loop
Skill2 starsChanged 33 days agoMITView on GitHub
Use when the user wants to design, scaffold, or choose an agentic LOOP that repeats one task until a check passes — iterate-until-green automation, a long-running unattended build, or picking which loop engine fits — landing as a written `.context/loops/` loop-spec (goal + verifiable stop condition + guardrails + chosen engine) before the loop runs. Fires on "design a loop for X", "set up a loop to keep building until tests pass", "make a loop that iterates until green", "loop until the build is clean", "which loop should I use". Not for: one-shot multi-agent fan-out across N different targets, which repeats nothing (/aidex:workflow); executing an existing loop right now (hand off to the ralph-loop plugin, /loop, or /goal); one-off tasks with no stop condition; planning multi-step work without a loop (/aidex:plan); ecosystem audits (/aidex:aidex); project-state audits (/aidex:audit).
55 other projects use a version of this.
Adopted by
Most recently taken up by
- Eclipter/agentstheir own version, first seen Nov 8, 2026
- SethGammon/Citadeltheir own version, first seen Nov 4, 2026
- drevendev/HungryCrabtheir own version, first seen Nov 1, 2026
- Railly/skillstheir own version, first seen Nov 1, 2026
- HeshamFS/swarmweavertheir own version, first seen Nov 1, 2026
- jtaroreh/agystacktheir own version, first seen Oct 29, 2026
Used with
Projects with it also use review-bugbot, origin and 10 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
0mlkrizzz655335vSkillreview-bugbot
缺陷导向代码审查。用 Bugbot 子代理找 bug。
Also in 4 projects that use this
0mlkrizzz655335vSkillorigin
origin CLI 管理。安装、登录、更新、修复 origin.cursor.com 的 CLI。"disabled-environments:
Also in 3 projects that use this
PandelisZSkillupdate-cli-config
View and modify Cursor CLI configuration settings in ~/.cursor/cli-config.json. Use when the user wants to change CLI settings, configure permissions, switch approval mode, enable vim mode, toggle display options, configure sandbox, or manage any CLI preferences.
Also in 4 projects that use this
32103210Skillmigrate-to-skills
Convert 'Applied intelligently' Cursor rules (.cursor/rules/*.mdc) and slash commands (.cursor/commands/*.md) to Agent Skills format (.cursor/skills/). Use when you want to migrate rules or commands to skills, convert .mdc rules to SKILL.md format, or consolidate commands into the skills directory.
Also in 4 projects that use this
32103210Skillupdate-cursor-settings
Modify Cursor/VSCode user settings in settings.json. Use when you want to change editor settings, preferences, configuration, themes, font size, tab size, format on save, auto save, keybindings, or any settings.json values.
Also in 4 projects that use this
MicrosoftSkillautomate
Propose an automation from a completed task or a new idea, then create it after approval. Use when the user asks to create an automation or wants scheduled local or cloud agent work.
Also in 4 projects that use this
- +3 more from 0mlkrizzz655335v
- +1 more from 32103210
Other versions55 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 55
- SethGammon/Citadel★ 927same name
- breezewish/CodexPotter★ 629same name
- jtaroreh/agystack★ 128same name
- dannys-code-corner/incan★ 73same name
- ww-w-ai/bkit-gemini★ 66same name
- IsuruMaduranga/one-code★ 50same name
- unclejobs-ai/second-claude-code★ 41same name
- BULDEE/ai-craftsman-superpowers★ 35same name
- Hassaan146/claude-skills★ 18same name
- woxiangyangzhimao/skills★ 14same name
45 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository21 other files it gives its agents.
The file
We split this skill into the rules it gives an agent
5 rules. 0 are common, 2 are distinctive, and 3 are very specific to this project.
0
Common
Most of the 50 edited versions we read keep these.
2
Distinctive
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 52
no args → list specs (ls .context/loops/*.md) and show this help
- Distinctive: line 60
Do not skip step 0 or step 1 — they decide whether a loop is even appropriate.
- Very specific: line 107
Scaffold: Run new-loop-spec.sh new <slug>, then fill every section of the generated spec from the answers.
- Distinctive: line 123
Only execute it if the user explicitly asks you to start the loop now.
- Very specific: line 162
If the project carries a ratchet baseline (.context/.validate-baseline.json), a non-zero exit means you introduced a NEW violation — fix it …
“Common” is measured: kept by at least 6 in 10 of the 50 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Loop — Design Agentic Loops
Help the user design and specify an agentic loop before running it, capture it
as a .context/loops/ loop-spec, then hand off execution to an existing
engine. This skill does not implement a loop runner — three mature engines
already exist (/goal, /loop, the ralph-loop plugin) plus headless
claude -p. The value here is the decision, the spec, and the guardrails.
See references/01-loop-engines.md for the engine matrix and guardrails, and references/02-loop-spec-conventions.md for the artifact format.
Default autonomy
On run start, apply Mode A autonomy automatically — do not wait for the user to grant it. Questions live in the initial alignment moment only; after that the run proceeds start-to-finish per the shared canon (deny/pre-authorized/mandated/autonomous). See "Run doctrine" below for how this applies once a loop is running.
Sub-actions
Dispatch by first argument:
| Command | Backed by | Purpose |
/aidex:loop | — | Show help + list existing .context/loops/ specs |
/aidex:loop design [slug] | model + new-loop-spec.sh | Interactive: run the loop-suitability questions, pick an engine, then scaffold the spec |
/aidex:loop new <slug> | scripts/new-loop-spec.sh | Scaffold an empty loop-spec file (skip the interview) |
/aidex:loop run <slug> | model | Read a finished spec and emit/execute the chosen engine's command |
Dispatch logic
bash "${CLAUDE_SKILL_DIR}/scripts/new-loop-spec.sh" "$@"new <slug>→new-loop-spec.sh new <slug>design [slug]→ run the interview below, thennew-loop-spec.sh new <slug>and fill it inrun <slug>→ no script; read the spec and follow run below- no args → list specs (
ls .context/loops/*.md) and show this help
design — the interview
Borrow the Socratic, one-question-at-a-time style. Walk the user through references/01-loop-engines.md §"Adoption steps". Do not skip step 0 or step 1 — they decide whether a loop is even appropriate.
No interactive channel (claude -p, cron): do not attempt the interview — take each
step's recommended default and record the defaulting in the loop-spec. Steps 0 and 1 are
the exception: a loop with no verifiable gate has no defensible default, so say so in the
spec and stop rather than guess one.
autonomy-conventions.md § When there is no interactive channel.
- Loop-suitability (step 0). Is there a check the machine can run to say pass/fail? If no verifiable gate exists, stop: this is interactive work, not a loop. Say so plainly.
- The gate (step 1). What is the verifiable stop condition? (tests pass /
exit 0 / type-check clean / lint clean / screenshot diff / a verifier
subagent). Pin it down concretely — this becomes the spec's stop condition.
A per-iteration "tests pass" means the SELECTED suite, never the full one
(
affected-tests.sh --command): a loop pays its stop condition on every iteration, so a full suite there is the largest repeated cost a loop can carry. The full suite belongs once, at the loop's end, which is its integration boundary (decision/2026-08-24-full-suite-gate-moves-from-commit-to-integration). - Shape. Greenfield or existing code? One task or many? Must it run with the machine off? Budget ceiling?
- Engine. First cut: ask what the user is handing off — the verification
check, the stop condition, the trigger, or the whole prompt (see the
reference §"First cut"). Then use the decision matrix to pick:
/goal·/loop·ralph-loop·claude -pwhile-loop · Routines (/schedule) · Channels · Workflow — or, for proactive loops, a composed stack (/schedule+/goal+ Workflow) recorded asengine: routine+goal+workflow. Recommend one, name the runner-up, say why. - Autonomy surface (step 1.5). Resolve the permission borders so the loop runs
unattended. Walk references/01-loop-engines.md
§"Step 1.5". Use Claude Code's native
allow/ask/deny— do NOT enumerate an allowlist. Pin three things: (a) any loop-specific deny beyond the base destructive config; (b) the pre-authorized ops that may run without asking; (c) the always-ask set (defaults: push/publish/deploy/release, plus integrating a branch into the trunk — merging the trunk INTO the loop's branch stays autonomous; NOT commit, deps, or additive migrations, which are autonomous; a destructive migration stays gated). Everything else safe + additive is autonomous: proceed, verify the assumption, log it. This is the lever that stops the loop from interrupting the user. (ADRdecision/2026-06-19-loop-autonomy-surface-native-permissions.md.) - Isolation surface. Decide whether the loop needs its own git worktree so it does
not trample your other work or shared state. Check whether
.context/worktrees/00-index.mdexists in the target project: if not, invokeworktree bootstrapfirst. Then record the worktree command (worktree.sh new <slug> --branch <branch>; a loop that runs migrations or mutates the DB unattended is the strongest case for the full stack, never--no-infra) in the spec's Guardrails → isolation line exactly as today. Entry stays opt-in (user / project CLAUDE.md authorizes). - Scaffold. Run
new-loop-spec.sh new <slug>, then fill every section of the generated spec from the answers. Leave nothing as a placeholder. If a spec with that slug already exists (new-loop-spec.shrefuses to overwrite), refine the existing spec in place from the interview answers instead of re-scaffolding.
run
- Read
.context/loops/<date>-<slug>.md. - Confirm the stop condition and guardrails are still accurate.
- Emit the engine command from the spec's Run command field. Do not invent a
new loop — dispatch to the chosen engine:
goal→/goal "<condition> … or stop after N turns"loop→/loop <interval> <prompt-or-command>ralph→/ralph-loop "<prompt>" --completion-promise "DONE" --max-iterations Nclaude-p→ thewhileone-liner overclaude -pwith scoped--allowedToolsroutine→/schedule …
- Only execute it if the user explicitly asks you to start the loop now; otherwise print the command for them to run.
Run doctrine — autonomy during the run
Once a spec's Autonomy surface is declared, the loop runs to its stop condition or turn cap without interrupting the user:
- Do not pause for anything outside the declared ask-set. Routine, safe, additive work proceeds — including an unforeseen, non-breaking architectural micro-decision that falls under your authorship.
- Pause only for the deny set (blocked outright) and the ask set (push/publish/deploy/release, merging the loop's branch into the trunk — not the trunk into the branch — plus any the spec declared). Commit, deps, and additive migrations are not in the ask-set — outward publication and trunk integration are.
- Proceed + log, don't halt: on a safe additive decision, the burden is to verify the assumption is correct (investigate, don't guess) and surface or log what you decided — not to stop. You may investigate, read the DB, and take a backup without asking when it gives confidence to continue.
- Ambiguous consent point not in the declared ask-set → decide it yourself, do not
deadlock. Judge CONTINUE / ASK / STOP against the policy in the ARBITER block of
workflow-core.md, using the spec's
autonomy surface + proof; batch any
ASKto the end. If the policy does not settle it, apply the rule above and proceed — never block on it.model-policy: per-stage: every subagent this skill launches pins its own model and effort rather than inheriting the run's.
This is the loop's instance of the shared autonomy canon — full decision rule, the
commit-is-not-gated policy, and the arbiter policy in
autonomy-conventions.md.
Self-check
Validate the artifact you just wrote and fix any violation before closing:
python3 ${CLAUDE_PLUGIN_ROOT}/skills/conventions/scripts/validate.py --type loopsIf the project carries a ratchet baseline (.context/.validate-baseline.json),
a non-zero exit means you introduced a NEW violation — fix it before closing.
Boundaries
| The user wants to… | Route to |
| Actually run a Ralph loop right now | ralph-loop plugin (/ralph-loop) |
| Run a prompt on a recurring interval | native /loop |
| "Work until this condition holds" in-session | native /goal |
| Fan out N agents over N different targets in one shot (repeats nothing) | workflow |
| Plan multi-step work (no loop) | plan |
| Record a decision / ADR | decision |
| Investigate how something works | research |
| Audit the Claude Code ecosystem | aidex |
| Audit project state (UX/security/perf) | audit |
| A one-off task with no stop condition | (just do the work) |
Related
- ralph-loop (plugin) — one of the
runtargets; loop scaffolds the methodology (specs, back pressure, disposable plan) the plugin does not ship. - plan — for multi-phase work that is not a loop.
- conventions — owns the shared
.context/documentation canon.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

