@sienklogic/plan-build-run 2.51.0 → 2.53.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 (229) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/package.json +4 -2
  3. package/plugins/copilot-pbr/agents/audit.agent.md +2 -5
  4. package/plugins/copilot-pbr/agents/codebase-mapper.agent.md +1 -4
  5. package/plugins/copilot-pbr/agents/debugger.agent.md +1 -4
  6. package/plugins/copilot-pbr/agents/dev-sync.agent.md +6 -9
  7. package/plugins/copilot-pbr/agents/executor.agent.md +1 -6
  8. package/plugins/copilot-pbr/agents/general.agent.md +1 -4
  9. package/plugins/copilot-pbr/agents/integration-checker.agent.md +1 -4
  10. package/plugins/copilot-pbr/agents/plan-checker.agent.md +1 -4
  11. package/plugins/copilot-pbr/agents/planner.agent.md +1 -4
  12. package/plugins/copilot-pbr/agents/researcher.agent.md +1 -4
  13. package/plugins/copilot-pbr/agents/synthesizer.agent.md +1 -4
  14. package/plugins/copilot-pbr/agents/verifier.agent.md +2 -4
  15. package/plugins/copilot-pbr/commands/audit.md +5 -0
  16. package/plugins/copilot-pbr/commands/begin.md +5 -0
  17. package/plugins/copilot-pbr/commands/build.md +5 -0
  18. package/plugins/copilot-pbr/commands/config.md +5 -0
  19. package/plugins/copilot-pbr/commands/continue.md +5 -0
  20. package/plugins/copilot-pbr/commands/dashboard.md +5 -0
  21. package/plugins/copilot-pbr/commands/debug.md +5 -0
  22. package/plugins/copilot-pbr/commands/discuss.md +5 -0
  23. package/plugins/copilot-pbr/commands/do.md +5 -0
  24. package/plugins/copilot-pbr/commands/explore.md +5 -0
  25. package/plugins/copilot-pbr/commands/health.md +5 -0
  26. package/plugins/copilot-pbr/commands/help.md +5 -0
  27. package/plugins/copilot-pbr/commands/import.md +5 -0
  28. package/plugins/copilot-pbr/commands/milestone.md +5 -0
  29. package/plugins/copilot-pbr/commands/note.md +5 -0
  30. package/plugins/copilot-pbr/commands/pause.md +5 -0
  31. package/plugins/copilot-pbr/commands/plan.md +5 -0
  32. package/plugins/copilot-pbr/commands/quick.md +5 -0
  33. package/plugins/copilot-pbr/commands/resume.md +5 -0
  34. package/plugins/copilot-pbr/commands/review.md +5 -0
  35. package/plugins/copilot-pbr/commands/scan.md +5 -0
  36. package/plugins/copilot-pbr/commands/setup.md +5 -0
  37. package/plugins/copilot-pbr/commands/status.md +5 -0
  38. package/plugins/copilot-pbr/commands/statusline.md +5 -0
  39. package/plugins/copilot-pbr/commands/todo.md +5 -0
  40. package/plugins/copilot-pbr/plugin.json +1 -1
  41. package/plugins/copilot-pbr/references/agent-teams.md +0 -1
  42. package/plugins/copilot-pbr/references/common-bug-patterns.md +0 -1
  43. package/plugins/copilot-pbr/references/config-reference.md +0 -1
  44. package/plugins/copilot-pbr/references/continuation-format.md +0 -1
  45. package/plugins/copilot-pbr/references/deviation-rules.md +0 -1
  46. package/plugins/copilot-pbr/references/git-integration.md +0 -1
  47. package/plugins/copilot-pbr/references/integration-patterns.md +0 -1
  48. package/plugins/copilot-pbr/references/model-profiles.md +0 -1
  49. package/plugins/copilot-pbr/references/model-selection.md +0 -1
  50. package/plugins/copilot-pbr/references/plan-authoring.md +0 -1
  51. package/plugins/copilot-pbr/references/plan-format.md +0 -1
  52. package/plugins/copilot-pbr/references/reading-verification.md +0 -1
  53. package/plugins/copilot-pbr/references/signal-files.md +41 -0
  54. package/plugins/copilot-pbr/references/stub-patterns.md +0 -1
  55. package/plugins/copilot-pbr/references/wave-execution.md +0 -1
  56. package/plugins/copilot-pbr/skills/begin/SKILL.md +74 -52
  57. package/plugins/copilot-pbr/skills/build/SKILL.md +55 -69
  58. package/plugins/copilot-pbr/skills/config/SKILL.md +7 -0
  59. package/plugins/copilot-pbr/skills/continue/SKILL.md +31 -24
  60. package/plugins/copilot-pbr/skills/dashboard/SKILL.md +8 -7
  61. package/plugins/copilot-pbr/skills/debug/SKILL.md +11 -0
  62. package/plugins/copilot-pbr/skills/discuss/SKILL.md +2 -0
  63. package/plugins/copilot-pbr/skills/do/SKILL.md +2 -0
  64. package/plugins/copilot-pbr/skills/explore/SKILL.md +7 -1
  65. package/plugins/copilot-pbr/skills/health/SKILL.md +2 -0
  66. package/plugins/copilot-pbr/skills/help/SKILL.md +6 -0
  67. package/plugins/copilot-pbr/skills/import/SKILL.md +9 -0
  68. package/plugins/copilot-pbr/skills/milestone/SKILL.md +20 -196
  69. package/plugins/copilot-pbr/skills/note/SKILL.md +2 -0
  70. package/plugins/copilot-pbr/skills/pause/SKILL.md +5 -0
  71. package/plugins/copilot-pbr/skills/plan/SKILL.md +87 -119
  72. package/plugins/copilot-pbr/skills/quick/SKILL.md +13 -8
  73. package/plugins/copilot-pbr/skills/resume/SKILL.md +4 -0
  74. package/plugins/copilot-pbr/skills/review/SKILL.md +85 -47
  75. package/plugins/copilot-pbr/skills/scan/SKILL.md +6 -0
  76. package/plugins/copilot-pbr/skills/setup/SKILL.md +2 -0
  77. package/plugins/copilot-pbr/skills/shared/commit-planning-docs.md +0 -1
  78. package/plugins/copilot-pbr/skills/shared/config-loading.md +0 -1
  79. package/plugins/copilot-pbr/skills/shared/context-budget.md +0 -1
  80. package/plugins/copilot-pbr/skills/shared/context-loader-task.md +0 -1
  81. package/plugins/copilot-pbr/skills/shared/digest-select.md +0 -1
  82. package/plugins/copilot-pbr/skills/shared/domain-probes.md +0 -1
  83. package/plugins/copilot-pbr/skills/shared/gate-prompts.md +0 -1
  84. package/plugins/copilot-pbr/skills/shared/phase-argument-parsing.md +0 -1
  85. package/plugins/copilot-pbr/skills/shared/revision-loop.md +0 -1
  86. package/plugins/copilot-pbr/skills/shared/state-update.md +0 -1
  87. package/plugins/copilot-pbr/skills/shared/universal-anti-patterns.md +1 -2
  88. package/plugins/copilot-pbr/skills/status/SKILL.md +35 -26
  89. package/plugins/copilot-pbr/skills/test/SKILL.md +2 -2
  90. package/plugins/copilot-pbr/skills/todo/SKILL.md +2 -0
  91. package/plugins/copilot-pbr/templates/CONTEXT.md.tmpl +0 -1
  92. package/plugins/copilot-pbr/templates/INTEGRATION-REPORT.md.tmpl +0 -1
  93. package/plugins/copilot-pbr/templates/RESEARCH-SUMMARY.md.tmpl +0 -1
  94. package/plugins/copilot-pbr/templates/ROADMAP.md.tmpl +0 -1
  95. package/plugins/copilot-pbr/templates/SUMMARY.md.tmpl +0 -1
  96. package/plugins/copilot-pbr/templates/VERIFICATION-DETAIL.md.tmpl +0 -1
  97. package/plugins/copilot-pbr/templates/continue-here.md.tmpl +0 -1
  98. package/plugins/copilot-pbr/templates/prompt-partials/phase-project-context.md.tmpl +0 -1
  99. package/plugins/cursor-pbr/.cursor-plugin/plugin.json +1 -1
  100. package/plugins/cursor-pbr/agents/audit.md +1 -1
  101. package/plugins/cursor-pbr/agents/codebase-mapper.md +1 -1
  102. package/plugins/cursor-pbr/agents/debugger.md +1 -1
  103. package/plugins/cursor-pbr/agents/dev-sync.md +6 -6
  104. package/plugins/cursor-pbr/agents/executor.md +1 -3
  105. package/plugins/cursor-pbr/agents/general.md +1 -1
  106. package/plugins/cursor-pbr/agents/integration-checker.md +2 -2
  107. package/plugins/cursor-pbr/agents/plan-checker.md +2 -2
  108. package/plugins/cursor-pbr/agents/planner.md +1 -1
  109. package/plugins/cursor-pbr/agents/researcher.md +2 -2
  110. package/plugins/cursor-pbr/agents/synthesizer.md +1 -1
  111. package/plugins/cursor-pbr/agents/verifier.md +3 -2
  112. package/plugins/cursor-pbr/commands/audit.md +5 -0
  113. package/plugins/cursor-pbr/commands/begin.md +5 -0
  114. package/plugins/cursor-pbr/commands/build.md +5 -0
  115. package/plugins/cursor-pbr/commands/config.md +5 -0
  116. package/plugins/cursor-pbr/commands/continue.md +5 -0
  117. package/plugins/cursor-pbr/commands/dashboard.md +5 -0
  118. package/plugins/cursor-pbr/commands/debug.md +5 -0
  119. package/plugins/cursor-pbr/commands/discuss.md +5 -0
  120. package/plugins/cursor-pbr/commands/do.md +5 -0
  121. package/plugins/cursor-pbr/commands/explore.md +5 -0
  122. package/plugins/cursor-pbr/commands/health.md +5 -0
  123. package/plugins/cursor-pbr/commands/help.md +5 -0
  124. package/plugins/cursor-pbr/commands/import.md +5 -0
  125. package/plugins/cursor-pbr/commands/milestone.md +5 -0
  126. package/plugins/cursor-pbr/commands/note.md +5 -0
  127. package/plugins/cursor-pbr/commands/pause.md +5 -0
  128. package/plugins/cursor-pbr/commands/plan.md +5 -0
  129. package/plugins/cursor-pbr/commands/quick.md +5 -0
  130. package/plugins/cursor-pbr/commands/resume.md +5 -0
  131. package/plugins/cursor-pbr/commands/review.md +5 -0
  132. package/plugins/cursor-pbr/commands/scan.md +5 -0
  133. package/plugins/cursor-pbr/commands/setup.md +5 -0
  134. package/plugins/cursor-pbr/commands/status.md +5 -0
  135. package/plugins/cursor-pbr/commands/statusline.md +5 -0
  136. package/plugins/cursor-pbr/commands/todo.md +5 -0
  137. package/plugins/cursor-pbr/hooks/hooks.json +4 -10
  138. package/plugins/cursor-pbr/references/agent-teams.md +0 -1
  139. package/plugins/{copilot-pbr/references → cursor-pbr/references/archive}/agent-anti-patterns.md +0 -1
  140. package/plugins/cursor-pbr/references/{pbr-rules.md → archive/pbr-rules.md} +0 -1
  141. package/plugins/cursor-pbr/references/common-bug-patterns.md +0 -1
  142. package/plugins/cursor-pbr/references/config-reference.md +0 -1
  143. package/plugins/cursor-pbr/references/continuation-format.md +0 -1
  144. package/plugins/cursor-pbr/references/deviation-rules.md +0 -1
  145. package/plugins/cursor-pbr/references/git-integration.md +0 -1
  146. package/plugins/cursor-pbr/references/integration-patterns.md +0 -1
  147. package/plugins/cursor-pbr/references/model-profiles.md +0 -1
  148. package/plugins/cursor-pbr/references/model-selection.md +0 -1
  149. package/plugins/cursor-pbr/references/plan-authoring.md +0 -1
  150. package/plugins/cursor-pbr/references/plan-format.md +0 -1
  151. package/plugins/cursor-pbr/references/reading-verification.md +0 -1
  152. package/plugins/cursor-pbr/references/signal-files.md +41 -0
  153. package/plugins/cursor-pbr/references/stub-patterns.md +0 -1
  154. package/plugins/cursor-pbr/references/wave-execution.md +0 -1
  155. package/plugins/cursor-pbr/skills/begin/SKILL.md +74 -52
  156. package/plugins/cursor-pbr/skills/build/SKILL.md +58 -70
  157. package/plugins/cursor-pbr/skills/config/SKILL.md +5 -0
  158. package/plugins/cursor-pbr/skills/continue/SKILL.md +31 -24
  159. package/plugins/cursor-pbr/skills/dashboard/SKILL.md +8 -7
  160. package/plugins/cursor-pbr/skills/debug/SKILL.md +8 -0
  161. package/plugins/cursor-pbr/skills/discuss/SKILL.md +2 -0
  162. package/plugins/cursor-pbr/skills/do/SKILL.md +2 -0
  163. package/plugins/cursor-pbr/skills/explore/SKILL.md +5 -1
  164. package/plugins/cursor-pbr/skills/health/SKILL.md +2 -0
  165. package/plugins/cursor-pbr/skills/help/SKILL.md +6 -0
  166. package/plugins/cursor-pbr/skills/import/SKILL.md +7 -0
  167. package/plugins/cursor-pbr/skills/milestone/SKILL.md +20 -196
  168. package/plugins/cursor-pbr/skills/note/SKILL.md +2 -0
  169. package/plugins/cursor-pbr/skills/pause/SKILL.md +4 -0
  170. package/plugins/cursor-pbr/skills/plan/SKILL.md +87 -119
  171. package/plugins/cursor-pbr/skills/quick/SKILL.md +13 -8
  172. package/plugins/cursor-pbr/skills/resume/SKILL.md +4 -0
  173. package/plugins/cursor-pbr/skills/review/SKILL.md +85 -47
  174. package/plugins/cursor-pbr/skills/scan/SKILL.md +5 -0
  175. package/plugins/cursor-pbr/skills/setup/SKILL.md +2 -0
  176. package/plugins/cursor-pbr/skills/shared/commit-planning-docs.md +0 -1
  177. package/plugins/cursor-pbr/skills/shared/config-loading.md +0 -1
  178. package/plugins/cursor-pbr/skills/shared/context-budget.md +0 -1
  179. package/plugins/cursor-pbr/skills/shared/context-loader-task.md +0 -1
  180. package/plugins/cursor-pbr/skills/shared/digest-select.md +0 -1
  181. package/plugins/cursor-pbr/skills/shared/domain-probes.md +0 -1
  182. package/plugins/cursor-pbr/skills/shared/gate-prompts.md +0 -1
  183. package/plugins/cursor-pbr/skills/shared/phase-argument-parsing.md +0 -1
  184. package/plugins/cursor-pbr/skills/shared/revision-loop.md +0 -1
  185. package/plugins/cursor-pbr/skills/shared/state-update.md +0 -1
  186. package/plugins/cursor-pbr/skills/shared/universal-anti-patterns.md +1 -2
  187. package/plugins/cursor-pbr/skills/status/SKILL.md +35 -26
  188. package/plugins/cursor-pbr/skills/test/SKILL.md +2 -2
  189. package/plugins/cursor-pbr/skills/todo/SKILL.md +2 -0
  190. package/plugins/cursor-pbr/templates/CONTEXT.md.tmpl +0 -1
  191. package/plugins/cursor-pbr/templates/INTEGRATION-REPORT.md.tmpl +0 -1
  192. package/plugins/cursor-pbr/templates/RESEARCH-SUMMARY.md.tmpl +0 -1
  193. package/plugins/cursor-pbr/templates/ROADMAP.md.tmpl +0 -1
  194. package/plugins/cursor-pbr/templates/SUMMARY.md.tmpl +0 -1
  195. package/plugins/cursor-pbr/templates/VERIFICATION-DETAIL.md.tmpl +0 -1
  196. package/plugins/cursor-pbr/templates/continue-here.md.tmpl +0 -1
  197. package/plugins/cursor-pbr/templates/prompt-partials/phase-project-context.md.tmpl +0 -1
  198. package/plugins/pbr/.claude-plugin/plugin.json +1 -1
  199. package/plugins/pbr/agents/executor.md +0 -2
  200. package/plugins/{cursor-pbr/references → pbr/references/archive}/agent-anti-patterns.md +0 -1
  201. package/plugins/{copilot-pbr/references → pbr/references/archive}/pbr-rules.md +0 -1
  202. package/plugins/pbr/references/signal-files.md +41 -0
  203. package/plugins/pbr/scripts/check-skill-workflow.js +7 -8
  204. package/plugins/pbr/scripts/check-subagent-output.js +7 -6
  205. package/plugins/pbr/scripts/context-budget-check.js +13 -1
  206. package/plugins/pbr/scripts/enforce-pbr-workflow.js +15 -6
  207. package/plugins/pbr/scripts/lib/core.js +53 -1
  208. package/plugins/pbr/scripts/log-subagent.js +7 -10
  209. package/plugins/pbr/scripts/pbr-tools.js +49 -3
  210. package/plugins/pbr/scripts/progress-tracker.js +13 -3
  211. package/plugins/pbr/scripts/session-cleanup.js +6 -0
  212. package/plugins/pbr/scripts/suggest-compact.js +13 -1
  213. package/plugins/pbr/skills/begin/SKILL.md +13 -13
  214. package/plugins/pbr/skills/build/SKILL.md +24 -7
  215. package/plugins/pbr/skills/milestone/SKILL.md +10 -10
  216. package/plugins/pbr/skills/plan/SKILL.md +9 -9
  217. package/plugins/pbr/skills/quick/SKILL.md +3 -3
  218. package/plugins/pbr/skills/review/SKILL.md +6 -6
  219. /package/plugins/{pbr/references → copilot-pbr/references/archive}/agent-anti-patterns.md +0 -0
  220. /package/plugins/copilot-pbr/references/{checkpoints.md → archive/checkpoints.md} +0 -0
  221. /package/plugins/copilot-pbr/references/{context-quality-tiers.md → archive/context-quality-tiers.md} +0 -0
  222. /package/plugins/{pbr/references → copilot-pbr/references/archive}/pbr-rules.md +0 -0
  223. /package/plugins/copilot-pbr/references/{verification-patterns.md → archive/verification-patterns.md} +0 -0
  224. /package/plugins/cursor-pbr/references/{checkpoints.md → archive/checkpoints.md} +0 -0
  225. /package/plugins/cursor-pbr/references/{context-quality-tiers.md → archive/context-quality-tiers.md} +0 -0
  226. /package/plugins/cursor-pbr/references/{verification-patterns.md → archive/verification-patterns.md} +0 -0
  227. /package/plugins/pbr/references/{checkpoints.md → archive/checkpoints.md} +0 -0
  228. /package/plugins/pbr/references/{context-quality-tiers.md → archive/context-quality-tiers.md} +0 -0
  229. /package/plugins/pbr/references/{verification-patterns.md → archive/verification-patterns.md} +0 -0
