@sienklogic/plan-build-run 2.9.1 → 2.11.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 (128) hide show
  1. package/CHANGELOG.md +44 -0
  2. package/package.json +1 -1
  3. package/plugins/copilot-pbr/agents/codebase-mapper.agent.md +42 -0
  4. package/plugins/copilot-pbr/agents/debugger.agent.md +4 -1
  5. package/plugins/copilot-pbr/agents/executor.agent.md +31 -1
  6. package/plugins/copilot-pbr/agents/integration-checker.agent.md +33 -2
  7. package/plugins/copilot-pbr/agents/planner.agent.md +58 -1
  8. package/plugins/copilot-pbr/agents/researcher.agent.md +23 -0
  9. package/plugins/copilot-pbr/agents/synthesizer.agent.md +24 -0
  10. package/plugins/copilot-pbr/agents/verifier.agent.md +35 -1
  11. package/plugins/copilot-pbr/plugin.json +1 -1
  12. package/plugins/copilot-pbr/references/agent-contracts.md +297 -0
  13. package/plugins/copilot-pbr/references/pbr-rules.md +1 -0
  14. package/plugins/copilot-pbr/references/pbr-tools-cli.md +285 -0
  15. package/plugins/copilot-pbr/references/ui-formatting.md +38 -56
  16. package/plugins/copilot-pbr/skills/begin/SKILL.md +30 -7
  17. package/plugins/copilot-pbr/skills/build/SKILL.md +28 -31
  18. package/plugins/copilot-pbr/skills/config/SKILL.md +9 -12
  19. package/plugins/copilot-pbr/skills/continue/SKILL.md +6 -6
  20. package/plugins/copilot-pbr/skills/dashboard/SKILL.md +12 -0
  21. package/plugins/copilot-pbr/skills/debug/SKILL.md +23 -26
  22. package/plugins/copilot-pbr/skills/discuss/SKILL.md +20 -10
  23. package/plugins/copilot-pbr/skills/do/SKILL.md +3 -3
  24. package/plugins/copilot-pbr/skills/explore/SKILL.md +11 -14
  25. package/plugins/copilot-pbr/skills/health/SKILL.md +75 -19
  26. package/plugins/copilot-pbr/skills/help/SKILL.md +6 -6
  27. package/plugins/copilot-pbr/skills/import/SKILL.md +22 -18
  28. package/plugins/copilot-pbr/skills/milestone/SKILL.md +90 -48
  29. package/plugins/copilot-pbr/skills/note/SKILL.md +3 -3
  30. package/plugins/copilot-pbr/skills/pause/SKILL.md +11 -10
  31. package/plugins/copilot-pbr/skills/plan/SKILL.md +22 -9
  32. package/plugins/copilot-pbr/skills/plan/templates/planner-prompt.md.tmpl +1 -1
  33. package/plugins/copilot-pbr/skills/quick/SKILL.md +9 -12
  34. package/plugins/copilot-pbr/skills/resume/SKILL.md +9 -9
  35. package/plugins/copilot-pbr/skills/review/SKILL.md +17 -12
  36. package/plugins/copilot-pbr/skills/scan/SKILL.md +9 -11
  37. package/plugins/copilot-pbr/skills/setup/SKILL.md +54 -8
  38. package/plugins/copilot-pbr/skills/shared/error-reporting.md +2 -1
  39. package/plugins/copilot-pbr/skills/shared/progress-display.md +0 -1
  40. package/plugins/copilot-pbr/skills/shared/universal-anti-patterns.md +10 -6
  41. package/plugins/copilot-pbr/skills/status/SKILL.md +3 -3
  42. package/plugins/copilot-pbr/skills/statusline/SKILL.md +12 -8
  43. package/plugins/copilot-pbr/skills/todo/SKILL.md +51 -28
  44. package/plugins/cursor-pbr/.cursor-plugin/plugin.json +1 -1
  45. package/plugins/cursor-pbr/agents/codebase-mapper.md +42 -0
  46. package/plugins/cursor-pbr/agents/debugger.md +4 -1
  47. package/plugins/cursor-pbr/agents/executor.md +31 -1
  48. package/plugins/cursor-pbr/agents/integration-checker.md +33 -2
  49. package/plugins/cursor-pbr/agents/planner.md +58 -1
  50. package/plugins/cursor-pbr/agents/researcher.md +23 -0
  51. package/plugins/cursor-pbr/agents/synthesizer.md +24 -0
  52. package/plugins/cursor-pbr/agents/verifier.md +35 -1
  53. package/plugins/cursor-pbr/references/agent-contracts.md +297 -0
  54. package/plugins/cursor-pbr/references/pbr-rules.md +1 -0
  55. package/plugins/cursor-pbr/references/pbr-tools-cli.md +285 -0
  56. package/plugins/cursor-pbr/references/ui-formatting.md +38 -56
  57. package/plugins/cursor-pbr/skills/begin/SKILL.md +30 -7
  58. package/plugins/cursor-pbr/skills/build/SKILL.md +28 -31
  59. package/plugins/cursor-pbr/skills/config/SKILL.md +9 -10
  60. package/plugins/cursor-pbr/skills/continue/SKILL.md +6 -6
  61. package/plugins/cursor-pbr/skills/dashboard/SKILL.md +12 -0
  62. package/plugins/cursor-pbr/skills/debug/SKILL.md +23 -23
  63. package/plugins/cursor-pbr/skills/discuss/SKILL.md +20 -10
  64. package/plugins/cursor-pbr/skills/do/SKILL.md +3 -3
  65. package/plugins/cursor-pbr/skills/explore/SKILL.md +11 -12
  66. package/plugins/cursor-pbr/skills/health/SKILL.md +75 -19
  67. package/plugins/cursor-pbr/skills/help/SKILL.md +6 -6
  68. package/plugins/cursor-pbr/skills/import/SKILL.md +22 -16
  69. package/plugins/cursor-pbr/skills/milestone/SKILL.md +90 -48
  70. package/plugins/cursor-pbr/skills/note/SKILL.md +3 -3
  71. package/plugins/cursor-pbr/skills/pause/SKILL.md +11 -9
  72. package/plugins/cursor-pbr/skills/plan/SKILL.md +22 -9
  73. package/plugins/cursor-pbr/skills/plan/templates/planner-prompt.md.tmpl +1 -1
  74. package/plugins/cursor-pbr/skills/quick/SKILL.md +9 -12
  75. package/plugins/cursor-pbr/skills/resume/SKILL.md +9 -9
  76. package/plugins/cursor-pbr/skills/review/SKILL.md +17 -12
  77. package/plugins/cursor-pbr/skills/scan/SKILL.md +9 -10
  78. package/plugins/cursor-pbr/skills/setup/SKILL.md +54 -8
  79. package/plugins/cursor-pbr/skills/shared/error-reporting.md +2 -1
  80. package/plugins/cursor-pbr/skills/shared/progress-display.md +0 -1
  81. package/plugins/cursor-pbr/skills/shared/universal-anti-patterns.md +10 -6
  82. package/plugins/cursor-pbr/skills/status/SKILL.md +3 -3
  83. package/plugins/cursor-pbr/skills/statusline/SKILL.md +12 -8
  84. package/plugins/cursor-pbr/skills/todo/SKILL.md +51 -28
  85. package/plugins/pbr/.claude-plugin/plugin.json +1 -1
  86. package/plugins/pbr/agents/codebase-mapper.md +42 -0
  87. package/plugins/pbr/agents/debugger.md +4 -1
  88. package/plugins/pbr/agents/executor.md +31 -1
  89. package/plugins/pbr/agents/integration-checker.md +34 -2
  90. package/plugins/pbr/agents/planner.md +58 -1
  91. package/plugins/pbr/agents/researcher.md +23 -0
  92. package/plugins/pbr/agents/synthesizer.md +24 -0
  93. package/plugins/pbr/agents/verifier.md +36 -1
  94. package/plugins/pbr/references/agent-contracts.md +297 -0
  95. package/plugins/pbr/references/pbr-rules.md +1 -0
  96. package/plugins/pbr/references/pbr-tools-cli.md +285 -0
  97. package/plugins/pbr/references/ui-formatting.md +37 -54
  98. package/plugins/pbr/scripts/check-skill-workflow.js +11 -0
  99. package/plugins/pbr/scripts/check-state-sync.js +58 -0
  100. package/plugins/pbr/scripts/check-subagent-output.js +43 -4
  101. package/plugins/pbr/scripts/validate-task.js +69 -17
  102. package/plugins/pbr/skills/begin/SKILL.md +36 -11
  103. package/plugins/pbr/skills/build/SKILL.md +37 -25
  104. package/plugins/pbr/skills/config/SKILL.md +12 -10
  105. package/plugins/pbr/skills/continue/SKILL.md +11 -9
  106. package/plugins/pbr/skills/dashboard/SKILL.md +12 -0
  107. package/plugins/pbr/skills/debug/SKILL.md +29 -23
  108. package/plugins/pbr/skills/discuss/SKILL.md +20 -10
  109. package/plugins/pbr/skills/do/SKILL.md +3 -3
  110. package/plugins/pbr/skills/explore/SKILL.md +14 -12
  111. package/plugins/pbr/skills/health/SKILL.md +76 -20
  112. package/plugins/pbr/skills/help/SKILL.md +8 -6
  113. package/plugins/pbr/skills/import/SKILL.md +25 -16
  114. package/plugins/pbr/skills/milestone/SKILL.md +88 -45
  115. package/plugins/pbr/skills/note/SKILL.md +3 -3
  116. package/plugins/pbr/skills/pause/SKILL.md +13 -9
  117. package/plugins/pbr/skills/plan/SKILL.md +28 -13
  118. package/plugins/pbr/skills/plan/templates/planner-prompt.md.tmpl +1 -1
  119. package/plugins/pbr/skills/quick/SKILL.md +12 -10
  120. package/plugins/pbr/skills/resume/SKILL.md +11 -9
  121. package/plugins/pbr/skills/review/SKILL.md +35 -24
  122. package/plugins/pbr/skills/scan/SKILL.md +12 -10
  123. package/plugins/pbr/skills/setup/SKILL.md +53 -7
  124. package/plugins/pbr/skills/shared/error-reporting.md +2 -0
  125. package/plugins/pbr/skills/shared/universal-anti-patterns.md +10 -6
  126. package/plugins/pbr/skills/status/SKILL.md +8 -6
  127. package/plugins/pbr/skills/statusline/SKILL.md +12 -8
  128. package/plugins/pbr/skills/todo/SKILL.md +51 -28
