@alterset/alterspec-client 0.15.0 → 0.16.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/README.md CHANGED
@@ -39,6 +39,10 @@ reference.
39
39
  from the spec (citing IDs the export holds), an assumption to work on until the product side confirms or corrects
40
40
  it, or open (that item waits). The dispatcher keeps the assumptions and the open ones (an answer from the spec is
41
41
  not sent); a product person answers there and marks each reconciled with the spec once the spec says it.
42
+ - **Bug**: the product does something other than what the spec says. Anyone raises one with `/alterspec-bug`,
43
+ which grooms the report against the export first; the dispatcher keeps it (`BUG-3`), never the spec, with the
44
+ items it violates as cites, and makes a task per track those items are on (`BUG-3/BE`), after the tasks that
45
+ built them. A bug task is taken and worked like any other; its checklist is the cites.
42
46
 
43
47
  ## Set up a repository
44
48
 
@@ -144,6 +148,7 @@ Other skills:
144
148
  | `/alterspec-task-eta <task> <YYYY-MM-DD\|clear> <reason>` | Set your own date for a task, or `clear` it so the dispatcher's computed ETA applies again. |
145
149
  | `/alterspec-task-release <task> [reason]` | Give a task back. Your code and branches stay as they are. |
146
150
  | `/alterspec-spec-ask <question>` | Answer a question about the product from the export, citing IDs. Read-only. |
151
+ | `/alterspec-bug <what is wrong>` | Groom a report against the export and, when the product deviates from what the spec says, raise a bug with the dispatcher citing the items it violates. A silent or ambiguous spec becomes a question instead; a wrong spec is a change in the spec project. `dismiss BUG-3 <reason>`, typed, dismisses one you raised. |
147
152
 
148
153
  You only ever type `task-done`, `task-eta` and `task-release` yourself, because each is your word. Claude starts
149
154
  the others from plain language as well.
