@skitterbyte/skitterspec 18.0.0 → 20.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/MIGRATION.md +296 -10
  2. package/README.md +53 -4
  3. package/assets/claude-md-section.md +38 -2
  4. package/assets/commands/spec-connect.md +2 -2
  5. package/assets/commands/spec-live.md +2 -2
  6. package/assets/core/env.config.json.example +7 -3
  7. package/assets/core/env.config.md +90 -30
  8. package/assets/hooks/review-gate.js +141 -0
  9. package/assets/review/page.html +1787 -0
  10. package/assets/rules/spec-planning.md +250 -10
  11. package/assets/rules/spec-reports.md +321 -0
  12. package/assets/skills/spec/SKILL.md +32 -4
  13. package/assets/skills/spec-bug/SKILL.md +113 -8
  14. package/assets/skills/spec-cancel/SKILL.md +84 -19
  15. package/assets/skills/spec-complete/SKILL.md +80 -23
  16. package/assets/skills/spec-diff/SKILL.md +678 -0
  17. package/assets/skills/spec-hotfix/SKILL.md +113 -10
  18. package/assets/skills/spec-init/SKILL.md +56 -7
  19. package/assets/skills/spec-next/SKILL.md +408 -7
  20. package/assets/skills/spec-review/SKILL.md +26 -3
  21. package/assets/skills/spec-reviewed/SKILL.md +258 -0
  22. package/assets/skills/spec-start/SKILL.md +283 -106
  23. package/assets/skills/spec-to-main/SKILL.md +28 -6
  24. package/package.json +11 -7
  25. package/src/cli.js +1808 -89
  26. package/src/env/building.js +143 -0
  27. package/src/env/commitcmd.js +108 -0
  28. package/src/env/config.js +58 -9
  29. package/src/env/hooks.js +117 -0
  30. package/src/env/provision.js +54 -15
  31. package/src/env/proxy.js +34 -1
  32. package/src/env/render.js +3 -12
  33. package/src/env/resolve.js +295 -9
  34. package/src/env/review.js +1536 -0
  35. package/src/env/serve.js +573 -0
  36. package/src/env/teardown.js +13 -6
  37. package/src/init.js +150 -1
  38. package/LICENSE +0 -21
@@ -1,10 +1,15 @@
1
1
  ---
2
2
  name: spec-next
3
- description: Build the next unfinished phase of the spec in flight for this session — pre-flight, implement with tests, record progress and refresh the tracker. Refuses when no spec is in flight rather than guessing one, and never builds a spec it is not standing in. Use when the user says "/spec-next", "build the next phase", "continue the spec", or "carry on with this spec".
3
+ description: Build the next unfinished phase of the spec in flight for this session — pre-flight, implement with tests, record progress and refresh the tracker. Refuses when no spec is in flight rather than guessing one, and builds wherever that spec resolves rather than wherever the session happens to stand. Use when the user says "/spec-next", "build the next phase", "continue the spec", or "carry on with this spec".
4
4
  ---
5
5
 
6
6
  # /spec-next — build the next phase of the spec in flight
7
7
 
8
+ > Stay silent while this runs — speak only to ask something you cannot answer
9
+ > yourself, or to report a failure at the moment it happens. Read
10
+ > `.claude/rules/spec-reports.md` before reporting; it defines the block this
11
+ > skill ends with.
12
+
8
13
  It assumes the workbench is already set up: a spec is **in flight** on this
9
14
  checkout, and this skill implements its next unfinished phase. Putting a spec in
10
15
  flight — provisioning, moving it to `in-progress`, getting its branch here — is
@@ -13,7 +18,36 @@ flight — provisioning, moving it to `in-progress`, getting its branch here —
13
18
 
14
19
  ## 1. Identify the spec in flight
15
20
 