@@ -3,16 +3,18 @@ name: begin
3
3
  description: "Start a new project. Deep questioning, research, requirements, and roadmap."
4
4
  ---
5
5
 
6
+ **STOP — DO NOT READ THIS FILE. You are already reading it. This prompt was injected into your context by Claude Code's plugin system. Using the Read tool on this SKILL.md file wastes ~7,600 tokens. Begin executing Step 1 immediately.**
7
+
6
8
  # /pbr:begin — Project Initialization
7
9
 
8
- You are the orchestrator for `/pbr:begin`. This skill initializes a new Plan-Build-Run project through deep questioning, optional research, requirements scoping, and roadmap generation. Your job is to stay lean — delegate heavy work to agents and keep the user's main context window clean.
10
+ You are the orchestrator for `/pbr:begin`. This skill initializes a new Plan-Build-Run project through deep questioning, optional research, requirements scoping, and roadmap generation. Your job is to stay lean — delegate heavy work to Task() agents and keep the user's main context window clean.
9
11
 
10
12
  ## Context Budget
11
13
 
12
14
  Reference: `skills/shared/context-budget.md` for the universal orchestrator rules.
13
15
 
14
16
  Additionally for this skill:
15
- - **Minimize** reading agent output — read only summaries, not full research docs
17
+ - **Minimize** reading subagent output — read only summaries, not full research docs
16
18
  - **Delegate** all analysis work to agents — the orchestrator routes, it doesn't analyze