@@ -159,11 +164,12 @@ switch or commit (`merged` fetches `origin/<main>` and the task branch, to read
159
164
  | `init [options]` | Set the repository up (see above). |
160
165
  | `key` | Print the public key and fingerprint you sign with. |
161
166
  | `open dispatcher` | Sign in and open the dispatcher's pages in the browser. The link works once, for a minute. |
162
- | `context <task> [--json] [--stats]` | Print the task's brief from the export, starting with its questions and its checklist. |
167
+ | `context <task> [--json] [--stats]` | Print the task's brief from the export, starting with its questions and its checklist; for a bug's task (`BUG-3/BE`), the bug's words, its cites as the checklist and the objects as they are now. |
163
168
  | `progress [task] [--json]` | Report the items your commits cover. Default: the task of the branch `task/<chg>-<track>`, else of the last commit's `Alterspec-Task` trailer. |
164
169
  | `lookup [ref...] [--question <text>] [--task <task>] [--item <item>]` | Where in the export a question is answered: what to read first, what to open before calling the export silent, the neighbours. `--unread <path...>` says what of that was not opened. |
165
170
  | `cites <ref...>` | Check that every ID or path is in the export; what an answer "from the spec" must pass. |
166
171
  | `questions [task] [--about <ID...>] [--open] [--json]` | Print a task's questions with the product side's answers, the ones naming some IDs, or without either your own. |
172
+ | `bugs [--about <ID...>] [--status open\|done\|dismissed] [--track <code>] [--json]` | Print the bugs naming some IDs (to find one raised before), or without `--about` your own, each with its tasks' statuses and branches. |
167
173
  | `merged <task> [--json]` | Print the commit and branch to report `done` with: the pushed task branch's head, or the commit on `origin/<main>` that brought the task in. |
168
174
  | `export-head [--latest <sha>]` | Pull the export clone and print the commit to send to the dispatcher. |
169
175
  | `mcp` | The MCP server Claude Code starts from `.mcp.json`. It forwards to the dispatcher. |
@@ -29,6 +29,8 @@ work from it, read its `README.md` (at least "How to read the spec" and "For cod
29
29
  and go on only with what its answer allows: an answer from the spec, a recorded assumption, or nothing for that
30
30
  item while the question is open. If the spec contradicts the code, stop and ask me. Never fill a gap with an
31
31
  invented business rule.
32
+ - If the product does something other than what the spec says, that is a bug for the dispatcher, never a note in
33
+ the spec: raise it with `/alterspec-bug`, which checks the spec first.
32
34
  - Work on a task goes through the alterspec skills (`/alterspec-task-context`); every commit of a task carries the
33
35
  trailers they describe.
34
36
  ```
@@ -3,7 +3,7 @@
3
3
  The CLI is `npx @alterset/alterspec-client`. Below it is written as `alterspec-client`; always run it as
4
4
  `npx @alterset/alterspec-client ...` from the repository (or the task's worktree). The dispatcher's tools come from
5
5
  the MCP server `dispatcher` that `.mcp.json` starts: `whoami`, `next_task`, `list_tasks`, `list_changes`, `task`,
6
- `touch`, `set_eta`, `feedback`, `ask` and `questions` (each when the dispatcher lists it), `done`, `release`. Progress reaches the dispatcher through `alterspec-client progress`, never by
6
+ `touch`, `set_eta`, `feedback`, `ask` and `questions`, `bug`, `bugs` and `dismiss_bug` (each when the dispatcher lists it), `done`, `release`. Progress reaches the dispatcher through `alterspec-client progress`, never by
7
7
  calling its tool yourself. Never call `force_release` or `mark_done`: they are an administrator's, in the
8
8
  dispatcher's pages.
9
9
 
@@ -15,8 +15,15 @@ dispatcher's pages.
15
15
  that owns it (`BO`, `MOB`); a channel that shares another's design (a sales desk that looks like the backoffice)
16
16
  is built in that one's track and has none of its own. This repository builds the tracks its
17
17
  `.alterspec-client.json` names.
18
- - **A task** is one signed-off change on one track, written `CHG-012/BE` (the change, a slash, the track). Never make
19
- up a task: take it from the developer's words or the dispatcher's answers, exactly as written.
18
+ - **A task** is one signed-off change on one track, written `CHG-012/BE` (the change, a slash, the track), or one
19
+ bug on one track, written `BUG-3/BE` (`kind: bug` in the dispatcher's lists). Never make up a task: take it from
20
+ the developer's words or the dispatcher's answers, exactly as written.
21
+ - **A bug** is the product deviating from what the spec says: raised from the client with `/alterspec-bug`, which
22
+ grooms the report against the export first, kept by the dispatcher and never by the spec. It cites the items of
23
+ the spec the product violates, and gets a task per track those items are on, placed after the tasks that built
24
+ them; a bug task is taken, built, reported and done like any other, and its checklist is the cites. Where the
25
+ spec is silent or reads two ways there is no bug yet, only a question; where the spec is wrong, a change in the
26
+ spec project.
20
27
  - **The export** is the product spec, signed off, in its own git repository; `.alterspec-client.json` names the
21
28
  developer's clone of it. It says what the product does in business terms and names everything by ID; it never
22
29
  says how to build it, which is this repository's business. Cite IDs when you refer to it. The clone is read-only:
@@ -0,0 +1,69 @@
1
+ # /alterspec-bug — the product deviates from the spec: groom it, then raise it with the dispatcher
2
+
3
+ Read `.alterspec-client/prompts/_shared.md` first and follow it.
4
+
5
+ Arguments: the report, in the reporter's words ("the price screen shows no margin", "an archived article can still
6
+ be approved"), from the developer or a product person; or, typed, `dismiss BUG-<n> <reason>` (below). A report is
7
+ groomed against the export before anything is sent: a bug is a disagreement between the spec and the product, and
8
+ only the spec says which side is wrong. The spec never records a bug (decision 17): a bug is the dispatcher's, cites
9
+ the items of the spec the product violates, and is fixed as a task like any other.
10
+
11
+ You edit nothing in the export. What the spec says comes from the export, never from this repository's code; what
12
+ the product does comes from the reporter, and from the code when you are asked to look.
13
+
14
+ 1. Start as `_shared.md` says (`whoami`, then `export-head`, so the clone is current; keep its `send`). When the
15
+ dispatcher can't be reached or refuses the key, say so in one line and stop: a bug lives in the dispatcher.
16
+ 2. Put the report as a question the export answers: "what does the spec say the product does when …", in the
17
+ export's terms where the reporter's words allow (the screen, the capability, the rule, the IDs they name), and
18
+ with what the reporter saw as a numbered part ("(1) what is shown … (2) what happens when …"). Don't guess which
19
+ side is wrong yet.
20
+ 3. Run `alterspec-client lookup --question "<that question, in full>"`, with the IDs the report names as `ref`s.
21
+ It prints what the question is about, the shards to read first, the ones that must be opened before the export
22
+ may be called silent, the neighbours and the views. When it says the question names nothing the export holds,
23
+ put the report in the export's terms (the glossary's words, the screen's or capability's ID from
24
+ `export.json`) and run it once more.
25
+ 4. Hand the `alterspec-spec-answerer` subagent the question in full, the export's path (`.alterspec-client.json`
26
+ names it), the lookup's output as it is, and the report as the reporter gave it, marked as what the product
27
+ does today, not as what the spec says. Don't answer it yourself and don't tell the answerer what you expect: it
28
+ reads the export only.
29
+ 5. When it returns `assumed` or `open`, run the same `lookup` with `--unread <everything on its Looked list>`.
30
+ What that prints was not opened: send the answerer back once with those paths, and take what it returns then.
31
+ 6. Decide the outcome from what came back, and say it in a line:
32
+ - **`spec`, and the product does otherwise**: a bug. Go on to step 7.
33
+ - **`spec`, and the product does what it says**: not a bug. Say what the spec says, with its IDs, and stop;
34
+ nothing is sent. When the reporter wants the product to do something else, that is a proposal: tell them to
35
+ bring it to the product side with `/alterspec-spec-ask` as a proposal, or do so when they ask.
36
+ - **`assumed` or `open`**: the spec is silent or reads two ways, so nothing is a bug yet. Hand the question, as
37
+ the answerer put it, to `/alterspec-spec-ask`, which records it for the product side; say that the product
38
+ side decides and the bug, if any, comes after. Stop here.
39
+ - **the spec is wrong** (the reporter says the spec's own text is not what the product should do, and the
40
+ product follows it): not a bug and not a question. Say so in a line with the IDs: it is a change, groomed and
41
+ signed off in the spec project like any change, and it arrives as tasks. Stop; nothing is sent.
42
+ 7. Name the items the product violates, as the dispatcher's tasks list them: an acceptance criterion
43
+ (`CAP-PRC-002-AC-03`), a screen action (`SCR-CAT-01.A02`), a contract state (`UX-SCR-CAT-01-BO#empty`), or an
44
+ object key that is an item of its own (`RULE-PRC-001`, `ENT-ARTICLE#lifecycle`), from the answerer's cites: the
45
+ criterion or action whose `Then` or `Shown` the product fails, not the capability as a whole when a criterion
46
+ says it. Run `alterspec-client cites <item...>` with them; drop what the export doesn't hold. A bug with no item
47
+ left is a question: go to the `assumed`/`open` line of step 6.
48
+ 8. Raised before? Run `alterspec-client bugs --about <item...>` (a failure here stops nothing). When one of them is
49
+ open and is this deviation, say it with its `BUG-<n>` and its tasks' statuses and stop: nothing is raised twice.
50
+ A done one that is back is a new bug: say which it follows in the description.
51
+ 9. Call `bug` with `title` (what is wrong, in a line; at most 200 characters), `description` (what was expected,
52
+ what happened, how to see it; at most 2000 characters; the reporter's words naming IDs, no code and no copied
53
+ spec text), `cites` (the items of step 7, at least one) and `export` (`send` from step 1). The dispatcher
54
+ answers in one line each, when it refuses:
55
+ - `UNKNOWN_ITEM`: no task of the export holds that item; cite it as the tasks list it (`alterspec-client
56
+ context <task>` lists a task's), or the object key when the item is the object whole.
57
+ - `NOT_BUILT`: nothing done or in progress holds that item yet, so the product can't deviate from it: the task
58
+ that builds it is still to come, and this is not a bug. Say so; the reporter may ask again once it is built.
59
+ - `TOO_LONG` / `INPUT_INVALID`: shorten or complete what it names and call once more.
60
+ - `EXPORT_UNKNOWN`: stop and tell the developer to tell an admin, as `_shared.md` says.
61
+ 10. Say the result: the `BUG-<n>`, then each of its tasks (`BUG-<n>/<track>`) with its status and what it waits
62
+ for ("BUG-3/BO is blocked after CHG-012/BO, in progress"; "BUG-3/BE is available"). A bug task is taken like
63
+ any other (`/alterspec-task-next`); its brief opens with the bug's words and its checklist is the cites.
64
+
65
+ **`dismiss BUG-<n> <reason>`**, typed by the developer only, never from a sentence: it is the reporter's word (or an
66
+ admin's) that the bug was raised in error or duplicates another. Start as step 1 says, then call `dismiss_bug` with
67
+ the `id`, the `reason` and, when the reason names the bug it duplicates, `duplicate_of`. Say the dispatcher's
68
+ sentence on `NOT_YOURS` (only the reporter or an admin), `IN_PROGRESS` (someone works on it: an admin dismisses it)
69
+ or `UNKNOWN_BUG`; else that its tasks are dismissed and never offered again.
@@ -2,7 +2,7 @@
2
2
 
3
3
  Read `.alterspec-client/prompts/_shared.md` first and follow it.
4
4
 
5
- Arguments: `[CHG-NNN/TRACK]`. Without one, take the developer's task in progress from `whoami`'s `in_progress`; when
5
+ Arguments: `[CHG-NNN/TRACK]` (or `BUG-<n>/TRACK`, a bug's task). Without one, take the developer's task in progress from `whoami`'s `in_progress`; when
6
6
  there are several, the one whose branch this checkout is on (`git branch --show-current` prints `task/<chg>-<track>`)
7
7
  or whose `Alterspec-Task` trailer the last commit carries; when that doesn't settle it, ask which.
8
8
 
@@ -27,6 +27,12 @@ or whose `Alterspec-Task` trailer the last commit carries; when that doesn't set
27
27
  change's text names, whole, the other decisions by path. Each hunk of a diff names the section it falls in. For a
28
28
  UI track
29
29
  the screens, their experience contracts, the mockup pages and the channel's design system.
30
+ **A bug's task** (`BUG-<n>/<track>`) has a shorter brief: it opens with the bug's words (what was expected, what
31
+ happened, how to see it) and the items it cites, which are its checklist; then the objects those items belong to,
32
+ where each is in the export now, and the changes the bug originates in. There is no delta: the product deviates
33
+ from the spec's current text, so read each cited item in the export (its shard), find where the code departs
34
+ from it, and make it do what the item says, nothing else. The tasks that built those items stay as they are; this
35
+ task is the fix, and an item is covered again when its tests pass with the fix.
30
36
  3. Call `touch` with the task, then `task` with it. `followed_by` lists the later tasks on this track whose objects
31
37
  overlap this one's; say them in one line, e.g. "CHG-015/BE, after yours, changes some of the same objects; it will
32
38
  be its own task." Build what this change says, not what later ones do.
@@ -2,7 +2,7 @@
2
2
 
3
3
  Read `.alterspec-client/prompts/_shared.md` first and follow it.
4
4
 
5
- Arguments: `<CHG-NNN/TRACK>`, required. The developer typed this command: that is their word that the task is done.
5
+ Arguments: `<CHG-NNN/TRACK>` (or `BUG-<n>/TRACK`), required. The developer typed this command: that is their word that the task is done.
6
6
  Without a task, ask for it; never guess it.
7
7
 
8
8
  1. Start as `_shared.md` says (`whoami`, `export-head`).
@@ -9,7 +9,8 @@ the developer wants in progress at once (default 1).
9
9
  2. Tracks: the one the developer named; else `tracks` in `.alterspec-client.json` when it lists any; else none, and
10
10
  the dispatcher offers every track the developer may take.
11
11
  3. Call `next_task` with `export` = `send` from `export-head`, `tracks` and `parallel`.
12
- 4. Say each `reasons` entry in one line (none available, blocked by what, at the limit, more after pulling).
12
+ 4. Say each `reasons` entry in one line (none available, blocked by what, at the limit, more after pulling). A task
13
+ with `kind: bug` (`BUG-3/BE`) is a bug's: say so, with the bug's title; it is worked like any other.
13
14
  5. Each assigned task's `after` lists the done tasks it waited for, each with its `commit` and `branch`. When an
14
15
  entry of the same track names a `branch` (not null), that predecessor's work is pushed there and not in the main
15
16
  branch yet: say in one line which branch to start from, e.g. "CHG-013/BE starts from `task/chg-012-be`, where
@@ -11,13 +11,15 @@ Arguments: `[track]`, optional.
11
11
  (`after` with their statuses).
12
12
  4. Call `list_changes` with `status: "open"` for the progress and ETA of the open changes and of each level.
13
13
  5. When `whoami`'s `answered_questions` is above 0, run `alterspec-client questions` and say each answered one in
14
- a line with its task, a corrected assumption first.
14
+ a line with its task, a corrected assumption first. When its `fixed_bugs` is above 0, run `alterspec-client bugs
15
+ --status done` and say each of the developer's bugs done since in a line, with its tasks' branches.
15
16
  6. Answer in four short parts:
16
17
  - **yours**: task, title, progress (`covered` of `of` items, the dispatcher's `percent`), ETA, since when, stale or
17
18
  not. An ETA the developer set is theirs: show it as theirs, with the computed one beside it. An unknown ETA is
18
19
  "unknown", never a guess. A task without items shows only its status.
19
20
  - **available**: task, title, level, and how long it lasts once taken when the dispatcher says.
20
21
  - **blocked**: task, waiting for which tasks.
22
+ A bug's task (`BUG-3/BE`, `kind: bug`) is listed like any other, named as a bug.
21
23
  - **changes**: per level, the open changes with their progress and ETA ("at least" when the dispatcher says so).
22
24
  A stale task of the developer's: say it in one line and suggest `/alterspec-task-release` if they won't finish it.
23
25
  Their own date for a task: `/alterspec-task-eta`.
@@ -0,0 +1,10 @@
1
+ ---
2
+ name: alterspec-bug
3
+ description: "Use when the developer or a product person says the product does something other than what the spec says (\"the price screen shows no margin\", \"approval is allowed for an archived article\"). Grooms the report against the export first: a deviation from what the spec says becomes a bug in the dispatcher, citing the items it violates; a spec that is silent or reads two ways becomes a question; a spec that is wrong is said, to change in the spec project. Never sends spec text. Also, typed, `dismiss BUG-<n> <reason>`."
4
+ argument-hint: "<what is wrong> | dismiss BUG-<n> <reason>"
5
+ allowed-tools: Read Glob Grep Agent Bash(npx @alterset/alterspec-client *) mcp__dispatcher__whoami mcp__dispatcher__bug mcp__dispatcher__bugs mcp__dispatcher__dismiss_bug
6
+ ---
7
+
8
+ Read `.alterspec-client/prompts/bug.md` and follow those instructions exactly.
9
+
10
+ Arguments: $ARGUMENTS
@@ -178,6 +178,7 @@ server. Then talk to it in plain words; the skills do the rest.
178
178
  | "let's work on my task" / `/alterspec-task-context` | the task's brief from the spec: why, the checklist (each part of an object named by its section or line), the one-time data change if any, the objects it changes (before and after), what moved since the sign-off and where the export uses them, the reach of its rules and roles, the changed acceptance criteria, the rules, events, quality requirements, integrations, decisions and glossary terms they and the change name (the rest, and the entities with their lifecycles, as paths); for a UI track also the screens, their contracts, mockups and design system |
179
179
  | "what am I on?" / `/alterspec-task-status` | your tasks with progress and ETA, what's available on your tracks, what is blocked and by what |
180
180
  | "what does RULE-… say?" / `/alterspec-spec-ask` | answers about the product from the spec, citing IDs; what the spec doesn't say is recorded as an assumption or an open question for the product side; Claude uses it by itself when a task's spec is undecided |
181
+ | "the price screen shows no margin" / `/alterspec-bug` | grooms the report against the spec first: where the product deviates from what the spec says, raises a bug with the dispatcher citing the items it violates, placed after the tasks that built them and offered like any task; where the spec is silent or reads two ways, asks instead; where the spec is wrong, says so |
181
182
  | `/alterspec-task-done CHG-023/BE` | after your branch is pushed: reports the task done with its head commit and the branch (or, once merged, the commit on the main branch); refused while nothing is pushed |
182
183
  | `/alterspec-task-release CHG-023/BE <reason>` | gives the task back so someone else can take it; your code and branches stay as they are |
183
184
  | `/alterspec-task-eta CHG-023/BE <YYYY-MM-DD> <reason>` | sets your own date when the computed ETA is wrong; `clear` instead of the date removes it |
@@ -269,6 +270,33 @@ and covers the items; it builds only what wasn't built here. Nothing is marked d
269
270
  While the dispatcher has no questions yet (an older one), the answer is still given, and Claude says it was not
270
271
  recorded: then an open question is yours to carry, as before.
271
272
 
273
+ ### Bugs
274
+
275
+ A bug is the product doing something other than what the spec says; the spec never records one. Say what is
276
+ wrong ("the price screen shows no margin") or type `/alterspec-bug <what is wrong>`, you or a product person.
277
+ Claude grooms it against the spec before anything is sent, the way it answers a question: the reading list, the
278
+ answerer reading the export only. Then one of three:
279
+
280
+ - **The spec says it and the product does otherwise.** A bug. Claude names the items the product violates
281
+ (acceptance criteria, screen actions, contract states, or an object that is an item of its own), checks each
282
+ exists in the export, looks whether one was raised about them before, and raises it with the dispatcher: a title,
283
+ what was expected, what happened and how to see it, in the reporter's words naming IDs, never spec text. The
284
+ dispatcher gives it a number (`BUG-3`) and a task per track the items are on (`BUG-3/BE`, `BUG-3/BO`), each after
285
+ the tasks that built those items: available at once when they are done, blocked while one is in progress. A bug
286
+ task is taken, worked and reported done like any other; its brief opens with the bug's words and its checklist is
287
+ the cites, covered again as each one's tests pass with the fix.
288
+ - **The spec is silent or reads two ways.** Nothing is a bug yet: Claude hands it to `/alterspec-spec-ask`, the
289
+ product side decides, and the bug, if any, comes after.
290
+ - **The spec is wrong.** Neither a bug nor a question: a change, groomed and signed off in the spec project, which
291
+ arrives as tasks.
292
+
293
+ The dispatcher refuses an item no task of the export holds (cite it as the tasks list it) and one nothing built
294
+ holds yet (the task that builds it is still to come, so the product can't deviate from it). A bug raised in error,
295
+ or twice, is dismissed by whoever raised it while nobody works on it, or by an admin: type
296
+ `/alterspec-bug dismiss BUG-3 <reason>`; its tasks are never offered again. `npx @alterset/alterspec-client bugs`
297
+ prints your bugs with their tasks, `bugs --about <ID...>` everyone's about some items; `/alterspec-task-status` says
298
+ when one of yours was fixed since you last looked.
299
+
272
300
  ### Good to know
273
301
 
274
302
  - **The trailer names the task.** Progress is read from the `Alterspec-Task` trailer of your commits, on any branch;