@@ -8,9 +8,9 @@ description: "Check planning directory integrity. Find and fix corrupted state."
8
8
  **Before ANY tool calls**, display this banner:
9
9
 
10
10
  ```
11
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
12
- PLAN-BUILD-RUN ► HEALTH CHECK
13
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
11
+ ╔══════════════════════════════════════════════════════════════╗
12
+ PLAN-BUILD-RUN ► HEALTH CHECK
13
+ ╚══════════════════════════════════════════════════════════════╝
14
14
  ```
15
15
 
16
16
  Then proceed to Step 1.
@@ -19,7 +19,7 @@ Then proceed to Step 1.
19
19
 
20
20
  You are running the **health** skill. Your job is to validate the integrity of the `.planning/` directory, report problems, and suggest targeted fixes. You never auto-repair anything.
21
21
 
22
- This skill runs **inline** and is **read-only** it never modifies any files.
22
+ This skill runs **inline**. It is read-only by default, but offers an optional **auto-fix** flow for common corruption patterns (see the Auto-Fix section below).
23
23
 
24
24
  ---
25
25
 
@@ -149,6 +149,58 @@ Glob for `.planning/phases/**/.PROGRESS-*` and `.planning/phases/**/.checkpoint-
149
149
 
150
150
  ---
151
151
 
152
+ ## Auto-Fix for Common Corruption Patterns
153
+
154
+ After running all 10 checks and collecting results, if any of the following auto-fixable issues were found, offer to fix them.
155
+
156
+ ### Auto-Fixable Patterns
157
+
158
+ | Pattern | Detection | Fix Action |
159
+ |---------|-----------|------------|
160
+ | Missing STATE.md frontmatter | Check 5 finds STATE.md without `---` block | Regenerate frontmatter from ROADMAP.md phase data (current_phase, total_phases, status) |
161
+ | STATE.md phase_slug mismatch | Check 5/7 finds phase_slug doesn't match current phase directory name | Correct phase_slug to match the actual directory name in `.planning/phases/` |
162
+ | Missing config.json | Check 1/2 finds no `.planning/config.json` | Create with default config template (same as `/pbr:setup` defaults) |
163
+ | Orphaned .active-skill file | Check 10 or general scan finds `.planning/.active-skill` older than 1 hour | Delete the stale `.active-skill` file |
164
+ | Empty phases directory | Check 3 finds `.planning/phases/` missing | Create the directory: `mkdir -p .planning/phases` |
165
+ | STATE.md over 150 lines | Check 5 finds STATE.md exceeds 150 lines | Compact the `## Accumulated Context` section, keeping only the last 3 entries |
166
+
167
+ ### Auto-Fix Flow
168
+
169
+ After displaying health check results, if any auto-fixable issues were detected:
170
+
171
+ 1. Count the auto-fixable issues and present:
172
+
173
+ Use AskUserQuestion:
174
+ question: "Found {N} auto-fixable issues. How should we handle them?"
175
+ header: "Fix?"
176
+ options:
177
+ - label: "Fix all" description: "Apply all {N} fixes automatically"
178
+ - label: "Review each" description: "Show each fix and confirm individually"
179
+ - label: "Skip" description: "Do nothing — just report"
180
+
181
+ 2. If "Fix all": Apply all fixes in order, then display a summary:
182
+ ```
183
+ Auto-fix results:
184
+ - Fixed: {description of fix 1}
185
+ - Fixed: {description of fix 2}
186
+ ...
187
+ ```
188
+
189
+ 3. If "Review each": For each fixable issue, display:
190
+ ```
191
+ Issue: {description}
192
+ Fix: {what will be done}
193
+ ```
194
+ Then ask via AskUserQuestion (yes/no): "Apply this fix?"
195
+ - If yes: apply and display `- Fixed: {description}`
196
+ - If no: skip and display `- Skipped: {description}`
197
+
198
+ 4. If "Skip": Do nothing, continue to the rest of the output.
199
+
200
+ **Note:** When auto-fix is active, the health skill is no longer strictly read-only. The `allowed-tools` frontmatter must include `Write` and `AskUserQuestion` for auto-fix to work. Update the frontmatter accordingly.
201
+
202
+ ---
203
+
152
204
  ## Bonus: Recent Decisions