17
19
 
18
20
  ## Step 0 — Immediate Output
@@ -36,7 +38,7 @@ Then proceed to Step 1.
36
38
 
37
39
  ## Orchestration Flow
38
40
 
39
- Execute these steps in order. Each step specifies whether it runs inline (in your context) or is delegated to an agent.
41
+ Execute these steps in order. Each step specifies whether it runs inline (in your context) or is delegated to a subagent.
40
42
 
41
43
  ---
42
44
 
@@ -118,7 +120,7 @@ Have a natural conversation to understand the user's vision. Do NOT present a fo
118
120
 
119
121
  ### Step 3: Workflow Preferences (inline)
120
122
 
121
- After understanding the project, configure the Plan-Build-Run workflow. Present preferences sequentially with conversational bridging (e.g., "Great. Next...") to keep the flow natural.
123
+ After understanding the project, configure the Plan-Build-Run workflow. Use AskUserQuestion for each preference below. Present them sequentially with conversational bridging (e.g., "Great. Next...") to keep the flow natural.
122
124
 
123
125
  **3a. Mode:**
124
126
  Use the **toggle-confirm** pattern from `skills/shared/gate-prompts.md`:
@@ -165,7 +167,7 @@ Use the **yes-no** pattern from `skills/shared/gate-prompts.md`:
165
167
 
