ai-loop
它能做什么
这个工具把编程工作拆分成几个清晰的步骤:规划(spec)、构建和审查。它能确保 AI 准确遵循你的指令,在每个阶段检查自己的工作,并在涉及重要操作时征求你的同意。
适用场景
- ✓当你希望 AI 按照计划,从零开始创建一个新东西时。
- ✓当工作需要拆分成更小的部分,并且有明确规则时。
- ✓当你希望 AI 在交付前先检查自己的工作时。
技能链接
https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/ai-loop/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“我想创建一个 Python 函数,用来计算一组数字的平均值。这个函数应该忽略非数字的值,如果列表为空,则返回 0。”
每周 5 个新技能,1 分钟读完。
工作原理
AI 会先理解你的需求(也就是规格说明,即 specification)。然后,它会按照这份规格说明编写代码。最后,它会审查代码,看看是否一切正确,必要时会重复这个过程。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
AI-Loop Skill
Overview
The ai-loop skill structures a bounded development cycle for agentic workflows. By dividing the process into distinct planning (Spec), implementation (Build), and validation (Review) phases, it helps an agent build and correct scoped code changes while keeping requirements, risk gates, and stop conditions explicit.
When to Use This Skill
- Use when you need a feature built from scratch or heavily modified, and you want the agent to handle the lifecycle (specification, implementation, and verification) inside one clearly bounded workflow.
- Use when working with isolated components, modules, or features that have well-defined scopes and constraints.
- Use when the user asks for a complete development pass but the work still has clear success criteria, a reasonable verification path, and no unresolved safety or product decisions.
How It Works
This skill executes a controlled development loop composed of three phases: Spec, Build, and Review. When invoked, the agent moves through those phases until the scoped requirements pass verification, a stop condition is reached, or human approval is needed.
Before starting, define:
- The maximum number of build-review iterations.
- The verification commands or manual checks that count as evidence.
- The actions that require explicit approval, such as destructive commands, production changes, external service writes, or broad architectural pivots.
Phase 1: Spec (Planning)
- Reuse the current request, accepted plan and existing artifacts. Ask only for essential missing scope or acceptance criteria; do not repeat answered questions.
- Do not start building yet.
- When you have enough information, use the existing specification or, when needed, save a scoped new one at
specs/<feature-name>.mdwithout overwriting user work. - The spec must include:
- The objective
- The exact requirements
- Edge cases to handle
- A concrete definition of done that someone could check the build against
- The iteration budget, verification commands, and approval gates.
Phase 2: Build (Implementation)
- Read the spec you just created in
specs/<feature-name>.md. - Build exactly what it describes.
- Do not add features, do not refactor unrelated code, and do not invent requirements that aren't in the spec.
- Focus strictly on fulfilling the spec. List which spec requirements you covered so the review step can check them.
Phase 3: Review (Verification)
- Compare your implementation against
specs/<feature-name>.md. - Go requirement by requirement and verify if it was met. List every gap, bug, or missing piece, naming the exact spec item each one fails.
- If anything fails and the iteration budget is not exhausted, write the specific fixes needed and loop back to Phase 2 (Build) to address them.
- Use the agreed iteration/resource limits and scope. Ask for material product or consequential authorization decisions that are not already resolved; routine repairs within the accepted outcome need no new checkpoint. Continue independent work when a dependent check is unavailable.
- Only pass the build and conclude the skill execution when every requirement in the spec is fully met and the declared verification evidence has passed.
Examples
Example 1: Creating a Basic Statistics Helper
User:
I want to add a utility for calculating basic statistics (mean, median, mode) of an array of numbers.
Agent (Phase 1 - Spec):
I can help with that. To get started, what programming language should this statistics calculator be implemented in? Also, how should empty arrays or invalid inputs be handled?
User:
JavaScript. If the array is empty, return null. If there are non-numbers, ignore them.
Agent (Phase 1 - Spec):
Thank you. I have created the specification file at
specs/stats-calculator.mdwith the requirements we discussed. Now, I will start implementing it.
Agent (Phase 2 - Build):
(Creates
stats_calculator.jsand implementsmean,median, andmodematching the spec exactly) I have finished implementing the calculator. I will now verify the implementation.
Agent (Phase 3 - Review):
Checking implementation against
specs/stats-calculator.md:
- Requirement: mean calculation -> PASS
- Requirement: median calculation -> PASS
- Requirement: mode calculation -> PASS
- Requirement: empty array returns null -> PASS
…
常见问题
什么是“审批关卡”(approval gates)?
这是指 AI 在做某些有风险的操作前会停下来,征求你的许可,比如修改核心代码或删除数据。
如果 AI 无法完成工作怎么办?
它会告诉你还缺少什么、为什么无法完成,并遵守你设置的限制(比如尝试次数上限)。
AI 能编写任何类型的代码吗?
它最适合定义清晰、相对独立的任务。对于规模很大或会影响系统多个部分的改动,它可能不是最合适的工具。
详情
作者的原始描述
Runs a bounded spec-build-review development loop with explicit scope, stop conditions, and human approval gates for risky or ambiguous work.
热度
- GitHub 星标
- 48k
- 排名
- #3709
- 许可证
- MIT
- 更新时间
- 2026/10/15
评论
- …
同一仓库的更多技能
00-andruia-consultant
48k帮你的智能体启动或改进 AI 项目。它可以分析代码、推荐工具,并用西班牙语制定行动计划。
007
48k让你的智能体执行安全审计和威胁建模。它有助于保护项目免受攻击和漏洞的威胁。
10-andruia-skill-smith
48k帮你的智能体创建或改进 AI 工具。它可以定义工具的工作方式、编写文档,并验证其结构。
20-andruia-niche-intelligence
48k让你的智能体创建某个特定行业的摘要。它有助于借助可靠的信息来源,了解项目的背景、规则、使用模式和风险。