153
205
 
154
206
  After all checks, look for `.planning/logs/decisions.jsonl`. If it exists, display the last 5 entries as `- {date}: {summary} (phase {N})`. If it does not exist, skip silently.
@@ -161,15 +213,17 @@ After all checks complete, display the branded result:
161
213
 
162
214
  **If all checks passed (0 failures):**
163
215
  ```
164
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
165
- PLAN-BUILD-RUN ► HEALTH CHECK PASSED ✓
166
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
216
+ ╔══════════════════════════════════════════════════════════════╗
217
+ PLAN-BUILD-RUN ► HEALTH CHECK PASSED ✓
218
+ ╚══════════════════════════════════════════════════════════════╝
167
219
 
168
220
  {N} checks passed, {M} warnings
169
221
 
170
- ───────────────────────────────────────────────────────────────
171
222
 
172
- ## ▶ Next Up
223
+
224
+ ╔══════════════════════════════════════════════════════════════╗
225
+ ║ ▶ NEXT UP ║
226
+ ╚══════════════════════════════════════════════════════════════╝
173
227
 
174
228
  **Continue your workflow** — planning directory is healthy
175
229
 
@@ -177,40 +231,42 @@ After all checks complete, display the branded result:
177
231
 
178
232
  <sub>`/clear` first → fresh context window</sub>
179
233
 
180
- ───────────────────────────────────────────────────────────────
234
+
181
235
 
182
236
  **Also available:**
183
237
  - `/pbr:continue` — execute next logical step
184
238
  - `/pbr:config` — adjust settings
185
239
 
186
- ───────────────────────────────────────────────────────────────
240
+
187
241
  ```
