@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.
- package/.agents/pm/extensions/.managed-extensions.json +2 -2
- package/.agents/pm/extensions/beads/runtime.js +4 -4
- package/.agents/pm/extensions/beads/runtime.ts +5 -5
- package/.agents/pm/extensions/todos/runtime.js +7 -7
- package/.agents/pm/extensions/todos/runtime.ts +10 -10
- package/.agents/skills/HARNESS_COMPATIBILITY.md +45 -0
- package/.agents/skills/README.md +21 -0
- package/.agents/skills/pm-developer/SKILL.md +73 -0
- package/.agents/skills/pm-developer/references/COMMAND_PLAYBOOK.md +48 -0
- package/.agents/skills/pm-developer/references/PROMPTS.md +17 -0
- package/.agents/skills/pm-extensions/SKILL.md +57 -0
- package/.agents/skills/pm-extensions/references/LIFECYCLE.md +40 -0
- package/.agents/skills/pm-extensions/references/TROUBLESHOOTING.md +25 -0
- package/.agents/skills/pm-sdk/SKILL.md +50 -0
- package/.agents/skills/pm-sdk/references/INTEGRATION_CHECKLIST.md +31 -0
- package/.agents/skills/pm-sdk/references/PROMPTS.md +13 -0
- package/.agents/skills/pm-user/SKILL.md +59 -0
- package/.agents/skills/pm-user/references/PROMPTS.md +17 -0
- package/.agents/skills/pm-user/references/WORKFLOWS.md +35 -0
- package/.claude-plugin/marketplace.json +38 -0
- package/.pi/README.md +35 -0
- package/.pi/agents/pm-triage-agent.md +19 -0
- package/.pi/agents/pm-verification-agent.md +21 -0
- package/.pi/chains/pm-native-delivery.chain.md +11 -0
- package/.pi/extensions/pm-cli/index.js +387 -0
- package/.pi/prompts/pm-workflow.md +5 -0
- package/.pi/skills/pm-native/SKILL.md +44 -0
- package/.pi/skills/pm-release/SKILL.md +35 -0
- package/AGENTS.md +1 -1
- package/CHANGELOG.md +13 -0
- package/PRD.md +16 -16
- package/README.md +30 -4
- package/dist/cli/argv-utils.d.ts +5 -0
- package/dist/cli/argv-utils.js +34 -0
- package/dist/cli/argv-utils.js.map +1 -0
- package/dist/cli/bootstrap-args.d.ts +15 -0
- package/dist/cli/bootstrap-args.js +211 -0
- package/dist/cli/bootstrap-args.js.map +1 -1
- package/dist/cli/commander-usage.js +109 -3
- package/dist/cli/commander-usage.js.map +1 -1
- package/dist/cli/commands/claim.js +6 -6
- package/dist/cli/commands/claim.js.map +1 -1
- package/dist/cli/commands/close.js +9 -9
- package/dist/cli/commands/close.js.map +1 -1
- package/dist/cli/commands/comments.d.ts +2 -0
- package/dist/cli/commands/comments.js +57 -8
- package/dist/cli/commands/comments.js.map +1 -1
- package/dist/cli/commands/completion.js +40 -7
- package/dist/cli/commands/completion.js.map +1 -1
- package/dist/cli/commands/config.js +6 -3
- package/dist/cli/commands/config.js.map +1 -1
- package/dist/cli/commands/contracts.d.ts +19 -0
- package/dist/cli/commands/contracts.js +36 -1
- package/dist/cli/commands/contracts.js.map +1 -1
- package/dist/cli/commands/create.d.ts +2 -2
- package/dist/cli/commands/create.js +116 -55
- package/dist/cli/commands/create.js.map +1 -1
- package/dist/cli/commands/docs.js +13 -6
- package/dist/cli/commands/docs.js.map +1 -1
- package/dist/cli/commands/extension.d.ts +3 -1
- package/dist/cli/commands/extension.js +174 -2
- package/dist/cli/commands/extension.js.map +1 -1
- package/dist/cli/commands/files.js +19 -12
- package/dist/cli/commands/files.js.map +1 -1
- package/dist/cli/commands/get.js +5 -5
- package/dist/cli/commands/get.js.map +1 -1
- package/dist/cli/commands/guide.d.ts +55 -0
- package/dist/cli/commands/guide.js +260 -0
- package/dist/cli/commands/guide.js.map +1 -0
- package/dist/cli/commands/health.js +1 -1
- package/dist/cli/commands/health.js.map +1 -1
- package/dist/cli/commands/history.js +30 -10
- package/dist/cli/commands/history.js.map +1 -1
- package/dist/cli/commands/index.d.ts +1 -0
- package/dist/cli/commands/index.js +1 -0
- package/dist/cli/commands/index.js.map +1 -1
- package/dist/cli/commands/init.d.ts +2 -0
- package/dist/cli/commands/init.js +21 -1
- package/dist/cli/commands/init.js.map +1 -1
- package/dist/cli/commands/learnings.js +3 -3
- package/dist/cli/commands/learnings.js.map +1 -1
- package/dist/cli/commands/metadata-normalizers.d.ts +4 -0
- package/dist/cli/commands/metadata-normalizers.js +37 -0
- package/dist/cli/commands/metadata-normalizers.js.map +1 -0
- package/dist/cli/commands/notes.js +3 -3
- package/dist/cli/commands/notes.js.map +1 -1
- package/dist/cli/commands/reindex.js +180 -156
- package/dist/cli/commands/reindex.js.map +1 -1
- package/dist/cli/commands/restore.d.ts +2 -2
- package/dist/cli/commands/restore.js +44 -24
- package/dist/cli/commands/restore.js.map +1 -1
- package/dist/cli/commands/search.d.ts +2 -0
- package/dist/cli/commands/search.js +45 -26
- package/dist/cli/commands/search.js.map +1 -1
- package/dist/cli/commands/test-all.d.ts +2 -0
- package/dist/cli/commands/test-all.js +2 -0
- package/dist/cli/commands/test-all.js.map +1 -1
- package/dist/cli/commands/test.d.ts +1 -0
- package/dist/cli/commands/test.js +13 -5
- package/dist/cli/commands/test.js.map +1 -1
- package/dist/cli/commands/update.js +188 -157
- package/dist/cli/commands/update.js.map +1 -1
- package/dist/cli/commands/validate.js +1 -1
- package/dist/cli/commands/validate.js.map +1 -1
- package/dist/cli/error-guidance.d.ts +9 -1
- package/dist/cli/error-guidance.js +147 -6
- package/dist/cli/error-guidance.js.map +1 -1
- package/dist/cli/guide-topics.d.ts +25 -0
- package/dist/cli/guide-topics.js +283 -0
- package/dist/cli/guide-topics.js.map +1 -0
- package/dist/cli/help-content.js +25 -1
- package/dist/cli/help-content.js.map +1 -1
- package/dist/cli/help-json-payload.js +11 -1
- package/dist/cli/help-json-payload.js.map +1 -1
- package/dist/cli/main.js +69 -6
- package/dist/cli/main.js.map +1 -1
- package/dist/cli/register-list-query.js +38 -1
- package/dist/cli/register-list-query.js.map +1 -1
- package/dist/cli/register-mutation.js +17 -4
- package/dist/cli/register-mutation.js.map +1 -1
- package/dist/cli/register-setup.js +15 -1
- package/dist/cli/register-setup.js.map +1 -1
- package/dist/cli/telemetry-flush.d.ts +2 -0
- package/dist/cli/telemetry-flush.js +4 -0
- package/dist/cli/telemetry-flush.js.map +1 -0
- package/dist/cli.js +1 -2
- package/dist/cli.js.map +1 -1
- package/dist/core/extensions/extension-types.d.ts +72 -0
- package/dist/core/extensions/extension-types.js +24 -0
- package/dist/core/extensions/extension-types.js.map +1 -1
- package/dist/core/extensions/loader.d.ts +1 -0
- package/dist/core/extensions/loader.js +766 -7
- package/dist/core/extensions/loader.js.map +1 -1
- package/dist/core/history/history.js +32 -11
- package/dist/core/history/history.js.map +1 -1
- package/dist/core/item/item-format.d.ts +2 -2
- package/dist/core/item/item-format.js +16 -16
- package/dist/core/item/item-format.js.map +1 -1
- package/dist/core/lock/lock.js +2 -0
- package/dist/core/lock/lock.js.map +1 -1
- package/dist/core/schema/runtime-field-filters.js +1 -1
- package/dist/core/schema/runtime-field-filters.js.map +1 -1
- package/dist/core/schema/runtime-field-values.js +2 -2
- package/dist/core/schema/runtime-field-values.js.map +1 -1
- package/dist/core/schema/runtime-schema.d.ts +1 -1
- package/dist/core/schema/runtime-schema.js +3 -3
- package/dist/core/schema/runtime-schema.js.map +1 -1
- package/dist/core/search/cache.js +7 -21
- package/dist/core/search/cache.js.map +1 -1
- package/dist/core/search/corpus.d.ts +13 -0
- package/dist/core/search/corpus.js +74 -0
- package/dist/core/search/corpus.js.map +1 -0
- package/dist/core/search/embedding-batches.js +90 -30
- package/dist/core/search/embedding-batches.js.map +1 -1
- package/dist/core/sentry/instrument.d.ts +18 -1
- package/dist/core/sentry/instrument.js +128 -12
- package/dist/core/sentry/instrument.js.map +1 -1
- package/dist/core/shared/constants.d.ts +1 -1
- package/dist/core/shared/constants.js +21 -1
- package/dist/core/shared/constants.js.map +1 -1
- package/dist/core/shared/errors.d.ts +8 -0
- package/dist/core/shared/errors.js.map +1 -1
- package/dist/core/shared/levenshtein.d.ts +1 -0
- package/dist/core/shared/levenshtein.js +37 -0
- package/dist/core/shared/levenshtein.js.map +1 -0
- package/dist/core/store/front-matter-cache.d.ts +1 -1
- package/dist/core/store/front-matter-cache.js +13 -13
- package/dist/core/store/front-matter-cache.js.map +1 -1
- package/dist/core/store/item-format-migration.js +5 -2
- package/dist/core/store/item-format-migration.js.map +1 -1
- package/dist/core/store/item-store.js +16 -15
- package/dist/core/store/item-store.js.map +1 -1
- package/dist/core/store/paths.js +35 -2
- package/dist/core/store/paths.js.map +1 -1
- package/dist/core/store/settings.js +216 -2
- package/dist/core/store/settings.js.map +1 -1
- package/dist/core/telemetry/runtime.d.ts +1 -0
- package/dist/core/telemetry/runtime.js +102 -3
- package/dist/core/telemetry/runtime.js.map +1 -1
- package/dist/core/test/item-test-run-tracking.js +2 -2
- package/dist/core/test/item-test-run-tracking.js.map +1 -1
- package/dist/mcp/server.d.ts +2 -0
- package/dist/mcp/server.js +407 -0
- package/dist/mcp/server.js.map +1 -0
- package/dist/pi/native.d.ts +5 -0
- package/dist/pi/native.js +236 -0
- package/dist/pi/native.js.map +1 -0
- package/dist/sdk/cli-contracts.d.ts +24 -2
- package/dist/sdk/cli-contracts.js +317 -2
- package/dist/sdk/cli-contracts.js.map +1 -1
- package/dist/sdk/index.d.ts +12 -1
- package/dist/sdk/index.js +8 -1
- package/dist/sdk/index.js.map +1 -1
- package/dist/types.d.ts +51 -2
- package/dist/types.js.map +1 -1
- package/docs/AGENT_GUIDE.md +15 -0
- package/docs/ARCHITECTURE.md +2 -2
- package/docs/CLAUDE_CODE_PLUGIN.md +225 -0
- package/docs/CODEX_PLUGIN.md +33 -0
- package/docs/COMMANDS.md +6 -2
- package/docs/CONFIGURATION.md +2 -8
- package/docs/EXTENSIONS.md +688 -0
- package/docs/MIGRATION_CLI_SIMPLIFICATION.md +64 -0
- package/docs/PI_PACKAGE.md +141 -0
- package/docs/QUICKSTART.md +1 -0
- package/docs/README.md +30 -1
- package/docs/RELEASING.md +4 -2
- package/docs/SDK.md +444 -2
- package/docs/examples/ci/github-actions-pm-extension-gate.yml +53 -0
- package/docs/examples/ci/gitlab-ci-pm-extension-gate.yml +41 -0
- package/docs/examples/ci/jenkins-pm-extension-gate.Jenkinsfile +45 -0
- package/docs/examples/policy-restricted-extension/README.md +74 -0
- package/docs/examples/policy-restricted-extension/index.js +21 -0
- package/docs/examples/policy-restricted-extension/manifest.json +21 -0
- package/docs/examples/policy-restricted-extension/package.json +8 -0
- package/docs/examples/sdk-app-embedding/README.md +39 -0
- package/docs/examples/sdk-app-embedding/package.json +9 -0
- package/docs/examples/sdk-app-embedding/run-embedded-pm.mjs +61 -0
- package/docs/examples/sdk-contract-consumer/README.md +57 -0
- package/docs/examples/sdk-contract-consumer/inspect-contracts.mjs +47 -0
- package/docs/examples/sdk-contract-consumer/package.json +10 -0
- package/docs/examples/starter-extension/README.md +57 -42
- package/docs/examples/starter-extension/manifest.json +15 -0
- package/marketplace.json +34 -0
- package/package.json +38 -4
- package/plugins/pm-cli-claude/.claude-plugin/plugin.json +23 -0
- package/plugins/pm-cli-claude/.mcp.json +12 -0
- package/plugins/pm-cli-claude/README.md +225 -0
- package/plugins/pm-cli-claude/agents/pm-coordinator.md +48 -0
- package/plugins/pm-cli-claude/agents/pm-delivery-chain.md +88 -0
- package/plugins/pm-cli-claude/agents/pm-triage-agent.md +83 -0
- package/plugins/pm-cli-claude/agents/pm-verification-agent.md +88 -0
- package/plugins/pm-cli-claude/commands/pm-audit.md +39 -0
- package/plugins/pm-cli-claude/commands/pm-calendar.md +41 -0
- package/plugins/pm-cli-claude/commands/pm-close-task.md +20 -0
- package/plugins/pm-cli-claude/commands/pm-developer.md +38 -0
- package/plugins/pm-cli-claude/commands/pm-init.md +44 -0
- package/plugins/pm-cli-claude/commands/pm-list.md +39 -0
- package/plugins/pm-cli-claude/commands/pm-new.md +36 -0
- package/plugins/pm-cli-claude/commands/pm-planner.md +51 -0
- package/plugins/pm-cli-claude/commands/pm-release.md +41 -0
- package/plugins/pm-cli-claude/commands/pm-search.md +21 -0
- package/plugins/pm-cli-claude/commands/pm-start-task.md +27 -0
- package/plugins/pm-cli-claude/commands/pm-status.md +15 -0
- package/plugins/pm-cli-claude/commands/pm-triage.md +35 -0
- package/plugins/pm-cli-claude/commands/pm-workflow.md +49 -0
- package/plugins/pm-cli-claude/hooks/hooks.json +17 -0
- package/plugins/pm-cli-claude/hooks/session-start.mjs +120 -0
- package/plugins/pm-cli-claude/scripts/pm-mcp-server.mjs +60 -0
- package/plugins/pm-cli-claude/skills/pm-audit/SKILL.md +88 -0
- package/plugins/pm-cli-claude/skills/pm-developer/SKILL.md +116 -0
- package/plugins/pm-cli-claude/skills/pm-planner/SKILL.md +118 -0
- package/plugins/pm-cli-claude/skills/pm-release/SKILL.md +83 -0
- package/plugins/pm-cli-claude/skills/pm-workflow/SKILL.md +148 -0
- package/plugins/pm-cli-codex/.codex-plugin/plugin.json +45 -0
- package/plugins/pm-cli-codex/.mcp.json +14 -0
- package/plugins/pm-cli-codex/README.md +30 -0
- package/plugins/pm-cli-codex/assets/pm-cli-small.svg +4 -0
- package/plugins/pm-cli-codex/commands/pm-audit.md +8 -0
- package/plugins/pm-cli-codex/commands/pm-close-task.md +9 -0
- package/plugins/pm-cli-codex/commands/pm-start-task.md +9 -0
- package/plugins/pm-cli-codex/scripts/pm-mcp-server.mjs +54 -0
- package/plugins/pm-cli-codex/skills/pm-auditor/SKILL.md +21 -0
- package/plugins/pm-cli-codex/skills/pm-auditor/agents/openai.yaml +6 -0
- package/plugins/pm-cli-codex/skills/pm-native/SKILL.md +57 -0
- package/plugins/pm-cli-codex/skills/pm-native/agents/openai.yaml +6 -0
- package/plugins/pm-cli-codex/skills/pm-release/SKILL.md +19 -0
- package/plugins/pm-cli-codex/skills/pm-release/agents/openai.yaml +6 -0
|
@@ -0,0 +1,283 @@
|
|
|
1
|
+
function normalizeTopicToken(value) {
|
|
2
|
+
return value.trim().toLowerCase().replaceAll("_", "-");
|
|
3
|
+
}
|
|
4
|
+
const GUIDE_TOPICS = [
|
|
5
|
+
{
|
|
6
|
+
id: "quickstart",
|
|
7
|
+
aliases: ["start", "getting-started", "bootstrap"],
|
|
8
|
+
title: "Quickstart",
|
|
9
|
+
summary: "Initialize a tracker and run the shortest safe plan -> execute -> close loop.",
|
|
10
|
+
intent: "Use this when a human or agent needs to start productive work quickly with minimal context load.",
|
|
11
|
+
commands: [
|
|
12
|
+
"pm init",
|
|
13
|
+
"pm context --limit 10",
|
|
14
|
+
"pm list-open --limit 20",
|
|
15
|
+
"pm create --create-mode progressive --title \"...\" --description \"...\" --type Task",
|
|
16
|
+
"pm claim <ID>",
|
|
17
|
+
"pm update <ID> --status in_progress",
|
|
18
|
+
"pm close <ID> \"<reason with evidence>\" --validate-close warn",
|
|
19
|
+
],
|
|
20
|
+
workflows: [
|
|
21
|
+
{
|
|
22
|
+
name: "Start Session Safely",
|
|
23
|
+
goal: "Bootstrap without mutating unrelated state.",
|
|
24
|
+
prompt: "You are bootstrapping pm work. Use a token-efficient context snapshot first, then select one open item, claim it, and only then mutate.",
|
|
25
|
+
commands: ["pm context --limit 10", "pm list-open --limit 20", "pm claim <ID>"],
|
|
26
|
+
},
|
|
27
|
+
],
|
|
28
|
+
docs: [
|
|
29
|
+
{ path: "README.md", purpose: "High-level project and install entrypoint." },
|
|
30
|
+
{ path: "docs/QUICKSTART.md", purpose: "Short setup and first-command walkthrough." },
|
|
31
|
+
{ path: "docs/COMMANDS.md", purpose: "Task-oriented command recipes." },
|
|
32
|
+
],
|
|
33
|
+
related: ["commands", "workflows", "release"],
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
id: "commands",
|
|
37
|
+
aliases: ["cli", "operations", "reference"],
|
|
38
|
+
title: "CLI Command Routing",
|
|
39
|
+
summary: "Find the right command family quickly and use command-scoped help/contracts output.",
|
|
40
|
+
intent: "Use this when selecting command paths, flags, and output formats for implementation or automation.",
|
|
41
|
+
commands: [
|
|
42
|
+
"pm --help",
|
|
43
|
+
"pm <command> --help",
|
|
44
|
+
"pm <command> --help --explain",
|
|
45
|
+
"pm contracts --command <command> --flags-only",
|
|
46
|
+
"pm contracts --command <command> --availability-only --runtime-only",
|
|
47
|
+
"pm completion <bash|zsh|fish>",
|
|
48
|
+
],
|
|
49
|
+
workflows: [
|
|
50
|
+
{
|
|
51
|
+
name: "Flag Discovery",
|
|
52
|
+
goal: "Resolve command flags deterministically before mutations.",
|
|
53
|
+
prompt: "You are preparing to run a command. Use help and contracts surfaces to verify required/optional flags before execution.",
|
|
54
|
+
commands: ["pm <command> --help --explain", "pm contracts --command <command> --flags-only"],
|
|
55
|
+
},
|
|
56
|
+
],
|
|
57
|
+
docs: [
|
|
58
|
+
{ path: "docs/COMMANDS.md", purpose: "Command grouping and examples." },
|
|
59
|
+
{ path: "docs/CONFIGURATION.md", purpose: "Project/global settings and policy controls." },
|
|
60
|
+
{ path: "docs/TESTING.md", purpose: "Linked-test orchestration and safety guidance." },
|
|
61
|
+
],
|
|
62
|
+
related: ["quickstart", "workflows", "sdk", "extensions"],
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
id: "workflows",
|
|
66
|
+
aliases: ["developer", "maintainer", "agent"],
|
|
67
|
+
title: "Developer and Agent Workflows",
|
|
68
|
+
summary: "Apply canonical claim -> execute -> verify -> close workflows with append-only evidence.",
|
|
69
|
+
intent: "Use this for day-to-day coding-agent execution loops and handoff-safe updates.",
|
|
70
|
+
commands: [
|
|
71
|
+
"pm claim <ID>",
|
|
72
|
+
"pm update <ID> --status in_progress",
|
|
73
|
+
"pm files <ID> --add ...",
|
|
74
|
+
"pm test <ID> --add ...",
|
|
75
|
+
"pm comments <ID> \"...\"",
|
|
76
|
+
"pm validate --check-resolution --check-history-drift",
|
|
77
|
+
"pm release <ID>",
|
|
78
|
+
],
|
|
79
|
+
workflows: [
|
|
80
|
+
{
|
|
81
|
+
name: "Execution Loop",
|
|
82
|
+
goal: "Keep code, tests, and tracker evidence synchronized.",
|
|
83
|
+
prompt: "You are implementing a scoped change. Claim first, link files/tests/docs as you go, append evidence comments, and close only after validation.",
|
|
84
|
+
commands: [
|
|
85
|
+
"pm claim <ID>",
|
|
86
|
+
"pm update <ID> --status in_progress",
|
|
87
|
+
"pm files <ID> --add path=<file>,scope=project",
|
|
88
|
+
"pm test <ID> --run --progress",
|
|
89
|
+
"pm close <ID> \"<evidence>\" --validate-close warn",
|
|
90
|
+
],
|
|
91
|
+
},
|
|
92
|
+
],
|
|
93
|
+
docs: [
|
|
94
|
+
{ path: "AGENTS.md", purpose: "Repository operating rules and required workflow." },
|
|
95
|
+
{ path: "docs/AGENT_GUIDE.md", purpose: "Agent-oriented usage and context strategy." },
|
|
96
|
+
{ path: "docs/TESTING.md", purpose: "Sandbox-safe test execution rules." },
|
|
97
|
+
],
|
|
98
|
+
related: ["quickstart", "commands", "skills"],
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
id: "sdk",
|
|
102
|
+
aliases: ["api", "typescript-sdk"],
|
|
103
|
+
title: "SDK and Integrations",
|
|
104
|
+
summary: "Use the published SDK surface for extension authoring and contract-safe integrations.",
|
|
105
|
+
intent: "Use this when building or reviewing programmatic integrations against @unbrained/pm-cli/sdk.",
|
|
106
|
+
commands: [
|
|
107
|
+
"pm contracts --schema-only",
|
|
108
|
+
"pm contracts --command extension --flags-only",
|
|
109
|
+
"pm contracts --runtime-only --availability-only",
|
|
110
|
+
],
|
|
111
|
+
workflows: [
|
|
112
|
+
{
|
|
113
|
+
name: "Integration Contract Check",
|
|
114
|
+
goal: "Confirm action schemas and runtime availability before coding.",
|
|
115
|
+
prompt: "You are wiring an integration. Capture schema + runtime availability first, then map your adapter payload fields to contract keys.",
|
|
116
|
+
commands: [
|
|
117
|
+
"pm contracts --schema-only",
|
|
118
|
+
"pm contracts --availability-only --runtime-only",
|
|
119
|
+
"pm contracts --command <command> --flags-only",
|
|
120
|
+
],
|
|
121
|
+
},
|
|
122
|
+
],
|
|
123
|
+
docs: [
|
|
124
|
+
{ path: "docs/SDK.md", purpose: "Public SDK exports and extension authoring references." },
|
|
125
|
+
{ path: "docs/ARCHITECTURE.md", purpose: "Core runtime composition and extension load flow." },
|
|
126
|
+
],
|
|
127
|
+
related: ["extensions", "commands"],
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
id: "extensions",
|
|
131
|
+
aliases: ["plugins", "extension-authoring"],
|
|
132
|
+
title: "Extensions",
|
|
133
|
+
summary: "Install, author, and diagnose extensions with deterministic lifecycle controls.",
|
|
134
|
+
intent: "Use this for extension management, capability registration, and runtime diagnostics.",
|
|
135
|
+
commands: [
|
|
136
|
+
"pm extension explore --project",
|
|
137
|
+
"pm extension install <target> --project",
|
|
138
|
+
"pm extension manage --detail summary",
|
|
139
|
+
"pm extension doctor --detail deep",
|
|
140
|
+
"pm extension activate <target> --project",
|
|
141
|
+
"pm extension deactivate <target> --project",
|
|
142
|
+
],
|
|
143
|
+
workflows: [
|
|
144
|
+
{
|
|
145
|
+
name: "Lifecycle Triage",
|
|
146
|
+
goal: "Diagnose extension state before forceful lifecycle actions.",
|
|
147
|
+
prompt: "You are debugging extension behavior. Inspect managed state first, then run doctor diagnostics, then apply install/adopt/activate actions.",
|
|
148
|
+
commands: [
|
|
149
|
+
"pm extension explore --project",
|
|
150
|
+
"pm extension manage --detail summary",
|
|
151
|
+
"pm extension doctor --detail deep",
|
|
152
|
+
],
|
|
153
|
+
},
|
|
154
|
+
],
|
|
155
|
+
docs: [
|
|
156
|
+
{ path: "docs/EXTENSIONS.md", purpose: "Capability model and lifecycle command usage." },
|
|
157
|
+
{
|
|
158
|
+
path: "docs/examples/starter-extension/README.md",
|
|
159
|
+
purpose: "Starter extension scaffold and local development path.",
|
|
160
|
+
},
|
|
161
|
+
{ path: "docs/SDK.md", purpose: "SDK contracts used by extension implementations." },
|
|
162
|
+
],
|
|
163
|
+
related: ["sdk", "commands", "skills"],
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
id: "skills",
|
|
167
|
+
aliases: ["agent-skills", "agentskills"],
|
|
168
|
+
title: "Agent Skills",
|
|
169
|
+
summary: "Skill bundles for developer, user, extensions, and sdk workflows aligned to the current CLI.",
|
|
170
|
+
intent: "Use this when an agent needs reproducible prompts/workflows with strict compatibility metadata.",
|
|
171
|
+
commands: [
|
|
172
|
+
"pm guide skills --depth deep",
|
|
173
|
+
"pm contracts --command guide --flags-only",
|
|
174
|
+
"pm validate --check-command-references",
|
|
175
|
+
],
|
|
176
|
+
workflows: [
|
|
177
|
+
{
|
|
178
|
+
name: "Skill Selection",
|
|
179
|
+
goal: "Pick the narrowest compatible skill first to minimize context usage.",
|
|
180
|
+
prompt: "Select a pm skill based on the task intent, then execute only the workflow section needed for the current change.",
|
|
181
|
+
commands: ["pm guide skills", "pm guide skills --depth deep"],
|
|
182
|
+
},
|
|
183
|
+
],
|
|
184
|
+
docs: [
|
|
185
|
+
{ path: "docs/AGENT_GUIDE.md", purpose: "Agent-first usage and context model." },
|
|
186
|
+
{ path: "docs/README.md", purpose: "Documentation routing with progressive disclosure." },
|
|
187
|
+
{ path: ".agents/skills/README.md", purpose: "Agent skills index and routing overview." },
|
|
188
|
+
{ path: ".agents/skills/pm-developer/SKILL.md", purpose: "Developer-oriented pm skill workflow." },
|
|
189
|
+
{ path: ".agents/skills/pm-user/SKILL.md", purpose: "User/operator pm skill workflow." },
|
|
190
|
+
{ path: ".agents/skills/pm-extensions/SKILL.md", purpose: "Extension-focused pm skill workflow." },
|
|
191
|
+
{ path: ".agents/skills/pm-sdk/SKILL.md", purpose: "SDK integration pm skill workflow." },
|
|
192
|
+
],
|
|
193
|
+
related: ["workflows", "harnesses", "commands"],
|
|
194
|
+
},
|
|
195
|
+
{
|
|
196
|
+
id: "harnesses",
|
|
197
|
+
aliases: ["compatibility", "agent-compatibility"],
|
|
198
|
+
title: "Agent Harness Compatibility",
|
|
199
|
+
summary: "Cross-harness compatibility guidance for skill discovery, prompts, and docs routing.",
|
|
200
|
+
intent: "Use this when adapting pm skills/docs usage for Pi, OpenClaw, Claude Code, Codex CLI, OpenCode, Amp, Droid, Hermes, or Gemini CLI.",
|
|
201
|
+
commands: ["pm guide skills", "pm guide commands", "pm contracts --runtime-only --availability-only"],
|
|
202
|
+
workflows: [
|
|
203
|
+
{
|
|
204
|
+
name: "Harness Mapping",
|
|
205
|
+
goal: "Route each harness to the same canonical skill/docs sources.",
|
|
206
|
+
prompt: "Map harness-specific entrypoints to the same pm guide topics and .agents/skills workflows without adding runtime harness-specific code.",
|
|
207
|
+
commands: ["pm guide harnesses --depth standard", "pm guide skills --depth deep"],
|
|
208
|
+
},
|
|
209
|
+
],
|
|
210
|
+
docs: [
|
|
211
|
+
{ path: "docs/AGENT_GUIDE.md", purpose: "Agent context and output-mode conventions." },
|
|
212
|
+
{ path: "docs/README.md", purpose: "Single-source documentation routing entrypoint." },
|
|
213
|
+
{ path: ".agents/skills/HARNESS_COMPATIBILITY.md", purpose: "Harness compatibility matrix and usage notes." },
|
|
214
|
+
],
|
|
215
|
+
related: ["skills", "workflows"],
|
|
216
|
+
},
|
|
217
|
+
{
|
|
218
|
+
id: "release",
|
|
219
|
+
aliases: ["gates", "ship", "release-readiness"],
|
|
220
|
+
title: "Release and Staleness Gates",
|
|
221
|
+
summary: "Run release gates and docs/skills freshness checks before publishing.",
|
|
222
|
+
intent: "Use this when validating release readiness and preventing docs/skills drift.",
|
|
223
|
+
commands: [
|
|
224
|
+
"pnpm build",
|
|
225
|
+
"pnpm test:coverage",
|
|
226
|
+
"pnpm quality:static",
|
|
227
|
+
"node scripts/release/run-gates.mjs --telemetry-mode best-effort",
|
|
228
|
+
"pnpm security:scan",
|
|
229
|
+
],
|
|
230
|
+
workflows: [
|
|
231
|
+
{
|
|
232
|
+
name: "Pre-Release Gate Sweep",
|
|
233
|
+
goal: "Ensure code, docs, and skills are all green before publish.",
|
|
234
|
+
prompt: "Run release gates in deterministic order and treat docs/skills freshness failures as release blockers.",
|
|
235
|
+
commands: [
|
|
236
|
+
"pnpm build",
|
|
237
|
+
"pnpm test:coverage",
|
|
238
|
+
"node scripts/release/run-gates.mjs --telemetry-mode best-effort",
|
|
239
|
+
],
|
|
240
|
+
},
|
|
241
|
+
],
|
|
242
|
+
docs: [
|
|
243
|
+
{ path: "docs/RELEASING.md", purpose: "Release flow and safety checks." },
|
|
244
|
+
{ path: "CHANGELOG.md", purpose: "Versioned release history and unreleased notes." },
|
|
245
|
+
{ path: "scripts/release/run-gates.mjs", purpose: "Source of truth for release gate ordering." },
|
|
246
|
+
],
|
|
247
|
+
related: ["commands", "skills", "workflows"],
|
|
248
|
+
},
|
|
249
|
+
];
|
|
250
|
+
const TOPIC_BY_TOKEN = new Map();
|
|
251
|
+
for (const topic of GUIDE_TOPICS) {
|
|
252
|
+
TOPIC_BY_TOKEN.set(topic.id, topic);
|
|
253
|
+
for (const alias of topic.aliases) {
|
|
254
|
+
TOPIC_BY_TOKEN.set(alias, topic);
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
export function listGuideTopics() {
|
|
258
|
+
return GUIDE_TOPICS.map((topic) => ({
|
|
259
|
+
...topic,
|
|
260
|
+
aliases: [...topic.aliases],
|
|
261
|
+
commands: [...topic.commands],
|
|
262
|
+
workflows: topic.workflows.map((workflow) => ({
|
|
263
|
+
...workflow,
|
|
264
|
+
commands: [...workflow.commands],
|
|
265
|
+
})),
|
|
266
|
+
docs: topic.docs.map((doc) => ({ ...doc })),
|
|
267
|
+
related: [...topic.related],
|
|
268
|
+
}));
|
|
269
|
+
}
|
|
270
|
+
export function listGuideTopicIds() {
|
|
271
|
+
return GUIDE_TOPICS.map((topic) => topic.id);
|
|
272
|
+
}
|
|
273
|
+
export function resolveGuideTopic(rawTopic) {
|
|
274
|
+
if (!rawTopic) {
|
|
275
|
+
return null;
|
|
276
|
+
}
|
|
277
|
+
const normalized = normalizeTopicToken(rawTopic);
|
|
278
|
+
if (!normalized) {
|
|
279
|
+
return null;
|
|
280
|
+
}
|
|
281
|
+
return TOPIC_BY_TOKEN.get(normalized) ?? null;
|
|
282
|
+
}
|
|
283
|
+
//# sourceMappingURL=guide-topics.js.map
|
|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,CAAC,QAA4B;IAC5D,IAAI,CAAC,QAAQ,EAAE,CAAC;QACd,OAAO,IAAI,CAAC;IACd,CAAC;IACD,MAAM,UAAU,GAAG,mBAAmB,CAAC,QAAQ,CAAC,CAAC;IACjD,IAAI,CAAC,UAAU,EAAE,CAAC;QAChB,OAAO,IAAI,CAAC;IACd,CAAC;IACD,OAAO,cAAc,CAAC,GAAG,CAAC,UAAU,CAAC,IAAI,IAAI,CAAC;AAChD,CAAC","sourcesContent":["export interface GuideDocReference {\n path: string;\n purpose: string;\n optional?: boolean;\n}\n\nexport interface GuideWorkflowTemplate {\n name: string;\n goal: string;\n prompt: string;\n commands: string[];\n}\n\nexport interface GuideTopicDefinition {\n id: string;\n aliases: string[];\n title: string;\n summary: string;\n intent: string;\n commands: string[];\n workflows: GuideWorkflowTemplate[];\n docs: GuideDocReference[];\n related: string[];\n}\n\nfunction normalizeTopicToken(value: string): string {\n return value.trim().toLowerCase().replaceAll(\"_\", \"-\");\n}\n\nconst GUIDE_TOPICS: GuideTopicDefinition[] = [\n {\n id: \"quickstart\",\n aliases: [\"start\", \"getting-started\", \"bootstrap\"],\n title: \"Quickstart\",\n summary: \"Initialize a tracker and run the shortest safe plan -> execute -> close loop.\",\n intent: \"Use this when a human or agent needs to start productive work quickly with minimal context load.\",\n commands: [\n \"pm init\",\n \"pm context --limit 10\",\n \"pm list-open --limit 20\",\n \"pm create --create-mode progressive --title \\\"...\\\" --description \\\"...\\\" --type Task\",\n \"pm claim <ID>\",\n \"pm update <ID> --status in_progress\",\n \"pm close <ID> \\\"<reason with evidence>\\\" --validate-close warn\",\n ],\n workflows: [\n {\n name: \"Start Session Safely\",\n goal: \"Bootstrap without mutating unrelated state.\",\n prompt:\n \"You are bootstrapping pm work. Use a token-efficient context snapshot first, then select one open item, claim it, and only then mutate.\",\n commands: [\"pm context --limit 10\", \"pm list-open --limit 20\", \"pm claim <ID>\"],\n },\n ],\n docs: [\n { path: \"README.md\", purpose: \"High-level project and install entrypoint.\" },\n { path: \"docs/QUICKSTART.md\", purpose: \"Short setup and first-command walkthrough.\" },\n { path: \"docs/COMMANDS.md\", purpose: \"Task-oriented command recipes.\" },\n ],\n related: [\"commands\", \"workflows\", \"release\"],\n },\n {\n id: \"commands\",\n aliases: [\"cli\", \"operations\", \"reference\"],\n title: \"CLI Command Routing\",\n summary: \"Find the right command family quickly and use command-scoped help/contracts output.\",\n intent: \"Use this when selecting command paths, flags, and output formats for implementation or automation.\",\n commands: [\n \"pm --help\",\n \"pm <command> --help\",\n \"pm <command> --help --explain\",\n \"pm contracts --command <command> --flags-only\",\n \"pm contracts --command <command> --availability-only --runtime-only\",\n \"pm completion <bash|zsh|fish>\",\n ],\n workflows: [\n {\n name: \"Flag Discovery\",\n goal: \"Resolve command flags deterministically before mutations.\",\n prompt:\n \"You are preparing to run a command. Use help and contracts surfaces to verify required/optional flags before execution.\",\n commands: [\"pm <command> --help --explain\", \"pm contracts --command <command> --flags-only\"],\n },\n ],\n docs: [\n { path: \"docs/COMMANDS.md\", purpose: \"Command grouping and examples.\" },\n { path: \"docs/CONFIGURATION.md\", purpose: \"Project/global settings and policy controls.\" },\n { path: \"docs/TESTING.md\", purpose: \"Linked-test orchestration and safety guidance.\" },\n ],\n related: [\"quickstart\", \"workflows\", \"sdk\", \"extensions\"],\n },\n {\n id: \"workflows\",\n aliases: [\"developer\", \"maintainer\", \"agent\"],\n title: \"Developer and Agent Workflows\",\n summary: \"Apply canonical claim -> execute -> verify -> close workflows with append-only evidence.\",\n intent: \"Use this for day-to-day coding-agent execution loops and handoff-safe updates.\",\n commands: [\n \"pm claim <ID>\",\n \"pm update <ID> --status in_progress\",\n \"pm files <ID> --add ...\",\n \"pm test <ID> --add ...\",\n \"pm comments <ID> \\\"...\\\"\",\n \"pm validate --check-resolution --check-history-drift\",\n \"pm release <ID>\",\n ],\n workflows: [\n {\n name: \"Execution Loop\",\n goal: \"Keep code, tests, and tracker evidence synchronized.\",\n prompt:\n \"You are implementing a scoped change. Claim first, link files/tests/docs as you go, append evidence comments, and close only after validation.\",\n commands: [\n \"pm claim <ID>\",\n \"pm update <ID> --status in_progress\",\n \"pm files <ID> --add path=<file>,scope=project\",\n \"pm test <ID> --run --progress\",\n \"pm close <ID> \\\"<evidence>\\\" --validate-close warn\",\n ],\n },\n ],\n docs: [\n { path: \"AGENTS.md\", purpose: \"Repository operating rules and required workflow.\" },\n { path: \"docs/AGENT_GUIDE.md\", purpose: \"Agent-oriented usage and context strategy.\" },\n { path: \"docs/TESTING.md\", purpose: \"Sandbox-safe test execution rules.\" },\n ],\n related: [\"quickstart\", \"commands\", \"skills\"],\n },\n {\n id: \"sdk\",\n aliases: [\"api\", \"typescript-sdk\"],\n title: \"SDK and Integrations\",\n summary: \"Use the published SDK surface for extension authoring and contract-safe integrations.\",\n intent: \"Use this when building or reviewing programmatic integrations against @unbrained/pm-cli/sdk.\",\n commands: [\n \"pm contracts --schema-only\",\n \"pm contracts --command extension --flags-only\",\n \"pm contracts --runtime-only --availability-only\",\n ],\n workflows: [\n {\n name: \"Integration Contract Check\",\n goal: \"Confirm action schemas and runtime availability before coding.\",\n prompt:\n \"You are wiring an integration. Capture schema + runtime availability first, then map your adapter payload fields to contract keys.\",\n commands: [\n \"pm contracts --schema-only\",\n \"pm contracts --availability-only --runtime-only\",\n \"pm contracts --command <command> --flags-only\",\n ],\n },\n ],\n docs: [\n { path: \"docs/SDK.md\", purpose: \"Public SDK exports and extension authoring references.\" },\n { path: \"docs/ARCHITECTURE.md\", purpose: \"Core runtime composition and extension load flow.\" },\n ],\n related: [\"extensions\", \"commands\"],\n },\n {\n id: \"extensions\",\n aliases: [\"plugins\", \"extension-authoring\"],\n title: \"Extensions\",\n summary: \"Install, author, and diagnose extensions with deterministic lifecycle controls.\",\n intent: \"Use this for extension management, capability registration, and runtime diagnostics.\",\n commands: [\n \"pm extension explore --project\",\n \"pm extension install <target> --project\",\n \"pm extension manage --detail summary\",\n \"pm extension doctor --detail deep\",\n \"pm extension activate <target> --project\",\n \"pm extension deactivate <target> --project\",\n ],\n workflows: [\n {\n name: \"Lifecycle Triage\",\n goal: \"Diagnose extension state before forceful lifecycle actions.\",\n prompt:\n \"You are debugging extension behavior. Inspect managed state first, then run doctor diagnostics, then apply install/adopt/activate actions.\",\n commands: [\n \"pm extension explore --project\",\n \"pm extension manage --detail summary\",\n \"pm extension doctor --detail deep\",\n ],\n },\n ],\n docs: [\n { path: \"docs/EXTENSIONS.md\", purpose: \"Capability model and lifecycle command usage.\" },\n {\n path: \"docs/examples/starter-extension/README.md\",\n purpose: \"Starter extension scaffold and local development path.\",\n },\n { path: \"docs/SDK.md\", purpose: \"SDK contracts used by extension implementations.\" },\n ],\n related: [\"sdk\", \"commands\", \"skills\"],\n },\n {\n id: \"skills\",\n aliases: [\"agent-skills\", \"agentskills\"],\n title: \"Agent Skills\",\n summary: \"Skill bundles for developer, user, extensions, and sdk workflows aligned to the current CLI.\",\n intent: \"Use this when an agent needs reproducible prompts/workflows with strict compatibility metadata.\",\n commands: [\n \"pm guide skills --depth deep\",\n \"pm contracts --command guide --flags-only\",\n \"pm validate --check-command-references\",\n ],\n workflows: [\n {\n name: \"Skill Selection\",\n goal: \"Pick the narrowest compatible skill first to minimize context usage.\",\n prompt:\n \"Select a pm skill based on the task intent, then execute only the workflow section needed for the current change.\",\n commands: [\"pm guide skills\", \"pm guide skills --depth deep\"],\n },\n ],\n docs: [\n { path: \"docs/AGENT_GUIDE.md\", purpose: \"Agent-first usage and context model.\" },\n { path: \"docs/README.md\", purpose: \"Documentation routing with progressive disclosure.\" },\n { path: \".agents/skills/README.md\", purpose: \"Agent skills index and routing overview.\" },\n { path: \".agents/skills/pm-developer/SKILL.md\", purpose: \"Developer-oriented pm skill workflow.\" },\n { path: \".agents/skills/pm-user/SKILL.md\", purpose: \"User/operator pm skill workflow.\" },\n { path: \".agents/skills/pm-extensions/SKILL.md\", purpose: \"Extension-focused pm skill workflow.\" },\n { path: \".agents/skills/pm-sdk/SKILL.md\", purpose: \"SDK integration pm skill workflow.\" },\n ],\n related: [\"workflows\", \"harnesses\", \"commands\"],\n },\n {\n id: \"harnesses\",\n aliases: [\"compatibility\", \"agent-compatibility\"],\n title: \"Agent Harness Compatibility\",\n summary: \"Cross-harness compatibility guidance for skill discovery, prompts, and docs routing.\",\n intent: \"Use this when adapting pm skills/docs usage for Pi, OpenClaw, Claude Code, Codex CLI, OpenCode, Amp, Droid, Hermes, or Gemini CLI.\",\n commands: [\"pm guide skills\", \"pm guide commands\", \"pm contracts --runtime-only --availability-only\"],\n workflows: [\n {\n name: \"Harness Mapping\",\n goal: \"Route each harness to the same canonical skill/docs sources.\",\n prompt:\n \"Map harness-specific entrypoints to the same pm guide topics and .agents/skills workflows without adding runtime harness-specific code.\",\n commands: [\"pm guide harnesses --depth standard\", \"pm guide skills --depth deep\"],\n },\n ],\n docs: [\n { path: \"docs/AGENT_GUIDE.md\", purpose: \"Agent context and output-mode conventions.\" },\n { path: \"docs/README.md\", purpose: \"Single-source documentation routing entrypoint.\" },\n { path: \".agents/skills/HARNESS_COMPATIBILITY.md\", purpose: \"Harness compatibility matrix and usage notes.\" },\n ],\n related: [\"skills\", \"workflows\"],\n },\n {\n id: \"release\",\n aliases: [\"gates\", \"ship\", \"release-readiness\"],\n title: \"Release and Staleness Gates\",\n summary: \"Run release gates and docs/skills freshness checks before publishing.\",\n intent: \"Use this when validating release readiness and preventing docs/skills drift.\",\n commands: [\n \"pnpm build\",\n \"pnpm test:coverage\",\n \"pnpm quality:static\",\n \"node scripts/release/run-gates.mjs --telemetry-mode best-effort\",\n \"pnpm security:scan\",\n ],\n workflows: [\n {\n name: \"Pre-Release Gate Sweep\",\n goal: \"Ensure code, docs, and skills are all green before publish.\",\n prompt:\n \"Run release gates in deterministic order and treat docs/skills freshness failures as release blockers.\",\n commands: [\n \"pnpm build\",\n \"pnpm test:coverage\",\n \"node scripts/release/run-gates.mjs --telemetry-mode best-effort\",\n ],\n },\n ],\n docs: [\n { path: \"docs/RELEASING.md\", purpose: \"Release flow and safety checks.\" },\n { path: \"CHANGELOG.md\", purpose: \"Versioned release history and unreleased notes.\" },\n { path: \"scripts/release/run-gates.mjs\", purpose: \"Source of truth for release gate ordering.\" },\n ],\n related: [\"commands\", \"skills\", \"workflows\"],\n },\n];\n\nconst TOPIC_BY_TOKEN = new Map<string, GuideTopicDefinition>();\nfor (const topic of GUIDE_TOPICS) {\n TOPIC_BY_TOKEN.set(topic.id, topic);\n for (const alias of topic.aliases) {\n TOPIC_BY_TOKEN.set(alias, topic);\n }\n}\n\nexport function listGuideTopics(): GuideTopicDefinition[] {\n return GUIDE_TOPICS.map((topic) => ({\n ...topic,\n aliases: [...topic.aliases],\n commands: [...topic.commands],\n workflows: topic.workflows.map((workflow) => ({\n ...workflow,\n commands: [...workflow.commands],\n })),\n docs: topic.docs.map((doc) => ({ ...doc })),\n related: [...topic.related],\n }));\n}\n\nexport function listGuideTopicIds(): string[] {\n return GUIDE_TOPICS.map((topic) => topic.id);\n}\n\nexport function resolveGuideTopic(rawTopic: string | undefined): GuideTopicDefinition | null {\n if (!rawTopic) {\n return null;\n }\n const normalized = normalizeTopicToken(rawTopic);\n if (!normalized) {\n return null;\n }\n return TOPIC_BY_TOKEN.get(normalized) ?? null;\n}\n\n"]}
|
package/dist/cli/help-content.js
CHANGED
|
@@ -253,6 +253,20 @@ const HELP_BY_COMMAND_PATH = {
|
|
|
253
253
|
],
|
|
254
254
|
tips: ["Use title_exact for strict collisions, title_fuzzy for near-duplicates, and parent_scope for child-level collisions."],
|
|
255
255
|
},
|
|
256
|
+
guide: {
|
|
257
|
+
why: "Routes local progressive-disclosure documentation so agents can fetch only the context they need.",
|
|
258
|
+
examples: [
|
|
259
|
+
"pm guide",
|
|
260
|
+
"pm guide quickstart",
|
|
261
|
+
"pm guide commands --depth standard",
|
|
262
|
+
"pm guide skills --depth deep --format markdown",
|
|
263
|
+
"pm guide release --json",
|
|
264
|
+
],
|
|
265
|
+
tips: [
|
|
266
|
+
"Use brief depth for minimal token footprint, standard for excerpted docs, and deep for full local document rendering.",
|
|
267
|
+
"Use --list to force topic index output even when topic parsing is ambiguous.",
|
|
268
|
+
],
|
|
269
|
+
},
|
|
256
270
|
calendar: {
|
|
257
271
|
why: "Provides deadline/reminder/event scheduling views for planning and coordination.",
|
|
258
272
|
examples: [
|
|
@@ -342,12 +356,16 @@ const HELP_BY_COMMAND_PATH = {
|
|
|
342
356
|
comments: {
|
|
343
357
|
why: "Adds or reviews lightweight status updates linked to an item.",
|
|
344
358
|
examples: [
|
|
359
|
+
'pm comments pm-a1b2 "Verified fix on Linux and macOS"',
|
|
345
360
|
'pm comments pm-a1b2 --add "Verified fix on Linux and macOS"',
|
|
361
|
+
'printf "%s\\n" "## Verification" "- linux pass" "- mac pass" | pm comments pm-a1b2 --stdin',
|
|
362
|
+
'pm comments pm-a1b2 --file docs/release-evidence.md --author "codex-agent"',
|
|
346
363
|
'pm comments pm-a1b2 --add "text: verification note with commas, key-like words, and parser details"',
|
|
347
364
|
'pm comments pm-a1b2 --add "Follow-up needed after review" --author "codex-agent" --force',
|
|
348
365
|
"pm comments pm-a1b2 --limit 10",
|
|
349
366
|
],
|
|
350
367
|
tips: [
|
|
368
|
+
"Use exactly one comment source at a time: positional [text], --add, --stdin, or --file.",
|
|
351
369
|
"Use --force when adding comments to items currently assigned to a different owner.",
|
|
352
370
|
"When --add payload resembles CSV-like key fragments (for example text=hello,scope:project), plain-text fallback is intentional; use explicit text=..., markdown text: ..., or stdin token - for structured intent.",
|
|
353
371
|
],
|
|
@@ -506,9 +524,15 @@ const HELP_BY_COMMAND_PATH = {
|
|
|
506
524
|
};
|
|
507
525
|
export const ROOT_HELP_BUNDLE = {
|
|
508
526
|
why: "Provides deterministic project management workflows for humans and coding agents.",
|
|
509
|
-
examples: [
|
|
527
|
+
examples: [
|
|
528
|
+
"pm init",
|
|
529
|
+
"pm guide",
|
|
530
|
+
"pm list-open --limit 10",
|
|
531
|
+
'pm create --title "..." --description "..." --type Task --status open --priority 1 --message "..." --create-mode progressive',
|
|
532
|
+
],
|
|
510
533
|
tips: [
|
|
511
534
|
"Use <command> --help for command-specific guidance and examples.",
|
|
535
|
+
"Use pm guide for local docs and skills routing with progressive disclosure.",
|
|
512
536
|
"Use --json for machine parsing and integration flows.",
|
|
513
537
|
"Use --no-pager to force direct help output in CI and other non-interactive shells.",
|
|
514
538
|
],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"help-content.js","sourceRoot":"/","sources":["cli/help-content.ts"],"names":[],"mappings":"AAiBA,SAAS,uBAAuB,CAAC,MAAkB;IACjD,MAAM,KAAK,GAAa;QACtB,EAAE;QACF,SAAS;QACT,KAAK,MAAM,CAAC,GAAG,EAAE;KAClB,CAAC;IACF,IAAI,MAAM,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC/B,KAAK,CAAC,IAAI,CAAC,EAAE,EAAE,UAAU,CAAC,CAAC;QAC3B,KAAK,CAAC,IAAI,CAAC,KAAK,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;IACxC,CAAC;IACD,KAAK,CAAC,IAAI,CAAC,EAAE,EAAE,0CAA0C,CAAC,CAAC;IAC3D,KAAK,CAAC,IAAI,CAAC,0BAA0B,CAAC,CAAC;IACvC,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC;AAED,SAAS,wBAAwB,CAAC,MAAkB;IAClD,MAAM,KAAK,GAAa;QACtB,EAAE;QACF,uBAAuB;QACvB,KAAK,MAAM,CAAC,GAAG,EAAE;QACjB,EAAE;QACF,WAAW;QACX,GAAG,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,KAAK,OAAO,EAAE,CAAC;KACpD,CAAC;IACF,IAAI,MAAM,CAAC,IAAI,IAAI,MAAM,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC1C,KAAK,CAAC,IAAI,CA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AoB,CAAC,EAAE,CAAC;QACzE,kBAAkB,CAAC,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,UAAU,CAAC,CAAC;IAC/D,CAAC;AACH,CAAC","sourcesContent":["import { Command } from \"commander\";\n\nexport interface HelpBundle {\n why: string;\n examples: string[];\n tips?: string[];\n}\n\nexport interface HelpNarrative {\n intent: string;\n examples: string[];\n tips: string[];\n detail_mode: HelpDetailMode;\n}\n\nexport type HelpDetailMode = \"compact\" | \"detailed\";\n\nfunction renderCompactHelpBundle(bundle: HelpBundle): string {\n const lines: string[] = [\n \"\",\n \"Intent:\",\n ` ${bundle.why}`,\n ];\n if (bundle.examples.length > 0) {\n lines.push(\"\", \"Example:\");\n lines.push(` ${bundle.examples[0]}`);\n }\n lines.push(\"\", \"Need deeper rationale and more examples?\");\n lines.push(\" Re-run with --explain.\");\n return lines.join(\"\\n\");\n}\n\nfunction renderDetailedHelpBundle(bundle: HelpBundle): string {\n const lines: string[] = [\n \"\",\n \"Why use this command:\",\n ` ${bundle.why}`,\n \"\",\n \"Examples:\",\n ...bundle.examples.map((example) => ` ${example}`),\n ];\n if (bundle.tips && bundle.tips.length > 0) {\n lines.push(\"\", \"Tips:\");\n lines.push(...bundle.tips.map((tip) => ` - ${tip}`));\n }\n return lines.join(\"\\n\");\n}\n\nfunction renderHelpBundle(bundle: HelpBundle, detailMode: HelpDetailMode): string {\n if (detailMode === \"detailed\") {\n return renderDetailedHelpBundle(bundle);\n }\n return renderCompactHelpBundle(bundle);\n}\n\nexport function normalizeHelpCommandPath(commandPath: string): string {\n return commandPath\n .trim()\n .toLowerCase()\n .split(/\\s+/)\n .filter((part) => part.length > 0)\n .join(\" \");\n}\n\nconst HELP_PATH_ALIASES: Record<string, string> = {\n cal: \"calendar\",\n ctx: \"context\",\n};\n\nfunction findDirectChildCommand(parent: Command, name: string): Command | null {\n return parent.commands.find((entry) => entry.name() === name) ?? null;\n}\n\nfunction findCommandByPath(root: Command, pathParts: string[]): Command | null {\n let current: Command = root;\n for (const part of pathParts) {\n const next = findDirectChildCommand(current, part);\n if (!next) {\n return null;\n }\n current = next;\n }\n return current;\n}\n\nfunction attachBundleByPath(root: Command, commandPath: string, bundle: HelpBundle, detailMode: HelpDetailMode): void {\n const command = findCommandByPath(root, commandPath.split(\" \").filter((part) => part.length > 0));\n if (!command) {\n return;\n }\n command.addHelpText(\"after\", renderHelpBundle(bundle, detailMode));\n}\n\nexport function resolveHelpDetailMode(argv: string[]): HelpDetailMode {\n if (argv.includes(\"--explain\")) {\n return \"detailed\";\n }\n return \"compact\";\n}\n\nconst HELP_BY_COMMAND_PATH: Record<string, HelpBundle> = {\n init: {\n why: \"Bootstraps tracker storage and settings so all other commands can run safely.\",\n examples: ['pm init', 'pm init acme', \"pm init --preset minimal\", \"pm init --preset strict\"],\n tips: [\n \"Run this once per repository before create/list/update commands.\",\n \"Use --preset for non-interactive automation; omit it in a TTY to use the setup wizard.\",\n ],\n },\n config: {\n why: \"Reads or updates project/global settings such as definition-of-done, item format, telemetry, and policy toggles.\",\n examples: [\n 'pm config project get definition-of-done',\n 'pm config project set definition-of-done --criterion \"tests pass\"',\n \"pm config project set item-format --format toon\",\n \"pm config project set sprint-release-format-policy --policy strict_error\",\n \"pm config project set governance-preset --policy minimal\",\n \"pm config project set governance-ownership-enforcement --policy none\",\n \"pm config project set test-result-tracking --policy enabled\",\n \"pm config global set telemetry-tracking --policy disabled\",\n ],\n },\n extension: {\n why:\n \"Installs, explores, manages, diagnoses, adopts (single or bulk), and activates/deactivates custom extensions across project or global scope.\",\n examples: [\n \"pm extension init ./my-extension\",\n \"pm extension install beads --project\",\n \"pm extension install todos --global\",\n \"pm extension install .agents/pm/extensions/sample --project\",\n \"pm extension install https://github.com/unbraind/pm-cli/tree/main/.agents/pm/extensions/pi --global\",\n \"pm extension install --gh unbraind/pm-cli/pi --project\",\n \"pm extension explore --project\",\n \"pm extension manage --global\",\n \"pm extension doctor --detail deep\",\n \"pm extension adopt sample-ext --project\",\n \"pm extension adopt-all --project\",\n \"pm extension adopt sample-ext --project --gh owner/repo/path --ref main\",\n \"pm extension activate sample-ext --project\",\n \"pm extension deactivate sample-ext --project\",\n \"pm extension uninstall sample-ext --global\",\n \"pm extension --install beads --project\",\n ],\n tips: [\n \"Prefer explicit subcommands (init/scaffold/install/uninstall/explore/manage/doctor/adopt/adopt-all/activate/deactivate) for discoverability.\",\n \"Legacy lifecycle flags remain supported as backward-compatible aliases.\",\n \"Bundled aliases beads and todos resolve to package-shipped extension sources.\",\n \"Use --gh/--github shorthand for GitHub sources and --ref to pin a branch, tag, or ref.\",\n \"Install updates settings activation state automatically unless extension allowlist mode is unchanged.\",\n \"Use --adopt for single-extension adoption and --adopt-all to bulk-register unmanaged installs as managed without reinstalling.\",\n \"Use --manage for concise triage summaries and remediation-oriented diagnostics alongside full extension details.\",\n \"Use --doctor for consolidated diagnostics with warning codes, remediation hints, and optional deep detail payloads.\",\n ],\n },\n create: {\n why: \"Creates a new planning item with deterministic metadata and history.\",\n examples: [\n 'pm create --title \"Harden lock flow\" --description \"Improve stale lock handling\" --type Task --status open --priority 1 --message \"Create lock hardening task\" --create-mode progressive',\n 'pm create --title \"Weekly planning sync\" --description \"Recurring coordination meeting\" --type Meeting --schedule-preset lightweight',\n 'pm create --title \"Asset: Hero model\" --description \"Track playable model asset\" --type Asset --status open --priority 1 --message \"Create asset item\" --type-option category=Character --dep \"id=pm-epic01,kind=parent,author=codex-agent,created_at=now\" --comment \"author=codex-agent,created_at=now,text=Why this asset item exists.\" --note \"author=codex-agent,created_at=now,text=Initial implementation note.\" --learning \"author=codex-agent,created_at=now,text=Durable lesson placeholder.\" --file \"path=src/assets/hero.glb,scope=project,note=tracked asset\" --test \"command=node scripts/run-tests.mjs test,scope=project,timeout_seconds=240\" --doc \"path=README.md,scope=project,note=asset docs\"',\n ],\n tips: [\n \"Use --schedule-preset lightweight for Reminder/Meeting/Event when you want minimal required create inputs.\",\n \"Use --type <value> to load type-aware policy guidance in --help output.\",\n ],\n },\n update: {\n why: \"Mutates existing item fields while preserving history and lock safety.\",\n examples: [\n 'pm update pm-a1b2 --status in_progress --message \"Start implementation\"',\n 'pm update pm-a1b2 --unset close-reason --message \"Clear stale close reason after reopen\"',\n 'pm update pm-a1b2 --unset assignee --deadline +2d --message \"Replan ownership and deadline\"',\n 'pm update pm-a1b2 --body \"Backfilled body text for legacy item\" --message \"Normalize missing body\"',\n ],\n tips: [\n 'Use \"pm close <ID> <TEXT>\" to close items instead of --status closed.',\n \"When reopening from closed to a non-terminal status, update clears stale close_reason unless explicitly set via --close-reason.\",\n 'Use \"pm append <ID> --body <text>\" for additive notes; use update --body to replace body content.',\n ],\n },\n \"update-many\": {\n why: \"Bulk-updates matched item sets with dry-run previews and rollback checkpoints for safe large-scale metadata changes.\",\n examples: [\n \"pm update-many --filter-status open --status in_progress --dry-run\",\n 'pm update-many --filter-tag wave:7 --replace-tests --test \"command=node scripts/run-tests.mjs test -- tests/core/history.spec.ts,scope=project,timeout_seconds=240\"',\n 'pm update-many --filter-tag governance --reviewer maintainer-review --message \"Normalize reviewer metadata\"',\n \"pm update-many --rollback ckpt-abc123\",\n ],\n tips: [\n \"Use --dry-run first to inspect proposed changes before apply mode.\",\n \"Linked-array mutation flags mirror pm update semantics (for example --replace-tests, --clear-files, and repeatable --doc/--note seeds).\",\n \"Checkpoints are enabled by default for apply mode and can be restored with --rollback.\",\n ],\n },\n normalize: {\n why:\n \"Scans items for low-signal lifecycle metadata drift, emits deterministic per-item plans, and optionally applies normalized metadata updates with update-style safety checks.\",\n examples: [\n \"pm normalize --dry-run\",\n \"pm normalize --filter-status in_progress --dry-run\",\n 'pm normalize --filter-status closed --apply --author \"codex-agent\" --message \"Normalize closure metadata\"',\n ],\n tips: [\n \"Dry-run mode is the default; pass --apply only after reviewing planned changes.\",\n \"Apply mode honors ownership/audit constraints and supports --allow-audit-update with optional --force override.\",\n ],\n },\n templates: {\n why: \"Saves, lists, and inspects reusable create option bundles for repeatable workflows.\",\n examples: [\n 'pm templates save triage-default --title \"Triage item\" --description \"...\" --type Task --status open --priority 2 --message \"Seed triage template\"',\n \"pm templates list\",\n \"pm templates show triage-default\",\n ],\n tips: [\n \"Template names are positional arguments (`pm templates save <name>` and `pm templates show <name>`), not --name flags.\",\n \"Combine templates with explicit create flags; explicit flags always override template defaults.\",\n ],\n },\n deps: {\n why: \"Inspects an item dependency graph as a tree or graph payload to understand blockers and hierarchy links.\",\n examples: [\n \"pm deps pm-a1b2\",\n \"pm deps pm-a1b2 --format graph\",\n \"pm deps pm-a1b2 --max-depth 2 --collapse repeated --summary\",\n ],\n tips: [\"Use --summary for lightweight counts when full graph payloads are unnecessary.\"],\n },\n list: {\n why: \"Lists active items with deterministic filtering and ordering.\",\n examples: [\n \"pm list --limit 20\",\n \"pm list --type Task --priority 0 --tag release --assignee codex-agent\",\n \"pm list --compact --sort deadline --order asc\",\n \"pm list --fields id,title,parent,type --sort parent --order asc\",\n ],\n },\n \"list-all\": {\n why: \"Lists all item states (including terminal states) when you need full visibility.\",\n examples: [\"pm list-all --limit 50\", \"pm list-all --type Issue --include-body\"],\n },\n \"list-open\": {\n why: \"Shows work that is ready to claim and start.\",\n examples: [\"pm list-open --priority 0 --limit 10\"],\n },\n \"list-in-progress\": {\n why: \"Tracks active execution and owner progress.\",\n examples: [\"pm list-in-progress --assignee codex-agent --limit 20\"],\n },\n \"list-blocked\": {\n why: \"Surfaces blocked work that needs intervention.\",\n examples: [\"pm list-blocked --limit 20\"],\n },\n \"list-closed\": {\n why: \"Reviews completed work and closure outcomes.\",\n examples: [\"pm list-closed --limit 20 --type Task\"],\n },\n \"list-canceled\": {\n why: \"Audits intentionally discontinued work.\",\n examples: [\"pm list-canceled --limit 20\"],\n },\n \"list-draft\": {\n why: \"Finds incompletely defined items that need refinement before execution.\",\n examples: [\"pm list-draft --limit 20\"],\n },\n aggregate: {\n why: \"Runs grouped aggregation queries for governance checks such as decomposition by parent/type or triage by status/priority.\",\n examples: [\n \"pm aggregate --group-by parent,type --count\",\n \"pm aggregate --group-by type,status --count\",\n \"pm aggregate --group-by parent,type --count --status open --parent pm-feature01\",\n ],\n tips: [\"Current aggregate mode is grouped counts only, so pass --count explicitly.\"],\n },\n \"dedupe-audit\": {\n why: \"Audits potential duplicate items and emits deterministic merge suggestions before any mutation.\",\n examples: [\n \"pm dedupe-audit --mode title_exact\",\n \"pm dedupe-audit --mode title_fuzzy --threshold 0.8 --limit 20\",\n \"pm dedupe-audit --mode parent_scope --status open\",\n ],\n tips: [\"Use title_exact for strict collisions, title_fuzzy for near-duplicates, and parent_scope for child-level collisions.\"],\n },\n calendar: {\n why: \"Provides deadline/reminder/event scheduling views for planning and coordination.\",\n examples: [\n \"pm calendar\",\n \"pm calendar --view agenda --from +0d --to +7d --assignee codex-agent\",\n \"pm calendar --view week --date 2026-04-06 --full-period --include deadlines,events\",\n \"pm calendar --view month --tag release --format json\",\n ],\n tips: [\n \"Day/week/month views are anchored period windows; default mode clips the start to now unless --past or --full-period is set.\",\n \"--full-period applies only to day/week/month views; use --from/--to to bound agenda windows.\",\n ],\n },\n context: {\n why: \"Builds an agent-optimized snapshot of critical active work plus near-term agenda context with progressive depth levels.\",\n examples: [\n \"pm context\",\n \"pm ctx --depth standard --limit 10\",\n \"pm ctx --depth deep --assignee codex-agent\",\n \"pm ctx --section hierarchy --section progress --section blockers\",\n \"pm context --depth standard --activity-limit 20 --stale-threshold 14d\",\n \"pm context --from +0d --to +7d --format markdown --depth deep\",\n ],\n tips: [\n \"High-level focus contains Epics/Features and low-level focus contains Tasks/Issues/Chores/Event/Reminder/Milestone/Meeting.\",\n \"When no open or in-progress work exists, blocked items are shown as fallback context.\",\n \"--depth brief (default) shows focus+agenda; standard adds hierarchy/activity/progress/workload; deep adds blockers/files/staleness/tests.\",\n \"--section overrides --depth and selects specific sections: hierarchy, activity, progress, blockers, files, workload, staleness, tests.\",\n \"Configure defaults via pm config project set context --default-depth standard --activity-limit 15.\",\n ],\n },\n search: {\n why: \"Finds relevant items by keyword, semantic, or hybrid retrieval modes.\",\n examples: [\n 'pm search \"lock stale retry\" --mode keyword --limit 10',\n 'pm search \"extension migration blockers\" --mode hybrid --type Task --priority 0',\n 'pm search \"Cross-Epic Realism Dependency Council\" --mode keyword --title-exact',\n ],\n tips: [\n \"Use --title-exact to require exact normalized title parity, or --phrase-exact to require full-phrase matches in item text fields.\",\n \"Use --include-linked when linked docs/files/tests should influence scoring.\",\n ],\n },\n reindex: {\n why: \"Rebuilds search artifacts after large changes to item corpus or provider/vector config.\",\n examples: [\"pm reindex --mode keyword\", \"pm reindex --mode hybrid\"],\n },\n get: {\n why: \"Shows complete details for one item by ID.\",\n examples: [\"pm get pm-a1b2\", \"pm get pm-a1b2 --json\"],\n tips: [\"JSON output shape is { item, body, linked, claim_state }; body is top-level (not item.body).\"],\n },\n history: {\n why: \"Inspects item mutation timeline and audit trail.\",\n examples: [\"pm history pm-a1b2 --limit 20\"],\n },\n activity: {\n why: \"Reviews recent tracker-wide activity across items.\",\n examples: [\n \"pm activity --limit 50\",\n \"pm activity --id pm-a1b2 --op update --author codex-agent --from -7d --to now\",\n \"pm activity --json --stream rows --limit 200\",\n ],\n tips: [\"Use --stream with --json for line-delimited automation output; --from is inclusive and --to is exclusive.\"],\n },\n restore: {\n why: \"Restores an item to a prior timestamp/version with history replay safety.\",\n examples: ['pm restore pm-a1b2 2026-04-01T00:00:00.000Z --author \"codex-agent\" --message \"Rollback to known-good state\"'],\n },\n close: {\n why: \"Transitions work to terminal closed state with explicit rationale.\",\n examples: [\n 'pm close pm-a1b2 \"All acceptance criteria met\" --author \"codex-agent\" --message \"Close after verification\"',\n 'pm close pm-a1b2 \"Done\" --validate-close',\n 'pm close pm-a1b2 \"Done\" --validate-close off',\n 'pm close pm-a1b2 \"Done\" --validate-close strict',\n ],\n },\n delete: {\n why: \"Removes an item while preserving history evidence and lock/ownership checks.\",\n examples: ['pm delete pm-a1b2 --author \"codex-agent\" --message \"Remove duplicate item\"'],\n },\n append: {\n why: \"Adds implementation notes to body without replacing existing content.\",\n examples: ['pm append pm-a1b2 --body \"Implemented retry with bounded backoff.\" --message \"Record implementation detail\"'],\n },\n comments: {\n why: \"Adds or reviews lightweight status updates linked to an item.\",\n examples: [\n 'pm comments pm-a1b2 --add \"Verified fix on Linux and macOS\"',\n 'pm comments pm-a1b2 --add \"text: verification note with commas, key-like words, and parser details\"',\n 'pm comments pm-a1b2 --add \"Follow-up needed after review\" --author \"codex-agent\" --force',\n \"pm comments pm-a1b2 --limit 10\",\n ],\n tips: [\n \"Use --force when adding comments to items currently assigned to a different owner.\",\n \"When --add payload resembles CSV-like key fragments (for example text=hello,scope:project), plain-text fallback is intentional; use explicit text=..., markdown text: ..., or stdin token - for structured intent.\",\n ],\n },\n \"comments-audit\": {\n why: \"Audits latest comments or full history rows across filtered item sets.\",\n examples: [\n \"pm comments-audit --status open --latest 1\",\n \"pm comments-audit --status open --latest 0\",\n \"pm comments-audit --parent pm-feature01 --tag governance --sprint sprint-12 --release vnext --priority 0\",\n \"pm comments-audit --full-history --limit 50\",\n ],\n tips: [\n \"Use either --latest or --full-history (not both). --latest 0 returns item summaries without comment rows. --limit is an alias for --limit-items.\",\n ],\n },\n notes: {\n why: \"Adds or reviews durable implementation notes linked to an item.\",\n examples: [\n 'pm notes pm-a1b2 --add \"Investigated parser edge case and documented fallback logic.\"',\n 'pm notes pm-a1b2 --add \"text: parser rationale with commas, colons, and key-like wording\"',\n 'pm notes pm-a1b2 --add \"Audit note\" --author \"reviewer\" --allow-audit-note',\n \"pm notes pm-a1b2 --limit 10\",\n ],\n tips: [\n \"Use --allow-audit-note for append-only non-owner audits; --allow-audit-comment remains supported as a legacy alias.\",\n \"CSV-like add payloads with extra key fragments are treated as plain text by design; use explicit text keys (text= or text:) when structured parsing is required.\",\n ],\n },\n learnings: {\n why: \"Adds or reviews post-implementation learnings for future work.\",\n examples: [\n 'pm learnings pm-a1b2 --add \"Avoid direct test-runner commands in linked tests; use sandbox runner.\"',\n 'pm learnings pm-a1b2 --add \"text: lesson with commas, key-like words, and punctuation-safe context\"',\n 'pm learnings pm-a1b2 --add \"Audit learning\" --author \"reviewer\" --allow-audit-learning',\n \"pm learnings pm-a1b2 --limit 10\",\n ],\n tips: [\n \"Use --allow-audit-learning for append-only non-owner audits; --allow-audit-comment remains supported as a legacy alias.\",\n \"If you intended structured parsing for a key-like payload, prefer explicit text=..., markdown text: ..., or stdin token -; ambiguous CSV-like forms intentionally remain plain text.\",\n ],\n },\n files: {\n why: \"Associates changed source files with tracker items for reproducibility.\",\n examples: [\n 'pm files pm-a1b2 --add \"path=src/cli/main.ts,scope=project,note=help orchestration\"',\n \"pm files discover pm-a1b2\",\n 'pm files discover pm-a1b2 --apply --note \"discovered from item text\"',\n ],\n },\n docs: {\n why: \"Associates relevant documentation paths with tracker items.\",\n examples: ['pm docs pm-a1b2 --add \"path=README.md,scope=project,note=user-facing command guidance\"'],\n },\n test: {\n why: \"Links test commands/paths and optionally executes them for one item.\",\n examples: [\n 'pm test pm-a1b2 --add \"command=node scripts/run-tests.mjs test -- tests/unit/output.spec.ts,scope=project,timeout_seconds=2400\"',\n 'pm test pm-a1b2 --add \"command=pm list-all --type Task --limit 200,scope=project,assert_stdout_contains=count:,assert_stdout_regex=count:\\\\s+\\\\d+\"',\n 'pm test pm-a1b2 --add \"command=pm list-all --type Task --limit 200,scope=project,pm_context_mode=auto\"',\n \"pm test pm-a1b2 --run --timeout 2400 --env-set PORT=0 --env-clear PLAYWRIGHT_BASE_URL --shared-host-safe --pm-context tracker --fail-on-context-mismatch --fail-on-skipped\",\n \"pm test pm-a1b2 --run --timeout 2400 --pm-context auto\",\n \"pm test pm-a1b2 --run --background --timeout 2400 --progress\",\n ],\n },\n \"test-all\": {\n why: \"Runs linked tests in bulk for release/readiness sweeps.\",\n examples: [\n \"pm test-all --status in_progress --limit 5 --offset 10 --timeout 2400\",\n \"pm test-all --status closed --timeout 3600 --progress --env-set PORT=0 --shared-host-safe --fail-on-skipped\",\n \"pm test-all --status in_progress --pm-context tracker --fail-on-context-mismatch --require-assertions-for-pm\",\n \"pm test-all --status in_progress --pm-context auto --fail-on-context-mismatch\",\n \"pm test-all --status in_progress --background --timeout 3600\",\n ],\n },\n \"test-runs\": {\n why: \"Manages background linked-test runs with lifecycle controls and log/status inspection.\",\n examples: [\n \"pm test-runs list --status running --limit 20\",\n \"pm test-runs status tr-abc123\",\n \"pm test-runs logs tr-abc123 --stream stderr --tail 200\",\n \"pm test-runs stop tr-abc123\",\n \"pm test-runs resume tr-abc123\",\n ],\n },\n stats: {\n why: \"Reports tracker-level totals and distribution by type/status.\",\n examples: [\"pm stats\", \"pm stats --json\"],\n },\n health: {\n why: \"Validates tracker/runtime health including extension triage, migration, and integrity diagnostics.\",\n examples: [\"pm health\", \"pm health --json\", \"pm health --check-only\", \"pm health --no-refresh\", \"pm health --refresh-vectors\"],\n },\n validate: {\n why:\n \"Runs standalone metadata, resolution, lifecycle (including dependency-cycle diagnostics), linked-file, linked-command reference, and history drift checks with default remediation hints for resolution gaps.\",\n examples: [\n \"pm validate\",\n \"pm validate --check-resolution --json\",\n \"pm validate --check-lifecycle --dependency-cycle-severity error\",\n \"pm validate --check-files --scan-mode tracked-all\",\n \"pm validate --check-files --scan-mode tracked-all-strict --include-pm-internals\",\n \"pm validate --check-command-references\",\n \"pm validate --check-resolution --fail-on-warn --json\",\n ],\n tips: [\"Resolution-gap warnings include default `pm update <id> ...` remediation hint templates in check details.\"],\n },\n gc: {\n why: \"Cleans optional cache artifacts to keep local tracker state tidy.\",\n examples: [\"pm gc\"],\n },\n claim: {\n why: \"Claims an item to signal active ownership and reduce conflicts.\",\n examples: [\n 'pm claim pm-a1b2 --author \"codex-agent\" --message \"Claim for implementation\"',\n 'pm claim pm-a1b2 --force --author \"codex-agent\" --message \"Take over terminal item\"',\n ],\n tips: [\"Claim takeover for non-terminal items does not require --force; --force is reserved for terminal/lock overrides.\"],\n },\n release: {\n why: \"Releases an active claim when paused, handed off, or completed.\",\n examples: [\n 'pm release pm-a1b2 --author \"codex-agent\" --message \"Release after closure\"',\n 'pm release pm-a1b2 --allow-audit-release --author \"reviewer\" --message \"Audit handoff release\"',\n ],\n tips: [\"Use --allow-audit-release for non-owner handoffs that only clear assignee metadata.\"],\n },\n \"start-task\": {\n why: \"Lifecycle alias that claims an item and sets status to in_progress.\",\n examples: ['pm start-task pm-a1b2 --author \"codex-agent\" --message \"Start implementation\"'],\n },\n \"pause-task\": {\n why: \"Lifecycle alias that sets status to open and releases active assignment.\",\n examples: ['pm pause-task pm-a1b2 --author \"codex-agent\" --message \"Pause for dependency unblock\"'],\n },\n \"close-task\": {\n why: \"Lifecycle alias that closes with reason text and clears assignment metadata.\",\n examples: ['pm close-task pm-a1b2 \"All acceptance criteria met\" --author \"codex-agent\" --message \"Close and handoff\"'],\n },\n completion: {\n why: \"Generates shell completion scripts for faster and more reliable command entry.\",\n examples: [\"pm completion bash\", \"pm completion zsh\", \"pm completion fish\", \"pm completion bash --eager-tags\"],\n tips: [\"Default scripts resolve tag suggestions lazily at completion time; use --eager-tags to embed current tags directly.\"],\n },\n contracts: {\n why: \"Exposes machine-readable CLI command and tool schema contracts for agent integrations.\",\n examples: [\n \"pm contracts\",\n \"pm contracts --command list --runtime-only\",\n \"pm contracts --command update --flags-only\",\n \"pm contracts --availability-only --runtime-only\",\n \"pm contracts --action create\",\n \"pm contracts --schema-only\",\n ],\n tips: [\"Use --command to narrow actions/schema to one CLI surface; combine with --flags-only or --availability-only for lighter payloads.\"],\n },\n};\n\nexport const ROOT_HELP_BUNDLE: HelpBundle = {\n why: \"Provides deterministic project management workflows for humans and coding agents.\",\n examples: [\"pm init\", \"pm list-open --limit 10\", 'pm create --title \"...\" --description \"...\" --type Task --status open --priority 1 --message \"...\" --create-mode progressive'],\n tips: [\n \"Use <command> --help for command-specific guidance and examples.\",\n \"Use --json for machine parsing and integration flows.\",\n \"Use --no-pager to force direct help output in CI and other non-interactive shells.\",\n ],\n};\n\nfunction resolveCanonicalHelpPath(commandPath: string | undefined): string {\n const normalized = normalizeHelpCommandPath(commandPath ?? \"\");\n if (!normalized) {\n return \"\";\n }\n return HELP_PATH_ALIASES[normalized] ?? normalized;\n}\n\nexport function resolveHelpBundleForPath(commandPath: string | undefined): HelpBundle {\n const canonicalPath = resolveCanonicalHelpPath(commandPath);\n if (!canonicalPath) {\n return ROOT_HELP_BUNDLE;\n }\n return HELP_BY_COMMAND_PATH[canonicalPath] ?? ROOT_HELP_BUNDLE;\n}\n\nexport function resolveHelpNarrative(commandPath: string | undefined, detailMode: HelpDetailMode): HelpNarrative {\n const bundle = resolveHelpBundleForPath(commandPath);\n return {\n intent: bundle.why,\n examples: detailMode === \"detailed\" ? [...bundle.examples] : bundle.examples.length > 0 ? [bundle.examples[0]] : [],\n tips: detailMode === \"detailed\" ? [...(bundle.tips ?? [])] : [],\n detail_mode: detailMode,\n };\n}\n\nexport function listDocumentedHelpPaths(): string[] {\n return Object.keys(HELP_BY_COMMAND_PATH).sort((left, right) => left.localeCompare(right));\n}\n\nexport function attachRichHelpText(program: Command, argv: string[] = process.argv.slice(2)): void {\n const detailMode = resolveHelpDetailMode(argv);\n program.addHelpText(\"after\", renderHelpBundle(ROOT_HELP_BUNDLE, detailMode));\n for (const [commandPath, bundle] of Object.entries(HELP_BY_COMMAND_PATH)) {\n attachBundleByPath(program, commandPath, bundle, detailMode);\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"help-content.js","sourceRoot":"/","sources":["cli/help-content.ts"],"names":[],"mappings":"AAiBA,SAAS,uBAAuB,CAAC,MAAkB;IACjD,MAAM,KAAK,GAAa;QACtB,EAAE;QACF,SAAS;QACT,KAAK,MAAM,CAAC,GAAG,EAAE;KAClB,CAAC;IACF,IAAI,MAAM,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC/B,KAAK,CAAC,IAAI,CAAC,EAAE,EAAE,UAAU,CAAC,CAAC;QAC3B,KAAK,CAAC,IAAI,CAAC,KAAK,MAAM,CAAC,QAAQ,CA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C,CAAC,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE;QACnH,IAAI,EAAE,UAAU,KAAK,UAAU,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE;QAC/D,WAAW,EAAE,UAAU;KACxB,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,uBAAuB;IACrC,OAAO,MAAM,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC,CAAC;AAC5F,CAAC;AAED,MAAM,UAAU,kBAAkB,CAAC,OAAgB,EAAE,OAAiB,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;IACzF,MAAM,UAAU,GAAG,qBAAqB,CAAC,IAAI,CAAC,CAAC;IAC/C,OAAO,CAAC,WAAW,CAAC,OAAO,EAAE,gBAAgB,CAAC,gBAAgB,EAAE,UAAU,CAAC,CAAC,CAAC;IAC7E,KAAK,MAAM,CAAC,WAAW,EAAE,MAAM,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,oBAAoB,CAAC,EAAE,CAAC;QACzE,kBAAkB,CAAC,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,UAAU,CAAC,CAAC;IAC/D,CAAC;AACH,CAAC","sourcesContent":["import { Command } from \"commander\";\n\nexport interface HelpBundle {\n why: string;\n examples: string[];\n tips?: string[];\n}\n\nexport interface HelpNarrative {\n intent: string;\n examples: string[];\n tips: string[];\n detail_mode: HelpDetailMode;\n}\n\nexport type HelpDetailMode = \"compact\" | \"detailed\";\n\nfunction renderCompactHelpBundle(bundle: HelpBundle): string {\n const lines: string[] = [\n \"\",\n \"Intent:\",\n ` ${bundle.why}`,\n ];\n if (bundle.examples.length > 0) {\n lines.push(\"\", \"Example:\");\n lines.push(` ${bundle.examples[0]}`);\n }\n lines.push(\"\", \"Need deeper rationale and more examples?\");\n lines.push(\" Re-run with --explain.\");\n return lines.join(\"\\n\");\n}\n\nfunction renderDetailedHelpBundle(bundle: HelpBundle): string {\n const lines: string[] = [\n \"\",\n \"Why use this command:\",\n ` ${bundle.why}`,\n \"\",\n \"Examples:\",\n ...bundle.examples.map((example) => ` ${example}`),\n ];\n if (bundle.tips && bundle.tips.length > 0) {\n lines.push(\"\", \"Tips:\");\n lines.push(...bundle.tips.map((tip) => ` - ${tip}`));\n }\n return lines.join(\"\\n\");\n}\n\nfunction renderHelpBundle(bundle: HelpBundle, detailMode: HelpDetailMode): string {\n if (detailMode === \"detailed\") {\n return renderDetailedHelpBundle(bundle);\n }\n return renderCompactHelpBundle(bundle);\n}\n\nexport function normalizeHelpCommandPath(commandPath: string): string {\n return commandPath\n .trim()\n .toLowerCase()\n .split(/\\s+/)\n .filter((part) => part.length > 0)\n .join(\" \");\n}\n\nconst HELP_PATH_ALIASES: Record<string, string> = {\n cal: \"calendar\",\n ctx: \"context\",\n};\n\nfunction findDirectChildCommand(parent: Command, name: string): Command | null {\n return parent.commands.find((entry) => entry.name() === name) ?? null;\n}\n\nfunction findCommandByPath(root: Command, pathParts: string[]): Command | null {\n let current: Command = root;\n for (const part of pathParts) {\n const next = findDirectChildCommand(current, part);\n if (!next) {\n return null;\n }\n current = next;\n }\n return current;\n}\n\nfunction attachBundleByPath(root: Command, commandPath: string, bundle: HelpBundle, detailMode: HelpDetailMode): void {\n const command = findCommandByPath(root, commandPath.split(\" \").filter((part) => part.length > 0));\n if (!command) {\n return;\n }\n command.addHelpText(\"after\", renderHelpBundle(bundle, detailMode));\n}\n\nexport function resolveHelpDetailMode(argv: string[]): HelpDetailMode {\n if (argv.includes(\"--explain\")) {\n return \"detailed\";\n }\n return \"compact\";\n}\n\nconst HELP_BY_COMMAND_PATH: Record<string, HelpBundle> = {\n init: {\n why: \"Bootstraps tracker storage and settings so all other commands can run safely.\",\n examples: ['pm init', 'pm init acme', \"pm init --preset minimal\", \"pm init --preset strict\"],\n tips: [\n \"Run this once per repository before create/list/update commands.\",\n \"Use --preset for non-interactive automation; omit it in a TTY to use the setup wizard.\",\n ],\n },\n config: {\n why: \"Reads or updates project/global settings such as definition-of-done, item format, telemetry, and policy toggles.\",\n examples: [\n 'pm config project get definition-of-done',\n 'pm config project set definition-of-done --criterion \"tests pass\"',\n \"pm config project set item-format --format toon\",\n \"pm config project set sprint-release-format-policy --policy strict_error\",\n \"pm config project set governance-preset --policy minimal\",\n \"pm config project set governance-ownership-enforcement --policy none\",\n \"pm config project set test-result-tracking --policy enabled\",\n \"pm config global set telemetry-tracking --policy disabled\",\n ],\n },\n extension: {\n why:\n \"Installs, explores, manages, diagnoses, adopts (single or bulk), and activates/deactivates custom extensions across project or global scope.\",\n examples: [\n \"pm extension init ./my-extension\",\n \"pm extension install beads --project\",\n \"pm extension install todos --global\",\n \"pm extension install .agents/pm/extensions/sample --project\",\n \"pm extension install https://github.com/unbraind/pm-cli/tree/main/.agents/pm/extensions/pi --global\",\n \"pm extension install --gh unbraind/pm-cli/pi --project\",\n \"pm extension explore --project\",\n \"pm extension manage --global\",\n \"pm extension doctor --detail deep\",\n \"pm extension adopt sample-ext --project\",\n \"pm extension adopt-all --project\",\n \"pm extension adopt sample-ext --project --gh owner/repo/path --ref main\",\n \"pm extension activate sample-ext --project\",\n \"pm extension deactivate sample-ext --project\",\n \"pm extension uninstall sample-ext --global\",\n \"pm extension --install beads --project\",\n ],\n tips: [\n \"Prefer explicit subcommands (init/scaffold/install/uninstall/explore/manage/doctor/adopt/adopt-all/activate/deactivate) for discoverability.\",\n \"Legacy lifecycle flags remain supported as backward-compatible aliases.\",\n \"Bundled aliases beads and todos resolve to package-shipped extension sources.\",\n \"Use --gh/--github shorthand for GitHub sources and --ref to pin a branch, tag, or ref.\",\n \"Install updates settings activation state automatically unless extension allowlist mode is unchanged.\",\n \"Use --adopt for single-extension adoption and --adopt-all to bulk-register unmanaged installs as managed without reinstalling.\",\n \"Use --manage for concise triage summaries and remediation-oriented diagnostics alongside full extension details.\",\n \"Use --doctor for consolidated diagnostics with warning codes, remediation hints, and optional deep detail payloads.\",\n ],\n },\n create: {\n why: \"Creates a new planning item with deterministic metadata and history.\",\n examples: [\n 'pm create --title \"Harden lock flow\" --description \"Improve stale lock handling\" --type Task --status open --priority 1 --message \"Create lock hardening task\" --create-mode progressive',\n 'pm create --title \"Weekly planning sync\" --description \"Recurring coordination meeting\" --type Meeting --schedule-preset lightweight',\n 'pm create --title \"Asset: Hero model\" --description \"Track playable model asset\" --type Asset --status open --priority 1 --message \"Create asset item\" --type-option category=Character --dep \"id=pm-epic01,kind=parent,author=codex-agent,created_at=now\" --comment \"author=codex-agent,created_at=now,text=Why this asset item exists.\" --note \"author=codex-agent,created_at=now,text=Initial implementation note.\" --learning \"author=codex-agent,created_at=now,text=Durable lesson placeholder.\" --file \"path=src/assets/hero.glb,scope=project,note=tracked asset\" --test \"command=node scripts/run-tests.mjs test,scope=project,timeout_seconds=240\" --doc \"path=README.md,scope=project,note=asset docs\"',\n ],\n tips: [\n \"Use --schedule-preset lightweight for Reminder/Meeting/Event when you want minimal required create inputs.\",\n \"Use --type <value> to load type-aware policy guidance in --help output.\",\n ],\n },\n update: {\n why: \"Mutates existing item fields while preserving history and lock safety.\",\n examples: [\n 'pm update pm-a1b2 --status in_progress --message \"Start implementation\"',\n 'pm update pm-a1b2 --unset close-reason --message \"Clear stale close reason after reopen\"',\n 'pm update pm-a1b2 --unset assignee --deadline +2d --message \"Replan ownership and deadline\"',\n 'pm update pm-a1b2 --body \"Backfilled body text for legacy item\" --message \"Normalize missing body\"',\n ],\n tips: [\n 'Use \"pm close <ID> <TEXT>\" to close items instead of --status closed.',\n \"When reopening from closed to a non-terminal status, update clears stale close_reason unless explicitly set via --close-reason.\",\n 'Use \"pm append <ID> --body <text>\" for additive notes; use update --body to replace body content.',\n ],\n },\n \"update-many\": {\n why: \"Bulk-updates matched item sets with dry-run previews and rollback checkpoints for safe large-scale metadata changes.\",\n examples: [\n \"pm update-many --filter-status open --status in_progress --dry-run\",\n 'pm update-many --filter-tag wave:7 --replace-tests --test \"command=node scripts/run-tests.mjs test -- tests/core/history.spec.ts,scope=project,timeout_seconds=240\"',\n 'pm update-many --filter-tag governance --reviewer maintainer-review --message \"Normalize reviewer metadata\"',\n \"pm update-many --rollback ckpt-abc123\",\n ],\n tips: [\n \"Use --dry-run first to inspect proposed changes before apply mode.\",\n \"Linked-array mutation flags mirror pm update semantics (for example --replace-tests, --clear-files, and repeatable --doc/--note seeds).\",\n \"Checkpoints are enabled by default for apply mode and can be restored with --rollback.\",\n ],\n },\n normalize: {\n why:\n \"Scans items for low-signal lifecycle metadata drift, emits deterministic per-item plans, and optionally applies normalized metadata updates with update-style safety checks.\",\n examples: [\n \"pm normalize --dry-run\",\n \"pm normalize --filter-status in_progress --dry-run\",\n 'pm normalize --filter-status closed --apply --author \"codex-agent\" --message \"Normalize closure metadata\"',\n ],\n tips: [\n \"Dry-run mode is the default; pass --apply only after reviewing planned changes.\",\n \"Apply mode honors ownership/audit constraints and supports --allow-audit-update with optional --force override.\",\n ],\n },\n templates: {\n why: \"Saves, lists, and inspects reusable create option bundles for repeatable workflows.\",\n examples: [\n 'pm templates save triage-default --title \"Triage item\" --description \"...\" --type Task --status open --priority 2 --message \"Seed triage template\"',\n \"pm templates list\",\n \"pm templates show triage-default\",\n ],\n tips: [\n \"Template names are positional arguments (`pm templates save <name>` and `pm templates show <name>`), not --name flags.\",\n \"Combine templates with explicit create flags; explicit flags always override template defaults.\",\n ],\n },\n deps: {\n why: \"Inspects an item dependency graph as a tree or graph payload to understand blockers and hierarchy links.\",\n examples: [\n \"pm deps pm-a1b2\",\n \"pm deps pm-a1b2 --format graph\",\n \"pm deps pm-a1b2 --max-depth 2 --collapse repeated --summary\",\n ],\n tips: [\"Use --summary for lightweight counts when full graph payloads are unnecessary.\"],\n },\n list: {\n why: \"Lists active items with deterministic filtering and ordering.\",\n examples: [\n \"pm list --limit 20\",\n \"pm list --type Task --priority 0 --tag release --assignee codex-agent\",\n \"pm list --compact --sort deadline --order asc\",\n \"pm list --fields id,title,parent,type --sort parent --order asc\",\n ],\n },\n \"list-all\": {\n why: \"Lists all item states (including terminal states) when you need full visibility.\",\n examples: [\"pm list-all --limit 50\", \"pm list-all --type Issue --include-body\"],\n },\n \"list-open\": {\n why: \"Shows work that is ready to claim and start.\",\n examples: [\"pm list-open --priority 0 --limit 10\"],\n },\n \"list-in-progress\": {\n why: \"Tracks active execution and owner progress.\",\n examples: [\"pm list-in-progress --assignee codex-agent --limit 20\"],\n },\n \"list-blocked\": {\n why: \"Surfaces blocked work that needs intervention.\",\n examples: [\"pm list-blocked --limit 20\"],\n },\n \"list-closed\": {\n why: \"Reviews completed work and closure outcomes.\",\n examples: [\"pm list-closed --limit 20 --type Task\"],\n },\n \"list-canceled\": {\n why: \"Audits intentionally discontinued work.\",\n examples: [\"pm list-canceled --limit 20\"],\n },\n \"list-draft\": {\n why: \"Finds incompletely defined items that need refinement before execution.\",\n examples: [\"pm list-draft --limit 20\"],\n },\n aggregate: {\n why: \"Runs grouped aggregation queries for governance checks such as decomposition by parent/type or triage by status/priority.\",\n examples: [\n \"pm aggregate --group-by parent,type --count\",\n \"pm aggregate --group-by type,status --count\",\n \"pm aggregate --group-by parent,type --count --status open --parent pm-feature01\",\n ],\n tips: [\"Current aggregate mode is grouped counts only, so pass --count explicitly.\"],\n },\n \"dedupe-audit\": {\n why: \"Audits potential duplicate items and emits deterministic merge suggestions before any mutation.\",\n examples: [\n \"pm dedupe-audit --mode title_exact\",\n \"pm dedupe-audit --mode title_fuzzy --threshold 0.8 --limit 20\",\n \"pm dedupe-audit --mode parent_scope --status open\",\n ],\n tips: [\"Use title_exact for strict collisions, title_fuzzy for near-duplicates, and parent_scope for child-level collisions.\"],\n },\n guide: {\n why: \"Routes local progressive-disclosure documentation so agents can fetch only the context they need.\",\n examples: [\n \"pm guide\",\n \"pm guide quickstart\",\n \"pm guide commands --depth standard\",\n \"pm guide skills --depth deep --format markdown\",\n \"pm guide release --json\",\n ],\n tips: [\n \"Use brief depth for minimal token footprint, standard for excerpted docs, and deep for full local document rendering.\",\n \"Use --list to force topic index output even when topic parsing is ambiguous.\",\n ],\n },\n calendar: {\n why: \"Provides deadline/reminder/event scheduling views for planning and coordination.\",\n examples: [\n \"pm calendar\",\n \"pm calendar --view agenda --from +0d --to +7d --assignee codex-agent\",\n \"pm calendar --view week --date 2026-04-06 --full-period --include deadlines,events\",\n \"pm calendar --view month --tag release --format json\",\n ],\n tips: [\n \"Day/week/month views are anchored period windows; default mode clips the start to now unless --past or --full-period is set.\",\n \"--full-period applies only to day/week/month views; use --from/--to to bound agenda windows.\",\n ],\n },\n context: {\n why: \"Builds an agent-optimized snapshot of critical active work plus near-term agenda context with progressive depth levels.\",\n examples: [\n \"pm context\",\n \"pm ctx --depth standard --limit 10\",\n \"pm ctx --depth deep --assignee codex-agent\",\n \"pm ctx --section hierarchy --section progress --section blockers\",\n \"pm context --depth standard --activity-limit 20 --stale-threshold 14d\",\n \"pm context --from +0d --to +7d --format markdown --depth deep\",\n ],\n tips: [\n \"High-level focus contains Epics/Features and low-level focus contains Tasks/Issues/Chores/Event/Reminder/Milestone/Meeting.\",\n \"When no open or in-progress work exists, blocked items are shown as fallback context.\",\n \"--depth brief (default) shows focus+agenda; standard adds hierarchy/activity/progress/workload; deep adds blockers/files/staleness/tests.\",\n \"--section overrides --depth and selects specific sections: hierarchy, activity, progress, blockers, files, workload, staleness, tests.\",\n \"Configure defaults via pm config project set context --default-depth standard --activity-limit 15.\",\n ],\n },\n search: {\n why: \"Finds relevant items by keyword, semantic, or hybrid retrieval modes.\",\n examples: [\n 'pm search \"lock stale retry\" --mode keyword --limit 10',\n 'pm search \"extension migration blockers\" --mode hybrid --type Task --priority 0',\n 'pm search \"Cross-Epic Realism Dependency Council\" --mode keyword --title-exact',\n ],\n tips: [\n \"Use --title-exact to require exact normalized title parity, or --phrase-exact to require full-phrase matches in item text fields.\",\n \"Use --include-linked when linked docs/files/tests should influence scoring.\",\n ],\n },\n reindex: {\n why: \"Rebuilds search artifacts after large changes to item corpus or provider/vector config.\",\n examples: [\"pm reindex --mode keyword\", \"pm reindex --mode hybrid\"],\n },\n get: {\n why: \"Shows complete details for one item by ID.\",\n examples: [\"pm get pm-a1b2\", \"pm get pm-a1b2 --json\"],\n tips: [\"JSON output shape is { item, body, linked, claim_state }; body is top-level (not item.body).\"],\n },\n history: {\n why: \"Inspects item mutation timeline and audit trail.\",\n examples: [\"pm history pm-a1b2 --limit 20\"],\n },\n activity: {\n why: \"Reviews recent tracker-wide activity across items.\",\n examples: [\n \"pm activity --limit 50\",\n \"pm activity --id pm-a1b2 --op update --author codex-agent --from -7d --to now\",\n \"pm activity --json --stream rows --limit 200\",\n ],\n tips: [\"Use --stream with --json for line-delimited automation output; --from is inclusive and --to is exclusive.\"],\n },\n restore: {\n why: \"Restores an item to a prior timestamp/version with history replay safety.\",\n examples: ['pm restore pm-a1b2 2026-04-01T00:00:00.000Z --author \"codex-agent\" --message \"Rollback to known-good state\"'],\n },\n close: {\n why: \"Transitions work to terminal closed state with explicit rationale.\",\n examples: [\n 'pm close pm-a1b2 \"All acceptance criteria met\" --author \"codex-agent\" --message \"Close after verification\"',\n 'pm close pm-a1b2 \"Done\" --validate-close',\n 'pm close pm-a1b2 \"Done\" --validate-close off',\n 'pm close pm-a1b2 \"Done\" --validate-close strict',\n ],\n },\n delete: {\n why: \"Removes an item while preserving history evidence and lock/ownership checks.\",\n examples: ['pm delete pm-a1b2 --author \"codex-agent\" --message \"Remove duplicate item\"'],\n },\n append: {\n why: \"Adds implementation notes to body without replacing existing content.\",\n examples: ['pm append pm-a1b2 --body \"Implemented retry with bounded backoff.\" --message \"Record implementation detail\"'],\n },\n comments: {\n why: \"Adds or reviews lightweight status updates linked to an item.\",\n examples: [\n 'pm comments pm-a1b2 \"Verified fix on Linux and macOS\"',\n 'pm comments pm-a1b2 --add \"Verified fix on Linux and macOS\"',\n 'printf \"%s\\\\n\" \"## Verification\" \"- linux pass\" \"- mac pass\" | pm comments pm-a1b2 --stdin',\n 'pm comments pm-a1b2 --file docs/release-evidence.md --author \"codex-agent\"',\n 'pm comments pm-a1b2 --add \"text: verification note with commas, key-like words, and parser details\"',\n 'pm comments pm-a1b2 --add \"Follow-up needed after review\" --author \"codex-agent\" --force',\n \"pm comments pm-a1b2 --limit 10\",\n ],\n tips: [\n \"Use exactly one comment source at a time: positional [text], --add, --stdin, or --file.\",\n \"Use --force when adding comments to items currently assigned to a different owner.\",\n \"When --add payload resembles CSV-like key fragments (for example text=hello,scope:project), plain-text fallback is intentional; use explicit text=..., markdown text: ..., or stdin token - for structured intent.\",\n ],\n },\n \"comments-audit\": {\n why: \"Audits latest comments or full history rows across filtered item sets.\",\n examples: [\n \"pm comments-audit --status open --latest 1\",\n \"pm comments-audit --status open --latest 0\",\n \"pm comments-audit --parent pm-feature01 --tag governance --sprint sprint-12 --release vnext --priority 0\",\n \"pm comments-audit --full-history --limit 50\",\n ],\n tips: [\n \"Use either --latest or --full-history (not both). --latest 0 returns item summaries without comment rows. --limit is an alias for --limit-items.\",\n ],\n },\n notes: {\n why: \"Adds or reviews durable implementation notes linked to an item.\",\n examples: [\n 'pm notes pm-a1b2 --add \"Investigated parser edge case and documented fallback logic.\"',\n 'pm notes pm-a1b2 --add \"text: parser rationale with commas, colons, and key-like wording\"',\n 'pm notes pm-a1b2 --add \"Audit note\" --author \"reviewer\" --allow-audit-note',\n \"pm notes pm-a1b2 --limit 10\",\n ],\n tips: [\n \"Use --allow-audit-note for append-only non-owner audits; --allow-audit-comment remains supported as a legacy alias.\",\n \"CSV-like add payloads with extra key fragments are treated as plain text by design; use explicit text keys (text= or text:) when structured parsing is required.\",\n ],\n },\n learnings: {\n why: \"Adds or reviews post-implementation learnings for future work.\",\n examples: [\n 'pm learnings pm-a1b2 --add \"Avoid direct test-runner commands in linked tests; use sandbox runner.\"',\n 'pm learnings pm-a1b2 --add \"text: lesson with commas, key-like words, and punctuation-safe context\"',\n 'pm learnings pm-a1b2 --add \"Audit learning\" --author \"reviewer\" --allow-audit-learning',\n \"pm learnings pm-a1b2 --limit 10\",\n ],\n tips: [\n \"Use --allow-audit-learning for append-only non-owner audits; --allow-audit-comment remains supported as a legacy alias.\",\n \"If you intended structured parsing for a key-like payload, prefer explicit text=..., markdown text: ..., or stdin token -; ambiguous CSV-like forms intentionally remain plain text.\",\n ],\n },\n files: {\n why: \"Associates changed source files with tracker items for reproducibility.\",\n examples: [\n 'pm files pm-a1b2 --add \"path=src/cli/main.ts,scope=project,note=help orchestration\"',\n \"pm files discover pm-a1b2\",\n 'pm files discover pm-a1b2 --apply --note \"discovered from item text\"',\n ],\n },\n docs: {\n why: \"Associates relevant documentation paths with tracker items.\",\n examples: ['pm docs pm-a1b2 --add \"path=README.md,scope=project,note=user-facing command guidance\"'],\n },\n test: {\n why: \"Links test commands/paths and optionally executes them for one item.\",\n examples: [\n 'pm test pm-a1b2 --add \"command=node scripts/run-tests.mjs test -- tests/unit/output.spec.ts,scope=project,timeout_seconds=2400\"',\n 'pm test pm-a1b2 --add \"command=pm list-all --type Task --limit 200,scope=project,assert_stdout_contains=count:,assert_stdout_regex=count:\\\\s+\\\\d+\"',\n 'pm test pm-a1b2 --add \"command=pm list-all --type Task --limit 200,scope=project,pm_context_mode=auto\"',\n \"pm test pm-a1b2 --run --timeout 2400 --env-set PORT=0 --env-clear PLAYWRIGHT_BASE_URL --shared-host-safe --pm-context tracker --fail-on-context-mismatch --fail-on-skipped\",\n \"pm test pm-a1b2 --run --timeout 2400 --pm-context auto\",\n \"pm test pm-a1b2 --run --background --timeout 2400 --progress\",\n ],\n },\n \"test-all\": {\n why: \"Runs linked tests in bulk for release/readiness sweeps.\",\n examples: [\n \"pm test-all --status in_progress --limit 5 --offset 10 --timeout 2400\",\n \"pm test-all --status closed --timeout 3600 --progress --env-set PORT=0 --shared-host-safe --fail-on-skipped\",\n \"pm test-all --status in_progress --pm-context tracker --fail-on-context-mismatch --require-assertions-for-pm\",\n \"pm test-all --status in_progress --pm-context auto --fail-on-context-mismatch\",\n \"pm test-all --status in_progress --background --timeout 3600\",\n ],\n },\n \"test-runs\": {\n why: \"Manages background linked-test runs with lifecycle controls and log/status inspection.\",\n examples: [\n \"pm test-runs list --status running --limit 20\",\n \"pm test-runs status tr-abc123\",\n \"pm test-runs logs tr-abc123 --stream stderr --tail 200\",\n \"pm test-runs stop tr-abc123\",\n \"pm test-runs resume tr-abc123\",\n ],\n },\n stats: {\n why: \"Reports tracker-level totals and distribution by type/status.\",\n examples: [\"pm stats\", \"pm stats --json\"],\n },\n health: {\n why: \"Validates tracker/runtime health including extension triage, migration, and integrity diagnostics.\",\n examples: [\"pm health\", \"pm health --json\", \"pm health --check-only\", \"pm health --no-refresh\", \"pm health --refresh-vectors\"],\n },\n validate: {\n why:\n \"Runs standalone metadata, resolution, lifecycle (including dependency-cycle diagnostics), linked-file, linked-command reference, and history drift checks with default remediation hints for resolution gaps.\",\n examples: [\n \"pm validate\",\n \"pm validate --check-resolution --json\",\n \"pm validate --check-lifecycle --dependency-cycle-severity error\",\n \"pm validate --check-files --scan-mode tracked-all\",\n \"pm validate --check-files --scan-mode tracked-all-strict --include-pm-internals\",\n \"pm validate --check-command-references\",\n \"pm validate --check-resolution --fail-on-warn --json\",\n ],\n tips: [\"Resolution-gap warnings include default `pm update <id> ...` remediation hint templates in check details.\"],\n },\n gc: {\n why: \"Cleans optional cache artifacts to keep local tracker state tidy.\",\n examples: [\"pm gc\"],\n },\n claim: {\n why: \"Claims an item to signal active ownership and reduce conflicts.\",\n examples: [\n 'pm claim pm-a1b2 --author \"codex-agent\" --message \"Claim for implementation\"',\n 'pm claim pm-a1b2 --force --author \"codex-agent\" --message \"Take over terminal item\"',\n ],\n tips: [\"Claim takeover for non-terminal items does not require --force; --force is reserved for terminal/lock overrides.\"],\n },\n release: {\n why: \"Releases an active claim when paused, handed off, or completed.\",\n examples: [\n 'pm release pm-a1b2 --author \"codex-agent\" --message \"Release after closure\"',\n 'pm release pm-a1b2 --allow-audit-release --author \"reviewer\" --message \"Audit handoff release\"',\n ],\n tips: [\"Use --allow-audit-release for non-owner handoffs that only clear assignee metadata.\"],\n },\n \"start-task\": {\n why: \"Lifecycle alias that claims an item and sets status to in_progress.\",\n examples: ['pm start-task pm-a1b2 --author \"codex-agent\" --message \"Start implementation\"'],\n },\n \"pause-task\": {\n why: \"Lifecycle alias that sets status to open and releases active assignment.\",\n examples: ['pm pause-task pm-a1b2 --author \"codex-agent\" --message \"Pause for dependency unblock\"'],\n },\n \"close-task\": {\n why: \"Lifecycle alias that closes with reason text and clears assignment metadata.\",\n examples: ['pm close-task pm-a1b2 \"All acceptance criteria met\" --author \"codex-agent\" --message \"Close and handoff\"'],\n },\n completion: {\n why: \"Generates shell completion scripts for faster and more reliable command entry.\",\n examples: [\"pm completion bash\", \"pm completion zsh\", \"pm completion fish\", \"pm completion bash --eager-tags\"],\n tips: [\"Default scripts resolve tag suggestions lazily at completion time; use --eager-tags to embed current tags directly.\"],\n },\n contracts: {\n why: \"Exposes machine-readable CLI command and tool schema contracts for agent integrations.\",\n examples: [\n \"pm contracts\",\n \"pm contracts --command list --runtime-only\",\n \"pm contracts --command update --flags-only\",\n \"pm contracts --availability-only --runtime-only\",\n \"pm contracts --action create\",\n \"pm contracts --schema-only\",\n ],\n tips: [\"Use --command to narrow actions/schema to one CLI surface; combine with --flags-only or --availability-only for lighter payloads.\"],\n },\n};\n\nexport const ROOT_HELP_BUNDLE: HelpBundle = {\n why: \"Provides deterministic project management workflows for humans and coding agents.\",\n examples: [\n \"pm init\",\n \"pm guide\",\n \"pm list-open --limit 10\",\n 'pm create --title \"...\" --description \"...\" --type Task --status open --priority 1 --message \"...\" --create-mode progressive',\n ],\n tips: [\n \"Use <command> --help for command-specific guidance and examples.\",\n \"Use pm guide for local docs and skills routing with progressive disclosure.\",\n \"Use --json for machine parsing and integration flows.\",\n \"Use --no-pager to force direct help output in CI and other non-interactive shells.\",\n ],\n};\n\nfunction resolveCanonicalHelpPath(commandPath: string | undefined): string {\n const normalized = normalizeHelpCommandPath(commandPath ?? \"\");\n if (!normalized) {\n return \"\";\n }\n return HELP_PATH_ALIASES[normalized] ?? normalized;\n}\n\nexport function resolveHelpBundleForPath(commandPath: string | undefined): HelpBundle {\n const canonicalPath = resolveCanonicalHelpPath(commandPath);\n if (!canonicalPath) {\n return ROOT_HELP_BUNDLE;\n }\n return HELP_BY_COMMAND_PATH[canonicalPath] ?? ROOT_HELP_BUNDLE;\n}\n\nexport function resolveHelpNarrative(commandPath: string | undefined, detailMode: HelpDetailMode): HelpNarrative {\n const bundle = resolveHelpBundleForPath(commandPath);\n return {\n intent: bundle.why,\n examples: detailMode === \"detailed\" ? [...bundle.examples] : bundle.examples.length > 0 ? [bundle.examples[0]] : [],\n tips: detailMode === \"detailed\" ? [...(bundle.tips ?? [])] : [],\n detail_mode: detailMode,\n };\n}\n\nexport function listDocumentedHelpPaths(): string[] {\n return Object.keys(HELP_BY_COMMAND_PATH).sort((left, right) => left.localeCompare(right));\n}\n\nexport function attachRichHelpText(program: Command, argv: string[] = process.argv.slice(2)): void {\n const detailMode = resolveHelpDetailMode(argv);\n program.addHelpText(\"after\", renderHelpBundle(ROOT_HELP_BUNDLE, detailMode));\n for (const [commandPath, bundle] of Object.entries(HELP_BY_COMMAND_PATH)) {\n attachBundleByPath(program, commandPath, bundle, detailMode);\n }\n}\n"]}
|