@unbrained/pm-cli 2026.5.10 → 2026.5.12

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 (172) hide show
  1. package/.claude-plugin/marketplace.json +4 -4
  2. package/AGENTS.md +3 -116
  3. package/CHANGELOG.md +14 -0
  4. package/PRD.md +11 -11
  5. package/README.md +20 -2
  6. package/dist/cli/argv-utils.d.ts +5 -0
  7. package/dist/cli/argv-utils.js +34 -0
  8. package/dist/cli/argv-utils.js.map +1 -0
  9. package/dist/cli/bootstrap-args.d.ts +15 -0
  10. package/dist/cli/bootstrap-args.js +211 -0
  11. package/dist/cli/bootstrap-args.js.map +1 -1
  12. package/dist/cli/commander-usage.js +109 -3
  13. package/dist/cli/commander-usage.js.map +1 -1
  14. package/dist/cli/commands/completion.js +7 -3
  15. package/dist/cli/commands/completion.js.map +1 -1
  16. package/dist/cli/commands/contracts.d.ts +19 -0
  17. package/dist/cli/commands/contracts.js +40 -2
  18. package/dist/cli/commands/contracts.js.map +1 -1
  19. package/dist/cli/commands/create.js +112 -51
  20. package/dist/cli/commands/create.js.map +1 -1
  21. package/dist/cli/commands/docs.js +9 -2
  22. package/dist/cli/commands/docs.js.map +1 -1
  23. package/dist/cli/commands/extension.d.ts +12 -3
  24. package/dist/cli/commands/extension.js +421 -69
  25. package/dist/cli/commands/extension.js.map +1 -1
  26. package/dist/cli/commands/files.js +9 -2
  27. package/dist/cli/commands/files.js.map +1 -1
  28. package/dist/cli/commands/index.d.ts +1 -0
  29. package/dist/cli/commands/index.js +1 -0
  30. package/dist/cli/commands/index.js.map +1 -1
  31. package/dist/cli/commands/init.d.ts +2 -0
  32. package/dist/cli/commands/init.js +21 -1
  33. package/dist/cli/commands/init.js.map +1 -1
  34. package/dist/cli/commands/metadata-normalizers.d.ts +4 -0
  35. package/dist/cli/commands/metadata-normalizers.js +37 -0
  36. package/dist/cli/commands/metadata-normalizers.js.map +1 -0
  37. package/dist/cli/commands/reindex.js +173 -135
  38. package/dist/cli/commands/reindex.js.map +1 -1
  39. package/dist/cli/commands/search.js +16 -6
  40. package/dist/cli/commands/search.js.map +1 -1
  41. package/dist/cli/commands/test.js +23 -8
  42. package/dist/cli/commands/test.js.map +1 -1
  43. package/dist/cli/commands/update.js +70 -39
  44. package/dist/cli/commands/update.js.map +1 -1
  45. package/dist/cli/commands/upgrade.d.ts +63 -0
  46. package/dist/cli/commands/upgrade.js +260 -0
  47. package/dist/cli/commands/upgrade.js.map +1 -0
  48. package/dist/cli/error-guidance.d.ts +9 -1
  49. package/dist/cli/error-guidance.js +147 -6
  50. package/dist/cli/error-guidance.js.map +1 -1
  51. package/dist/cli/guide-topics.js +18 -16
  52. package/dist/cli/guide-topics.js.map +1 -1
  53. package/dist/cli/help-content.js +42 -2
  54. package/dist/cli/help-content.js.map +1 -1
  55. package/dist/cli/help-json-payload.js +11 -1
  56. package/dist/cli/help-json-payload.js.map +1 -1
  57. package/dist/cli/main.js +69 -6
  58. package/dist/cli/main.js.map +1 -1
  59. package/dist/cli/register-setup.js +174 -82
  60. package/dist/cli/register-setup.js.map +1 -1
  61. package/dist/cli/telemetry-flush.d.ts +2 -0
  62. package/dist/cli/telemetry-flush.js +4 -0
  63. package/dist/cli/telemetry-flush.js.map +1 -0
  64. package/dist/cli.js +1 -2
  65. package/dist/cli.js.map +1 -1
  66. package/dist/core/extensions/extension-types.d.ts +72 -0
  67. package/dist/core/extensions/extension-types.js +24 -0
  68. package/dist/core/extensions/extension-types.js.map +1 -1
  69. package/dist/core/extensions/loader.d.ts +1 -0
  70. package/dist/core/extensions/loader.js +766 -7
  71. package/dist/core/extensions/loader.js.map +1 -1
  72. package/dist/core/lock/lock.js +2 -0
  73. package/dist/core/lock/lock.js.map +1 -1
  74. package/dist/core/packages/manifest.d.ts +13 -0
  75. package/dist/core/packages/manifest.js +139 -0
  76. package/dist/core/packages/manifest.js.map +1 -0
  77. package/dist/core/sentry/instrument.d.ts +15 -0
  78. package/dist/core/sentry/instrument.js +35 -3
  79. package/dist/core/sentry/instrument.js.map +1 -1
  80. package/dist/core/shared/constants.js +20 -0
  81. package/dist/core/shared/constants.js.map +1 -1
  82. package/dist/core/shared/errors.d.ts +8 -0
  83. package/dist/core/shared/errors.js.map +1 -1
  84. package/dist/core/shared/levenshtein.d.ts +1 -0
  85. package/dist/core/shared/levenshtein.js +37 -0
  86. package/dist/core/shared/levenshtein.js.map +1 -0
  87. package/dist/core/store/paths.js +34 -1
  88. package/dist/core/store/paths.js.map +1 -1
  89. package/dist/core/store/settings.js +210 -1
  90. package/dist/core/store/settings.js.map +1 -1
  91. package/dist/core/telemetry/runtime.d.ts +1 -0
  92. package/dist/core/telemetry/runtime.js +102 -3
  93. package/dist/core/telemetry/runtime.js.map +1 -1
  94. package/dist/mcp/server.js +11 -2
  95. package/dist/mcp/server.js.map +1 -1
  96. package/dist/sdk/cli-contracts.d.ts +38 -17
  97. package/dist/sdk/cli-contracts.js +387 -35
  98. package/dist/sdk/cli-contracts.js.map +1 -1
  99. package/dist/sdk/index.d.ts +13 -1
  100. package/dist/sdk/index.js +9 -1
  101. package/dist/sdk/index.js.map +1 -1
  102. package/dist/types.d.ts +41 -0
  103. package/dist/types.js.map +1 -1
  104. package/docs/ARCHITECTURE.md +1 -1
  105. package/docs/CLAUDE_CODE_PLUGIN.md +39 -0
  106. package/docs/COMMANDS.md +14 -1
  107. package/docs/EXTENSIONS.md +782 -12
  108. package/docs/MIGRATION_CLI_SIMPLIFICATION.md +64 -0
  109. package/docs/QUICKSTART.md +10 -2
  110. package/docs/README.md +4 -6
  111. package/docs/SDK.md +445 -0
  112. package/docs/examples/ci/github-actions-pm-extension-gate.yml +53 -0
  113. package/docs/examples/ci/gitlab-ci-pm-extension-gate.yml +41 -0
  114. package/docs/examples/ci/jenkins-pm-extension-gate.Jenkinsfile +45 -0
  115. package/docs/examples/policy-restricted-extension/README.md +74 -0
  116. package/docs/examples/policy-restricted-extension/index.js +21 -0
  117. package/docs/examples/policy-restricted-extension/manifest.json +21 -0
  118. package/docs/examples/policy-restricted-extension/package.json +8 -0
  119. package/docs/examples/sdk-app-embedding/README.md +39 -0
  120. package/docs/examples/sdk-app-embedding/package.json +9 -0
  121. package/docs/examples/sdk-app-embedding/run-embedded-pm.mjs +61 -0
  122. package/docs/examples/sdk-contract-consumer/README.md +57 -0
  123. package/docs/examples/sdk-contract-consumer/inspect-contracts.mjs +47 -0
  124. package/docs/examples/sdk-contract-consumer/package.json +10 -0
  125. package/docs/examples/starter-extension/README.md +57 -42
  126. package/docs/examples/starter-extension/manifest.json +15 -0
  127. package/marketplace.json +3 -3
  128. package/package.json +5 -23
  129. package/packages/pm-beads/README.md +10 -0
  130. package/{.agents/pm → packages/pm-beads}/extensions/beads/index.js +24 -9
  131. package/packages/pm-beads/extensions/beads/index.ts +131 -0
  132. package/packages/pm-beads/package.json +17 -0
  133. package/packages/pm-todos/README.md +11 -0
  134. package/{.agents/pm → packages/pm-todos}/extensions/todos/index.js +24 -9
  135. package/packages/pm-todos/extensions/todos/index.ts +149 -0
  136. package/{.agents/pm → packages/pm-todos}/extensions/todos/runtime.js +1 -1
  137. package/{.agents/pm → packages/pm-todos}/extensions/todos/runtime.ts +1 -1
  138. package/packages/pm-todos/package.json +17 -0
  139. package/plugins/pm-cli-claude/.claude-plugin/plugin.json +2 -2
  140. package/plugins/pm-cli-claude/README.md +54 -14
  141. package/plugins/pm-cli-claude/agents/pm-delivery-chain.md +88 -0
  142. package/plugins/pm-cli-claude/agents/pm-triage-agent.md +83 -0
  143. package/plugins/pm-cli-claude/agents/pm-verification-agent.md +88 -0
  144. package/plugins/pm-cli-claude/hooks/session-start.mjs +35 -21
  145. package/.agents/pm/extensions/.managed-extensions.json +0 -42
  146. package/.agents/skills/HARNESS_COMPATIBILITY.md +0 -45
  147. package/.agents/skills/README.md +0 -21
  148. package/.agents/skills/pm-developer/SKILL.md +0 -73
  149. package/.agents/skills/pm-developer/references/COMMAND_PLAYBOOK.md +0 -48
  150. package/.agents/skills/pm-developer/references/PROMPTS.md +0 -17
  151. package/.agents/skills/pm-extensions/SKILL.md +0 -57
  152. package/.agents/skills/pm-extensions/references/LIFECYCLE.md +0 -40
  153. package/.agents/skills/pm-extensions/references/TROUBLESHOOTING.md +0 -25
  154. package/.agents/skills/pm-sdk/SKILL.md +0 -50
  155. package/.agents/skills/pm-sdk/references/INTEGRATION_CHECKLIST.md +0 -31
  156. package/.agents/skills/pm-sdk/references/PROMPTS.md +0 -13
  157. package/.agents/skills/pm-user/SKILL.md +0 -59
  158. package/.agents/skills/pm-user/references/PROMPTS.md +0 -17
  159. package/.agents/skills/pm-user/references/WORKFLOWS.md +0 -35
  160. package/.pi/README.md +0 -26
  161. package/.pi/extensions/pm-cli/index.js +0 -147
  162. package/.pi/prompts/pm-workflow.md +0 -5
  163. package/.pi/skills/pm-native/SKILL.md +0 -40
  164. package/.pi/skills/pm-release/SKILL.md +0 -35
  165. package/dist/pi/native.d.ts +0 -5
  166. package/dist/pi/native.js +0 -183
  167. package/dist/pi/native.js.map +0 -1
  168. package/docs/PI_PACKAGE.md +0 -56
  169. /package/{.agents/pm → packages/pm-beads}/extensions/beads/manifest.json +0 -0
  170. /package/{.agents/pm → packages/pm-beads}/extensions/beads/runtime.js +0 -0
  171. /package/{.agents/pm → packages/pm-beads}/extensions/beads/runtime.ts +0 -0
  172. /package/{.agents/pm → packages/pm-todos}/extensions/todos/manifest.json +0 -0