166
168
  **After gathering preferences:**
167
169
 
168
- **CRITICAL: You MUST create the .planning/ directory and write config.json NOW. Do not proceed without this.**
170
+ **CRITICAL (no hook): You MUST create the .planning/ directory and write config.json NOW. Do not proceed without this.**
169
171
 
170
172
  1. Read the config template from `skills/begin/templates/config.json.tmpl`
171
173
  2. Apply the user's choices to the template
@@ -174,7 +176,7 @@ Use the **yes-no** pattern from `skills/shared/gate-prompts.md`:
174
176
 
175
177
  **IMPORTANT**: This step MUST happen BEFORE research (Step 5) because depth controls how many researchers to spawn.
176
178
 
177
- **CRITICAL: Write .active-skill NOW.** Write the text "begin" to `.planning/.active-skill` using the Write tool. Verify the file exists before proceeding.
179
+ **CRITICAL (hook-enforced): Write .active-skill NOW.** Write the text "begin" to `.planning/.active-skill` using the Write tool. Verify the file exists before proceeding.
178
180
 
179
181
  ---
180
182
 
@@ -208,9 +210,9 @@ Use the **yes-no** pattern from `skills/shared/gate-prompts.md`:
208
210
 
209
211
  ### Step 5: Research (delegated to agents)
210
212
 
211
- Spawn parallel agents for research. Each researcher writes to `.planning/research/`.
213
+ Spawn parallel Task() agents for research. Each researcher writes to `.planning/research/`.
212
214
 
213
- **CRITICAL: Create .planning/research/ directory NOW before spawning researchers. Do NOT skip this step.**
215
+ **CRITICAL (no hook): Create .planning/research/ directory NOW before spawning researchers. Do NOT skip this step.**
214
216
 
215
217
  **Learnings injection (opt-in):** Before spawning researchers, check if global learnings exist:
216
218
 
@@ -231,13 +233,19 @@ If the command succeeds AND returns a non-empty JSON array:
231
233
 
232
234
  If no learnings exist or the command fails: skip injection silently.
233
235
 
234
- **For each research topic, invoke the @researcher agent:**
236
+ **For each research topic, spawn a Task():**
235
237
 
236
- Invoke `@researcher` with the research prompt constructed from the template.
238
+ ```
239
+ Task({
240
+ subagent_type: "pbr:researcher",
241
+ // After researcher: check for ## RESEARCH COMPLETE or ## RESEARCH BLOCKED
242
+ prompt: <see researcher prompt template below>
243
+ })
244
+ ```
237
245
 
238
- **NOTE**: The `@researcher` agent is defined in `agents/researcher.md`. Do NOT inline the agent definition — it wastes main context.
246
+ **NOTE**: The `pbr:researcher` subagent type auto-loads the agent definition from `agents/researcher.md`. Do NOT inline the agent definition — it wastes main context.
239
247
 
240
- **Path resolution**: Before constructing any agent prompt, resolve plugin root to its absolute path. Use the resolved absolute path for any pbr-tools.js or template references included in the prompt.
248
+ **Path resolution**: Before constructing any agent prompt, resolve `${PLUGIN_ROOT}` to its absolute path. Do not pass the variable literally in prompts — Task() contexts may not expand it. Use the resolved absolute path for any pbr-tools.js or template references included in the prompt.
241
249
 
242
250
  #### Researcher Prompt Template
243
251
 
@@ -246,9 +254,10 @@ For each researcher, construct the prompt by reading the template and filling in
246
254
  Read `skills/begin/templates/researcher-prompt.md.tmpl` for the prompt structure.
247
255
 
248
256
  **Prepend this block to the researcher prompt before sending:**
257
+
249
258
  ```
250
259
  <files_to_read>
251
- CRITICAL: Read these files BEFORE any other action:
260
+ CRITICAL (no hook): Read these files BEFORE any other action:
252
261
  1. .planning/REQUIREMENTS.md — scoped requirements (if exists)
253
262
  {if learnings_temp_path exists}2. {learnings_temp_path} — cross-project learnings (tech stack patterns from past PBR projects){/if}
254
263
  </files_to_read>
@@ -292,28 +301,34 @@ If `{learnings_temp_path}` was produced in the learnings injection step above, r
292
301
  - What security concerns exist?
293
302
 
294
303
  **Parallelization:**
295
- - Spawn ALL researchers in parallel when possible
296
- - Before spawning, display to the user: `Spawning {N} researchers in parallel...`
297
- - When each completes: "{topic} researcher complete ({duration})"
298
- - When all complete: "All {N} researchers finished. Proceeding to synthesis."
304
+ - Spawn ALL researchers in parallel (multiple Task() calls in one response)
305
+ - Use `run_in_background: true` for each researcher
306
+ - Before spawning, display to the user: `◐ Spawning {N} researchers in parallel...`
307
+ - While waiting, display progress to the user:
308
+ - After spawning: list of topics being researched
309
+ - Periodically (every ~30s): check `TaskOutput` with `block: false` for each agent and report status
310
+ - When each completes: "✓ {topic} researcher complete ({duration})"
311
+ - When all complete: "All {N} researchers finished. Proceeding to synthesis."
299
312
  - Wait for all to complete before proceeding
300
313
 
301
- **After each researcher completes**, check the agent output for a completion marker:
302
- - If `## RESEARCH COMPLETE` is present: researcher finished successfully, proceed
303
- - If `## RESEARCH BLOCKED` is present: warn the user that research could not complete, ask if they want to proceed with limited context or stop
304
- - If neither marker is present: warn that researcher may not have completed successfully, but proceed if output files exist on disk
305
-
306
314
  ---
307
315
 
308
- ### Step 6: Synthesis (delegated to agent)
316
+ ### Step 6: Synthesis (delegated to subagent)
317
+
318
+ After all researchers complete, display to the user: `◐ Spawning synthesizer...`
309
319
 
310
- After all researchers complete, display to the user: `Spawning synthesizer...`
320
+ Spawn a synthesis agent:
311
321
 
312
- Invoke the `@synthesizer` agent with the synthesis prompt.
322
+ ```
323
+ Task({
324
+ subagent_type: "pbr:synthesizer",
325
+ prompt: <synthesis prompt>
326
+ })
327
+ ```
313
328
 
314
- **NOTE**: The `@synthesizer` agent is defined in `agents/synthesizer.md`. Do NOT inline it.
329
+ **NOTE**: The `pbr:synthesizer` subagent type auto-loads the agent definition. Do NOT inline it. The agent definition specifies `model: sonnet` — do not override it.
315
330
 
316
- **Path resolution**: Before constructing the agent prompt, resolve plugin root to its absolute path. Do not pass the variable literally in prompts.
331
+ **Path resolution**: Before constructing the agent prompt, resolve `${PLUGIN_ROOT}` to its absolute path. Do not pass the variable literally in prompts — Task() contexts may not expand it.
317
332
 
318
333
  #### Synthesis Prompt Template
319
334
 
@@ -322,7 +337,7 @@ Read `skills/begin/templates/synthesis-prompt.md.tmpl` for the prompt structure.
322
337
  **Prepend this block to the synthesizer prompt before sending:**
