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