@skitterbyte/skitterspec-azure-boards 2.3.0 → 2.4.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 (58) hide show
  1. package/assets/claude-md-section.md +20 -1
  2. package/assets/core/azure-boards.config.md +4 -2
  3. package/assets/core/env.config.json.example +1 -0
  4. package/assets/core/env.config.md +90 -6
  5. package/assets/hooks/main-guard.cjs +18 -2
  6. package/assets/hooks/review-gate.cjs +19 -2
  7. package/assets/rules/commit-trailers.md +24 -1
  8. package/assets/rules/spec-planning.md +81 -18
  9. package/assets/rules/spec-reports.md +1 -1
  10. package/assets/skills/spec/SKILL.md +55 -2
  11. package/assets/skills/spec-azure-setup/SKILL.md +23 -1
  12. package/assets/skills/spec-bug/SKILL.md +36 -3
  13. package/assets/skills/spec-cancel/SKILL.md +35 -0
  14. package/assets/skills/spec-claim/SKILL.md +41 -2
  15. package/assets/skills/spec-complete/SKILL.md +113 -0
  16. package/assets/skills/spec-hotfix/SKILL.md +51 -4
  17. package/assets/skills/spec-incident/SKILL.md +22 -0
  18. package/assets/skills/spec-next/SKILL.md +12 -5
  19. package/assets/skills/spec-push/SKILL.md +22 -0
  20. package/assets/skills/spec-review/SKILL.md +32 -0
  21. package/assets/skills/spec-start/SKILL.md +50 -3
  22. package/assets/skills/spec-status/SKILL.md +18 -3
  23. package/assets/skills/spec-sync/SKILL.md +1 -0
  24. package/assets/skills/spec-to-main/SKILL.md +47 -1
  25. package/package.json +1 -1
  26. package/src/cli.js +1091 -39
  27. package/src/env/base.js +104 -0
  28. package/src/env/config.js +75 -3
  29. package/src/env/disposition.js +62 -0
  30. package/src/env/handoff.js +80 -0
  31. package/src/env/host.js +262 -0
  32. package/src/env/hotfix.js +225 -0
  33. package/src/env/hotfixland.js +103 -9
  34. package/src/env/inflight.js +95 -0
  35. package/src/env/integrate.js +130 -4
  36. package/src/env/mainguard.js +6 -0
  37. package/src/env/phases.js +28 -0
  38. package/src/env/provision.js +18 -6
  39. package/src/env/resolve.js +108 -9
  40. package/src/env/serve.js +6 -1
  41. package/src/env/specstate.js +101 -0
  42. package/src/env/teardown.js +42 -0
  43. package/src/vendor/azure-boards/cli-sync.js +47 -3
  44. package/src/vendor/azure-boards/config.js +17 -5
  45. package/src/vendor/provider-kit/index.js +4 -0
  46. package/src/vendor/provider-kit/src/apply.js +49 -4
  47. package/src/vendor/provider-kit/src/assignment.js +78 -1
  48. package/src/vendor/provider-kit/src/config.js +34 -1
  49. package/src/vendor/provider-kit/src/list-rows.js +35 -11
  50. package/src/vendor/provider-kit/src/released.js +14 -1
  51. package/src/vendor/provider-kit/src/specs.js +4 -2
  52. package/src/vendor/provider-kit/src/splice.js +64 -0
  53. package/src/vendor/provider-kit/src/status.js +137 -0
  54. package/src/vendor/sync-core/index.js +14 -1
  55. package/src/vendor/sync-core/src/compare.js +17 -5
  56. package/src/vendor/sync-core/src/normalize.js +50 -7
  57. package/src/vendor/sync-core/src/push.js +26 -2
  58. package/src/vendor/sync-core/src/summary.js +257 -0
@@ -301,6 +301,28 @@ split it into phase files (`01-<slug>.md`, `02-…`) with a phase index in
301
301
  `00-overview.md`, exactly like a feature spec. It starts in `in-progress`
302
302
  because work is already underway. Keep it lean:
303
303
 