323
338
  ```
324
339
  <files_to_read>
325
- CRITICAL: Read these files BEFORE any other action:
340
+ CRITICAL (no hook): Read these files BEFORE any other action:
326
341
  1. .planning/research/*.md — all research output files from Step 5
327
342
  </files_to_read>
328
343
  ```
@@ -390,7 +405,7 @@ Each requirement must be:
390
405
 
391
406
  **7e. Write REQUIREMENTS.md:**
392
407
 
393
- **CRITICAL: Write REQUIREMENTS.md NOW. The roadmap planner depends on this file.**
408
+ **CRITICAL (no hook): Write REQUIREMENTS.md NOW. The roadmap planner depends on this file.**
394
409
 
395
410
  Read the template from `skills/begin/templates/REQUIREMENTS.md.tmpl` and write `.planning/REQUIREMENTS.md` with:
396
411
  - All v1 requirements grouped by category
@@ -400,15 +415,23 @@ Read the template from `skills/begin/templates/REQUIREMENTS.md.tmpl` and write `
400
415
 
401
416
  ---
402
417
 
403
- ### Step 8: Roadmap Generation (delegated to agent)
418
+ ### Step 8: Roadmap Generation (delegated to subagent)
419
+
420
+ Display to the user: `◐ Spawning planner (roadmap)...`
404
421
 
405
- Display to the user: `Spawning planner (roadmap)...`
422
+ Spawn the planner in roadmap mode:
406
423
 
407
- Invoke the `@planner` agent in roadmap mode with the roadmap prompt.
424
+ ```
425
+ Task({
426
+ subagent_type: "pbr:planner",
427
+ // After planner: check for ## PLANNING COMPLETE or ## PLANNING FAILED
428
+ prompt: <roadmap prompt>
429
+ })
430
+ ```
408
431
 
409
- **NOTE**: The `@planner` agent is defined in `agents/planner.md`. Do NOT inline it. The planner agent will read REQUIREMENTS.md and SUMMARY.md from disk — you only need to tell it what to do and where files are.
432
+ **NOTE**: The `pbr:planner` subagent type auto-loads the agent definition. Do NOT inline it. The planner agent will read REQUIREMENTS.md and SUMMARY.md from disk — you only need to tell it what to do and where files are.
410
433
 
411
- **Path resolution**: Before constructing the agent prompt, resolve plugin root to its absolute path. Do not pass the variable literally in prompts.
434
+ **Path resolution**: Before constructing the agent prompt, resolve `${PLUGIN_ROOT}` to its absolute path. Do not pass the variable literally in prompts — Task() contexts may not expand it.
412
435
 
413
436
  #### Roadmap Prompt Template
414
437
 
@@ -417,7 +440,7 @@ Read `skills/begin/templates/roadmap-prompt.md.tmpl` for the prompt structure.
417
440
  **Prepend this block to the roadmap planner prompt before sending:**
418
441
  ```
419
442
  <files_to_read>
420
- CRITICAL: Read these files BEFORE any other action:
443
+ CRITICAL (no hook): Read these files BEFORE any other action:
421
444
  1. .planning/REQUIREMENTS.md — scoped requirements for phase planning
422
445
  2. .planning/research/SUMMARY.md — research synthesis (if exists)
423
446
  </files_to_read>
@@ -428,17 +451,14 @@ CRITICAL: Read these files BEFORE any other action:
428
451
  - `{description}` — project description from Step 2
429
452
  - `{quick|standard|comprehensive}` — depth setting from Step 3
430
453
 
431
- **After the planner completes**, check the agent output for a completion marker:
432
- - If `## PLANNING COMPLETE` is present: planner finished successfully, proceed
433
- - If `## PLANNING FAILED` is present: warn the user that planning could not complete, display the reason, and offer to retry or abort
434
- - If neither marker is present: warn that planner may not have completed successfully, but proceed if ROADMAP.md exists on disk
435
-
454
+ **After the planner completes:**
436
455
  - **Spot-check:** Verify `.planning/ROADMAP.md` exists on disk using Glob before attempting to read it. If missing, the planner may have failed silently — warn: `⚠ ROADMAP.md not found after planner completed. Re-spawning planner...` and retry once.
437
456
  - Read `.planning/ROADMAP.md`
438
- - Count the phases and milestones from the roadmap content
457
+ - Count the phases from the roadmap content
458
+ - Verify the roadmap contains a `## Milestone:` section wrapping the phases (the planner should generate this). If not, the initial set of phases constitutes the first milestone — add the section header yourself.
439
459
  - Display:
440
460
  ```
441
- Roadmap created — {N} phases across {M} milestones
461
+ Roadmap created — {N} phases in milestone "{name}"
442
462
  ```
443
463
  - If `gates.confirm_roadmap` is true in config, use the **approve-revise-abort** pattern from `skills/shared/gate-prompts.md`:
444
464
  question: "Approve this roadmap?"
@@ -446,7 +466,7 @@ CRITICAL: Read these files BEFORE any other action:
446
466
  - label: "Approve" description: "Proceed with this roadmap"
447
467
  - label: "Request changes" description: "Discuss adjustments before proceeding"
448
468
  - label: "Abort" description: "Cancel and start over"
449
- - If user selects "Request changes": edit the roadmap inline (small changes) or re-invoke planner
469
+ - If user selects "Request changes": edit the roadmap inline (small changes) or re-spawn planner
450
470
  - If user selects "Approve": proceed to Step 9
451
471
  - If user selects "Abort": stop execution
452
472
 
@@ -456,9 +476,9 @@ CRITICAL: Read these files BEFORE any other action:
456
476
 
457
477
  Write the project state files from templates:
458
478
 
459
- **CRITICAL: You MUST write all 5 state initialization files (Steps 9a-9e). Do NOT skip any.**
479
+ **CRITICAL (no hook): You MUST write all 5 state initialization files (Steps 9a-9e). Do NOT skip any.**
460
480
 
461
- **CRITICAL: Write PROJECT.md NOW. Do NOT skip this step.**
481
+ **CRITICAL (no hook): Write PROJECT.md NOW. Do NOT skip this step.**
462
482
 
463
483
  **9a. Write PROJECT.md:**
464
484
  1. Read `skills/begin/templates/PROJECT.md.tmpl`
@@ -472,7 +492,7 @@ Write the project state files from templates:
472
492
  3. Write to `.planning/PROJECT.md`
473
493
  4. Ensure the `## Milestones` section is filled in with the project name and phase count from the roadmap
474
494
 
475
- **CRITICAL: Write STATE.md NOW. Do NOT skip this step.**
495
+ **CRITICAL (no hook): Write STATE.md NOW. Do NOT skip this step.**
476
496
 
477
497
  **9b. Write STATE.md:**
478
498
  1. Read `skills/begin/templates/STATE.md.tmpl`
@@ -486,7 +506,7 @@ Write the project state files from templates:
486
506
  4. Fill in the `## Milestone` section with the project name and total phase count
487
507
  5. **STATE.md size limit**: Follow size limit enforcement rules in `skills/shared/state-update.md` (150 lines max).
488
508
 
489
- **CRITICAL: Write CONTEXT.md NOW. Do NOT skip this step.**
509
+ **CRITICAL (no hook): Write CONTEXT.md NOW. Do NOT skip this step.**
490
510
 
