$npx -y skills add codeclawd/fable-mode --skill groundSelf-terminating grounding loop for a development step. Turns assertions, assumptions, and inferences into verified knowledge via an evidence-backed ledger; self-resolves code-determinable forks and logs them; escalates only genuine preference forks; spawns an independent verifie
| 1 | # /ground — executable grounding protocol |
| 2 | |
| 3 | Makes the "verify before done" discipline **self-terminating** (a ledger with a termination |
| 4 | test), **self-resolving** (a decision policy for forks), and **independently verified** (a cold |
| 5 | second agent), so it runs to completion without you re-prompting "ground further" each step. |
| 6 | |
| 7 | ## Core invariant |
| 8 | |
| 9 | Do not return to the user while any load-bearing claim is UNVERIFIED or any code-determinable fork |
| 10 | is unresolved. "Looks done" is not a termination criterion — an empty UNVERIFIED column is. |
| 11 | |
| 12 | ## 1. Build the ledger |
| 13 | |
| 14 | List every claim the step rests on, as a table: `| # | Claim | Status | Evidence |` |
| 15 | |
| 16 | - A row is **VERIFIED only** when Evidence is a concrete `file:line` (read) or a command **+ its |
| 17 | output** (run). |
| 18 | - "Structurally certain" / "by reading" / "likely" / "should" → **UNVERIFIED**. No exceptions. |
| 19 | - **Behavioral claims** — control flow, ordering, teardown, exception propagation, state |
| 20 | mutation, concurrency — require **run** evidence, not read evidence. Reason only to design the |
| 21 | check; then run it. |
| 22 | - For any library / framework / API claim, ground truth is the installed version or the official |
| 23 | docs (Context7) — not memory. |
| 24 | - A claim too vague to mark either way is **split** into checkable sub-claims. |
| 25 | |
| 26 | ## 2. The five moves |
| 27 | |
| 28 | 1. Read breadth-first — topology: imports, calls, where state lives (Grep/Glob/Read; fan out |
| 29 | parallel searches for fan-out questions). |
| 30 | 2. Read the private internals — closures, captured vars, callbacks, indirection — not just exports. |
| 31 | 3. Test each plan claim against the code — grep the counts, check the visibility. |
| 32 | 4. Name what is intentionally excluded, and why. |
| 33 | 5. Write findings into the plan / ledger. |
| 34 | |
| 35 | ## 3. The loop + termination |
| 36 | |
| 37 | Run the moves, fill the ledger, repeat. Each pass must verify ≥1 row or split a vague claim. |
| 38 | **Terminate** when a full pass yields no new verifications AND the UNVERIFIED column is empty for |
| 39 | all load-bearing claims. |
| 40 | |
| 41 | ## 4. Decision policy — make forks resolve themselves |
| 42 | |
| 43 | For each fork the grounding surfaces, classify: |
| 44 | |
| 45 | - **Code-determinable** — one branch is correct given how the code wires, a project invariant, or |
| 46 | the development trajectory. → **Decide it.** Write *decision + grounded reasoning + rejected |
| 47 | alternative(s)* into a decision log. Do not ask. |
| 48 | - **Preference / value** — needs the user's priorities, risk tolerance, or product direction; or |
| 49 | is irreversible *and* expensive. → **Stop and surface it** inline (markdown list, never |
| 50 | AskUserQuestion) with a grounded recommendation. |
| 51 | - **Unsure which class** → treat as preference and surface. Conservative on purpose. |
| 52 | |
| 53 | The bar: ask only what the code genuinely cannot answer. |
| 54 | |
| 55 | ## 5. Independent verification |
| 56 | |
| 57 | When the ledger is clean, spawn the **grounding-verifier** agent (cold, read-only). Give it the |
| 58 | step goal + the ledger + the diff (if any) — **not** your justification narrative. It performs: |
| 59 | |
| 60 | - **(a) Row-check** — each cited evidence actually supports its claim; re-run behavioral checks |
| 61 | (the run is ground truth regardless of reader). |
| 62 | - **(b) Gap-scan** — independently hunt load-bearing claims the ledger omits: bypass paths, |
| 63 | untested assumptions, unnamed exclusions, count claims that are off. |
| 64 | - **(c) Summary-fidelity** — confirm the §6 packet faithfully describes the diff. |
| 65 | |
| 66 | Resolve every REFUTED / INSUFFICIENT finding (re-ground, fix, or escalate) **before** surfacing. |
| 67 | The verifier reduces but does not eliminate error — it breaks the self-grading loop. Independence |
| 68 | comes from cold context + adversarial stance, not model diversity (same model is fine). For code |
| 69 | changes you may also run the bundled `/code-review` and `/verify` skills alongside it. |
| 70 | |
| 71 | ## 6. The review packet — abstraction parity |
| 72 | |
| 73 | The ledger is an audit trail, not a review surface. Produce a **separate** packet at **the |
| 74 | altitude of the user's original request**, descending to code only in an appendix: |
| 75 | |
| 76 | 1. **The ask** — restated in the user's words. |
| 77 | 2. **What I did** — plain English, same altitude. |
| 78 | 3. **Decisions + why + rejected alternatives** — one line each, plain English. |
| 79 | 4. **Genuine forks** for the user, if any. |
| 80 | 5. **One-command behavioral proof** — before/after, a single command the user can run. |
| 81 | 6. *Appendix* — ledger, decision log, full diff. There for drill-down, never required to review. |
| 82 | |
| 83 | ## 7. Ceiling (autonomy) |
| 84 | |
| 85 | Default **ceiling 2**: ground → decide code-determinable forks → implement → verify → **stage |
| 86 | everything and stop before commit** for sign-off. Ceiling 1: also commit autonomously. Ceiling 3: |
| 87 | widen |