@sienklogic/plan-build-run 2.0.2 → 2.1.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 (156) hide show
  1. package/dashboard/src/routes/pages.routes.js +11 -4
  2. package/dashboard/src/services/dashboard.service.js +81 -17
  3. package/dashboard/src/services/phase.service.js +30 -24
  4. package/dashboard/src/services/roadmap.service.js +3 -3
  5. package/dashboard/src/views/partials/phase-content.ejs +5 -4
  6. package/package.json +1 -1
  7. package/plugins/cursor-pbr/.cursor-plugin/plugin.json +1 -1
  8. package/plugins/cursor-pbr/CHANGELOG.md +15 -0
  9. package/plugins/cursor-pbr/README.md +118 -0
  10. package/plugins/cursor-pbr/agents/codebase-mapper.md +108 -0
  11. package/plugins/cursor-pbr/agents/debugger.md +168 -0
  12. package/plugins/cursor-pbr/agents/executor.md +236 -0
  13. package/plugins/cursor-pbr/agents/general.md +87 -0
  14. package/plugins/cursor-pbr/agents/integration-checker.md +87 -0
  15. package/plugins/cursor-pbr/agents/plan-checker.md +198 -0
  16. package/plugins/cursor-pbr/agents/planner.md +180 -0
  17. package/plugins/cursor-pbr/agents/researcher.md +162 -0
  18. package/plugins/cursor-pbr/agents/synthesizer.md +101 -0
  19. package/plugins/cursor-pbr/agents/verifier.md +193 -0
  20. package/plugins/cursor-pbr/assets/logo.svg +21 -0
  21. package/plugins/cursor-pbr/hooks/hooks.json +189 -7
  22. package/plugins/cursor-pbr/references/agent-anti-patterns.md +25 -0
  23. package/plugins/cursor-pbr/references/agent-interactions.md +135 -0
  24. package/plugins/cursor-pbr/references/agent-teams.md +55 -0
  25. package/plugins/cursor-pbr/references/checkpoints.md +158 -0
  26. package/plugins/cursor-pbr/references/common-bug-patterns.md +14 -0
  27. package/plugins/cursor-pbr/references/config-reference.md +442 -0
  28. package/plugins/cursor-pbr/references/continuation-format.md +213 -0
  29. package/plugins/cursor-pbr/references/deviation-rules.md +113 -0
  30. package/plugins/cursor-pbr/references/git-integration.md +227 -0
  31. package/plugins/cursor-pbr/references/integration-patterns.md +118 -0
  32. package/plugins/cursor-pbr/references/model-profiles.md +100 -0
  33. package/plugins/cursor-pbr/references/model-selection.md +32 -0
  34. package/plugins/cursor-pbr/references/pbr-rules.md +194 -0
  35. package/plugins/cursor-pbr/references/plan-authoring.md +182 -0
  36. package/plugins/cursor-pbr/references/plan-format.md +288 -0
  37. package/plugins/cursor-pbr/references/planning-config.md +214 -0
  38. package/plugins/cursor-pbr/references/questioning.md +215 -0
  39. package/plugins/cursor-pbr/references/reading-verification.md +128 -0
  40. package/plugins/cursor-pbr/references/stub-patterns.md +161 -0
  41. package/plugins/cursor-pbr/references/subagent-coordination.md +120 -0
  42. package/plugins/cursor-pbr/references/ui-formatting.md +462 -0
  43. package/plugins/cursor-pbr/references/verification-patterns.md +199 -0
  44. package/plugins/cursor-pbr/references/wave-execution.md +96 -0
  45. package/plugins/cursor-pbr/rules/pbr-workflow.mdc +48 -0
  46. package/plugins/cursor-pbr/setup.ps1 +78 -0
  47. package/plugins/cursor-pbr/setup.sh +83 -0
  48. package/plugins/cursor-pbr/skills/begin/SKILL.md +566 -0
  49. package/plugins/cursor-pbr/skills/begin/templates/PROJECT.md.tmpl +34 -0
  50. package/plugins/cursor-pbr/skills/begin/templates/REQUIREMENTS.md.tmpl +19 -0
  51. package/plugins/cursor-pbr/skills/begin/templates/STATE.md.tmpl +50 -0
  52. package/plugins/cursor-pbr/skills/begin/templates/config.json.tmpl +64 -0
  53. package/plugins/cursor-pbr/skills/begin/templates/researcher-prompt.md.tmpl +20 -0
  54. package/plugins/cursor-pbr/skills/begin/templates/roadmap-prompt.md.tmpl +31 -0
  55. package/plugins/cursor-pbr/skills/begin/templates/synthesis-prompt.md.tmpl +17 -0
  56. package/plugins/cursor-pbr/skills/build/SKILL.md +902 -0
  57. package/plugins/cursor-pbr/skills/config/SKILL.md +253 -0
  58. package/plugins/cursor-pbr/skills/continue/SKILL.md +159 -0
  59. package/plugins/cursor-pbr/skills/debug/SKILL.md +512 -0
  60. package/plugins/cursor-pbr/skills/debug/templates/continuation-prompt.md.tmpl +17 -0
  61. package/plugins/cursor-pbr/skills/debug/templates/initial-investigation-prompt.md.tmpl +28 -0
  62. package/plugins/cursor-pbr/skills/discuss/SKILL.md +344 -0
  63. package/plugins/cursor-pbr/skills/discuss/templates/CONTEXT.md.tmpl +62 -0
  64. package/plugins/cursor-pbr/skills/discuss/templates/decision-categories.md +10 -0
  65. package/plugins/cursor-pbr/skills/explore/SKILL.md +375 -0
  66. package/plugins/cursor-pbr/skills/health/SKILL.md +218 -0
  67. package/plugins/cursor-pbr/skills/health/templates/check-pattern.md.tmpl +31 -0
  68. package/plugins/cursor-pbr/skills/health/templates/output-format.md.tmpl +64 -0
  69. package/plugins/cursor-pbr/skills/help/SKILL.md +152 -0
  70. package/plugins/cursor-pbr/skills/import/SKILL.md +499 -0
  71. package/plugins/cursor-pbr/skills/milestone/SKILL.md +701 -0
  72. package/plugins/cursor-pbr/skills/milestone/templates/audit-report.md.tmpl +49 -0
  73. package/plugins/cursor-pbr/skills/milestone/templates/stats-file.md.tmpl +31 -0
  74. package/plugins/cursor-pbr/skills/note/SKILL.md +228 -0
  75. package/plugins/cursor-pbr/skills/pause/SKILL.md +246 -0
  76. package/plugins/cursor-pbr/skills/pause/templates/continue-here.md.tmpl +72 -0
  77. package/plugins/cursor-pbr/skills/plan/SKILL.md +648 -0
  78. package/plugins/cursor-pbr/skills/plan/templates/checker-prompt.md.tmpl +22 -0
  79. package/plugins/cursor-pbr/skills/plan/templates/gap-closure-prompt.md.tmpl +33 -0
  80. package/plugins/cursor-pbr/skills/plan/templates/planner-prompt.md.tmpl +39 -0
  81. package/plugins/cursor-pbr/skills/plan/templates/researcher-prompt.md.tmpl +20 -0
  82. package/plugins/cursor-pbr/skills/plan/templates/revision-prompt.md.tmpl +24 -0
  83. package/plugins/cursor-pbr/skills/quick/SKILL.md +351 -0
  84. package/plugins/cursor-pbr/skills/resume/SKILL.md +399 -0
  85. package/plugins/cursor-pbr/skills/review/SKILL.md +649 -0
  86. package/plugins/cursor-pbr/skills/review/templates/debugger-prompt.md.tmpl +61 -0
  87. package/plugins/cursor-pbr/skills/review/templates/gap-planner-prompt.md.tmpl +41 -0
  88. package/plugins/cursor-pbr/skills/review/templates/verifier-prompt.md.tmpl +116 -0
  89. package/plugins/cursor-pbr/skills/scan/SKILL.md +301 -0
  90. package/plugins/cursor-pbr/skills/scan/templates/mapper-prompt.md.tmpl +202 -0
  91. package/plugins/cursor-pbr/skills/setup/SKILL.md +250 -0
  92. package/plugins/cursor-pbr/skills/shared/commit-planning-docs.md +36 -0
  93. package/plugins/cursor-pbr/skills/shared/config-loading.md +103 -0
  94. package/plugins/cursor-pbr/skills/shared/context-budget.md +41 -0
  95. package/plugins/cursor-pbr/skills/shared/context-loader-task.md +87 -0
  96. package/plugins/cursor-pbr/skills/shared/digest-select.md +80 -0
  97. package/plugins/cursor-pbr/skills/shared/domain-probes.md +126 -0
  98. package/plugins/cursor-pbr/skills/shared/error-reporting.md +80 -0
  99. package/plugins/cursor-pbr/skills/shared/gate-prompts.md +389 -0
  100. package/plugins/cursor-pbr/skills/shared/phase-argument-parsing.md +46 -0
  101. package/plugins/cursor-pbr/skills/shared/progress-display.md +54 -0
  102. package/plugins/cursor-pbr/skills/shared/revision-loop.md +82 -0
  103. package/plugins/cursor-pbr/skills/shared/state-loading.md +63 -0
  104. package/plugins/cursor-pbr/skills/shared/state-update.md +162 -0
  105. package/plugins/cursor-pbr/skills/shared/universal-anti-patterns.md +34 -0
  106. package/plugins/cursor-pbr/skills/status/SKILL.md +362 -0
  107. package/plugins/cursor-pbr/skills/todo/SKILL.md +195 -0
  108. package/plugins/cursor-pbr/templates/CONTEXT.md.tmpl +53 -0
  109. package/plugins/cursor-pbr/templates/INTEGRATION-REPORT.md.tmpl +152 -0
  110. package/plugins/cursor-pbr/templates/RESEARCH-SUMMARY.md.tmpl +98 -0
  111. package/plugins/cursor-pbr/templates/ROADMAP.md.tmpl +41 -0
  112. package/plugins/cursor-pbr/templates/SUMMARY.md.tmpl +82 -0
  113. package/plugins/cursor-pbr/templates/VERIFICATION-DETAIL.md.tmpl +117 -0
  114. package/plugins/cursor-pbr/templates/continue-here.md.tmpl +74 -0
  115. package/plugins/cursor-pbr/templates/prompt-partials/phase-project-context.md.tmpl +38 -0
  116. package/plugins/pbr/agents/codebase-mapper.md +41 -206
  117. package/plugins/pbr/agents/debugger.md +65 -171
  118. package/plugins/pbr/agents/executor.md +90 -275
  119. package/plugins/pbr/agents/general.md +27 -97
  120. package/plugins/pbr/agents/integration-checker.md +35 -112
  121. package/plugins/pbr/agents/plan-checker.md +71 -164
  122. package/plugins/pbr/agents/planner.md +75 -246
  123. package/plugins/pbr/agents/researcher.md +63 -255
  124. package/plugins/pbr/agents/synthesizer.md +49 -174
  125. package/plugins/pbr/agents/verifier.md +75 -366
  126. package/plugins/pbr/hooks/hooks.json +14 -10
  127. package/plugins/pbr/scripts/auto-continue.js +20 -4
  128. package/plugins/pbr/scripts/check-dangerous-commands.js +1 -1
  129. package/plugins/pbr/scripts/check-phase-boundary.js +1 -1
  130. package/plugins/pbr/scripts/check-plan-format.js +3 -3
  131. package/plugins/pbr/scripts/check-roadmap-sync.js +3 -3
  132. package/plugins/pbr/scripts/check-skill-workflow.js +1 -1
  133. package/plugins/pbr/scripts/check-state-sync.js +2 -2
  134. package/plugins/pbr/scripts/check-subagent-output.js +1 -1
  135. package/plugins/pbr/scripts/check-summary-gate.js +198 -0
  136. package/plugins/pbr/scripts/context-budget-check.js +1 -1
  137. package/plugins/pbr/scripts/event-handler.js +2 -2
  138. package/plugins/pbr/scripts/event-logger.js +1 -1
  139. package/plugins/pbr/scripts/log-subagent.js +1 -1
  140. package/plugins/pbr/scripts/pbr-tools.js +1 -1
  141. package/plugins/pbr/scripts/post-write-dispatch.js +1 -1
  142. package/plugins/pbr/scripts/post-write-quality.js +1 -1
  143. package/plugins/pbr/scripts/pre-bash-dispatch.js +1 -1
  144. package/plugins/pbr/scripts/pre-write-dispatch.js +16 -3
  145. package/plugins/pbr/scripts/session-cleanup.js +1 -1
  146. package/plugins/pbr/scripts/status-line.js +1 -1
  147. package/plugins/pbr/scripts/suggest-compact.js +1 -1
  148. package/plugins/pbr/scripts/task-completed.js +1 -1
  149. package/plugins/pbr/scripts/track-context-budget.js +11 -6
  150. package/plugins/pbr/scripts/validate-commit.js +1 -1
  151. package/plugins/pbr/scripts/validate-task.js +1 -1
  152. package/plugins/cursor-pbr/agents/.gitkeep +0 -0
  153. package/plugins/cursor-pbr/references/.gitkeep +0 -0
  154. package/plugins/cursor-pbr/rules/.gitkeep +0 -0
  155. package/plugins/cursor-pbr/skills/.gitkeep +0 -0
  156. package/plugins/cursor-pbr/templates/.gitkeep +0 -0
