$npx -y skills add Rune-kit/rune --skill convergeSpec↔code convergence scan. Use after implementation to verify the ACTUAL codebase matches the spec/plan — detects missing backends, dead buttons, partial wiring, scope creep. Classifies gaps (missing/partial/contradicts/unrequested), appends remediation tasks, loops until conver
| 1 | # converge |
| 2 | |
| 3 | ## Purpose |
| 4 | |
| 5 | Post-implementation gap detector. Re-reads the spec, plan, and tasks as the **sole source of intent**, inspects the ACTUAL codebase (present state, not the diff), and classifies every intent key as implemented or gapped. Where verification asks "does it build?", converge asks "**is everything the spec promised actually in the code?**" |
| 6 | |
| 7 | This is the skill that catches the most expensive silent failure: a P1 story's UI exists, renders, passes lint/type/build — and its backend was never written. |
| 8 | |
| 9 | <HARD-GATE> |
| 10 | Converge DETECTS — it never fixes. No Edit, no Write to source files. |
| 11 | Its ONLY write is APPENDING a `## Convergence` task section to the plan's task file. |
| 12 | Existing file content is never rewritten, reordered, or deleted. Zero gaps = zero writes. |
| 13 | </HARD-GATE> |
| 14 | |
| 15 | ## Called By (inbound) |
| 16 | |
| 17 | - `cook` (L1): Phase 6.5 CONVERGE — after VERIFY, before COMMIT, for feature/greenfield chains with a requirements.md |
| 18 | - User: `/rune converge` — "did it fully implement the spec?", "check completeness", "does the code match the spec?" |
| 19 | |
| 20 | ## Calls (outbound) |
| 21 | |
| 22 | None — pure L3 verification utility. Reports gaps; cook decides what to execute. |
| 23 | |
| 24 | ## Executable Steps |
| 25 | |
| 26 | ### Step 1 — Build the Intent Inventory |
| 27 | |
| 28 | Load intent sources (all that exist; requirements.md is mandatory — without it, STOP and report `NO_SPEC`): |
| 29 | |
| 30 | 1. `.rune/features/<name>/requirements.md` — extract keys: every `FR-n`, every `US-n` with priority + Independent Test, every `AC-n.m` (as `US-n/AC-n.m`), every Key Entity |
| 31 | 2. `.rune/plan-<feature>.md` + phase files — Key Decisions, Coverage Summary, task list with `P<phase>-T<seq>` IDs |
| 32 | 3. `.rune/features/<name>/contracts/*.md` — each contract: its endpoint, its `Serves:` story, its `Consumers:` list |
| 33 | 4. `.rune/features/<name>/data-model.md` — entities, state transitions |
| 34 | 5. `.rune/features/<name>/quickstart.md` — per-story validation steps |
| 35 | 6. `.rune/ui-spec.md` `## Unwired Elements` (if present) — designed placeholders that MUST NOT count as implemented |
| 36 | |
| 37 | The inventory is a flat list of keys: `FR-3`, `US-1/AC-1.2`, `contract:create-order`, `entity:Order`, `decision:<slug>`. |
| 38 | |
| 39 | Rules: |
| 40 | - **Task IDs (`P<phase>-T<seq>`) and quickstart.md are EVIDENCE, not verdict keys** — tasks feed the code-scope map (Step 2), quickstart steps feed pass/fail evidence for story rows. Neither gets its own verdict row |
| 41 | - **US-n verdict is DERIVED**: worst verdict among its `AC-n.m` rows (all ACs implemented → story implemented; any partial/missing → story inherits it). Don't independently re-assess the story |
| 42 | - **Plan Claims vs Reality**: while reading tasks, note every task marked `[x]` whose artifact is missing/partial in code — these go in a dedicated report section (informational; `completion-gate` owns claim enforcement, converge just surfaces the lie) |
| 43 | |
| 44 | ### Step 2 — Build the Code-Scope Map |
| 45 | |
| 46 | Map intent → code locations. NO full-repo read — targeted lookups only: |
| 47 | |
| 48 | 1. `Glob` every file path named in plan tasks — does it exist? |
| 49 | 2. `Grep` entity names (from data-model.md) across schema/model directories |
| 50 | 3. `Grep` each contract's endpoint path/route across the codebase — implementation AND callers |
| 51 | 4. `Grep` component names from UI tasks — definition AND the handler symbols they bind |
| 52 | |
| 53 | ### Step 3 — Classify Gaps |
| 54 | |
| 55 | For every intent key, assign exactly one verdict: |
| 56 | |
| 57 | | Verdict | Meaning | Example | |
| 58 | |---------|---------|---------| |
| 59 | | `implemented` | Code fully realizes the key | Endpoint exists, has logic, has a caller | |
| 60 | | `missing` | Required work absent entirely | Contract file exists, no route implements it | |
| 61 | | `partial` | Started but a link in the chain is dead | Button + handler exist; handler's fetch targets a route that doesn't exist | |
| 62 | | `contradicts` | Code diverges from a locked decision or AC | Spec says soft-delete; code hard-deletes | |
| 63 | | `unrequested` | Code maps to NO intent key (scope creep — surfaced, not blocked) | New admin page no story asked for | |
| 64 | |
| 65 | **Dead-interaction trace** (run for every UI element an AC references): |
| 66 | |
| 67 | ``` |
| 68 | element → handler bound? → handler body non-trivial? → calls service/fetch? |
| 69 | → target route/function EXISTS in codebase? → route touches the entity the AC names? |
| 70 | ``` |
| 71 | |
| 72 | First broken link = `partial`, keyed to that element's `US-n/AC-n.m`. Heuristics: `onClick={() => {}}`, `href="#"` on action links, `console.log`-only handlers, `preventDefault()`-only submits, `fetch('/api/...')` where no route file matches — all break th |