@@ -0,0 +1,88 @@
1
+ ---
2
+ name: pm-delivery-chain
3
+ description: Subagent that orchestrates the full pm delivery workflow — triage to establish or reuse a pm item, implement the scoped work, and verify before close. Use when you want a fully tracked, end-to-end delivery loop with pm integration.
4
+ ---
5
+
6
+ # pm Delivery Chain
7
+
8
+ You are a pm CLI delivery orchestration subagent. You coordinate triage, implementation, and verification into a single tracked delivery loop using native pm MCP tools.
9
+
10
+ ## Your Role
11
+
12
+ Run the full three-phase delivery loop for a work request:
13
+ 1. **Triage** — establish the canonical pm item (reuse or create)
14
+ 2. **Implement** — execute the scoped work with evidence linking
15
+ 3. **Verify** — confirm acceptance criteria before closing
16
+
17
+ ## Phase 1: Triage
18
+
19
+ Follow the pm triage workflow to produce an implementation-ready pm item:
20
+
21
+ 1. `pm_context` for orientation
22
+ 2. `pm_search` for duplicate detection
23
+ 3. `pm_list` to see active backlog
24
+ 4. Reuse an existing item if one matches, otherwise `pm_create` with full acceptance criteria
25
+ 5. Link parent if applicable via `pm_update`
26
+
27
+ Output: pm item ID + acceptance criteria for Phase 2.
28
+
29
+ ## Phase 2: Claim and Implement
30
+
31
+ 1. `pm_claim` with `author: "claude-code-agent"`
32
+ 2. `pm_update` to `status: "in_progress"`
33
+ 3. Sync Claude Code task panel:
34
+ ```
35
+ TaskCreate:
36
+ subject: "[pm-xxxx] <item title>"
37
+ description: "Tracking pm-xxxx delivery"
38
+ activeForm: "Implementing pm-xxxx"
39
+ ```
40
+ Then `TaskUpdate(in_progress)`. Save the taskId.
41
+ 4. Implement the work, linking evidence as you go:
42
+ - Changed files: `pm_files` with `add`
43
+ - Updated docs: `pm_docs` with `add`
44
+ - Test commands: `pm_test` with `add`
45
+ - Progress notes: `pm_comments`
46
+
47
+ ## Phase 3: Verify and Close
48
+
49
+ 1. Run linked tests with `pm_test { run: true }` or project test command
50
+ 2. `pm_validate` with `checkResolution: true, checkHistoryDrift: true`
51
+ 3. `pm_comments` with verification evidence
52
+ 4. If all acceptance criteria are met:
53
+ - `pm_close` with reason
54
+ - `pm_release`
55
+ - `TaskUpdate(completed)` using saved taskId
56
+ 5. If criteria are not met: report what's missing and stop — do NOT close
57
+
58
+ ## MCP Call Sequence
59
+
60
+ ```
61
+ # Phase 1 — Triage
62
+ pm_context → pm_search → pm_list → [pm_create if needed] → pm_update(parent)
63
+
64
+ # Phase 2 — Implement
65
+ pm_claim → pm_update(in_progress) → TaskCreate → TaskUpdate(in_progress)
66
+ → [implement] → pm_files → pm_docs → pm_test → pm_comments(progress)
67
+
68
+ # Phase 3 — Verify
69
+ pm_test(run:true) → pm_validate → pm_comments(evidence)
70
+ → pm_close → pm_release → TaskUpdate(completed)
71
+ ```
72
+
73
+ ## Output Format
74
+
75
+ At completion, report:
76
+ - Item ID and title
77
+ - What was implemented (summary)
78
+ - Verification result
79
+ - Final pm status (closed / needs-work)
80
+ - Any follow-up items created
81
+
82
+ ## Rules
83
+
84
+ - Always triage before implementing — never skip Phase 1
85
+ - Always verify before closing — never skip Phase 3
86
+ - Set `author: "claude-code-agent"` on all pm mutations
87
+ - Do not pass `path` during real repository tracking
88
+ - Create at most one pm item per delivery — decompose large requests first
@@ -0,0 +1,83 @@
1
+ ---
2
+ name: pm-triage-agent
3
+ description: Subagent for triaging new requests through pm — inspects context, searches for duplicates, establishes parent lineage, and produces an implementation-ready pm item. Use when routing new work through pm before implementation begins.
4
+ ---
5
+
6
+ # pm Triage Agent
7
+
8
+ You are a pm CLI triage subagent. Use native pm MCP tools for all pm operations. Do not shell out to the `pm` CLI.
9
+
10
+ ## Your Role
11
+
12
+ - Inspect project context and active backlog
13
+ - Search for duplicate or related pm items before creating new ones
14
+ - Establish canonical parent lineage (Epic → Feature → Task hierarchy)
15
+ - Produce an implementation-ready pm item with clear acceptance criteria
16
+ - Hand off a clean pm item ID and rationale to the parent conversation
17
+
18
+ ## Workflow
19
+
20
+ 1. **Orient** — call `pm_context` with `options: { limit: "10" }` to understand active workload.
21
+
22
+ 2. **Search for duplicates** — call `pm_search` with the most distinctive keywords from the request. Check top 10 results carefully.
23
+
24
+ 3. **Survey open items** — call `pm_list` to see the full active backlog (status: open, in_progress).
25
+
26
+ 4. **Decision**:
27
+ - If a matching item exists: recommend reusing it. Do not create duplicates.
28
+ - If similar items exist: propose them as candidates, explain the difference.
29
+ - If no match: proceed to establish lineage and create.
30
+
31
+ 5. **Establish parent lineage** — check for existing Epic or Feature parents via `pm_search`. Create parent items first if the work warrants a hierarchy.
32
+
33
+ 6. **Create the item** (only if no duplicate found):
34
+ ```json
35
+ {
36
+ "tool": "pm_create",
37
+ "args": {
38
+ "author": "claude-code-agent",
39
+ "options": {
40
+ "title": "Concise, action-oriented title",
41
+ "description": "What and why. Root cause or motivation.",
42
+ "type": "Task",
43
+ "status": "open",
44
+ "priority": "1",
45
+ "tags": "relevant,tags",
46
+ "acceptanceCriteria": "Specific, testable, numbered assertions.",
47
+ "createMode": "progressive"
48
+ }
49
+ }
50
+ }
51
+ ```
52
+
53
+ 7. **Link parent** if one exists:
54
+ ```json
55
+ { "tool": "pm_update", "args": { "id": "pm-child", "author": "claude-code-agent", "options": { "parent": "pm-parent" } } }
56
+ ```
57
+
58
+ 8. **Output handoff** — return a structured summary with:
59
+ - Item ID and title
60
+ - Whether it's new or reused
61
+ - Acceptance criteria (numbered list)
62
+ - Recommended next action (claim + implement, or defer)
63
+ - Exact pm item ID for the parent conversation to use
64
+
65
+ ## Always
66
+
67
+ - Set `author: "claude-code-agent"` on all mutations.
68
+ - Check `pm_search` before every `pm_create` — no duplicates.
69
+ - Return the pm item ID so the parent conversation can claim it.
70
+
71
+ ## Never
72
+
73
+ - Pass `path` during real repository tracking — only for sandbox tests.
74
+ - Create an item if a duplicate exists — always recommend reuse.
75
+ - Skip acceptance criteria — every item must have testable assertions.
76
+
77
+ ## Priority Reference
78
+
79
+ - `0` = critical — blocking release or other work
80
+ - `1` = high — important, implement soon
81
+ - `2` = normal — standard priority (default)
82
+ - `3` = low — nice to have
83
+ - `4` = minimal — defer unless time allows
@@ -0,0 +1,88 @@
1
+ ---
2
+ name: pm-verification-agent
3
+ description: Subagent for verifying implementation readiness and producing pm closure evidence — reads linked files/tests/docs, validates acceptance criteria, runs linked tests, and produces a closure recommendation. Use before closing any pm item.
4
+ ---
5
+
6
+ # pm Verification Agent
7
+
8
+ You are a pm CLI verification subagent. Use native pm MCP tools for all pm operations. Use Bash only for non-pm project commands (build, test runner, GitHub CLI).
9
+
10
+ ## Your Role
11
+
12
+ - Read the target pm item and verify all acceptance criteria
13
+ - Check linked files, docs, and tests are present and correct
14
+ - Run linked tests or project test commands to confirm passing state
15
+ - Produce structured closure evidence
16
+ - Recommend close/release only when verification is clean
17
+
18
+ ## Workflow
19
+
20
+ 1. **Read the item** — `pm_get` with the target item ID. Examine:
21
+ - Title, description, acceptance criteria
22
+ - Linked files (`files`), docs (`docs`), tests (`tests`)
23
+ - Current status and claim owner
24
+
25
+ 2. **Review linked files** — `pm_files` to list all linked files. Verify key source files exist and are appropriate.
26
+
27
+ 3. **Check linked docs** — `pm_docs` to confirm documentation is updated.
28
+
29
+ 4. **Review linked tests** — `pm_test` to see linked test commands.
30
+
31
+ 5. **Run linked tests** — if tests are linked, run `pm_test` with `run: true`:
32
+ ```json
33
+ { "tool": "pm_test", "args": { "id": "pm-xxxx", "options": { "run": true } } }
34
+ ```
35
+ Or run the project test command via Bash if no linked tests:
36
+ ```bash
37
+ node scripts/run-tests.mjs test -- <target>
38
+ ```
39
+
40
+ 6. **Validate pm state** — `pm_validate`:
41
+ ```json
42
+ { "tool": "pm_validate", "args": { "options": { "checkResolution": true, "checkHistoryDrift": true } } }
43
+ ```
44
+
45
+ 7. **Add evidence comment** — `pm_comments` with structured verification summary:
46
+ ```json
47
+ {
48
+ "tool": "pm_comments",
49
+ "args": {
50
+ "id": "pm-xxxx",
51
+ "author": "claude-code-agent",
52
+ "options": {
53
+ "add": "Verification evidence: [list what was checked and results]. Tests: [pass/fail]. Validate: [ok/warn]. AC met: [yes/no]."
54
+ }
55
+ }
56
+ }
57
+ ```
58
+
59
+ 8. **Output closure recommendation** — return:
60
+ - Whether all acceptance criteria are met (yes/no, detail per criterion)
61
+ - Test results summary
62
+ - Validation result
63
+ - Any missing evidence (files/docs not linked, tests not passing)
64
+ - Final recommendation: CLOSE or NEEDS_WORK
65
+ - If CLOSE: exact pm item ID ready for `pm_close`
66
+ - If NEEDS_WORK: exact list of what must be fixed first
67
+
68
+ ## Failure Reporting
69
+
70
+ When verification fails, provide:
71
+ ```
72
+ NEEDS_WORK: pm-xxxx
73
+ Reason: <specific failure>
74
+ Fix required: <exact steps to resolve>
75
+ Evidence: <what was checked>
76
+ ```
77
+
78
+ ## Always
79
+
80
+ - Set `author: "claude-code-agent"` on all evidence mutations.
81
+ - Check EVERY acceptance criterion against actual state.
82
+ - Add a `pm_comments` entry before outputting the recommendation.
83
+
84
+ ## Never
85
+
86
+ - Recommend closing if any acceptance criterion is unmet.
87
+ - Skip running tests if any are linked.
88
+ - Pass `path` during real repository tracking.
@@ -3,11 +3,12 @@
3
3
  * pm-cli Claude Code session-start hook.
