@unbrained/pm-cli 2026.8.26 → 2026.8.28

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 (196) hide show
  1. package/.agents/skills/HARNESS_COMPATIBILITY.md +32 -0
  2. package/.agents/skills/README.md +47 -0
  3. package/.agents/skills/pm-developer/SKILL.md +117 -0
  4. package/.agents/skills/pm-developer/references/COMMAND_PLAYBOOK.md +49 -0
  5. package/.agents/skills/pm-developer/references/GRAPH_AND_RELATIONSHIPS.md +91 -0
  6. package/.agents/skills/pm-developer/references/MULTI_AGENT_MERGE.md +72 -0
  7. package/.agents/skills/pm-developer/references/PROMPTS.md +17 -0
  8. package/.agents/skills/pm-developer/references/SCRIPTING_COMPOSITION.md +82 -0
  9. package/.agents/skills/pm-developer/references/TOKEN_BUDGETS.md +85 -0
  10. package/.agents/skills/pm-extensions/SKILL.md +106 -0
  11. package/.agents/skills/pm-extensions/references/AUTHORING.md +95 -0
  12. package/.agents/skills/pm-extensions/references/LIFECYCLE.md +40 -0
  13. package/.agents/skills/pm-extensions/references/TROUBLESHOOTING.md +25 -0
  14. package/.agents/skills/pm-sdk/SKILL.md +107 -0
  15. package/.agents/skills/pm-sdk/references/DOMAIN_MODELING.md +78 -0
  16. package/.agents/skills/pm-sdk/references/INTEGRATION_CHECKLIST.md +31 -0
  17. package/.agents/skills/pm-sdk/references/PROMPTS.md +13 -0
  18. package/.agents/skills/pm-sdk/references/SURFACE_MAP.md +82 -0
  19. package/.agents/skills/pm-user/SKILL.md +111 -0
  20. package/.agents/skills/pm-user/references/BACKLOG_SHAPING.md +105 -0
  21. package/.agents/skills/pm-user/references/PROMPTS.md +17 -0
  22. package/.agents/skills/pm-user/references/WORKFLOWS.md +35 -0
  23. package/.claude-plugin/marketplace.json +2 -2
  24. package/CHANGELOG.md +50 -4
  25. package/README.md +8 -5
  26. package/dist/cli/commander-usage.js +11 -7
  27. package/dist/cli/error-guidance.js +62 -8
  28. package/dist/cli/help-content.d.ts +2 -0
  29. package/dist/cli/help-content.js +53 -17
  30. package/dist/cli/help-json-payload.d.ts +8 -2
  31. package/dist/cli/help-json-payload.js +46 -12
  32. package/dist/cli/main.js +52 -74
  33. package/dist/cli/register-annotations.js +83 -60
  34. package/dist/cli/register-setup.js +98 -57
  35. package/dist/cli-bundle/bundle-manifest.json +151 -151
  36. package/dist/cli-bundle/chunks/{chunk-UKBCRPA2.js → chunk-BY2FQ2NI.js} +2 -2
  37. package/dist/cli-bundle/chunks/chunk-E73FDIWT.js +3 -0
  38. package/dist/cli-bundle/chunks/{chunk-WRHJ3MB6.js → chunk-FEVBFFCQ.js} +2 -2
  39. package/dist/cli-bundle/chunks/{chunk-KBFP3E4E.js → chunk-M7OXRQE3.js} +66 -44
  40. package/dist/cli-bundle/chunks/{chunk-S4U76VZF.js → chunk-NBCBFVZI.js} +2 -2
  41. package/dist/cli-bundle/chunks/{chunk-ZNRLJ54C.js → chunk-NTXZHRKA.js} +45 -45
  42. package/dist/cli-bundle/chunks/chunk-QE6WQXFO.js +3 -0
  43. package/dist/cli-bundle/chunks/chunk-TIQ6AMH2.js +13 -0
  44. package/dist/cli-bundle/chunks/chunk-X2RROGZE.js +2 -0
  45. package/dist/cli-bundle/chunks/{chunk-E2GCFJSU.js → chunk-XRVVYRRO.js} +33 -33
  46. package/dist/cli-bundle/chunks/chunk-XWEQGHHG.js +202 -0
  47. package/dist/cli-bundle/chunks/{register-list-query-EMCPMICY.js → register-list-query-J35ZPQQ5.js} +2 -2
  48. package/dist/cli-bundle/chunks/{register-mutation-OJ67ABCB.js → register-mutation-J6XJJOGU.js} +4 -4
  49. package/dist/cli-bundle/chunks/{register-operations-H2GLP7LT.js → register-operations-AE3JEMFT.js} +2 -2
  50. package/dist/cli-bundle/chunks/register-setup-OQERLLWE.js +2 -0
  51. package/dist/cli-bundle/focused-chunks/{chunk-72T6JGAE.js → chunk-4ZDRZYYJ.js} +43 -43
  52. package/dist/cli-bundle/focused-chunks/{chunk-OHIHZ7HS.js → chunk-6GCRSLPG.js} +2 -2
  53. package/dist/cli-bundle/focused-chunks/{chunk-UYBA57GY.js → chunk-AD6ULRAF.js} +2 -2
  54. package/dist/cli-bundle/focused-chunks/{chunk-FXDLT6FL.js → chunk-AHAM2HAU.js} +2 -2
  55. package/dist/cli-bundle/focused-chunks/{chunk-LV5N3LK5.js → chunk-FC2AXLB5.js} +2 -2
  56. package/dist/cli-bundle/focused-chunks/{chunk-IBHXMFE7.js → chunk-HC7ODMH3.js} +2 -2
  57. package/dist/cli-bundle/focused-chunks/{chunk-4K2II4TV.js → chunk-HVQ22RC4.js} +2 -2
  58. package/dist/cli-bundle/focused-chunks/{chunk-MMXUPDDJ.js → chunk-JZYPPMXF.js} +2 -2
  59. package/dist/cli-bundle/focused-chunks/chunk-LLNTHF5X.js +2 -0
  60. package/dist/cli-bundle/focused-chunks/chunk-LYFWQMVC.js +2 -0
  61. package/dist/cli-bundle/focused-chunks/{chunk-A644DUFQ.js → chunk-MEASX544.js} +2 -2
  62. package/dist/cli-bundle/focused-chunks/{chunk-YO3ZF3FI.js → chunk-THEPQMLX.js} +2 -2
  63. package/dist/cli-bundle/focused-chunks/{chunk-57XY346D.js → chunk-XDPYBQCF.js} +9 -9
  64. package/dist/cli-bundle/focused-chunks/{chunk-TMJDFHVD.js → chunk-Y3JJXRVK.js} +2 -2
  65. package/dist/cli-bundle/focused-chunks/{chunk-66VGB23P.js → chunk-Y5A7SJJ7.js} +2 -2
  66. package/dist/cli-bundle/focused-chunks/chunk-YJLDHJOD.js +2 -0
  67. package/dist/cli-bundle/focused-chunks/{chunk-P2E6LDAE.js → chunk-YVVZ3LQ6.js} +3 -3
  68. package/dist/cli-bundle/focused-chunks/chunk-Z2USIBR2.js +5 -0
  69. package/dist/cli-bundle/main.js +15 -14
  70. package/dist/cli-bundle/sdk-authoring.js +1 -1
  71. package/dist/cli-bundle/sdk-contracts.js +2 -2
  72. package/dist/cli-bundle/sdk-core.js +31 -31
  73. package/dist/cli-bundle/sdk-governance.js +1 -1
  74. package/dist/cli-bundle/sdk-graph.js +1 -1
  75. package/dist/cli-bundle/sdk-merge.js +31 -31
  76. package/dist/cli-bundle/sdk-query.js +1 -1
  77. package/dist/cli-bundle/sdk-runtime.js +1 -1
  78. package/dist/cli-bundle/sdk-testing.js +1 -1
  79. package/dist/cli-bundle/sdk.js +32 -7
  80. package/dist/core/governance/issue-codes.d.ts +11 -2
  81. package/dist/core/governance/issue-codes.js +29 -10
  82. package/dist/core/item/item-format.js +3 -3
  83. package/dist/core/store/item-store.js +12 -5
  84. package/dist/mcp/server.js +123 -9
  85. package/dist/mcp/tool-definitions.d.ts +2 -0
  86. package/dist/mcp/tool-definitions.js +5 -5
  87. package/dist/sdk/agent/closed-domain-contracts.d.ts +1 -1
  88. package/dist/sdk/agent/closed-domain-contracts.js +24 -2
  89. package/dist/sdk/agent/command-recovery.js +3 -3
  90. package/dist/sdk/agent/task-transcript-contracts.d.ts +52 -0
  91. package/dist/sdk/agent/task-transcript-contracts.js +198 -0
  92. package/dist/sdk/agent-capability-contracts.js +6 -2
  93. package/dist/sdk/annotations.d.ts +5 -2
  94. package/dist/sdk/annotations.js +66 -36
  95. package/dist/sdk/cli-bootstrap.d.ts +2 -8
  96. package/dist/sdk/cli-bootstrap.js +7 -66
  97. package/dist/sdk/cli-contracts/bootstrap-command-scanner.d.ts +23 -0
  98. package/dist/sdk/cli-contracts/bootstrap-command-scanner.js +80 -0
  99. package/dist/sdk/cli-contracts/command-aliases.js +15 -2
  100. package/dist/sdk/cli-contracts/enum-contracts.d.ts +4 -1
  101. package/dist/sdk/cli-contracts/enum-contracts.js +7 -2
  102. package/dist/sdk/cli-contracts/flag-contracts.js +12 -5
  103. package/dist/sdk/cli-contracts/flag-lexicon-contracts.js +5 -5
  104. package/dist/sdk/cli-contracts/grammar-contracts.d.ts +3 -3
  105. package/dist/sdk/cli-contracts/grammar-contracts.js +24 -17
  106. package/dist/sdk/cli-contracts/runtime-contracts.js +13 -11
  107. package/dist/sdk/cli-contracts/tool-parameter-tables.js +15 -2
  108. package/dist/sdk/cli-contracts/tool-schema.d.ts +1 -1
  109. package/dist/sdk/cli-contracts/tool-schema.js +32 -16
  110. package/dist/sdk/cli-contracts.d.ts +1 -1
  111. package/dist/sdk/cli-contracts.js +3 -3
  112. package/dist/sdk/cli-program.js +3 -2
  113. package/dist/sdk/comments.d.ts +4 -0
  114. package/dist/sdk/comments.js +2 -2
  115. package/dist/sdk/completion.js +47 -16
  116. package/dist/sdk/contracts.d.ts +1 -0
  117. package/dist/sdk/contracts.js +3 -2
  118. package/dist/sdk/extension/install-sources.d.ts +13 -0
  119. package/dist/sdk/extension/install-sources.js +62 -30
  120. package/dist/sdk/generated/generated-error-code-catalog-part-1.js +26 -2
  121. package/dist/sdk/generated/generated-error-code-catalog-part-2.js +38 -14
  122. package/dist/sdk/governance/upgrade.d.ts +2 -0
  123. package/dist/sdk/governance/upgrade.js +30 -8
  124. package/dist/sdk/governance/validate.js +8 -6
  125. package/dist/sdk/guide-topics.js +6 -6
  126. package/dist/sdk/index.d.ts +5 -2
  127. package/dist/sdk/index.js +6 -3
  128. package/dist/sdk/learnings.d.ts +4 -0
  129. package/dist/sdk/learnings.js +7 -4
  130. package/dist/sdk/lifecycle/close.js +4 -3
  131. package/dist/sdk/mcp/apps.d.ts +70 -0
  132. package/dist/sdk/mcp/apps.js +154 -0
  133. package/dist/sdk/mcp/skills.d.ts +127 -0
  134. package/dist/sdk/mcp/skills.js +390 -0
  135. package/dist/sdk/notes.d.ts +4 -0
  136. package/dist/sdk/notes.js +2 -2
  137. package/dist/sdk/read-output-contracts.js +16 -3
  138. package/dist/sdk/runtime-action-aliases.js +7 -3
  139. package/dist/sdk/runtime-input.js +15 -4
  140. package/dist/sdk/runtime-primitives.d.ts +1 -1
  141. package/dist/sdk/runtime-primitives.js +3 -3
  142. package/dist/sdk/runtime.d.ts +6 -6
  143. package/dist/sdk/runtime.js +8 -8
  144. package/docs/CLI_GRAMMAR.md +7 -1
  145. package/docs/COMMANDS.md +5 -4
  146. package/docs/EXTENSIONS.md +33 -32
  147. package/docs/MCP_2026_07_28.md +24 -2
  148. package/docs/MCP_2026_07_28_CONFORMANCE.md +4 -4
  149. package/docs/MCP_SKILLS_AND_APPS.md +107 -0
  150. package/docs/OUTPUT_TOKEN_ACCOUNTING.md +20 -7
  151. package/docs/QUICKSTART.md +15 -15
  152. package/docs/README.md +1 -0
  153. package/docs/RELEASING.md +20 -4
  154. package/docs/SDK.md +12 -0
  155. package/docs/SDK_CONTEXT_INTEGRITY.md +18 -1
  156. package/docs/SDK_EVIDENCE_TRACEABILITY.md +9 -1
  157. package/docs/SDK_RUNTIME_BOUNDARIES.md +10 -0
  158. package/docs/TESTING.md +6 -2
  159. package/docs/agent-task-token-baseline.json +97 -11
  160. package/docs/agent-task-transcripts.json +211 -0
  161. package/docs/generated/AGENT_CAPABILITY_ROUTING.md +1 -1
  162. package/docs/generated/FLAG_LEXICON_BUDGETS.md +3 -3
  163. package/docs/generated/REFUSAL_CLOSURE_CENSUS.md +11 -7
  164. package/docs/performance/cli-transport-overhead.md +10 -2
  165. package/marketplace.json +2 -2
  166. package/package.json +10 -8
  167. package/packages/pm-beads/README.md +12 -6
  168. package/packages/pm-beads/docs/MIGRATION.md +53 -0
  169. package/packages/pm-beads/extensions/beads/index.ts +8 -0
  170. package/packages/pm-beads/extensions/beads/runtime.ts +671 -112
  171. package/packages/pm-beads/package.json +1 -1
  172. package/packages/pm-calendar/package.json +1 -1
  173. package/packages/pm-command-kit/package.json +1 -1
  174. package/packages/pm-digital-twin/package.json +1 -1
  175. package/packages/pm-governance-audit/package.json +1 -1
  176. package/packages/pm-guide-shell/package.json +1 -1
  177. package/packages/pm-kanban/package.json +1 -1
  178. package/packages/pm-lifecycle-hooks/package.json +1 -1
  179. package/packages/pm-linked-test-adapters/package.json +1 -1
  180. package/packages/pm-search-advanced/package.json +1 -1
  181. package/packages/pm-templates/package.json +1 -1
  182. package/packages/pm-todos/package.json +1 -1
  183. package/packages/pm-vcs/package.json +1 -1
  184. package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
  185. package/plugins/pm-codex/.codex-plugin/plugin.json +1 -1
  186. package/sdk/public-surface.json +430 -36
  187. package/dist/cli-bundle/chunks/chunk-ES25LX3D.js +0 -202
  188. package/dist/cli-bundle/chunks/chunk-FRDWWB6R.js +0 -3
  189. package/dist/cli-bundle/chunks/chunk-ICQ3RVIY.js +0 -2
  190. package/dist/cli-bundle/chunks/chunk-IV64RJVE.js +0 -13
  191. package/dist/cli-bundle/chunks/chunk-MVYLQ67M.js +0 -3
  192. package/dist/cli-bundle/chunks/register-setup-GLZAHLVI.js +0 -2
  193. package/dist/cli-bundle/focused-chunks/chunk-4XNH2HM7.js +0 -2
  194. package/dist/cli-bundle/focused-chunks/chunk-7I23XGWO.js +0 -2
  195. package/dist/cli-bundle/focused-chunks/chunk-7YCDTCBC.js +0 -2
  196. package/dist/cli-bundle/focused-chunks/chunk-LMKG3DFE.js +0 -5
