@sienklogic/plan-build-run 2.54.0 → 2.55.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (127) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/package.json +1 -1
  3. package/plugins/codex-pbr/agents/audit.md +223 -0
  4. package/plugins/codex-pbr/agents/codebase-mapper.md +196 -0
  5. package/plugins/codex-pbr/agents/debugger.md +245 -0
  6. package/plugins/codex-pbr/agents/dev-sync.md +142 -0
  7. package/plugins/codex-pbr/agents/executor.md +429 -0
  8. package/plugins/codex-pbr/agents/general.md +131 -0
  9. package/plugins/codex-pbr/agents/integration-checker.md +178 -0
  10. package/plugins/codex-pbr/agents/plan-checker.md +253 -0
  11. package/plugins/codex-pbr/agents/planner.md +343 -0
  12. package/plugins/codex-pbr/agents/researcher.md +253 -0
  13. package/plugins/codex-pbr/agents/synthesizer.md +183 -0
  14. package/plugins/codex-pbr/agents/verifier.md +352 -0
  15. package/plugins/codex-pbr/commands/audit.md +5 -0
  16. package/plugins/codex-pbr/commands/begin.md +5 -0
  17. package/plugins/codex-pbr/commands/build.md +5 -0
  18. package/plugins/codex-pbr/commands/config.md +5 -0
  19. package/plugins/codex-pbr/commands/continue.md +5 -0
  20. package/plugins/codex-pbr/commands/dashboard.md +5 -0
  21. package/plugins/codex-pbr/commands/debug.md +5 -0
  22. package/plugins/codex-pbr/commands/discuss.md +5 -0
  23. package/plugins/codex-pbr/commands/do.md +5 -0
  24. package/plugins/codex-pbr/commands/explore.md +5 -0
  25. package/plugins/codex-pbr/commands/health.md +5 -0
  26. package/plugins/codex-pbr/commands/help.md +5 -0
  27. package/plugins/codex-pbr/commands/import.md +5 -0
  28. package/plugins/codex-pbr/commands/milestone.md +5 -0
  29. package/plugins/codex-pbr/commands/note.md +5 -0
  30. package/plugins/codex-pbr/commands/pause.md +5 -0
  31. package/plugins/codex-pbr/commands/plan.md +5 -0
  32. package/plugins/codex-pbr/commands/quick.md +5 -0
  33. package/plugins/codex-pbr/commands/resume.md +5 -0
  34. package/plugins/codex-pbr/commands/review.md +5 -0
  35. package/plugins/codex-pbr/commands/scan.md +5 -0
  36. package/plugins/codex-pbr/commands/setup.md +5 -0
  37. package/plugins/codex-pbr/commands/status.md +5 -0
  38. package/plugins/codex-pbr/commands/statusline.md +5 -0
  39. package/plugins/codex-pbr/commands/test.md +5 -0
  40. package/plugins/codex-pbr/commands/todo.md +5 -0
  41. package/plugins/codex-pbr/commands/undo.md +5 -0
  42. package/plugins/codex-pbr/references/agent-contracts.md +324 -0
  43. package/plugins/codex-pbr/references/agent-teams.md +54 -0
  44. package/plugins/codex-pbr/references/common-bug-patterns.md +13 -0
  45. package/plugins/codex-pbr/references/config-reference.md +552 -0
  46. package/plugins/codex-pbr/references/continuation-format.md +212 -0
  47. package/plugins/codex-pbr/references/deviation-rules.md +112 -0
  48. package/plugins/codex-pbr/references/git-integration.md +256 -0
  49. package/plugins/codex-pbr/references/integration-patterns.md +117 -0
  50. package/plugins/codex-pbr/references/model-profiles.md +99 -0
  51. package/plugins/codex-pbr/references/model-selection.md +31 -0
  52. package/plugins/codex-pbr/references/pbr-tools-cli.md +400 -0
  53. package/plugins/codex-pbr/references/plan-authoring.md +246 -0
  54. package/plugins/codex-pbr/references/plan-format.md +313 -0
  55. package/plugins/codex-pbr/references/questioning.md +235 -0
  56. package/plugins/codex-pbr/references/reading-verification.md +127 -0
  57. package/plugins/codex-pbr/references/signal-files.md +41 -0
  58. package/plugins/codex-pbr/references/stub-patterns.md +160 -0
  59. package/plugins/codex-pbr/references/ui-formatting.md +444 -0
  60. package/plugins/codex-pbr/references/wave-execution.md +95 -0
  61. package/plugins/codex-pbr/skills/audit/SKILL.md +346 -0
  62. package/plugins/codex-pbr/skills/begin/SKILL.md +800 -0
  63. package/plugins/codex-pbr/skills/build/SKILL.md +958 -0
  64. package/plugins/codex-pbr/skills/config/SKILL.md +267 -0
  65. package/plugins/codex-pbr/skills/continue/SKILL.md +172 -0
  66. package/plugins/codex-pbr/skills/dashboard/SKILL.md +44 -0
  67. package/plugins/codex-pbr/skills/debug/SKILL.md +530 -0
  68. package/plugins/codex-pbr/skills/discuss/SKILL.md +355 -0
  69. package/plugins/codex-pbr/skills/do/SKILL.md +68 -0
  70. package/plugins/codex-pbr/skills/explore/SKILL.md +407 -0
  71. package/plugins/codex-pbr/skills/health/SKILL.md +300 -0
  72. package/plugins/codex-pbr/skills/help/SKILL.md +229 -0
  73. package/plugins/codex-pbr/skills/import/SKILL.md +538 -0
  74. package/plugins/codex-pbr/skills/milestone/SKILL.md +620 -0
  75. package/plugins/codex-pbr/skills/note/SKILL.md +215 -0
  76. package/plugins/codex-pbr/skills/pause/SKILL.md +258 -0
  77. package/plugins/codex-pbr/skills/plan/SKILL.md +650 -0
  78. package/plugins/codex-pbr/skills/quick/SKILL.md +417 -0
  79. package/plugins/codex-pbr/skills/resume/SKILL.md +403 -0
  80. package/plugins/codex-pbr/skills/review/SKILL.md +669 -0
  81. package/plugins/codex-pbr/skills/scan/SKILL.md +325 -0
  82. package/plugins/codex-pbr/skills/setup/SKILL.md +169 -0
  83. package/plugins/codex-pbr/skills/shared/commit-planning-docs.md +35 -0
  84. package/plugins/codex-pbr/skills/shared/config-loading.md +102 -0
  85. package/plugins/codex-pbr/skills/shared/context-budget.md +77 -0
  86. package/plugins/codex-pbr/skills/shared/context-loader-task.md +86 -0
  87. package/plugins/codex-pbr/skills/shared/digest-select.md +79 -0
  88. package/plugins/codex-pbr/skills/shared/domain-probes.md +125 -0
  89. package/plugins/codex-pbr/skills/shared/error-reporting.md +59 -0
  90. package/plugins/codex-pbr/skills/shared/gate-prompts.md +388 -0
  91. package/plugins/codex-pbr/skills/shared/phase-argument-parsing.md +45 -0
  92. package/plugins/codex-pbr/skills/shared/revision-loop.md +81 -0
  93. package/plugins/codex-pbr/skills/shared/state-update.md +169 -0
  94. package/plugins/codex-pbr/skills/shared/universal-anti-patterns.md +43 -0
  95. package/plugins/codex-pbr/skills/status/SKILL.md +449 -0
  96. package/plugins/codex-pbr/skills/statusline/SKILL.md +149 -0
  97. package/plugins/codex-pbr/skills/test/SKILL.md +210 -0
  98. package/plugins/codex-pbr/skills/todo/SKILL.md +281 -0
  99. package/plugins/codex-pbr/skills/undo/SKILL.md +172 -0
  100. package/plugins/codex-pbr/templates/CONTEXT.md.tmpl +52 -0
  101. package/plugins/codex-pbr/templates/INTEGRATION-REPORT.md.tmpl +167 -0
  102. package/plugins/codex-pbr/templates/RESEARCH-SUMMARY.md.tmpl +97 -0
  103. package/plugins/codex-pbr/templates/ROADMAP.md.tmpl +47 -0
  104. package/plugins/codex-pbr/templates/SUMMARY-complex.md.tmpl +95 -0
  105. package/plugins/codex-pbr/templates/SUMMARY-minimal.md.tmpl +48 -0
  106. package/plugins/codex-pbr/templates/SUMMARY.md.tmpl +81 -0
  107. package/plugins/codex-pbr/templates/VERIFICATION-DETAIL.md.tmpl +117 -0
  108. package/plugins/codex-pbr/templates/codebase/ARCHITECTURE.md.tmpl +98 -0
  109. package/plugins/codex-pbr/templates/codebase/CONCERNS.md.tmpl +93 -0
  110. package/plugins/codex-pbr/templates/codebase/CONVENTIONS.md.tmpl +104 -0
  111. package/plugins/codex-pbr/templates/codebase/INTEGRATIONS.md.tmpl +78 -0
  112. package/plugins/codex-pbr/templates/codebase/STACK.md.tmpl +78 -0
  113. package/plugins/codex-pbr/templates/codebase/STRUCTURE.md.tmpl +80 -0
  114. package/plugins/codex-pbr/templates/codebase/TESTING.md.tmpl +107 -0
  115. package/plugins/codex-pbr/templates/continue-here.md.tmpl +73 -0
  116. package/plugins/codex-pbr/templates/pr-body.md.tmpl +22 -0
  117. package/plugins/codex-pbr/templates/prompt-partials/phase-project-context.md.tmpl +37 -0
  118. package/plugins/codex-pbr/templates/research/ARCHITECTURE.md.tmpl +124 -0
  119. package/plugins/codex-pbr/templates/research/STACK.md.tmpl +71 -0
  120. package/plugins/codex-pbr/templates/research/SUMMARY.md.tmpl +112 -0
  121. package/plugins/codex-pbr/templates/research-outputs/phase-research.md.tmpl +81 -0
  122. package/plugins/codex-pbr/templates/research-outputs/project-research.md.tmpl +99 -0
  123. package/plugins/codex-pbr/templates/research-outputs/synthesis.md.tmpl +36 -0
  124. package/plugins/copilot-pbr/plugin.json +1 -1
  125. package/plugins/cursor-pbr/.cursor-plugin/plugin.json +1 -1
  126. package/plugins/jules-pbr/AGENTS.md +600 -0
  127. package/plugins/pbr/.claude-plugin/plugin.json +1 -1