304
+ **Who owns this spec's status.** Only when `specs/.core/azure-boards.config.json` exists.
305
+ Run `skitterspec spec-sync ownership --json` once and read both values:
306
+
307
+ - **`workflowState: "pull"`** — Azure Boards is the record of this spec's status, so
308
+ this skill **writes no `> **Status:**` header and appends no State log row**,
309
+ wherever its steps below say to. A spec this skill creates gets neither: its
310
+ header carries `> **Tracker:** <work item url>` instead, filled in once linking
311
+ has stamped the url, and its body has no `## State log` section. Readiness is
312
+ the spec's own content — a `Draft` is a spec whose **Open questions** is not
313
+ empty — so nothing is lost with the header.
314
+ - **`assignee: "pull"`** — Azure Boards holds who is building it, so this skill
315
+ **writes no `> **Developer:**` line** either.
316
+ - **Anything else** — `push`, `none`, sync reported off, or the command failing
317
+ — is cannot-tell, and the steps below run exactly as written.
318
+
319
+ What `pull` leaves alone: the folder move (a bucket records what the repo did to
320
+ the code, not a planning status), the phase files and index, and the Changelog.
321
+ A reason a `Status:` header would have carried — a cancellation's, a knock-back
322
+ to Draft — goes in a dated Changelog line instead. A spec that already carries
323
+ any of these lines keeps them untouched: they are history, and nothing rewrites
324
+ them.
325
+
304
326
  ```markdown
305
327
  # Bug: <short title>
306
328
 
@@ -379,7 +401,9 @@ is opted in). If it's absent, skip this entirely — the spec stays local-only a
379
401
  the skill behaves exactly as above. When present, link the spec you just wrote
380
402
  so status and discussion live in Boards while the repo stays the source of
381
403
  truth. A spec is a **work item**; each phase is a **child work item**, carrying
382
- that phase's tasks in its description as a read-only markdown checklist.
404
+ that phase's tasks in its description as a read-only markdown checklist. That is the `spec` description mode;
405
+ under `summary` (a new config's default) the issue and each sub-issue carry
406
+ a short block instead, and the phase's tasks stay in git.
383
407
 
384
408
  **Linking is just the first push**, so it runs the same engine path `/spec-push`
385
409
  does — you never create the work item by hand:
@@ -460,6 +484,12 @@ item is a cosmetic gap that `/spec-claim` closes later.
460
484
  skitterspec spec-sync assign <spec> --to <id> --name "<display name>"
461
485
  ```
462
486
 
487
+ **Where `spec-sync ownership` reports `assignee: pull`**, the work item is the
488
+ record and the spec file is not: add `--if-unassigned`. It writes Azure Boards
489
+ directly, claims the work item only when nobody holds it, and stamps nothing —
490
+ so step 4 has no header to leave alone, since under `pull` no `Developer:`
491
+ line was written.
492
+
463
493
  4. **Leave `> **Developer:**` as `git config user.name`** — the step above this
464
494
  seam already set it, and this seam must not overwrite it with the tracker's
465
495
  display name.
@@ -481,12 +511,15 @@ item is a cosmetic gap that `/spec-claim` closes later.
481
511
 
482
512
  **Nothing is pushed here.** `assign` writes the repo only, and the refresh these
483
513
  skills already run sends it. Assignment is an ordinary field of the projection,
484
- not a side errand with its own network call.
514
+ not a side errand with its own network call. Under `pull` the
515
+ `assign` call is itself the write, so there is nothing for a push to carry.
485
516
 
486
517
  **There is no unassign step anywhere.** The projection derives the assignee from
487
518
  the spec's lifecycle bucket, so `/spec-complete` and `/spec-cancel` release the
488
519
  work item through the push they already make. The stamp deliberately stays in
489
- the file: who actioned the work outlives who is currently holding it.
520
+ the file: who actioned the work outlives who is currently holding it. Under `pull`
521
+ the projection carries no assignee at all, so finishing a spec leaves it on
522
+ the work item: the board keeps who did the work.
490
523
 
491
524
  Azure Boards has no project picker: a minted work item lands in the configured
492
525
  `azure.project` by construction, decided once in
@@ -37,6 +37,28 @@ it verbatim/condensed for the header.
37
37
 
38
38
  ## 4. Stamp the spec
39
39
 
40
+ **Who owns this spec's status.** Only when `specs/.core/azure-boards.config.json` exists.
41
+ Run `skitterspec spec-sync ownership --json` once and read both values:
42
+
43
+ - **`workflowState: "pull"`** — Azure Boards is the record of this spec's status, so
44
+ this skill **writes no `> **Status:**` header and appends no State log row**,
45
+ wherever its steps below say to. A spec this skill creates gets neither: its
46
+ header carries `> **Tracker:** <work item url>` instead, filled in once linking
47
+ has stamped the url, and its body has no `## State log` section. Readiness is
48
+ the spec's own content — a `Draft` is a spec whose **Open questions** is not
49
+ empty — so nothing is lost with the header.
50
+ - **`assignee: "pull"`** — Azure Boards holds who is building it, so this skill
51
+ **writes no `> **Developer:**` line** either.
52
+ - **Anything else** — `push`, `none`, sync reported off, or the command failing
53
+ — is cannot-tell, and the steps below run exactly as written.
54
+
55
+ What `pull` leaves alone: the folder move (a bucket records what the repo did to
56
+ the code, not a planning status), the phase files and index, and the Changelog.
57
+ A reason a `Status:` header would have carried — a cancellation's, a knock-back
58
+ to Draft — goes in a dated Changelog line instead. A spec that already carries
59
+ any of these lines keeps them untouched: they are history, and nothing rewrites
60
+ them.
61
+
40
62
  Update the **Status** header in the entry point so the reason is visible at the
41
63
  top:
42
64
 
@@ -75,6 +97,10 @@ PAT is set (see `apply.transport` in `azure-boards.config.md`).
75
97
  complete/cancelled/reviewed in the repo regardless; the mirror is disposable
76
98
  and the next push repairs it. Do not roll anything back, and do not stop to
77
99
  ask.
100
+ - **In `/spec-complete`'s PR mode this push belongs to run 2.** Run 1 readies
101
+ a PR, and a ready PR is not a merged one — so skip it on run 1, even where
102
+ the `branch` lane committed the move to ride the PR, and run it on run 2 once
103
+ the host has merged. The tracker's Done lands when the work does.
78
104
  - **Say what happened** in the skill's report: mirror updated, skipped as