16
- Resolve **in this order**, and stop at the first that answers:
21
+ **`--worktree <path>` answers before anything else.** When the invocation names a
22
+ worktree, that is the spec to build and that is where it is built — cwd is not
23
+ consulted. It is how `/spec-start` carries on into phase 1 without moving your
24
+ session, and you can type it yourself.
25
+
26
+ **This is not a loosening of the refusal below.** That refusal exists against
27
+ *guessing* which spec to build, and a path someone typed is not a guess. A bare
28
+ `/spec-next` still refuses exactly as it does today.
29
+
30
+ **Validate the path before writing a line into it.** Run the resolver *from* the
31
+ path, so the answer comes from where you are about to write:
32
+
33
+ ```
34
+ cd "<path>" && skitterspec spec-env resolve
35
+ ```
36
+
37
+ Check the `worktree:` line it prints is that same path. If it is not — or the
38
+ command reports that isolation is not enabled — refuse and stop, naming what you
39
+ were given. A path that is not a provisioned worktree must never become a place
40
+ to write code.
41
+ **Read the output, not the exit status** — it exits 0 even when it
42
+ cannot resolve anything.
43
+
44
+ **Not `--dir <path>`.** That flag sets the **repo root**, not the worktree to
45
+ resolve from, so it answers a different question: on a repo with two or more
46
+ worktrees it refuses with *"no spec given, and N specs have worktrees"* and
47
+ validates nothing at all. The `cd` form is what makes the path itself the
48
+ evidence.
49
+
50
+ Otherwise resolve **in this order**, and stop at the first that answers:
17
51
 
18
52
  1. **The live spec of this checkout** — run
19
53
  `skitterspec spec-env live status` and read its `live:` line. `live: yes`
@@ -24,20 +58,65 @@ Resolve **in this order**, and stop at the first that answers:
24
58
  opened in one is its own workbench.
25
59
  3. **The current branch, in `checkout` mode** — no worktrees exist, so the
26
60
  branch the checkout is on names the spec.
61
+ 4. **The only spec provisioned in this repo** — ask the engine, with no spec
62
+ named, from wherever you happen to be standing:
63
+
64
+ ```
65
+ skitterspec spec-env resolve
66
+ ```
67
+
68
+ Take its `spec:` line **only when it names exactly one spec**.
69
+
70
+ This is the **durable** rung, and that is the whole reason it exists. Rungs 1
71
+ to 3 all read *session* state, and session state does not survive a `/clear`,
72
+ a new terminal tab, or coming back tomorrow — while the provisioned worktree
73
+ they are each a proxy for is **on disk** and survives all three. `/spec-start`
74
+ does leave the session standing in the worktree and that `cd` is real; what it
75
+ is not is durable. Without this rung, a repo holding exactly one answer sends
76
+ the operator away to re-supply something it already knew.
77
+
78
+ It is also the resolution every other bare command in this workflow already
79
+ uses — the worktree you are standing in, else the sole provisioned spec — so
80
+ this rung is what stops `/spec-next` being a silent exception to a rule
81
+ `.claude/rules/spec-planning.md` states has none left.
82
+
83
+ **Say which spec you resolved and how**, before writing a line of it:
84
+ *"not standing in a worktree — `<spec>` is the only spec provisioned"*. Rungs
85
+ 1 to 3 are self-evident to whoever typed the command; this one is not, and
86
+ the operator cannot see from where they sit what you picked.
87
+
88
+ **Several worktrees stay a refusal.** The engine names them and resolves
89
+ nothing — exactly the ambiguity the refusal below exists for. Relay its list
90
+ unchanged and stop; never pick from it.
91
+
92
+ WHAT WOULD FOOL THIS: a worktree left behind by a declined teardown is still
93
+ a worktree, so a finished spec can go on counting as provisioned. That widens
94
+ the candidate set, so the failure it produces is an extra candidate — an
95
+ ambiguity the engine refuses on — and never a wrong spec built. It cannot
96
+ manufacture an *absence*, which is why the absence below is still worth
97
+ refusing on.
27
98
 
28
99
  **If none answers, refuse and stop:**
29
100
  `no spec in flight — run /spec-start <name> to start one`.
30
101
 
102
+ That now answers a real absence — no worktree anywhere, the engine included —
103
+ rather than a session that merely lost track of where it was standing.
104
+
31
105
  **Never fall back to the spec "in context".** A spec discussed in conversation
32
106
  is not a spec in flight, and this skill writes real code: building the wrong
33
107
  spec's phase produces commits on a branch nobody asked for. The refusal is
34
108
  cheap; the mistake is not.
35
109
 
