$npx -y skills add JuliusBrussee/cavekit --skill buildPlan-then-execute implementation against SPEC.md. Native single-thread loop, no sub-agents. On test or build failure, auto-invokes the backprop skill before retrying — a failed verification always considers whether a new §V invariant would prevent recurrence. Triggers when the us
| 1 | # build — implement spec |
| 2 | |
| 3 | Single-thread native plan→execute. You are main Claude. No swarm. |
| 4 | |
| 5 | ## LOAD |
| 6 | |
| 7 | 1. Read `SPEC.md`. If missing → tell user to invoke the spec skill first. Stop. |
| 8 | 2. Read `FORMAT.md` once if not loaded. |
| 9 | 3. Read §R if present — external facts the build must honor, ⊥ re-derive or contradict. |
| 10 | 4. Parse invocation args: |
| 11 | - `§T.n` → that task only |
| 12 | - `--next` → lowest-numbered row with status `.` or `~` |
| 13 | - `--all` or empty → every `.` row in §T order |
| 14 | |
| 15 | High blast radius (shared module, auth, data, money, public §I)? Run `/review` first. Trivial & reversible? Skip planning ceremony, just do step EXECUTE. |
| 16 | |
| 17 | ## PLAN |
| 18 | |
| 19 | Native plan mode — you delegate to it, you do not reinvent task breakdown. For chosen task(s): |
| 20 | |
| 21 | 1. Cite every §V invariant that applies. Plan must respect all. |
| 22 | 2. Cite every §I interface touched. Plan must preserve shape. |
| 23 | 3. List files to create / edit. |
| 24 | 4. **Verification contract** — name the EXACT test(s) / acceptance criteria that |
| 25 | prove each §V touched. Which test, not "add tests". "Do TDD" alone backfires; |
| 26 | the spec says *what to check*. Each §V touched → a named test that fails first. |
| 27 | 5. Name verification command (test, build, lint) — this is the external oracle. Green = done; ⊥ "looks done". |
| 28 | |
| 29 | Show plan. Wait for user OK unless auto mode. |
| 30 | |
| 31 | ## EXECUTE |
| 32 | |
| 33 | Per task in order: |
| 34 | |
| 35 | 1. Flip §T.n status cell `.` → `~`. Just write to SPEC.md. |
| 36 | 2. Edit code per plan. |
| 37 | 3. Run verification command. |
| 38 | 4. **Pass** → flip `~` → `x`. Next task. |
| 39 | 5. **Fail** → invoke backprop skill. Do NOT retry blindly. |
| 40 | |
| 41 | ## FAIL → BACKPROP |
| 42 | |
| 43 | On test/build failure: |
| 44 | |
| 45 | 1. Read failure output. |
| 46 | 2. Ask: is failure (a) my code bug, (b) spec wrong, or (c) unspecified edge case? |
| 47 | 3. If (a) → fix code, re-run. No spec change. |
| 48 | 4. If (b) or (c) → invoke spec skill with `bug: <cause>` first, let it update §V and §B, then resume build against updated spec. |
| 49 | |
| 50 | Rule: never silently fix root-cause without considering backprop. §B is the memory that stops recurrence. |
| 51 | |
| 52 | ## WRITE POLICY |
| 53 | |
| 54 | - Only flip §T status. No other SPEC.md edits from build. |
| 55 | - Other spec edits → invoke spec skill. |
| 56 | - Commit after each §T completes. Message: `T<n>: <goal line>` + §V cites. |
| 57 | |
| 58 | ## VERIFICATION |
| 59 | |
| 60 | Task `x` only if: |
| 61 | - Verification command (the oracle) exits 0. |
| 62 | - Every §V touched has its named test from the verification contract, and it passes. |
| 63 | - No §V invariant regressed (run full test suite at end). |
| 64 | |
| 65 | ## NON-GOALS |
| 66 | |
| 67 | - No sub-agents. No parallel workers. Main thread only. |
| 68 | - No progress dashboards. `cat SPEC.md | grep §T` is the dashboard. |
| 69 | - No speculative work beyond chosen task scope. |