79
105
  unlinked, or failed with the reason.
80
106
  - **There is no unassign step here.** The projection derives the assignee from
@@ -253,6 +279,15 @@ only ordering that survives.
253
279
  copy of abandoned work. Seeing no such section here is the expected case, not
254
280
  a fault — and if the user wants the remote branch gone anyway, that is their
255
281
  call to make explicitly, not something to tidy away on their behalf.
282
+
283
+ **In PR mode the same confirm-first section may carry the PR abandon**
284
+ (`gh pr close` / `az repos pr update --status abandoned`): a cancelled spec
285
+ must not leave a live PR behind — it is noise with a merge button on it.
286
+ The teardown of an open-PR spec is refused unforced (the PR is named), so
287
+ this line appears on the forced run the refusal led to; ask before running
288
+ it like the delete above, and run the abandon **before** any remote branch
289
+ delete — closing the PR first is what stops the host complaining about a
290
+ deleted source branch.
256
291
  4. `skitterspec spec-env prune` — reap orphaned test-DB volumes that belong to no
257
292
  live spec (leftovers from declined/aborted teardowns or manual worktree
258
293
  removal). Show the orphan list and, **only on the user's confirmation**, run
@@ -26,6 +26,27 @@ checks the same thing and writes nothing, so the rule holds for a script, a
26
26
  chained command, and anyone who reached for the CLI directly. Prose in one
27
27
  skill is not a guard; it is a guard's documentation.
28
28
 
29
+ ## Under `pull`, the work item is the record
30
+
31
+ Ask once: `skitterspec spec-sync ownership --json`. Where `assignee` is
32
+ **`pull`**, Azure Boards owns who is building the spec, and the repo keeps no copy — so
33
+ the steps below change in four places, and only these:
34
+
35
+ - **`assign` writes Azure Boards directly and stamps nothing.** There is no repo record
36
+ to change and no push to follow: §4 does not run, because the `assign` call
37
+ *was* the write.
38
+ - **Take checks Azure Boards, not the file.** Run `assign <spec> --to <id> --if-unassigned`
39
+ first. If it reports the work item is already assigned to someone else, that is
40
+ step 2's colleague: name them, confirm, then run it again without the flag.
41
+ - **No `> **Developer:**` line is written**, by any mode. The tracker names the
42
+ person; a header would be the copy `pull` exists to remove.
43
+ - **§3 is skipped.** The work item's own history records the move, and a
44
+ Changelog line saying who holds it would be that copy again.
45
+
46
+ Everything else stands: the opt-in check, resolving a person through a search
47
+ before a hand-over, and the report. Under `push` (or with ownership unknown)
48
+ nothing in this section applies.
49
+
29
50
  ## 1. Identify the target spec
30
51
 
31
52
  The argument, else the spec in flight for this session, else ask. Unlike
@@ -78,8 +99,26 @@ now".
78
99
  where search is unavailable, confirmed with the user.)
79
100
  2. On several matches, show them and let the user pick. On none, say so and
80
101
  stop — do not fall back to the raw argument as an id.
81
- 3. Stamp it with the resolved id and display name.
82
- 4. Set `> **Developer:**` to that person's **Azure display name**.
102
+ 3. **Make the work reachable before you hand it over.** Run
103
+ `skitterspec spec-env handoff <spec> --json`. A spec's branch lives in a
104
+ local worktree, so without this the work item would name a new owner for code
105
+ only you can see.
106
+ - **`blocked`** — relay the reason. Where it carries an `offer` (uncommitted
107
+ work: `/commit`), offer it once as `offered-unblocks.md` says, run it on a
108
+ yes, then run `handoff` again. With no offer, stop here: nothing is assigned.
109
+ - **`commands`** non-empty — the branch is not published at HEAD. Ask once,
110
+ naming the target: *"push `<branch>` to `<remote>` so <name> can pick it
111
+ up?"* Run it on a yes. On a no, stop: a hand-over the new owner cannot
112
+ reach is not a hand-over, so nothing is assigned.
113
+ - Then post the note it wrote onto the work item:
114
+ `skitterspec spec-sync comment <spec> --file <notePath>`. It names the
115
+ branch, the sha and the phases done, and a comment is the surface no later
116
+ push replaces. A failed post is said and does not stop the hand-over.
117
+
118
+ The new owner's `/spec-start <spec>` resumes from that branch rather than
119
+ forking a fresh one (`spec-env up` sees it on the remote).
120
+ 4. Stamp it with the resolved id and display name.
121
+ 5. Set `> **Developer:**` to that person's **Azure display name**.
83
122
 
84
123
  This is the **one** place the tracker's name reaches the header, and the
85
124
  exception is the whole reason it exists: there is no `git config user.name`
@@ -102,6 +102,29 @@ feature was designed not to disturb.
102
102
 
103
103
  - Tick all completed tasks in the phase files; flip every finished phase-file
104
104
  heading **and** every row in the `00-overview.md` phase index to `✅`.
