Implements an existing plan file via gated, context-isolated sub-agents. User-invoked only: /implement-plan <plan-file> [PRD_FILE=...] [ADR_FILES=...]. Orchestrates TDD-gated lanes (RED, GREEN, review+fix, independent verify), freezes cross-lane contracts before fan-out, scouts each lane once into a shared brief, treats the plan as a living artifact updated from sub-agent feedback, and maintains an evidence-based progress ledger. Produces implemented, reviewed, independently verified code plus an as-built plan file.
71
88%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
View guide
Passed
No findings from the security scan
Drive implementation of an existing plan via gated, context-isolated sub-agents. You are the orchestrator: you orchestrate work AND information. You never write code yourself and never read repo code — sub-agents do; you hold only the contract sheet, the ledger, the briefs' curation, and agents' returned summaries/evidence.
$ARGUMENTS — path to PLAN_FILE (required). Optional: PRD_FILE=, ADR_FILES=
(consult for ambiguity only, never hand raw to agents).PLAN_FILE. Never split it; lanes consume it by
phase/section reference at dispatch time — copies drift, references stay current when
the plan changes mid-run.Examples:
/implement-plan docs/plans/kanban.md
/implement-plan docs/plans/kanban.md PRD_FILE=docs/prds/kanban.mdRead PLAN_FILE and extract into orchestrator context only:
**Tests** block, mapped AC-Ns.If any is missing (no phases, ACs, Tests blocks, or seams): stop and report the gap — do not invent. Ask the user how to proceed.
Pin every seam onto a one-page contract sheet (template: references/templates.md)
handed into every lane. A seam is frozen when both sides can code against it (real one
side, mock the other) without negotiation. No fan-out until all seams are FROZEN.
One read-only scout agent per lane (Explore type, low effort, sonnet) writes
LANE_BRIEF.md at the lane worktree root (git-ignored):
## Env — exact test/build/lint/run commands, service/env setup, ports; confirm
clean green baseline (this IS the baseline check).## Map — repo layout, key files per phase, conventions, gotchas.Brief covers its own lane only; per-run artifact, deleted at run end. Exploration is paid once per lane, not once per agent. If the environment can't stand up (blocked secrets, missing services): surface as blocker — never mark phases around it.
One fresh sub-agent per (phase, role); implementer and verifier are always different
agents. Exact per-role context recipes and the mandatory return contract (Learnings: +
Plan deltas:) are in references/role-prompts.md — read it before dispatching the
first agent and follow it verbatim. Key rules:
## Env only (never
implementer claims — independence).Learnings: into the brief's ## Map; dedupe, drop stale lines,
keep it lean. Route Plan deltas: per "Living plan" below.Downgrade only agents whose output is later gate-checked by a stronger agent; never
downgrade a gate. Scouts/Explore → sonnet; trivial lookups → haiku; implementer,
review+fix, verifier, integration, whole-diff review, final acceptance → session model.
Flip a ledger cell only on evidence (command + exit code + last ~30 lines — never full logs), never on say-so. Why: agents under completion pressure report success optimistically; evidence is the only signal that survives that bias, and output tails keep the orchestrator's context flat over long runs.
Tests RED ✓ — phase's test cases (from its **Tests** block) shown failing before any implementation.AC-N → ≥1 test case; an AC without a test blocks the phase.Impl GREEN ✓ — passing test output, not a claim.review+fix ✓ — merged review pass done; all correctness findings resolved AND quality findings applied or waived w/ reason; tests still green.Indep verify ✓ — separate fresh verifier re-ran the suite against the phase's committed snapshot, PASS + evidence (UI phases: agent-browser screenshots mobile + desktop).DONE only with 1–5 all ✓. A failing/blocked task stops the gate — surface it, never mark around it.RED → GREEN → review+fix → independent verify → gate.
/code-review --fix (effort: high) on the phase
diff, two mandatory lenses: correctness, AND quality cleanups at full /simplify depth —
the agent must spawn a dedicated simplify-focused sub-finder (reuse, simplification,
efficiency, altitude). Resolve or waive every finding; re-run tests once (green).DONE only with all cells green.Concurrency rule: one writer per worktree at a time. Mutating stages (RED, GREEN, review+fix) serialize within a lane; only read-only verify overlaps, and only on committed snapshots. Cross-lane parallelism is unrestricted. Why: overlapping writers means the next phase builds on code the fixer is simultaneously rewriting — the rework costs more than the overlap saves; a read-only verifier on an immutable commit can't collide with anything.
PLAN_FILE is continuously updated through implementation; it ends as the as-built record.
PLAN_FILE. Agents report Plan deltas:.rev N — change — source — why to a
## Plan changelog section in PLAN_FILE. Rev counter = staleness detector.DONE phase → apply + un-tick its
Indep verify/Gate, re-verify if behavior-relevant. FROZEN seam → pause consuming
lanes, update contract sheet, re-freeze, notify both sides, resume.DONE) — replace mocks with real
endpoints/SDKs, run cross-lane flows; touches code → same review+fix pass on its diff./code-review (effort: xhigh) on the entire cumulative
diff (all lanes + integration) before acceptance; fresh pass, not a re-run. Resolve or
waive every correctness finding; suite stays green.## Verification (latest rev) + brief ## Env. Runs full e2e;
signs off or returns failing ACs. The integrator never self-certifies. Pure
verification — no review+fix.Templates + column spec in references/templates.md. State machine per phase:
TODO → RED → GREEN → REVIEWED → VERIFYING → DONE.
Render policy: per state change re-render only the changed row; render the
full table on gate flips to DONE and at run end.
Feature-done signal (the only one): every phase DONE + Integration ✓ + Whole-diff
review ✓ + Final acceptance ✓, against the latest plan rev.
Step −1 → Step 0 (freeze) → Step 0.5 (scouts, parallel) → fan out lanes in parallel → per-phase loop gates each phase (verify of N overlaps RED of N+1) → Integration → whole-diff review (xhigh) → Final acceptance. Hard sequence only: integration-after-all-lanes, whole-diff-before-acceptance, acceptance-last. Apply plan deltas the moment any agent reports them.
## Prerequisites/## Verification; scouts confirm the green
baseline (Step 0.5).Agent tool, git worktrees, /code-review skill; agent-browser for UI
phases. If /code-review is unavailable, stop and report — the gates cannot run.When the whole-plan gate is green (or the run is stopped as blocked):
LANE_BRIEF.md (per-run artifacts; stale briefs mislead future runs).## Plan changelog in PLAN_FILE — the plan is now the as-built record.66c7102
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.