Implement Spec
Build the active spec to completion, one reviewable pass at a time. The spec is
the source of truth, but the architecture is allowed to improve when the code
teaches you the plan is stale.
A pass (usually one slice) is a commit checkpoint, not a stopping point. The
job is the whole spec — every slice, every global TODO — not the first green
commit. Finishing a pass means starting the next one, not handing back to the
user. Only stop when the spec is fully implemented (or a genuine blocker needs a
decision only the user can make).
Work in parallel wherever the graph allows. Do not walk the ladder one slice
at a time when slices are independent. Read the spec's dependency graph as a
wavefront and delegate independent passes to subagents that run concurrently
(see Rules) — you orchestrate and integrate; only serialize what genuinely
depends on prior work.
Workflow
Read the repo README, the spec README, and the next slice before editing.
Load any skills named by the spec. Identify the current pickup point, global
TODOs, required gates, and what must stay green. If a multi-slice spec lacks
a live handoff prompt, add one before the first pass ends.
Reconcile the plan with the current code. If the slice would preserve a
development-only shim, duplicated type, weak wrapper, or obsolete path,
replace it with the simpler architecture and update the spec handoff.
Implement one coherent pass: usually one slice, one vertical checkpoint, or
one architecture correction. Keep the review surface small enough to audit.
Verify the actual contract. For behavior changes, run the focused unit tests
first; for browser-visible work, use the real browser/harness and inspect
screenshots so the subject is framed and readable, not merely nonblank.
A visual CHANGE carries two extra proofs before you claim it: a
byte/pixel diff against the pre-change baseline on the production route
(static checks and re-anchored assertions all pass on a no-op — a
palette pass once shipped "verified" while the production frame was
byte-identical), and an unprimed
screenshot-critique — at the
user's reported framing when the pass answers their visual bug report —
before declaring it fixed; the implementer's eyes are primed by the fix
and repeatedly pass what fresh eyes catch.
Never weaken an existing default gate or repin a failing contract without
proving the old contract is wrong.
Review the change list and clean up after every pass, before committing.
Read git status/git diff --stat line by line and account for every path:
one-off probes, shot scripts, scratch files, nohup.out, ad-hoc screenshot
dirs, and SPIKE/debug notes never enter a commit — scratch stays out of the
tree; review evidence belongs in the spec's assets/; anything else gets
deleted. A file you can't name the durable purpose of does not ship.
Delegated agents leak these; the integrating reviewer re-checks the merged
tree with the same eye.
Sizing the pass — measuring what it cost and reworking it when the line count
is out of proportion to the behaviour it delivers — belongs to the shape pass
in step 6, under refactor-clean.
Run review at the end of every pass, before committing.
It sequences the three closeout lenses — refactor-clean on the shape,
code-review on the settled diff, write-docs on what the change touched — and
you apply the fixes from all three. Long specs are where sediment compounds,
so hold the shape pass to this pass's own output: dev-only shims, duplicated
concepts, parallel abstractions, and compatibility wrappers it introduced
collapse into the clean contract with one owner, so the code reads as designed
today, not tacked on. Last, run
audit-choices on the cleaned pass — a pure
audit that appends every decision made where the spec was silent (your own,
and each delegated subagent's when integrating) to the spec's choices
ledger (specs/<feature>/choices.md) with verdicts, changing no code
itself. You act on its findings: redo unsound choices from their corrected
decisions, adopt the recorded provisional call on any user-only entry — the
audit never blocks the run. Rerun the affected checks, then commit only the
focused changes from this pass.
Update the spec README's "Next Agent Prompt": status, completed work, next
pickup point, blockers, changed gates, and any architecture decision that
changed the plan.
Run a maintenance checkpoint as part of the loop, not as endgame cleanup.
Trigger it after a red pass, after every two or three slice commits, after a
rebase/resume/compaction, before changing feature areas, when evidence
invalidates the plan, when the handoff contradicts the TODO/graph, when the
choices ledger's entries cluster around one slice, or when the
active prompt grows hard to scan. Long specs bloat repeatedly; cleanup is a
normal pass, not a cosmetic chore.
A checkpoint cleans both plan and code before more feature work:
- Shorten the README handoff to one current pickup, one priority order, and
one compact evidence ledger; move play-by-play into slice files or assets.
- Correct completed/rejected/next markers; delete stale TODOs, stale
acceptance claims, duplicated status sections, and obsolete prompts.
- Re-rank remaining work so the next red/high-risk contract is explicit, and
demote branches that are not on that path.
- Reslice any still-red, overloaded, or foggy slice into smaller independently
verifiable passes before implementing past it.
- Delete or collapse scaffolding from earlier passes when it no longer owns a
real contract.
- If the work feels off-track, ask a fresh review/subagent to audit spec shape
and priority order, then apply the fixes.
Commit the checkpoint as its own focused pass when cleanup changes the spec,
code shape, or handoff enough that future agents would otherwise inherit stale
context. It is done only when a fresh agent can read the README handoff, TODO,
and slice graph and choose the same next action without conversation history.
Continue. If any slice or global TODO is still open, go straight back to
step 1 for the next one — same session, no pause for acknowledgement. Keep
looping until every TODO is closed.
Run review once more over the whole spec. The
per-pass reviews each judged one slice against the code as it stood then; this
one judges the finished feature. Scope it to the spec's full diff, not the last
pass — that is the only scope where duplication spread across slices, a shape
that only reads wrong once every slice has landed, and docs that describe
increments instead of the feature are visible at all. Apply the fixes, rerun
the gates, commit.
Consolidate the choices ledger, then close. When the last slice lands, the
choices.md you've been appending to per pass is build-order sediment: entries
banked early carry "provisional — revisit in slice N" verdicts that a later pass
silently resolved, entries a later pass reverted still sit there, and the same
choice may appear twice. The per-pass rule "banked is settled, never re-listed"
is what let that drift accumulate — so the final consolidation is its deliberate
exception. Before archiving, rewrite choices.md from scratch as the final
ledger: re-audit every banked choice against the final shipped code (not the
pass it landed in), collapse each provisional/needs-later entry to its actual
end state, drop anything a later pass superseded or reverted, and merge
duplicates. Keep it choices only — no gate results, e2e evidence, or
review-finding narration; those are reported elsewhere and are not decisions the
user now owns. Present it per audit-choices: grouped
by verdict, ranked least-confident-first, every entry ELI5 and standalone.
Then close the spec with close-spec.
Rules
- Delegate independent work to subagents so passes run in parallel. The
spec's dependency graph is the map: whenever two or more slices, branches (e.g.
frontend vs backend), sub-slices, replication spikes, or recon tasks have no
unmet dependency on each other, hand them to subagents that run concurrently
(spawn them in one message) instead of doing them yourself in sequence. Give
each subagent its own git worktree when they touch files in parallel so their
diffs don't collide, and keep work that shares the same files or API seam on a
single agent to avoid merge chaos. Each delegated unit still owns its full pass
— implement, verify, review, focused commit — and you integrate
the results, resolve conflicts, rerun the affected gates on the merged tree, and
keep the Next Agent Prompt coherent. Only serialize what the graph says must be
serial; never idle a lane waiting on an unrelated one.
- Treat backward compatibility as non-goal for unshipped/dev scaffolding. Delete
old paths, wrappers, aliases, fallback modes, and stale tests when the new
architecture replaces them.
- Do not let tests get easier by accident. A split harness or new runner must
preserve the old default coverage unless the spec explicitly changes it.
- Commit every clean pass, then immediately begin the next one. A green commit is
a checkpoint, not permission to stop. If a pass is not green, do not commit it
as finished; report the failing contract and exact evidence.
- Do not stop while work remains. "Slice N is done and committed" is not a
finished task while later slices or TODOs are open — a single completed slice is
a reason to continue, never to hand back. The only legitimate early stops are: a
hard blocker that needs a user-only decision, a gate that cannot be made green
with an honest fix, or the user interrupting. Running low on context is not a
stop — update the handoff and keep going. When you must stop, say exactly which
slice is next and why you paused.
- Keep visual evidence honest: contact sheets, GIFs, screenshots, and
baselines must show the thing being judged at the intended camera/framing.
- Sweep every user-visible surface implied by the slice. A model, state, or
data change is not done if the main view, cards, menus, reports, and
verification fixtures now tell different stories.
- When the implementation touches shared behavior, leave docs or spec rationale
using write-docs principles: durable invariants and
pointers, not copied inventories.
- For long specs, keep the spec itself reviewable as an invariant. Do not let
the README become a transcript of every attempt; keep one current handoff, one
TODO/graph, and one compact evidence ledger, with details in slice files or
assets.
- Human checkpoints never block. At a slice's review or sign-off gate, open
the relevant shots with preview-shots,
state the decision and the options, and give the user ~5 minutes to weigh in —
keep building other non-blocked work meanwhile, never idle. If they don't
answer, make the call yourself on the evidence, record the decision and its
rationale in the spec (the checkpoint's resolution), and keep going — and close
the shots you opened (preview-shots cleans up Preview) so a long unattended run
never piles up windows. A goal or implementation NEVER stops to wait on the
user; it documents the assumption, keeps it reversible, and lets the user
course-correct later.
Done
A pass is done when code, spec handoff, verification evidence, review
cleanup, and a focused commit all agree on the same current truth — then you
start the next pass.
The spec is done — and only then is this skill done — when every slice and
global TODO is closed, all gates are green, the whole-spec review has run and its
fixes have landed, the handoff shows nothing left to pick up, and the spec has
been archived with close-spec.
Anything short of that is mid-implementation: keep going.
The final handback presents the choices ledger, not the diff, per
audit-choices — a days-long unsupervised run
earns its merge through this ledger; it is the user's review surface for
everything decided without them. Hand over the consolidated ledger from
step 11 (final state, verified against shipped code, choices only), never the
raw per-pass append — a ledger still carrying "will be done in a later slice"
verdicts tells the user you never went back to confirm it was.
Close the handback with the size of what you added — always last, after the
ledger. The ledger says what was decided; this says what it cost. A short
table over the whole run:
|
added |
deleted |
net |
| Production code (excl. comments) |
|
|
|
| Comments |
|
|
|
| Tests / harness |
|
|
|
| Specs & docs |
|
|
|
Then one paragraph naming the structural surfaces the run added — a new
cron, table column, index, endpoint, config flag, dependency — because those
are what the user now owns and maintains, and a line count alone hides them.
Exclude formatter churn from files the run did not otherwise touch, and say so
if you excluded any.
State the count plainly whatever it is. A large net addition for a small
behavioural change is a finding to report, not a number to bury — and if you
notice it here rather than at the pass that caused it, say which pass it was.
Slices are not the only unit of scope. A spec also records decisions —
ledger rows, decision-table entries, invariants — and a decision can be agreed
in planning but never turned into a slice, especially when it's orthogonal to
the slices' theme. "All slices closed" then reads as done while that decision is
silently unbuilt. Before declaring the spec done, reconcile every recorded
decision against the shipped code, not just the slice list: each one is either
implemented, or explicitly marked "no code needed." A decision with no owning
slice is the classic silent miss — the close-spec audit is the backstop for it,
not the first line of defense.
1---2name: implement-spec3description: Implement an existing spec through committed passes. Use for long or multi-pass specs that need maintenance checkpoints to periodically clean code, handoffs, priorities, and plan bloat before drift accumulates.4---56# Implement Spec78Build the active spec to completion, one reviewable pass at a time. The spec is9the source of truth, but the architecture is allowed to improve when the code10teaches you the plan is stale.1112A pass (usually one slice) is a **commit checkpoint, not a stopping point.** The13job is the whole spec — every slice, every global TODO — not the first green14commit. Finishing a pass means starting the next one, not handing back to the15user. Only stop when the spec is fully implemented (or a genuine blocker needs a16decision only the user can make).1718**Work in parallel wherever the graph allows.** Do not walk the ladder one slice19at a time when slices are independent. Read the spec's dependency graph as a20wavefront and **delegate independent passes to subagents that run concurrently**21(see Rules) — you orchestrate and integrate; only serialize what genuinely22depends on prior work.2324## Workflow25261. Read the repo README, the spec README, and the next slice before editing.27 Load any skills named by the spec. Identify the current pickup point, global28 TODOs, required gates, and what must stay green. If a multi-slice spec lacks29 a live handoff prompt, add one before the first pass ends.302. Reconcile the plan with the current code. If the slice would preserve a31 development-only shim, duplicated type, weak wrapper, or obsolete path,32 replace it with the simpler architecture and update the spec handoff.333. Implement one coherent pass: usually one slice, one vertical checkpoint, or34 one architecture correction. Keep the review surface small enough to audit.354. Verify the actual contract. For behavior changes, run the focused unit tests36 first; for browser-visible work, use the real browser/harness and inspect37 screenshots so the subject is framed and readable, not merely nonblank.38 A visual CHANGE carries two extra proofs before you claim it: a39 byte/pixel diff against the pre-change baseline on the production route40 (static checks and re-anchored assertions all pass on a no-op — a41 palette pass once shipped "verified" while the production frame was42 byte-identical), and an unprimed43 [screenshot-critique](../screenshot-critique/SKILL.md) — at the44 user's reported framing when the pass answers their visual bug report —45 before declaring it fixed; the implementer's eyes are primed by the fix46 and repeatedly pass what fresh eyes catch.47 Never weaken an existing default gate or repin a failing contract without48 proving the old contract is wrong.495. **Review the change list and clean up after every pass, before committing.**50 Read `git status`/`git diff --stat` line by line and account for every path:51 one-off probes, shot scripts, scratch files, `nohup.out`, ad-hoc screenshot52 dirs, and SPIKE/debug notes never enter a commit — scratch stays out of the53 tree; review evidence belongs in the spec's `assets/`; anything else gets54 deleted. A file you can't name the durable purpose of does not ship.55 Delegated agents leak these; the integrating reviewer re-checks the merged56 tree with the same eye.5758 Sizing the pass — measuring what it cost and reworking it when the line count59 is out of proportion to the behaviour it delivers — belongs to the shape pass60 in step 6, under [refactor-clean](../refactor-clean/SKILL.md).616. Run [review](../review/SKILL.md) at the end of every pass, before committing.62 It sequences the three closeout lenses — refactor-clean on the shape,63 code-review on the settled diff, write-docs on what the change touched — and64 you apply the fixes from all three. Long specs are where sediment compounds,65 so hold the shape pass to this pass's own output: dev-only shims, duplicated66 concepts, parallel abstractions, and compatibility wrappers it introduced67 collapse into the clean contract with one owner, so the code reads as designed68 today, not tacked on. Last, run69 [audit-choices](../audit-choices/SKILL.md) on the cleaned pass — a pure70 audit that appends every decision made where the spec was silent (your own,71 and each delegated subagent's when integrating) to the spec's choices72 ledger (`specs/<feature>/choices.md`) with verdicts, changing no code73 itself. You act on its findings: redo unsound choices from their corrected74 decisions, adopt the recorded provisional call on any user-only entry — the75 audit never blocks the run. Rerun the affected checks, then commit only the76 focused changes from this pass.777. Update the spec README's "Next Agent Prompt": status, completed work, next78 pickup point, blockers, changed gates, and any architecture decision that79 changed the plan.808. Run a **maintenance checkpoint** as part of the loop, not as endgame cleanup.81 Trigger it after a red pass, after every two or three slice commits, after a82 rebase/resume/compaction, before changing feature areas, when evidence83 invalidates the plan, when the handoff contradicts the TODO/graph, when the84 choices ledger's entries cluster around one slice, or when the85 active prompt grows hard to scan. Long specs bloat repeatedly; cleanup is a86 normal pass, not a cosmetic chore.8788 A checkpoint cleans both plan and code before more feature work:89 - Shorten the README handoff to one current pickup, one priority order, and90 one compact evidence ledger; move play-by-play into slice files or assets.91 - Correct completed/rejected/next markers; delete stale TODOs, stale92 acceptance claims, duplicated status sections, and obsolete prompts.93 - Re-rank remaining work so the next red/high-risk contract is explicit, and94 demote branches that are not on that path.95 - Reslice any still-red, overloaded, or foggy slice into smaller independently96 verifiable passes before implementing past it.97 - Delete or collapse scaffolding from earlier passes when it no longer owns a98 real contract.99 - If the work feels off-track, ask a fresh review/subagent to audit spec shape100 and priority order, then apply the fixes.101102 Commit the checkpoint as its own focused pass when cleanup changes the spec,103 code shape, or handoff enough that future agents would otherwise inherit stale104 context. It is done only when a fresh agent can read the README handoff, TODO,105 and slice graph and choose the same next action without conversation history.1069. **Continue.** If any slice or global TODO is still open, go straight back to107 step 1 for the next one — same session, no pause for acknowledgement. Keep108 looping until every TODO is closed.10910. **Run [review](../review/SKILL.md) once more over the whole spec.** The110 per-pass reviews each judged one slice against the code as it stood then; this111 one judges the finished feature. Scope it to the spec's full diff, not the last112 pass — that is the only scope where duplication spread across slices, a shape113 that only reads wrong once every slice has landed, and docs that describe114 increments instead of the feature are visible at all. Apply the fixes, rerun115 the gates, commit.11611. **Consolidate the choices ledger, then close.** When the last slice lands, the117 `choices.md` you've been appending to per pass is build-order sediment: entries118 banked early carry "provisional — revisit in slice N" verdicts that a later pass119 silently resolved, entries a later pass reverted still sit there, and the same120 choice may appear twice. The per-pass rule "banked is settled, never re-listed"121 is what let that drift accumulate — so the final consolidation is its deliberate122 exception. Before archiving, **rewrite `choices.md` from scratch** as the final123 ledger: re-audit every banked choice against the **final shipped code** (not the124 pass it landed in), collapse each provisional/needs-later entry to its actual125 end state, drop anything a later pass superseded or reverted, and merge126 duplicates. Keep it **choices only** — no gate results, e2e evidence, or127 review-finding narration; those are reported elsewhere and are not decisions the128 user now owns. Present it per [audit-choices](../audit-choices/SKILL.md): grouped129 by verdict, ranked least-confident-first, every entry ELI5 and standalone.130 *Then* close the spec with [close-spec](../close-spec/SKILL.md).131132## Rules133134- **Delegate independent work to subagents so passes run in parallel.** The135 spec's dependency graph is the map: whenever two or more slices, branches (e.g.136 frontend vs backend), sub-slices, replication spikes, or recon tasks have no137 unmet dependency on each other, hand them to subagents that run concurrently138 (spawn them in one message) instead of doing them yourself in sequence. Give139 each subagent its own git worktree when they touch files in parallel so their140 diffs don't collide, and keep work that shares the same files or API seam on a141 single agent to avoid merge chaos. Each delegated unit still owns its full pass142 — implement, verify, review, focused commit — and you integrate143 the results, resolve conflicts, rerun the affected gates on the merged tree, and144 keep the Next Agent Prompt coherent. Only serialize what the graph says must be145 serial; never idle a lane waiting on an unrelated one.146- Treat backward compatibility as non-goal for unshipped/dev scaffolding. Delete147 old paths, wrappers, aliases, fallback modes, and stale tests when the new148 architecture replaces them.149- Do not let tests get easier by accident. A split harness or new runner must150 preserve the old default coverage unless the spec explicitly changes it.151- Commit every clean pass, then immediately begin the next one. A green commit is152 a checkpoint, not permission to stop. If a pass is not green, do not commit it153 as finished; report the failing contract and exact evidence.154- Do not stop while work remains. "Slice N is done and committed" is not a155 finished task while later slices or TODOs are open — a single completed slice is156 a reason to continue, never to hand back. The only legitimate early stops are: a157 hard blocker that needs a user-only decision, a gate that cannot be made green158 with an honest fix, or the user interrupting. Running low on context is not a159 stop — update the handoff and keep going. When you must stop, say exactly which160 slice is next and why you paused.161- Keep visual evidence honest: contact sheets, GIFs, screenshots, and162 baselines must show the thing being judged at the intended camera/framing.163- Sweep every user-visible surface implied by the slice. A model, state, or164 data change is not done if the main view, cards, menus, reports, and165 verification fixtures now tell different stories.166- When the implementation touches shared behavior, leave docs or spec rationale167 using [write-docs](../write-docs/SKILL.md) principles: durable invariants and168 pointers, not copied inventories.169- For long specs, keep the spec itself reviewable as an invariant. Do not let170 the README become a transcript of every attempt; keep one current handoff, one171 TODO/graph, and one compact evidence ledger, with details in slice files or172 assets.173- **Human checkpoints never block.** At a slice's review or sign-off gate, open174 the relevant shots with [preview-shots](../preview-shots/SKILL.md),175 state the decision and the options, and give the user ~5 minutes to weigh in —176 keep building other non-blocked work meanwhile, never idle. If they don't177 answer, make the call yourself on the evidence, record the decision and its178 rationale in the spec (the checkpoint's resolution), and keep going — and close179 the shots you opened (preview-shots cleans up Preview) so a long unattended run180 never piles up windows. A goal or implementation NEVER stops to wait on the181 user; it documents the assumption, keeps it reversible, and lets the user182 course-correct later.183184## Done185186A **pass** is done when code, spec handoff, verification evidence, review187cleanup, and a focused commit all agree on the same current truth — then you188start the next pass.189190The **spec** is done — and only then is this skill done — when every slice and191global TODO is closed, all gates are green, the whole-spec review has run and its192fixes have landed, the handoff shows nothing left to pick up, and the spec has193been archived with [close-spec](../close-spec/SKILL.md).194Anything short of that is mid-implementation: keep going.195196The final handback presents the choices ledger, not the diff, per197[audit-choices](../audit-choices/SKILL.md) — a days-long unsupervised run198earns its merge through this ledger; it is the user's review surface for199everything decided without them. Hand over the **consolidated** ledger from200step 11 (final state, verified against shipped code, choices only), never the201raw per-pass append — a ledger still carrying "will be done in a later slice"202verdicts tells the user you never went back to confirm it was.203204**Close the handback with the size of what you added — always last, after the205ledger.** The ledger says what was decided; this says what it cost. A short206table over the whole run:207208| | added | deleted | net |209| --- | --- | --- | --- |210| Production code (excl. comments) | | | |211| Comments | | | |212| Tests / harness | | | |213| Specs & docs | | | |214215Then one paragraph naming the **structural** surfaces the run added — a new216cron, table column, index, endpoint, config flag, dependency — because those217are what the user now owns and maintains, and a line count alone hides them.218Exclude formatter churn from files the run did not otherwise touch, and say so219if you excluded any.220221State the count plainly whatever it is. A large net addition for a small222behavioural change is a finding to report, not a number to bury — and if you223notice it here rather than at the pass that caused it, say which pass it was.224225226**Slices are not the only unit of scope.** A spec also records *decisions* —227ledger rows, decision-table entries, invariants — and a decision can be agreed228in planning but never turned into a slice, especially when it's orthogonal to229the slices' theme. "All slices closed" then reads as done while that decision is230silently unbuilt. Before declaring the spec done, reconcile every recorded231decision against the shipped code, not just the slice list: each one is either232implemented, or explicitly marked "no code needed." A decision with no owning233slice is the classic silent miss — the close-spec audit is the backstop for it,234not the first line of defense.