@skitterbyte/skitterspec-github 0.0.0-stage → 1.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 (112) hide show
  1. package/MIGRATION.md +1107 -0
  2. package/README.md +53 -2
  3. package/assets/claude-md-section.md +85 -0
  4. package/assets/commands/allow-main.md +33 -0
  5. package/assets/commands/spec-connect.md +13 -0
  6. package/assets/commands/spec-live.md +14 -0
  7. package/assets/commands/spec-remote-review.md +37 -0
  8. package/assets/commands/spec-skip.md +24 -0
  9. package/assets/core/SETUP.md +112 -0
  10. package/assets/core/env.config.json.example +56 -0
  11. package/assets/core/env.config.md +557 -0
  12. package/assets/core/gating.config.json.example +4 -0
  13. package/assets/core/gating.config.md +81 -0
  14. package/assets/core/github.config.json.example +18 -0
  15. package/assets/core/github.config.md +66 -0
  16. package/assets/hooks/main-guard.cjs +162 -0
  17. package/assets/hooks/review-gate.cjs +146 -0
  18. package/assets/review/page.html +3384 -0
  19. package/assets/rules/commit-trailers.md +103 -0
  20. package/assets/rules/negative-checks.md +69 -0
  21. package/assets/rules/offered-unblocks.md +100 -0
  22. package/assets/rules/spec-planning.md +692 -0
  23. package/assets/rules/spec-reports.md +557 -0
  24. package/assets/skills/no-spec/SKILL.md +246 -0
  25. package/assets/skills/spec/SKILL.md +718 -0
  26. package/assets/skills/spec-bug/SKILL.md +646 -0
  27. package/assets/skills/spec-cancel/SKILL.md +263 -0
  28. package/assets/skills/spec-claim/SKILL.md +122 -0
  29. package/assets/skills/spec-complete/SKILL.md +450 -0
  30. package/assets/skills/spec-diff/SKILL.md +870 -0
  31. package/assets/skills/spec-github-setup/SKILL.md +236 -0
  32. package/assets/skills/spec-hotfix/SKILL.md +668 -0
  33. package/assets/skills/spec-init/SKILL.md +178 -0
  34. package/assets/skills/spec-list/SKILL.md +172 -0
  35. package/assets/skills/spec-next/SKILL.md +685 -0
  36. package/assets/skills/spec-push/SKILL.md +307 -0
  37. package/assets/skills/spec-review/SKILL.md +258 -0
  38. package/assets/skills/spec-reviewed/SKILL.md +284 -0
  39. package/assets/skills/spec-start/SKILL.md +554 -0
  40. package/assets/skills/spec-status/SKILL.md +112 -0
  41. package/assets/skills/spec-sync/SKILL.md +226 -0
  42. package/assets/skills/spec-to-main/SKILL.md +139 -0
  43. package/bin/skitterspec-github.js +61 -0
  44. package/package.json +41 -4
  45. package/src/cli.js +5901 -0
  46. package/src/deprecate.js +138 -0
  47. package/src/env/bootstrap.js +188 -0
  48. package/src/env/building.js +143 -0
  49. package/src/env/classify.js +176 -0
  50. package/src/env/commitcmd.js +108 -0
  51. package/src/env/config.js +753 -0
  52. package/src/env/dev.js +63 -0
  53. package/src/env/hooks.js +226 -0
  54. package/src/env/hotfix.js +411 -0
  55. package/src/env/hotfixland.js +302 -0
  56. package/src/env/integrate.js +126 -0
  57. package/src/env/live.js +504 -0
  58. package/src/env/mainguard.js +299 -0
  59. package/src/env/provision.js +466 -0
  60. package/src/env/proxy.js +192 -0
  61. package/src/env/prune.js +119 -0
  62. package/src/env/registry.js +159 -0
  63. package/src/env/render.js +17 -0
  64. package/src/env/resolve.js +716 -0
  65. package/src/env/review.js +2577 -0
  66. package/src/env/reviewers/coderabbit.js +228 -0
  67. package/src/env/reviewers.js +517 -0
  68. package/src/env/serve.js +1044 -0
  69. package/src/env/supervise.js +157 -0
  70. package/src/env/teardown.js +248 -0
  71. package/src/env/trust.js +87 -0
  72. package/src/gating.js +155 -0
  73. package/src/init.js +1150 -0
  74. package/src/lines-diff.js +114 -0
  75. package/src/prompts.js +129 -0
  76. package/src/vendor/github/api.js +786 -0
  77. package/src/vendor/github/cli-sync.js +1530 -0
  78. package/src/vendor/github/commands.js +44 -0
  79. package/src/vendor/github/config.js +414 -0
  80. package/src/vendor/github/credentials.js +109 -0
  81. package/src/vendor/github/dialect.js +62 -0
  82. package/src/vendor/github/identity.js +38 -0
  83. package/src/vendor/github/mcp.js +85 -0
  84. package/src/vendor/provider-kit/index.js +41 -0
  85. package/src/vendor/provider-kit/src/adapter.js +23 -0
  86. package/src/vendor/provider-kit/src/apply.js +207 -0
  87. package/src/vendor/provider-kit/src/args.js +68 -0
  88. package/src/vendor/provider-kit/src/assignment.js +277 -0
  89. package/src/vendor/provider-kit/src/config.js +198 -0
  90. package/src/vendor/provider-kit/src/credentials.js +404 -0
  91. package/src/vendor/provider-kit/src/doctor.js +35 -0
  92. package/src/vendor/provider-kit/src/http.js +63 -0
  93. package/src/vendor/provider-kit/src/identity.js +93 -0
  94. package/src/vendor/provider-kit/src/md-compare.js +39 -0
  95. package/src/vendor/provider-kit/src/md-tables.js +94 -0
  96. package/src/vendor/provider-kit/src/prompt.js +50 -0
  97. package/src/vendor/provider-kit/src/released.js +269 -0
  98. package/src/vendor/provider-kit/src/releases.js +380 -0
  99. package/src/vendor/provider-kit/src/specs.js +166 -0
  100. package/src/vendor/provider-kit/src/transport.js +22 -0
  101. package/src/vendor/sync-core/index.js +93 -0
  102. package/src/vendor/sync-core/src/base.js +81 -0
  103. package/src/vendor/sync-core/src/compare.js +338 -0
  104. package/src/vendor/sync-core/src/dialect.js +51 -0
  105. package/src/vendor/sync-core/src/fields.js +36 -0
  106. package/src/vendor/sync-core/src/legacy.js +100 -0
  107. package/src/vendor/sync-core/src/normalize.js +998 -0
  108. package/src/vendor/sync-core/src/push.js +85 -0
  109. package/src/vendor/sync-core/src/retarget.js +278 -0
  110. package/src/vendor/sync-core/src/task-block.js +308 -0
  111. package/src/vendor/sync-core/src/verify.js +67 -0
  112. package/src/vendor/sync-core/src/write.js +191 -0