188
242
 
189
243
  **If failures found:**
190
244
  ```
191
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
192
- PLAN-BUILD-RUN ► HEALTH CHECK FAILED ⚠
193
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
245
+ ╔══════════════════════════════════════════════════════════════╗
246
+ PLAN-BUILD-RUN ► HEALTH CHECK FAILED ⚠
247
+ ╚══════════════════════════════════════════════════════════════╝
194
248
 
195
249
  {N} checks passed, {F} failures, {M} warnings
196
250
 
197
- ───────────────────────────────────────────────────────────────
198
251
 
199
- ## ▶ Next Up
252
+
253
+ ╔══════════════════════════════════════════════════════════════╗
254
+ ║ ▶ NEXT UP ║
255
+ ╚══════════════════════════════════════════════════════════════╝
200
256
 
201
257
  **Fix the failures** listed above, then re-run
202
258
 
203
259
  `/pbr:health`
204
260
 
205
- ───────────────────────────────────────────────────────────────
261
+
206
262
  ```
207
263
 
208
264
  ---
209
265
 
210
266
  ## Anti-Patterns
211
267
 
212
- 1. **DO NOT** modify any files — this is strictly read-only
213
- 2. **DO NOT** auto-repair anything — present fixes and let the user decide
268
+ 1. **DO NOT** modify files without user consent auto-fix requires explicit user approval via AskUserQuestion
269
+ 2. **DO NOT** auto-repair anything silently always present fixes and let the user decide
214
270
  3. **DO NOT** skip checks that depend on missing files — report the dependency failure and continue
215
271
  4. **DO NOT** treat warnings as failures in the summary count — only count FAIL items
216
272
  5. **DO NOT** read full plan/summary contents — frontmatter and existence checks are sufficient
@@ -8,9 +8,9 @@ description: "Command reference and workflow guide for Plan-Build-Run."
8
8
  **Before ANY tool calls**, display this banner:
9
9
 
10
10
  ```
11
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
12
- PLAN-BUILD-RUN ► COMMAND REFERENCE
13
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
11
+ ╔══════════════════════════════════════════════════════════════╗
12
+ PLAN-BUILD-RUN ► COMMAND REFERENCE
13
+ ╚══════════════════════════════════════════════════════════════╝
14
14
  ```
15
15
 
16
16
  Then proceed to Step 1.
@@ -134,16 +134,16 @@ Skills automatically activate the appropriate context: `/pbr:build` uses dev con
134
134
  ## Getting Started
135
135
 
136
136
  ```
137
- ───────────────────────────────────────────────────────────────
138
137
 
139
- ## ▶ Next Up
138
+ ╔══════════════════════════════════════════════════════════════╗
139
+ ║ ▶ NEXT UP ║
140
+ ╚══════════════════════════════════════════════════════════════╝
140
141
 
141
142
  → `/pbr:begin` — start a new project
142
143
  → `/pbr:status` — check current project status
143
144
  → `/pbr:config` — configure workflow settings
144
145
  → `/pbr:help <command>` — detailed help for a specific command
145
146
 
146
- ───────────────────────────────────────────────────────────────
147
147
  ```
148
148
 
149
149
  ## Getting Help
@@ -9,9 +9,9 @@ argument-hint: "<phase-number> [--from <filepath>] [--skip-checker]"
9
9
  **Before ANY tool calls**, display this banner:
10
10
 
11
11
  ```
12
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
13
- PLAN-BUILD-RUN ► IMPORTING PLAN
14
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
12
+ ╔══════════════════════════════════════════════════════════════╗
13
+ PLAN-BUILD-RUN ► IMPORTING PLAN
14
+ ╚══════════════════════════════════════════════════════════════╝
15
15
  ```
