@skitterbyte/skitterspec-azure-boards 1.0.0 → 1.2.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.
- package/assets/core/azure-boards.config.json.example +4 -1
- package/assets/core/azure-boards.config.md +2 -0
- package/assets/core/env.config.md +49 -0
- package/assets/skills/no-spec/SKILL.md +6 -3
- package/assets/skills/spec/SKILL.md +20 -14
- package/assets/skills/spec-azure-setup/SKILL.md +17 -4
- package/assets/skills/spec-bug/SKILL.md +20 -14
- package/assets/skills/spec-complete/SKILL.md +6 -3
- package/assets/skills/spec-hotfix/SKILL.md +20 -14
- package/assets/skills/spec-to-main/SKILL.md +5 -3
- package/bin/skitterspec-azure-boards.js +7 -0
- package/package.json +1 -1
- package/src/cli.js +58 -6
- package/src/env/config.js +111 -14
- package/src/env/glob.js +34 -0
- package/src/env/hotfix.js +4 -2
- package/src/env/integrate.js +52 -11
- package/src/env/live.js +1 -26
- package/src/vendor/azure-boards/api.js +28 -15
- package/src/vendor/azure-boards/cli-sync.js +138 -15
- package/src/vendor/azure-boards/config.js +33 -4
- package/src/vendor/azure-boards/dialect.js +19 -2
- package/src/vendor/azure-boards/identity.js +5 -3
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
"orgUrl": "https://dev.azure.com/your-org",
|
|
4
4
|
"project": "your-project",
|
|
5
5
|
"workItemType": "Issue",
|
|
6
|
+
"workItemTypeByKind": {},
|
|
6
7
|
"childType": "Task",
|
|
7
8
|
"areaPath": ""
|
|
8
9
|
},
|
|
@@ -15,7 +16,9 @@
|
|
|
15
16
|
"intake": {
|
|
16
17
|
"tag": "",
|
|
17
18
|
"bugTags": ["bug"],
|
|
18
|
-
"hotfixTags": []
|
|
19
|
+
"hotfixTags": [],
|
|
20
|
+
"bugTypes": ["Bug"],
|
|
21
|
+
"hotfixTypes": []
|
|
19
22
|
},
|
|
20
23
|
"auth": {
|
|
21
24
|
"tokenEnv": "AZURE_DEVOPS_EXT_PAT"
|
|
@@ -9,11 +9,13 @@ env-var NAMES — never a credential. Credentials live in the user-level store
|
|
|
9
9
|
| `azure.orgUrl` | The organization (`https://dev.azure.com/<org>`). Also keys the credentials-store entry. | `""` |
|
|
10
10
|
| `azure.project` | The project spec work items land in. | `""` |
|
|
11
11
|
| `azure.workItemType` | The work item type a spec mints as. Types are process-defined (Basic: `Issue`; Agile: `User Story`; custom anything), so this is config, not a constant. | `"Issue"` |
|
|
12
|
+
| `azure.workItemTypeByKind` | The mint type per spec kind — `feature`, `bug`, `hotfix`, read off the spec folder's prefix — falling back to `azure.workItemType`. In Agile/Scrum/CMMI a bug is a type, so `{ "bug": "Bug", "hotfix": "Bug" }` keeps `/spec-bug` and `/spec-hotfix` out of the story backlog. Each named type's states are validated like the base pair's. | `{}` |
|
|
12
13
|
| `azure.childType` | The type a phase mints as, linked parent/child under the spec's item. | `"Task"` |
|
|
13
14
|
| `azure.areaPath` | Optional area path for minted items; empty means the project default. | `""` |
|
|
14
15
|
| `mapping.specFolder` / `mapping.phases` / `mapping.tasks` | Spec → work item, phase → child item, tasks → markdown checklist. Same modes as the other providers (`subissue` \| `deferred` \| `inline`; `checklist` \| `none`). | `issue` / `subissue` / `checklist` |
|
|
15
16
|
| `states.<bucket>` | The Boards STATE name for each lifecycle bucket, per the project's own process. Moves are direct `System.State` writes; a state the process refuses is a named refusal listing the states the type has. `cancelled` defaults to `Done` because the Basic process carries no Cancelled state. | see example |
|
|
16
17
|
| `intake.tag` / `intake.bugTags` / `intake.hotfixTags` | Intake routes an adopted work item by its tags (Boards has tags, not labels): the inbox filter, and the routes to `/spec-bug` and `/spec-hotfix`. Empty lists route nothing. | `""` / `["bug"]` / `[]` |
|
|
18
|
+
| `intake.bugTypes` / `intake.hotfixTypes` | The same routes, keyed on the item's work item TYPE — in Agile/Scrum/CMMI a bug is a type, not a tag, so an untagged `Bug` still reaches `/spec-bug`. A match on either axis routes, hotfix wins over bug, and an explicit `[]` opts type routing out. | `["Bug"]` / `[]` |
|
|
17
19
|
| `auth.tokenEnv` | The env-var NAME for the PAT — the official CLI's by default, so a machine set up for `az boards` needs nothing new. Work Items (Read & Write) covers everything but identity search, which wants Identity (Read). | `AZURE_DEVOPS_EXT_PAT` |
|
|
18
20
|
| `refs.foreignPatterns` | Ref shapes that are KNOWN HISTORY rather than unreferenced commits — a repo migrating off another tracker lists its old key here (e.g. `"ERQ-\\d+"`). | `[]` |
|
|
19
21
|
| `releases.workItemType` / `releases.series` | The release seam's carrier: one work item of this type per release, found by title, its state moved through each series' `envs` map by `release deployed`. | `"Release"` / `[]` |
|
|
@@ -143,6 +143,10 @@ through to a documented conservative default; see the field notes below.
|
|
|
143
143
|
// exits non-zero; [] = none. Each string is a shell command; {slug}/{branch}/{worktreePath}/{projectName}/{portOffset}
|
|
144
144
|
// expand (the cwd is already the worktree, so {worktreePath} is usually
|
|
145
145
|
// redundant). Example: ["pnpm install --frozen-lockfile"].
|
|
146
|
+
// An entry may also be { "run": "<cmd>", "when": ["<glob>", ...] }. `when` is
|
|
147
|
+
// IGNORED here — a fresh worktree always runs every setup step — and exists
|
|
148
|
+
// so `afterLand` can re-run that step after a land that changes its inputs
|
|
149
|
+
// (`{ "setup": true }`, below).
|
|
146
150
|
"setup": [],
|
|
147
151
|
|
|
148
152
|
// Commands to run in the PRIMARY checkout after a land — the counterpart of
|
|
@@ -160,6 +164,51 @@ through to a documented conservative default; see the field notes below.
|
|
|
160
164
|
// failure, report it as a caveat, and never undo the land or block
|
|
161
165
|
// teardown. Literal strings — tokens are NOT expanded, because they run on
|
|
162
166
|
// the base branch where a spec's {slug} or {portOffset} mean nothing.
|
|
167
|
+
//
|
|
168
|
+
// CONDITIONAL ENTRIES. A plain string always runs. An entry may instead be
|
|
169
|
+
// { "run": "<cmd>", "when": ["<glob>", ...] } (a single string `when` is
|
|
170
|
+
// fine), which runs only when the land changes a file one of its globs
|
|
171
|
+
// matches — so a generate or an install costs nothing on a land that does
|
|
172
|
+
// not need it, and is not forgotten on one that does:
|
|
173
|
+
//
|
|
174
|
+
// "afterLand": [
|
|
175
|
+
// { "run": "pnpm install --frozen-lockfile", "when": ["pnpm-lock.yaml", "**/package.json"] },
|
|
176
|
+
// { "run": "pnpm run db:generate", "when": ["prisma/schema.prisma"] },
|
|
177
|
+
// "pnpm db:data-migration"
|
|
178
|
+
// ]
|
|
179
|
+
//
|
|
180
|
+
// Globs are repo-relative: `*` stays within a directory, `**` crosses them
|
|
181
|
+
// (`**/package.json` matches the root one too), `?` is one character. An
|
|
182
|
+
// entry whose `when` holds no usable glob is DROPPED, never widened to
|
|
183
|
+
// always-run.
|
|
184
|
+
// The changed files are what the land brings into the base branch:
|
|
185
|
+
// `base...branch` for `integrate` (read before the rebase, so it is the
|
|
186
|
+
// branch's own changes), and the carried fix commits — minus the release's
|
|
187
|
+
// version commit — for `hotfix land`.
|
|
188
|
+
// When that cannot be known, the conditional entries RUN. That is the
|
|
189
|
+
// "already landed" plan (the land happened elsewhere, so its range is not
|
|
190
|
+
// here) and any diff git would not answer. A redundant generate costs
|
|
191
|
+
// seconds; a skipped one leaves the base red with nothing pointing at why.
|
|
192
|
+
// A land that changed no files is known, not unknown, and skips them.
|
|
193
|
+
// The plan says why for every entry: a matched one ends in
|
|
194
|
+
// `# <path> changed`, an unknown one in `# range unknown` with a line saying
|
|
195
|
+
// so, and the rest are listed under `skipped (nothing in the land matched):`
|
|
196
|
+
// with their globs. The reason is a shell comment, so a line run as printed
|
|
197
|
+
// stays one command. Skipped lines are information — run only the list
|
|
198
|
+
// under `then, … run`.
|
|
199
|
+
//
|
|
200
|
+
// REUSING A SETUP STEP. `{ "setup": true }` expands, in place, to every
|
|
201
|
+
// `setup` entry that declares `when`, so the trigger lives in one list:
|
|
202
|
+
//
|
|
203
|
+
// "setup": [
|
|
204
|
+
// { "run": "pnpm install --frozen-lockfile", "when": ["pnpm-lock.yaml", "**/package.json"] },
|
|
205
|
+
// { "run": "pnpm run db:generate", "when": ["prisma/schema.prisma"] }
|
|
206
|
+
// ],
|
|
207
|
+
// "afterLand": [{ "setup": true }, "pnpm db:data-migration"]
|
|
208
|
+
//
|
|
209
|
+
// Plain setup strings carry no trigger and are never pulled in. The command
|
|
210
|
+
// is copied literally — afterLand expands no tokens — so a setup step that
|
|
211
|
+
// relies on {slug}-style tokens is a poor one to reuse.
|
|
163
212
|
"afterLand": [],
|
|
164
213
|
|
|
165
214
|
// Host dev servers `spec-env dev up <spec>` starts on the spec's port block
|
|
@@ -174,7 +174,10 @@ three, in that order — never the bare `page:` path.
|
|
|
174
174
|
**Between the two, run the after-land commands.** Where the `integrate` plan
|
|
175
175
|
ends with a `then, in the primary checkout (<path>), run:` section — the
|
|
176
176
|
project's `afterLand` — run those commands there, in order, once the
|
|
177
|
-
fast-forward has succeeded, and on an already-landed no-op too.
|
|
177
|
+
fast-forward has succeeded, and on an already-landed no-op too. Run only the
|
|
178
|
+
lines under that heading; a `skipped (nothing in the land matched):` block
|
|
179
|
+
lists conditional entries this land did not need, and is information, never
|
|
180
|
+
commands. A lockfile
|
|
178
181
|
refresh is exactly the land that needs them.
|
|
179
182
|
**Stop at the first non-zero exit**: the run becomes `⚠️`, naming the command that failed and the ones that
|
|
180
183
|
did not run, and it **never undoes the land and never stops the `down`**.
|
|
@@ -205,8 +208,8 @@ the shape; this section carries only what is specific here.
|
|
|
205
208
|
|
|
206
209
|
- `✅` — the work is done, the tests are green, and the verdict was acted on.
|
|
207
210
|
- `⚠️` — done and green, with something worth knowing — an after-land command
|
|
208
|
-
that failed, for one. `Notes` carries what the after-land commands ran
|
|
209
|
-
where they stopped; nothing about them when none are configured.
|
|
211
|
+
that failed, for one. `Notes` carries what the after-land commands ran and
|
|
212
|
+
skipped, or where they stopped; nothing about them when none are configured.
|
|
210
213
|
- `❌` — the tests are red, or the land failed part-way. Quote the failure and
|
|
211
214
|
say what is standing.
|
|
212
215
|
- `⏸` — refused before acting: no name given, the name is already a spec, the
|
|
@@ -43,26 +43,32 @@ Then:
|
|
|
43
43
|
description, tags, reporter, URL. If Azure isn't connected, say so and offer
|
|
44
44
|
to carry on without it — a spec written from the user's own description is
|
|
45
45
|
still a spec.
|
|
46
|
-
3. **Route the item to the right skill.** Match the item's
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
46
|
+
3. **Route the item to the right skill.** Match the item's work item **TYPE**
|
|
47
|
+
against `intake.hotfixTypes`/`intake.bugTypes` and its **TAGS**
|
|
48
|
+
(case-insensitively — Boards has tags, not labels) against
|
|
49
|
+
`intake.hotfixTags`/`intake.bugTags`, **checking the hotfix lists first**.
|
|
50
|
+
A match on *either* axis routes; the type check exists because in the
|
|
51
|
+
Agile, Scrum and CMMI processes a bug is a **type**, not a tag, so a
|
|
52
|
+
support-filed `Bug` with no tags at all still belongs in `/spec-bug`:
|
|
53
|
+
|
|
54
|
+
- **`intake.hotfixTypes` or `intake.hotfixTags`** → this is broken in
|
|
55
|
+
**production**, so it needs a fix against the released version, not
|
|
56
|
+
`main`. Say so, name the matching type or tag, and tell the user to run
|
|
57
|
+
**`/spec-hotfix <ITEM-REF>`** — then stop.
|
|
58
|
+
- **`intake.bugTypes` or `intake.bugTags`** → a bug report, not a feature
|
|
59
|
+
request. Say so, name the matching type or tag, and tell the user to run
|
|
60
|
+
**`/spec-bug <ITEM-REF>`** — then stop, without authoring a Feature spec.
|
|
61
|
+
|
|
62
|
+
**Hotfix wins when an item matches both**, and deliberately: production is the
|
|
58
63
|
more specific destination, and the two mistakes are not equally costly. Routing
|
|
59
64
|
a prod issue to `/spec-bug` produces a fix that lands on `main` and never
|
|
60
65
|
reaches the running version — discovered only when someone asks why it hasn't
|
|
61
66
|
shipped. The reverse is a hotfix branch for something that could have waited,
|
|
62
67
|
which is merely wasteful.
|
|
63
68
|
|
|
64
|
-
|
|
65
|
-
|
|
69
|
+
`bugTypes` defaults to `["Bug"]`; an explicit empty list opts type routing
|
|
70
|
+
out. With a tag list unset, nothing routes through it; with every list
|
|
71
|
+
empty, each item is treated as a feature request, exactly as before.
|
|
66
72
|
|
|
67
73
|
**Which checks run depends on where you are**, because a skip is about not
|
|
68
74
|
bouncing someone to the skill they are already in — not about ignoring an
|
|
@@ -92,6 +92,15 @@ these are config rather than constants:
|
|
|
92
92
|
Basic process's); an Agile project usually wants `User Story`.
|
|
93
93
|
- **`azure.childType`** — the type a phase mints as, created as a hierarchy
|
|
94
94
|
child. Default **Task**.
|
|
95
|
+
- **`azure.workItemTypeByKind`** — the mint type per spec kind, falling back
|
|
96
|
+
to `workItemType`. Ask it wherever the process HAS a `Bug` type (Agile,
|
|
97
|
+
Scrum, CMMI): a `/spec-bug` or `/spec-hotfix` minting a `User Story` files
|
|
98
|
+
the bug in the wrong backlog, and `{ "bug": "Bug", "hotfix": "Bug" }` is the
|
|
99
|
+
usual answer there. On Basic (no Bug type) say nothing and leave it empty.
|
|
100
|
+
- **`intake.bugTypes`** / **`intake.hotfixTypes`** — the same processes route
|
|
101
|
+
intake by TYPE as well as tag: `bugTypes` defaults to `["Bug"]`, so an
|
|
102
|
+
untagged Bug-type item reaches `/spec-bug` without anyone remembering a tag
|
|
103
|
+
convention. Confirm the default; an explicit `[]` opts type routing out.
|
|
95
104
|
|
|
96
105
|
Offer the defaults and take yes for an answer — this is a confirmation, not an
|
|
97
106
|
interrogation.
|
|
@@ -130,6 +139,7 @@ flag in step 6.
|
|
|
130
139
|
skitterspec spec-sync init-config \
|
|
131
140
|
--org-url https://dev.azure.com/<org> --project <project> \
|
|
132
141
|
[--work-item-type Issue] [--child-type Task] \
|
|
142
|
+
[--kind-type <kind>=<Type> …] [--bug-type <Type> …] [--hotfix-type <Type> …] \
|
|
133
143
|
[--state <bucket>=<name> …] [--force] [--json]
|
|
134
144
|
```
|
|
135
145
|
|
|
@@ -147,11 +157,14 @@ right, so don't paraphrase it into "done".
|
|
|
147
157
|
**Only when `specs/.core/env.config.json` exists** (per-spec isolation is on).
|
|
148
158
|
If it is absent, skip this — there is nothing to configure.
|
|
149
159
|
|
|
150
|
-
**Check before you write —
|
|
160
|
+
**Check before you write — most projects need nothing here.** When this
|
|
151
161
|
superset's `init --isolation` wrote the `env.config.json`, both keys below are
|
|
152
|
-
seeded
|
|
153
|
-
|
|
154
|
-
|
|
162
|
+
seeded — and even where they are absent, the superset binary now defaults them
|
|
163
|
+
at runtime, so an `env.config.json` that simply omits them already claims the
|
|
164
|
+
snapshot. The one case left is a file that sets them **explicitly to another
|
|
165
|
+
provider's values** (a migration — Linear-era `linear-base`/`linear_identifier`
|
|
166
|
+
is the live example); `spec-sync apply` prints a note naming the exact keys
|
|
167
|
+
whenever the snapshot it wrote is not claimed, so follow that note.
|
|
155
168
|
|
|
156
169
|
`/spec-start` commits an uncommitted spec for you, but only the paths it can
|
|
157
170
|
prove belong to that spec. Its own folder always does; this repo's per-spec
|
|
@@ -42,26 +42,32 @@ Then:
|
|
|
42
42
|
description, tags, reporter, URL. If Azure isn't connected, say so and offer
|
|
43
43
|
to carry on without it — a spec written from the user's own description is
|
|
44
44
|
still a spec.
|
|
45
|
-
3. **Route the item to the right skill.** Match the item's
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
45
|
+
3. **Route the item to the right skill.** Match the item's work item **TYPE**
|
|
46
|
+
against `intake.hotfixTypes`/`intake.bugTypes` and its **TAGS**
|
|
47
|
+
(case-insensitively — Boards has tags, not labels) against
|
|
48
|
+
`intake.hotfixTags`/`intake.bugTags`, **checking the hotfix lists first**.
|
|
49
|
+
A match on *either* axis routes; the type check exists because in the
|
|
50
|
+
Agile, Scrum and CMMI processes a bug is a **type**, not a tag, so a
|
|
51
|
+
support-filed `Bug` with no tags at all still belongs in `/spec-bug`:
|
|
52
|
+
|
|
53
|
+
- **`intake.hotfixTypes` or `intake.hotfixTags`** → this is broken in
|
|
54
|
+
**production**, so it needs a fix against the released version, not
|
|
55
|
+
`main`. Say so, name the matching type or tag, and tell the user to run
|
|
56
|
+
**`/spec-hotfix <ITEM-REF>`** — then stop.
|
|
57
|
+
- **`intake.bugTypes` or `intake.bugTags`** → a bug report, not a feature
|
|
58
|
+
request. Say so, name the matching type or tag, and tell the user to run
|
|
59
|
+
**`/spec-bug <ITEM-REF>`** — then stop, without authoring a Feature spec.
|
|
60
|
+
|
|
61
|
+
**Hotfix wins when an item matches both**, and deliberately: production is the
|
|
57
62
|
more specific destination, and the two mistakes are not equally costly. Routing
|
|
58
63
|
a prod issue to `/spec-bug` produces a fix that lands on `main` and never
|
|
59
64
|
reaches the running version — discovered only when someone asks why it hasn't
|
|
60
65
|
shipped. The reverse is a hotfix branch for something that could have waited,
|
|
61
66
|
which is merely wasteful.
|
|
62
67
|
|
|
63
|
-
|
|
64
|
-
|
|
68
|
+
`bugTypes` defaults to `["Bug"]`; an explicit empty list opts type routing
|
|
69
|
+
out. With a tag list unset, nothing routes through it; with every list
|
|
70
|
+
empty, each item is treated as a feature request, exactly as before.
|
|
65
71
|
|
|
66
72
|
**Which checks run depends on where you are**, because a skip is about not
|
|
67
73
|
bouncing someone to the skill they are already in — not about ignoring an
|
|
@@ -170,8 +170,8 @@ the shape; this section carries only what is specific here.
|
|
|
170
170
|
**Fields:** `Tracker` · `Spec` · `Tests` · `Notes` · `Landed` · `Worktree` ·
|
|
171
171
|
`Follow-ups` · `Next`
|
|
172
172
|
|
|
173
|
-
`Notes` carries the after-land commands step 6 ran, and where
|
|
174
|
-
failure, the command that failed and the ones that did not run. A project with
|
|
173
|
+
`Notes` carries the after-land commands step 6 ran, and where, and any it
|
|
174
|
+
skipped because the land matched no `when` — or, on a failure, the command that failed and the ones that did not run. A project with
|
|
175
175
|
no `afterLand` says nothing about it.
|
|
176
176
|
|
|
177
177
|
**Report this spec and no other.** A completion is the moment it is most
|
|
@@ -288,7 +288,10 @@ is finished — e.g. to run a later phase in CI or a shared test env? Use
|
|
|
288
288
|
3. **Run the after-land commands.** Where the plan ends with a
|
|
289
289
|
`then, in the primary checkout (<path>), run:` section — the project's
|
|
290
290
|
`afterLand`, such as a data migration — run those commands in that
|
|
291
|
-
directory, in order, after the fast-forward succeeds.
|
|
291
|
+
directory, in order, after the fast-forward succeeds. Run only the lines under that
|
|
292
|
+
heading; a `skipped (nothing in the land matched):` block lists conditional
|
|
293
|
+
entries this land did not need, and is information, never commands.
|
|
294
|
+
**Also on the no-op**:
|
|
292
295
|
the engine prints them there deliberately, because a land made on another
|
|
293
296
|
machine leaves them pending here. **Stop at the first non-zero exit** — a
|
|
294
297
|
later command may depend on it — and carry on with the rest of the skill:
|
|
@@ -49,26 +49,32 @@ Then:
|
|
|
49
49
|
description, tags, reporter, URL. If Azure isn't connected, say so and offer
|
|
50
50
|
to carry on without it — a spec written from the user's own description is
|
|
51
51
|
still a spec.
|
|
52
|
-
3. **Route the item to the right skill.** Match the item's
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
52
|
+
3. **Route the item to the right skill.** Match the item's work item **TYPE**
|
|
53
|
+
against `intake.hotfixTypes`/`intake.bugTypes` and its **TAGS**
|
|
54
|
+
(case-insensitively — Boards has tags, not labels) against
|
|
55
|
+
`intake.hotfixTags`/`intake.bugTags`, **checking the hotfix lists first**.
|
|
56
|
+
A match on *either* axis routes; the type check exists because in the
|
|
57
|
+
Agile, Scrum and CMMI processes a bug is a **type**, not a tag, so a
|
|
58
|
+
support-filed `Bug` with no tags at all still belongs in `/spec-bug`:
|
|
59
|
+
|
|
60
|
+
- **`intake.hotfixTypes` or `intake.hotfixTags`** → this is broken in
|
|
61
|
+
**production**, so it needs a fix against the released version, not
|
|
62
|
+
`main`. Say so, name the matching type or tag, and tell the user to run
|
|
63
|
+
**`/spec-hotfix <ITEM-REF>`** — then stop.
|
|
64
|
+
- **`intake.bugTypes` or `intake.bugTags`** → a bug report, not a feature
|
|
65
|
+
request. Say so, name the matching type or tag, and tell the user to run
|
|
66
|
+
**`/spec-bug <ITEM-REF>`** — then stop, without authoring a Feature spec.
|
|
67
|
+
|
|
68
|
+
**Hotfix wins when an item matches both**, and deliberately: production is the
|
|
64
69
|
more specific destination, and the two mistakes are not equally costly. Routing
|
|
65
70
|
a prod issue to `/spec-bug` produces a fix that lands on `main` and never
|
|
66
71
|
reaches the running version — discovered only when someone asks why it hasn't
|
|
67
72
|
shipped. The reverse is a hotfix branch for something that could have waited,
|
|
68
73
|
which is merely wasteful.
|
|
69
74
|
|
|
70
|
-
|
|
71
|
-
|
|
75
|
+
`bugTypes` defaults to `["Bug"]`; an explicit empty list opts type routing
|
|
76
|
+
out. With a tag list unset, nothing routes through it; with every list
|
|
77
|
+
empty, each item is treated as a feature request, exactly as before.
|
|
72
78
|
|
|
73
79
|
**Which checks run depends on where you are**, because a skip is about not
|
|
74
80
|
bouncing someone to the skill they are already in — not about ignoring an
|
|
@@ -91,7 +91,9 @@ and continue — the branch has no commits base doesn't already have.
|
|
|
91
91
|
`then, in the primary checkout (<path>), run:` section — the project's
|
|
92
92
|
`afterLand`, such as a data migration — run those commands in that directory,
|
|
93
93
|
in order, after the fast-forward and **before** the re-test below, which may
|
|
94
|
-
need them. Run
|
|
94
|
+
need them. Run only the lines under that heading; a
|
|
95
|
+
`skipped (nothing in the land matched):` block lists conditional entries this
|
|
96
|
+
land did not need, and is information, never commands. Run them on the no-op too: the engine prints them there because a
|
|
95
97
|
land made elsewhere leaves them pending here.
|
|
96
98
|
**Stop at the first non-zero exit**, and carry on with §5: a failure makes the run `⚠️`, naming the command
|
|
97
99
|
that failed and the ones that did not run, and it **never undoes the land**.
|
|
@@ -129,8 +131,8 @@ the shape; this section carries only what is specific here.
|
|
|
129
131
|
|
|
130
132
|
**Fields:** `Branch` · `Tests` · `Notes` · `Landed` · `Follow-ups` · `Next`
|
|
131
133
|
|
|
132
|
-
`Notes` carries the after-land commands §4 ran, and where
|
|
133
|
-
failed and the ones that did not run. Nothing about it when none are
|
|
134
|
+
`Notes` carries the after-land commands §4 ran, and where, and any it
|
|
135
|
+
skipped because the land matched no `when` — or the one that failed and the ones that did not run. Nothing about it when none are
|
|
134
136
|
configured.
|
|
135
137
|
|
|
136
138
|
**No `Spec` field, deliberately.** This skill changes no status and moves no
|
|
@@ -21,6 +21,13 @@ if (!existsSync(join(__dirname, '..', 'src'))) {
|
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
const { run, HELP } = require('../src/cli.js')
|
|
24
|
+
|
|
25
|
+
// The provider's isolation defaults, registered beneath the project's own
|
|
26
|
+
// env.config.json so `spec-env stage` claims this provider's snapshot sidecar
|
|
27
|
+
// without a hand edit (see common src/env/config.js, setProviderEnvDefaults).
|
|
28
|
+
require('../src/env/config.js').setProviderEnvDefaults(
|
|
29
|
+
require('../src/vendor/azure-boards/config.js').ENV_CONFIG_DEFAULTS,
|
|
30
|
+
)
|
|
24
31
|
const {
|
|
25
32
|
PROVIDER_COMMANDS,
|
|
26
33
|
providerHelpSection,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@skitterbyte/skitterspec-azure-boards",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"description": "Spec-driven development for Claude Code, with one-way Azure Boards sync — a superset of @skitterbyte/skitterspec: the base filesystem workflow plus /spec-status · /spec-push · /spec-claim and the spec-sync CLI, mirroring specs to Azure DevOps work items with parent/child hierarchy, assignment and a release work item per tag. The repo is canonical; Boards is a generated mirror. Install this OR the base OR one other superset — exactly one.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"claude",
|
package/src/cli.js
CHANGED
|
@@ -1920,6 +1920,7 @@ function specEnvIntegrate(dir, config, specArg) {
|
|
|
1920
1920
|
aheadOfBase: cahead !== null && Number(cahead) > 0,
|
|
1921
1921
|
checkoutPath: dir,
|
|
1922
1922
|
onBranch: cgit(['rev-parse', '--abbrev-ref', 'HEAD']) === spec.branch,
|
|
1923
|
+
changedFiles: landRange(cgit, base, spec.branch),
|
|
1923
1924
|
})
|
|
1924
1925
|
if (cplan.blocked) {
|
|
1925
1926
|
process.stdout.write(`spec-env integrate: blocked — ${cplan.reason}.\n`)
|
|
@@ -2017,6 +2018,7 @@ function specEnvIntegrate(dir, config, specArg) {
|
|
|
2017
2018
|
base,
|
|
2018
2019
|
aheadOfBase,
|
|
2019
2020
|
mainRepoPath: dir,
|
|
2021
|
+
changedFiles: landRange(gitReader(dir), base, spec.branch),
|
|
2020
2022
|
})
|
|
2021
2023
|
|
|
2022
2024
|
if (plan.blocked) {
|
|
@@ -2043,13 +2045,47 @@ function specEnvIntegrate(dir, config, specArg) {
|
|
|
2043
2045
|
process.stdout.write(out.join('\n') + '\n' + afterLandSection(plan.afterLand))
|
|
2044
2046
|
}
|
|
2045
2047
|
|
|
2048
|
+
// The files a land brings into the base branch: `base...branch`, merge-base to
|
|
2049
|
+
// the branch tip. Read before the rebase runs, so it is the branch's own
|
|
2050
|
+
// changes — `base..branch` would also list what the base gained meanwhile and
|
|
2051
|
+
// over-match. A diff git would not answer is null: unknown, never empty.
|
|
2052
|
+
function landRange(git, base, branch) {
|
|
2053
|
+
const out = git(['diff', '--name-only', `${base}...${branch}`])
|
|
2054
|
+
if (out === null) return null
|
|
2055
|
+
return out.split('\n').map((l) => l.trim()).filter(Boolean)
|
|
2056
|
+
}
|
|
2057
|
+
|
|
2046
2058
|
// The `afterLand` commands, as a section printed after a land plan — or after
|
|
2047
2059
|
// integrate's already-landed line. Empty string when none apply, so a project
|
|
2048
|
-
// without the key sees exactly the output it always has
|
|
2060
|
+
// without the key sees exactly the output it always has, and one of plain
|
|
2061
|
+
// strings sees exactly what it saw before entries could be conditional.
|
|
2049
2062
|
function afterLandSection(afterLand) {
|
|
2050
|
-
if (!afterLand || !afterLand.
|
|
2051
|
-
const
|
|
2052
|
-
|
|
2063
|
+
if (!afterLand || !afterLand.entries || afterLand.entries.length === 0) return ''
|
|
2064
|
+
const entries = afterLand.entries
|
|
2065
|
+
const ran = entries.filter((e) => e.decision !== 'skipped')
|
|
2066
|
+
const skipped = entries.filter((e) => e.decision === 'skipped')
|
|
2067
|
+
const width = Math.max(...entries.map((e) => e.run.length))
|
|
2068
|
+
const out = ['']
|
|
2069
|
+
if (ran.length) {
|
|
2070
|
+
out.push(` then, in the primary checkout (${afterLand.cwd}), run (stop at the first failure):`)
|
|
2071
|
+
for (const e of ran) {
|
|
2072
|
+
// The reason is a shell COMMENT, not prose after a dash: these lines are
|
|
2073
|
+
// run as printed, and `cmd — path changed` would hand the command two
|
|
2074
|
+
// stray arguments.
|
|
2075
|
+
if (e.decision === 'matched') out.push(` ${e.run.padEnd(width)} # ${e.matched} changed`)
|
|
2076
|
+
else if (e.decision === 'unknown') out.push(` ${e.run.padEnd(width)} # range unknown`)
|
|
2077
|
+
else out.push(` ${e.run}`)
|
|
2078
|
+
}
|
|
2079
|
+
} else {
|
|
2080
|
+
out.push(` after-land, in the primary checkout (${afterLand.cwd}): nothing to run.`)
|
|
2081
|
+
}
|
|
2082
|
+
if (ran.some((e) => e.decision === 'unknown')) {
|
|
2083
|
+
out.push(" the land's changed files are unknown here, so the conditional entries run.")
|
|
2084
|
+
}
|
|
2085
|
+
if (skipped.length) {
|
|
2086
|
+
out.push(' skipped (nothing in the land matched):')
|
|
2087
|
+
for (const e of skipped) out.push(` ${e.run.padEnd(width)} # when ${e.when.join(', ')}`)
|
|
2088
|
+
}
|
|
2053
2089
|
return out.join('\n') + '\n'
|
|
2054
2090
|
}
|
|
2055
2091
|
|
|
@@ -2111,6 +2147,12 @@ function hotfixCarry(dir, spec, base, wtGit, released) {
|
|
|
2111
2147
|
.map((l) => l.slice(2).trim()),
|
|
2112
2148
|
)
|
|
2113
2149
|
const commits = fixCommits.filter((sha) => !already.has(sha))
|
|
2150
|
+
// What main gains from the whole fix, for afterLand's `when` — taken from
|
|
2151
|
+
// every fix commit rather than the remaining ones, so a carry resumed after a
|
|
2152
|
+
// partial run still sees what the earlier picks changed. A commit git would
|
|
2153
|
+
// not describe makes the range unknown (null), which runs the conditional
|
|
2154
|
+
// entries rather than skipping them.
|
|
2155
|
+
const files = carryFiles(wtGit, fixCommits)
|
|
2114
2156
|
|
|
2115
2157
|
// Which checkout, if any, has the base branch checked out.
|
|
2116
2158
|
const list = git(['worktree', 'list', '--porcelain']) || ''
|
|
@@ -2123,14 +2165,24 @@ function hotfixCarry(dir, spec, base, wtGit, released) {
|
|
|
2123
2165
|
let carry
|
|
2124
2166
|
if (where) {
|
|
2125
2167
|
const st = gitReader(where)(['status', '--porcelain'])
|
|
2126
|
-
carry = { strategy: st ? 'dirty' : 'inplace', path: where, commits }
|
|
2168
|
+
carry = { strategy: st ? 'dirty' : 'inplace', path: where, commits, files }
|
|
2127
2169
|
} else {
|
|
2128
2170
|
const tmpPath = path.join(path.dirname(spec.worktreePath), `${spec.slug}-carry-${base}`)
|
|
2129
|
-
carry = { strategy: 'worktree', path: dir, tmpPath, commits }
|
|
2171
|
+
carry = { strategy: 'worktree', path: dir, tmpPath, commits, files }
|
|
2130
2172
|
}
|
|
2131
2173
|
return { fixCommits, carry }
|
|
2132
2174
|
}
|
|
2133
2175
|
|
|
2176
|
+
function carryFiles(git, commits) {
|
|
2177
|
+
const files = new Set()
|
|
2178
|
+
for (const sha of commits) {
|
|
2179
|
+
const out = git(['diff-tree', '--no-commit-id', '--name-only', '-r', sha])
|
|
2180
|
+
if (out === null) return null
|
|
2181
|
+
for (const line of out.split('\n')) if (line.trim()) files.add(line.trim())
|
|
2182
|
+
}
|
|
2183
|
+
return [...files]
|
|
2184
|
+
}
|
|
2185
|
+
|
|
2134
2186
|
// `hotfix finish`: tear a landed hotfix down once its deploy is out. The guards
|
|
2135
2187
|
// live in `planHotfixFinish`; this gathers the facts, refuses from inside the
|
|
2136
2188
|
// worktree it is about to remove, and runs the two git commands itself.
|