105
+
106
+ **Who owns this spec's status.** Only when `specs/.core/azure-boards.config.json` exists.
107
+ Run `skitterspec spec-sync ownership --json` once and read both values:
108
+
109
+ - **`workflowState: "pull"`** — Azure Boards is the record of this spec's status, so
110
+ this skill **writes no `> **Status:**` header and appends no State log row**,
111
+ wherever its steps below say to. A spec this skill creates gets neither: its
112
+ header carries `> **Tracker:** <work item url>` instead, filled in once linking
113
+ has stamped the url, and its body has no `## State log` section. Readiness is
114
+ the spec's own content — a `Draft` is a spec whose **Open questions** is not
115
+ empty — so nothing is lost with the header.
116
+ - **`assignee: "pull"`** — Azure Boards holds who is building it, so this skill
117
+ **writes no `> **Developer:**` line** either.
118
+ - **Anything else** — `push`, `none`, sync reported off, or the command failing
119
+ — is cannot-tell, and the steps below run exactly as written.
120
+
121
+ What `pull` leaves alone: the folder move (a bucket records what the repo did to
122
+ the code, not a planning status), the phase files and index, and the Changelog.
123
+ A reason a `Status:` header would have carried — a cancellation's, a knock-back
124
+ to Draft — goes in a dated Changelog line instead. A spec that already carries
125
+ any of these lines keeps them untouched: they are history, and nothing rewrites
126
+ them.
127
+
105
128
  - Set the **Status** header in the entry point:
106
129
  `> **Status:** Complete (<YYYY-MM-DD>)`.
107
130
  - Append a **State log** row:
@@ -136,6 +159,10 @@ PAT is set (see `apply.transport` in `azure-boards.config.md`).
136
159
  complete/cancelled/reviewed in the repo regardless; the mirror is disposable
137
160
  and the next push repairs it. Do not roll anything back, and do not stop to
138
161
  ask.
162
+ - **In `/spec-complete`'s PR mode this push belongs to run 2.** Run 1 readies
163
+ a PR, and a ready PR is not a merged one — so skip it on run 1, even where
164
+ the `branch` lane committed the move to ride the PR, and run it on run 2 once
165
+ the host has merged. The tracker's Done lands when the work does.
139
166
  - **Say what happened** in the skill's report: mirror updated, skipped as
140
167
  unlinked, or failed with the reason.
141
168
  - **There is no unassign step here.** The projection derives the assignee from
@@ -289,6 +316,27 @@ in that order, and stops at the first step that fails:
289
316
  **Then stop: the worktree is kept** (step 7). The branch is what the next
290
317
  `-hotfix.N` is cut from if this deploy fails, so it waits for the deploy.
291
318
 
319
+ **A branch-based hotfix** (`> **Base version:** <branch>@<sha>`, from
320
+ `hotfix.releaseBranch`) runs the same command and the same consent ask — the
321
+ engine picks the path from the header. What differs is what it does:
322
+
323
+ - it **rebases** onto `<remote>/<branch>` and **lands on the release branch** by
324
+ `land.strategy`: under `ff` the push of the hotfix onto that branch *is* the
325
+ land (so the consent ask names the release branch, not only a tag); under `pr`
326
+ it pushes the hotfix branch and opens a **ready** PR, then holds with
327
+ `the PR into <branch> is open` — re-run the same command once it merges;
328
+ - the **tag** is optional (`hotfix.tag`): cut and pushed after the land, or not
329
+ at all;
330
+ - the **carry** goes to the resolved base — the current rc under
331
+ `baseBranchPattern` — directly under `ff`, through a `carry/<slug>` branch and
332
+ its own ready PR under `pr`.
333
+
334
+ `Landed` then names the release branch, how it landed (fast-forward, or the PR
335
+ and whether it merged), the tag if one was cut, and the carry. A PR still
336
+ waiting on its merge is a `⚠️` — the land is not done until the host says so.
337
+ `spec-env hotfix finish` tears it down once both the land and the carry are
338
+ confirmed, naming every check that is not.
339
+
292
340
  ### 6-feature/bug. `Type: Feature` / `Type: Bug` — rebase + fast-forward
293
341
 