16
16
 
17
17
  Then proceed to Step 1.
@@ -48,11 +48,12 @@ Reference: `skills/shared/config-loading.md` for the tooling shortcut and config
48
48
  1. Parse `$ARGUMENTS` for phase number
49
49
  2. Parse optional `--from <filepath>` flag (path to the external document to import)
50
50
  3. Parse optional `--skip-checker` flag (skip plan validation step)
51
- 4. Validate:
51
+ 4. **CRITICAL: Write .active-skill NOW.** Write the text "import" to `.planning/.active-skill` using the Write tool.
52
+ 5. Validate:
52
53
  - Phase exists in ROADMAP.md
53
54
  - Phase directory exists at `.planning/phases/{NN}-{slug}/`
54
- 5. If no phase number given, read current phase from `.planning/STATE.md`
55
- 6. Check for existing plans in the phase directory (glob for `*-PLAN.md`)
55
+ 6. If no phase number given, read current phase from `.planning/STATE.md`
56
+ 7. Check for existing plans in the phase directory (glob for `*-PLAN.md`)
56
57
  - If plans exist: ask user via AskUserQuestion: "Phase {N} already has plans. Replace them with imported plans?"
57
58
  - If yes: note that existing plans will be overwritten in Step 7
58
59
  - If no: stop
@@ -318,7 +319,7 @@ Follow the revision loop with:
318
319
 
319
320
  ### Step 7: Write PLAN.md Files (inline)
320
321
 
321
- Write each plan to `.planning/phases/{NN}-{slug}/{phase}-{plan_num}-PLAN.md`.
322
+ Write each plan to `.planning/phases/{NN}-{slug}/PLAN-{plan_num}.md`.
322
323
 
323
324
  If existing plans are being replaced (user confirmed in Step 1):
324
325
  - Delete existing `*-PLAN.md` files in the phase directory before writing new ones
@@ -376,14 +377,18 @@ docs({phase}): import plans for phase {N} ({count} plans, {wave_count} waves)
376
377
 
377
378
  ---
378
379
 
379
- ### Step 10: Confirm (inline)
380
+ ### Step 10: Cleanup
381
+
382
+ Delete `.planning/.active-skill` if it exists. This must happen on all paths (success, partial, and failure) before reporting results.
383
+
384
+ ### Step 11: Confirm (inline)
380
385
 
381
386
  Present a summary of the import using the branded banner:
382
387
 
383
388
  ```
384
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
385
- PLAN-BUILD-RUN ► IMPORT COMPLETE ✓
386
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
389
+ ╔══════════════════════════════════════════════════════════════╗
390
+ PLAN-BUILD-RUN ► IMPORT COMPLETE ✓
391
+ ╚══════════════════════════════════════════════════════════════╝
387
392
 
388
393
  **Phase {N}: {name}** — {plan_count} plans imported
389
394
 
@@ -402,9 +407,10 @@ Wave execution order:
402
407
  Must-haves coverage: {count} truths across {plan_count} plans
403
408
  Requirements traced: {count}/{total} REQ-IDs covered
404
409
 
405
- ───────────────────────────────────────────────────────────────
406
410
 
407
- ## ▶ Next Up
411
+ ╔══════════════════════════════════════════════════════════════╗
412
+ ║ ▶ NEXT UP ║
413
+ ╚══════════════════════════════════════════════════════════════╝
408
414
 
409
415
  **Build Phase {N}** — execute these imported plans
410
416
 
@@ -412,19 +418,19 @@ Requirements traced: {count}/{total} REQ-IDs covered
412
418
 
413
419
  <sub>`/clear` first → fresh context window</sub>
414
420
 
415
- ───────────────────────────────────────────────────────────────
416
421
 
417
422
  **Also available:**
418
423
  - `/pbr:plan {N}` — re-plan from scratch if import needs rework
419
424
  - `/pbr:discuss {N}` — talk through details before building
420
425
 
421
- ───────────────────────────────────────────────────────────────
422
426
  ```
423
427
 
424
428
  ---
425
429
 
426
430
  ## Error Handling
427
431
 
432
+ **IMPORTANT:** On ALL error exits below, delete `.planning/.active-skill` if it exists before displaying the error message.
433
+
428
434
  ### Phase not found
429
435
  If the specified phase does not exist in ROADMAP.md, display:
430
436
  ```
@@ -493,7 +499,7 @@ Present remaining issues and ask user to decide: proceed or intervene.
493
499
 
494
500
  | File | Purpose | When |
495
501
  |------|---------|------|
496
- | `.planning/phases/{NN}-{slug}/{phase}-{NN}-PLAN.md` | Imported plan files | Step 7 |
502
+ | `.planning/phases/{NN}-{slug}/PLAN-{NN}.md` | Imported plan files | Step 7 |
497
503
  | `.planning/ROADMAP.md` | Plans Complete + Status updated to `planned` | Step 8a |
498
504
  | `.planning/STATE.md` | Updated with plan status and import source | Step 8b |
499
505
  | `.planning/CONTEXT.md` | Updated if blockers surfaced new locked decisions | Step 8d |
@@ -9,9 +9,9 @@ argument-hint: "new|complete|audit|gaps [version]"
9
9
  **Before ANY tool calls**, display this banner:
10
10
 
11
11
  ```
