@unbrained/pm-cli 2026.5.6 → 2026.5.11

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 (268) hide show
  1. package/.agents/pm/extensions/.managed-extensions.json +2 -2
  2. package/.agents/pm/extensions/beads/runtime.js +4 -4
  3. package/.agents/pm/extensions/beads/runtime.ts +5 -5
  4. package/.agents/pm/extensions/todos/runtime.js +7 -7
  5. package/.agents/pm/extensions/todos/runtime.ts +10 -10
  6. package/.agents/skills/HARNESS_COMPATIBILITY.md +45 -0
  7. package/.agents/skills/README.md +21 -0
  8. package/.agents/skills/pm-developer/SKILL.md +73 -0
  9. package/.agents/skills/pm-developer/references/COMMAND_PLAYBOOK.md +48 -0
  10. package/.agents/skills/pm-developer/references/PROMPTS.md +17 -0
  11. package/.agents/skills/pm-extensions/SKILL.md +57 -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 +50 -0
  15. package/.agents/skills/pm-sdk/references/INTEGRATION_CHECKLIST.md +31 -0
  16. package/.agents/skills/pm-sdk/references/PROMPTS.md +13 -0
  17. package/.agents/skills/pm-user/SKILL.md +59 -0
  18. package/.agents/skills/pm-user/references/PROMPTS.md +17 -0
  19. package/.agents/skills/pm-user/references/WORKFLOWS.md +35 -0
  20. package/.claude-plugin/marketplace.json +38 -0
  21. package/.pi/README.md +35 -0
  22. package/.pi/agents/pm-triage-agent.md +19 -0
  23. package/.pi/agents/pm-verification-agent.md +21 -0
  24. package/.pi/chains/pm-native-delivery.chain.md +11 -0
  25. package/.pi/extensions/pm-cli/index.js +387 -0
  26. package/.pi/prompts/pm-workflow.md +5 -0
  27. package/.pi/skills/pm-native/SKILL.md +44 -0
  28. package/.pi/skills/pm-release/SKILL.md +35 -0
  29. package/AGENTS.md +1 -1
  30. package/CHANGELOG.md +13 -0
  31. package/PRD.md +16 -16
  32. package/README.md +30 -4
  33. package/dist/cli/argv-utils.d.ts +5 -0
  34. package/dist/cli/argv-utils.js +34 -0
  35. package/dist/cli/argv-utils.js.map +1 -0
  36. package/dist/cli/bootstrap-args.d.ts +15 -0
  37. package/dist/cli/bootstrap-args.js +211 -0
  38. package/dist/cli/bootstrap-args.js.map +1 -1
  39. package/dist/cli/commander-usage.js +109 -3
  40. package/dist/cli/commander-usage.js.map +1 -1
  41. package/dist/cli/commands/claim.js +6 -6
  42. package/dist/cli/commands/claim.js.map +1 -1
  43. package/dist/cli/commands/close.js +9 -9
  44. package/dist/cli/commands/close.js.map +1 -1
  45. package/dist/cli/commands/comments.d.ts +2 -0
  46. package/dist/cli/commands/comments.js +57 -8
  47. package/dist/cli/commands/comments.js.map +1 -1
  48. package/dist/cli/commands/completion.js +40 -7
  49. package/dist/cli/commands/completion.js.map +1 -1
  50. package/dist/cli/commands/config.js +6 -3
  51. package/dist/cli/commands/config.js.map +1 -1
  52. package/dist/cli/commands/contracts.d.ts +19 -0
  53. package/dist/cli/commands/contracts.js +36 -1
  54. package/dist/cli/commands/contracts.js.map +1 -1
  55. package/dist/cli/commands/create.d.ts +2 -2
  56. package/dist/cli/commands/create.js +116 -55
  57. package/dist/cli/commands/create.js.map +1 -1
  58. package/dist/cli/commands/docs.js +13 -6
  59. package/dist/cli/commands/docs.js.map +1 -1
  60. package/dist/cli/commands/extension.d.ts +3 -1
  61. package/dist/cli/commands/extension.js +174 -2
  62. package/dist/cli/commands/extension.js.map +1 -1
  63. package/dist/cli/commands/files.js +19 -12
  64. package/dist/cli/commands/files.js.map +1 -1
  65. package/dist/cli/commands/get.js +5 -5
  66. package/dist/cli/commands/get.js.map +1 -1
  67. package/dist/cli/commands/guide.d.ts +55 -0
  68. package/dist/cli/commands/guide.js +260 -0
  69. package/dist/cli/commands/guide.js.map +1 -0
  70. package/dist/cli/commands/health.js +1 -1
  71. package/dist/cli/commands/health.js.map +1 -1
  72. package/dist/cli/commands/history.js +30 -10
  73. package/dist/cli/commands/history.js.map +1 -1
  74. package/dist/cli/commands/index.d.ts +1 -0
  75. package/dist/cli/commands/index.js +1 -0
  76. package/dist/cli/commands/index.js.map +1 -1
  77. package/dist/cli/commands/init.d.ts +2 -0
  78. package/dist/cli/commands/init.js +21 -1
  79. package/dist/cli/commands/init.js.map +1 -1
  80. package/dist/cli/commands/learnings.js +3 -3
  81. package/dist/cli/commands/learnings.js.map +1 -1
  82. package/dist/cli/commands/metadata-normalizers.d.ts +4 -0
  83. package/dist/cli/commands/metadata-normalizers.js +37 -0
  84. package/dist/cli/commands/metadata-normalizers.js.map +1 -0
  85. package/dist/cli/commands/notes.js +3 -3
  86. package/dist/cli/commands/notes.js.map +1 -1
  87. package/dist/cli/commands/reindex.js +180 -156
  88. package/dist/cli/commands/reindex.js.map +1 -1
  89. package/dist/cli/commands/restore.d.ts +2 -2
  90. package/dist/cli/commands/restore.js +44 -24
  91. package/dist/cli/commands/restore.js.map +1 -1
  92. package/dist/cli/commands/search.d.ts +2 -0
  93. package/dist/cli/commands/search.js +45 -26
  94. package/dist/cli/commands/search.js.map +1 -1
  95. package/dist/cli/commands/test-all.d.ts +2 -0
  96. package/dist/cli/commands/test-all.js +2 -0
  97. package/dist/cli/commands/test-all.js.map +1 -1
  98. package/dist/cli/commands/test.d.ts +1 -0
  99. package/dist/cli/commands/test.js +13 -5
  100. package/dist/cli/commands/test.js.map +1 -1
  101. package/dist/cli/commands/update.js +188 -157
  102. package/dist/cli/commands/update.js.map +1 -1
  103. package/dist/cli/commands/validate.js +1 -1
  104. package/dist/cli/commands/validate.js.map +1 -1
  105. package/dist/cli/error-guidance.d.ts +9 -1
  106. package/dist/cli/error-guidance.js +147 -6
  107. package/dist/cli/error-guidance.js.map +1 -1
  108. package/dist/cli/guide-topics.d.ts +25 -0
  109. package/dist/cli/guide-topics.js +283 -0
  110. package/dist/cli/guide-topics.js.map +1 -0
  111. package/dist/cli/help-content.js +25 -1
  112. package/dist/cli/help-content.js.map +1 -1
  113. package/dist/cli/help-json-payload.js +11 -1
  114. package/dist/cli/help-json-payload.js.map +1 -1
  115. package/dist/cli/main.js +69 -6
  116. package/dist/cli/main.js.map +1 -1
  117. package/dist/cli/register-list-query.js +38 -1
  118. package/dist/cli/register-list-query.js.map +1 -1
  119. package/dist/cli/register-mutation.js +17 -4
  120. package/dist/cli/register-mutation.js.map +1 -1
  121. package/dist/cli/register-setup.js +15 -1
  122. package/dist/cli/register-setup.js.map +1 -1
  123. package/dist/cli/telemetry-flush.d.ts +2 -0
  124. package/dist/cli/telemetry-flush.js +4 -0
  125. package/dist/cli/telemetry-flush.js.map +1 -0
  126. package/dist/cli.js +1 -2
  127. package/dist/cli.js.map +1 -1
  128. package/dist/core/extensions/extension-types.d.ts +72 -0
  129. package/dist/core/extensions/extension-types.js +24 -0
  130. package/dist/core/extensions/extension-types.js.map +1 -1
  131. package/dist/core/extensions/loader.d.ts +1 -0
  132. package/dist/core/extensions/loader.js +766 -7
  133. package/dist/core/extensions/loader.js.map +1 -1
  134. package/dist/core/history/history.js +32 -11
  135. package/dist/core/history/history.js.map +1 -1
  136. package/dist/core/item/item-format.d.ts +2 -2
  137. package/dist/core/item/item-format.js +16 -16
  138. package/dist/core/item/item-format.js.map +1 -1
  139. package/dist/core/lock/lock.js +2 -0
  140. package/dist/core/lock/lock.js.map +1 -1
  141. package/dist/core/schema/runtime-field-filters.js +1 -1
  142. package/dist/core/schema/runtime-field-filters.js.map +1 -1
  143. package/dist/core/schema/runtime-field-values.js +2 -2
  144. package/dist/core/schema/runtime-field-values.js.map +1 -1
  145. package/dist/core/schema/runtime-schema.d.ts +1 -1
  146. package/dist/core/schema/runtime-schema.js +3 -3
  147. package/dist/core/schema/runtime-schema.js.map +1 -1
  148. package/dist/core/search/cache.js +7 -21
  149. package/dist/core/search/cache.js.map +1 -1
  150. package/dist/core/search/corpus.d.ts +13 -0
  151. package/dist/core/search/corpus.js +74 -0
  152. package/dist/core/search/corpus.js.map +1 -0
  153. package/dist/core/search/embedding-batches.js +90 -30
  154. package/dist/core/search/embedding-batches.js.map +1 -1
  155. package/dist/core/sentry/instrument.d.ts +18 -1
  156. package/dist/core/sentry/instrument.js +128 -12
  157. package/dist/core/sentry/instrument.js.map +1 -1
  158. package/dist/core/shared/constants.d.ts +1 -1
  159. package/dist/core/shared/constants.js +21 -1
  160. package/dist/core/shared/constants.js.map +1 -1
  161. package/dist/core/shared/errors.d.ts +8 -0
  162. package/dist/core/shared/errors.js.map +1 -1
  163. package/dist/core/shared/levenshtein.d.ts +1 -0
  164. package/dist/core/shared/levenshtein.js +37 -0
  165. package/dist/core/shared/levenshtein.js.map +1 -0
  166. package/dist/core/store/front-matter-cache.d.ts +1 -1
  167. package/dist/core/store/front-matter-cache.js +13 -13
  168. package/dist/core/store/front-matter-cache.js.map +1 -1
  169. package/dist/core/store/item-format-migration.js +5 -2
  170. package/dist/core/store/item-format-migration.js.map +1 -1
  171. package/dist/core/store/item-store.js +16 -15
  172. package/dist/core/store/item-store.js.map +1 -1
  173. package/dist/core/store/paths.js +35 -2
  174. package/dist/core/store/paths.js.map +1 -1
  175. package/dist/core/store/settings.js +216 -2
  176. package/dist/core/store/settings.js.map +1 -1
  177. package/dist/core/telemetry/runtime.d.ts +1 -0
  178. package/dist/core/telemetry/runtime.js +102 -3
  179. package/dist/core/telemetry/runtime.js.map +1 -1
  180. package/dist/core/test/item-test-run-tracking.js +2 -2
  181. package/dist/core/test/item-test-run-tracking.js.map +1 -1
  182. package/dist/mcp/server.d.ts +2 -0
  183. package/dist/mcp/server.js +407 -0
  184. package/dist/mcp/server.js.map +1 -0
  185. package/dist/pi/native.d.ts +5 -0
  186. package/dist/pi/native.js +236 -0
  187. package/dist/pi/native.js.map +1 -0
  188. package/dist/sdk/cli-contracts.d.ts +24 -2
  189. package/dist/sdk/cli-contracts.js +317 -2
  190. package/dist/sdk/cli-contracts.js.map +1 -1
  191. package/dist/sdk/index.d.ts +12 -1
  192. package/dist/sdk/index.js +8 -1
  193. package/dist/sdk/index.js.map +1 -1
  194. package/dist/types.d.ts +51 -2
  195. package/dist/types.js.map +1 -1
  196. package/docs/AGENT_GUIDE.md +15 -0
  197. package/docs/ARCHITECTURE.md +2 -2
  198. package/docs/CLAUDE_CODE_PLUGIN.md +225 -0
  199. package/docs/CODEX_PLUGIN.md +33 -0
  200. package/docs/COMMANDS.md +6 -2
  201. package/docs/CONFIGURATION.md +2 -8
  202. package/docs/EXTENSIONS.md +688 -0
  203. package/docs/MIGRATION_CLI_SIMPLIFICATION.md +64 -0
  204. package/docs/PI_PACKAGE.md +141 -0
  205. package/docs/QUICKSTART.md +1 -0
  206. package/docs/README.md +30 -1
  207. package/docs/RELEASING.md +4 -2
  208. package/docs/SDK.md +444 -2
  209. package/docs/examples/ci/github-actions-pm-extension-gate.yml +53 -0
  210. package/docs/examples/ci/gitlab-ci-pm-extension-gate.yml +41 -0
  211. package/docs/examples/ci/jenkins-pm-extension-gate.Jenkinsfile +45 -0
  212. package/docs/examples/policy-restricted-extension/README.md +74 -0
  213. package/docs/examples/policy-restricted-extension/index.js +21 -0
  214. package/docs/examples/policy-restricted-extension/manifest.json +21 -0
  215. package/docs/examples/policy-restricted-extension/package.json +8 -0
  216. package/docs/examples/sdk-app-embedding/README.md +39 -0
  217. package/docs/examples/sdk-app-embedding/package.json +9 -0
  218. package/docs/examples/sdk-app-embedding/run-embedded-pm.mjs +61 -0
  219. package/docs/examples/sdk-contract-consumer/README.md +57 -0
  220. package/docs/examples/sdk-contract-consumer/inspect-contracts.mjs +47 -0
  221. package/docs/examples/sdk-contract-consumer/package.json +10 -0
  222. package/docs/examples/starter-extension/README.md +57 -42
  223. package/docs/examples/starter-extension/manifest.json +15 -0
  224. package/marketplace.json +34 -0
  225. package/package.json +38 -4
  226. package/plugins/pm-cli-claude/.claude-plugin/plugin.json +23 -0
  227. package/plugins/pm-cli-claude/.mcp.json +12 -0
  228. package/plugins/pm-cli-claude/README.md +225 -0
  229. package/plugins/pm-cli-claude/agents/pm-coordinator.md +48 -0
  230. package/plugins/pm-cli-claude/agents/pm-delivery-chain.md +88 -0
  231. package/plugins/pm-cli-claude/agents/pm-triage-agent.md +83 -0
  232. package/plugins/pm-cli-claude/agents/pm-verification-agent.md +88 -0
  233. package/plugins/pm-cli-claude/commands/pm-audit.md +39 -0
  234. package/plugins/pm-cli-claude/commands/pm-calendar.md +41 -0
  235. package/plugins/pm-cli-claude/commands/pm-close-task.md +20 -0
  236. package/plugins/pm-cli-claude/commands/pm-developer.md +38 -0
  237. package/plugins/pm-cli-claude/commands/pm-init.md +44 -0
  238. package/plugins/pm-cli-claude/commands/pm-list.md +39 -0
  239. package/plugins/pm-cli-claude/commands/pm-new.md +36 -0
  240. package/plugins/pm-cli-claude/commands/pm-planner.md +51 -0
  241. package/plugins/pm-cli-claude/commands/pm-release.md +41 -0
  242. package/plugins/pm-cli-claude/commands/pm-search.md +21 -0
  243. package/plugins/pm-cli-claude/commands/pm-start-task.md +27 -0
  244. package/plugins/pm-cli-claude/commands/pm-status.md +15 -0
  245. package/plugins/pm-cli-claude/commands/pm-triage.md +35 -0
  246. package/plugins/pm-cli-claude/commands/pm-workflow.md +49 -0
  247. package/plugins/pm-cli-claude/hooks/hooks.json +17 -0
  248. package/plugins/pm-cli-claude/hooks/session-start.mjs +120 -0
  249. package/plugins/pm-cli-claude/scripts/pm-mcp-server.mjs +60 -0
  250. package/plugins/pm-cli-claude/skills/pm-audit/SKILL.md +88 -0
  251. package/plugins/pm-cli-claude/skills/pm-developer/SKILL.md +116 -0
  252. package/plugins/pm-cli-claude/skills/pm-planner/SKILL.md +118 -0
  253. package/plugins/pm-cli-claude/skills/pm-release/SKILL.md +83 -0
  254. package/plugins/pm-cli-claude/skills/pm-workflow/SKILL.md +148 -0
  255. package/plugins/pm-cli-codex/.codex-plugin/plugin.json +45 -0
  256. package/plugins/pm-cli-codex/.mcp.json +14 -0
  257. package/plugins/pm-cli-codex/README.md +30 -0
  258. package/plugins/pm-cli-codex/assets/pm-cli-small.svg +4 -0
  259. package/plugins/pm-cli-codex/commands/pm-audit.md +8 -0
  260. package/plugins/pm-cli-codex/commands/pm-close-task.md +9 -0
  261. package/plugins/pm-cli-codex/commands/pm-start-task.md +9 -0
  262. package/plugins/pm-cli-codex/scripts/pm-mcp-server.mjs +54 -0
  263. package/plugins/pm-cli-codex/skills/pm-auditor/SKILL.md +21 -0
  264. package/plugins/pm-cli-codex/skills/pm-auditor/agents/openai.yaml +6 -0
  265. package/plugins/pm-cli-codex/skills/pm-native/SKILL.md +57 -0
  266. package/plugins/pm-cli-codex/skills/pm-native/agents/openai.yaml +6 -0
  267. package/plugins/pm-cli-codex/skills/pm-release/SKILL.md +19 -0
  268. package/plugins/pm-cli-codex/skills/pm-release/agents/openai.yaml +6 -0
