@adhd/backlog 0.0.2 → 0.1.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/dist/package.json DELETED
@@ -1,34 +0,0 @@
1
- {
2
- "name": "@adhd/backlog",
3
- "version": "0.0.2",
4
- "bin": {
5
- "backlog": "./dist/index.js"
6
- },
7
- "dependencies": {
8
- "@adhd/sox-graph-store": "^0.3.0",
9
- "better-sqlite3": "^12.10.0",
10
- "@adhd/environment": "0.0.2",
11
- "@adhd/environment-base-spec": "0.0.3",
12
- "@adhd/apigen-core-client": "^0.1.1",
13
- "@adhd/apigen-plugin-api-fastify": "^0.1.2",
14
- "@adhd/apigen-plugin-openapi": "^0.1.3",
15
- "@adhd/apigen-plugin-mcp": "^0.1.2",
16
- "@adhd/apigen-plugin-cli-output": "^0.1.3",
17
- "@adhd/apigen-engine-naming": "^0.1.3",
18
- "yaml": "1.10.3"
19
- },
20
- "devDependencies": {
21
- "@types/better-sqlite3": "^7.6.13"
22
- },
23
- "main": "./dist/index.js",
24
- "module": "./dist/index.mjs",
25
- "typings": "./dist/index.d.ts",
26
- "publishConfig": {
27
- "access": "public"
28
- },
29
- "files": [
30
- "dist",
31
- "CHANGELOG.md",
32
- "skill"
33
- ]
34
- }
package/skill/SKILL.md DELETED
@@ -1,148 +0,0 @@
1
- ---
2
- name: backlog-usage
3
- description: "Use whenever filing, claiming, transitioning, or resolving a backlog item (bug/debt/feature/investigation) in ANY repo on this machine — via the `backlog` CLI/MCP, never by hand-editing a BACKLOG.md file. Also use to check current migration status before assuming markdown vs. the tool is authoritative. Examples: \"log this bug\", \"file a debt item for the flaky test\", \"claim BUG-042\", \"what's still open in this repo\", \"is BACKLOG.md still the source of truth here\"."
4
- ---
5
-
6
- # `@adhd/backlog` usage
7
-
8
- `@adhd/backlog` is a graph-backed, multi-agent, cross-repo backlog tool. It is
9
- migrating every repo on this machine off hand-edited `BACKLOG.md` files onto
10
- itself as the source of truth, with `BACKLOG.md` demoted to a generated,
11
- git-visible *projection* of the graph. This skill is the ONLY place the
12
- command surface, protocol, and migration-state mechanism are documented —
13
- the global `CLAUDE.md`/`AGENTS.md` carry just one pointer line to this file.
14
-
15
- ## 1. Check migration status FIRST, every time
16
-
17
- Never trust a hardcoded phase number in this document — it goes stale the
18
- moment a phase advances. Before deciding whether `BACKLOG.md` or the tool is
19
- authoritative for the CURRENT repo, run:
20
-
21
- ```
22
- backlog migration-status
23
- ```
24
-
25
- It reports `{ phase, description, toolIsAuthoritative }`. While
26
- `toolIsAuthoritative` is `false` (phases `not-started`/`phase-1`/`phase-2`),
27
- `BACKLOG.md` (root, per-plan, per-package) is still the real source of truth
28
- in this repo — read/file there by hand as usual, but still prefer `backlog
29
- list-items`/`backlog create-item` for querying and filing so items are
30
- visible cross-repo and get FTS/symbol dedup for free. Once `toolIsAuthoritative`
31
- is `true` (`phase-3` and later), **never hand-edit a `BACKLOG.md` file** —
32
- every one is a generated projection at that point, and a hand-edit will be
33
- silently overwritten (or, once the parity gate is blocking, rejected in CI).
34
-
35
- ## 2. Command surface — 36 ops, one CLI convention
36
-
37
- Every op takes `ctx` as an implicit first argument (never pass it — the CLI/
38
- MCP host supplies it). The CLI's own parameter-naming convention (verified
39
- against real spawned-binary tests, `cli.spec.ts`):
40
-
41
- - **Scalar parameters** get individual kebab-case flags, named after the
42
- parameter itself: `getItem(ctx, repo, humanId)` → `backlog get-item --repo
43
- <repo> --human-id <id>`.
44
- - **Object-shaped parameters** get a single JSON-blob flag, named after the
45
- parameter's own name, kebab-cased: `createItem(ctx, input)` → `backlog
46
- create-item --input '<json>'`.
47
- - The bin name is never part of `argv` — a bare `create-item …`/`get-item …`
48
- resolves without any manual namespace prefix.
49
- - Failures use real process exit codes (never `0` on error — unknown command
50
- → exit `4`, bad flag → exit `2`); errors are JSON on the last stderr line.
51
- - Every op is also available as an MCP tool, named `backlog_client_d_<snake_case_op>`
52
- (e.g. `backlog_client_d_create_item`), once `.mcp.json` wires the server —
53
- same parameters, same semantics.
54
-
55
- | `client.ts` export | CLI form |
56
- |---|---|
57
- | `createItem(ctx, input)` | `backlog create-item --input '<CreateItemInput json>'` |
58
- | `getItem(ctx, repo, humanId)` | `backlog get-item --repo <repo> --human-id <id>` |
59
- | `updateItem(ctx, repo, humanId, patch)` | `backlog update-item --repo <repo> --human-id <id> --patch '<UpdateItemInput json>'` |
60
- | `listItems(ctx, filter?)` | `backlog list-items --filter '<BacklogFilter json>'` |
61
- | `softDeleteItem(ctx, repo, humanId, reason)` | `backlog soft-delete-item --repo <repo> --human-id <id> --reason <text>` |
62
- | `stats(ctx, scope?)` | `backlog stats --scope '<StatsScope json>'` |
63
- | `spotlight(ctx, scope?, limit?)` | `backlog spotlight --scope '<json>' --limit <n>` |
64
- | `readyItems(ctx, scope?)` | `backlog ready-items --scope '<json>'` |
65
- | `blockers(ctx, repo, humanId)` | `backlog blockers --repo <repo> --human-id <id>` |
66
- | `dependencyGraph(ctx, scope?)` | `backlog dependency-graph --scope '<json>'` |
67
- | `topoOrder(ctx, scope?)` | `backlog topo-order --scope '<json>'` |
68
- | `staleClaims(ctx, maxAgeMin, scope?)` | `backlog stale-claims --max-age-min <n> --scope '<json>'` |
69
- | `claimItem(ctx, repo, humanId, by, opts?)` | `backlog claim-item --repo <repo> --human-id <id> --by <identity> --opts '<ClaimOpts json>'` |
70
- | `renewClaim(ctx, repo, humanId, by)` | `backlog renew-claim --repo <repo> --human-id <id> --by <identity>` |
71
- | `releaseClaim(ctx, repo, humanId, by, opts?)` | `backlog release-claim --repo <repo> --human-id <id> --by <identity> --opts '<json>'` |
72
- | `assignItem(ctx, repo, humanId, to, by)` | `backlog assign-item --repo <repo> --human-id <id> --to <identity> --by <identity>` |
73
- | `startWork(ctx, repo, humanId, by)` | `backlog start-work --repo <repo> --human-id <id> --by <identity>` |
74
- | `transitionStatus(ctx, repo, humanId, status, opts)` | `backlog transition-status --repo <repo> --human-id <id> --status <STATUS> --opts '<TransitionOpts json>'` |
75
- | `addCitation(ctx, repo, humanId, citation)` | `backlog add-citation --repo <repo> --human-id <id> --citation '<Citation json>'` |
76
- | `appendNote(ctx, repo, humanId, by, text)` | `backlog append-note --repo <repo> --human-id <id> --by <identity> --text <note>` |
77
- | `resolveItem(ctx, repo, humanId, status, opts)` | `backlog resolve-item --repo <repo> --human-id <id> --status <STATUS> --opts '<json>'` |
78
- | `archiveResolved(ctx, scope, opts?)` | `backlog archive-resolved --scope '<StatsScope json>' --opts '<ArchiveOpts json>'` |
79
- | `addDependency(ctx, repo, humanId, dependsOnHumanId)` | `backlog add-dependency --repo <repo> --human-id <id> --depends-on-human-id <id2>` |
80
- | `removeDependency(ctx, repo, humanId, dependsOnHumanId)` | `backlog remove-dependency --repo <repo> --human-id <id> --depends-on-human-id <id2>` |
81
- | `linkRelated(ctx, repo, humanIdA, humanIdB)` | `backlog link-related --repo <repo> --human-id-a <id1> --human-id-b <id2>` |
82
- | `supersedeItem(ctx, repo, oldHumanId, newInput, reason)` | `backlog supersede-item --repo <repo> --old-human-id <id> --new-input '<CreateItemInput json>' --reason <text>` |
83
- | `splitItem(ctx, repo, parentHumanId, children)` | `backlog split-item --repo <repo> --parent-human-id <id> --children '<CreateItemInput[] json>'` |
84
- | `mergeItems(ctx, repo, keepHumanId, dropHumanId, reason)` | `backlog merge-items --repo <repo> --keep-human-id <id1> --drop-human-id <id2> --reason <text>` |
85
- | `setPriority(ctx, repo, humanId, priority)` | `backlog set-priority --repo <repo> --human-id <id> --priority <PRIORITY>` |
86
- | `attachToPlan(ctx, repo, humanId, planSlug)` | `backlog attach-to-plan --repo <repo> --human-id <id> --plan-slug <slug>` |
87
- | `importFromMarkdown(ctx, input)` | `backlog import-from-markdown --input '<ImportMarkdownInput json>'` |
88
- | `renderToMarkdown(ctx, filter?)` | `backlog render-to-markdown --filter '<BacklogFilter json>'` |
89
- | `exportJson(ctx, filter?)` | `backlog export-json --filter '<json>'` |
90
- | `auditTrail(ctx, repo, humanId)` | `backlog audit-trail --repo <repo> --human-id <id>` |
91
- | `migrationStatus(ctx)` | `backlog migration-status` |
92
- | `setMigrationPhase(ctx, phase)` | `backlog set-migration-phase --phase <PHASE>` (admin-only — only whoever just verified a phase's DoD should call this) |
93
-
94
- Every `<repo>` value is this machine's stable git-remote-derived slug (e.g.
95
- `PseudoSky/adhd`) — never a bare directory name. A worktree agent
96
- (`<repo>/.worktrees/*`) resolves to the SAME main-repo `repo` slug, not a
97
- phantom per-worktree repo.
98
-
99
- ## 3. Claim/renew/release protocol (multi-agent use)
100
-
101
- - Identity is always `${agentName}:${instanceId}` — NEVER a bare role literal
102
- like `"agent"`. Two concurrent agents both claiming as `"implementer"`
103
- defeats the CAS protocol entirely.
104
- - `claimItem` is idempotent for the SAME claimant — always `renewed`, no
105
- contention check.
106
- - A long-running task must call `renewClaim` periodically (default
107
- staleness: 30 minutes).
108
- - Every exit path (done/error/abandoned) calls `releaseClaim`
109
- unconditionally — it is a no-op on an already-unclaimed item, never an
110
- error. Never leave an item claimed after you stop working on it.
111
-
112
- ## 4. Citations — via tool calls, never hand-typed markdown
113
-
114
- The `Citation` type (`{ file, lines?, context? }`) is the structured form of
115
- one bracketed citation entry in the old hand-edited convention. Instead of
116
- typing a `Citations: [...]` line by hand:
117
-
118
- - Call `transitionStatus`/`resolveItem` with `{ citations: [...] }` when
119
- moving into any terminal-done/terminal-workaround status — this is
120
- REQUIRED and enforced (a status transition without citations there is
121
- rejected).
122
- - Call `addCitation` to attach evidence without a status change.
123
-
124
- ## 5. Dedupe before filing — via the tool, not eyeballing
125
-
126
- `createItem` runs a dedupe scan (FTS over title+body, plus exact
127
- symbol/path/errorText metadata match) BEFORE writing, and returns
128
- `duplicateCandidates` alongside `created: false` when a likely match exists.
129
- **Always inspect `duplicateCandidates` first.** Only pass `force: true` after
130
- confirming the candidates are genuinely a distinct issue — never as a way to
131
- skip reading them.
132
-
133
- ## 6. Filing a new item — worked example
134
-
135
- ```
136
- backlog create-item --input '{
137
- "family": "BUG-MYAREA",
138
- "title": "Short, specific summary",
139
- "body": "Full description, root cause if known, evidence.",
140
- "repo": "PseudoSky/adhd",
141
- "projectPath": "packages/domain/my-package",
142
- "priority": "HIGH"
143
- }'
144
- ```
145
-
146
- If the response has `created: false` with non-empty `duplicateCandidates`,
147
- read them before deciding whether to `force: true` or update the existing
148
- item instead (`updateItem`/`appendNote`).
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes