@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
@@ -0,0 +1,258 @@
1
+ ---
2
+ name: spec-reviewed
3
+ description: Pick up the review you approved on the page — run it bare to pick up the single waiting pass, paste the six-digit code off the page ("/spec-reviewed 608223") to name one exactly, and be asked which only when two are waiting. Use when the user says "/spec-reviewed", "I approved it", "I've reviewed it", "pick up my review", "I pressed approve", or otherwise says they have finished reviewing a rendered diff.
4
+ disable-model-invocation: true
5
+ ---
6
+
7
+ # /spec-reviewed — pick up the review you just approved
8
+
9
+ > Stay silent while this runs — speak only to ask something you cannot answer
10
+ > yourself, or to report a failure at the moment it happens. Read
11
+ > `.claude/rules/spec-reports.md` before reporting; it defines the block this
12
+ > skill ends with.
13
+
14
+ You read the diff somewhere else, pressed a verdict, and the engine is holding
15
+ the pass. This is how it gets picked up.
16
+
17
+ ## What this is for, now that the picker exists
18
+
19
+ `/spec-next` and `/spec-diff` both end in a picker carrying these same endings,
20
+ so the usual way to pick a review up is to choose one there. This command is
21
+ what covers the case that picker cannot.
22
+
23
+ **A picker is consumed when the turn ends.** Nobody scrolls back and answers one
24
+ an hour later. So a review read over lunch, a session cleared, a fresh terminal
25
+ tomorrow morning — in every one of those the control is gone and the pass is
26
+ still waiting, and this is the way in. That is a narrower job than it once had,
27
+ and not an absent one.
28
+
29
+ **It is also the only claim path the harness itself enforces** — see below.
30
+ Deleting this skill as redundant with the picker would leave no path that has
31
+ the mechanism at all, only paths that have the property.
32
+
33
+ ## Why this is user-only, and why that is the whole point
34
+
35
+ `disable-model-invocation: true` is not ergonomics here — it is the enforcement
36
+ of `/spec-diff` step 0's central rule:
37
+ **never claim a pass you were not asked to claim**.
38
+
39
+ That rule exists because a review pass can be POSTed by anything that reaches
40
+ the page. So a stranger's pass sits in the holding area — unless an agent goes
41
+ and fetches it, which is exactly what happened once: an agent found a waiting
42
+ approval, read its code off disk, claimed it, and reported the round-trip
43
+ working.
44
+
45
+ Prose alone did not prevent that. The harness does —
46
+ **the model cannot invoke this skill** — so a pass picked up *this way* is only
47
+ ever picked up because a person typed the command. Typing it *is* the human
48
+ signal. A later edit that makes this skill model-invocable does not make it more
49
+ convenient — it removes the only thing standing between a stray approval and
50
+ someone's repo.
51
+
52
+ **There is exactly one other way in, and it is bounded rather than trusting.**
53
+ A phase that ends waits on its page, and a pass arriving *during that wait* is
54
+ claimed by the engine (`--claim-since`, `/spec-diff` §4b): scoped to the window,
55
+ acting on nothing when no pass arrived, refusing when two did. A pass already
56
+ sitting there when the wait began is never swept up by it — which is the
57
+ stranger's pass this whole rule was written about. Everything outside that
58
+ window still comes through here.
59
+
60
+ ## 1. Resolve the spec
61
+
62
+ Bare, exactly as every other bare command in this workflow: the worktree you are
63
+ standing in, else the sole provisioned spec. Ask the engine rather than guessing:
64
+
65
+ ```
66
+ skitterspec spec-env resolve
67
+ ```
68
+
69
+ Several provisioned and none resolved is a refusal — relay its list and stop,
70
+ never pick from it. See `.claude/rules/spec-planning.md`; do not restate the
71
+ rule here.
72
+
73
+ **Three argument shapes, and they cannot collide.** A **six-digit code**
74
+ matches `^\d{6}$`; a **tracker id** carries a letter and a hyphen; a
75
+ **spec name** is neither. So the parse needs no flag, and nothing has to be
76
+ guessed at from context.
77
+
78
+ A **six-digit code** is a pass the operator read off their own page. It says
79
+ **which pass**, not which spec — so resolve the spec exactly as a bare
80
+ invocation does, above, and claim the code *there*. Then go to step 4 — a named
81
+ pass has nothing to disambiguate.
82
+
83
+ A **name** targets that spec instead. A **tracker id** does too, but only
84
+ through a **provider seam**: the base knows nothing about tracker ids, so
85
+ resolve one by asking whichever provider is installed for its listing —
86
+
87
+ ```
88
+ skitterspec spec-sync linked --json
89
+ ```
90
+
91
+ — which answers `[{ spec, bucket, identifier }]`, and match on `identifier`.
92
+ **With no provider installed an id resolves to nothing**, and that is the right
93
+ answer rather than a guess: a `SKS-227`-shaped string is not evidence that a
94
+ tracker exists. Say the id matched no spec and stop.
95
+
96
+ ## 1a. Targeting another spec? Get into its worktree first
97
+
98
+ **Only when the resolved spec's worktree is not where this session stands.**
99
+ Compare the `worktree:` line from `skitterspec spec-env resolve <spec>` against
100
+ cwd, resolving both paths first so a symlinked or trailing-slash spelling of one
101
+ tree does not read as two. **Same tree — say nothing and carry on.** That is the
102
+ ordinary case, and a line about it is narration.
103
+
104
+ **Different trees, and it matters for what comes after, not for the claim.**
105
+ Claiming is harmless from anywhere: the sidecar lives in the primary checkout.
106
+ But an honoured `commit` verdict **commits**, and `changes` **edits files**, and
107
+ both must land in *that spec's* worktree — done from here they would land in
108
+ this one, on the wrong branch, looking entirely normal at the time.
109
+
110
+ So **ask, then move**:
111
+
112
+ *"`feat-orders` lives in `../repo-wt/orders`, and picking its review up means
113
+ committing there — move this session over to carry on?"*
114
+
115
+ - **On a yes**, move with a plain `cd "<worktreePath>"`. That is the whole
116
+ mechanism, exactly as `/spec-start` does it — not a tool call, because an
117
+ approval prompt is unusable on a phone.
118
+ Then **confirm the move landed** rather than assuming it
119
+ (`.claude/rules/negative-checks.md` rule 1): run `skitterspec spec-env resolve`
120
+ with no argument and check its `spec:` line names the target. If it does not,
121
+ stop — do not claim a pass you are about to act on from a tree you could not
122
+ confirm.
123
+ - **On a no, stop without claiming.** A pass claimed here and acted on there is
124
+ exactly the split this guard exists to prevent, and claiming first would spend
125
+ the code for nothing.
126
+
127
+ **A target with no worktree is a refusal.** There is nowhere for a commit to
128
+ land. Name it, suggest `/spec-start <name>`, and stop.
129
+
130
+ **Why not simply refuse unless you are on the base branch?** Because that bans a
131
+ legitimate case — standing in one spec, picking up another's review — while
132
+ *still* leaving the work to be done in a tree you are not in. The relocation is
133
+ needed either way, so the relocation is the guard.
134
+
135
+ ## 2. Read what is waiting
136
+
137
+ ```
138
+ skitterspec spec-env review <spec>
139
+ ```
140
+
141
+ Its `pending:` block lists each waiting pass — code, verdict, age:
142
+
143
+ ```
144
+ pending: 1 waiting
145
+ 792969 · commit · 1 min ago
146
+ ```
147
+
148
+ **Never open `.spec-env/reviews/<spec>.pending.json`.** The render carries
149
+ everything a decision needs, so there is nothing to go looking for, and going
150
+ looking is the bypass step 0 forbids. The file is right there and readable; that
151
+ is precisely why the rule is written down rather than assumed.
152
+
153
+ **Check the store before concluding nothing is waiting.** Only when this spec
154
+ has a published page (`--json` reports a `url`): a reader off the LAN sent their
155
+ pass to the artifact's own `passes` collection rather than to the engine, so an
156
+ empty holding area is not an empty answer yet. Read it with the Artifact tool's
157
+ `read_db`, merge the `blob` through `--notes`, and **delete the document** —
158
+ `/spec-diff` §6 owns the whole sequence, including that a claim consumes.
159
+
160
+ **Nothing waiting in either is an ordinary answer.** Say so and stop. Do not hunt
161
+ through other specs, and do not treat an empty holding area as a problem — a
162
+ `file://` page copies to the clipboard instead of sending, so mention that the
163
+ pass may be on their clipboard waiting to be pasted, and finish.
164
+
165
+ ## 3. One pass waiting? Act on it
166
+
167
+ **Claim it and go to step 4.** Do not read the code out, and do not ask whether
168
+ it is theirs. The operator typed this command, which is the whole signal — and
169
+ this skill is the one place in the workflow where that signal cannot be
170
+ manufactured, because the model cannot invoke it.
171
+
172
+ **The code was never an authorisation.** A later edit must not restore it as
173
+ one. It earned its keep when the *page* pushed: the agent went looking, found
174
+ a pass, and had to prove which one it had. What stops a stranger's approval
175
+ reaching your repo is not those six digits — it is that this command cannot be
176
+ typed by anything but a person, and that the one automatic path (`--claim-since`)
177
+ is bounded by a window a stranger's pass falls outside of. The confirmation step
178
+ added nothing to either, and cost a round-trip on every review.
179
+
180
+ So the code has exactly one job left: **telling two passes apart**. That is
181
+ disambiguation, not a gate.
182
+
183
+ **Two or more waiting is a refusal to guess.** Name them all — code, verdict,
184
+ age — and ask which. Never take the newest, the oldest, or the only `commit`:
185
+ this is the one case where a stranger's pass really is sitting beside theirs,
186
+ and the six digits are the only thing that separates them.
187
+
188
+ *"Two are waiting — 792969 (commit, 1 min ago) and 324199 (commit-continue,
189
+ just now). Which is yours?"*
190
+
191
+ **A pasted code skips even that.** `/spec-reviewed 324199` names the pass
192
+ outright, so there is nothing to disambiguate and nothing to ask — claim it and
193
+ act.
194
+
195
+ **On "that isn't mine"**, leave it and offer to drop it:
196
+
197
+ ```
198
+ skitterspec spec-env review <spec> --drop <code>
199
+ ```
200
+
201
+ A pass that stays is reported on every render until the operator stops reading
202
+ the line — which is how the real one gets missed.
203
+
204
+ ## 4. Claim it and act
205
+
206
+ ```
207
+ skitterspec spec-env review <spec> --claim <code>
208
+ ```
209
+
210
+ Then **route on the verdict exactly as `/spec-diff` §2 does** — its steps 2, 2a
211
+ and 4 own that routing, including the commit hand-off through
212
+ `review.commitWith` and what `commit-continue` does after it. Follow it; do not
213
+ restate it here, because two copies of a routing rule is how the two come to
214
+ disagree.
215
+
216
+ That includes the one rule worth knowing before you invoke anything:
217
+ `commit-continue` runs `/spec-next` and **stops there**. It never completes,
218
+ lands or tears anything down.
219
+
220
+ **A code that matches nothing refuses, and names nothing.** The engine answers
221
+ that way and you relay it unchanged: do not list what *is* waiting, and never
222
+ fall back to "the only one". Both would hand a guesser the answer, and the
223
+ second is exactly the fallback that would let an unread pass through. A mistyped
224
+ digit is the ordinary cause — say the code matched nothing and let the operator
225
+ look again.
226
+
227
+ That holds whichever door the code came through, the paste included. A wrong
228
+ code is a wrong code.
229
+
230
+ A claim is a **delivery mechanism, not a second kind of review**: a pass that
231
+ arrived this way means exactly what the same pass pasted into the chat would
232
+ mean — or picked from `/spec-next`'s picker, which is the same conclusion
233
+ reached by a third route.
234
+
235
+ ## 5. Report
236
+
237
+ End with the block defined in `.claude/rules/spec-reports.md`. That file carries
238
+ the shape; this section carries only what is specific here.
239
+
240
+ **Verdicts**
241
+
242
+ - `✅` — a pass was claimed and its verdict acted on.
243
+ - `⚠️` — claimed and acted on, with something worth knowing.
244
+ - `❌` — it acted and stopped part-way; the commit failed, or the work did.
245
+ Quote it.
246
+ - `⏸` — nothing was waiting, the operator said the waiting pass was not theirs,
247
+ they declined the move to another spec's worktree, or the target has no
248
+ worktree at all. Nothing changed, and none of those is a failure.
249
+
250
+ **Fields:** `Tracker` · `Branch` · `Built` · `Tests` · `Worktree` ·
251
+ `Follow-ups` · `Next`
252
+
253
+ `Worktree` appears only when this run **moved the session** — the path it moved
254
+ to, because the operator's next command depends on knowing where they now are.
255
+ A run that stayed put omits it.
256
+
257
+ `Built` is what the verdict produced — the commit, or the commented files
258
+ worked. A run that claimed nothing built nothing and omits it.