@@ -0,0 +1,701 @@
1
+ ---
2
+ name: milestone
3
+ description: "Manage milestones: new, complete, audit, gaps."
4
+ argument-hint: "new|complete|audit|gaps [version]"
5
+ ---
6
+
7
+ ## Step 0 — Immediate Output
8
+
9
+ **Before ANY tool calls**, display this banner:
10
+
11
+ ```
12
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
13
+ PLAN-BUILD-RUN ► MILESTONE
14
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
15
+ ```
16
+
17
+ Then proceed to Step 1.
18
+
19
+ # /pbr:milestone — Milestone Management
20
+
21
+ You are running the **milestone** skill. Milestones represent significant project checkpoints — a set of phases that together deliver a cohesive chunk of functionality. This skill handles the full milestone lifecycle: creation, completion, auditing, and gap analysis.
22
+
23
+ This skill runs **inline** for most subcommands, but spawns agents for `audit`.
24
+
25
+ ---
26
+
27
+ ## Context Budget
28
+
29
+ Reference: `skills/shared/context-budget.md` for the universal orchestrator rules.
30
+
31
+ Additionally for this skill:
32
+ - **Never** perform integration checks yourself — delegate to the integration-checker subagent
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
35
+
36
+ ---
37
+
38
+ ## Core Principle
39
+
40
+ **Milestones are the rhythm of the project.** They force you to step back, verify everything works together, and create a clean snapshot before moving on. Never skip the audit — integration issues hide at milestone boundaries.
41
+
42
+ ---
43
+
44
+ ## Argument Parsing
45
+
46
+ Parse `$ARGUMENTS` for the subcommand and optional version:
47
+
48
+ ```
49
+ $ARGUMENTS format: {subcommand} [{version/name}]
50
+
51
+ Examples:
52
+ "new" → subcommand=new, arg=none
53
+ "new User Auth" → subcommand=new, arg="User Auth"
54
+ "complete v1.0" → subcommand=complete, arg="v1.0"
55
+ "complete 1.0" → subcommand=complete, arg="v1.0" (auto-prefix v)
56
+ "audit v1.0" → subcommand=audit, arg="v1.0"
57
+ "audit" → subcommand=audit, arg=current milestone
58
+ "gaps" → subcommand=gaps, arg=most recent audit
59
+ ```
60
+
61
+ **If no subcommand recognized:** Show usage:
62
+ ```
63
+ Usage: /pbr:milestone <subcommand> [version]
64
+
65
+ Subcommands:
66
+ new [name] — Start a new milestone cycle
67
+ complete [ver] — Archive completed milestone
68
+ audit [ver] — Verify milestone completion
69
+ gaps — Create phases to close audit gaps
70
+ ```
71
+
72
+ ---
73
+
74
+ ## Subcommand: `new`
75
+
76
+ Start a new milestone cycle with new phases.
77
+
78
+ ### Flow
79
+
80
+ 1. **Read current state:**
81
+ - Read ROADMAP.md to see existing phases
82
+ - Read STATE.md for current position
83
+ - Read PROJECT.md if it exists (milestone history)
84
+
85
+ 2. **Get milestone details** via AskUserQuestion:
86
+ - "What's the name/goal for this new milestone?"
87
+ - "What are the major features or capabilities it should deliver?"
88
+ - If the user provided a name in `$ARGUMENTS`, use it and skip the name question
89
+
90
+ 3. **Determine phase numbering:**
91
+ - Find the highest phase number in the current ROADMAP.md
92
+ - New phases start at highest + 1
93
+ - Example: if phases 1-5 exist, new milestone starts at phase 6
94
+
95
+ 4. **Mini roadmap session:**
96
+ Run a condensed version of the `/pbr:begin` questioning flow:
97
+
98
+ a. Ask about major components needed (via AskUserQuestion):
99
+ - "What are the 2-5 major areas of work for this milestone?"
100
+
101
+ b. For each area, ask:
102
+ - "Any specific requirements or constraints for {area}?"
103
+
104
+ c. Generate phases from the areas:
105
+ - Each major area becomes a phase
106
+ - Order by dependency (foundations first)
107
+ - Include brief description and success criteria
108
+
109
+ 5. **Update ROADMAP.md:**
110
+ Append new milestone section:
111
+
112
+ ```markdown
113
+ ---
114
+
115
+ ## Milestone: {name}
116
+
117
+ **Goal:** {goal statement}
118
+ **Phases:** {start_num} - {end_num}
119
+
120
+ ### Phase {N}: {name}
121
+ **Goal:** {goal}
122
+ **Requirements:** {list}
123
+ **Success criteria:** {criteria}
124
+ **Depends on:** {prior phases}
125
+
126
+ ### Phase {N+1}: {name}
127
+ ...
128
+ ```
129
+
130
+ 6. **Create phase directories:**
131
+ For each new phase:
132
+ ```
133
+ .planning/phases/{NN}-{slug}/
134
+ ```
135
+
136
+ 7. **Update PROJECT.md** (create if needed):
137
+ Add milestone to the active milestones list:
138
+
139
+ ```markdown
140
+ ## Active Milestones
141
+
142
+ ### {name}
143
+ - **Phases:** {start} - {end}
144
+ - **Created:** {date}
145
+ - **Status:** In progress
146
+ ```
147
+
148
+ 8. **Update STATE.md:**
149
+ - Set current phase to the first new phase
150
+ - Update milestone info
151
+
152
+ 9. **Commit** if `planning.commit_docs: true`:
153
+ ```
154
+ docs(planning): start milestone "{name}" (phases {start}-{end})
155
+ ```
156
+
157
+ 10. **Confirm** with branded output:
158
+ ```
159
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
160
+ PLAN-BUILD-RUN ► MILESTONE CREATED ✓
161
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
162
+
163
+ **Milestone: {name}** — {count} phases
164
+
165
+ Phases:
166
+ {N}. {name}
167
+ {N+1}. {name}
168
+ ...
169
+
170
+ ───────────────────────────────────────────────────────────────
171
+
172
+ ## ▶ Next Up
173
+
174
+ **Phase {N}: {name}** — start with discussion or planning
175
+
176
+ `/pbr:discuss {N}`
177
+
178
+ <sub>`/clear` first → fresh context window</sub>
179
+
180
+ ───────────────────────────────────────────────────────────────
181
+
182
+ **Also available:**
183
+ - `/pbr:plan {N}` — skip discussion, plan directly
184
+ - `/pbr:status` — see project status
185
+
186
+ ───────────────────────────────────────────────────────────────
187
+ ```
188
+
189
+ ---
190
+
191
+ ## Subcommand: `complete`
192
+
193
+ Archive a completed milestone and prepare for the next one.
194
+
195
+ ### Flow
196
+
197
+ 1. **Determine version:**
198
+ - If provided in `$ARGUMENTS`: use it (auto-prefix `v` if missing)
199
+ - If not provided: ask via AskUserQuestion: "What version number for this milestone? (e.g., v1.0)"
200
+
201
+ 2. **Verify all phases are complete:**
202
+ - Read ROADMAP.md to find milestone phases
203
+ - For each phase, check for VERIFICATION.md
204
+ - If any phase lacks VERIFICATION.md:
205
+
206
+ Present the warning context:
207
+ Unverified phases:
208
+ - Phase {N}: {name}
209
+ - Phase {M}: {name}
210
+
211
+ Use AskUserQuestion (pattern: yes-no from `skills/shared/gate-prompts.md`):
212
+ question: "{count} phases haven't been verified. Continue with milestone completion?"
213
+ header: "Unverified"
214
+ options:
215
+ - label: "Continue anyway" description: "Proceed despite unverified phases (not recommended)"
216
+ - label: "Stop and review" description: "Run /pbr:review for unverified phases first"
217
+ - If "Stop and review" or "Other": stop and suggest the review commands for each unverified phase
218
+ - If "Continue anyway": proceed with warning noted
219
+
220
+ **Timestamp freshness check:**
221
+ For each phase that has a VERIFICATION.md, compare its `checked_at` frontmatter timestamp against the most recent SUMMARY.md file modification date in that phase directory (use `ls -t` or file stats).
222
+ If any SUMMARY.md is newer than its VERIFICATION.md `checked_at`:
223
+ - Warn: "Phase {N} ({name}) was modified after verification. The VERIFICATION.md may not reflect the current code state."
224
+ - List affected phases with their freshness details
225
+
226
+ Use AskUserQuestion (pattern: stale-continue from `skills/shared/gate-prompts.md`):
227
+ question: "{count} phases were modified after verification. Re-verify or continue?"
228
+ header: "Stale"
229
+ options:
230
+ - label: "Re-verify" description: "Run /pbr:review for affected phases (recommended)"
231
+ - label: "Continue anyway" description: "Proceed with potentially outdated verification"
232
+ - If "Re-verify" or "Other": suggest the review commands for affected phases and stop
233
+ - If "Continue anyway": proceed with warning noted
234
+
235
+ 3. **Gather milestone stats:**
236
+
237
+ ```bash
238
+ # Get commit range for this milestone's phases
239
+ git log --oneline --since="{milestone start date}" --until="now"
240
+
241
+ # Count files changed
242
+ git diff --stat {first_milestone_commit}..HEAD
243
+ ```
244
+
245
+ Collect:
246
+ - Total commits in milestone
247
+ - Total files changed
248
+ - Lines added / removed
249
+ - Duration (start date to now)
250
+ - Number of phases completed
251
+ - Number of plans executed
252
+ - Number of quick tasks
253
+
254
+ 4. **Extract accomplishments:**
255
+ Read all SUMMARY.md files for milestone phases:
256
+ - Collect `provides` fields (what was built)
257
+ - Collect `key_decisions` fields
258
+ - Collect `patterns` fields
259
+ - Collect `tech_stack` union
260
+
261
+ 5. **Archive milestone documents:**
262
+
263
+ Copy/create archive files:
264
+ - `.planning/milestones/{version}-ROADMAP.md` — snapshot of ROADMAP.md at completion
265
+ - `.planning/milestones/{version}-REQUIREMENTS.md` — snapshot of REQUIREMENTS.md
266
+ - `.planning/milestones/{version}-STATS.md` — milestone statistics
267
+
268
+ **Stats file content:**
269
+
270
+ 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.
271
+
272
+ 6. **Update PROJECT.md:**
273
+ - Move milestone from "Active" to "Completed"
274
+ - Add completion date and version tag
275
+
276
+ ```markdown
277
+ ## Completed Milestones
278
+
279
+ ### {name} ({version})
280
+ - **Completed:** {date}
281
+ - **Phases:** {start} - {end}
282
+ - **Key deliverables:** {summary}
283
+ ```
284
+
285
+ - Move validated requirements from active to completed section
286
+
287
+ 7. **Collapse completed phases in ROADMAP.md:**
288
+ Replace detailed phase entries with collapsed summaries:
289
+
290
+ ```markdown
291
+ ## Milestone: {name} ({version}) -- COMPLETED
292
+
293
+ Phases {start}-{end} completed on {date}. See `.planning/milestones/{version}-ROADMAP.md` for details.
294
+
295
+ | Phase | Status |
296
+ |-------|--------|
297
+ | {N}. {name} | Completed |
298
+ | {N+1}. {name} | Completed |
299
+ ```
300
+
301
+ 7b. **Update STATE.md:**
302
+ - Update `.planning/STATE.md` to mark the milestone as complete
303
+ - Clear the current milestone field or set status to "completed"
304
+ - Update last activity timestamp
305
+ - Record the milestone version in the history/completed section
306
+
307
+ 7c. **Update HISTORY.md:**
308
+ - Append a milestone completion entry to `.planning/HISTORY.md`:
309
+ ```markdown
310
+ ## {date} — Milestone {version} Completed
311
+
312
+ - Milestone: {name}
313
+ - Phases: {start} - {end}
314
+ - Duration: {duration} days
315
+ - Key deliverables: {summary from Step 4}
316
+ ```
317
+
318
+ 8. **Git tag:**
319
+ ```bash
320
+ git tag -a {version} -m "Milestone: {name}"
321
+ ```
322
+
323
+ 9. **Commit:**
324
+ ```bash
325
+ git add .planning/milestones/ .planning/ROADMAP.md .planning/PROJECT.md .planning/STATE.md .planning/HISTORY.md
326
+ git commit -m "docs(planning): complete milestone {version}"
327
+ ```
328
+
329
+ 10. **Confirm** with branded output:
330
+ ```
331
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
332
+ PLAN-BUILD-RUN ► MILESTONE COMPLETE 🎉
333
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
334
+
335
+ **{version}**
336
+
337
+ Stats:
338
+ - {count} phases, {count} plans
339
+ - {count} commits, {lines} lines of code
340
+ - {duration} days
341
+
342
+ Archived to: .planning/milestones/{version}-*
343
+ Git tag: {version}
344
+
345
+ ───────────────────────────────────────────────────────────────
346
+
347
+ ## ▶ Next Up
348
+
349
+ **Start the next milestone** — plan new features
350
+
351
+ `/pbr:milestone new`
352
+
353
+ <sub>`/clear` first → fresh context window</sub>
354
+
355
+ ───────────────────────────────────────────────────────────────
356
+
357
+ **Also available:**
358
+ - `/pbr:status` — see project status
359
+ - `/pbr:help` — see all commands
360
+
361
+ ───────────────────────────────────────────────────────────────
362
+ ```
363
+
364
+ ---
365
+
366
+ ## Subcommand: `audit`
367
+
368
+ Verify milestone completion with cross-phase integration checks.
369
+
370
+ ### Flow
371
+
372
+ 1. **Determine target:**
373
+ - If version provided: audit that specific milestone
374
+ - If no version: audit the current milestone (most recent active)
375
+
376
+ 2. **Read all VERIFICATION.md files** for milestone phases:
377
+ - Collect verification results
378
+ - Note any `gaps_found` statuses
379
+ - Note any phases without verification
380
+
381
+ 3. **Spawn integration checker:**
382
+
383
+ Display to the user: `◐ Spawning integration checker...`
384
+
385
+ Spawn `Task(subagent_type: "pbr:integration-checker")` with:
386
+
387
+ ```
388
+ You are integration-checker. Perform cross-phase integration verification.
389
+
390
+ Milestone: {version or "current"}
391
+ Phases to check: {list of phase directories}
392
+
393
+ Instructions:
394
+ 1. Read all SUMMARY.md files for the milestone phases
395
+ 2. Build a dependency graph from provides/affects/requires fields
396
+ 3. Verify integration points:
397
+ a. Every "requires" in a later phase is "provided" by an earlier phase
398
+ b. Every "affects" target still exists and hasn't been broken
399
+ c. No circular dependencies
400
+ d. No orphaned provides (things built but never consumed)
401
+ 4. Check for:
402
+ - Broken imports/references between phases
403
+ - API contract mismatches
404
+ - Missing error handling at integration points
405
+ - Configuration inconsistencies
406
+ 5. Return findings as a structured report
407
+ ```
408
+
409
+ 4. **Check requirements coverage:**
410
+ - Read REQUIREMENTS.md
411
+ - For each requirement tagged for this milestone:
412
+ - Search VERIFICATION.md files for coverage
413
+ - Search SUMMARY.md `provides` fields
414
+ - Flag uncovered requirements
415
+
416
+ 5. **Write audit report:**
417
+
418
+ Create `.planning/{version}-MILESTONE-AUDIT.md` using the template:
419
+
420
+ Read `skills/milestone/templates/audit-report.md.tmpl` for the audit report format. Fill in all `{variable}` placeholders with actual data from the audit.
421
+
422
+ 6. **Report to user** using branded banners:
423
+
424
+ **If PASSED:**
425
+ ```
426
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
427
+ PLAN-BUILD-RUN ► MILESTONE AUDIT PASSED ✓
428
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
429
+
430
+ All phases verified, integration checks passed, requirements covered.
431
+
432
+ ───────────────────────────────────────────────────────────────
433
+
434
+ ## ▶ Next Up
435
+
436
+ **Complete the milestone** — archive and tag
437
+
438
+ `/pbr:milestone complete {version}`
439
+
440
+ <sub>`/clear` first → fresh context window</sub>
441
+
442
+ ───────────────────────────────────────────────────────────────
443
+
444
+ **Also available:**
445
+ - `/pbr:milestone gaps` — address any minor issues first
446
+ - `/pbr:status` — see project status
447
+
448
+ ───────────────────────────────────────────────────────────────
449
+ ```
450
+
451
+ **If GAPS FOUND:**
452
+ ```
453
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
454
+ PLAN-BUILD-RUN ► MILESTONE AUDIT — GAPS FOUND ⚠
455
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
456
+
457
+ Found {count} gaps:
458
+ - {gap 1}
459
+ - {gap 2}
460
+
461
+ ───────────────────────────────────────────────────────────────
462
+
463
+ ## ▶ Next Up
464
+
465
+ **Close the gaps** — create fix phases
466
+
467
+ `/pbr:milestone gaps`
468
+
469
+ <sub>`/clear` first → fresh context window</sub>
470
+
471
+ ───────────────────────────────────────────────────────────────
472
+
473
+ **Also available:**
474
+ - `/pbr:milestone complete` — proceed despite gaps
475
+ - `/pbr:status` — see project status
476
+
477
+ ───────────────────────────────────────────────────────────────
478
+ ```
479
+
480
+ **If TECH DEBT:**
481
+ ```
482
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
483
+ PLAN-BUILD-RUN ► MILESTONE AUDIT — TECH DEBT ⚠
484
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
485
+
486
+ Milestone functional but has {count} tech debt items.
487
+
488
+ ───────────────────────────────────────────────────────────────
489
+
490
+ ## ▶ Next Up
491
+
492
+ **Address tech debt or proceed**
493
+
494
+ `/pbr:milestone gaps` — create cleanup phases
495
+ `/pbr:milestone complete` — proceed as-is
496
+
497
+ <sub>`/clear` first → fresh context window</sub>
498
+
499
+ ───────────────────────────────────────────────────────────────
500
+ ```
501
+
502
+ ---
503
+
504
+ ## Subcommand: `gaps`
505
+
506
+ Create phases to close gaps found during an audit.
507
+
508
+ ### Flow
509
+
510
+ 1. **Find most recent audit:**
511
+ - Search for `*-MILESTONE-AUDIT.md` in `.planning/`
512
+ - If multiple, use the most recent
513
+ - If none: "No audit found. Run `/pbr:milestone audit` first."
514
+
515
+ 2. **Read audit report:**
516
+ - Extract all gaps and tech debt items
517
+ - Parse severity levels
518
+
519
+ 3. **Prioritize gaps:**
520
+
521
+ Group by priority:
522
+ - **Must fix** (critical/high): Blocking issues, broken integration, uncovered requirements
523
+ - **Should fix** (medium): Non-critical integration issues, important tech debt
524
+ - **Nice to fix** (low): Minor tech debt, optimization opportunities
525
+
526
+ 4. **Present to user:**
527
+
528
+ ```
529
+ Gaps from milestone audit:
530
+
531
+ Must fix ({count}):
532
+ - {gap}: {description}
533
+
534
+ Should fix ({count}):
535
+ - {gap}: {description}
536
+
537
+ Nice to fix ({count}):
538
+ - {gap}: {description}
539
+
540
+ Use AskUserQuestion (pattern: multi-option-priority from `skills/shared/gate-prompts.md`):
541
+ question: "Which gaps should we address? ({must_count} must-fix, {should_count} should-fix, {nice_count} nice-to-fix)"
542
+ header: "Priority"
543
+ options:
544
+ - label: "Must-fix only" description: "Address {must_count} critical/high gaps"
545
+ - label: "Must + should" description: "Address {must_count + should_count} critical through medium gaps"
546
+ - label: "Everything" description: "Address all {total_count} gaps including low priority"
547
+ - label: "Let me pick" description: "Choose specific gaps to address"
548
+ - If "Must-fix only": filter to must-fix gaps for phase creation
549
+ - If "Must + should": filter to must-fix + should-fix gaps
550
+ - If "Everything": include all gaps
551
+ - If "Let me pick" or "Other": present individual gaps for selection
552
+
553
+ 5. **Group into logical phases:**
554
+ - Group related gaps together (same subsystem, same files)
555
+ - Each group becomes a phase
556
+ - Name phases descriptively: "{N+1}. Fix {area} integration" or "{N+1}. Address {component} gaps"
557
+
558
+ 6. **Update ROADMAP.md:**
559
+ Add gap-closure phases after the current milestone phases:
560
+
561
+ ```markdown
562
+ ### Phase {N}: Fix {area} (gap closure)
563
+ **Goal:** Address gaps found in milestone audit
564
+ **Gaps addressed:**
565
+ - {gap 1}
566
+ - {gap 2}
567
+ **Success criteria:** All addressed gaps pass verification
568
+ ```
569
+
570
+ 7. **Create phase directories:**
571
+ ```
572
+ .planning/phases/{NN}-fix-{slug}/
573
+ ```
574
+
575
+ 8. **Commit:**
576
+ ```
577
+ docs(planning): add gap-closure phases from milestone audit
578
+ ```
579
+
580
+ 9. **Confirm** with branded output:
581
+ ```
582
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
583
+ PLAN-BUILD-RUN ► GAP PHASES CREATED ✓
584
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
585
+
586
+ Created {count} gap-closure phase(s):
587
+ - Phase {N}: {name}
588
+ - Phase {N+1}: {name}
589
+
590
+ ───────────────────────────────────────────────────────────────
591
+
592
+ ## ▶ Next Up
593
+
594
+ **Plan the first gap-closure phase**
595
+
596
+ `/pbr:plan {N}`
597
+
598
+ <sub>`/clear` first → fresh context window</sub>
599
+
600
+ ───────────────────────────────────────────────────────────────
601
+
602
+ **Also available:**
603
+ - `/pbr:status` — see project status
604
+
605
+ ───────────────────────────────────────────────────────────────
606
+ ```
607
+
608
+ ---
609
+
610
+ ## State Integration
611
+
612
+ All subcommands update STATE.md:
613
+ - `new`: Sets current milestone, resets phase
614
+ - `complete`: Clears current milestone, updates history
615
+ - `audit`: Notes audit status and date
616
+ - `gaps`: Updates phase count and roadmap info
617
+
618
+ ---
619
+
620
+ ## Git Integration
621
+
622
+ Reference: `skills/shared/commit-planning-docs.md` for the standard commit pattern.
623
+
624
+ All subcommands commit if `planning.commit_docs: true`:
625
+ - `new`: `docs(planning): start milestone "{name}" (phases {start}-{end})`
626
+ - `complete`: `docs(planning): complete milestone {version}`
627
+ - `audit`: `docs(planning): audit milestone {version} - {status}`
628
+ - `gaps`: `docs(planning): add gap-closure phases from milestone audit`
629
+
630
+ Tags (complete only):
631
+ - `git tag -a {version} -m "Milestone: {name}"`
632
+
633
+ ---
634
+
635
+ ## Edge Cases
636
+
637
+ ### No ROADMAP.md exists
638
+ - For `new`: Create one from scratch (this is a fresh start)
639
+ - For others, display:
640
+ ```
641
+ ╔══════════════════════════════════════════════════════════════╗
642
+ ║ ERROR ║
643
+ ╚══════════════════════════════════════════════════════════════╝
644
+
645
+ No roadmap found.
646
+
647
+ **To fix:** Run `/pbr:begin` or `/pbr:milestone new` first.
648
+ ```
649
+
650
+ ### Milestone has no phases
651
+ Display:
652
+ ```
653
+ ╔══════════════════════════════════════════════════════════════╗
654
+ ║ ERROR ║
655
+ ╚══════════════════════════════════════════════════════════════╝
656
+
657
+ No phases found for this milestone.
658
+
659
+ **To fix:**
660
+ - For `complete`: Nothing to complete — add phases first.
661
+ - For `audit`: Nothing to audit — build phases first.
662
+ ```
663
+
664
+ ### Audit finds no gaps
665
+ - Status: PASSED
666
+ - Skip the recommendations section
667
+ - Suggest proceeding to complete
668
+
669
+ ### Version already exists (tag collision)
670
+ Display:
671
+ ```
672
+ ╔══════════════════════════════════════════════════════════════╗
673
+ ║ ERROR ║
674
+ ╚══════════════════════════════════════════════════════════════╝
675
+
676
+ Git tag {version} already exists.
677
+
678
+ **To fix:** Use a different version number (e.g., {version}.1).
679
+ ```
680
+ Ask for alternative via AskUserQuestion.
681
+
682
+ ### Partially verified milestone
683
+ - `complete` warns but allows proceeding with user confirmation
684
+ - `audit` treats unverified phases as gaps
685
+
686
+ ### Large milestone (8+ phases)
687
+ - `audit` may take longer due to integration checking
688
+ - Warn: "This milestone has {count} phases. The audit may take a few minutes."
689
+
690
+ ---
691
+
692
+ ## Anti-Patterns
693
+
694
+ 1. **DO NOT** skip the audit before completing — integration issues hide at boundaries
695
+ 2. **DO NOT** auto-complete milestones without user confirmation
696
+ 3. **DO NOT** create gap phases without user approval of priorities
697
+ 4. **DO NOT** delete audit reports — they're historical records
698
+ 5. **DO NOT** reuse version numbers — each milestone gets a unique version
699
+ 6. **DO NOT** modify code during milestone operations — this is project management only
700
+ 7. **DO NOT** collapse phases in ROADMAP.md before archiving — archive first, collapse second
701
+ 8. **DO NOT** skip the git tag — tags make milestone boundaries findable