491
511
  **9c. Write CONTEXT.md:**
492
512
  Create `.planning/CONTEXT.md` from information gathered during questioning:
@@ -512,7 +532,7 @@ Create `.planning/CONTEXT.md` from information gathered during questioning:
512
532
  | {feature} | {reason} |
513
533
  ```
514
534
 
515
- **CRITICAL: Write HISTORY.md NOW. Do NOT skip this step.**
535
+ **CRITICAL (no hook): Write HISTORY.md NOW. Do NOT skip this step.**
516
536
 
517
537
  **9d. Write HISTORY.md:**
518
538
  Create `.planning/HISTORY.md` with an initial entry:
@@ -527,7 +547,7 @@ Create `.planning/HISTORY.md` with an initial entry:
527
547
  - Roadmap: {N} phases planned
528
548
  ```
529
549
 
530
- **CRITICAL: Create phase directories NOW. Do NOT skip this step.**
550
+ **CRITICAL (no hook): Create phase directories NOW. Do NOT skip this step.**
531
551
 
532
552
  **9e. Create phase directories:**
533
553
  For each phase in the roadmap, create the directory structure:
@@ -587,10 +607,10 @@ Display the `PROJECT INITIALIZED ✓` banner with project name, core value, phas
587
607
  ## Error Handling
588
608
 
589
609
  ### Research agent fails
590
- If a researcher agent fails or times out:
610
+ If a researcher Task() fails or times out:
591
611
  - Note which topic wasn't researched
592
612
  - Continue with available research
593
- - Display: "Research on {topic} failed. Proceeding without it. You can re-research during /pbr:plan."
613
+ - Display: `⚠ Research on {topic} failed. Proceeding without it. You can re-research during /pbr:plan.`
594
614
 
595
615
  ### User wants to restart
596
616
  If user says they want to start over mid-flow:
@@ -600,7 +620,9 @@ If user says they want to start over mid-flow:
600
620
  ### Config write fails
601
621
  If `.planning/` directory can't be created, display:
602
622
  ```
603
- ERROR
623
+ ╔══════════════════════════════════════════════════════════════╗
624
+ ║ ERROR ║
625
+ ╚══════════════════════════════════════════════════════════════╝
604
626
 
605
627
  Cannot create .planning/ directory.
606
628
 
@@ -64,7 +64,7 @@ Reference: `skills/shared/config-loading.md` for the tooling shortcut and config
64
64
  1. Parse `$ARGUMENTS` for phase number and flags
65
65
  2. Read `.planning/config.json` for parallelization, model, and gate settings (see config-loading.md for field reference)
66
66
  3. Resolve depth profile: run `node ${PLUGIN_ROOT}/scripts/pbr-tools.js config resolve-depth` to get the effective feature/gate settings for the current depth. Store the result for use in later gating decisions.
67
- 4. **CRITICAL: Write .active-skill NOW.** Write `.planning/.active-skill` with the content `build` (registers with workflow enforcement hook)
67
+ 4. **CRITICAL (hook-enforced): Write .active-skill NOW.** Write `.planning/.active-skill` with the content `build` (registers with workflow enforcement hook)
68
68
  5. Validate:
69
69
  - Phase directory exists at `.planning/phases/{NN}-{slug}/`
70
70
  - PLAN.md files exist in the directory
@@ -83,27 +83,17 @@ Reference: `skills/shared/config-loading.md` for the tooling shortcut and config
83
83
 
84
84
  **Staleness check (dependency fingerprints):**
85
85
  After validating prerequisites, check plan staleness:
86
- 1. Read each PLAN.md file's `dependency_fingerprints` field (if present)
87
- 2. For each fingerprinted dependency, check the current SUMMARY.md file (length + modification time)
88
- 3. If any fingerprint doesn't match: the dependency phase was re-built after this plan was created
89
- 4. Use AskUserQuestion (pattern: stale-continue from `skills/shared/gate-prompts.md`):
90
- question: "Plan {plan_id} may be stale — dependency phase {M} was re-built after this plan was created."
91
- header: "Stale"
92
- options:
93
- - label: "Continue anyway" description: "Proceed with existing plans (may still be valid)"
94
- - label: "Re-plan" description: "Stop and re-plan with `/pbr:plan {N}` (recommended)"
95
- If "Re-plan" or "Other": stop and suggest `/pbr:plan {N}`
96
- If "Continue anyway": proceed with existing plans
97
- 10. If plans have no `dependency_fingerprints` field, fall back to timestamp-based staleness detection:
98
- a. Read `.planning/ROADMAP.md` and identify the current phase's dependencies (the `depends_on` field)
99
- b. For each dependency phase, find its phase directory under `.planning/phases/`
100
- c. Check if any SUMMARY.md files in the dependency phase directory have a modification timestamp newer than the current phase's PLAN.md files
101
- d. If any upstream dependency was modified after planning, display a warning (do NOT block):
102
- ```
103
- Warning: Phase {dep_phase} (dependency of Phase {N}) was modified after this phase was planned.
104
- Plans may be based on outdated assumptions. Consider re-planning with `/pbr:plan {N}`.
105
- ```
106
- e. This is advisory only — continue with the build after displaying the warning
86
+
87
+ ```bash
88
+ node ${PLUGIN_ROOT}/scripts/pbr-tools.js staleness-check {phase-slug}
89
+ ```
90
+
91
+ Returns `{ stale: bool, plans: [{id, stale, reason}] }`. If `stale: true` for any plan:
92
+ - Use AskUserQuestion (pattern: stale-continue from `skills/shared/gate-prompts.md`):
93
+ question: "Plan {plan_id} may be stale {reason}"
94
+ options: ["Continue anyway", "Re-plan with /pbr:plan {N}"]
95
+ - If "Re-plan": stop. If "Continue anyway": proceed.
96
+ If `stale: false`: proceed silently.
107
97
 
108
98
  **Validation errors — use branded error boxes:**
109
99
 
@@ -199,30 +189,19 @@ Validate wave consistency:
199
189
 
200
190
  ### Step 5b: Write Checkpoint Manifest (inline)
201
191
 
202
- **CRITICAL: Write .checkpoint-manifest.json NOW before entering the wave loop.**
192
+ **CRITICAL (hook-enforced): Initialize checkpoint manifest NOW before entering the wave loop.**
203
193
 
204
- Before entering the wave loop, write `.planning/phases/{NN}-{slug}/.checkpoint-manifest.json`:
205
-
206
- ```json
207
- {
208
- "plans": ["02-01", "02-02", "02-03"],
209
- "checkpoints_resolved": [],
210
- "checkpoints_pending": [],
211
- "wave": 1,
212
- "deferred": [],
213
- "commit_log": [],
214
- "last_good_commit": null
215
- }
194
+ ```bash
195
+ node ${PLUGIN_ROOT}/scripts/pbr-tools.js checkpoint init {phase-slug} --plans "{comma-separated plan IDs}"
216
196
  ```
217
197
 
218
- This file tracks execution progress for crash recovery and rollback. On resume after compaction, read this manifest to determine where execution left off and which plans still need work.
198
+ After each wave completes, update the manifest:
199
+
200
+ ```bash
201
+ node ${PLUGIN_ROOT}/scripts/pbr-tools.js checkpoint update {phase-slug} --wave {N} --resolved {plan-id} --sha {commit-sha}
202
+ ```
219
203
 