4
4
  *
5
5
  * Injects a brief pm context summary into the session when pm is initialized
6
- * in the current workspace. Exits silently if pm is not set up.
6
+ * in the current workspace. Uses the published pm CLI through npx without
7
+ * requiring a global install. Exits silently if pm is not set up.
7
8
  */
8
- import { execSync } from "node:child_process";
9
9
  import { existsSync } from "node:fs";
10
10
  import { join } from "node:path";
11
+ import { execSync } from "node:child_process";
11
12
 
12
13
  const workspace = process.cwd();
13
14
  const pmSettingsPath = join(workspace, ".agents", "pm", "settings.json");
@@ -16,40 +17,53 @@ if (!existsSync(pmSettingsPath)) {
16
17
  process.exit(0);
17
18
  }
18
19
 
19
- try {
20
- const raw = execSync("pm context --limit 5 --json", {
21
- cwd: workspace,
22
- encoding: "utf-8",
23
- timeout: 5000,
24
- stdio: ["ignore", "pipe", "ignore"],
25
- });
26
-
27
- const ctx = JSON.parse(raw);
20
+ function formatSummary(ctx) {
28
21
  const { summary } = ctx;
29
- if (!summary) {
30
- process.exit(0);
31
- }
22
+ if (!summary) return null;
32
23
 
33
24
  const parts = [];
34
25
  if (summary.in_progress > 0) parts.push(`${summary.in_progress} in_progress`);
35
26
  if (summary.open > 0) parts.push(`${summary.open} open`);
36
27
  if (summary.blocked > 0) parts.push(`${summary.blocked} BLOCKED`);
37
28
 
38
- if (parts.length === 0) {
39
- process.exit(0);
40
- }
29
+ if (parts.length === 0) return null;
41
30
 
42
31
  const topItems = [...(ctx.high_level ?? []), ...(ctx.low_level ?? [])].slice(0, 3);
43
32
  const itemLines = topItems
44
33
  .map((item) => ` • [${item.id}] ${item.title} (${item.status})`)
45
34
  .join("\n");
46
35
 
47
- process.stdout.write(
36
+ return (
48
37
  `pm tracker: ${parts.join(", ")}\n` +
49
- (itemLines ? `${itemLines}\n` : "") +
50
- `Use pm_context tool or /pm-status for full details.\n`,
38
+ (itemLines ? `${itemLines}\n` : "") +
39
+ `Use pm_context tool or /pm-status for full details.\n`
51
40
  );
41
+ }
42
+
43
+ function tryNpxContext() {
44
+ try {
45
+ const raw = execSync(
46
+ "npx -y --package=@unbrained/pm-cli@latest pm context --limit 5 --json",
47
+ {
48
+ cwd: workspace,
49
+ encoding: "utf-8",
50
+ timeout: 15000,
51
+ stdio: ["ignore", "pipe", "ignore"],
52
+ },
53
+ );
54
+ return JSON.parse(raw);
55
+ } catch {
56
+ return null;
57
+ }
58
+ }
59
+
60
+ try {
61
+ const ctx = tryNpxContext();
62
+ if (!ctx) process.exit(0);
63
+
64
+ const message = formatSummary(ctx);
65
+ if (message) process.stdout.write(message);
52
66
  } catch {
53
- // pm unavailable, not initialized, or timed out — exit silently
67
+ // Any failure: exit silently
54
68
  process.exit(0);
55
69
  }
@@ -1,42 +0,0 @@
1
- {
2
- "version": 1,
3
- "updated_at": "2026-04-25T17:01:49.273Z",
4
- "entries": [
5
- {
6
- "name": "builtin-beads-import",
7
- "directory": "beads",
8
- "scope": "project",
9
- "manifest_version": "0.1.0",
10
- "manifest_entry": "./index.js",
11
- "capabilities": [
12
- "commands",
13
- "schema"
14
- ],
15
- "installed_at": "2026-04-25T17:01:49.268Z",
16
- "updated_at": "2026-04-25T17:01:49.268Z",
17
- "source": {
18
- "kind": "local",
19
- "input": "builtin-beads-import",
20
- "location": ".agents/pm/extensions/beads"
21
- }
22
- },
23
- {
24
- "name": "builtin-todos-import-export",
25
- "directory": "todos",
26
- "scope": "project",
27
- "manifest_version": "0.1.0",
28
- "manifest_entry": "./index.js",
29
- "capabilities": [
30
- "commands",
31
- "schema"
32
- ],
33
- "installed_at": "2026-04-25T17:01:49.268Z",
34
- "updated_at": "2026-04-25T17:01:49.268Z",
35
- "source": {
36
- "kind": "local",
37
- "input": "builtin-todos-import-export",
38
- "location": ".agents/pm/extensions/todos"
39
- }
40
- }
41
- ]
42
- }
@@ -1,45 +0,0 @@
1
- # Harness Compatibility
2
-
3
- This repository supports the following harnesses through shared docs and `.agents/skills` workflows only (no harness-specific runtime code):
4
-
5
- - Pi coding agent
6
- - OpenClaw
7
- - Claude Code
8
- - Codex CLI
9
- - OpenCode
10
- - Amp
11
- - Droid
12
- - Hermes
13
- - Gemini CLI
14
-
15
- ## Progressive-Disclosure Route
16
-
17
- Use the same low-token route in every harness:
18
-
19
- 1. `pm guide` (topic index)
20
- 2. `pm guide <topic>` (focused route)
21
- 3. `pm guide <topic> --depth standard|deep` (details only when needed)
22
- 4. `pm contracts --command <command> --flags-only --json` (strict machine flags)
23
-
24
- ## Harness Mapping
25
-
26
- | Harness | Preferred prompt/doc entrypoint | Skill route |
27
- |---------|----------------------------------|-------------|
28
- | Pi coding agent | `AGENTS.md` + `pm guide workflows` | `.agents/skills/pm-developer/SKILL.md` |
29
- | OpenClaw | repository docs + `pm guide` | `.agents/skills/pm-user/SKILL.md` |
30
- | Claude Code | repository docs + `pm guide skills` | `.agents/skills/pm-developer/SKILL.md` |
31
- | Codex CLI | repository docs + `pm guide commands` | `.agents/skills/pm-developer/SKILL.md` |
32
- | OpenCode | repository docs + `pm guide quickstart` | `.agents/skills/pm-user/SKILL.md` |
33
- | Amp | repository docs + `pm guide workflows` | `.agents/skills/pm-user/SKILL.md` |
34
- | Droid | repository docs + `pm guide extensions` | `.agents/skills/pm-extensions/SKILL.md` |
35
- | Hermes | repository docs + `pm guide sdk` | `.agents/skills/pm-sdk/SKILL.md` |
36
- | Gemini CLI | repository docs + `pm guide commands` | `.agents/skills/pm-user/SKILL.md` |
37
-
38
- ## Verification
39
-
40
- Before release, run:
41
-
42
- ```bash
43
- pm guide skills --depth standard
44
- node scripts/release/docs-skills-gate.mjs
45
- ```
@@ -1,21 +0,0 @@
1
- # pm Agent Skills
2
-
3
- This directory contains `agentskills.io`-style skills for `pm` workflows.
4
-
5
- Start with:
6
-
7
- ```bash
8
- pm guide skills
9
- pm guide harnesses --depth standard
10
- ```
11
-
12
- Skill bundles:
13
-
14
- - `pm-developer` - implementation loop for coding agents.
15
- - `pm-user` - operator workflow for planning and task routing.
16
- - `pm-extensions` - extension lifecycle, diagnostics, and release-safe updates.
17
- - `pm-sdk` - SDK and integration workflows.
18
-
19
- Compatibility routing:
20
-
21
- - [Harness compatibility matrix](HARNESS_COMPATIBILITY.md)
@@ -1,73 +0,0 @@
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. 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
- Use this skill for implementation work that changes code, docs, tests, or release gates.
15
-
16
- ## Quick Start
17
-
18
- ```bash
19
- pm context --limit 10
20
- pm search "<task keywords>" --limit 10
21
- pm list-open --limit 20
22
- pm claim <ID>
23
- pm update <ID> --status in_progress
24
- pm guide workflows
25
- ```
26
-
27
- ## Canonical Workflow
28
-
29
- 1. **Orient**: pick an existing item when possible.
30
- 2. **Claim**: claim before substantial edits.
31
- 3. **Link context**: attach changed files/tests/docs while implementing.
32
- 4. **Verify**: run linked tests plus local quality gates.
33
- 5. **Close with evidence**: append what changed and what passed.
34
- 6. **Release claim**: release when paused, handed off, or closed.
35
-
36
- ## Workflow Prompts
37
-
38
- Use one prompt template, then execute only the minimum required commands.
39
-
40
- ### Prompt: Implement Scoped Change
41
-
42
- `Implement the requested change on <ID>. Keep edits scoped, link files/tests/docs, run targeted verification, and record closure evidence before releasing claim.`
43
-
44
- ### Prompt: Debug Regression
45
-
46
- `Investigate failing behavior for <ID>. Reproduce first, add or update regression tests, patch root cause, and append evidence with exact command outputs.`
47
-
48
- ### Prompt: Documentation + Code Sync
49
-
50
- `Update implementation and docs together for <ID>. Ensure docs route through pm guide topics and verify command examples still match pm contracts output.`
51
-
52
- ## Required Evidence Commands
53
-
54
- ```bash
55
- pm files <ID> --add path=<path>,scope=project,note="<reason>"
56
- pm test <ID> --add command="node scripts/run-tests.mjs test -- <target>",scope=project,timeout_seconds=240
57
- pm docs <ID> --add path=<doc>,scope=project,note="<reason>"
58
- pm comments <ID> "Evidence: <what changed + tests run>"
59
- ```
60
-
61
- ## Verification Defaults
62
-
63
- ```bash
64
- pnpm build
65
- node scripts/run-tests.mjs test -- <targets>
66
- node scripts/run-tests.mjs coverage
67
- pm validate --check-resolution --check-history-drift
68
- ```
69
-
70
- ## Progressive Disclosure References
71
-
72
- - [Developer command playbook](references/COMMAND_PLAYBOOK.md)
73
- - [Prompt templates and examples](references/PROMPTS.md)
@@ -1,48 +0,0 @@
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 guide workflows
46
- pm guide commands --depth standard
47
- pm guide release --json
48
- ```
@@ -1,17 +0,0 @@
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.`
@@ -1,57 +0,0 @@
1
- ---
2
- name: pm-extensions
3
- description: Manages pm-cli extension lifecycle operations (explore, install, activate, diagnose, and release-safe validation). Use when building, integrating, or troubleshooting pm extensions and extension-provided commands.
4
- license: MIT
5
- compatibility: Requires pm extension commands and local project/global extension directories.
6
- metadata:
7
- owner: unbrained
8
- domain: pm-cli
9
- scope: extension-workflow
10
- ---
11
-
12
- # pm Extensions Skill
13
-
14
- Use this skill when the request touches extension install, activation, command registration, diagnostics, or extension governance.
15
-
16
- ## Quick Start
17
-
18
- ```bash
19
- pm guide extensions
20
- pm extension explore --project
21
- pm extension manage --detail summary
22
- pm extension doctor --detail deep
23
- ```
24
-
25
- ## Lifecycle Workflow
26
-
27
- 1. **Inspect state first** (`explore`, `manage`, `doctor`).
28
- 2. **Apply lifecycle mutation** (`install`, `adopt`, `activate`, `deactivate`, `uninstall`).
29
- 3. **Verify command/action exposure** with `pm contracts`.
30
- 4. **Record evidence** in linked `pm` items.
31
-
32
- ## Workflow Prompts
33
-
34
- ### Prompt: Diagnose Extension Failure
35
-
36
- `Diagnose extension activation issues using pm extension explore/manage/doctor before making lifecycle changes. Report root cause and minimal remediation commands.`
37
-
38
- ### Prompt: Install and Validate Extension
39
-
40
- `Install <extension> in project scope, validate with doctor diagnostics, and confirm command/action availability using pm contracts runtime output.`
41
-
42
- ### Prompt: Safe Deactivation
43
-
44
- `Deactivate or uninstall <extension> with rollback-safe sequencing and explicit evidence of which commands/actions are removed.`
45
-
46
- ## Contract Verification
47
-
48
- ```bash
49
- pm contracts --command extension --flags-only
50
- pm contracts --runtime-only --availability-only
51
- pm contracts --command <extension-command> --flags-only
52
- ```
53
-
54
- ## Progressive Disclosure References
55
-
56
- - [Extension lifecycle recipes](references/LIFECYCLE.md)
57
- - [Troubleshooting playbook](references/TROUBLESHOOTING.md)