@@ -0,0 +1,554 @@
1
+ ---
2
+ name: spec-start
3
+ description: Put a spec in flight — provision its branch, move it to in-progress, refresh the tracker, then build phase 1. Commits the spec itself when that is all that is uncommitted, and refuses to touch anyone else's unfinished work. Use when the user says "/spec-start", "start this spec", or "begin implementing <spec>".
4
+ ---
5
+
6
+ # /spec-start — put a spec in flight
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
+
13
+ One checkout, one spec in flight. This skill is how a spec gets there:
14
+ provision, move it to `in-progress`, refresh the tracker, then hand straight on
15
+ to `/spec-next` for phase 1. Continuing a spec afterwards is `/spec-next`;
16
+ finishing it is `/spec-complete`.
17
+
18
+ ## 1. The gate — what each mode demands of the tree
19
+
20
+ **Check this first, before resolving anything or touching a file.** What the
21
+ gate demands depends on the mode, because the two modes hold work in different
22
+ places — read `mode` from `specs/.core/env.config.json` (default `worktree`).
23
+
24
+ **`worktree` mode — there is no tree gate.** The spec is built in its own
25
+ worktree, so neither another spec being in flight nor its uncommitted files are a
26
+ conflict; both are the parallelism the mode exists for. `git worktree add`
27
+ carries nothing and forks from a commit, and the one thing this run writes into
28
+ the checkout — the spec's own commit, which `spec-env up` plans for you — names
29
+ its paths on both the `add` and the `commit`, so it cannot reach a file that is
30
+ not this spec's. Work belonging to someone else is **reported and left alone**,
31
+ never a refusal. Nothing is switched here and nothing is parked.
32
+
33
+ **`checkout` mode — the workbench must be free**: on the base branch (`main`, or
34
+ the configured `baseBranch`) and clean, since the branch is built right here and
35
+ this mode holds one spec at a time. If it isn't, relay what is in flight and
36
+ stop — name the spec holding the checkout and the two ways out, then end your
37
+ turn:
38
+
39
+ - **`/spec-complete`** — it's finished; land it and free the workbench.
40
+ - **`/spec-cancel`** — it isn't wanted; record why and free the workbench.
41
+
42
+ **Never get past the gate yourself.** Do not stash, do not commit
43
+ **another spec's** work, do not switch branches for them. An uncommitted tree
44
+ and a half-built phase are each a decision someone must make deliberately — and
45
+ the cost of guessing is another spec's work moved without its author asking. A
46
+ refusal costs one command; the alternative can cost an afternoon.
47
+
48
+ **What `spec-env up` does with the tree**, in both modes — relay what it says
49
+ rather than deciding for yourself:
50
+
51
+ | What it found | `worktree` | `checkout` |
52
+ |---------------|-------------|-------------|
53
+ | clean | provisions | provisions |
54
+ | every path is this spec's | commits those paths **first**, then forks | same, then switches |
55
+ | some path is not | commits this spec's, provisions, **reports the rest** | refuses, naming them |
56
+
57
+ That is membership in an exactly-known set — the spec's own folder plus the
58
+ project's `spec.companionPaths` — and **not** a judgement about whether the
59
+ changes look important. It never decides that.
60
+
61
+ **The last row is the only real difference, and it is mechanical.**
62
+ `git switch -c` carries the working tree onto the new branch, so in
63
+ `checkout` mode a colleague's files really would be moved without them asking.
64
+ `git worktree add` carries nothing, so in `worktree` mode the same files are
65
+ simply not this run's business — and refusing over them fired on the commonest
66
+ tree this workflow produces: a second spec authored while the first is still
67
+ uncommitted. When it reports them, say how many and whose in the `Untouched` row
68
+ and **keep the verdict `✅`** — nothing went wrong.
69
+
70
+ When it plans the commit, the paths are printed above the commands, so run them
71
+ as printed; when it refuses, relay the reason and stop.
72
+
73
+ It also refuses a **clean** tree whose spec is not in the commit the worktree
74
+ would fork from — otherwise you get a branch missing the very spec it is for.
75
+
76
+ **A spec that `/spec` already landed is the HEALTHY case of that check.**
77
+ It is not the refusal. `/spec` authors in its own `--docs` worktree and its committing
78
+ verdict fast-forwards the base branch, so by the time `/spec-start` runs the
79
+ spec is already in the commit the worktree forks from and the tree is clean —
80
+ which is exactly what that check is looking for. Do not read "clean tree,
81
+ nothing to commit" as a sign something was skipped: it means the landing worked.
82
+
83
+ **And the worktree may already exist**, because `Commit & Start` keeps it. That
84
+ is a re-attach, not a clash: `spec-env up` plans the attach form rather than a
85
+ second `-b` fork, and its `then, run:` line — `spec-env bootstrap <name>`,
86
+ without `--docs` — is where the `setup` commands `--docs` deliberately skipped
87
+ finally run. So run it — the install belongs to this moment, the first at which
88
+ the tree is used for code — and report a re-attach rather than a fresh
89
+ provision.
90
+
91
+ ## 2. Identify the spec
92
+
93
+ - Use the name/path argument when given.
94
+ - Otherwise use the spec **in context** (the one just created or discussed).
95
+ Unlike `/spec-next`, that fallback is safe here: this skill starts nothing
96
+ without the gate above passing, and a wrong guess is caught by the operator
97
+ before any code is written.
98
+ - Locate it under `specs/` — `specs/backlog/` first, then the other buckets. A
99
+ spec is a `<name>/` folder whose entry point is `00-overview.md`, with one
100
+ file per phase beside it (`01-<slug>.md`, `02-…`). Legacy specs may be a bare
101
+ `<name>.md`, or a `00-overview.md` with inline phases — handle those too.
102
+ - A spec already in `specs/in-progress/` was started before. Its worktree
103
+ probably still exists, so this is a re-attach: say so rather than reporting a
104
+ fresh start, and skip the housekeeping that is already done.
105
+
106
+ ## 2b. Bring the review server up — from here, before anything else
107
+
108
+ **Only when the project has per-spec isolation** (`specs/.core/env.config.json`
109
+ present). Without it there is no review server and this step does not exist —
110
+ skip it in silence rather than explaining an absence.
111
+
112
+ ```
113
+ skitterspec spec-env review serve --host 0.0.0.0
114
+ ```
115
+
116
+ **Here is the point.** Right now this session is standing in the
117
+ **primary checkout**, and in a moment step 3 `cd`s into a worktree and stays
118
+ there. A
119
+ daemon started after that `cd` is started *by the worktree's copy of the code* —
120
+ and when `/spec-complete` removes that worktree, the daemon keeps answering on
121
+ its port and fails on every page it is asked for, for every spec. The engine
122
+ defends against that now, but the cheapest fix is to never create the situation:
123
+ start it while you are still somewhere that outlives the spec.
124
+
125
+ It is also what lets **several specs be reviewed at once**. Reviews all render
126
+ into the primary checkout's `.spec-env/reviews/`, so one server serves every
127
+ provisioned spec — including specs another agent is building in another
128
+ worktree. Starting it here means that one server belongs to the checkout none of
129
+ them can delete.
130
+
131
+ **Say nothing when it is already up.** The usual outcome is adoption — a server
132
+ is running and this changes nothing — and a line per `/spec-start` about a
133
+ daemon nobody asked about is the narration `.claude/rules/spec-reports.md`
134
+ forbids. Speak only if it could not start.
135
+
136
+ **Never fatal, never a gate.** A busy port, no network address, a refused
137
+ spawn — say it in one line and **carry on**; provisioning is not conditional on
138
+ it, and the page falls back to its `file://` URL exactly as it does today.
139
+
140
+ **`--host 0.0.0.0` is the deliberate half.** It binds the server to this
141
+ machine's network addresses so the page opens on a phone, and the engine mints a
142
+ token with that bind as its only guard. On a machine you would rather not expose,
143
+ drop the flag — the server is then reachable from this machine alone and the
144
+ render says so. On **`--plan`** this step does not run at all.
145
+
146
+ ## 3. Build its branch
147
+
148
+ ### `worktree` mode
149
+
150
+ **One path. There is no branching here and none should be added back.**
151
+
152
+ 1. **Provision.** Run `skitterspec spec-env up <name>` — a planner, so run the
153
+ `to provision, run:` commands it prints and confirm they succeeded.
154
+
155
+ 2. **Trust the worktree.** `spec-env up` wrote the printed `trusted:` root into
156
+ `.claude/settings.local.json`, but that file does not hot-reload in this
157
+ session — run **`/add-dir <trusted root>`** before editing into the worktree,
158
+ or the first write prompts. This is not tab machinery: worktrees live outside
159
+ the checkout, and the trust entry is what stops the prompt.
160
+
161
+ 3. **Bootstrap it, and move into it.** The `cd` is in the command itself, and it
162
+ **moves this session** — that is what it is for, not a side effect of it. The
163
+ Bash working directory persists between calls, so from here on this session is
164
+ standing in the worktree, which is what lets a bare `/spec-next` resolve the
165
+ spec on its own:
166
+
167
+ ```
168
+ cd "<worktreePath>" && skitterspec spec-env bootstrap <name>
169
+ ```
170
+
171
+ That is the planner's `then, run:` line, with the `cd` in front. It seeds
172
+ the gitignored files before `setup` itself — a fresh worktree has neither, so
173
+ hooks, typechecks and tests fail until both have happened — and stops at the
174
+ first step that fails, naming it. Relay its step lines; a non-zero exit is a
175
+ failure to report at the moment it happens, not a reason to run the steps by
176
+ hand.
177
+
178
+ **The worktree steps are the engine's to run, never yours.** Seeding the
179
+ gitignored files, the env file, `setup` and the stack all happen inside
180
+ `skitterspec spec-env bootstrap <name>` — one call that names no file. Do not
181
+ reconstruct them as shell: they used to be printed that way, an agent's copy was
182
+ never faithful, and a project's secrets hook refused every rewrite that named a
183
+ `.env` path. `bootstrap --plan` says what it would do, for reading only.
184
+
185
+ **Then confirm the move landed — never assume it.** Ask for a positive signal
186
+ rather than reading silence as success (`.claude/rules/negative-checks.md`
187
+ rule 1): run `skitterspec spec-env resolve` with **no argument** and read the
188
+ `spec:` line it prints.
189
+
190
+ ```
191
+ skitterspec spec-env resolve # must name this spec
192
+ ```
193
+
194
+ Three states, not two. It names this spec → carry on. It names something else,
195
+ or resolves nothing → **the `cd` did not take**. Say so plainly and fall back
196
+ to the stop-here ending in step 6, printing the path so the operator can open
197
+ a session there themselves; do not build a phase from a session whose location
198
+ you could not confirm. A failed `cd` leaves you in the primary checkout on the
199
+ base branch, where a phase's worth of code looks entirely normal at the time.
200
+
201
+ 4. **Housekeep with `git -C <worktreePath>`** — step 4 below, against the
202
+ worktree.
203
+
204
+ **Keep the `-C` prefix**, even though the session is inside the worktree now
205
+ and a bare `git` would usually do the same thing. It is immune to the one
206
+ failure this sequence can have — a `cd` that silently did not take — where a
207
+ bare `git` would instead write the spec's move into the primary checkout on
208
+ the base branch. It costs nothing and removes a whole failure mode, so do not
209
+ tidy it away.
210
+
211
+ 5. **Print the worktree path.** What happens next is step 6 — it is offered
212
+ there, not decided here.
213
+
214
+ **The session moves into the worktree, and nothing opens a window.** Those are
215
+ two different claims and both are load-bearing. The move is real, and the `cd` in
216
+ step 3 is its whole mechanism — no tool call, because an approval prompt is
217
+ unusable on a phone and leaves the session stuck. Nothing is *spawned*: no new
218
+ terminal, no tab, no editor sent anywhere, because that machinery had nothing
219
+ left to do and was removed deliberately.
220
+
221
+ **Do not move the branch into this checkout**, and do not ask the operator to.
222
+ `/spec-live` is for testing a finished-enough spec on the already-running dev
223
+ server; it is not how work gets started.
224
+
225
+ **`/spec-next`'s refusal is unchanged by this.** Its rule 2 — "the worktree you
226
+ are standing in" — is what answers afterwards, and step 3 is what puts the session
227
+ there; nothing about rules 1 to 3 is loosened, and it must stay that way, because
228
+ the refusal exists so the wrong branch is never built. What changed is where the
229
+ session stands, not how weakly the rules read: a bare `/spec-next` typed from
230
+ somewhere that is neither a worktree nor a live checkout still refuses exactly as
231
+ it did. `--worktree <path>` survives untouched beside it — it answers before those
232
+ rules and cannot be reached by guessing.
233
+
234
+ **And the `cd` is a convenience, not the only thing holding this together.**
235
+ `/spec-next`'s **rule 4** asks the engine for the sole provisioned spec, so a
236
+ bare `/spec-next` resolves this spec from anywhere in the repo — after a
237
+ `/clear`, from a new tab, tomorrow morning. That is what makes step 6's
238
+ stop-here ending an honest offer rather than a promise only this session can
239
+ keep. Do not delete rule 4 as redundant with the `cd`: the `cd` is session state,
240
+ and rule 4 is what is left once it is gone.
241
+
242
+ ### `checkout` mode
243
+
244
+ Run `skitterspec spec-env up <name>` and the single `git switch` it prints.
245
+ There is no worktree, no bootstrap and no hand-off — the checkout is already the
246
+ workbench. Its planner enforces the same gate from the engine side, so relay any
247
+ refusal and stop.
248
+
249
+ ## 4. Move the spec into development
250
+
251
+ **Do this before you report anything**, so no path can end with a provisioned
252
+ worktree and a spec still reading `Ready` in `specs/backlog/`. In `worktree` mode
253
+ run it against the worktree with `git -C <worktreePath>`; in `checkout` mode the
254
+ branch is already here.
255
+
256
+ - `git mv "specs/backlog/<name>" "specs/in-progress/<name>"` if it isn't there
257
+ already (`mkdir -p specs/in-progress` first). Use `git mv` to keep history.
258
+ - Set the **Status** header: `> **Status:** In Progress — Phase 1 (started <YYYY-MM-DD>)`.
259
+ - Set **Developer** if it is still `—` (`git config user.name`).
260
+
261
+ **Only when all three hold**: `specs/.core/github.config.json` exists, the repo
262
+ **owns** `assignee` in its `sync.fieldOwnership`, and the spec carries a
263
+ `github_identifier`. Any one missing → skip this step silently and carry on; a
264
+ project that declined must see no trace of assignment.
265
+
266
+ Ownership is the **value**, not the key: `assignee` is owned by default, and
267
+ `"none"` is how a project declines it. Testing whether the key is *present* would
268
+ read as opted-in everywhere, since the default puts it in every config.
269
+
270
+ **Never blocks, never fails the skill.** Everything below is best-effort: the
271
+ branch is provisioned and the spec is moving either way, and an unassigned issue
272
+ is a cosmetic gap that `/spec-claim` closes later.
273
+
274
+ 1. **Work out who you are.** Run `skitterspec spec-sync whoami --json`.
275
+ - `ok: true` → use `id` and `name`. Nothing to ask.
276
+ - `source: "mcp"` or the command reports no token → call the discovered
277
+ `get_me` tool, then cache its login:
278
+ `skitterspec spec-sync whoami --set <id> --name "<name>"`.
279
+ - `ok: false` → identity is **unknown**, which is an ordinary state (a shared
280
+ or bot key, an offline machine). Go to step 2.
281
+ 2. **Unknown identity — three states, not two.** Decide by what is actually
282
+ reachable, and route the third to inaction:
283
+ - **GitHub reachable *and* this is an interactive session** → offer a short
284
+ user search (`skitterspec spec-sync users <name-or-email>`, or the
285
+ user-list tool on MCP), let the operator pick, and offer to cache it with
286
+ `whoami --set` so this is asked once per machine rather than once per spec.
287
+ - **Not reachable, or not interactive** → say so in one line
288
+ (`assignment skipped — no GitHub identity`) and **carry on**. Do not prompt
289
+ for something you could not act on, and never stall a `/spec-start` on it.
290
+ 3. **Record it on the spec** — through the engine, never by hand-editing
291
+ frontmatter:
292
+
293
+ ```
294
+ skitterspec spec-sync assign <spec> --to <login> --name "<display name>"
295
+ ```
296
+
297
+ 4. **Leave `> **Developer:**` as `git config user.name`** — the step above this
298
+ seam already set it, and this seam must not overwrite it with the tracker's
299
+ display name.
300
+
301
+ Those two names are the same person and often not the same string, and the
302
+ git one is the one everything else in the spec already uses: `Author:`, every
303
+ **State log** `By` row, and every commit. Writing the tracker's name into this
304
+ one field would leave a spec whose own audit trail contradicts its header —
305
+ a worse problem than the one it would solve. Anyone wanting a different name
306
+ on their specs sets `git config user.name`, and it stays consistent
307
+ everywhere.
308
+
309
+ The header names **who is building this**; the stamp in step 3 names
310
+ **which tracker account it is assigned to**. They answer different questions,
311
+ so they need not be the same string. The one place that reasoning does not hold
312
+ is handing a spec to *someone else* — there is no local git name for them —
313
+ and that case belongs to `/spec-claim --to`, which sets the header from the
314
+ tracker deliberately.
315
+
316
+ **Nothing is pushed here.** `assign` writes the repo only, and the refresh these
317
+ skills already run sends it. Assignment is an ordinary field of the projection,
318
+ not a side errand with its own network call.
319
+
320
+ **There is no unassign step anywhere.** The projection derives the assignee from
321
+ the spec's lifecycle bucket, so `/spec-complete` and `/spec-cancel` release the
322
+ issue through the push they already make. The stamp deliberately stays in the
323
+ file: who actioned the work outlives who is currently holding it.
324
+
325
+ - Append a **State log** row: `| <YYYY-MM-DD> | In Progress | in-progress | <git user.name> |`.
326
+
327
+ **Only when `specs/.core/github.config.json` exists** and the spec's overview
328
+ carries a `github_identifier`. Either missing → **skip**, in one line
329
+ (`not linked to GitHub — /spec-push to mirror it`), and carry on. Nothing else in
330
+ this step changes.
331
+
332
+ **Refresh the mirror now, without asking.** Run `/spec-push`. The spec has just
333
+ moved to `in-progress/` and been stamped with a developer — two real state
334
+ changes, and the tracker is a generated mirror of them. It costs one engine call
335
+ and no model tokens when a GitHub token is set (see `apply.transport` in
336
+ `github.config.md`).
337
+
338
+ - **Never mint.** An unlinked spec is skipped, not created. A spec kept
339
+ deliberately local should stay that way — `/spec-push` is how someone opts in.
340
+ - **Never fatal.** If the push fails — offline, no token, a GitHub error — say so
341
+ and **finish the operation anyway**. The spec is in flight in the repo
342
+ regardless; the mirror is disposable and the next push repairs it. Do not roll
343
+ the provisioning back, and do not stop to ask.
344
+ - **Say what happened** in the skill's report: mirror updated, skipped as
345
+ unlinked, or failed with the reason.
346
+
347
+ ### Why it sits here
348
+
349
+ Pinned **after the `git mv` and before the commit**, and both halves matter:
350
+
351
+ - **After the move**, because the projection reads a spec's workflow state from
352
+ its folder bucket. Push while the folder is still in `backlog/` and the issue
353
+ is set to the state the spec is *leaving*.
354
+ - **Before the commit**, because the push stamps ids into the spec and writes a
355
+ snapshot under `specs/.core/`. The `git add` that follows sweeps both up with
356
+ the status change; push after it instead and those files are left uncommitted —
357
+ which strands a dirty worktree on the hand-off, and makes `spec-env integrate`
358
+ refuse to land the branch.
359
+
360
+ ### Why this is not the refresh `/spec-next` already runs
361
+
362
+ It was once reasoned that a push here would send the same thing twice, one commit
363
+ apart, because `/spec-next` refreshes the moment it starts. That holds only in
364
+ `checkout` mode, where `/spec-next` follows immediately. In `worktree` mode the
365
+ spec is built elsewhere and the refresh can be hours away or never come — and
366
+ until it does, the issue sits in its old workflow state with nobody assigned
367
+ while the repo reads `in-progress` with a developer on it.
368
+
369
+ The two pushes are not duplicates either way. This one carries the issue's
370
+ workflow state and its assignee; the one `/spec-next` runs carries phase 1
371
+ starting. Every other lifecycle skill mirrors the state change it makes, and this
372
+ is the seam that stops `/spec-start` being the exception.
373
+
374
+ - **Commit it.** One commit, the spec's own — it records the in-progress state on
375
+ the branch, and sweeps up everything above so the worktree is clean when you
376
+ hand it over.
377
+
378
+ **Publishing that branch is yours to do, and nothing here does it for you.**
379
+ Whenever you want the work somewhere other than this machine:
380
+
381
+ ```
382
+ git -C <worktreePath> push -u origin <branch>
383
+ ```
384
+
385
+ Print it if it is useful; never run it. This skill once pushed here, justified as
386
+ recording the state "for everyone" and firing the tracker's automation — and
387
+ neither half survives reading. The automation needs `{identifier}` in
388
+ `branch.pattern` (see `env.config.md`) to put an issue id in the branch name, and
389
+ the shipped default carries none, so the tracker has nothing to match. Nor was it
390
+ an invariant: `/spec-bug` provisions a worktree the same way and has never
391
+ pushed, and `/spec-hotfix` forbids it outright. This was the odd one out.
392
+
393
+ **It also kept a guard from ever firing.** `refuseTeardownIfUnpushed` blocks
394
+ teardown on commits that are unpushed and unlanded — which described no branch at
395
+ all while this skill published every one of them at provisioning. It can fire now,
396
+ and the place it does is `/spec-cancel`, where the work really is about to be
397
+ destroyed: that skill relays the refusal and offers both ways out. Nothing to do
398
+ here beyond knowing it is no longer dead code.
399
+
400
+ A spec ideally arrives `Ready` from `/spec`; a `Draft` works too — sanity-check
401
+ it is well-formed first.
402
+
403
+ - **Report anything left waiting, and claim none of it.** Ask the engine once:
404
+
405
+ ```
406
+ skitterspec spec-env review waiting
407
+ ```
408
+
409
+ A pass listed here arrived when nothing was watching — a wait that never ran,
410
+ a session cleared, a terminal closed overnight — and no watcher can recover
411
+ those, however good. Relay what it prints: the spec, the code, the verdict and
412
+ the age, with `/spec-reviewed <code>` to pick one up and `--drop <code>` to
413
+ disown it.
414
+
415
+ **It is information, not a gate.** It never refuses, nothing here is
416
+ conditional on it, and **you never claim one** — `/spec-diff` §0 stands
417
+ unchanged, and a pass sitting there when you arrived was not sent to you.
418
+ Silent when nothing is waiting, which is the usual case: say nothing rather
419
+ than reporting that there was nothing to report.
420
+
421
+
422
+ ## 4b. Note a missing gating decision (only if configured)
423
+
424
+ **Only when `specs/.core/gating.config.json` exists.** Run
425
+ `skitterspec gating check <name>` and, if it names this spec, mention it **once**
426
+ before phase 1 starts — the cheapest moment to decide is before any code exists.
427
+
428
+ **This check is advisory.** It reports; it never refuses, and nothing below is
429
+ conditional on it. A spec written before the project adopted gating has no header
430
+ and is not broken — turning this into a gate would accuse the very specs the
431
+ feature was designed not to disturb.
432
+
433
+ ## 5. Bring the spec's dev servers up — confirm before heavy steps
434
+
435
+ **Only when the project configures host dev servers** (`env.config.json` → a
436
+ non-empty `dev` array). Show what will start — the commands, the ports, any
437
+ Docker stack — and get a yes; on **`--plan`**, print it and stop. On
438
+ confirmation run `skitterspec spec-env dev up <name>`. With none configured this
439
+ is a clean no-op.
440
+
441
+ To reach the spec at your normal `localhost` URL afterwards, the **user** types
442
+ **`/spec-connect <name>`** (`/spec-connect main` hands the ports back). Never
443
+ invoke it yourself.
444
+
445
+ ## 6. Build phase 1
446
+
447
+ **`checkout` mode — carry straight on into `/spec-next`** in this session: it
448
+ marks phase 1 started, refreshes the mirror again, builds it with tests and
449
+ reports. Do not stop and ask the operator to run it: the branch is here and they
450
+ asked to start the spec.
451
+
452
+ **`worktree` mode — offer it, then do what they say.** Step 3 left this session
453
+ standing in the worktree, so both endings happen right here and neither needs a
454
+ second session opened anywhere. In prose: say the worktree is ready and name its
455
+ path, then ask **"build phase 1 now?"** — recommending that they do, and naming
456
+ both endings so the decline is a real answer rather than a formality.
457
+
458
+ **Never fence that question.** A grey box is read as an artefact to skim rather
459
+ than as something someone is being asked, which is the whole reason
460
+ `.claude/rules/spec-reports.md` bans fencing a message to the reader. This step
461
+ prescribed a fenced block for a long time and an operator read straight past it,
462
+ which is the evidence, not a preference.
463
+
464
+ - **Build it here** — carry on into a bare **`/spec-next`**. Bare is right: the
465
+ session is in the worktree, so its rule 2 resolves this spec with nothing
466
+ passed and nothing guessed.
467
+ - **Stop here** — the operator is left standing in the worktree on a provisioned
468
+ branch, which is a perfectly good place to leave things. Nothing has to be
469
+ reopened or handed anywhere, and `/spec-next` typed an hour later — from this
470
+ session or a fresh one — does exactly what it would have done now.
471
+
472
+ **Ask rather than deciding for them, and mean it.** Provisioning is cheap and
473
+ reversible; a phase build is neither, and one yes should not cover both. A large
474
+ phase is often better started in a session of its own with a whole context budget
475
+ to spend, and only the operator knows which this is. On **`--plan`** this step
476
+ does not run at all — nothing was provisioned to build in.
477
+
478
+ **`--worktree <path>` is still there, and is still not a way around the refusal.**
479
+ It builds a spec the session is *not* standing in, which after step 3 is the
480
+ exception rather than the normal path. Reach for it in exactly two cases: the
481
+ confirm in step 3 reported the `cd` did not take, or you deliberately mean to
482
+ build some other spec's phase from here. A path someone typed is not a path
483
+ anything guessed, which is why it was never a loosening of the refusal and still
484
+ is not.
485
+
486
+ ## 7. Report
487
+
488
+ **When step 6 carried on into `/spec-next`, emit no block here.** That skill ends
489
+ with its own, and its `Branch` and `Spec` fields already carry everything this
490
+ one would say. Two blocks for one run is the noise the contract exists to
491
+ remove — this section is for the run that stops at step 6.
492
+
493
+ End with the block defined in `.claude/rules/spec-reports.md`. That file carries
494
+ the shape; this section carries only what is specific here.
495
+
496
+ **Verdicts**
497
+
498
+ - `✅` — the branch is provisioned, the spec is `in-progress`, the session is
499
+ standing in the worktree.
500
+ - `⚠️` — provisioned, with something worth knowing (dev servers that did not
501
+ come up, a mirror that did not refresh, a missing gating decision).
502
+ - `❌` — provisioning failed part-way and left something behind. Say what, and
503
+ where.
504
+ - `⏸` — the gate refused: in `checkout` mode a dirty tree or someone else's
505
+ unfinished work, in either mode a spec whose own files are not in the commit
506
+ the worktree would fork from. Nothing changed. Another spec's uncommitted work
507
+ is **not** on this list in `worktree` mode — it is an `Untouched` row on a
508
+ `✅`.
509
+
510
+ **Fields:** `Tracker` · `Branch` · `Spec` · `Worktree` · `Untouched` · `Follow-ups` · `Next`
511
+
512
+ `Worktree` carries the path, because the session is now standing in it and the
513
+ operator's next command depends on knowing that. `Next` is `/spec-next`.
514
+
515
+ `Untouched` appears only when `spec-env up` reported uncommitted work that was
516
+ not this spec's — say how much and whose, and **keep the verdict `✅`**. Nothing
517
+ went wrong: a worktree carries nothing, so that work was never in play.
518
+
519
+ On **`--plan`** nothing was provisioned, so the verdict is `⏸` and `Built`
520
+ carries the plan rather than a claim about the repo.
521
+
522
+ ## Opt-outs
523
+
524
+ - **`--plan`** — print the provisioning and dev-server plan, change nothing.
525
+ - **`--no-worktree`** — skip provisioning and build on the current branch. Warn
526
+ that the work lands wherever you are (usually the base branch); reserve it for
527
+ a trivial change or an explicit request.
528
+
529
+ There is no `--here`. It existed to ask for the branch in the checkout you are
530
+ standing in — and in `checkout` mode that is already what happens, while in
531
+ `worktree` mode `--no-worktree` is the way to say it.
532
+
533
+ ## Why this skill links nothing, but does mirror what it changes
534
+
535
+ This skill creates no spec and mints no issue, so it has **nothing to link** —
536
+ the intake and picker steps belong to `/spec`, `/spec-bug` and `/spec-hotfix`.
537
+
538
+ It does push, though, and that is step 4's seam. The state change it makes — the
539
+ spec moving to `in-progress` with a developer stamped on it — is mirrored by the
540
+ skill that makes it, exactly as `/spec-complete`, `/spec-cancel` and
541
+ `/spec-review` mirror theirs. It was once reasoned that the refresh `/spec-next`
542
+ runs would cover it, so a push here would send the same thing twice one commit
543
+ apart. That only ever held in `checkout` mode, where `/spec-next` follows
544
+ immediately; in `worktree` mode it can be hours away or never come, and the
545
+ issue sits in its old state with nobody assigned meanwhile.
546
+
547
+ The **assignment** seam just above it is still not a push, and does not need to
548
+ be. This is the one moment in the lifecycle where "who is building this" is
549
+ actually decided — the branch is being provisioned for someone, and that someone
550
+ is at the keyboard. It stamps the spec file and stops there, so it costs no
551
+ tracker call and rides out on the push below like every other field. Deferring
552
+ the stamp to `/spec-next` would be worse than untidy: in `worktree` mode the two
553
+ can be separated by hours, and a spec in flight with nobody named on it is
554
+ exactly the gap assignment exists to close.
@@ -0,0 +1,112 @@
1
+ ---
2
+ name: spec-status
3
+ description: Show a spec's one-way sync status against GitHub — a read-only drift report naming what would push, and whether the tracker's status has drifted from the spec's. Changes nothing. Opt-in — needs specs/.core/github.config.json. Use when the user says "/spec-status", "is this spec in sync with GitHub", "what would push", or "show spec sync status".
4
+ disable-model-invocation: true
5
+ ---
6
+
7
+ # /spec-status — one-way sync drift report
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
+ Read-only. Reports two things and writes nothing:
15
+
16
+ 1. **Pending push** — has the spec changed since the last push (is there an issue
17
+ description/state or any phase sub-issue to create or update)?
18
+ 2. **State drift** — does GitHub's issue status differ from the spec's status?
19
+ (The repo wins on the next push; this is just a heads-up, e.g. a card moved
20
+ on the board.)
21
+
22
+ The repo is the source of truth; GitHub is a generated mirror, so there is no
23
+ per-field "conflict" — only "what would the next push send" and "did the mirror
24
+ drift".
25
+
26
+ **Opt-in**: only runs when `specs/.core/github.config.json` exists. If absent,
27
+ tell the user how to enable GitHub sync and stop.
28
+
29
+ ## 1. Identify the target spec
30
+
31
+ Use the argument, else the spec in context; ask if unclear.
32
+
33
+ ## 2. Fetch the GitHub issue (optional, for drift)
34
+
35
+ If the spec has a `github_identifier`, discover the GitHub MCP read tool
36
+ (`issue_read`) and write the issue JSON to a temp file, with its board item's
37
+ Status as `state: { name }` — an issue's own `open`/`closed` is not its state. If GitHub isn't
38
+ connected, skip the drift lines (still report pending-push).
39
+
40
+ **Write the whole issue, including its `description`.** The engine reports two
41
+ independent kinds of drift off that one file: the status someone moved, and the
42
+ **description someone edited**. Write only the status fields and the second
43
+ check has nothing to look at — and it says nothing rather than guessing, so the
44
+ loss is silent. Keep `url` too: it is what the description line points the
45
+ reader at.
46
+
47
+ **The description itself never enters the conversation.** The engine hashes it
48
+ and compares hashes; what it prints is *that* the text changed, plus where to
49
+ read it. Do not open the temp file, and do not paste the description into your
50
+ report.
51
+
52
+ Optionally fetch the board's Status options to a file to validate the
53
+ configured `states` at the same time.
54
+
55
+ ## 3. Run the engine
56
+
57
+ ```
58
+ skitterspec spec-sync status <spec> [--remote <issuefile>] [--workspace-states <statesfile>]
59
+ ```
60
+
61
+ - Reports `push: pending — N to create, M to update` or `up to date`.
62
+ - With `--remote`, adds a `drift:` line comparing the board's Status to the
63
+ spec's status.
64
+ - With `--workspace-states`, fails loudly if a configured state name isn't a
65
+ Status option on the board (the push would refuse at apply time).
66
+
67
+ ## 3b. A wrong repo is a different problem
68
+
69
+ If the spec's `github_url` names a **different repo** than `github.owner` /
70
+ `github.repo` in `specs/.core/github.config.json` — a repo renamed or
71
+ transferred, or a spec copied in from elsewhere — the stamps point at issues
72
+ this repo's config does not reach. That is not push drift and `/spec-push`
73
+ cannot fix it: it fails with `no GitHub issue found for #<n>`. GitHub redirects
74
+ a transferred repo's URLs, but the API does not follow the old name.
75
+
76
+ There is no `retarget` for GitHub yet. Re-stamp by hand with
77
+ `spec-sync stamp <spec> --issue #<n> --url <new url>`, or fix the config if it
78
+ is the config that is stale.
79
+
80
+ ## 4. Report
81
+
82
+ Relay the engine's output **verbatim, above the block** — it is the answer, and
83
+ the block is the verdict on it. Never write to either side.
84
+
85
+ End with the block defined in `.claude/rules/spec-reports.md`. That file carries
86
+ the shape; this section carries only what is specific here.
87
+
88
+ **Verdicts**
89
+
90
+ - `✅` — in sync; nothing would push.
91
+ - `⚠️` — drift: N objects would push, GitHub's status was moved by hand, or the
92
+ issue's **description** was edited on GitHub since the last push. None is an
93
+ error — the repo wins on the next push — but all are the reason someone ran
94
+ this. **Say which**, since the three call for different things: a pending push
95
+ is routine, a moved status is usually someone else's automation, and an edited
96
+ description means a person wrote something that the next push replaces.
97
+ - `⏸` — no config, or the spec is not linked. Nothing to compare.
98
+
99
+ **Fields:** `Tracker` · `Follow-ups` · `Next`
100
+
101
+ `Tracker` is the drift in one line — what would push, and whether the tracker's
102
+ status diverged. `Next` is `/spec-push` when a push is pending, and nothing to
103
+ do when it is not.
104
+
105
+ A **`phases: <mode>`** line names the phase mode that resolved for this spec's
106
+ lifecycle bucket, and appears only when it is not the default `subissue`.
107
+ `mapping.phases` may be a per-bucket map, so this is the only place the mode a
108
+ given spec got is stated. Under **`inline`** the phases live in the spec issue's
109
+ description rather than as sub-issues, so "0 to create" is the expected shape
110
+ rather than a sign the phase files failed to parse; under **`deferred`** the
111
+ `N phase(s) deferred` line above it says how many are still waiting on
112
+ `/spec-next`. Relay both lines as printed.