12
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
13
- PLAN-BUILD-RUN ► MILESTONE
14
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
12
+ ╔══════════════════════════════════════════════════════════════╗
13
+ PLAN-BUILD-RUN ► MILESTONE
14
+ ╚══════════════════════════════════════════════════════════════╝
15
15
  ```
16
16
 
17
17
  Then proceed to Step 1.
@@ -29,9 +29,9 @@ This skill runs **inline** for most subcommands, but spawns agents for `audit`.
29
29
  Reference: `skills/shared/context-budget.md` for the universal orchestrator rules.
30
30
 
31
31
  Additionally for this skill:
32
- - **Never** perform integration checks yourself — delegate to the integration-checker subagent
32
+ - **Never** perform integration checks yourself — delegate to the integration-checker agent
33
33
  - **Minimize** reading audit and verification outputs — read only frontmatter and status fields
34
- - **Delegate** all cross-phase integration analysis to the integration-checker subagent
34
+ - **Delegate** all cross-phase integration analysis to the integration-checker agent
35
35
 
36
36
  ---
37
37
 
@@ -156,9 +156,9 @@ Start a new milestone cycle with new phases.
156
156
 
157
157
  10. **Confirm** with branded output:
158
158
  ```
159
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
160
- PLAN-BUILD-RUN ► MILESTONE CREATED ✓
161
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
159
+ ╔══════════════════════════════════════════════════════════════╗
160
+ PLAN-BUILD-RUN ► MILESTONE CREATED ✓
161
+ ╚══════════════════════════════════════════════════════════════╝
162
162
 
163
163
  **Milestone: {name}** — {count} phases
164
164
 
@@ -167,9 +167,11 @@ Start a new milestone cycle with new phases.
167
167
  {N+1}. {name}
168
168
  ...
169
169
 
170
- ───────────────────────────────────────────────────────────────
171
170
 
172
- ## ▶ Next Up
171
+
172
+ ╔══════════════════════════════════════════════════════════════╗
173
+ ║ ▶ NEXT UP ║
174
+ ╚══════════════════════════════════════════════════════════════╝
173
175
 
174
176
  **Phase {N}: {name}** — start with discussion or planning
175
177
 
@@ -177,13 +179,13 @@ Start a new milestone cycle with new phases.
177
179
 
178
180
  <sub>`/clear` first → fresh context window</sub>
179
181
 
180
- ───────────────────────────────────────────────────────────────
182
+
181
183
 
182
184
  **Also available:**
183
185
  - `/pbr:plan {N}` — skip discussion, plan directly
184
186
  - `/pbr:status` — see project status
185
187
 
186
- ───────────────────────────────────────────────────────────────
188
+
187
189
  ```
188
190
 
189
191
  ---
@@ -260,14 +262,40 @@ Archive a completed milestone and prepare for the next one.
260
262
 
261
263
  5. **Archive milestone documents:**
262
264
 
265
+ **CRITICAL: Pre-flight safety checks BEFORE archiving. Do NOT skip this step.**
266
+
267
+ Before creating or moving anything, verify the destination is safe:
268
+ - Check if `.planning/milestones/{version}/` already exists
269
+ - If it exists AND contains files (phases/, STATS.md, etc.), STOP and display:
270
+ ```
271
+ ╔══════════════════════════════════════════════════════════════╗
272
+ ║ ERROR ║
273
+ ╚══════════════════════════════════════════════════════════════╝
274
+
275
+ Archive destination `.planning/milestones/{version}/` already contains files.
276
+ Completing this milestone would overwrite the existing archive.
277
+
278
+ **To fix:** Run `/pbr:health` or manually inspect `.planning/milestones/{version}/`.
279
+ Use a different version number (e.g., {version}.1) or remove the existing archive first.
280
+ ```
281
+ Ask the user via AskUserQuestion whether to use a different version or abort.
282
+ - Verify each source phase directory exists before attempting to move it
283
+ - If any source phase directory is missing, warn but continue with the phases that do exist
284
+
285
+ **CRITICAL: Create the archive directory .planning/milestones/{version}/ NOW. Do NOT skip this step.**
286
+
263
287
  Create a versioned archive directory and move phase directories into it:
264
288
  - `.planning/milestones/{version}/ROADMAP.md` — snapshot of ROADMAP.md at completion
265
- - `.planning/milestones/{version}/REQUIREMENTS.md` — snapshot of REQUIREMENTS.md
289
+ - `.planning/milestones/{version}/REQUIREMENTS.md` — **CRITICAL: Copy REQUIREMENTS.md to archive NOW. Do NOT skip this step.** Snapshot of REQUIREMENTS.md
266
290
  - `.planning/milestones/{version}/STATS.md` — milestone statistics
267
291
  - `.planning/milestones/{version}/phases/{NN}-{slug}/` — move each milestone phase directory from `.planning/phases/` into the archive
268
292
 
293
+ **CRITICAL: Move phase directories from .planning/phases/ to archive NOW. Do NOT skip this step.**
294
+
269
295
  **Move phases:** For each phase belonging to this milestone, move (not copy) its directory from `.planning/phases/{NN}-{slug}/` to `.planning/milestones/{version}/phases/{NN}-{slug}/`. This keeps the active phases directory clean for the next milestone.
270
296
 
297
+ **CRITICAL: Write STATS.md to .planning/milestones/{version}/STATS.md NOW. Do NOT skip this step.**
298
+
271
299
  **Stats file content:**
272
300
 
273
301
  Read `skills/milestone/templates/stats-file.md.tmpl` for the stats file format. Fill in all `{variable}` placeholders with actual data gathered in Steps 3-4.
@@ -287,6 +315,8 @@ Archive a completed milestone and prepare for the next one.
287
315
 
288
316
  - Move validated requirements from active to completed section
289
317
 
318
+ **CRITICAL: Update ROADMAP.md with collapsed milestone section NOW. Do NOT skip this step.**
319
+
290
320
  7. **Collapse completed phases in ROADMAP.md:**
291
321
  Replace detailed phase entries with collapsed summaries:
292
322
 
@@ -301,6 +331,8 @@ Archive a completed milestone and prepare for the next one.
301
331
  | {N+1}. {name} | Completed |
302
332
  ```
