@sienklogic/plan-build-run 2.0.0 → 2.0.1

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