/spec:loopfrom spec
Goal-driven autonomous round loop. Give it a goal + acceptance checklist + round budget (touchpoint 1), then it researches, implements, self-checks, and retrospects round after round — driven by a Stop-event hook, not by prompt discipline — until the final acceptance audit (touchpoint 2, the loop's ONLY independent verification) passes every item, or a fuse blows (round cap / no-progress / refusal-to-retrospect). Use when the goal is known but the path is not; a known plan one-pass change belongs to /spec:workflow instead.
Ships in spec. Installing the plugin adds it to Claude Code.
Goal-driven autonomous iteration: research → implement → verify → retrospect per round, with a file ledger as cross-round memory and a Stop-event hook as the round driver. The HARD GATE moves up to the goal level — the user approves the goal/acceptance/budget once, then the loop runs unattended until final acceptance or a fuse.
Positioning: /spec:workflow = plan known, one pass, two touchpoints. /spec:loop = goal known, path unknown, N rounds, same two touchpoints. A bare self-feeding loop (ralph-style) = no acceptance checklist, no independent verification, no ledger — this command exists precisely to add those. Never run two loops at once (nor alongside another Stop-driven looper such as ralph-loop).
Ledger format authority: skills/core/references/loop-spec.md — loop.md structure, write ownership (loop.md model-only / .loop-state driver-only), field rules.
| Form | Behavior |
|---|---|
/spec:loop <goal> | cold start (below) |
/spec:loop | resume: a paused/fuse-stopped ledger exists → set status: running, re-bind the session (below — skipping this leaves the session guard silently ignoring every Stop from this session), continue from the latest Retrospect's plan |
/spec:loop stop | soft brake: set status: paused — the driver releases the next stop |
/spec:loop abandon | drop the direction: set status: aborted; archive later with /spec:archive abandoned |
Resume re-bind (the only .loop-state touch besides cold start — it rewrites the session_id line and preserves every counter):
awk -v s="${CLAUDE_CODE_SESSION_ID:-}" 'BEGIN{FS=OFS="="} $1=="session_id"{$2=s} 1' spec/changes/<name>/.loop-state > spec/changes/<name>/.loop-state.tmp && mv spec/changes/<name>/.loop-state.tmp spec/changes/<name>/.loop-state
running loop.md in this project → refuse (one loop at a time). Other active changes coexist fine — loop dirs without proposal.md are exempt from the gates' active count, and the current pointer keeps propose/apply targeting their own change while the loop runs.verify: clause (an executable check or observable behavior — "feels better" is not acceptance); confirm items AND their verify clauses with the userspec/changes/<kebab-name>/loop.md per loop-spec — frontmatter (status: running, max_rounds, no_progress_fuse: 3 — plain bare values, and the fuse must be >= 1), ## Acceptance (checkboxes live ONLY here), empty ## Rounds / ## Lessons.printf 'session_id=%s\nrounds_injected=0\nretro_reinjects=0\nchecked_history=\ntree_fp_history=\n' "${CLAUDE_CODE_SESSION_ID:-}" > spec/changes/<name>/.loop-state
Cold start and the resume re-bind above are the ONLY times anything other than the driver touches .loop-state.## Lessons. Then search the ledger and the codebase before assuming anything is unimplemented — re-implementing existing work is the classic fresh-context failure.#### Plan (what + why this one).skills/core/references/code-charter.md before the first keystroke of the run). Write #### Act (file-level).#### Verify. Check off Acceptance items your checks satisfy; a mid-loop checkmark is a claim that final acceptance will independently audit, so an honest miss costs one fix round while a dishonest check costs the same round plus the audit finding. Anti-Cheating applies in full (unrun ≠ success; a bypass must be declared a bypass).#### Retrospect = the lesson learned (durable/operational ones also appended to ## Lessons as L-N) + the next round's plan. Then end the turn — ending the turn is how the round ends.status: paused, and report to the user instead of burning rounds.The loop-driver Stop hook fires every time the turn ends and decides mechanically (see its header for the probe-verified contract): ledger integers valid? → round budget left? → all Acceptance checked (→ it injects the final acceptance turn)? → Retrospect written (missing → re-inject, ≤2)? → progress made (checkbox count / worktree fingerprint, no_progress_fuse consecutive stale rounds → fuse)? → otherwise it injects the next round. Four distinct stop notices tell the user WHICH way it ended: round cap / no progress / refusal-to-retrospect / ledger corrupt.
Implications:
status: paused (that IS the exit; say why in the Retrospect).When every Acceptance item is checked, the driver injects the final-acceptance turn: dispatch a fresh spec-verifier to independently re-verify EVERY Acceptance item against its verify: clause — mid-loop checkmarks are claims; this is the loop's ONLY independent audit, so it is exhaustive. The audit is iterative by design: items that fail get unchecked, the findings recorded in the current round, and the loop continues fixing (the driver re-arms automatically; each audit pass counts toward the round cap). Only when every item holds: report per-item results to the user and set status: done. Then /spec:archive closes the change (loop.md travels with it, .loop-state is deleted, durable Lessons feed the knowledge base (subdocs + index, per knowledge-spec.md)).
A fuse stop instead of acceptance → report the driver's notice verbatim, plus: what the ledger shows, what you would change (plan / acceptance list / budget), and wait — resuming is the user's call (/spec:loop).
/spec:workflow) or for pure understanding (that's exploration, no delivery)#### Verify (a bare claim wastes an audit round); checkboxes outside ## Acceptance; editing .loop-state (full list in loop-spec.md)/spec:ultrawork, /spec:ultraqa) inside loop rounds — rounds are self-run working checks by design; the stack belongs to /spec:apply and standalone use. In a loop, convergence is your own cheap checks plus the round's #### Verify, and the final acceptance audit is the only independent passWhat the command file sets; muted values are Claude Code's defaults
npx claudepluginhub effinrich/spec-stack --plugin spec21 commands in this plugin
/apply/spec:applyImplement the code, advancing by proposal/tasks. A pre-command hook checks that proposal.md carries the APPROVED marker. Verification model: cheap self-run working checks per node while implementing; ONE independent spec-verifier pass at the end (never dispatch verification subagents mid-implementation)/archive/spec:archiveArchives the current change to spec/archive/YYYY-MM-DD-<name>/. Only invoked when the user explicitly says "archive". Writes an archive-stage retrospect, mines the change for recurring lessons (fresh-context spec-reflector agent) and applies the ones the user selects to project skills / rules files, sediments the knowledge base, checks for uncommitted code, and is guarded by the check-archive hook./ask/spec:askInterrogates preference-driven decision points. Derives questions from the candidate sets research minted into each [TBD] (options are citations, not inventions), asks via AskUserQuestion (multiSelect for pick-several), and moves answered items to/chat/spec:chatDiscussion mode. Everything said during this mode is treated as thinking material only — no documents are touched. Use for brainstorming directions, or to talk through concerns about a proposal before deciding how to change it./design/spec:designTechnical design elaboration. Trigger on demand — use when the architecture is complex, there are more than 3 interfaces, sequence/data-flow diagrams are needed, or a decision requires more than 300 words of deep argumentation. Produces design.md./fix/spec:fixStreaming light tier for bug fixes and small changes (user-explicit only, never model-initiated). Appends F-N entries to today's daily batch under spec/changes/fixes/<date>/ — locate & confirm before touching code, fix directly when confident or research candidates when not, self-check evidence per entry; the ONE independent audit happens at /spec:ship.Other plugins' commands for the same job
7-day visitors to each command page