303
333
 
334
+ **CRITICAL: Update STATE.md to mark milestone as complete NOW. Do NOT skip this step.**
335
+
304
336
  7b. **Update STATE.md:**
305
337
  - Update `.planning/STATE.md` to mark the milestone as complete
306
338
  - Clear the current milestone field or set status to "completed"
@@ -331,9 +363,9 @@ Archive a completed milestone and prepare for the next one.
331
363
 
332
364
  10. **Confirm** with branded output:
333
365
  ```
334
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
335
- PLAN-BUILD-RUN ► MILESTONE COMPLETE 🎉
336
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
366
+ ╔══════════════════════════════════════════════════════════════╗
367
+ PLAN-BUILD-RUN ► MILESTONE COMPLETE 🎉
368
+ ╚══════════════════════════════════════════════════════════════╝
337
369
 
338
370
  **{version}**
339
371
 
@@ -345,9 +377,11 @@ Archive a completed milestone and prepare for the next one.
345
377
  Archived to: .planning/milestones/{version}/
346
378
  Git tag: {version}
347
379
 
348
- ───────────────────────────────────────────────────────────────
349
380
 
350
- ## ▶ Next Up
381
+
382
+ ╔══════════════════════════════════════════════════════════════╗
383
+ ║ ▶ NEXT UP ║
384
+ ╚══════════════════════════════════════════════════════════════╝
351
385
 
352
386
  **Start the next milestone** — plan new features
353
387
 
@@ -355,13 +389,13 @@ Archive a completed milestone and prepare for the next one.
355
389
 
356
390
  <sub>`/clear` first → fresh context window</sub>
357
391
 
358
- ───────────────────────────────────────────────────────────────
392
+
359
393
 
360
394
  **Also available:**
361
395
  - `/pbr:status` — see project status
362
396
  - `/pbr:help` — see all commands
363
397
 
364
- ───────────────────────────────────────────────────────────────
398
+
365
399
  ```
366
400
 
367
401
  ---
@@ -385,7 +419,7 @@ Verify milestone completion with cross-phase integration checks.
385
419
 
386
420
  Display to the user: `◐ Spawning integration checker...`
387
421
 
388
- Spawn `Task(subagent_type: "pbr:integration-checker")` with:
422
+ Spawn `Task(agent_type: "pbr:integration-checker")` with:
389
423
 
390
424
  ```
391
425
  You are integration-checker. Perform cross-phase integration verification.
@@ -426,15 +460,17 @@ Verify milestone completion with cross-phase integration checks.
426
460
 
427
461
  **If PASSED:**
428
462
  ```
429
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
430
- PLAN-BUILD-RUN ► MILESTONE AUDIT PASSED ✓
431
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
463
+ ╔══════════════════════════════════════════════════════════════╗
464
+ PLAN-BUILD-RUN ► MILESTONE AUDIT PASSED ✓
465
+ ╚══════════════════════════════════════════════════════════════╝
432
466
 
433
467
  All phases verified, integration checks passed, requirements covered.
434
468
 
435
- ───────────────────────────────────────────────────────────────
436
469
 
437
- ## ▶ Next Up
470
+
471
+ ╔══════════════════════════════════════════════════════════════╗
472
+ ║ ▶ NEXT UP ║
473
+ ╚══════════════════════════════════════════════════════════════╝
438
474
 
439
475
  **Complete the milestone** — archive and tag
440
476
 
@@ -442,28 +478,30 @@ Verify milestone completion with cross-phase integration checks.
442
478
 
443
479
  <sub>`/clear` first → fresh context window</sub>
