
AI Loop
FreeStreamline your development process with structured feedback loops.
Free · Opens the source repo
What AI Loop does
The ai-loop skill provides a structured framework for managing the development lifecycle of software features, ensuring that each phase is well-defined and executed with clarity. By breaking the process into three distinct phases—Specification, Implementation, and Review—this skill allows agents to focus on delivering scoped code changes while maintaining rigorous control over requirements and quality assurance. This approach is particularly beneficial for developers and designers who need to manage complex tasks with clear boundaries and success criteria.
In the Specification phase, the agent engages with the user to gather detailed requirements, constraints, and expectations for the feature being developed. This ensures that all necessary information is captured before any coding begins, allowing for a clear and actionable specification document to be created. This document serves as a reference point throughout the development process, guiding the implementation and review phases.
During the Implementation phase, the agent strictly adheres to the specifications outlined in the previous phase. This focus on fulfilling the exact requirements prevents scope creep and ensures that the final product aligns with user expectations. The agent is instructed not to introduce any additional features or modifications that were not explicitly outlined in the spec, thereby maintaining a disciplined approach to development.
Finally, the Review phase involves a thorough verification of the implementation against the specification. The agent systematically checks each requirement to confirm that it has been met, documenting any gaps or issues that arise. If necessary, the agent can loop back to the Build phase to address these issues, ensuring that the final output is fully compliant with the original requirements. This skill is ideal for isolated tasks or features with clear boundaries, making it a valuable tool for developers looking to enhance their workflow efficiency while minimizing risks associated with ambiguous requirements.
When to use it
Use this skill when you need to develop a feature from scratch or make significant modifications, ensuring that the process is well-defined and controlled.
When not to use it
This skill is not suitable for open-ended projects or tasks that require extensive architectural changes without clear specifications.
What you can build with it
Building a New Feature
When tasked with creating a new feature, the AI Loop skill guides the agent through a structured process to ensure all requirements are met.
Modifying Existing Code
For significant modifications to existing code, the skill helps maintain focus on the specified changes without introducing unintended alterations.
Ensuring Compliance with Specifications
When compliance with user specifications is critical, the AI Loop skill provides a rigorous framework for verification and validation.
How to install AI Loop
View source1. Install with the skills CLI
npx skills add sickn33/agentic-awesome-skills/ai-loop --agent claude-code2. Or install it manually
Download the skill folder and drop it into ~/.claude/skills/ for all projects, or .claude/skills/ to scope it to one repo. Restart Claude Code so it picks up the new skill.
Anthropic's agentic coding CLI, and the reference implementation of Agent Skills. Drop a skill folder into ~/.claude/skills and Claude Code loads it automatically whenever a task matches the skill's description. Claude Code docs
Inside SKILL.md
Written by sickn33AI-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)
- Interview the user about the feature or app they want to build. Ask one focused question at a time until you fully understand the goal, the must-have requirements, the constraints, and what "done" looks like.
- Do not start building yet.
- When you have enough information, write a clear, detailed specification and save it to
specs/<feature-name>.md. - 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.
- Stop and ask for human input when the next fix would change the spec, exceed the iteration budget, require risky operations, or depend on product decisions not captured in the spec.
- 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
- Requirement: non-numbers are ignored -> FAIL (I noticed
modedoesn't filter out non-numbers).I will now loop back to Phase 2 to fix the
modefunction.
Agent (Phase 2 - Build Loop-Back):
(Fixes
modeto filter out non-numbers) I have updated the implementation. Let's re-verify.
Agent (Phase 3 - Review):
- Requirement: mode filters non-numbers -> PASS
All requirements passed! The statistics calculator is complete and verified.
Best Practices
- ✅ Do ask clarifying questions one at a time to avoid overwhelming the user during the planning phase.
- ✅ Do document edge cases explicitly in
specs/<feature-name>.mdbefore writing any code. - ✅ Do stick strictly to the approved specification during the build phase.
- ✅ Do cap the loop with a small iteration budget and report exactly what remains if the budget is exhausted.
- ✅ Do pause for explicit approval before destructive, production, credentialed, or externally visible actions.
- ❌ Don't implement extra features or perform unrelated refactorings that aren't specified.
- ❌ Don't skip the review phase or pass it without verifying every single requirement.
- ❌ Don't keep retrying the same failing fix without new evidence or a changed approach.
Limitations
- This skill requires sufficient context about the feature to be provided during the Spec phase.
- It is best suited for isolated features or tasks with clear boundaries, rather than open-ended architectural refactoring.
- The review phase relies on the agent's self-assessment against the generated spec; manual review is still recommended for critical systems.
- It is not a replacement for human approval on security-sensitive, destructive, production, compliance, or externally visible changes.
- It should stop rather than continue if requirements conflict, tests cannot run, or verification depends on unavailable credentials or systems.
Security & Safety Notes
- Be cautious when running or testing code generated during the Build phase. Always run tests in a safe, sandboxed environment.
- Avoid executing arbitrary shell commands provided directly by the user without validating their safety.
- Make sure no hardcoded secrets, keys, or credentials are added to the code or specifications.
- Treat production deploys, data migrations, payment flows, credential changes, and external write actions as approval-gated work.
Common Pitfalls
- Problem: The agent tries to build a huge system all at once, leading to an overcomplicated spec and incomplete implementation.
Solution: Keep the scope of
ai-loopto small, modular features. Break larger systems into multiple independent loops. - Problem: The spec is vague, causing the build phase to rely on assumptions. Solution: Spend extra time in the planning phase asking targeted questions to pin down requirements.
Related Skills
@plan-writing- For writing more detailed implementation plans for larger projects.@ask-questions-if-underspecified- For standard guidelines on interviewing the user.
Frequently asked questions about AI Loop
Similar skills
Rhino 3D Scripting
Streamline your Rhinoceros 3D scripting tasks.
MVVM Toolkit
Streamline ViewModel development with source generators.
FreeCAD Scripts
Generate Python scripts for FreeCAD automation and modeling.
Azure Architecture Builder
Design and deploy Azure infrastructure using natural language.
Command Development
Streamline your command creation for Claude Code.
Create Cowork Plugin
Easily build and package plugins through guided sessions.