@@ -17,7 +17,7 @@
17
17
  "source": {
18
18
  "kind": "local",
19
19
  "input": "builtin-beads-import",
20
- "location": "/home/steve/GITHUB_RELEASE/pm-cli/.agents/pm/extensions/beads"
20
+ "location": ".agents/pm/extensions/beads"
21
21
  }
22
22
  },
23
23
  {
@@ -35,7 +35,7 @@
35
35
  "source": {
36
36
  "kind": "local",
37
37
  "input": "builtin-todos-import-export",
38
- "location": "/home/steve/GITHUB_RELEASE/pm-cli/.agents/pm/extensions/todos"
38
+ "location": ".agents/pm/extensions/todos"
39
39
  }
40
40
  }
41
41
  ]
@@ -361,7 +361,7 @@ function ensureInitHasRun(pmRoot) {
361
361
  }
362
362
  function emptyDocument() {
363
363
  return {
364
- front_matter: {},
364
+ metadata: {},
365
365
  body: "",
366
366
  };
367
367
  }
@@ -520,7 +520,7 @@ export async function runBeadsImport(options, global) {
520
520
  finalBody += (finalBody ? "\n\n" : "") + "## External Reference\n" + externalRef;
521
521
  }
522
522
  const afterDocument = canonicalDocument({
523
- front_matter: frontMatter,
523
+ metadata: frontMatter,
524
524
  body: finalBody,
525
525
  });