444
480
 
445
- ───────────────────────────────────────────────────────────────
481
+
446
482
 
447
483
  **Also available:**
448
484
  - `/pbr:milestone gaps` — address any minor issues first
449
485
  - `/pbr:status` — see project status
450
486
 
451
- ───────────────────────────────────────────────────────────────
487
+
452
488
  ```
453
489
 
454
490
  **If GAPS FOUND:**
455
491
  ```
456
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
457
- PLAN-BUILD-RUN ► MILESTONE AUDIT — GAPS FOUND ⚠
458
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
492
+ ╔══════════════════════════════════════════════════════════════╗
493
+ PLAN-BUILD-RUN ► MILESTONE AUDIT — GAPS FOUND ⚠
494
+ ╚══════════════════════════════════════════════════════════════╝
459
495
 
460
496
  Found {count} gaps:
461
497
  - {gap 1}
462
498
  - {gap 2}
463
499
 
464
- ───────────────────────────────────────────────────────────────
465
500
 
466
- ## ▶ Next Up
501
+
502
+ ╔══════════════════════════════════════════════════════════════╗
503
+ ║ ▶ NEXT UP ║
504
+ ╚══════════════════════════════════════════════════════════════╝
467
505
 
468
506
  **Close the gaps** — create fix phases
469
507
 
@@ -471,26 +509,28 @@ Verify milestone completion with cross-phase integration checks.
471
509
 
472
510
  <sub>`/clear` first → fresh context window</sub>
473
511
 
474
- ───────────────────────────────────────────────────────────────
512
+
475
513
 
476
514
  **Also available:**
477
515
  - `/pbr:milestone complete` — proceed despite gaps
478
516
  - `/pbr:status` — see project status
479
517
 
480
- ───────────────────────────────────────────────────────────────
518
+
481
519
  ```
482
520
 
483
521
  **If TECH DEBT:**
484
522
  ```
485
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
486
- PLAN-BUILD-RUN ► MILESTONE AUDIT — TECH DEBT ⚠
487
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
523
+ ╔══════════════════════════════════════════════════════════════╗
524
+ PLAN-BUILD-RUN ► MILESTONE AUDIT — TECH DEBT ⚠
525
+ ╚══════════════════════════════════════════════════════════════╝
488
526
 
489
527
  Milestone functional but has {count} tech debt items.
490
528
 
491
- ───────────────────────────────────────────────────────────────
492
529
 
493
- ## ▶ Next Up
530
+
531
+ ╔══════════════════════════════════════════════════════════════╗
532
+ ║ ▶ NEXT UP ║
533
+ ╚══════════════════════════════════════════════════════════════╝
494
534
 
495
535
  **Address tech debt or proceed**
496
536
 
@@ -499,7 +539,7 @@ Verify milestone completion with cross-phase integration checks.
499
539
 
500
540
  <sub>`/clear` first → fresh context window</sub>
501
541
 
502
- ───────────────────────────────────────────────────────────────
542
+
503
543
  ```
504
544
 
505
545
  ---
@@ -582,17 +622,19 @@ Create phases to close gaps found during an audit.
582
622
 
583
623
  9. **Confirm** with branded output:
584
624
  ```
585
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
586
- PLAN-BUILD-RUN ► GAP PHASES CREATED ✓
587
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
625
+ ╔══════════════════════════════════════════════════════════════╗
626
+ PLAN-BUILD-RUN ► GAP PHASES CREATED ✓
627
+ ╚══════════════════════════════════════════════════════════════╝
588
628
 
589
629
  Created {count} gap-closure phase(s):
590
630
  - Phase {N}: {name}
591
631
  - Phase {N+1}: {name}
592
632
 
593
- ───────────────────────────────────────────────────────────────
594
633
 
595
- ## ▶ Next Up
634
+
635
+ ╔══════════════════════════════════════════════════════════════╗
636
+ ║ ▶ NEXT UP ║
637
+ ╚══════════════════════════════════════════════════════════════╝
596
638
 
597
639
  **Plan the first gap-closure phase**
598
640
 
@@ -600,12 +642,12 @@ Create phases to close gaps found during an audit.
600
642
 
601
643
  <sub>`/clear` first → fresh context window</sub>
602
644
 
603
- ───────────────────────────────────────────────────────────────
645
+
604
646
 
605
647
  **Also available:**
606
648
  - `/pbr:status` — see project status
607
649
 
608
- ───────────────────────────────────────────────────────────────
650
+
609
651
  ```
610
652
 
611
653
  ---
@@ -9,9 +9,9 @@ argument-hint: "<text> | list | promote <index> [--global]"
9
9
  **Before ANY tool calls**, display this banner:
10
10
 
11
11
  ```
12
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
13
- PLAN-BUILD-RUN ► NOTE
14
- ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
12
+ ╔══════════════════════════════════════════════════════════════╗
13
+ PLAN-BUILD-RUN ► NOTE
14
+ ╚══════════════════════════════════════════════════════════════╝
15
15
  ```
16
16
 
17
17
  Then proceed to Step 1.