220
- Update the manifest after each wave completes:
221
- - Move completed plan IDs into `checkpoints_resolved`
222
- - Advance the `wave` counter
223
- - Record commit SHAs in `commit_log` (array of `{ plan, sha, timestamp }` objects)
224
- - Update `last_good_commit` to the SHA of the last successfully verified commit
225
- - Append any deferred items collected from executor SUMMARYs
204
+ This tracks execution for crash recovery and rollback. Read `.checkpoint-manifest.json` on resume to reconstruct which plans are complete.
226
205
 
227
206
  ---
228
207
 
@@ -326,11 +305,11 @@ Use the filled template as the Task() prompt.
326
305
 
327
306
  ```
328
307
  Task({
329
- agent_type: "pbr:executor",
308
+ subagent_type: "pbr:executor",
330
309
  prompt: <executor prompt constructed above>
331
310
  })
332
311
 
333
- NOTE: The pbr:executor agent type auto-loads the agent definition.
312
+ NOTE: The pbr:executor subagent type auto-loads the agent definition.
334
313
 
335
314
  After executor completes, check for completion markers: `## PLAN COMPLETE`, `## PLAN FAILED`, or `## CHECKPOINT: {TYPE}`. Route accordingly — PLAN COMPLETE proceeds to next plan, PLAN FAILED triggers failure handling, CHECKPOINT triggers checkpoint flow. Do NOT inline it.
336
315
  ```
@@ -358,7 +337,7 @@ For each completed executor:
358
337
 
359
338
  **Spot-check executor claims:**
360
339
 
361
- CRITICAL: Before reading results or advancing to the next wave, run the spot-check CLI for each completed plan.
340
+ CRITICAL (no hook): Before reading results or advancing to the next wave, run the spot-check CLI for each completed plan.
362
341
 
363
342
  For each completed plan in this wave:
364
343
 
@@ -393,13 +372,7 @@ Use AskUserQuestion with the three options. Route:
393
372
  - Also search SUMMARY.md for `## Self-Check: FAILED` marker — if present, warn before next wave
394
373
  - Between waves: verify no file conflicts from parallel executors (`git status` for uncommitted changes)
395
374
 
396
- **Additional wave spot-checks:**
397
- - Check for `## Self-Check: FAILED` in SUMMARY.md — if present, warn user before proceeding to next wave
398
- - Between waves: verify no file conflicts from parallel executors (check `git status` for uncommitted changes)
399
- - If ANY spot-check fails, present user with: **Retry this plan** / **Continue to next wave** / **Abort build**
400
-
401
375
  **Read executor deviations:**
402
-
403
376
  After all executors in the wave complete, read all SUMMARY frontmatter and:
404
377
  - Collect `deferred` items into a running list (append to `.checkpoint-manifest.json` deferred array)
405
378
  - Flag any deviation-rule-4 (architectural) stops — these require user attention
@@ -420,16 +393,14 @@ Wave {W} Results:
420
393
 
421
394
  **Skip if** the depth profile has `features.inline_verify: false`.
422
395
 
423
- To check: use the resolved depth profile. Only `comprehensive` mode enables inline verification by default.
424
-
425
- When inline verification is enabled, each completed plan gets a targeted verification pass before the orchestrator proceeds to the next wave. This catches issues early — before dependent plans build on a broken foundation.
396
+ To check: use the resolved depth profile. Only `comprehensive` mode enables inline verification by default. When inline verification is enabled, each completed plan gets a targeted verification pass before the orchestrator proceeds to the next wave — catching issues early before dependent plans build on a broken foundation.
426
397
 
427
398
  For each plan that completed successfully in this wave:
428
399
 
429
400
  1. Read the plan's SUMMARY.md to get `key_files` (the files this plan created/modified)
430
401
  2. Display to the user: `◐ Spawning inline verifier for plan {plan_id}...`
431
402
 
432
- Spawn `Task({ agent_type: "pbr:verifier", model: "haiku", prompt: ... })`. Read `skills/build/templates/inline-verifier-prompt.md.tmpl` and fill in `{NN}-{slug}`, `{plan_id}`, and `{comma-separated key_files list}` (key_files from PLAN.md frontmatter). Use the filled template as the `prompt` value.
403
+ Spawn `Task({ subagent_type: "pbr:verifier", model: "haiku", prompt: ... })`. Read `skills/build/templates/inline-verifier-prompt.md.tmpl` and fill in `{NN}-{slug}`, `{plan_id}`, and `{comma-separated key_files list}` (key_files from PLAN.md frontmatter). Use the filled template as the `prompt` value.
433
404
 
434
405
  3. If verifier reports FAIL for any file:
435
406
  - Present the failure to the user: "Inline verify failed for plan {plan_id}: {details}"
@@ -557,22 +528,20 @@ If `config.ci.gate_enabled` is `true` AND `config.git.branching` is not `none`:
557
528
  7. If `next_action` is `"abort"` or `status` is `"failed"`:
558
529
  Show warning box and use AskUserQuestion: Wait / Continue anyway / Abort
559
530
  8. If "Continue anyway": log deviation — `DEVIATION: CI gate bypassed for wave {N}`
560
- 8. If "Abort": stop build, update STATE.md
531
+ 9. If "Abort": stop build, update STATE.md
561
532
 
562
533
  #### 6f. Update STATE.md
563
534
 
564
535
  After each wave completes (all plans in the wave are done, skipped, or aborted):
565
536
 
566
537
  **SUMMARY gate — verify before updating STATE.md:**
538
+ For every plan in the wave, run:
567
539
 
568
- Before writing any STATE.md update, verify these three gates for every plan in the wave:
569
- 1. SUMMARY file exists at the expected path
570
- 2. SUMMARY file is not empty (file size > 0)
571
- 3. SUMMARY file has a valid title and YAML frontmatter (contains `---` delimiters and a `status:` field)
540
+ ```bash
541
+ node ${PLUGIN_ROOT}/scripts/pbr-tools.js summary-gate {phase-slug} {plan-id}
542
+ ```
572
543
 
573
- Block the STATE.md update until ALL gates pass. If any gate fails:
574
- - Warn user: "SUMMARY gate failed for plan {id}: {which gate}. Cannot update STATE.md."
575
- - Ask user to retry the executor or manually inspect the SUMMARY file
544
+ Returns `{ ok: bool, gate: string, detail: string }`. Block STATE.md update until ALL plans return `ok: true`. If any fail, warn: "SUMMARY gate failed for plan {id}: {gate} — {detail}. Cannot update STATE.md."
576
545
 
577
546
  Once gates pass, update `.planning/STATE.md`:
578
547
 
@@ -590,6 +559,12 @@ node ${PLUGIN_ROOT}/scripts/pbr-tools.js state update last_activity now
590
559
 
591
560
  **STATE.md size limit:** Follow the size limit enforcement rules in `skills/shared/state-update.md` (150 lines max — collapse completed phases, remove duplicated decisions, trim old sessions).
592
561
 
562
+ **Completion check:** Before proceeding to next wave, confirm ALL of:
563
+ - [ ] SUMMARY gate passed for every plan in this wave
564
+ - [ ] STATE.md frontmatter `plans_complete` updated
565
+ - [ ] STATE.md body progress bar updated
566
+ - [ ] `last_activity` timestamp refreshed
567
+
593
568
  ---