526
526
  const existing = await locateItem(pmRoot, id, settings.id_prefix, settings.item_format, typeRegistry.type_to_folder);
@@ -529,12 +529,12 @@ export async function runBeadsImport(options, global) {
529
529
  skipped += 1;
530
530
  continue;
531
531
  }
532
- const itemPath = getItemPath(pmRoot, type, id, settings.item_format, typeRegistry.type_to_folder);
532
+ const itemPath = getItemPath(pmRoot, type, id, "toon", typeRegistry.type_to_folder);
533
533
  const historyPath = getHistoryPath(pmRoot, id);
534
534
  try {
535
535
  const releaseLock = await acquireLock(pmRoot, id, settings.locks.ttl_seconds, author);
536
536
  try {
537
- await writeFileAtomic(itemPath, serializeItemDocument(afterDocument, { format: settings.item_format }));
537
+ await writeFileAtomic(itemPath, serializeItemDocument(afterDocument, { format: "toon" }));
538
538
  try {
539
539
  const entry = createHistoryEntry({
540
540
  nowIso: nowIso(),
@@ -16,7 +16,7 @@ import { isTimestampLiteral, nowIso } from "../../../../src/core/shared/time.js"
16
16
  import { locateItem } from "../../../../src/core/store/item-store.js";
17
17
  import { getHistoryPath, getItemPath, getSettingsPath, resolvePmRoot } from "../../../../src/core/store/paths.js";
18
18
  import { readSettings } from "../../../../src/core/store/settings.js";
19
- import type { Dependency, ItemDocument, ItemFrontMatter, ItemStatus, ItemType, LogNote, LinkedFile, LinkedTest, LinkedDoc } from "../../../../src/types/index.js";
19
+ import type { Dependency, ItemDocument, ItemMetadata, ItemStatus, ItemType, LogNote, LinkedFile, LinkedTest, LinkedDoc } from "../../../../src/types/index.js";
20
20
  import { DEPENDENCY_KIND_VALUES } from "../../../../src/types/index.js";
21
21
 
22
22
  const PRIMARY_AUTO_DISCOVERY_FILES = [
@@ -445,7 +445,7 @@ function ensureInitHasRun(pmRoot: string): Promise<void> {
445
445
 
446
446
  function emptyDocument(): ItemDocument {
447
447
  return {
448
- front_matter: {} as ItemFrontMatter,
448
+ metadata: {} as ItemMetadata,
449
449
  body: "",
450
450
  };
451
451
  }
@@ -633,7 +633,7 @@ export async function runBeadsImport(options: BeadsImportOptions, global: Global
633
633
  finalBody += (finalBody ? "\n\n" : "") + "## External Reference\n" + externalRef;
634
634
  }
635
635
  const afterDocument = canonicalDocument({
636
- front_matter: frontMatter,
636
+ metadata: frontMatter,
637
637
  body: finalBody,
638
638
  });
639
639
  const existing = await locateItem(pmRoot, id, settings.id_prefix, settings.item_format, typeRegistry.type_to_folder);
@@ -642,13 +642,13 @@ export async function runBeadsImport(options: BeadsImportOptions, global: Global
642
642
  skipped += 1;
643
643
  continue;
644
644
  }
645
- const itemPath = getItemPath(pmRoot, type, id, settings.item_format, typeRegistry.type_to_folder);
645
+ const itemPath = getItemPath(pmRoot, type, id, "toon", typeRegistry.type_to_folder);
646
646
 
647
647
  const historyPath = getHistoryPath(pmRoot, id);
648
648
  try {
649
649
  const releaseLock = await acquireLock(pmRoot, id, settings.locks.ttl_seconds, author);
650
650
  try {
651
- await writeFileAtomic(itemPath, serializeItemDocument(afterDocument, { format: settings.item_format }));
651
+ await writeFileAtomic(itemPath, serializeItemDocument(afterDocument, { format: "toon" }));
652
652
  try {
653
653
  const entry = createHistoryEntry({
654
654
  nowIso: nowIso(),
@@ -187,7 +187,7 @@ function normalizeBody(body) {
187
187
  }
188
188
  function emptyDocument() {
189
189
  return {
190
- front_matter: {},
190
+ metadata: {},
191
191
  body: "",
192
192
  };
193
193
  }
@@ -254,9 +254,9 @@ async function importTodoCandidate(candidate, runtime) {
254
254
  if (located) {
255
255
  return { warning: `todos_import_item_exists:${id}` };
256
256
  }
257
- const itemPath = getItemPath(runtime.pmRoot, type, id, runtime.settings.item_format, runtime.typeToFolder);
257
+ const itemPath = getItemPath(runtime.pmRoot, type, id, "toon", runtime.typeToFolder);
258
258
  const afterDocument = canonicalDocument({
259
- front_matter: normalizeFrontMatter({
259
+ metadata: normalizeFrontMatter({
260
260
  id,
261
261
  title,
262
262
  description: toNonEmptyString(candidate.frontMatter.description) ?? "",
@@ -316,7 +316,7 @@ async function importTodoCandidate(candidate, runtime) {
316
316
  try {
317
317
  const releaseLock = await acquireLock(runtime.pmRoot, id, runtime.settings.locks.ttl_seconds, runtime.author);
318
318
  try {
319
- await writeFileAtomic(itemPath, serializeItemDocument(afterDocument, { format: runtime.settings.item_format }));
319
+ await writeFileAtomic(itemPath, serializeItemDocument(afterDocument, { format: "toon" }));
320
320
  try {
321
321
  const historyEntry = createHistoryEntry({
322
322
  nowIso: nowIso(),
@@ -442,18 +442,18 @@ export async function runTodosExport(options, global) {
442
442
  }
443
443
  try {
444
444
  const { document } = await readLocatedItem(located);
445
- const todoFrontMatter = { ...document.front_matter };
445
+ const todoFrontMatter = { ...document.metadata };
446
446
  const frontMatter = JSON.stringify(todoFrontMatter, null, 2);
447
447
  const body = normalizeBody(document.body);
448
448
  const serialized = body.length > 0 ? `${frontMatter}\n\n${body}\n` : `${frontMatter}\n`;
449
- const exportPath = path.join(destinationFolder, `${document.front_matter.id}.md`);
449
+ const exportPath = path.join(destinationFolder, `${document.metadata.id}.md`);
450
450
  await writeFileAtomic(exportPath, serialized);
451
451
  warnings.push(...(await runActiveOnWriteHooks({
452
452
  path: exportPath,
453
453
  scope: "project",
454
454
  op: "todos:export",
455
455
  })));
456
- ids.push(document.front_matter.id);
456
+ ids.push(document.metadata.id);
457
457
  exported += 1;
458
458
  }
459
459
  catch {
@@ -18,7 +18,7 @@ import { listAllFrontMatter, locateItem, readLocatedItem } from "../../../../src
18
18
  import { getHistoryPath, getItemPath, getSettingsPath, resolvePmRoot } from "../../../../src/core/store/paths.js";
19
19
  import { readSettings } from "../../../../src/core/store/settings.js";
20
20
  import { CONFIDENCE_TEXT_VALUES, ISSUE_SEVERITY_VALUES, RISK_VALUES } from "../../../../src/types/index.js";
21
- import type { ItemDocument, ItemFrontMatter, ItemStatus, ItemType, PmSettings } from "../../../../src/types/index.js";
21
+ import type { ItemDocument, ItemMetadata, ItemStatus, ItemType, PmSettings } from "../../../../src/types/index.js";
22
22
 
23
23
  const DEFAULT_TODOS_FOLDER = ".pi/todos";
24
24
 
@@ -133,7 +133,7 @@ function toPriority(value: unknown): PriorityValue {
133
133
  return 2;
134
134
  }
135
135
 
136
- function toConfidence(value: unknown): ItemFrontMatter["confidence"] | undefined {
136
+ function toConfidence(value: unknown): ItemMetadata["confidence"] | undefined {
137
137
  if (typeof value === "number" && Number.isInteger(value) && value >= 0 && value <= 100) {
138
138
  return value;
139
139
  }
@@ -258,7 +258,7 @@ function normalizeBody(body: string): string {
258
258
 
259
259
  function emptyDocument(): ItemDocument {
260
260
  return {
261
- front_matter: {} as ItemFrontMatter,
261
+ metadata: {} as ItemMetadata,
262
262
  body: "",
263
263
  };
264
264
  }
@@ -336,10 +336,10 @@ async function importTodoCandidate(candidate: ParsedTodoCandidate, runtime: Todo
336
336
  if (located) {
337
337
  return { warning: `todos_import_item_exists:${id}` };
338
338
  }
339
- const itemPath = getItemPath(runtime.pmRoot, type, id, runtime.settings.item_format, runtime.typeToFolder);
339
+ const itemPath = getItemPath(runtime.pmRoot, type, id, "toon", runtime.typeToFolder);
340
340
 
341
341
  const afterDocument = canonicalDocument({
342
- front_matter: normalizeFrontMatter({
342
+ metadata: normalizeFrontMatter({
343
343
  id,
344
344
  title,
345
345
  description: toNonEmptyString(candidate.frontMatter.description) ?? "",
@@ -391,7 +391,7 @@ async function importTodoCandidate(candidate: ParsedTodoCandidate, runtime: Todo
391
391
  files: Array.isArray(candidate.frontMatter.files) ? (candidate.frontMatter.files as any[]) : undefined,
392
392
  docs: Array.isArray(candidate.frontMatter.docs) ? (candidate.frontMatter.docs as any[]) : undefined,
393
393
  tests: Array.isArray(candidate.frontMatter.tests) ? (candidate.frontMatter.tests as any[]) : undefined,
394
- } as ItemFrontMatter),
394
+ } as ItemMetadata),
395
395
  body: candidate.body,
396
396
  });
397
397
 
@@ -400,7 +400,7 @@ async function importTodoCandidate(candidate: ParsedTodoCandidate, runtime: Todo
400
400
  try {
401
401
  const releaseLock = await acquireLock(runtime.pmRoot, id, runtime.settings.locks.ttl_seconds, runtime.author);
402
402
  try {
403
- await writeFileAtomic(itemPath, serializeItemDocument(afterDocument, { format: runtime.settings.item_format }));
403
+ await writeFileAtomic(itemPath, serializeItemDocument(afterDocument, { format: "toon" }));
404
404
  try {
405
405
  const historyEntry = createHistoryEntry({
406
406
  nowIso: nowIso(),
@@ -538,11 +538,11 @@ export async function runTodosExport(options: TodosExportOptions, global: Global
538
538
 
539
539
  try {
540
540
  const { document } = await readLocatedItem(located);
541
- const todoFrontMatter: Record<string, unknown> = { ...document.front_matter };
541
+ const todoFrontMatter: Record<string, unknown> = { ...document.metadata };
542
542
  const frontMatter = JSON.stringify(todoFrontMatter, null, 2);
543
543
  const body = normalizeBody(document.body);
544
544
  const serialized = body.length > 0 ? `${frontMatter}\n\n${body}\n` : `${frontMatter}\n`;
545
- const exportPath = path.join(destinationFolder, `${document.front_matter.id}.md`);
545
+ const exportPath = path.join(destinationFolder, `${document.metadata.id}.md`);
546
546
  await writeFileAtomic(exportPath, serialized);
547
547
  warnings.push(
548
548
  ...(await runActiveOnWriteHooks({
@@ -551,7 +551,7 @@ export async function runTodosExport(options: TodosExportOptions, global: Global
551
551
  op: "todos:export",
552
552
  })),
553
553
  );
554
- ids.push(document.front_matter.id);
554
+ ids.push(document.metadata.id);
555
555
  exported += 1;
556
556
  } catch {
557
557
  warnings.push(`todos_export_read_failed:${item.id}`);
@@ -0,0 +1,45 @@
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
+ ```
@@ -0,0 +1,21 @@
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)
@@ -0,0 +1,73 @@
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)
@@ -0,0 +1,48 @@
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
+ ```
@@ -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,57 @@
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)
@@ -0,0 +1,40 @@
1
+ # Extension Lifecycle Recipes
2
+
3
+ ## Inspect Current State
4
+
5
+ ```bash
6
+ pm extension explore --project
7
+ pm extension manage --detail summary
8
+ pm extension doctor --detail deep
9
+ ```
10
+
11
+ ## Install and Activate
12
+
13
+ ```bash
14
+ pm extension install <target> --project
15
+ pm extension activate <target> --project
16
+ pm extension doctor --detail summary
17
+ ```
18
+
19
+ ## Adopt Existing Extensions
20
+
21
+ ```bash
22
+ pm extension adopt <name> --project
23
+ pm extension adopt-all --project
24
+ pm extension manage --detail summary
25
+ ```
26
+
27
+ ## Deactivate / Uninstall
28
+
29
+ ```bash
30
+ pm extension deactivate <target> --project
31
+ pm extension uninstall <target> --project
32
+ pm extension doctor --detail deep
33
+ ```
34
+
35
+ ## Contract Checks
36
+
37
+ ```bash
38
+ pm contracts --runtime-only --availability-only
39
+ pm contracts --command extension --flags-only
40
+ ```
@@ -0,0 +1,25 @@
1
+ # Extension Troubleshooting
2
+
3
+ ## Common Diagnostic Sequence
4
+
5
+ 1. `pm extension explore --project`
6
+ 2. `pm extension manage --detail summary`
7
+ 3. `pm extension doctor --detail deep --trace`
8
+ 4. `pm contracts --runtime-only --availability-only`
9
+
10
+ ## Symptoms and Checks
11
+
12
+ - **Command not visible**
13
+ - Confirm extension is managed and active.
14
+ - Confirm capability includes `commands`.
15
+ - Check `pm contracts` action availability.
16
+
17
+ - **Schema mismatch**
18
+ - Confirm capability includes `schema`.
19
+ - Re-run doctor with `--detail deep --trace`.
20
+ - Validate runtime-only contracts output.
21
+
22
+ - **Unexpected behavior after updates**
23
+ - Check registration precedence with manage/doctor.
24
+ - Run with `--no-extensions` to isolate core behavior.
25
+ - Re-activate extension after fixing manifest or entry path.
@@ -0,0 +1,50 @@
1
+ ---
2
+ name: pm-sdk
3
+ description: Implements pm-cli integrations using @unbrained/pm-cli/sdk and runtime contracts. Use when authoring extensions, wrappers, or automation that must stay aligned with command/action schema changes.
4
+ license: MIT
5
+ compatibility: Requires Node.js and access to pm contracts output for runtime parity checks.
6
+ metadata:
7
+ owner: unbrained
8
+ domain: pm-cli
9
+ scope: sdk-integration
10
+ ---
11
+
12
+ # pm SDK Skill
13
+
14
+ Use this skill when integrating against `@unbrained/pm-cli/sdk` or validating external wrappers.
15
+
16
+ ## Quick Start
17
+
18
+ ```bash
19
+ pm guide sdk
20
+ pm contracts --schema-only
21
+ pm contracts --runtime-only --availability-only
22
+ pm contracts --command <command> --flags-only
23
+ ```
24
+
25
+ ## Integration Workflow
26
+
27
+ 1. Capture current runtime schema and command contracts.
28
+ 2. Map integration payload fields to contract keys.
29
+ 3. Implement with SDK exports (no internal `src/core/...` imports).
30
+ 4. Validate command/action availability in runtime-only mode.
31
+ 5. Add regression tests for schema-bound behavior.
32
+
33
+ ## Workflow Prompts
34
+
35
+ ### Prompt: Build New Integration
36
+
37
+ `Implement <integration> using @unbrained/pm-cli/sdk and pm contracts output as the source of truth. Add tests that fail when required command/action fields drift.`
38
+
39
+ ### Prompt: Contract Drift Investigation
40
+
41
+ `Compare integration assumptions with current pm contracts output, identify drift, and patch mapping logic and tests to restore parity.`
42
+
43
+ ### Prompt: Extension Authoring
44
+
45
+ `Author extension registration using defineExtension and declared capabilities only, then verify activation and command availability with pm contracts.`
46
+
47
+ ## Progressive Disclosure References
48
+
49
+ - [Integration checklist](references/INTEGRATION_CHECKLIST.md)
50
+ - [SDK prompt templates](references/PROMPTS.md)
@@ -0,0 +1,31 @@
1
+ # SDK Integration Checklist
2
+
3
+ ## Contract Capture
4
+
5
+ ```bash
6
+ pm contracts --schema-only --json
7
+ pm contracts --runtime-only --availability-only --json
8
+ pm contracts --command <command> --flags-only --json
9
+ ```
10
+
11
+ ## Implementation Rules
12
+
13
+ - Use `@unbrained/pm-cli/sdk` exports only.
14
+ - Do not import internal runtime modules from `src/core/...`.
15
+ - Keep action/flag mappings derived from `pm contracts` outputs.
16
+ - Handle extension-unavailable states through availability metadata.
17
+
18
+ ## Validation
19
+
20
+ ```bash
21
+ pnpm build
22
+ node scripts/run-tests.mjs test -- <targeted sdk/integration tests>
23
+ node scripts/run-tests.mjs coverage
24
+ ```
25
+
26
+ ## Release Readiness
27
+
28
+ ```bash
29
+ node scripts/release/docs-skills-gate.mjs
30
+ node scripts/release/run-gates.mjs --telemetry-mode best-effort
31
+ ```
@@ -0,0 +1,13 @@
1
+ # SDK Prompt Templates
2
+
3
+ ## Runtime Contract Mapping
4
+
5
+ `Map this integration request to pm contracts output first, then generate implementation steps keyed to command flags and action schema fields.`
6
+
7
+ ## Extension Capability Design
8
+
9
+ `Design extension capabilities for <feature> using defineExtension. Include only needed capabilities and provide a verification command list for activation and contracts checks.`
10
+
11
+ ## Wrapper Parity Check
12
+
13
+ `Audit wrapper action/command mapping parity against current pm contracts output and report any missing or stale fields with patch recommendations.`