/loop
> Run an iterative refinement loop until a quality threshold is met.
Best use case
/loop is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
> Run an iterative refinement loop until a quality threshold is met.
Teams using /loop should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/loop/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How /loop Compares
| Feature / Agent | /loop | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
> Run an iterative refinement loop until a quality threshold is met.
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
SKILL.md Source
# /loop > Run an iterative refinement loop until a quality threshold is met. ## Usage ``` /loop "<task>" --until "<condition>" [--max-iterations <n>] ``` ## What It Does Executes a task repeatedly, evaluating the output against a quality condition after each iteration. Continues refining until the condition is met or max iterations reached. Each iteration builds on the previous output. Useful for progressive improvement of content, code, or designs. ## Implementation 1. **Initial execution** -- run the task, produce first output. 2. **Evaluate** -- check output against the condition (quality score, test pass, criteria met). 3. **Refine** -- if condition not met, identify gaps and re-execute with improvements. 4. **Repeat** -- continue until condition met or max iterations (default: 5). 5. **Report** -- iteration log showing progression and final output. ## Examples ```bash # Refine until tests pass /loop "fix failing tests in auth module" --until "all tests pass" --max-iterations 3 # Refine content quality /loop "write pitch for AI Masters" --until "S/N score > 0.8" # Iterative optimization /loop "optimize query performance" --until "p99 < 200ms" --max-iterations 5 ```
Related Skills
reflection-loop
Self-correction via critique loop - 18.5 percentage point improvement
/do
> The agent's primary skill. Customize this to match your agent's purpose.
/report
> Generate structured reports. Director-owned.
/primary
> Main workflow execution and routing. Director-owned.
Qualify
## Command
Prospect
## Command
Close Plan
## Command
Battlecard
## Command
Spec
## Command
Schedule
## Command
Repurpose
## Command
Ideate
## Command