594
569
 
595
570
  ### Step 7: Phase Verification (delegated, conditional)
@@ -616,11 +591,11 @@ Spawn a verifier Task():
616
591
 
617
592
  ```
618
593
  Task({
619
- agent_type: "pbr:verifier",
594
+ subagent_type: "pbr:verifier",
620
595
  prompt: <verifier prompt>
621
596
  })
622
597
 
623
- NOTE: The pbr:verifier agent type auto-loads the agent definition. Do NOT inline it.
598
+ NOTE: The pbr:verifier subagent type auto-loads the agent definition. Do NOT inline it.
624
599
 
625
600
  After verifier completes, check for completion marker: `## VERIFICATION COMPLETE`. Read VERIFICATION.md frontmatter for status.
626
601
  ```
@@ -634,7 +609,7 @@ Use the same verifier prompt template as defined in `/pbr:review`: read `skills/
634
609
  **Prepend this block to the verifier prompt before sending:**
635
610
  ```
636
611
  <files_to_read>
637
- CRITICAL: Read these files BEFORE any other action:
612
+ CRITICAL (no hook): Read these files BEFORE any other action:
638
613
  1. .planning/phases/{NN}-{slug}/PLAN-*.md — must-haves to verify against
639
614
  2. .planning/phases/{NN}-{slug}/SUMMARY-*.md — executor build summaries
640
615
  3. .planning/phases/{NN}-{slug}/VERIFICATION.md — prior verification results (if exists)
@@ -685,14 +660,14 @@ If triggered:
685
660
  Spawn a lightweight mapper Task():
686
661
  ```
687
662
  Task({
688
- agent_type: "pbr:codebase-mapper",
663
+ subagent_type: "pbr:codebase-mapper",
689
664
  model: "haiku",
690
665
  prompt: "Incremental codebase map update. These files changed during the Phase {N} build:\n{diff file list}\n\nRead the existing .planning/codebase/ documents. Update ONLY the sections affected by these changes. Do NOT rewrite entire documents — make targeted updates. If a new dependency was added, update STACK.md. If new directories/modules were created, update STRUCTURE.md. If new patterns were introduced, update CONVENTIONS.md. Write updated files to .planning/codebase/."
691
666
  })
692
667
  ```
693
668
  4. Do NOT block on this — use `run_in_background: true` and continue to Step 8a. Report completion in Step 8f if it finishes in time.
694
669
 
695
- **CRITICAL: Update ROADMAP.md progress table NOW. Do NOT skip this step.**
670
+ **CRITICAL (no hook): Update ROADMAP.md progress table NOW. Do NOT skip this step. (roadmap-sync warns)**
696
671
 
697
672
  **8a. Update ROADMAP.md Progress table** (REQUIRED — do this BEFORE updating STATE.md):
698
673
 
@@ -710,13 +685,18 @@ These return `{ success, old_status, new_status }` or `{ success, old_plans, new
710
685
  5. Update the `Status` column to the final_status determined in Step 8-pre
711
686
  6. Save the file — do NOT skip this step
712
687
 
713
- **CRITICAL: Update STATE.md NOW with phase completion status. Do NOT skip this step.**
688
+ **CRITICAL (no hook): Update STATE.md NOW with phase completion status. Do NOT skip this step. (state-sync warns)**
714
689
 
715
- **8b. Update STATE.md (CRITICAL — update BOTH frontmatter AND body):**
690
+ **8b. Update STATE.md (CRITICAL (no hook) — update BOTH frontmatter AND body):**
716
691
  - Frontmatter: `status`, `plans_complete`, `last_activity`, `progress_percent`, `last_command`
717
692
  - Body `## Current Position`: `Phase:` line, `Plan:` line, `Status:` line, `Last activity:` line, `Progress:` bar
718
693
  - These MUST stay in sync — the status line reads frontmatter, humans read the body
719
694
 
695
+ **Completion check:** Before proceeding to 8c, confirm ALL of:
696
+ - [ ] STATE.md frontmatter fields set: status, plans_complete, last_activity, progress_percent, last_command
697
+ - [ ] STATE.md body ## Current Position updated: Phase, Status, Last activity, Progress bar
698
+ - [ ] Frontmatter and body are consistent (same status value in both)
699
+
720
700
  **8c. Commit planning docs (if configured):**
721
701
  Reference: `skills/shared/commit-planning-docs.md` for the standard commit pattern.
722
702
  If `planning.commit_docs` is `true`:
@@ -780,6 +760,12 @@ After invoking the chained skill, it runs within the same session. When it compl
780
760
  Write `.planning/.auto-next` containing the next logical command (e.g., `/pbr:plan {N+1}` or `/pbr:review {N}`)
781
761
  - This file signals to the user or to wrapper scripts that the next step is ready
782
762
 
763
+ **Completion check:** Before proceeding to 8f, confirm ALL of:
764
+ - [ ] auto_advance OR auto_continue evaluated (one path taken)
765
+ - [ ] If auto_continue: `.auto-next` file written with correct next command
766
+ - [ ] Pending todos evaluated (Step 8e-ii)
767
+ - [ ] Clearly-satisfied todos auto-closed via `pbr-tools.js todo done`
768
+
783
769
  **8e-ii. Check Pending Todos:**
784
770
 
785
771
  **CRITICAL (no hook): Check pending todos after build. Do NOT skip this step.**
@@ -834,6 +820,8 @@ Then present the appropriate branded banner from Read `references/ui-formatting.
834
820
  - **If `passed` + last phase:** Use the "Milestone Complete" template. Fill in phase count.
835
821
  - **If `gaps_found`:** Use the "Gaps Found" template. Fill in phase number, name, score, and gap summaries from VERIFICATION.md.
836
822
 
823
+ Include `<sub>/clear first → fresh context window</sub>` inside the Next Up routing block of the completion template.
824
+
837
825
  **8g. Display USER-SETUP.md (conditional):**
838
826
 
839
827
  Check if `.planning/phases/{NN}-{slug}/USER-SETUP.md` exists. If it does:
@@ -3,6 +3,8 @@ name: config
3
3
  description: "Configure settings: depth, model profiles, features, git, and gates."
4
4
  ---
5
5
 
6
+ **STOP — DO NOT READ THIS FILE. You are already reading it. This prompt was injected into your context by Claude Code's plugin system. Using the Read tool on this SKILL.md file wastes ~7,600 tokens. Begin executing Step 1 immediately.**
7
+
6
8
  ## Step 0 — Immediate Output
7
9
 
8
10
  **Before ANY tool calls**, display this banner:
@@ -203,6 +205,7 @@ Updated:
203
205
  models.executor: inherit → sonnet
204
206
 
205
207
 
208
+
206
209
  ╔══════════════════════════════════════════════════════════════╗
207
210
  ║ ▶ NEXT UP ║
208
211
  ╚══════════════════════════════════════════════════════════════╝
@@ -214,10 +217,12 @@ Updated:
214
217
  <sub>`/clear` first → fresh context window</sub>
215
218
 
216
219
 
220
+
217
221
  **Also available:**
218
222
  - `/pbr:continue` — execute next logical step
219
223
  - `/pbr:config` — change more settings
220
224
 
225
+
221
226
  ```
222
227
 
223
228
  ## Config Schema