294
342
  Land the finished branch on the base branch so the work reaches `main` (or your
@@ -324,6 +372,19 @@ is finished — e.g. to run a later phase in CI or a shared test env? Use
324
372
  `git -C <worktree> rebase --abort`, relay the conflict, and **stop** — leave it
325
373
  to the user; do not tear anything down.
326
374
  On a **no-op** ("already landed"), just say so and continue.
375
+
376
+ **Under a rolling base** (`baseBranchPattern` in `env.config.json`) the plan
377
+ can carry two more things, and both are the engine's to say:
378
+ - a `git -C <mainRepoPath> switch <base>` (or `switch -c … --track`) **first**,
379
+ when the primary checkout still has an older release candidate out — run it
380
+ in order with the rest;
381
+ - a `retarget: forked from <old> · landing onto <new>` line, when the rc
382
+ rolled while this spec was in flight. It is the land working, not a fault:
383
+ relay it verbatim in the `Landed` row so the reader sees where the work went.
384
+
385
+ A refusal naming `no branch matches <pattern>` means no release candidate is
386
+ visible — usually not fetched. Relay it, stop with `⏸`, and name
387
+ `skitterspec spec-env base` (it fetches and lists) as the next step.
327
388
  3. **Run the after-land commands.** Where the plan ends with a
328
389
  `then, in the primary checkout (<path>), run:` section — the project's
329
390
  `afterLand`, such as a data migration — run those commands in that
@@ -343,6 +404,58 @@ is finished — e.g. to run a later phase in CI or a shared test env? Use
343
404
  5. **Report** the landing (base branch, fast-forward result). It **never pushes** —
344
405
  mention the user can `git push` the base branch themselves.
345
406
 
407
+ ### 6-pr. PR mode (`land.strategy: "pr"`) — dispose, push, ready; finish after the merge
408
+
409
+ Completion is **two runs** here, the `hotfix land`/`finish` shape: the merge is
410
+ the host's act and may be days away, so the run that readies the PR cannot also
411
+ finalise. Which run this is, the engine says: `spec-env integrate <name>`
412
+ printing a `(pr)` plan is run 1; printing
413
+ `already landed … — finish what the merge deferred` is run 2.
414
+
415
+ **Run 1 — the last control point.** Once the PR is ready, anyone can merge from
416
+ the host UI and the tracker's automations act — so everything that needs a
417
+ person happens before the ready, in this order:
418
+
419
+ 1. **Disposition pass — mandatory, before anything is pushed.** Run
420
+ `skitterspec spec-env disposition <name> --json`. For every unticked task,
421
+ non-✅ phase and surfaced follow-up it lists, the user disposes it:
422
+ **tick** (it was done — tick it, naming the evidence) · **spin off** (a
423
+ follow-on ticket minted now, linked to this one — offer `/spec` or the
424
+ provider's mint) · **drop** (a dated Changelog line with the reason, the
425
+ `none: <reason>` grammar). Batch the asking; never decide for them, and
426
+ never auto-create. **Refuse to ready the PR while anything is undisposed**
427
+ — you asked the enumeration, so it cannot also be fine. `clean` proceeds
428
+ with nothing asked.
429
+ 2. **Consent, naming the target.** Ask once, plainly:
430
+ *"push `<branch>` and open the PR into `<base>` on `<remote>`, ready for
431
+ merge?"* — the base branch is named so a spec that outlived a release roll
432
+ is caught by the person reading a stale rc name. On a no, stop with the
433
+ held commands relayed.
434
+ 3. **Run the plan.** `skitterspec spec-env integrate <name> --push` and run
435
+ what it prints: fetch, rebase onto `<remote>/<base>`, the push, and the PR
436
+ create — or, where a draft already exists, the flip-to-ready. A rebase
437
+ conflict aborts and stops exactly as 6-feature/bug step 2.
438
+ 4. **Defer the finalise.** §4's bucket move follows the spec documents'
439
+ `land.specDocs` lane: under `trunk` leave the spec in `specs/in-progress/`
440
+ — run 2 moves it on base after the merge; under `branch` commit the move on
441
+ the branch *before* step 3 so it rides the PR. Either way
442
+ **the tracker's Done waits for run 2**: a ready PR is not a merged one.
443
+ 5. **Stop, keeping the worktree.** Report
444
+ `Landed: PR #N opened — finish after merge` (or `ready`), spec
445
+ `In Progress`, worktree standing. No afterLand runs — the plan deferred it
446
+ — and no teardown. The merge is what un-blocks run 2; nothing here waits on
447
+ it.
448
+
449
+ **Run 2 — after the host merges.** `integrate` recognises the landed branch
450
+ (ancestry or the host's answer) and prints the finish: catch local base up and
451
+ the deferred `afterLand` with the land's own range. Run those, then do what run
452
+ 1 deferred — the §4 move (trunk lane) with its State log row and commit, the
453
+ §5 report — then **§7 teardown runs as normal**:
454
+ a host-merged branch counts as landed (squash and rebase
455
+ merges included), and a host that auto-deleted the branch makes the remote
456
+ delete an already-gone no-op, never a failure. Re-test on base before calling
457
+ it done, exactly as 6-feature/bug step 4.
458
+
346
459
  ## 7. Tear down the environment (opt-in, only if configured)
347
460
 
348
461
  **A hotfix is torn down later, by `hotfix finish`.**
@@ -158,6 +158,16 @@ it happens differs (`/spec` writes the spec in Phase B, `/spec-bug` in its step
158
158
 
159
159
  ## 1. Establish the base version (the tag)
160
160
 
161
+ **A release BRANCH instead of a tag.** Where `env.config.json` sets
162
+ `hotfix.releaseBranch` (e.g. `"master"` — a team whose prod is whatever that
163
+ branch holds), there is **no tag to ask for**: skip the questions below and run
164
+ §3's `up` **without `--from`**. The engine fetches, forks from the remote's head
165
+ of that branch, and prints two lines — `fork:` naming the commit, and
166
+ `record: > **Base version:** <branch>@<sha>` — and §5 copies that `record:`
167
+ value into the header **verbatim**. Say which commit it forked from in one line;
168
+ that is the version the fix is built on. The rest of this section is the tag
169
+ flow, unchanged.
170
+
161
171
  - **Read the arguments.** `/spec-hotfix <tag> <name>` (e.g.
162
172
  `/spec-hotfix v33.16.4 login-crash`). An argument shaped like an issue
163
173
  reference — letters, a hyphen, digits (`SKI-123`) —
@@ -275,6 +285,10 @@ installs `.claude/hooks/main-guard.cjs` that first write is refused outright,
275
285
  and a step whose documented opening the repo will not perform is not a step. The
276
286
  spec is written in the worktree at §5, on the branch it belongs to.
277
287
 
288
+ **Branch-based (`hotfix.releaseBranch`):** run the same command **without**
289
+ `--from` — the engine picks the release branch's head and prints the
290
+ `record:` line §5 copies. An explicit `--from` still wins over it.
291
+
278
292
  **§5 records the same tag you passed to `--from`**, on the spec's
279
293
  `> **Base version:**` header. That is not bookkeeping: `/spec-complete` cuts the
280
294
  release and carries the fix off the header, so a worktree forked from one ref and
@@ -313,6 +327,28 @@ you there, so create the folder and write it here. A hotfix
313
327
  is usually a single-pass fix, so the `## Fix` block can live directly in
314
328
  `00-overview.md`. Keep it lean:
315
329
 
330
+ **Who owns this spec's status.** Only when `specs/.core/azure-boards.config.json` exists.
331
+ Run `skitterspec spec-sync ownership --json` once and read both values:
332
+
333
+ - **`workflowState: "pull"`** — Azure Boards is the record of this spec's status, so
334
+ this skill **writes no `> **Status:**` header and appends no State log row**,
335
+ wherever its steps below say to. A spec this skill creates gets neither: its
336
+ header carries `> **Tracker:** <work item url>` instead, filled in once linking
337
+ has stamped the url, and its body has no `## State log` section. Readiness is
338
+ the spec's own content — a `Draft` is a spec whose **Open questions** is not
339
+ empty — so nothing is lost with the header.
340
+ - **`assignee: "pull"`** — Azure Boards holds who is building it, so this skill
341
+ **writes no `> **Developer:**` line** either.
342
+ - **Anything else** — `push`, `none`, sync reported off, or the command failing
343
+ — is cannot-tell, and the steps below run exactly as written.
344
+
345
+ What `pull` leaves alone: the folder move (a bucket records what the repo did to
346
+ the code, not a planning status), the phase files and index, and the Changelog.
347
+ A reason a `Status:` header would have carried — a cancellation's, a knock-back
348
+ to Draft — goes in a dated Changelog line instead. A spec that already carries
349
+ any of these lines keeps them untouched: they are history, and nothing rewrites
350
+ them.
351
+
316
352
  ```markdown
317
353
  # Hotfix: <short title>
318
354
 
@@ -321,7 +357,7 @@ is usually a single-pass fix, so the `## Fix` block can live directly in
321
357
  > **Status:** In Progress — fixing (red test added)
322
358
  > **Author:** <git user.name — who reported/captured it>
323
359
  > **Developer:** <git user.name — you, since you're fixing it now>
324
- > **Base version:** <tag prod is running, e.g. v33.16.4>
360
+ > **Base version:** <tag prod is running, e.g. v33.16.4 — or, branch-based, the `record:` value `up` printed, e.g. master@1a2b3c4d5e6f>
325
361
  > **Raised:** <YYYY-MM-DD (today)>
326
362
  > **Area:** <files/modules>
327
363
  > **Severity:** <Azure's literal values, "1 - Critical" … "4 - Low" — optional;
@@ -400,7 +436,9 @@ is opted in). If it's absent, skip this entirely — the spec stays local-only a
400
436
  the skill behaves exactly as above. When present, link the spec you just wrote
401
437
  so status and discussion live in Boards while the repo stays the source of
402
438
  truth. A spec is a **work item**; each phase is a **child work item**, carrying
403
- that phase's tasks in its description as a read-only markdown checklist.
439
+ that phase's tasks in its description as a read-only markdown checklist. That is the `spec` description mode;
440
+ under `summary` (a new config's default) the issue and each sub-issue carry
441
+ a short block instead, and the phase's tasks stay in git.
404
442
 
405
443
  **Linking is just the first push**, so it runs the same engine path `/spec-push`
406
444
  does — you never create the work item by hand:
@@ -481,6 +519,12 @@ item is a cosmetic gap that `/spec-claim` closes later.
481
519
  skitterspec spec-sync assign <spec> --to <id> --name "<display name>"
482
520
  ```
483
521
 
522
+ **Where `spec-sync ownership` reports `assignee: pull`**, the work item is the
523
+ record and the spec file is not: add `--if-unassigned`. It writes Azure Boards
524
+ directly, claims the work item only when nobody holds it, and stamps nothing —
525
+ so step 4 has no header to leave alone, since under `pull` no `Developer:`
526
+ line was written.
527
+
484
528
  4. **Leave `> **Developer:**` as `git config user.name`** — the step above this
485
529
  seam already set it, and this seam must not overwrite it with the tracker's
486
530
  display name.
@@ -502,12 +546,15 @@ item is a cosmetic gap that `/spec-claim` closes later.
502
546
 
503
547
  **Nothing is pushed here.** `assign` writes the repo only, and the refresh these
504
548
  skills already run sends it. Assignment is an ordinary field of the projection,
505
- not a side errand with its own network call.
549
+ not a side errand with its own network call. Under `pull` the
550
+ `assign` call is itself the write, so there is nothing for a push to carry.
506
551
 
507
552
  **There is no unassign step anywhere.** The projection derives the assignee from
508
553
  the spec's lifecycle bucket, so `/spec-complete` and `/spec-cancel` release the
509
554
  work item through the push they already make. The stamp deliberately stays in
510
- the file: who actioned the work outlives who is currently holding it.
555
+ the file: who actioned the work outlives who is currently holding it. Under `pull`
556
+ the projection carries no assignee at all, so finishing a spec leaves it on
557
+ the work item: the board keeps who did the work.
511
558
 
512
559
  Azure Boards has no project picker: a minted work item lands in the configured
513
560
  `azure.project` by construction, decided once in
@@ -72,6 +72,28 @@ this spec. Without isolation, write where you stand.
72
72
  The spec is a folder in **`specs/in-progress/`** — never backlog — with
73
73
  `00-overview.md` and one phase file:
74
74
 
75
+ **Who owns this spec's status.** Only when `specs/.core/azure-boards.config.json` exists.
76
+ Run `skitterspec spec-sync ownership --json` once and read both values:
77
+
78
+ - **`workflowState: "pull"`** — Azure Boards is the record of this spec's status, so
79
+ this skill **writes no `> **Status:**` header and appends no State log row**,
80
+ wherever its steps below say to. A spec this skill creates gets neither: its
81
+ header carries `> **Tracker:** <work item url>` instead, filled in once linking
82
+ has stamped the url, and its body has no `## State log` section. Readiness is
83
+ the spec's own content — a `Draft` is a spec whose **Open questions** is not
84
+ empty — so nothing is lost with the header.
85
+ - **`assignee: "pull"`** — Azure Boards holds who is building it, so this skill
86
+ **writes no `> **Developer:**` line** either.
87
+ - **Anything else** — `push`, `none`, sync reported off, or the command failing
88
+ — is cannot-tell, and the steps below run exactly as written.
89
+
90
+ What `pull` leaves alone: the folder move (a bucket records what the repo did to
91
+ the code, not a planning status), the phase files and index, and the Changelog.
92
+ A reason a `Status:` header would have carried — a cancellation's, a knock-back
93
+ to Draft — goes in a dated Changelog line instead. A spec that already carries
94
+ any of these lines keeps them untouched: they are history, and nothing rewrites
95
+ them.
96
+
75
97
  ```markdown
76
98
  # Incident: <short title>
77
99
 
@@ -194,10 +194,15 @@ once it is over. Without a provider this is a no-op and nothing below changes.
194
194
  carries an `azure_identifier`. Otherwise skip this step — no config means zero
195
195
  change.
196
196
 
197
- - **No pull.** Azure Boards is a generated mirror in one-way sync, so there is
198
- nothing to bring down before building — the repo is already the source of
199
- truth. (A state a teammate moved in Boards is advisory only; `/spec-status`
200
- surfaces it. It is overwritten on the next push.)
197
+ - **No pull — one look at the board, before building.** Nothing is brought
198
+ down. Run `skitterspec spec-sync board <spec>`: it reads Azure Boards and writes nothing to
199
+ the spec, and it is **silent** unless the work item says Done or Cancelled while
200
+ this spec is still in flight. When it prints a line, relay it once as a
201
+ warning — this session holds the branch, so the cleanup it names is the
202
+ operator's to choose — and **carry on with the build**. Never run that
203
+ cleanup and never refuse on it. A status someone moved anywhere else is the
204
+ board doing its job, and the next push sends a state only when the spec
205
+ itself changes bucket.
201
206
  - **Refresh the mirror now, without asking.** Run `/spec-push`. The spec has just
202
207
  moved to `in-progress` and its phase to `🔄` — both real state changes, and the
203
208
  tracker is a generated mirror of them. This holds under **both**
@@ -213,7 +218,9 @@ change.
213
218
  `assignee` (it does by default; `"none"` declines it). If the spec records
214
219
  nobody and `skitterspec spec-sync whoami --json` answers, stamp it with
215
220
  `skitterspec spec-sync assign <spec> --to <id> --name "<name>"` and let the
216
- push above carry it. If identity is unknown, skip it in silence.
221
+ push above carry it. If identity is unknown, skip it in silence. Where
222
+ `spec-sync ownership` reports `assignee: pull`, add `--if-unassigned`: the
223
+ ticket is the record there, so it is assigned only when nobody holds it.
217
224
  **Do not prompt**: an assignment question in the middle of a build is an
218
225
  interruption with no deadline, and `/spec-claim` answers it whenever the
219
226
  operator likes.
@@ -20,6 +20,13 @@ own (the child's title and state). This skill computes what changed since the
20
20
  last push and applies it — it never reads Boards content back or merges. A
21
21
  person editing the mirror in Boards will see it overwritten on the next push.
22
22
 
23
+ **That is `mapping.description: "spec"`.** Under `"summary"` (what a new
24
+ config is written with) the issue and each sub-issue carry a delimited
25
+ **block** instead — summary, acceptance criteria, surfaces, gating and
26
+ progress for the spec; goal and task count for a phase — spliced in beside
27
+ whatever the team wrote in Azure Boards, which is never overwritten. Only the block
28
+ is the repo's, so only an edit inside it is reported.
29
+
23
30
  **Opt-in**: only runs when `specs/.core/azure-boards.config.json` exists. If
24
31
  absent, tell the user how to enable Azure Boards sync and stop.
25
32
 
@@ -142,6 +149,21 @@ configured `azure.project` by construction.
142
149
 
143
150
  ## 4a. Apply it yourself — the MCP path (order matters)
144
151
 
152
+ **In summary mode, every body you write is the engine's splice — never the plan's text on its own.**
153
+ Only when the plan's `descriptionMode` is
154
+ `summary` (it is always present; `spec` needs none of this). There
155
+ the plan's `description` and each sub-issue's `goal` are a **block**, and the
156
+ issue's body is the block *plus the team's text around it*. Writing the block
157
+ alone deletes that text. So, for each object you are about to write:
158
+
159
+ 1. Save the body Azure Boards holds now to a file — an empty file for one you are
160
+ creating.
161
+ 2. `skitterspec spec-sync splice <spec> --live <file>` for the spec issue, or
162
+ `… --phase <ref>` for a phase's sub-issue.
163
+ 3. Write **exactly what it prints**. A non-zero exit printed nothing and means
164
+ a delimiter was edited by hand: skip that object's body, write its other
165
+ fields, and name it in the report. Never compose the splice yourself.
166
+
145
167
  **First, check whether you are about to overwrite someone.** On the API path
146
168
  `apply` does this for itself, off the read-back it already makes. On the MCP
147
169
  path nothing has read the item yet, so ask before you write:
@@ -43,6 +43,11 @@ trust the spec's own wording — verify:
43
43
  - **Decisions still valid.** Re-check each `## Decisions` entry against the
44
44
  current architecture and `.claude/rules/*.md`. Flag any that now conflict with
45
45
  how the codebase actually works (a changed convention, a superseded approach).
46
+ - **The ticket-facing pair.** A spec with no `## Summary` or no
47
+ `## Acceptance criteria` is not broken — older specs predate both — but where
48
+ a ticketing provider pushes summaries the ticket falls back to the Problem's
49
+ first paragraph and shows no definition of done. Offer to write the missing
50
+ one(s) in step 3, with a draft; never add them unasked.
46
51
  - **New constraints.** Note rules/patterns introduced since the spec was written
47
52
  that it must now honour (e.g. a new required field, a new error type, a new
48
53
  pattern the rest of the code now follows).
@@ -96,6 +101,29 @@ resolve it by reading the code, do that instead of asking.
96
101
  - Add a dated **Changelog** entry summarising the review (e.g. `- <date> —
97
102
  Reviewed vs codebase: retargeted Phase 2 onto X, dropped Y (removed), ticked Z
98
103
  (already done)`).
104
+
105
+ **Who owns this spec's status.** Only when `specs/.core/azure-boards.config.json` exists.
106
+ Run `skitterspec spec-sync ownership --json` once and read both values:
107
+
108
+ - **`workflowState: "pull"`** — Azure Boards is the record of this spec's status, so
109
+ this skill **writes no `> **Status:**` header and appends no State log row**,
110
+ wherever its steps below say to. A spec this skill creates gets neither: its
111
+ header carries `> **Tracker:** <work item url>` instead, filled in once linking
112
+ has stamped the url, and its body has no `## State log` section. Readiness is
113
+ the spec's own content — a `Draft` is a spec whose **Open questions** is not
114
+ empty — so nothing is lost with the header.
115
+ - **`assignee: "pull"`** — Azure Boards holds who is building it, so this skill
116
+ **writes no `> **Developer:**` line** either.
117
+ - **Anything else** — `push`, `none`, sync reported off, or the command failing
118
+ — is cannot-tell, and the steps below run exactly as written.
119
+
120
+ What `pull` leaves alone: the folder move (a bucket records what the repo did to
121
+ the code, not a planning status), the phase files and index, and the Changelog.
122
+ A reason a `Status:` header would have carried — a cancellation's, a knock-back
123
+ to Draft — goes in a dated Changelog line instead. A spec that already carries
124
+ any of these lines keeps them untouched: they are history, and nothing rewrites
125
+ them.
126
+
99
127
  - **Status:** if drift is minor, leave status as-is. If a `Ready` spec needs real
100
128
  re-grooming, knock it back to `Draft` (set `> **Status:** Draft` and append a
101
129
  **State log** row).
@@ -119,6 +147,10 @@ PAT is set (see `apply.transport` in `azure-boards.config.md`).
119
147
  complete/cancelled/reviewed in the repo regardless; the mirror is disposable
120
148
  and the next push repairs it. Do not roll anything back, and do not stop to
121
149
  ask.
150
+ - **In `/spec-complete`'s PR mode this push belongs to run 2.** Run 1 readies
151
+ a PR, and a ready PR is not a merged one — so skip it on run 1, even where
152
+ the `branch` lane committed the move to ride the PR, and run it on run 2 once
153
+ the host has merged. The tracker's Done lands when the work does.
122
154
  - **Say what happened** in the skill's report: mirror updated, skipped as
123
155
  unlinked, or failed with the reason.
124
156
  - **There is no unassign step here.** The projection derives the assignee from