@@ -0,0 +1,99 @@
1
+ # Model Profiles Reference
2
+
3
+ How Plan-Build-Run maps agents to models and how to configure model selection.
4
+
5
+ ---
6
+
7
+ ## Agent-to-Model Mapping
8
+
9
+ Each Plan-Build-Run agent has a default model specified in its agent definition frontmatter (`model:` field). These defaults are overridden by the `models` section of `config.json`.
10
+
11
+ ### Default Agent Models
12
+
13
+ | Agent | Default Model | Rationale |
14
+ |-------|---------------|-----------|
15
+ | `researcher` | `sonnet` | Research requires strong reasoning for source evaluation and synthesis |
16
+ | `planner` | `inherit` | Planning is complex; inherits the session's primary model |
17
+ | `executor` | `inherit` | Execution needs the full capability of the session model |
18
+ | `verifier` | `sonnet` | Verification needs solid reasoning but not the heaviest model |
19
+ | `integration-checker` | `sonnet` | Cross-phase analysis requires strong pattern matching |
20
+ | `plan-checker` | `sonnet` | Plan quality analysis needs good analytical capability |
21
+ | `debugger` | `inherit` | Debugging is complex; inherits session model |
22
+ | `codebase-mapper` | `sonnet` | Codebase analysis requires thorough reasoning |
23
+ | `synthesizer` | `haiku` | Synthesis is mechanical combination; speed over depth |
24
+ | `general` | `inherit` | Lightweight utility; inherits session model |
25
+
26
+ The `inherit` value means the agent uses whatever model the parent session is running (typically the user's configured Claude model).
27
+
28
+ ---
29
+
30
+ ## Model Profile Presets
31
+
32
+ The `/pbr:config model-profile {preset}` command sets all agent models at once using a preset:
33
+
34
+ | Profile | Researcher | Planner | Executor | Verifier | Int-Checker | Debugger | Mapper | Synthesizer |
35
+ |---------|-----------|---------|----------|----------|-------------|----------|--------|-------------|
36
+ | `quality` | opus | opus | opus | opus | sonnet | opus | sonnet | sonnet |
37
+ | `balanced` | sonnet | inherit | inherit | sonnet | sonnet | inherit | sonnet | haiku |
38
+ | `budget` | haiku | haiku | haiku | haiku | haiku | haiku | haiku | haiku |
39
+ | `adaptive` | sonnet | sonnet | inherit | sonnet | haiku | inherit | haiku | haiku |
40
+
41
+ ### Preset Descriptions
42
+
43
+ - **quality**: Maximum capability across all agents. Best results but highest token cost. Use for critical projects or complex architectures.
44
+ - **balanced**: The default preset. Front-loads intelligence in research and verification, inherits session model for planning and execution. Good general-purpose choice.
45
+ - **budget**: All agents use haiku. Fastest and cheapest, but reduced quality for complex reasoning tasks. Suitable for well-defined, mechanical work.
46
+ - **adaptive**: Front-loads intelligence in research and planning (where decisions matter most), uses lighter models for mechanical execution and verification. Good cost-quality tradeoff.
47
+
48
+ ---
49
+
50
+ ## Configuring Models
51
+
52
+ ### Per-Agent Configuration
53
+
54
+ Set an individual agent's model via `/pbr:config`:
55
+
56
+ ```
57
+ /pbr:config model executor sonnet
58
+ /pbr:config model verifier opus
59
+ ```
60
+
61
+ Or edit `config.json` directly:
62
+
63
+ ```json
64
+ {
65
+ "models": {
66
+ "researcher": "sonnet",
67
+ "planner": "inherit",
68
+ "executor": "inherit",
69
+ "verifier": "sonnet",
70
+ "integration_checker": "sonnet",
71
+ "debugger": "inherit",
72
+ "mapper": "sonnet",
73
+ "synthesizer": "haiku"
74
+ }
75
+ }
76
+ ```
77
+
78
+ ### Valid Model Values
79
+
80
+ | Value | Meaning |
81
+ |-------|---------|
82
+ | `sonnet` | Claude Sonnet (4.5/4.6) -- balanced speed and capability |
83
+ | `opus` | Claude Opus (4.6) -- highest capability, slower |
84
+ | `haiku` | Claude Haiku (4.5) -- fastest, lower capability |
85
+ | `inherit` | Use the session's primary model (whatever the user is running) |
86
+
87
+ Note: Claude Code 2.1.45+ supports Sonnet 4.6. Model values are abstract names — Claude Code resolves them to the latest available version.
88
+
89
+ ---
90
+
91
+ ## Model Selection in Skill Orchestration
92
+
93
+ Skills that spawn subagents use the `model` parameter in `Task()` calls. Some skills hardcode a lighter model for specific tasks:
94
+
95
+ - **Build skill**: Spawns inline verifiers with `model: "haiku"` for quick spot-checks
96
+ - **Build skill**: Spawns codebase mapper updates with `model: "haiku"` for incremental map refreshes
97
+ - **Plan skill**: Uses the configured `planner` model for main planning work
98
+
99
+ The `subagent_type` parameter automatically loads the agent definition, and the model from `config.json` takes precedence over the agent's default `model:` frontmatter field.
@@ -0,0 +1,31 @@
1
+ # Model Selection Reference
2
+
3
+ Plan-Build-Run uses adaptive model selection to balance cost and capability.
4
+
5
+ ## How It Works
6
+
7
+ 1. The planner annotates each task with `complexity="simple|medium|complex"`
8
+ 2. The build skill maps complexity to a model via `config.models.complexity_map`
9
+ 3. The executor agent is spawned with the selected model
10
+
11
+ ## Default Mapping
12
+
13
+ | Complexity | Model | Rationale |
14
+ |-----------|-------|-----------|
15
+ | simple | haiku | Fast, cheap — sufficient for mechanical changes |
16
+ | medium | sonnet | Good balance for standard feature work |
17
+ | complex | inherit | Uses session model — typically Opus for critical work |
18
+
19
+ ## Override Mechanisms
20
+
21
+ 1. **Per-task override**: Add `model="sonnet"` attribute to task XML in PLAN.md
22
+ 2. **Config override**: Set `models.complexity_map` in config.json to change defaults
23
+ 3. **Agent-level override**: Set `models.executor` in config.json to force a single model for all executor spawns (disables adaptive selection)
24
+
25
+ ## Heuristics
26
+
27
+ The planner uses these signals to determine complexity:
28
+ - File count and types
29
+ - Task name keywords
30
+ - Dependency count
31
+ - Whether the task introduces new patterns vs. follows established ones
@@ -0,0 +1,400 @@
1
+ # pbr-tools.js CLI Reference
2
+
3
+ Command-line interface for structured JSON operations on `.planning/` state.
4
+ Skills and agents call this via Bash to avoid token-expensive text parsing.
5
+
6
+ ```
7
+ node ${CLAUDE_PLUGIN_ROOT}/scripts/pbr-tools.js <command> [args]
8
+ ```
9
+
10
+ All commands output JSON to stdout. Errors output JSON with an `error` field to stderr (exit code 1).
11
+
12
+ ---
13
+
14
+ ## State Commands
15
+
16
+ ### `state load`
17
+
18
+ Returns full project state as a single JSON object.
19
+
20
+ ```bash
21
+ node ${CLAUDE_PLUGIN_ROOT}/scripts/pbr-tools.js state load
22
+ ```
23
+
24
+ **Output:**
25
+ ```json
26
+ {
27
+ "exists": true,
28
+ "config": { ... }, // config.json contents
29
+ "state": { // STATE.md frontmatter + parsed body
30
+ "version": 2,
31
+ "current_phase": "1",
32
+ "status": "building",
33
+ "progress_percent": 45,
34
+ "last_activity": "2025-01-15",
35
+ "last_command": "/pbr:build",
36
+ "blockers": []
37
+ },
38
+ "roadmap": { // Parsed ROADMAP.md
39
+ "phases": [{ "number": "01", "name": "...", "status": "planned", ... }]
40
+ },
41
+ "phase_count": 3,
42
+ "current_phase": "1",
43
+ "progress": { "phases": [...], "total_plans": 5, "completed_plans": 2, "percentage": 40 }
44
+ }
45
+ ```
46
+
47
+ ### `state check-progress`
48
+
49
+ Recalculates progress from filesystem (plan files, summaries, verification).
50
+
51
+ ```bash
52
+ node ${CLAUDE_PLUGIN_ROOT}/scripts/pbr-tools.js state check-progress
53
+ ```
54
+
55
+ **Output:**
56
+ ```json
57
+ {
58
+ "phases": [
59
+ { "directory": "01-setup", "plans": 2, "summaries": 2, "completed": 2, "has_verification": true, "status": "verified" }
60
+ ],
61
+ "total_plans": 5,
62
+ "completed_plans": 3,
63
+ "percentage": 60
64
+ }
65
+ ```
66
+
67
+ ### `state update <field> <value>`
68
+
69
+ Atomically updates a single field in STATE.md. Uses file locking.
70
+
71
+ ```bash
72
+ node ${CLAUDE_PLUGIN_ROOT}/scripts/pbr-tools.js state update current_phase 2
73
+ node ${CLAUDE_PLUGIN_ROOT}/scripts/pbr-tools.js state update status building
74
+ node ${CLAUDE_PLUGIN_ROOT}/scripts/pbr-tools.js state update last_activity now # auto-timestamps
75
+ node ${CLAUDE_PLUGIN_ROOT}/scripts/pbr-tools.js state update plans_complete 3
76
+ ```
77
+
78
+ **Valid fields:** `current_phase`, `status`, `plans_complete`, `last_activity`
79
+
80
+ **Output:** `{ "success": true, "field": "status", "value": "building" }`
81
+
82
+ ---
83
+
84
+ ## Config Commands
85
+
86
+ ### `config validate`
87
+
88
+ Validates `config.json` against the JSON schema. Detects both schema violations and semantic conflicts.
89
+
90
+ ```bash
91
+ node ${CLAUDE_PLUGIN_ROOT}/scripts/pbr-tools.js config validate
92
+ ```
93
+
94
+ **Output:**
95
+ ```json
96
+ {
97
+ "valid": true,
98
+ "errors": [],
99
+ "warnings": ["features.auto_continue=true with mode=interactive: auto_continue only fires in autonomous mode"]
100
+ }
101
+ ```
102
+
103
+ ### `config resolve-depth [dir]`
104
+
105
+ Resolves the effective depth profile by merging base profile with user overrides.
106
+
107
+ ```bash
108
+ node ${CLAUDE_PLUGIN_ROOT}/scripts/pbr-tools.js config resolve-depth
109
+ node ${CLAUDE_PLUGIN_ROOT}/scripts/pbr-tools.js config resolve-depth /path/to/.planning
110
+ ```
111
+
112
+ **Output:** Full depth profile object with all resolved values (research rounds, plan detail level, verification depth, etc.)
113
+
114
+ ---
115
+
116
+ ## Plan & Phase Commands
117
+
118
+ ### `plan-index <phase>`
119
+
120
+ Returns plan inventory for a phase, grouped by wave.
121
+
122
+ ```bash
123
+ node ${CLAUDE_PLUGIN_ROOT}/scripts/pbr-tools.js plan-index 1
124
+ ```
125
+
126
+ **Output:**
127
+ ```json
128
+ {
129
+ "phase": "01-setup",
130
+ "total_plans": 3,
131
+ "plans": [
132
+ {
133
+ "file": "PLAN-01.md",
134
+ "plan_id": "01",
135
+ "wave": 1,
136
+ "type": "feature",
137
+ "autonomous": true,
138
+ "depends_on": [],
139
+ "gap_closure": false,
140
+ "has_summary": true,
141
+ "must_haves_count": 4
142
+ }
143
+ ],
144
+ "waves": { "wave_1": ["01", "02"], "wave_2": ["03"] }
145
+ }
146
+ ```
147
+
148
+ ### `phase-info <phase>`
149
+
150
+ Comprehensive single-phase status combining roadmap, filesystem, and plan data.
151
+
152
+ ```bash
153
+ node ${CLAUDE_PLUGIN_ROOT}/scripts/pbr-tools.js phase-info 1
154
+ ```
155
+
156
+ **Output:**
157
+ ```json
158
+ {
159
+ "phase": "01-setup",
160
+ "name": "setup",
161
+ "goal": "Initialize project infrastructure",
162
+ "roadmap_status": "building",
163
+ "filesystem_status": "partial",
164
+ "plans": [...],
165
+ "plan_count": 3,
166
+ "summaries": [{ "file": "SUMMARY-01.md", "plan": "01", "status": "complete" }],
167
+ "completed": 1,
168
+ "verification": null,
169
+ "has_context": false
170
+ }
171
+ ```
172
+
173
+ ### `must-haves <phase>`
174
+
175
+ Collects all must-haves from phase plans — truths, artifacts, and key links.
176
+
177
+ ```bash
178
+ node ${CLAUDE_PLUGIN_ROOT}/scripts/pbr-tools.js must-haves 1
179
+ ```
180
+
181
+ **Output:**
182
+ ```json
183
+ {
184
+ "phase": "01-setup",
185
+ "plans": {
186
+ "01": { "truths": ["..."], "artifacts": ["..."], "key_links": ["..."] }
187
+ },
188
+ "all": { "truths": [...], "artifacts": [...], "key_links": [...] },
189
+ "total": 12
190
+ }
191
+ ```
192
+
193
+ ---
194
+
195
+ ## Frontmatter Command
196
+
197
+ ### `frontmatter <filepath>`
198
+
199
+ Parses a markdown file's YAML frontmatter and returns as JSON.
200
+
201
+ ```bash
202
+ node ${CLAUDE_PLUGIN_ROOT}/scripts/pbr-tools.js frontmatter .planning/phases/01-setup/PLAN-01.md
203
+ ```
204
+
205
+ **Output:** The frontmatter fields as a JSON object. Returns `{ "error": "File not found: ..." }` if the file doesn't exist.
206
+
207
+ ---
208
+
209
+ ## Roadmap Commands
210
+
211
+ ### `roadmap update-status <phase> <status>`
212
+
213
+ Updates the Status column for a phase in ROADMAP.md's Phase Overview table. Uses file locking. Warns on invalid status transitions but does not block them.
214
+
215
+ ```bash
216
+ node ${CLAUDE_PLUGIN_ROOT}/scripts/pbr-tools.js roadmap update-status 1 building
217
+ ```
218
+
219
+ **Valid statuses:** `pending`, `planned`, `building`, `built`, `partial`, `needs_fixes`, `verified`, `skipped`
220
+
221
+ **Output:** `{ "success": true, "old_status": "planned", "new_status": "building" }`
222
+
223
+ ### `roadmap update-plans <phase> <complete> <total>`
224
+
225
+ Updates the Plans column (e.g., "2/5") for a phase in ROADMAP.md.
226
+
227
+ ```bash
228
+ node ${CLAUDE_PLUGIN_ROOT}/scripts/pbr-tools.js roadmap update-plans 1 2 5
229
+ ```
230
+
231
+ **Output:** `{ "success": true, "old_plans": "1/5", "new_plans": "2/5" }`
232
+
233
+ ---
234
+
235
+ ## History Commands
236
+
237
+ ### `history append <type> <title> [body]`
238
+
239
+ Appends a record to HISTORY.md. Creates the file if it doesn't exist.
240
+
241
+ ```bash
242
+ node ${CLAUDE_PLUGIN_ROOT}/scripts/pbr-tools.js history append milestone "v1.0 Release" "Initial release with core features"
243
+ node ${CLAUDE_PLUGIN_ROOT}/scripts/pbr-tools.js history append phase "01-setup Complete" "3 plans executed, all verified"
244
+ ```
245
+
246
+ **Types:** `milestone`, `phase`
247
+
248
+ **Output:** `{ "success": true }`
249
+
250
+ ### `history load`
251
+
252
+ Loads all HISTORY.md records as structured JSON.
253
+
254
+ ```bash
255
+ node ${CLAUDE_PLUGIN_ROOT}/scripts/pbr-tools.js history load
256
+ ```
257
+
258
+ **Output:**
259
+ ```json
260
+ {
261
+ "records": [
262
+ { "type": "milestone", "title": "v1.0 Release", "date": "2025-01-15", "body": "..." }
263
+ ],
264
+ "line_count": 42
265
+ }
266
+ ```
267
+
268
+ Returns `null` if HISTORY.md doesn't exist.
269
+
270
+ ---
271
+
272
+ ## Event Command
273
+
274
+ ### `event <category> <event> [JSON-details]`
275
+
276
+ Logs a structured event to `.planning/logs/events.jsonl`.
277
+
278
+ ```bash
279
+ node ${CLAUDE_PLUGIN_ROOT}/scripts/pbr-tools.js event build plan-complete '{"plan":"01","phase":"01-setup"}'
280
+ node ${CLAUDE_PLUGIN_ROOT}/scripts/pbr-tools.js event error hook-failure '{"script":"validate-task.js"}'
281
+ ```
282
+
283
+ **Output:** `{ "logged": true, "category": "build", "event": "plan-complete" }`
284
+
285
+ If the JSON-details argument is not valid JSON, it's stored as `{ "raw": "<the string>" }`.
286
+
287
+ ---
288
+
289
+ ## Compound Init Commands
290
+
291
+ Compound commands that compose multiple data sources into a single JSON response.
292
+ Replace multi-step context loading in skills with a single CLI call.
293
+
294
+ ### `init execute-phase <phase>`
295
+
296
+ Everything an executor needs to start building a phase.
297
+
298
+ ```bash
299
+ node ${CLAUDE_PLUGIN_ROOT}/scripts/pbr-tools.js init execute-phase 3
300
+ ```
301
+
302
+ **Output:**
303
+ ```json
304
+ {
305
+ "executor_model": "sonnet",
306
+ "verifier_model": "sonnet",
307
+ "config": { "depth": "standard", "mode": "interactive", "parallelization": {}, "planning": {}, "gates": {}, "features": {} },
308
+ "phase": { "num": "3", "dir": "03-auth", "name": "auth", "goal": "...", "has_context": false, "status": "planned", "plan_count": 2, "completed": 0 },
309
+ "plans": [{ "file": "PLAN-01.md", "plan_id": "01", "wave": 1, "autonomous": true, "has_summary": false, "must_haves_count": 4, "depends_on": [] }],
310
+ "waves": { "wave_1": ["01", "02"] },
311
+ "branch_name": "main",
312
+ "git_clean": true
313
+ }
314
+ ```
315
+
316
+ ### `init plan-phase <phase>`
317
+
318
+ Everything a planner needs to start phase planning.
319
+
320
+ ```bash
321
+ node ${CLAUDE_PLUGIN_ROOT}/scripts/pbr-tools.js init plan-phase 3
322
+ ```
323
+
324
+ **Output:** `researcher_model`, `planner_model`, `checker_model`, `config` (depth profile, features, planning settings), `phase` (num, dir, goal, depends_on), `existing_artifacts`, `workflow` flags.
325
+
326
+ ### `init quick <description>`
327
+
328
+ Everything the quick skill needs: next task number, slug, directory path.
329
+
330
+ ```bash
331
+ node ${CLAUDE_PLUGIN_ROOT}/scripts/pbr-tools.js init quick "add search feature"
332
+ ```
333
+
334
+ **Output:** `next_task_number`, `slug`, `dir`, `dir_name`, `timestamp`, `config` subset.
335
+
336
+ ### `init verify-work <phase>`
337
+
338
+ Everything a verifier needs to start verification.
339
+
340
+ ```bash
341
+ node ${CLAUDE_PLUGIN_ROOT}/scripts/pbr-tools.js init verify-work 3
342
+ ```
343
+
344
+ **Output:** `verifier_model`, `phase` info, `has_verification`, `prior_attempts`, `prior_status`, `summaries`.
345
+
346
+ ### `init resume`
347
+
348
+ Detect interrupted state and suggest continuation.
349
+
350
+ ```bash
351
+ node ${CLAUDE_PLUGIN_ROOT}/scripts/pbr-tools.js init resume
352
+ ```
353
+
354
+ **Output:** `state`, `auto_next`, `continue_here`, `active_skill`, `current_phase`, `progress`.
355
+
356
+ ### `init progress`
357
+
358
+ All phases with status and completion data.
359
+
360
+ ```bash
361
+ node ${CLAUDE_PLUGIN_ROOT}/scripts/pbr-tools.js init progress
362
+ ```
363
+
364
+ **Output:** `current_phase`, `total_phases`, `status`, `phases` array, `total_plans`, `completed_plans`, `percentage`.
365
+
366
+ ---
367
+
368
+ ## State Mutation Extensions
369
+
370
+ ### `state patch <JSON>`
371
+
372
+ Multi-field atomic STATE.md update. Updates all fields in a single pass.
373
+
374
+ ```bash
375
+ node ${CLAUDE_PLUGIN_ROOT}/scripts/pbr-tools.js state patch '{"status":"executing","last_activity":"now"}'
376
+ ```
377
+
378
+ **Valid fields:** `current_phase`, `status`, `plans_complete`, `last_activity`, `progress_percent`, `phase_slug`, `total_phases`, `last_command`, `blockers`
379
+
380
+ **Output:** `{ "success": true, "updated": ["status", "last_activity"] }`
381
+
382
+ ### `state advance-plan`
383
+
384
+ Increment current plan number in STATE.md and update progress percentage.
385
+
386
+ ```bash
387
+ node ${CLAUDE_PLUGIN_ROOT}/scripts/pbr-tools.js state advance-plan
388
+ ```
389
+
390
+ **Output:** `{ "success": true, "previous_plan": 1, "current_plan": 2, "total_plans": 5, "progress_percent": 40 }`
391
+
392
+ ### `state record-metric [--duration Nm] [--plans-completed N]`
393
+
394
+ Record session/execution metrics. Appends to HISTORY.md and updates last_activity.
395
+
396
+ ```bash
397
+ node ${CLAUDE_PLUGIN_ROOT}/scripts/pbr-tools.js state record-metric --duration 15m --plans-completed 3
398
+ ```
399
+
400
+ **Output:** `{ "success": true, "duration_minutes": 15, "plans_completed": 3 }`