@skitterbyte/skitterspec-azure-boards 2.1.0 → 2.3.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/MIGRATION.md +42 -0
- package/assets/core/azure-boards.config.md +2 -1
- package/assets/rules/spec-planning.md +91 -13
- package/assets/skills/spec/SKILL.md +70 -18
- package/assets/skills/spec-bug/SKILL.md +36 -0
- package/assets/skills/spec-complete/SKILL.md +39 -0
- package/assets/skills/spec-hotfix/SKILL.md +25 -0
- package/assets/skills/spec-incident/SKILL.md +164 -0
- package/assets/skills/spec-init/SKILL.md +2 -1
- package/package.json +1 -1
- package/src/cli.js +1 -1
- package/src/env/resolve.js +5 -4
- package/src/vendor/azure-boards/api.js +32 -2
- package/src/vendor/azure-boards/cli-sync.js +220 -33
- package/src/vendor/azure-boards/config.js +4 -2
- package/src/vendor/provider-kit/src/config.js +44 -0
- package/src/vendor/sync-core/index.js +4 -1
- package/src/vendor/sync-core/src/normalize.js +111 -18
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: spec-incident
|
|
3
|
+
description: Capture a live incident — an outage or degradation of a running service — as an Incident-type spec written during the outage. Grills for what is down, since when, who is affected, severity and what was tried, then writes the spec straight into specs/in-progress/ with a Timeline appended to as it unfolds. Fixes are separate linked specs, never phases. Use when the user says "/spec-incident", "we have an outage", "prod is down and I need an incident record", or asks to track an incident.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# /spec-incident — capture a live incident
|
|
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
|
+
An **incident** is an outage or degradation of a live service. It is not
|
|
14
|
+
delivery work: the fixes are separate hotfix, bug, chore or issue specs, each
|
|
15
|
+
linked back to it, and this spec is the **record** — what happened, when, to
|
|
16
|
+
whom, and what was done. It is written **during** the outage, so it starts in
|
|
17
|
+
`specs/in-progress/`, there is no backlog stop and no review page to wait on:
|
|
18
|
+
speed matters, and the record is reviewed at completion, when
|
|
19
|
+
`/spec-complete` writes the incident log from it.
|
|
20
|
+
|
|
21
|
+
**This skill is not the response.** Mitigating comes first, and nothing here
|
|
22
|
+
blocks it — the grill is short, the spec is small, and everything else is
|
|
23
|
+
appended as it happens.
|
|
24
|
+
|
|
25
|
+
## 1. Grill — short, and only what the record needs
|
|
26
|
+
|
|
27
|
+
Ask for exactly these, batched, with nothing speculative:
|
|
28
|
+
|
|
29
|
+
1. **What is down or degraded** — the service, and how it is failing.
|
|
30
|
+
2. **Since when** — first report, and detection time where they differ.
|
|
31
|
+
3. **Who is affected** — which users or systems, and how badly.
|
|
32
|
+
4. **Severity** — Azure's literal values: `1 - Critical`, `2 - High`,
|
|
33
|
+
`3 - Medium`, `4 - Low`. Propose one from the impact described; the user
|
|
34
|
+
confirms.
|
|
35
|
+
5. **What has been tried** — anything already attempted, and its effect.
|
|
36
|
+
|
|
37
|
+
A root cause is **not** grilled: nobody has it yet, and the Timeline is where
|
|
38
|
+
the investigation lands as it happens.
|
|
39
|
+
|
|
40
|
+
### No live outage to record — route to the right door
|
|
41
|
+
|
|
42
|
+
This is the costliest door to enter wrongly — no backlog stop, no review page,
|
|
43
|
+
straight into `specs/in-progress/` — so the grill's own answers are also its
|
|
44
|
+
exit. When items 1 and 2 establish there is **no outage to record** — nothing
|
|
45
|
+
is down or degraded, it never was live, or it is a risk rather than an event —
|
|
46
|
+
propose the right door instead of writing an incident
|
|
47
|
+
(`.claude/rules/spec-planning.md` carries the full routing matrix):
|
|
48
|
+
|
|
49
|
+
- a **defect** → **`/spec-bug`**, or **`/spec-hotfix`** when it is on a
|
|
50
|
+
released version;
|
|
51
|
+
- anything else → **`/spec`**, whose kind proposal picks feature, chore or
|
|
52
|
+
issue from there.
|
|
53
|
+
|
|
54
|
+
**A past outage someone wants a record of stays an incident**: "it is over" is
|
|
55
|
+
not "it never happened" — the signal is *no outage to record*, not *no outage
|
|
56
|
+
now*. This check is the grill's existing questions read honestly, never an
|
|
57
|
+
extra round trip, and the hand-off contract is the same as everywhere else:
|
|
58
|
+
confirm first, naming the signal in the user's own words; a decline carries
|
|
59
|
+
this skill on; on a confirmed switch invoke the destination skill in-session,
|
|
60
|
+
seeded with everything already established.
|
|
61
|
+
|
|
62
|
+
## 2. Write it, in flight
|
|
63
|
+
|
|
64
|
+
Pick a short kebab name prefixed `incident-` (e.g. `incident-api-outage`).
|
|
65
|
+
|
|
66
|
+
**With per-spec isolation** (`specs/.core/env.config.json` present), provision
|
|
67
|
+
before writing, exactly as `/spec` Phase B does: run
|
|
68
|
+
`skitterspec spec-env up <name> --docs`, run the commands it prints, `cd` into
|
|
69
|
+
the worktree, and confirm with a bare `skitterspec spec-env resolve` naming
|
|
70
|
+
this spec. Without isolation, write where you stand.
|
|
71
|
+
|
|
72
|
+
The spec is a folder in **`specs/in-progress/`** — never backlog — with
|
|
73
|
+
`00-overview.md` and one phase file:
|
|
74
|
+
|
|
75
|
+
```markdown
|
|
76
|
+
# Incident: <short title>
|
|
77
|
+
|
|
78
|
+
> **Type:** Incident
|
|
79
|
+
> **Name:** incident-<kebab-name>
|
|
80
|
+
> **Status:** In Progress — live (started <YYYY-MM-DD>)
|
|
81
|
+
> **Author:** <git user.name>
|
|
82
|
+
> **Developer:** <git user.name — whoever is running the incident>
|
|
83
|
+
> **Raised:** <YYYY-MM-DD (today)>
|
|
84
|
+
> **Severity:** <1 - Critical … 4 - Low>
|
|
85
|
+
> **Gating:** <pre-filled "none: incident record, no code"; only when release
|
|
86
|
+
> gating is configured, omit otherwise>
|
|
87
|
+
|
|
88
|
+
## Impact
|
|
89
|
+
|
|
90
|
+
<who is affected, what is failing, since when — from the grill>
|
|
91
|
+
|
|
92
|
+
## Timeline
|
|
93
|
+
|
|
94
|
+
- <YYYY-MM-DD HH:MM> — <first report / detected / what was tried / what changed>
|
|
95
|
+
|
|
96
|
+
## Fixes
|
|
97
|
+
|
|
98
|
+
<one line per fix spec as they are opened — see step 4. "None yet" until then.>
|
|
99
|
+
|
|
100
|
+
## State log
|
|
101
|
+
|
|
102
|
+
| Date | Status | Folder | By |
|
|
103
|
+
|------|--------|--------|----|
|
|
104
|
+
| <YYYY-MM-DD> | In Progress | in-progress | <author> |
|
|
105
|
+
|
|
106
|
+
## Changelog
|
|
107
|
+
|
|
108
|
+
- <YYYY-MM-DD> — Incident captured.
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
The phase file `01-response.md` holds the response as tasks — mitigate,
|
|
112
|
+
diagnose, open fix specs, verify recovery — manual steps, not code. Commits in
|
|
113
|
+
this spec default to `docs` with no `Release-Note:`.
|
|
114
|
+
|
|
115
|
+
## 3. Link to the tracker (only if a provider is installed)
|
|
116
|
+
|
|
117
|
+
Run the provider's linking push exactly as `/spec` Phase E describes — the
|
|
118
|
+
spec is already in `in-progress`, so the mint lands in the incident's
|
|
119
|
+
in-flight state (with Azure's `statesByType`, an Incident is created Active
|
|
120
|
+
and never sent New; the `Severity:` header is written where the provider has a
|
|
121
|
+
home for it). No provider, or an unreachable tracker, is one line and the
|
|
122
|
+
record stands in the repo.
|
|
123
|
+
|
|
124
|
+
## 4. Run the incident from the spec
|
|
125
|
+
|
|
126
|
+
- **Append to the Timeline** as things happen — dated lines, cheap and often.
|
|
127
|
+
- **Fixes are separate specs**: a prod-version fix is `/spec-hotfix`, a
|
|
128
|
+
mainline defect `/spec-bug`, tooling `/spec` (chore), manual remediation
|
|
129
|
+
`/spec` (issue). Each fix spec carries `> **Incident:** incident-<name>` in
|
|
130
|
+
its header, which the next push turns into a related link on the tracker.
|
|
131
|
+
They are never phases of this spec.
|
|
132
|
+
- **Mid-incident board states stay manual**: skitterspec writes states at
|
|
133
|
+
lifecycle moves only, so moving the ticket to a Mitigated-style state during
|
|
134
|
+
the outage is done on the board, and the next push leaves it until the spec
|
|
135
|
+
itself moves.
|
|
136
|
+
|
|
137
|
+
## 5. End of the outage is not the end of the spec
|
|
138
|
+
|
|
139
|
+
When the service is recovered, say so in the Timeline and keep the spec in
|
|
140
|
+
flight until the record is complete — root cause written, fixes linked.
|
|
141
|
+
`/spec-complete` is the ending: it writes `incident-log.md` from this spec and
|
|
142
|
+
its linked fixes, refuses while a linked fix is still open (and offers to
|
|
143
|
+
complete anyway with it listed as outstanding), and pushes the log onto the
|
|
144
|
+
incident item as a comment.
|
|
145
|
+
|
|
146
|
+
## Report
|
|
147
|
+
|
|
148
|
+
End with the block defined in `.claude/rules/spec-reports.md`. That file
|
|
149
|
+
carries the shape; this section carries only what is specific here.
|
|
150
|
+
|
|
151
|
+
**Verdicts**
|
|
152
|
+
|
|
153
|
+
- `✅` — the incident spec is written, in flight, and (where a provider is
|
|
154
|
+
installed) linked.
|
|
155
|
+
- `⚠️` — written and in flight, with something worth knowing (a mint that
|
|
156
|
+
failed, a worktree that could not be provisioned so it was written in
|
|
157
|
+
place).
|
|
158
|
+
- `⏸` — the grill could not establish what is down, so nothing was written.
|
|
159
|
+
|
|
160
|
+
**Fields:** `Tracker` · `Branch` · `Spec` · `Built` · `Worktree` ·
|
|
161
|
+
`Follow-ups` · `Next`
|
|
162
|
+
|
|
163
|
+
`Next` is the response itself — the first task of `01-response.md` — never a
|
|
164
|
+
review page: nothing here waits on a verdict while a service is down.
|
|
@@ -27,8 +27,9 @@ clobber customised content. Finish with a summary of created vs already-present.
|
|
|
27
27
|
> **Leave alone**. Non-interactively it only adds what's missing; `--resync` /
|
|
28
28
|
> `--reset` (reset needs `--yes`) drive the stronger actions.
|
|
29
29
|
|
|
30
|
-
The system is **
|
|
30
|
+
The system is **fourteen skills**: `spec` (feature, chore or issue), `spec-bug` (bug),
|
|
31
31
|
`spec-hotfix` (a bug fixed on a released tag),
|
|
32
|
+
`spec-incident` (a live outage, recorded as it happens),
|
|
32
33
|
`no-spec` (work that genuinely has none — off the base branch all the same),
|
|
33
34
|
`spec-review`, `spec-start`,
|
|
34
35
|
`spec-next`, `spec-diff` (read a spec's diff as a page),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@skitterbyte/skitterspec-azure-boards",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.3.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
|
@@ -906,7 +906,7 @@ function specEnvUp(dir, config, specArg, flags = {}) {
|
|
|
906
906
|
try {
|
|
907
907
|
spec = resolveSpecWithWorktree(dir, config, specArg)
|
|
908
908
|
} catch (err) {
|
|
909
|
-
const specShaped = typeof specArg === 'string' && /^(feat|bug|hotfix|chore)-./.test(specArg)
|
|
909
|
+
const specShaped = typeof specArg === 'string' && /^(feat|bug|hotfix|chore|issue|incident)-./.test(specArg)
|
|
910
910
|
if (err.code !== 'SPEC_NOT_FOUND' || !docs || !specShaped || config.mode === 'checkout') {
|
|
911
911
|
throw err
|
|
912
912
|
}
|
package/src/env/resolve.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Pure spec/branch resolution for per-spec isolation.
|
|
5
5
|
*
|
|
6
6
|
* Given a spec argument (a folder name or path) it locates the spec folder under
|
|
7
|
-
* `specs/**`, splits the `feat-`/`bug-`/`hotfix-`/`chore-` prefix into
|
|
7
|
+
* `specs/**`, splits the `feat-`/`bug-`/`hotfix-`/`chore-`/`issue-`/`incident-` prefix into
|
|
8
8
|
* `{ type, slug }`, derives the
|
|
9
9
|
* git branch from the config's `branch.pattern` (provider-neutral; `{identifier}`
|
|
10
10
|
* is filled from a tracker id when one is configured, else it falls back to
|
|
@@ -295,10 +295,11 @@ function phaseIsDone(text) {
|
|
|
295
295
|
return /^#\s.*✅\s*$/m.test(text)
|
|
296
296
|
}
|
|
297
297
|
|
|
298
|
-
// Split a `feat-`/`bug-`/`hotfix-`/`chore-` prefix.
|
|
299
|
-
// defaults to `feat` and the whole folder name is the
|
|
298
|
+
// Split a `feat-`/`bug-`/`hotfix-`/`chore-`/`issue-`/`incident-` prefix.
|
|
299
|
+
// Unknown prefix → type defaults to `feat` and the whole folder name is the
|
|
300
|
+
// slug.
|
|
300
301
|
function splitPrefix(folder) {
|
|
301
|
-
const m = /^(feat|bug|hotfix|chore)-(.+)$/.exec(folder)
|
|
302
|
+
const m = /^(feat|bug|hotfix|chore|issue|incident)-(.+)$/.exec(folder)
|
|
302
303
|
if (m) return { type: m[1], slug: m[2] }
|
|
303
304
|
return { type: 'feat', slug: folder }
|
|
304
305
|
}
|
|
@@ -236,6 +236,9 @@ function makeApiAdapter({ orgUrl, project, token, fetch: fetchImpl, sleep, maxRe
|
|
|
236
236
|
if (input.assigneeId !== undefined) {
|
|
237
237
|
add('/fields/System.AssignedTo', input.assigneeId == null ? '' : input.assigneeId)
|
|
238
238
|
}
|
|
239
|
+
if (input.severity !== undefined && input.severity !== null) {
|
|
240
|
+
add('/fields/Microsoft.VSTS.Common.Severity', input.severity)
|
|
241
|
+
}
|
|
239
242
|
if (input.areaPath) add('/fields/System.AreaPath', input.areaPath)
|
|
240
243
|
return ops
|
|
241
244
|
}
|
|
@@ -295,16 +298,43 @@ function makeApiAdapter({ orgUrl, project, token, fetch: fetchImpl, sleep, maxRe
|
|
|
295
298
|
return item
|
|
296
299
|
},
|
|
297
300
|
|
|
298
|
-
async createIssue({ title, description, assigneeId, workItemType, areaPath }) {
|
|
301
|
+
async createIssue({ title, description, assigneeId, workItemType, areaPath, severity }) {
|
|
299
302
|
const created = await request(
|
|
300
303
|
'POST',
|
|
301
304
|
`${projectBase}/wit/workitems/$${encodeURIComponent(workItemType)}`,
|
|
302
|
-
{ body: itemPatch({ title, description, assigneeId, areaPath }, bodyFieldFor(workItemType)), patch: true },
|
|
305
|
+
{ body: itemPatch({ title, description, assigneeId, areaPath, severity }, bodyFieldFor(workItemType)), patch: true },
|
|
303
306
|
)
|
|
304
307
|
if (!created || created.id == null) throw new Error('Azure DevOps returned no work item for the create')
|
|
305
308
|
return { id: String(created.id), identifier: identifierOf(created.id), url: urlOf(created.id) }
|
|
306
309
|
},
|
|
307
310
|
|
|
311
|
+
/**
|
|
312
|
+
* Add a `System.LinkTypes.Related` relation from one work item to another.
|
|
313
|
+
* Idempotent at the caller's level: Azure refuses a relation that already
|
|
314
|
+
* exists, and that exact refusal comes back as `{ added: false,
|
|
315
|
+
* already: true }` rather than an error — a re-push is not a failure.
|
|
316
|
+
*/
|
|
317
|
+
async addRelatedLink(id, targetId) {
|
|
318
|
+
try {
|
|
319
|
+
await request('PATCH', `${projectBase}/wit/workitems/${encodeURIComponent(numId(id))}`, {
|
|
320
|
+
body: [
|
|
321
|
+
{
|
|
322
|
+
op: 'add',
|
|
323
|
+
path: '/relations/-',
|
|
324
|
+
value: { rel: 'System.LinkTypes.Related', url: itemApiUrl(numId(targetId)) },
|
|
325
|
+
},
|
|
326
|
+
],
|
|
327
|
+
patch: true,
|
|
328
|
+
})
|
|
329
|
+
} catch (error) {
|
|
330
|
+
if (/already exists|relation.*exist/i.test(String(error && error.message))) {
|
|
331
|
+
return { added: false, already: true }
|
|
332
|
+
}
|
|
333
|
+
throw error
|
|
334
|
+
}
|
|
335
|
+
return { added: true }
|
|
336
|
+
},
|
|
337
|
+
|
|
308
338
|
async createSubIssue(parentId, { title, description, childType, areaPath }) {
|
|
309
339
|
const ops = itemPatch({ title, description, areaPath }, bodyFieldFor(childType))
|
|
310
340
|
ops.push({
|