From spiral
Five-phase adversarial development loop (design → plan → architect → implement → evaluate) that re-enters until the evaluator flags GREEN. For features where the bar is "insane quality", not "ship it". Use when the user explicitly invokes /spiral or asks for a multi-pass spiral build.
How this skill is triggered — by the user, by Claude, or both
Slash command
/spiral:spiralThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
You orchestrate five sub-agents per iteration. The loop repeats until the **Evaluator** returns `VERDICT: GREEN`, capped at 4 iterations. Every phase writes ONE markdown file to `.spiral/<feature>/iter-N/`. The orchestrator's context stays tiny because sub-agents only return a one-line receipt; the substantive output lives in files.
You orchestrate five sub-agents per iteration. The loop repeats until the Evaluator returns VERDICT: GREEN, capped at 4 iterations. Every phase writes ONE markdown file to .spiral/<feature>/iter-N/. The orchestrator's context stays tiny because sub-agents only return a one-line receipt; the substantive output lives in files.
These exist because the previous version of this skill stalled on background agents.
run_in_background. Foreground agents always return a result; background agents rely on completion notifications that can hang or get lost. We trade a few seconds of orchestrator wait time for determinism.<path>. Reply with ONLY the verdict line plus a 1-sentence summary." The orchestrator NEVER reads the full output back into context — it reads at most the last 2 lines of a file when it needs to make a control-flow decision..spiral/<feature>/iter-N/*.md. Sub-agents read the files they need; the orchestrator just passes paths.ScheduleWakeup, no Monitor, no polling. After Phase 5, read the verdict, branch.isolation: "worktree" so a failed iteration can't leave the main tree broken. The worktree path is recorded; if the iteration ends GREEN, the orchestrator surfaces the worktree path so the user can merge.TaskCreate one task per phase per iteration; mark complete as they finish. mark_chapter once per iteration. The user can see exactly where the spiral is at any moment without you having to summarize./spiral <feature> or "spiral on …".Do NOT use for: single-component polish, copy fixes, bug triage, refactors. Those have their own skills.
/spiral <feature-slug> [brief sentence]
If slug missing, ask once via AskUserQuestion. Slug becomes .spiral/<feature-slug>/. Brief is one sentence of intent — write it to .spiral/<feature-slug>/brief.md and never touch it again.
.spiral/<feature-slug>/
brief.md
iter-1/
01-design.md
02-plan.md
03-architecture.md
04-implementation.md ← includes "Worktree: <path>" line
05-evaluation.md ← ends with VERDICT: GREEN | RED
screenshots/
iter-2/ (only if iter-1 RED)
...
| Phase | Model | Why |
|---|---|---|
| 1 Design | opus | Creative UX synthesis, deep |
| 2 Plan | sonnet | Structured decomposition, cheap |
| 3 Architect | opus | High-stakes, irreversible decisions |
| 4 Implementation | sonnet | Volume work, parallel children |
| 5 Evaluator | opus | Adversarial depth, blind-spot hunting |
Pass model: to the Agent tool to lock the tier. The orchestrator stays on whatever model the user invoked.
Inside ONE conversation turn (or a small number of turns the user is happy to leave running), do this:
1. Setup
- Resolve slug, write brief.md, mkdir .spiral/<slug>/iter-1/
- TaskCreate: one task per phase × expected iterations (start with 5 tasks for iter-1)
- mark_chapter("Spiral iter-1: <slug>")
2. For iteration N in 1..4:
- Run Phase 1 (foreground Agent, opus). Wait for ≤80-word receipt.
- TaskUpdate phase 1 → completed; phase 2 → in_progress
- Run Phase 2 (foreground Agent, sonnet). If reply contains "DESIGN-GAP", goto Phase 1 of same iter once with the gap appended.
- TaskUpdate phase 2 → completed; phase 3 → in_progress
- Run Phase 3 (foreground Agent, opus).
- TaskUpdate phase 3 → completed; phase 4 → in_progress
- Run Phase 4 (foreground Agent, sonnet, isolation: "worktree"). Receipt includes worktree path + branch.
- TaskUpdate phase 4 → completed; phase 5 → in_progress
- Run Phase 5 (foreground Agent, opus). Receipt is just the VERDICT line.
- TaskUpdate phase 5 → completed.
- If receipt contains "VERDICT: GREEN":
- Surface 3-bullet summary + worktree path to user. STOP.
- Else (RED):
- mkdir iter-(N+1)/; TaskCreate 5 more tasks; mark_chapter("Spiral iter-(N+1)")
- Continue loop.
3. If loop exits without GREEN (4 iterations RED):
- Read just the score lines from each iter-N/05-evaluation.md (one grep, not full read).
- Surface trend to user: which axes are stuck? Ask whether to keep iterating, pivot, or ship.
The orchestrator NEVER reads a sub-agent's full output. It either reads the agent's receipt text directly, or runs tail -n 5 .spiral/<slug>/iter-N/05-evaluation.md to grab the verdict.
Every phase's Agent call follows this shape — copy and fill in:
Role: <one sentence>.
Read in this order:
1. <path>
2. <path>
[3. Prior iter-(N-1)/05-evaluation.md — treat findings as REQUIRED corrections]
Write your output to <output-path>. Cap: <N> words.
Required sections (in order):
- ...
Output rubric:
- Be specific. Cite file:line for non-obvious claims.
- No filler ("delightful", "seamless", "modern").
When done, reply with ONLY:
- A 1-sentence summary
- The literal line `WROTE: <output-path>`
[- For Phase 5 also: the literal line `VERDICT: GREEN` or `VERDICT: RED`]
Do NOT include the file's contents in your reply.
That last rule is the load-bearing one. It keeps your context from blowing up.
Role: senior product designer + UX researcher.
Reads: brief.md, prior iter-(N-1)/05-evaluation.md if exists, CLAUDE.md, the closest existing screen (orchestrator names the path).
Writes iter-N/01-design.md (≤ 1500 words):
Role: tech lead doing work-wave decomposition.
Reads: iter-N/01-design.md, prior eval if exists, repo layout from CLAUDE.md.
Writes iter-N/02-plan.md (≤ 1000 words):
DESIGN-GAP: <what> at the top and reply with that line. Orchestrator re-runs Phase 1 with the gap appended (max one redo per iteration).Role: principal engineer choosing patterns for production-grade code.
Reads: iter-N/01-design.md, iter-N/02-plan.md, prior eval, CLAUDE.md, files named in plan's surface inventory.
Writes iter-N/03-architecture.md (≤ 1500 words):
Role: implementation lead. May spawn its own parallel children for independent waves.
Agent call MUST pass isolation: "worktree". The worktree path + branch come back in the agent's result message — capture them and write them into the receipt header.
Reads (this agent and its children): iter-N/02-plan.md, iter-N/03-architecture.md, CLAUDE.md, source files named in plan.
Per wave:
cd <pkg> && pnpm exec tsc --noEmit). Fix RED before moving on. Never --no-verify.Writes iter-N/04-implementation.md (≤ 800 words):
Worktree: <absolute path> and Branch: <branch-name> on the first two lines[x] checklist)git diff --stat HEAD outputNever commits. Leaves changes in the worktree.
Role: adversarial critic + QA engineer. Defaults to RED unless evidence proves GREEN.
Reads: iter-N/01-design.md … iter-N/04-implementation.md, source diffs in the worktree, prior iter-(N-1)/05-evaluation.md if exists (verify previously-flagged issues are resolved).
Required actions:
04-implementation.md./run skill or repo's documented command)..spiral/<feature>/iter-N/screenshots/.tests/e2e/specs/. Run pnpm test:e2e.Writes iter-N/05-evaluation.md (≤ 2000 words):
file:line + what's wrong + what GREEN looks like)VERDICT: GREEN or VERDICT: REDGREEN requires: all four axes ≥ 7, zero blockers, Playwright suite green, AI-slop watch empty. Anything less is RED.
Reply to orchestrator with ONLY:
WROTE: .spiral/<slug>/iter-N/05-evaluation.mdVERDICT: GREEN or VERDICT: RED<worktree-path> on branch <branch>. Review with git -C <path> diff main and merge when ready." Do not auto-merge.spawn_taskWhen the evaluator catches improvements that are out of scope (dead code, stale docs, security issues in unrelated files), it MAY include a SPAWN_TASKS: block at the end of its reply listing them. The orchestrator then calls mcp__ccd_session__spawn_task once per item to fire them as side tasks. This keeps the spiral focused while not losing the finds.
.spiral/<slug>/brief.md and reads receipts/verdicts.git add -A.--no-verify past hooks..spiral/<feature>/iter-N/05-evaluation.md ends with VERDICT: GREEN.iter-N/screenshots/..spiral/<feature>/ and audit every decision back to the brief.Provides behavioral guidelines to reduce common LLM coding mistakes, focusing on simplicity, surgical changes, assumption surfacing, and verifiable success criteria.
Searches, retrieves, and installs Agent Skills from prompts.chat registry using MCP tools like search_skills and get_skill. Activates for finding skills, browsing catalogs, or extending Claude.
Creates, edits, and optimizes skills for Claude Code, including drafting, evaluating with test prompts, iterating on performance, and improving skill descriptions for better triggering accuracy.
npx claudepluginhub ving-34/spiral-skills --plugin spiral