110
+ **Rung 4 is not that fallback wearing a hat.** A provisioned worktree is a
111
+ record that someone ran `/spec-start`: it is on disk, the engine reads it, and it
112
+ either names one spec or refuses. A spec named in conversation is a guess about
113
+ intent with nothing underneath it, and no number of them ever resolves to one.
114
+
36
115
  A **name argument** is accepted, but it must *match* the spec in flight — it
37
116
  narrows a re-run, it does not select a different spec. A mismatch refuses,
38
117
  naming both.
39
118
 
40
- ## 2. Pre-flight — commit prior work
119
+ ## 2. Pre-flight — the last phase is committed, and was answered
41
120
 
42
121
  Before writing any code for this phase, get the workspace clean:
43
122
 
@@ -49,6 +128,32 @@ Before writing any code for this phase, get the workspace clean:
49
128
  next phase on top of an uncommitted one. (Skip if this is the first phase —
50
129
  there's nothing prior to commit.)
51
130
 
131
+ - **Confirm the last phase's review was answered.** Ask the engine, never the
132
+ sidecar:
133
+
134
+ ```
135
+ skitterspec spec-env review gate <spec> --json
136
+ ```
137
+
138
+ `state: "armed"` means a phase ended, its page was rendered, and nobody has
139
+ said what they concluded. **Refuse, with the `⏸` block**, and name the three
140
+ ways out in the `Next` row: read the page and send a verdict, type
141
+ `/spec-reviewed` if one is already waiting, or
142
+ `skitterspec spec-env review skip "<reason>"` to move on with the reason on
143
+ the record.
144
+
145
+ `state: "clear"` carries on.
146
+ **`state: "unknown"` also carries on, in silence** — it is the project opting out, a sidecar that could not be read, or
147
+ a spec the engine could not resolve, and none of those is evidence that
148
+ anything is owed (`.claude/rules/negative-checks.md`). Do not mention it: a
149
+ line about a gate nobody armed is an accusation against a healthy repo.
150
+
151
+ **This refusal counts nothing.** It is not a tally of ticked boxes — those
152
+ still gate nothing and still are not counted. It asserts one thing: a phase
153
+ that ended has an answer. And the exit is always **one command**, one of them
154
+ being *"I am moving on"*, which is what keeps this a push rather than a wall —
155
+ a gate with no exit gets switched off wholesale instead of answered.
156
+
52
157
  ## 3. Implement the phase
53
158
 
54
159
  Identify the **first unfinished phase** from the `00-overview.md` phase index,
@@ -63,6 +168,33 @@ once it is over. Without a provider this is a no-op and nothing below changes.
63
168
 
64
169
 
65
170
 
171
+ **Before building, compare the worktree against where you are standing.** Take
172
+ the `worktree:` line from `skitterspec spec-env resolve <spec>` and compare it
173
+ with this session's cwd, resolving both paths first so a symlinked or
174
+ trailing-slash spelling of one tree does not read as two.
175
+
176
+ Same tree — the ordinary case, since `/spec-start` leaves the session standing
177
+ in it — and the rest of this step is inert.
178
+ **Different trees, and the discipline below applies however the spec was resolved.**
179
+ `--worktree <path>` is one way to get here and §1's rung 4 is another: a bare
180
+ `/spec-next` typed from the primary checkout resolves the sole provisioned spec
181
+ and builds it somewhere this session is not. What makes the discipline necessary
182
+ is the two trees, so that is what it is conditioned on — not the shape of the
183
+ invocation, which cannot see rung 4 at all.
184
+
185
+ Record the baseline before you write anything:
186
+
187
+ ```
188
+ skitterspec spec-env resolve <spec> --record-primary
189
+ ```
190
+
191
+ Then build as below, with one discipline on top.
192
+ **The session is not standing in the worktree**, so every write takes an
193
+ absolute path under it and every command
194
+ is prefixed `cd "<worktreePath>" &&` — typecheck and tests included. A single
195
+ relative path lands the work in the primary checkout, on the base branch, and
196
+ nothing about it looks wrong at the time. Step 4b is what catches it.
197
+
66
198
  Then build it, following the project rules in `.claude/rules/*.md` and `CLAUDE.md`:
67
199
 
68
200
  - Work task by task through the phase file. Make focused edits that match
@@ -91,8 +223,277 @@ a mirror lag a whole spec behind. Without a provider this is a no-op.
91
223
 
92
224
 
93
225
 
94
- ## 5. Report
226
+ ## 4b. Prove nothing leaked into the primary checkout
227
+
228
+ **Only when the resolved worktree is not this session's cwd** — the same
229
+ comparison step 3 made, and it holds however the spec was resolved. Standing in
230
+ the worktree there is no second tree to have written into, so this step does not
231
+ apply and there is nothing to check.
232
+
233
+ WHAT WOULD FOOL THIS CHECK: it watches the **primary checkout** and nothing
234
+ else, so a build run from inside *another* spec's worktree would leak there
235
+ unseen. That is left unhandled deliberately rather than overlooked — reaching it
236
+ takes an explicit `--worktree` typed from a second worktree — and the cost of the
237
+ gap is a missed leak, never a false accusation.
238
+
239
+ The phase is built and its progress recorded — all of it written into a tree this
240
+ session is not standing in. Before reporting any of it as done:
241
+
242
+ ```
243
+ skitterspec spec-env resolve <spec> --assert-primary-clean
244
+ ```
245
+
246
+ - **Exit 0, "primary checkout clean"** — carry on.
247
+ - **Non-zero** — stop and relay the engine's message unchanged. It names the
248
+ paths and both readings: this build wrote them and they belong in the worktree,
249
+ or something else did and the baseline wants re-recording.
250
+ **Do not guess which, and do not delete anything.**
251
+ A path that appeared is not proof of who put it there.
252
+ - **"cannot tell"** — no baseline, or one from another spec. It exits 0 and
253
+ claims nothing; say so in one line and carry on. An absence is not evidence.
254
+
255
+ ## 5. Render the page, arm the gate, then wait for the verdict
256
+
257
+ **Only when the project has per-spec isolation** (`specs/.core/env.config.json`
258
+ present). Without it there is no worktree to read and this step does not exist.
259
+
260
+ The phase is built, its tests are green, and nothing is committed yet. That is
261
+ the moment the page is about, so render it now — **after** the tests pass and
262
+ **before** the commit:
263
+
264
+ ```
265
+ skitterspec spec-env review <spec>
266
+ ```
267
+
268
+ **This is free.** It is the engine reading git and splicing text into a template;
269
+ the diff never passes through you, so a 266KB patch costs nothing. Report the
270
+ path it prints and move on.
271
+
272
+ **Then arm the gate**, so the phase now owes a verdict:
273
+
274
+ ```
275
+ skitterspec spec-env review arm <spec> --phase <n>
276
+ ```
277
+
278
+ It is idempotent within a phase, so a re-render does not restart the clock, and
279
+ it is **never fatal**: a project that opted out, or an engine that could not
280
+ resolve the spec, says so and the phase is still built. Nothing here counts
281
+ anything — the gate asserts that a phase which ended has an answer, and that is
282
+ all it asserts.
283
+
284
+ **Then offer `/spec-diff`. Do not run it.** The written review is the part that
285
+ costs — roughly **700 output tokens**, because writing it means reading the diff
286
+ — and that spend is the operator's call, not a default.
287
+
288
+ **Where you are going to wait, the offer is the banner after the block** —
289
+ defined in `.claude/rules/spec-reports.md`, and **the `Review` row is dropped**
290
+ so one subject lives in one place:
291
+
292
+ ---
293
+
294
+ ## ⏸ Review ready — <N> files, +<a> −<d>
295
+
296
+ **[Open the page](<the `open:` URL>)** · I'm holding here until you send a verdict.
297
+
298
+ `/spec-reviewed` picks it up · `spec-env review skip "<reason>"` moves on
299
+
300
+ **One link, and the engine has already chosen it.** Where it served, the
301
+ banner carries the served URL and the wait is real. Where it could not serve —
302
+ a busy port, a machine with no network address — that is the case publishing
303
+ exists for, and then the banner carries the published URL with what is true of
304
+ it: *press a verdict, then type `/spec-reviewed`*, because nothing pushes from
305
+ the artifact store into this conversation.
306
+
307
+ **Never offer both.** Publishing while the server is reachable adds a second
308
+ door the reader cannot tell apart from the first, and the wait only stands
309
+ behind one of them — that was done, and three verdicts were pressed on the
310
+ published page while each sat unread under a line saying I was holding. The
311
+ published page is for the reader the server cannot reach, and for nobody
312
+ else.
313
+
314
+ ---
315
+
316
+ **Where you are not waiting, it stays the `Review` row** — the counts, the page
317
+ link and a question, in one row:
318
+
319
+ | **Review** | <N> files, +<a> −<d> · [open the page](<the `open:` URL>) — want a written review before you commit? |
320
+
321
+ **Both shapes are addressed to someone, and that is the constraint.** The offer
322
+ was once a fenced block of engine output: two quoted lines under the test
323
+ counts, addressed to nobody, with the report then closing on *"commit this
324
+ first"* — the last instruction the reader got was to move on, so they did. A row
325
+ in a labelled table is findable; a question in it is answerable; a banner says
326
+ the work has stopped. What must never come back is something unaddressed,
327
+ unfindable, or fenced.
328
+
329
+ **Never bury it and never split it.** The row sits above the last two rows of
330
+ the block, and the page and the question stay in the same row; the banner
331
+ replaces the row rather than joining it. Two places naming one page make the reader
332
+ resolve a distinction before acting on either — which is the same failure
333
+ whether the two places are adjacent rows or a row and a banner.
334
+
335
+ ### Then wait for the verdict, where the harness can
336
+
337
+ The row is findable, but a row cannot make the continuation follow from the
338
+ reading — and that is the gap the whole gate exists to close.
339
+ **Where this harness can watch a file and wake the session on a change, use it.** The pass
340
+ arrives at the engine's holding area, the watch fires, and the verdict the
341
+ reader pressed is what carries the work on.
342
+
343
+ 1. **Note the moment you start waiting**, as an ISO timestamp. That instant is
344
+ the whole scope of what you may claim.
345
+ 2. **Watch the pending store** for the spec —
346
+ `.spec-env/reviews/<spec>.pending.json` in the primary checkout — and
347
+ **end your turn**. Do not poll, and do not hold the turn open: the point is that
348
+ the reader has the terminal back while they read.
349
+ 3. **On waking, let the engine pick**:
350
+
351
+ ```
352
+ skitterspec spec-env review <spec> --claim-since <the timestamp> --json
353
+ ```
354
+
355
+ It claims the one pass that arrived inside the window, and acts on nothing
356
+ at all when none did (the watch can fire on a write that was not a pass) or
357
+ when two did (two sittings, or two people — the operator has the codes).
358
+ 4. **Route on the verdict** exactly as `/spec-diff` §2 and §4 describe. Do not
359
+ restate that routing here.
360
+
361
+ **WHY THIS IS SAFE, AND WHAT IT COSTS.** It was once true that a device
362
+ reaching your page could not reach your conversation, and that fact was the
363
+ whole guard: a pass sat in the holding area until a person typed
364
+ `/spec-reviewed`. This replaces that guard rather than weakening it by
365
+ accident, and the replacement is two things together — **the serve token**,
366
+ 48 unguessable bits minted per server, which is what decides who can POST at
367
+ all; and **the window**, which is what decides which pass is yours. A pass
368
+ already waiting when the wait began is never claimed by it, which is exactly
369
+ the stranger's pass the old rule was written about. What is genuinely given up
370
+ is that the page can now act, so the token has become a credential rather than
371
+ a convenience — and `--claim-since` refusing to choose between two passes is
372
+ what stops a race becoming a wrong commit.
373
+
374
+ **Where the harness cannot watch a file, change nothing.** The `Review` row and
375
+ `/spec-reviewed` are the whole story, exactly as before. The gate still holds
376
+ either way: it is the engine's, not the watch's.
377
+
378
+ **It still does not break a chained run.** `/commit && /spec-next` is typed as
379
+ one line; by the time this step is reached the chain has finished, so waiting
380
+ here stops nothing that was still going to happen.
381
+
382
+ Relay the **`open:`** line the engine prints, not the bare path: a path is not
383
+ clickable in any terminal, and a page nobody can open is a page nobody reads.
384
+
385
+ - **Never write the review unasked**, and **never publish**. Publishing leaves
386
+ something behind that this tooling cannot remove, so it is always something
387
+ someone asks for. A `file://` link is no use on a phone, and saying so **is**
388
+ the ask — publishing is the answer to it, and `/spec-diff` §6 owns how.
389
+ **Follow the `reader:` line the engine printed — do not sniff for it.** It
390
+ answers where the person reading this is sitting, and the offer changes with it:
391
+
392
+ - **absent** (`unknown`) — the `file://` URL, exactly as always. **Do not warn:**
393
+ unknown is the ordinary state of a local machine, and a warning there is an
394
+ accusation against a healthy session.
395
+ - **`local`** — the `file://` URL.
396
+ - **`remote`** — the engine has already stood its local server up and put a URL
397
+ the reader can open on `open:`. So there is **nothing special to say**: relay
398
+ that line like any other. Any `also:` lines under it are the other addresses
399
+ this machine has, offered because the best-guess one can be wrong — pass them
400
+ on rather than editing them out.
401
+
402
+ **Never read an environment variable to decide this** — not `SSH_CONNECTION`,
403
+ not `CLAUDE_CODE_*`, not a tty check. The engine did it, reports it on that line
404
+ and in `--json`, and a second implementation here could not be tested and would
405
+ drift.
406
+
407
+ **Serving is the engine's to do; publishing is never.** A `remote` reader
408
+ authorises a local server — one process, ended by one flag, leaving nothing
409
+ behind — and authorises nothing else. A reader the server CAN reach is not a
410
+ reason to publish as well: the page they can already open is the page to name. Publishing leaves a page this tooling
411
+ cannot remove, so it stays an ask in every case, always. If the engine could not
412
+ serve (a busy port, a machine with no network address) it falls back to the
413
+ `file://` URL with its marker, and that is when publishing is worth naming.
414
+
415
+ - **Never fatal.** A failed render — no worktree, a git error — is one line and
416
+ the phase is still done. The page is a convenience; the repo is the record.
417
+ - If the project has no isolation config, skip the whole step in silence rather
418
+ than explaining an absence.
419
+
420
+ ## 6. Report
421
+
422
+ Do **not** `git commit` unless the user asks — finish, verify, and wait.
423
+
424
+ End with the block defined in `.claude/rules/spec-reports.md`. That file carries
425
+ the shape; this section carries only what is specific here.
426
+
427
+ **Verdicts**
428
+
429
+ - `✅` — the phase is built and its tests are green.
430
+ - `⚠️` — built and green, with something worth knowing (a mirror that did not
431
+ refresh, a deviation from the plan).
432
+ - `❌` — the phase's tests are red, or it stopped part-way. Quote the failure.
433
+ - `⏸` — no spec in flight, or the name given does not match the one that is.
434
+
435
+ **Fields:** `Tracker` · `Branch` · `Built` · `Tests` · `Notes` · `Review` ·
436
+ `Follow-ups` · `Next`
437
+
438
+ ## 6a. End in a picker
439
+
440
+ The block says what happened; this is what to do about it. Offer the same four
441
+ endings the review page carries, so a review finishes the same way wherever the
442
+ reader is standing — the page, a pasted code, or here.
443
+
444
+ **Not when you are waiting.** Where §5 set a watch and ended the turn, the
445
+ verdict is coming from the page and the picker would be a second way to answer
446
+ a question already asked — so the block ends on `Next`, which names the page.
447
+ The picker is for the run that did not wait: no watch available, or a render
448
+ the reader is expected to come back to in their own time.
449
+
450
+ | Option | Does |
451
+ |--------|------|
452
+ | `Reviewed` | Claims the waiting pass and routes on its verdict |
453
+ | `Commit` | Runs the project's commit skill, and stops |
454
+ | `Commit & Continue` | Commits, then `/spec-next` — and **stops there** |
455
+ | `Discuss` | Asks what is up; changes nothing |
456
+
457
+ **`Reviewed` only when a pass is actually waiting.** The render's `pending:`
458
+ block already says. Offering a pickup with nothing to pick up is the empty
459
+ gesture this exists against — the other three stand on their own.
460
+
461
+ **Do not restate the routing.** `/spec-diff` §2, §2a and §4 own it, including
462
+ the commit hand-off through `review.commitWith` and what `commit-continue` does
463
+ after. Two copies of a routing rule is how the two come to disagree.
464
+
465
+ **It does not break a chained run.** `/commit && /spec-next` is typed as one
466
+ line and the picker appears at the **end**, by which point the chain has already
467
+ finished. The cost that was feared here — a question stopping a run mid-way — is
468
+ not a cost this placement has.
469
+
470
+ **Nothing may claim a pass without a pick.** `/spec-reviewed` is user-only by
471
+ *harness enforcement*, because prose alone once failed to stop an agent claiming
472
+ a pass nobody asked it to. A pick keeps the **property** that makes that safe —
473
+ a person in the conversation chose, and a device that reaches the page cannot —
474
+ while routing around the **mechanism**, since the claim runs downstream of the
475
+ pick. That trade is deliberate and it has exactly one condition: a run that
476
+ shows no picker claims nothing, and a picker nobody answered claims nothing.
477
+
478
+ WHAT WOULD FOOL THIS: a picker shown reflexively at the end of every run trains
479
+ the reader to dismiss it, and a dismissed picker is indistinguishable from a
480
+ considered decline. So offer it where there is a real choice, and let the `Next`
481
+ row carry the rest.
482
+
483
+ `Next` names the commit and then the phase, as
484
+ `/commit, then /spec-next → phase 3 (Auth)`, so the block says what to do and
485
+ which phase is next without a line of prose for either.
486
+
487
+ **The commit is not optional politeness.** Step 6 above deliberately leaves the
488
+ phase uncommitted, and §2 of this very skill refuses to build the next phase on
489
+ top of an uncommitted one — so a `Next` that names only `/spec-next` sends the
490
+ reader straight into that refusal. The two halves are four hundred lines apart,
491
+ which is exactly how they drifted.
95
492
 
96
- Summarise what was implemented, the test result (quote failures if any), and
97
- which phase is next. Do **not** `git commit` unless the user asks — finish,
98
- verify, and wait.
493
+ **Step 5's offer lands in one of two shapes, and never both.** Waiting on a
494
+ verdict the **banner** after the block, and no `Review` row. Not waiting the
495
+ `Review` row, and no banner. Neither is a paragraph: the ban on prose after the
496
+ block is untouched, and the banner is a control the contract names
497
+ (`.claude/rules/spec-reports.md`). Step 5 renders before the commit and this
498
+ step is where its offer lands, so the two must not disagree about which shape it
499
+ takes.
@@ -5,6 +5,11 @@ description: Re-validate an existing spec against the current codebase — detec
5
5
 
6
6
  # /spec-review — bring a spec back in sync with the codebase
7
7
 
8
+ > Stay silent while this runs — speak only to ask something you cannot answer
9
+ > yourself, or to report a failure at the moment it happens. Read
10
+ > `.claude/rules/spec-reports.md` before reporting; it defines the block this
11
+ > skill ends with.
12
+
8
13
  Specs rot: the code moves on while a spec sits in the backlog or pauses
9
14
  mid-build. This skill re-validates a spec against the **current** code and
10
15
  rewrites the stale parts so it's safe to act on. It plans only — it does not
@@ -99,6 +104,24 @@ resolve it by reading the code, do that instead of asking.
99
104
 
100
105
  ## 5. Report
101
106
 
102
- Summarise the drift found, what you changed, any questions still open, and
103
- whether the spec is now safe to `/spec-start` (or should drop back to `Draft` until
104
- the open questions are resolved). Do **not** `git commit` unless the user asks.
107
+ Do **not** `git commit` unless the user asks.
108
+
109
+ End with the block defined in `.claude/rules/spec-reports.md`. That file carries
110
+ the shape; this section carries only what is specific here.
111
+
112
+ **Verdicts**
113
+
114
+ - `✅` — checked against the code and brought up to date; safe to `/spec-start`.
115
+ - `⚠️` — updated, but dropped back to `Draft`: questions are open that only the
116
+ operator can answer. Name them.
117
+ - `⏸` — no such spec, or nothing to review. Nothing changed.
118
+
119
+ **Fields:** `Tracker` · `Spec` · `Built` · `Follow-ups` · `Next`
120
+
121
+ `Built` is the drift found and what you changed about it — a renamed file, an
122
+ API that moved, a task the code already does. `Spec` carries the status the
123
+ review leaves it in, which is the answer to "can I start this?".
124
+
125
+ **Drift found and not fixed is a `Follow-up`, not a silence.** A spec this skill
126
+ declared reviewed is one nobody will re-read; something it noticed and left
127
+ undone has to leave the session in writing or it did not happen.