Compiles a goal into a durable, file-backed agent loop (.loop/<name>/) that any coding agent can execute unattended. Produces LOOP.md, state.json, and backlog.md for autonomous iteration.
Ships in claude-skills-library. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
You are compiling a loop, not writing a prompt. A prompt asks an agent to do something once; a loop is a durable program — goal, state, iteration discipline, verification, and exit conditions — stored in files so that any agent can pick it up cold, run exactly one iteration, and leave it resumable. The agent is the interpreter; the loop is the program. Design accordingly: everything that matters must survive a context wipe.
.loop/<name>/ contract (LOOP.md, state.json, backlog.md, signs.md, runs.jsonl), defining ratchet metrics, budgets, independent verifier gates, or stall/escalation triggers.Done-when predicate exists (fix verifiability first).Work through these six steps in order. Steps 1–3 are thinking; 4–6 emit files.
Interview the user (or the task description) until you can state:
Match against the taxonomy in references/archetypes.md (read it now). Summary:
| Archetype | Core mechanic | Terminates? |
|---|---|---|
| backlog-drain | pick top item → do → verify → strike through | yes — backlog empty |
| ratchet-climb | move one metric monotonically; revert regressions | yes — target reached |
| red-green | write failing test → make it pass → refactor | yes — spec covered |
| watch-and-report | read-only scan → diff vs last state → report | no — runs on cadence |
| evaluate-optimize | generate → judge against rubric → keep best → retry | yes — rubric satisfied |
| babysitter | poll external state (CI/PR) → kick until terminal | yes — merged/green |
| pipeline | stage N's output is stage N+1's input, each gated | yes — final gate passes |
Hybrids are normal (a backlog-drain whose verify step is a ratchet). Name the primary archetype in the charter — it tells the runner which discipline applies.
The single highest-leverage design decision — undersized units are the #1 divergence cause across every loop system studied. Think blast radius: files touched × duration per unit; many small bombs, never one big one. One iteration = one fresh-context agent session that must complete its unit and verify it inside the context "smart zone" (~40–60% utilization). Heuristics:
Create .loop/<name>/LOOP.md from references/loop-charter-template.md (read it, don't improvise the format — the runner and orchestrator parse these sections). The charter's load-bearing sections: Goal, Done-when, Archetype, Iteration contract, Verification (exact commands), Ratchet (metric + direction + regression policy), Guardrails, Escalation (stall definition + who to ping + how), Budget (max iterations / tokens / wall-clock).
.loop/<name>/state.json — from the schema in references/state-schema.md: {name, archetype, status: "designed", iteration: 0, ratchet: {...}, promotion: {mode: "propose-only", clean_cycles: 0, required_cycles: 3}, budget, last_run: null}..loop/<name>/backlog.md — prioritized checklist of units, each sized per step 3. For non-backlog archetypes, this holds the watch-list or rubric instead. The backlog is disposable: regenerating it from goal + current code costs one planning pass and is always cheaper than a loop going in circles against a stale plan. When building it, never assume something is unimplemented — verify by searching the code first..loop/<name>/signs.md — starts with any known failure patterns for this domain; the runner appends a "sign" after every observed failure (see the signs rule below)..loop/<name>/journal.md — created empty with just the header row; the runner appends.Run the checks in references/loop-doctor.md against what you just wrote (done-when checkable? verification commands actually runnable here? units sized? guardrails inherited?). Fix failures before handoff. Then tell the user exactly how to start it, e.g.:
/loop 30m run one iteration of .loop/<name> per the loop-runner skillwhile :; do codex exec "run one iteration of .loop/<name> per the loop-runner skill"; sleep 1800; done.loop/skill-hygiene-ratchet/Below is a complete, self-contained .loop/skill-hygiene-ratchet/ package (LOOP.md, state.json, and backlog.md) that runs cleanly in any sandbox without external dependencies:
.loop/skill-hygiene-ratchet/LOOP.md# Loop Charter: skill-hygiene-ratchet
- **Goal**: Bring all 30 flagship skills in `graph/skills.graph.json` to 100% deterministic and adversarial eval pass rate (`30/30 PASS`, `0` conflicts).
- **Done-when**: `node tools/eval-skills-suite.mjs && node tools/gen-skills-graph.mjs --check` exits `0` with `verdicts.FAIL === 0` and `verdicts.REVISE === 0`.
- **Archetype**: `backlog-drain` + `ratchet-climb`
- **Actor Model**:
- **Maker**: Single agent on branch `agent/<harness>/skill-hygiene` (max 1 skill per iteration).
- **Independent Verifier**: Separate harness running `node tools/eval-skills-suite.mjs` in read-only mode.
- **Human Gate**: Frank approves any public catalog release or pricing/spend action.
- **Verification**:
- Primary: `node tools/eval-skills-suite.mjs`
- Fallback: `node tools/gen-skills-graph.mjs --check`
- **Ratchet**:
- Metric: `counts.verdicts.PASS` (monotonic non-decreasing, target `30`).
- Regression Policy: `git checkout -- <touched-files>` immediately if `PASS` count drops or planted-fault recall falls below `90/90`.
- **Guardrails (Never-Do)**:
- Never delete or weaken tests, rubric checks, or planted-fault probes to make a skill pass.
- Never push directly to `main` or modify files outside `free-skills/*/SKILL.md`.
- **Budgets**: `max_iterations: 10`, `max_elapsed_minutes: 120`, `no_progress_stop: 3`, `max_spend_usd: 0`.
- **Escalation**: After 3 consecutive iterations with `delta_pass === 0`, set `status: "stalled"` in `state.json` and emit a blocker report.
.loop/skill-hygiene-ratchet/state.json{
"name": "skill-hygiene-ratchet",
"archetype": "ratchet-climb",
"status": "designed",
"iteration": 0,
"ratchet": {
"metric": "counts.verdicts.PASS",
"direction": "up",
"baseline": 22,
"current": 22,
"target": 30
},
"promotion": {
"mode": "propose-only",
"clean_cycles": 0,
"required_cycles": 3
},
"budget": {
"max_iterations": 10,
"max_elapsed_minutes": 120,
"no_progress_stop": 3,
"max_spend_usd": 0
},
"last_run": null
}
.loop/skill-hygiene-ratchet/backlog.md# Backlog: skill-hygiene-ratchet
- [ ] Unit 1: Fix unguarded `$<digit>` token at line 72 of `free-skills/book-publishing/SKILL.md`
- [ ] Unit 2: Fix unguarded `$<digit>` tokens across lines 264, 505–532 of `free-skills/social-media-strategy/SKILL.md`
- [ ] Unit 3: Upgrade `free-skills/hooks-automation/SKILL.md` to native `.claude/settings.json` hooks
stalled, escalate per charter. A loop that spins without progress is worse than a stopped loop.LOOP_OK, suppressed from the channel") and cap proactive reports (~3–5/day); "check whether X failed" is a valid watch item, "keep an eye on things" is not.signs.md so that exact failure cannot recur ("SLIDE DOWN, DON'T JUMP"). Signs are written reactively from observed failures, never speculatively; prune signs that newer models make obsolete. This accumulation layer is what makes a loop converge over weeks instead of circling.Done-when: Every LOOP.md must specify an exact shell command that returns exit code 0 when done and non-zero otherwise.LOOP.md explicitly names one Maker, one Independent Verifier, and the Human Gate.state.json and LOOP.md declare max_iterations, max_elapsed_minutes, no_progress_stop, and max_spend_usd.Guardrails.references/archetypes.md — full taxonomy with worked examples, failure modes, and the signs meta-layer.references/loop-charter-template.md — the LOOP.md template (parse-stable section names).references/state-schema.md — state.json schema + journal.md and signs.md formats.references/loop-doctor.md — pre-flight checklist the designer runs before handoff.references/loop-native-skills.md — how skills and loops compose; guidance for skill-creator/plugin-creator authors.references/loop-canon.md — the source lineages (Huntley/Ralph, Steinberger, Cherny, Anthropic harnesses, 12-factor), where they agree, and the disagreements this family resolved.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
agent-loop, autonomous-agent, recurring-task, file-backed-loop
/claude-skills-library:loop-designerfrom claude-skills-library
npx claudepluginhub frankxai/claude-skills-library --plugin claude-skills-library116 skills in this plugin
/acos-metaACOS self-description and configuration skill. Documents how ACOS works, how to extend it, how to add new skills/commands/agents, and how to debug the hook system. Use when building new ACOS capabilities, understanding the system architecture, or onboarding to ACOS for the first time./acos-visual-genGenerate research-grounded visuals using the InfoGenius pipeline. Use when creating infographics, diagrams, educational visuals, or any image that benefits from factual accuracy. Supports 8 visual styles (3D, technical, minimalist, photorealistic, futuristic, vintage, cartoon, standard) and 4 audience levels./agent-hygieneThe quality bar for any agent working on agent definitions, skills, commands, hooks, AGENTS.md or CLAUDE.md, in any repo and any harness. Use at session start, before editing a file under .claude/agents, agents/, .claude/commands or any SKILL.md, before handing work back, and whenever choosing which model tier (Haiku, Sonnet, Opus, Fable) or effort level a task deserves. Carries the estate guardrails, the agent-file contract the linter enforces, the verification line every hand-back ends with, and the routing rule for spending the top tier.Other plugins' skills for the same job