@@ -0,0 +1,32 @@
1
+ # Harness Compatibility
2
+
3
+ This repository supports external automation harnesses through shared docs and `.agents/skills` workflows only. Harness-specific runtime code belongs in separate adapter packages, not in the main `pm` CLI or SDK.
4
+
5
+ ## Progressive-Disclosure Route
6
+
7
+ Use the same low-token route in every harness:
8
+
9
+ 1. `pm install guide-shell --project` (enable optional local guide commands)
10
+ 2. `pm guide` (topic index)
11
+ 3. `pm guide <topic>` (focused route)
12
+ 4. `pm guide <topic> --depth standard|deep` (details only when needed)
13
+ 5. `pm contracts --command <command> --flags-only --json` (strict machine flags)
14
+
15
+ ## Harness Mapping
16
+
17
+ | Harness need | Preferred prompt/doc entrypoint | Skill route |
18
+ |--------------|----------------------------------|-------------|
19
+ | Development loop | `AGENTS.md` + optional `pm guide workflows` | `.agents/skills/pm-developer/SKILL.md` |
20
+ | User/operator workflow | repository docs + optional `pm guide quickstart` | `.agents/skills/pm-user/SKILL.md` |
21
+ | Package authoring | repository docs + optional `pm guide extensions` | `.agents/skills/pm-extensions/SKILL.md` |
22
+ | SDK integration | repository docs + optional `pm guide sdk` | `.agents/skills/pm-sdk/SKILL.md` |
23
+
24
+ ## Verification
25
+
26
+ Before release, run:
27
+
28
+ ```bash
29
+ pm install guide-shell --project
30
+ pm guide skills --depth standard
31
+ node scripts/release/docs-skills-gate.mjs
32
+ ```
@@ -0,0 +1,47 @@
1
+ # pm Agent Skills
2
+
3
+ `agentskills.io`-style skill bundles for `pm` workflows, written for
4
+ progressive disclosure: each `SKILL.md` is a router of roughly one screen, each
5
+ `references/*.md` is a bounded expansion, and the exhaustive surface is fetched
6
+ at runtime from contracts rather than copied into prose that can drift.
7
+
8
+ ## Load Order
9
+
10
+ | Tier | Source | Typical cost | Staleness risk |
11
+ | ---- | -------------------------------------- | ------------ | -------------- |
12
+ | 0 | `SKILL.md` | ~650 tok | Gated |
13
+ | 1 | `pm next`, `pm context`, `pm search` | ~0.5-2.5k | None (live) |
14
+ | 2 | `pm contracts ...`, `pm <cmd> --help --json` | ~1-3.4k | None (generated) |
15
+ | 2 | `pm guide <topic> --depth brief` | ~0.6-1k | Gated |
16
+ | 3 | `references/*.md` | ~0.3-1k each | Gated |
17
+ | 4 | `docs/*.md` | 0.7k-45k | Gated |
18
+
19
+ Never load a tier-4 document whole when a reference routes into a section of
20
+ it. `docs/COMMANDS.md` is ~29k tokens and `docs/SDK.md` is ~45k.
21
+
22
+ ## Bundles
23
+
24
+ | Skill | Use when |
25
+ | --------------------------------- | ------------------------------------------------------ |
26
+ | [`pm-developer`](pm-developer/SKILL.md) | Changing code, docs, tests, or release gates |
27
+ | [`pm-user`](pm-user/SKILL.md) | Intake, triage, prioritization, planning, reporting |
28
+ | [`pm-extensions`](pm-extensions/SKILL.md) | Package and extension lifecycle and authoring |
29
+ | [`pm-sdk`](pm-sdk/SKILL.md) | Integrations, embedding, and domain packs on the SDK |
30
+
31
+ Harness-specific bundles ship with the plugins under `plugins/pm-claude/skills`
32
+ and `plugins/pm-codex/skills`; they route to the same guide topics and
33
+ contracts.
34
+
35
+ ## Runtime Routing
36
+
37
+ ```bash
38
+ pm install guide-shell --project
39
+ pm guide # topic index
40
+ pm guide skills
41
+ pm guide harnesses --depth standard
42
+ ```
43
+
44
+ Guide topics: `quickstart`, `commands`, `workflows`, `sdk`, `extensions`,
45
+ `skills`, `harnesses`, `release`, `tokens`, `graph`, `assurance`, `merge`.
46
+
47
+ Compatibility routing: [Harness compatibility matrix](HARNESS_COMPATIBILITY.md)
@@ -0,0 +1,117 @@
1
+ ---
2
+ name: pm-developer
3
+ description: Runs the pm-cli developer execution loop (orient, claim, implement, verify, close) with linked files/tests/docs evidence, under an explicit token budget. Use when coding, debugging, refactoring, or shipping repository changes tracked in pm items.
4
+ license: MIT
5
+ compatibility: Works in terminal-based coding agents with bash, Node.js, and pnpm.
6
+ metadata:
7
+ owner: unbrained
8
+ domain: pm-cli
9
+ scope: developer-workflow
10
+ ---
11
+
12
+ # pm Developer Skill
13
+
14
+ Implementation work that changes code, docs, tests, or release gates. `pm` is the
15
+ system of record: every change is linked to an item, and every mutation is
16
+ recorded in an append-only history stream.
17
+
18
+ ## Load Order
19
+
20
+ Load only the tier the task needs. Costs are measured, not estimated.
21
+
22
+ | Tier | Load | Cost | When |
23
+ | ---- | --------------------------------------------- | --------- | ---------------------------------------- |
24
+ | 0 | This file | ~650 tok | Always. |
25
+ | 1 | `pm next` or `pm context --limit 10` | ~2.1-2.5k | Pick or resume work. |
26
+ | 2 | `pm contracts --command <cmd> --flags-only` | ~1-3.4k | Exact flags for one command. |
27
+ | 2 | `pm guide <topic> --depth brief` | ~0.6-1k | A capability family you have not used. |
28
+ | 3 | `references/*.md` below | ~0.3-1k | Repeatable procedure detail. |
29
+ | 4 | `docs/*.md` | 0.7k-45k | Only when a reference routes you there. |
30
+
31
+ Never load `docs/COMMANDS.md` (~29k) or `docs/SDK.md` (~45k) whole. Both are
32
+ routed into by section from the references below.
33
+
34
+ Optional deep routing that never goes stale:
35
+
36
+ ```bash
37
+ pm install guide-shell --project
38
+ pm guide workflows --depth brief
39
+ ```
40
+
41
+ ## Non-Negotiables
42
+
43
+ - Author identity is detected automatically. **Never pass `--author` and never
44
+ set `PM_AUTHOR`.** The harness, model, effort, role, and topic are probed and
45
+ recorded on every history entry.
46
+ - Never edit files under `.agents/pm` directly. Every mutation goes through `pm`.
47
+ - Never claim an item's state from memory. Read it live before asserting it.
48
+ - Claim before substantial edits; release when paused, handed off, or closed.
49
+ - Search before creating. Record the duplicate check as a create-time comment.
50
+
51
+ ## Canonical Loop
52
+
53
+ ```bash
54
+ pm next # or: pm context --limit 10
55
+ pm search "<task keywords>" --limit 10
56
+ pm claim <ID>
57
+ pm update <ID> --status in_progress --message "Start implementation"
58
+ # ...implement...
59
+ pm files <ID> --add path=<path>,scope=project,note="<why>"
60
+ pm docs <ID> --add path=<doc>,scope=project,note="<why>"
61
+ pm test <ID> --add command="node scripts/run-tests.mjs test -- <target>",scope=project,timeout_seconds=240
62
+ pm comments <ID> "Evidence: <what changed and what passed>"
63
+ pm test <ID> --run --progress
64
+ pm close <ID> "<reason with evidence>" --validate-close warn
65
+ pm release <ID>
66
+ ```
67
+
68
+ ## Capability Map
69
+
70
+ Capability families and their commands are generated from the public SDK
71
+ contract. Start with `pm guide capabilities`, expand only the family the task
72
+ enters, and use these drift-gated references:
73
+
74
+ - [Capability routing](../../../docs/generated/AGENT_CAPABILITY_ROUTING.md)
75
+ - [Visibility tiers and families](../../../docs/generated/AGENT_COMMAND_SURFACE.md)
76
+
77
+ `pm help` shows the bounded core tier. Use `pm guide capabilities`, `pm
78
+ contracts --summary`, or `pm <command> --help --json` for progressive
79
+ disclosure into the wider surface.
80
+
81
+ ## Token Discipline
82
+
83
+ Every read declares a default ceiling and degrades deterministically rather
84
+ than truncating silently. Choose in this order:
85
+
86
+ 1. **Projection** — ask for fewer fields: `pm get <ID> --output-include id,title,status,dependencies`.
87
+ 2. **Row limit** — `--output-limit 20`, or the command's own `--limit`.
88
+ 3. **Budget** — `--output-budget <tokens>` only when the first two are set.
89
+ 4. **Continuation** — when a response carries `output_budget_truncation`, use
90
+ the declared `--output-cursor`. Re-running with `--output-budget unbounded`
91
+ can cost orders of magnitude more.
92
+
93
+ Always read the `omission_receipt` before treating a result as complete. See
94
+ [Token budgets and read output](references/TOKEN_BUDGETS.md).
95
+
96
+ ## Verification Defaults
97
+
98
+ ```bash
99
+ pnpm build
100
+ node scripts/run-tests.mjs test -- <targets>
101
+ node scripts/run-tests.mjs coverage
102
+ pm validate --check-resolution --check-history-drift
103
+ pm health --summary
104
+ ```
105
+
106
+ Repository-wide gates before proposing a merge: `pnpm quality:static`.
107
+
108
+ ## References
109
+
110
+ | Need | Load | Cost |
111
+ | ------------------------------------------------ | -------------------------------------------------------- | -------- |
112
+ | Command recipes for the developer loop | [Command playbook](references/COMMAND_PLAYBOOK.md) | ~275 tok |
113
+ | Prompt templates | [Prompts](references/PROMPTS.md) | ~250 tok |
114
+ | Bounded reads, cursors, projections, receipts | [Token budgets](references/TOKEN_BUDGETS.md) | ~900 tok |
115
+ | Typed edges, traversal, planning analytics | [Relationship graph](references/GRAPH_AND_RELATIONSHIPS.md) | ~900 tok |
116
+ | Branching, merging, concurrent agents | [Multi-agent and merge](references/MULTI_AGENT_MERGE.md) | ~800 tok |
117
+ | Composing pm with grep, jq, xargs, and scripts | [Scripting](references/SCRIPTING_COMPOSITION.md) | ~800 tok |
@@ -0,0 +1,49 @@
1
+ # Developer Command Playbook
2
+
3
+ ## Session Bootstrap (Maintainer Run)
4
+
5
+ ```bash
6
+ npm install -g .
7
+ pm --version
8
+ node -v
9
+ pnpm -v
10
+ pnpm build
11
+ ```
12
+
13
+ ## Item Lifecycle
14
+
15
+ ```bash
16
+ pm context --limit 10
17
+ pm search "<keywords>" --limit 10
18
+ pm list-open --limit 20
19
+ pm claim <ID>
20
+ pm update <ID> --status in_progress --description "..."
21
+ pm append <ID> --body "Implementation notes"
22
+ ```
23
+
24
+ ## Evidence Linking
25
+
26
+ ```bash
27
+ pm files <ID> --add path=src/<file>.ts,scope=project,note="implementation"
28
+ pm docs <ID> --add path=docs/<doc>.md,scope=project,note="public docs update"
29
+ pm test <ID> --add command="node scripts/run-tests.mjs test -- tests/unit/<file>.spec.ts",scope=project,timeout_seconds=240
30
+ ```
31
+
32
+ ## Close Workflow
33
+
34
+ ```bash
35
+ pm test <ID> --run --progress
36
+ node scripts/run-tests.mjs coverage
37
+ pm comments <ID> "Evidence: linked tests passed; coverage remained green."
38
+ pm close <ID> "Acceptance criteria met with verification evidence." --validate-close warn
39
+ pm release <ID>
40
+ ```
41
+
42
+ ## Local Docs Routing
43
+
44
+ ```bash
45
+ pm install guide-shell --project
46
+ pm guide workflows
47
+ pm guide commands --depth standard
48
+ pm guide release --json
49
+ ```
@@ -0,0 +1,91 @@
1
+ # Relationships and Graph Analytics
2
+
3
+ The tracker is a directed graph, not a list. Typed edges are what make the
4
+ project's history readable by algorithm. Full contract:
5
+ [docs/RELATIONSHIP_GRAPH.md](../../../../docs/RELATIONSHIP_GRAPH.md) (~7.4k tok)
6
+ and [docs/DEPENDENCY_KIND_CONTRACT.md](../../../../docs/DEPENDENCY_KIND_CONTRACT.md) (~700 tok).
7
+
8
+ ## The Edge Vocabulary
9
+
10
+ Authoritative at runtime:
11
+
12
+ ```bash
13
+ pm contracts --json --full | jq '.relationship_kind_contracts'
14
+ ```
15
+
16
+ | Kind | Meaning | Ordering | Hierarchy |
17
+ | ----------------- | ---------------------------------------------- | -------- | --------- |
18
+ | `parent` | This item belongs under that one | no | yes |
19
+ | `child` | Inverse of `parent` | no | yes |
20
+ | `blocked_by` | This item waits for that one | yes | no |
21
+ | `blocks` | Inverse of `blocked_by` | yes | no |
22
+ | `implements` | This item realizes that goal, story, or ADR | no | no |
23
+ | `verifies` | This item proves that one behaves as claimed | no | no |
24
+ | `discovered_from` | This item was found while doing that one | no | no |
25
+ | `incident_from` | This item originates in that recorded incident | no | no |
26
+ | `supersedes` | This item replaces that one | no | no |
27
+ | `commits_to` | This item lands in that changeset or release | yes | no |
28
+ | `related` | Associative, non-directional | no | no |
29
+
30
+ `related` carries the least information. Prefer a typed kind whenever one
31
+ applies — `discovered_from`, `implements`, and `verifies` are the three that
32
+ most often replace a reflexive `related`.
33
+
34
+ ## Adding Edges
35
+
36
+ ```bash
37
+ pm update <ID> --dep "id=<other>,kind=implements"
38
+ pm update <ID> --dep "id=<other>,kind=discovered_from"
39
+ pm update <ID> --dep-remove "id=<other>,kind=related"
40
+ ```
41
+
42
+ Rules that prevent damage:
43
+
44
+ - `--dep` **appends**; it does not replace the dependency list.
45
+ - `--dep-remove` with a bare id deletes **every** row for that id. Always pass
46
+ `kind=` unless removing all of them is the intent.
47
+ - Never record both `A blocks B` and `B blocked_by A`. They are inverse
48
+ spellings of one edge, and recording both creates a cycle.
49
+ - Never add an edge to satisfy a count. Each edge should cite durable text, a
50
+ history event, or a linked artifact.
51
+ - A placeholder or misspelled id passes `create` silently. Verify with
52
+ `pm deps <ID>` after adding.
53
+
54
+ ## Reading The Graph
55
+
56
+ ```bash
57
+ pm deps <ID> # tree view of one item's neighborhood
58
+ pm deps <ID> --format context --direction both --kind implements,verifies
59
+ pm graph analyze # layers, critical path, components, hubs
60
+ pm graph audit # findings, coverage, edge composition
61
+ pm graph impact <ID> --direction downstream
62
+ pm graph ancestors <ID> / descendants <ID>
63
+ pm graph paths <A> <B>
64
+ pm graph dominators <ID> # what must pass through this node
65
+ pm graph articulation # single points of failure
66
+ pm graph communities / centrality / slack / redundancy
67
+ pm graph plan # critical path method over the ordering DAG
68
+ ```
69
+
70
+ `pm graph impact` and the traversal verbs are directional. Pass `--direction`
71
+ explicitly rather than relying on a default when the answer depends on it.
72
+
73
+ ## Governance Signals Worth Checking
74
+
75
+ `pm graph audit` reports the properties that decide whether the graph is
76
+ trustworthy:
77
+
78
+ - `isolated_active_nodes` and `degree_leq_one_active_nodes` — work nobody can
79
+ reach from anywhere.
80
+ - `redundant_edges` — edges implied by another path; they cost storage and
81
+ dilute analytics.
82
+ - `ordering_contradiction_edges` — a scheduling claim contradicted elsewhere.
83
+ - `outcome_unreachable_nodes` — items that resolve to no declared goal.
84
+ - `articulation_points` and `bridge_edges` — the structural chokepoints.
85
+
86
+ When a workspace declares these as assurance bounds, adding edges can move a
87
+ ratchet. Check headroom before a bulk enrichment pass:
88
+
89
+ ```bash
90
+ pm assurance run graph-composition --trigger ci --dry-run --json
91
+ ```
@@ -0,0 +1,72 @@
1
+ # Multiple Agents, Branches, and Merges
2
+
3
+ Tracker data is versioned alongside the code, so several agents can work on
4
+ separate branches and merge without hand-resolving item files. Full contract:
5
+ [docs/MERGE_SAFETY.md](../../../../docs/MERGE_SAFETY.md) (~4.4k tok).
6
+
7
+ ## Once Per Clone Or Worktree
8
+
9
+ The `.gitattributes` merge fence is committed, but the driver definitions it
10
+ names are clone-local git config. A fresh clone or worktree merges tracker data
11
+ textually until the installer has run:
12
+
13
+ ```bash
14
+ pm merge install
15
+ pm merge install --dry-run # preview
16
+ ```
17
+
18
+ Skipping this is the single most common cause of tracker merge conflicts.
19
+
20
+ ## Ownership Across Agents
21
+
22
+ - `pm claim <ID>` before substantial edits. A claim is a recorded lease, not a
23
+ lock file, and it survives branching.
24
+ - `pm release <ID>` when pausing, handing off, closing, or canceling.
25
+ - `pm list-in-progress` shows what the fleet currently holds.
26
+ - Never force an ownership or lock override without explicit human approval.
27
+
28
+ Author identity is detected per invocation — harness, model, effort, role, and
29
+ topic — so two agents on the same branch remain distinguishable in history
30
+ without anyone passing `--author`.
31
+
32
+ ## What Merges Field-Aware
33
+
34
+ The driver resolves four artifact classes: `item`, `history`, `relationship`,
35
+ and `json`. Set-valued fields such as tags and dependency rows union rather
36
+ than collide. Scalar fields follow the recorded field policy.
37
+
38
+ Two properties to keep in mind when designing concurrent work:
39
+
40
+ - **Additive beats rewriting.** `pm comments`, `pm notes`, and `--dep` append.
41
+ Rewriting a description or replacing acceptance criteria on two branches is a
42
+ genuine conflict that no driver can invent an answer for.
43
+ - **Independent ids do not collide** unless two branches mint the same id for
44
+ unrelated items. Prefer creating items on a branch that has seen the other
45
+ branch's ids when doing bulk creation.
46
+
47
+ ## After A Merge
48
+
49
+ A clean field-aware merge can still leave history streams needing
50
+ reconciliation. Always run the post-merge gate:
51
+
52
+ ```bash
53
+ pm merge report
54
+ pm merge reconcile --message "Post-merge history reconciliation"
55
+ pm validate --check-history-drift
56
+ pm health --check-only
57
+ ```
58
+
59
+ `pm merge report` lists what the driver decided and what it discarded. Review
60
+ it before reconciling; reconciliation is an audited write.
61
+
62
+ ## Proving Nothing Was Lost
63
+
64
+ ```bash
65
+ pm validate --check-resolution --check-history-drift
66
+ pm graph audit
67
+ pm activity --limit 20
68
+ ```
69
+
70
+ History is append-only and hash-chained. `--check-history-drift` compares each
71
+ stream's recorded chain against its contents, so a silently rewritten entry
72
+ fails the check rather than passing unnoticed.
@@ -0,0 +1,17 @@
1
+ # Prompt Templates
2
+
3
+ ## Implement Feature
4
+
5
+ `Implement <feature> on <ID>. Reuse existing architecture, link all changed files/tests/docs, run targeted + coverage checks, and append evidence before close.`
6
+
7
+ ## Fix Bug
8
+
9
+ `Fix <bug> on <ID>. Add a regression test, keep the patch minimal, run focused tests first, then full gate commands if scope expands.`
10
+
11
+ ## Refactor
12
+
13
+ `Refactor <area> on <ID> without behavior changes. Preserve API contracts, update docs where command behavior is clarified, and validate with existing regression suite.`
14
+
15
+ ## Release Readiness Sweep
16
+
17
+ `Perform release readiness checks for <ID>. Run build, coverage, static quality, secret scan, and release gates. Document all results in a closure comment.`
@@ -0,0 +1,82 @@
1
+ # Composing pm With Shell Tools
2
+
3
+ `pm` is designed to be a process in a pipeline. Full contract:
4
+ [docs/SCRIPTING.md](../../../../docs/SCRIPTING.md) (~1.9k tok).
5
+
6
+ ## Exit Codes Are Part Of The Answer
7
+
8
+ | Exit | Meaning | Response |
9
+ | ---- | ----------------------------------------- | ----------------------------------- |
10
+ | 0 | Completed (a read may return zero rows) | Parse stdout. |
11
+ | 1 | Runtime failure | Preserve stderr and stop. |
12
+ | 2 | Invalid flags or composition | Fix the invocation; do not retry. |
13
+ | 3 | Tracker or resource not found | Fix the path or id. |
14
+ | 4 | State or concurrency conflict | Refresh live state, then decide. |
15
+ | 5 | A dependency operation failed | Inspect dependency evidence. |
16
+ | 6 | Succeeded, matched nothing to change | Success. Inspect the receipt. |
17
+ | 7 | Succeeded, changed part of the selection | Success. Inspect unmatched rows. |
18
+
19
+ `0`, `6`, and `7` are all success. A bare `if pm ...; then` treats `6` and `7`
20
+ as failure, so classify the status explicitly in scripts.
21
+
22
+ ## JSON Shapes
23
+
24
+ - CLI JSON has **no result wrapper**. `pm get <ID> --json` returns the entity
25
+ envelope directly.
26
+ - Collections return `items`, `count`, `total`, `has_more`, `next_cursor`, and
27
+ a `completeness` block.
28
+ - Mutations return a flat receipt: `id`, `status`, `changed_field_count`.
29
+ - `--lean` drops nulls and empty containers, which makes `jq` selectors shorter
30
+ and the payload smaller.
31
+
32
+ ## Patterns
33
+
34
+ Select ids and act on them:
35
+
36
+ ```bash
37
+ ids=$(pm list --status open --type Issue --json --output-budget unbounded \
38
+ | jq -r '.items[] | select(.title | test("Semgrep")) | .id' | paste -sd,)
39
+ pm update-many --ids "$ids" --tags triaged --dry-run
40
+ ```
41
+
42
+ Bulk writes take ids comma-joined in a single argument; reads emit one id per
43
+ line. `paste -sd,` or `tr '\n' ','` bridges the two.
44
+
45
+ Aggregate without loading rows:
46
+
47
+ ```bash
48
+ pm aggregate --group-by type --json | jq '.groups'
49
+ pm stats --json | jq '.by_status'
50
+ ```
51
+
52
+ Drive a check from graph structure:
53
+
54
+ ```bash
55
+ pm graph audit --json | jq '{findings: .finding_count, redundant: .profile.redundant_edges}'
56
+ ```
57
+
58
+ Stream history:
59
+
60
+ ```bash
61
+ pm activity --limit 50 --json | jq -r '.events[] | [.at, .op, .item_id] | @tsv'
62
+ ```
63
+
64
+ ## Guardrails
65
+
66
+ - One malformed flag makes a whole bulk update apply nothing. Use `--dry-run`
67
+ first on any `*-many` command.
68
+ - Never delete items by search match. Delete only by exact id.
69
+ - Do not write absolute filesystem paths into item text; run the repository
70
+ secret scan before committing tracker changes.
71
+ - Prefer `--output-budget unbounded` only inside scripts that consume the output
72
+ programmatically, never in an agent's own context.
73
+
74
+ ## Discovering Exact Flags
75
+
76
+ The contract is authoritative and never stale:
77
+
78
+ ```bash
79
+ pm <command> --help --json
80
+ pm contracts --command <command> --flags-only --json
81
+ pm contracts --command <command> --full --json | jq '.command_exit_contracts'
82
+ ```
@@ -0,0 +1,85 @@
1
+ # Token Budgets and Read Output
2
+
3
+ Every `pm` read declares a default token ceiling, degrades deterministically
4
+ when it is reached, and reports what it withheld. This reference is the
5
+ operating procedure; [docs/READ_OUTPUT_CONTRACTS.md](../../../../docs/READ_OUTPUT_CONTRACTS.md)
6
+ (~3.6k tok) is the full contract.
7
+
8
+ ## The Four Levers, In Order
9
+
10
+ Apply the cheapest lever that answers the question.
11
+
12
+ 1. **Projection.** Ask for fewer fields or sections.
13
+
14
+ ```bash
15
+ pm get <ID> --output-include id,title,status,dependencies
16
+ pm list --status open --output-include id,title,type
17
+ ```
18
+
19
+ 2. **Row limit.** Bound the number of rows before bounding tokens.
20
+
21
+ ```bash
22
+ pm list --status open --output-limit 20
23
+ pm search "<terms>" --limit 10
24
+ ```
25
+
26
+ 3. **Budget.** Only after 1 and 2 are set.
27
+
28
+ ```bash
29
+ pm context --limit 10 --output-budget 4000
30
+ ```
31
+
32
+ 4. **Continuation.** Resume rather than re-read.
33
+
34
+ ```bash
35
+ pm notes <ID> --output-cursor <cursor-from-previous-response>
36
+ ```
37
+
38
+ ## Reading The Receipt
39
+
40
+ Two blocks decide whether a result may be treated as complete.
41
+
42
+ - `omission_receipt` — declares whether field groups were dropped and the flag
43
+ that restores each one. `has_omissions: false` means the projection is whole.
44
+ - `output_budget_truncation` — appears only when a ceiling bound the result. It
45
+ names the `reason`, the `budget_source`, the row collections it compacted, and
46
+ whether a continuation is available.
47
+
48
+ A truncated read is a claim about the part it withheld. Never summarize a
49
+ truncated list as if it were the population. When `continuation_available` is
50
+ true, the cursor is the correct recovery; `--output-budget unbounded` is the
51
+ last resort and can be hundreds of times more expensive.
52
+
53
+ ## Formats
54
+
55
+ - `--output-format toon` (default) is the agent-loop encoding: tabular rows are
56
+ emitted once as a header plus values, not repeated per row.
57
+ - `--output-format json` / `--json` is for strict parsing. JSON ceilings are
58
+ higher than TOON ceilings for the same command because the encoding is larger.
59
+ - `--lean` omits null and empty containers from JSON output.
60
+ - `--token-accounting` attaches a per-section cost receipt so a read can be
61
+ profiled before it is made routine.
62
+
63
+ ## Measuring Before Committing To A Pattern
64
+
65
+ ```bash
66
+ pm contracts --summary --json | jq '.command_summaries[]
67
+ | {command, toon: .default_max_estimated_tokens_by_format.toon}'
68
+ pm list --status open --token-accounting
69
+ ```
70
+
71
+ Use the declared ceiling per command rather than assuming a global one. A
72
+ command with no declared ceiling inherits the workspace default, which is a
73
+ weaker guarantee than a declared one.
74
+
75
+ ## Cold-Start Cost
76
+
77
+ The cheapest useful orientation is two calls:
78
+
79
+ ```bash
80
+ pm next # ~2.5k tok — one actionable item with its context
81
+ pm contracts --summary # ~2.6k tok — the command surface with per-command ceilings
82
+ ```
83
+
84
+ Prefer `pm next` over `pm list-open` when the goal is to start work: it applies
85
+ relevance ranking and returns a working set rather than a page of rows.