@lipter7/blueprint 2.0.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 (125) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +626 -0
  3. package/agents/bp-codebase-mapper.md +761 -0
  4. package/agents/bp-debugger.md +1198 -0
  5. package/agents/bp-executor.md +403 -0
  6. package/agents/bp-integration-checker.md +423 -0
  7. package/agents/bp-phase-researcher.md +469 -0
  8. package/agents/bp-plan-checker.md +622 -0
  9. package/agents/bp-planner.md +1157 -0
  10. package/agents/bp-project-researcher.md +618 -0
  11. package/agents/bp-research-synthesizer.md +236 -0
  12. package/agents/bp-roadmapper.md +605 -0
  13. package/agents/bp-verifier.md +523 -0
  14. package/bin/install.js +1754 -0
  15. package/blueprint/bin/blueprint-tools.js +4597 -0
  16. package/blueprint/bin/blueprint-tools.test.js +2033 -0
  17. package/blueprint/references/checkpoints.md +775 -0
  18. package/blueprint/references/continuation-format.md +249 -0
  19. package/blueprint/references/decimal-phase-calculation.md +65 -0
  20. package/blueprint/references/git-integration.md +248 -0
  21. package/blueprint/references/git-planning-commit.md +38 -0
  22. package/blueprint/references/model-profile-resolution.md +32 -0
  23. package/blueprint/references/model-profiles.md +73 -0
  24. package/blueprint/references/phase-argument-parsing.md +61 -0
  25. package/blueprint/references/planning-config.md +194 -0
  26. package/blueprint/references/questioning.md +141 -0
  27. package/blueprint/references/tdd.md +263 -0
  28. package/blueprint/references/ui-brand.md +160 -0
  29. package/blueprint/references/verification-patterns.md +612 -0
  30. package/blueprint/templates/DEBUG.md +159 -0
  31. package/blueprint/templates/UAT.md +247 -0
  32. package/blueprint/templates/codebase/architecture.md +255 -0
  33. package/blueprint/templates/codebase/concerns.md +310 -0
  34. package/blueprint/templates/codebase/conventions.md +307 -0
  35. package/blueprint/templates/codebase/integrations.md +280 -0
  36. package/blueprint/templates/codebase/stack.md +186 -0
  37. package/blueprint/templates/codebase/structure.md +285 -0
  38. package/blueprint/templates/codebase/testing.md +480 -0
  39. package/blueprint/templates/config.json +35 -0
  40. package/blueprint/templates/context.md +283 -0
  41. package/blueprint/templates/continue-here.md +78 -0
  42. package/blueprint/templates/debug-subagent-prompt.md +91 -0
  43. package/blueprint/templates/discovery.md +146 -0
  44. package/blueprint/templates/milestone-archive.md +123 -0
  45. package/blueprint/templates/milestone.md +115 -0
  46. package/blueprint/templates/phase-prompt.md +567 -0
  47. package/blueprint/templates/planner-subagent-prompt.md +117 -0
  48. package/blueprint/templates/project.md +184 -0
  49. package/blueprint/templates/requirements.md +231 -0
  50. package/blueprint/templates/research-project/ARCHITECTURE.md +204 -0
  51. package/blueprint/templates/research-project/FEATURES.md +147 -0
  52. package/blueprint/templates/research-project/PITFALLS.md +200 -0
  53. package/blueprint/templates/research-project/STACK.md +120 -0
  54. package/blueprint/templates/research-project/SUMMARY.md +170 -0
  55. package/blueprint/templates/research.md +552 -0
  56. package/blueprint/templates/roadmap.md +202 -0
  57. package/blueprint/templates/state.md +176 -0
  58. package/blueprint/templates/summary-complex.md +59 -0
  59. package/blueprint/templates/summary-minimal.md +41 -0
  60. package/blueprint/templates/summary-standard.md +48 -0
  61. package/blueprint/templates/summary.md +246 -0
  62. package/blueprint/templates/user-setup.md +311 -0
  63. package/blueprint/templates/verification-report.md +322 -0
  64. package/blueprint/workflows/add-phase.md +111 -0
  65. package/blueprint/workflows/add-todo.md +157 -0
  66. package/blueprint/workflows/audit-milestone.md +241 -0
  67. package/blueprint/workflows/check-todos.md +176 -0
  68. package/blueprint/workflows/complete-milestone.md +644 -0
  69. package/blueprint/workflows/diagnose-issues.md +219 -0
  70. package/blueprint/workflows/discovery-phase.md +289 -0
  71. package/blueprint/workflows/discuss-phase.md +408 -0
  72. package/blueprint/workflows/execute-phase.md +338 -0
  73. package/blueprint/workflows/execute-plan.md +437 -0
  74. package/blueprint/workflows/help.md +470 -0
  75. package/blueprint/workflows/insert-phase.md +129 -0
  76. package/blueprint/workflows/list-phase-assumptions.md +178 -0
  77. package/blueprint/workflows/map-codebase.md +327 -0
  78. package/blueprint/workflows/new-milestone.md +373 -0
  79. package/blueprint/workflows/new-project.md +958 -0
  80. package/blueprint/workflows/pause-work.md +122 -0
  81. package/blueprint/workflows/plan-milestone-gaps.md +256 -0
  82. package/blueprint/workflows/plan-phase.md +376 -0
  83. package/blueprint/workflows/progress.md +385 -0
  84. package/blueprint/workflows/quick.md +230 -0
  85. package/blueprint/workflows/remove-phase.md +154 -0
  86. package/blueprint/workflows/research-phase.md +74 -0
  87. package/blueprint/workflows/resume-project.md +306 -0
  88. package/blueprint/workflows/set-profile.md +80 -0
  89. package/blueprint/workflows/settings.md +145 -0
  90. package/blueprint/workflows/transition.md +493 -0
  91. package/blueprint/workflows/update.md +212 -0
  92. package/blueprint/workflows/verify-phase.md +226 -0
  93. package/blueprint/workflows/verify-work.md +570 -0
  94. package/commands/bp/add-phase.md +39 -0
  95. package/commands/bp/add-todo.md +42 -0
  96. package/commands/bp/audit-milestone.md +42 -0
  97. package/commands/bp/check-todos.md +41 -0
  98. package/commands/bp/complete-milestone.md +136 -0
  99. package/commands/bp/debug.md +162 -0
  100. package/commands/bp/discuss-phase.md +86 -0
  101. package/commands/bp/execute-phase.md +42 -0
  102. package/commands/bp/help.md +22 -0
  103. package/commands/bp/insert-phase.md +33 -0
  104. package/commands/bp/join-discord.md +18 -0
  105. package/commands/bp/list-phase-assumptions.md +50 -0
  106. package/commands/bp/map-codebase.md +71 -0
  107. package/commands/bp/new-milestone.md +51 -0
  108. package/commands/bp/new-project.md +42 -0
  109. package/commands/bp/pause-work.md +35 -0
  110. package/commands/bp/plan-milestone-gaps.md +40 -0
  111. package/commands/bp/plan-phase.md +44 -0
  112. package/commands/bp/progress.md +24 -0
  113. package/commands/bp/quick.md +38 -0
  114. package/commands/bp/reapply-patches.md +110 -0
  115. package/commands/bp/remove-phase.md +32 -0
  116. package/commands/bp/research-phase.md +187 -0
  117. package/commands/bp/resume-work.md +40 -0
  118. package/commands/bp/set-profile.md +34 -0
  119. package/commands/bp/settings.md +36 -0
  120. package/commands/bp/update.md +37 -0
  121. package/commands/bp/verify-work.md +39 -0
  122. package/hooks/dist/bp-check-update.js +62 -0
  123. package/hooks/dist/bp-statusline.js +91 -0
  124. package/package.json +48 -0
  125. package/scripts/build-hooks.js +42 -0
@@ -0,0 +1,644 @@
1
+ <purpose>
2
+
3
+ Mark a shipped version (v1.0, v1.1, v2.0) as complete. Creates historical record in MILESTONES.md, performs full PROJECT.md evolution review, reorganizes ROADMAP.md with milestone groupings, and tags the release in git.
4
+
5
+ </purpose>
6
+
7
+ <required_reading>
8
+
9
+ 1. templates/milestone.md
10
+ 2. templates/milestone-archive.md
11
+ 3. `.blueprint/ROADMAP.md`
12
+ 4. `.blueprint/REQUIREMENTS.md`
13
+ 5. `.blueprint/PROJECT.md`
14
+
15
+ </required_reading>
16
+
17
+ <archival_behavior>
18
+
19
+ When a milestone completes:
20
+
21
+ 1. Extract full milestone details to `.blueprint/milestones/v[X.Y]-ROADMAP.md`
22
+ 2. Archive requirements to `.blueprint/milestones/v[X.Y]-REQUIREMENTS.md`
23
+ 3. Update ROADMAP.md — replace milestone details with one-line summary
24
+ 4. Delete REQUIREMENTS.md (fresh one for next milestone)
25
+ 5. Perform full PROJECT.md evolution review
26
+ 6. Offer to create next milestone inline
27
+
28
+ **Context Efficiency:** Archives keep ROADMAP.md constant-size and REQUIREMENTS.md milestone-scoped.
29
+
30
+ **ROADMAP archive** uses `templates/milestone-archive.md` — includes milestone header (status, phases, date), full phase details, milestone summary (decisions, issues, tech debt).
31
+
32
+ **REQUIREMENTS archive** contains all requirements marked complete with outcomes, traceability table with final status, notes on changed requirements.
33
+
34
+ </archival_behavior>
35
+
36
+ <process>
37
+
38
+ <step name="verify_readiness">
39
+
40
+ **Use `roadmap analyze` for comprehensive readiness check:**
41
+
42
+ ```bash
43
+ ROADMAP=$(node ~/.claude/blueprint/bin/blueprint-tools.js roadmap analyze)
44
+ ```
45
+
46
+ This returns all phases with plan/summary counts and disk status. Use this to verify:
47
+ - Which phases belong to this milestone?
48
+ - All phases complete (all plans have summaries)? Check `disk_status === 'complete'` for each.
49
+ - `progress_percent` should be 100%.
50
+
51
+ Present:
52
+
53
+ ```
54
+ Milestone: [Name, e.g., "v1.0 MVP"]
55
+
56
+ Includes:
57
+ - Phase 1: Foundation (2/2 plans complete)
58
+ - Phase 2: Authentication (2/2 plans complete)
59
+ - Phase 3: Core Features (3/3 plans complete)
60
+ - Phase 4: Polish (1/1 plan complete)
61
+
62
+ Total: {phase_count} phases, {total_plans} plans, all complete
63
+ ```
64
+
65
+ <config-check>
66
+
67
+ ```bash
68
+ cat .blueprint/config.json 2>/dev/null
69
+ ```
70
+
71
+ </config-check>
72
+
73
+ <if mode="yolo">
74
+
75
+ ```
76
+ ⚡ Auto-approved: Milestone scope verification
77
+ [Show breakdown summary without prompting]
78
+ Proceeding to stats gathering...
79
+ ```
80
+
81
+ Proceed to gather_stats.
82
+
83
+ </if>
84
+
85
+ <if mode="interactive" OR="custom with gates.confirm_milestone_scope true">
86
+
87
+ ```
88
+ Ready to mark this milestone as shipped?
89
+ (yes / wait / adjust scope)
90
+ ```
91
+
92
+ Wait for confirmation.
93
+ - "adjust scope": Ask which phases to include.
94
+ - "wait": Stop, user returns when ready.
95
+
96
+ </if>
97
+
98
+ </step>
99
+
100
+ <step name="gather_stats">
101
+
102
+ Calculate milestone statistics:
103
+
104
+ ```bash
105
+ git log --oneline --grep="feat(" | head -20
106
+ git diff --stat FIRST_COMMIT..LAST_COMMIT | tail -1
107
+ find . -name "*.swift" -o -name "*.ts" -o -name "*.py" | xargs wc -l 2>/dev/null
108
+ git log --format="%ai" FIRST_COMMIT | tail -1
109
+ git log --format="%ai" LAST_COMMIT | head -1
110
+ ```
111
+
112
+ Present:
113
+
114
+ ```
115
+ Milestone Stats:
116
+ - Phases: [X-Y]
117
+ - Plans: [Z] total
118
+ - Tasks: [N] total (from phase summaries)
119
+ - Files modified: [M]
120
+ - Lines of code: [LOC] [language]
121
+ - Timeline: [Days] days ([Start] → [End])
122
+ - Git range: feat(XX-XX) → feat(YY-YY)
123
+ ```
124
+
125
+ </step>
126
+
127
+ <step name="extract_accomplishments">
128
+
129
+ Extract one-liners from SUMMARY.md files using summary-extract:
130
+
131
+ ```bash
132
+ # For each phase in milestone, extract one-liner
133
+ for summary in .blueprint/phases/*-*/*-SUMMARY.md; do
134
+ node ~/.claude/blueprint/bin/blueprint-tools.js summary-extract "$summary" --fields one_liner | jq -r '.one_liner'
135
+ done
136
+ ```
137
+
138
+ Extract 4-6 key accomplishments. Present:
139
+
140
+ ```
141
+ Key accomplishments for this milestone:
142
+ 1. [Achievement from phase 1]
143
+ 2. [Achievement from phase 2]
144
+ 3. [Achievement from phase 3]
145
+ 4. [Achievement from phase 4]
146
+ 5. [Achievement from phase 5]
147
+ ```
148
+
149
+ </step>
150
+
151
+ <step name="create_milestone_entry">
152
+
153
+ **Note:** MILESTONES.md entry is now created automatically by `blueprint-tools milestone complete` in the archive_milestone step. The entry includes version, date, phase/plan/task counts, and accomplishments extracted from SUMMARY.md files.
154
+
155
+ If additional details are needed (e.g., user-provided "Delivered" summary, git range, LOC stats), add them manually after the CLI creates the base entry.
156
+
157
+ </step>
158
+
159
+ <step name="evolve_project_full_review">
160
+
161
+ Full PROJECT.md evolution review at milestone completion.
162
+
163
+ Read all phase summaries:
164
+
165
+ ```bash
166
+ cat .blueprint/phases/*-*/*-SUMMARY.md
167
+ ```
168
+
169
+ **Full review checklist:**
170
+
171
+ 1. **"What This Is" accuracy:**
172
+ - Compare current description to what was built
173
+ - Update if product has meaningfully changed
174
+
175
+ 2. **Core Value check:**
176
+ - Still the right priority? Did shipping reveal a different core value?
177
+ - Update if the ONE thing has shifted
178
+
179
+ 3. **Requirements audit:**
180
+
181
+ **Validated section:**
182
+ - All Active requirements shipped this milestone → Move to Validated
183
+ - Format: `- ✓ [Requirement] — v[X.Y]`
184
+
185
+ **Active section:**
186
+ - Remove requirements moved to Validated
187
+ - Add new requirements for next milestone
188
+ - Keep unaddressed requirements
189
+
190
+ **Out of Scope audit:**
191
+ - Review each item — reasoning still valid?
192
+ - Remove irrelevant items
193
+ - Add requirements invalidated during milestone
194
+
195
+ 4. **Context update:**
196
+ - Current codebase state (LOC, tech stack)
197
+ - User feedback themes (if any)
198
+ - Known issues or technical debt
199
+
200
+ 5. **Key Decisions audit:**
201
+ - Extract all decisions from milestone phase summaries
202
+ - Add to Key Decisions table with outcomes
203
+ - Mark ✓ Good, ⚠️ Revisit, or — Pending
204
+
205
+ 6. **Constraints check:**
206
+ - Any constraints changed during development? Update as needed
207
+
208
+ Update PROJECT.md inline. Update "Last updated" footer:
209
+
210
+ ```markdown
211
+ ---
212
+ *Last updated: [date] after v[X.Y] milestone*
213
+ ```
214
+
215
+ **Example full evolution (v1.0 → v1.1 prep):**
216
+
217
+ Before:
218
+
219
+ ```markdown
220
+ ## What This Is
221
+
222
+ A real-time collaborative whiteboard for remote teams.
223
+
224
+ ## Core Value
225
+
226
+ Real-time sync that feels instant.
227
+
228
+ ## Requirements
229
+
230
+ ### Validated
231
+
232
+ (None yet — ship to validate)
233
+
234
+ ### Active
235
+
236
+ - [ ] Canvas drawing tools
237
+ - [ ] Real-time sync < 500ms
238
+ - [ ] User authentication
239
+ - [ ] Export to PNG
240
+
241
+ ### Out of Scope
242
+
243
+ - Mobile app — web-first approach
244
+ - Video chat — use external tools
245
+ ```
246
+
247
+ After v1.0:
248
+
249
+ ```markdown
250
+ ## What This Is
251
+
252
+ A real-time collaborative whiteboard for remote teams with instant sync and drawing tools.
253
+
254
+ ## Core Value
255
+
256
+ Real-time sync that feels instant.
257
+
258
+ ## Requirements
259
+
260
+ ### Validated
261
+
262
+ - ✓ Canvas drawing tools — v1.0
263
+ - ✓ Real-time sync < 500ms — v1.0 (achieved 200ms avg)
264
+ - ✓ User authentication — v1.0
265
+
266
+ ### Active
267
+
268
+ - [ ] Export to PNG
269
+ - [ ] Undo/redo history
270
+ - [ ] Shape tools (rectangles, circles)
271
+
272
+ ### Out of Scope
273
+
274
+ - Mobile app — web-first approach, PWA works well
275
+ - Video chat — use external tools
276
+ - Offline mode — real-time is core value
277
+
278
+ ## Context
279
+
280
+ Shipped v1.0 with 2,400 LOC TypeScript.
281
+ Tech stack: Next.js, Supabase, Canvas API.
282
+ Initial user testing showed demand for shape tools.
283
+ ```
284
+
285
+ **Step complete when:**
286
+
287
+ - [ ] "What This Is" reviewed and updated if needed
288
+ - [ ] Core Value verified as still correct
289
+ - [ ] All shipped requirements moved to Validated
290
+ - [ ] New requirements added to Active for next milestone
291
+ - [ ] Out of Scope reasoning audited
292
+ - [ ] Context updated with current state
293
+ - [ ] All milestone decisions added to Key Decisions
294
+ - [ ] "Last updated" footer reflects milestone completion
295
+
296
+ </step>
297
+
298
+ <step name="reorganize_roadmap">
299
+
300
+ Update `.blueprint/ROADMAP.md` — group completed milestone phases:
301
+
302
+ ```markdown
303
+ # Roadmap: [Project Name]
304
+
305
+ ## Milestones
306
+
307
+ - ✅ **v1.0 MVP** — Phases 1-4 (shipped YYYY-MM-DD)
308
+ - 🚧 **v1.1 Security** — Phases 5-6 (in progress)
309
+ - 📋 **v2.0 Redesign** — Phases 7-10 (planned)
310
+
311
+ ## Phases
312
+
313
+ <details>
314
+ <summary>✅ v1.0 MVP (Phases 1-4) — SHIPPED YYYY-MM-DD</summary>
315
+
316
+ - [x] Phase 1: Foundation (2/2 plans) — completed YYYY-MM-DD
317
+ - [x] Phase 2: Authentication (2/2 plans) — completed YYYY-MM-DD
318
+ - [x] Phase 3: Core Features (3/3 plans) — completed YYYY-MM-DD
319
+ - [x] Phase 4: Polish (1/1 plan) — completed YYYY-MM-DD
320
+
321
+ </details>
322
+
323
+ ### 🚧 v[Next] [Name] (In Progress / Planned)
324
+
325
+ - [ ] Phase 5: [Name] ([N] plans)
326
+ - [ ] Phase 6: [Name] ([N] plans)
327
+
328
+ ## Progress
329
+
330
+ | Phase | Milestone | Plans Complete | Status | Completed |
331
+ | ----------------- | --------- | -------------- | ----------- | ---------- |
332
+ | 1. Foundation | v1.0 | 2/2 | Complete | YYYY-MM-DD |
333
+ | 2. Authentication | v1.0 | 2/2 | Complete | YYYY-MM-DD |
334
+ | 3. Core Features | v1.0 | 3/3 | Complete | YYYY-MM-DD |
335
+ | 4. Polish | v1.0 | 1/1 | Complete | YYYY-MM-DD |
336
+ | 5. Security Audit | v1.1 | 0/1 | Not started | - |
337
+ | 6. Hardening | v1.1 | 0/2 | Not started | - |
338
+ ```
339
+
340
+ </step>
341
+
342
+ <step name="archive_milestone">
343
+
344
+ **Delegate archival to blueprint-tools:**
345
+
346
+ ```bash
347
+ ARCHIVE=$(node ~/.claude/blueprint/bin/blueprint-tools.js milestone complete "v[X.Y]" --name "[Milestone Name]")
348
+ ```
349
+
350
+ The CLI handles:
351
+ - Creating `.blueprint/milestones/` directory
352
+ - Archiving ROADMAP.md to `milestones/v[X.Y]-ROADMAP.md`
353
+ - Archiving REQUIREMENTS.md to `milestones/v[X.Y]-REQUIREMENTS.md` with archive header
354
+ - Moving audit file to milestones if it exists
355
+ - Creating/appending MILESTONES.md entry with accomplishments from SUMMARY.md files
356
+ - Updating STATE.md (status, last activity)
357
+
358
+ Extract from result: `version`, `date`, `phases`, `plans`, `tasks`, `accomplishments`, `archived`.
359
+
360
+ Verify: `✅ Milestone archived to .blueprint/milestones/`
361
+
362
+ **Note:** Phase directories (`.blueprint/phases/`) are NOT deleted — they accumulate across milestones as raw execution history. Phase numbering continues (v1.0 phases 1-4, v1.1 phases 5-8, etc.).
363
+
364
+ After archival, the AI still handles:
365
+ - Reorganizing ROADMAP.md with milestone grouping (requires judgment)
366
+ - Full PROJECT.md evolution review (requires understanding)
367
+ - Deleting original ROADMAP.md and REQUIREMENTS.md
368
+ - These are NOT fully delegated because they require AI interpretation of content
369
+
370
+ </step>
371
+
372
+ <step name="reorganize_roadmap_and_delete_originals">
373
+
374
+ After `milestone complete` has archived, reorganize ROADMAP.md with milestone groupings, then delete originals:
375
+
376
+ **Reorganize ROADMAP.md** — group completed milestone phases:
377
+
378
+ ```markdown
379
+ # Roadmap: [Project Name]
380
+
381
+ ## Milestones
382
+
383
+ - ✅ **v1.0 MVP** — Phases 1-4 (shipped YYYY-MM-DD)
384
+ - 🚧 **v1.1 Security** — Phases 5-6 (in progress)
385
+
386
+ ## Phases
387
+
388
+ <details>
389
+ <summary>✅ v1.0 MVP (Phases 1-4) — SHIPPED YYYY-MM-DD</summary>
390
+
391
+ - [x] Phase 1: Foundation (2/2 plans) — completed YYYY-MM-DD
392
+ - [x] Phase 2: Authentication (2/2 plans) — completed YYYY-MM-DD
393
+
394
+ </details>
395
+ ```
396
+
397
+ **Then delete originals:**
398
+
399
+ ```bash
400
+ rm .blueprint/ROADMAP.md
401
+ rm .blueprint/REQUIREMENTS.md
402
+ ```
403
+
404
+ </step>
405
+
406
+ <step name="update_state">
407
+
408
+ Most STATE.md updates were handled by `milestone complete`, but verify and update remaining fields:
409
+
410
+ **Project Reference:**
411
+
412
+ ```markdown
413
+ ## Project Reference
414
+
415
+ See: .blueprint/PROJECT.md (updated [today])
416
+
417
+ **Core value:** [Current core value from PROJECT.md]
418
+ **Current focus:** [Next milestone or "Planning next milestone"]
419
+ ```
420
+
421
+ **Accumulated Context:**
422
+ - Clear decisions summary (full log in PROJECT.md)
423
+ - Clear resolved blockers
424
+ - Keep open blockers for next milestone
425
+
426
+ </step>
427
+
428
+ <step name="handle_branches">
429
+
430
+ Check branching strategy and offer merge options.
431
+
432
+ Use `init milestone-op` for context, or load config directly:
433
+
434
+ ```bash
435
+ INIT=$(node ~/.claude/blueprint/bin/blueprint-tools.js init execute-phase "1")
436
+ ```
437
+
438
+ Extract `branching_strategy`, `phase_branch_template`, `milestone_branch_template` from init JSON.
439
+
440
+ **If "none":** Skip to git_tag.
441
+
442
+ **For "phase" strategy:**
443
+
444
+ ```bash
445
+ BRANCH_PREFIX=$(echo "$PHASE_BRANCH_TEMPLATE" | sed 's/{.*//')
446
+ PHASE_BRANCHES=$(git branch --list "${BRANCH_PREFIX}*" 2>/dev/null | sed 's/^\*//' | tr -d ' ')
447
+ ```
448
+
449
+ **For "milestone" strategy:**
450
+
451
+ ```bash
452
+ BRANCH_PREFIX=$(echo "$MILESTONE_BRANCH_TEMPLATE" | sed 's/{.*//')
453
+ MILESTONE_BRANCH=$(git branch --list "${BRANCH_PREFIX}*" 2>/dev/null | sed 's/^\*//' | tr -d ' ' | head -1)
454
+ ```
455
+
456
+ **If no branches found:** Skip to git_tag.
457
+
458
+ **If branches exist:**
459
+
460
+ ```
461
+ ## Git Branches Detected
462
+
463
+ Branching strategy: {phase/milestone}
464
+ Branches: {list}
465
+
466
+ Options:
467
+ 1. **Merge to main** — Merge branch(es) to main
468
+ 2. **Delete without merging** — Already merged or not needed
469
+ 3. **Keep branches** — Leave for manual handling
470
+ ```
471
+
472
+ AskUserQuestion with options: Squash merge (Recommended), Merge with history, Delete without merging, Keep branches.
473
+
474
+ **Squash merge:**
475
+
476
+ ```bash
477
+ CURRENT_BRANCH=$(git branch --show-current)
478
+ git checkout main
479
+
480
+ if [ "$BRANCHING_STRATEGY" = "phase" ]; then
481
+ for branch in $PHASE_BRANCHES; do
482
+ git merge --squash "$branch"
483
+ git commit -m "feat: $branch for v[X.Y]"
484
+ done
485
+ fi
486
+
487
+ if [ "$BRANCHING_STRATEGY" = "milestone" ]; then
488
+ git merge --squash "$MILESTONE_BRANCH"
489
+ git commit -m "feat: $MILESTONE_BRANCH for v[X.Y]"
490
+ fi
491
+
492
+ git checkout "$CURRENT_BRANCH"
493
+ ```
494
+
495
+ **Merge with history:**
496
+
497
+ ```bash
498
+ CURRENT_BRANCH=$(git branch --show-current)
499
+ git checkout main
500
+
501
+ if [ "$BRANCHING_STRATEGY" = "phase" ]; then
502
+ for branch in $PHASE_BRANCHES; do
503
+ git merge --no-ff "$branch" -m "Merge branch '$branch' for v[X.Y]"
504
+ done
505
+ fi
506
+
507
+ if [ "$BRANCHING_STRATEGY" = "milestone" ]; then
508
+ git merge --no-ff "$MILESTONE_BRANCH" -m "Merge branch '$MILESTONE_BRANCH' for v[X.Y]"
509
+ fi
510
+
511
+ git checkout "$CURRENT_BRANCH"
512
+ ```
513
+
514
+ **Delete without merging:**
515
+
516
+ ```bash
517
+ if [ "$BRANCHING_STRATEGY" = "phase" ]; then
518
+ for branch in $PHASE_BRANCHES; do
519
+ git branch -d "$branch" 2>/dev/null || git branch -D "$branch"
520
+ done
521
+ fi
522
+
523
+ if [ "$BRANCHING_STRATEGY" = "milestone" ]; then
524
+ git branch -d "$MILESTONE_BRANCH" 2>/dev/null || git branch -D "$MILESTONE_BRANCH"
525
+ fi
526
+ ```
527
+
528
+ **Keep branches:** Report "Branches preserved for manual handling"
529
+
530
+ </step>
531
+
532
+ <step name="git_tag">
533
+
534
+ Create git tag:
535
+
536
+ ```bash
537
+ git tag -a v[X.Y] -m "v[X.Y] [Name]
538
+
539
+ Delivered: [One sentence]
540
+
541
+ Key accomplishments:
542
+ - [Item 1]
543
+ - [Item 2]
544
+ - [Item 3]
545
+
546
+ See .blueprint/MILESTONES.md for full details."
547
+ ```
548
+
549
+ Confirm: "Tagged: v[X.Y]"
550
+
551
+ Ask: "Push tag to remote? (y/n)"
552
+
553
+ If yes:
554
+ ```bash
555
+ git push origin v[X.Y]
556
+ ```
557
+
558
+ </step>
559
+
560
+ <step name="git_commit_milestone">
561
+
562
+ Commit milestone completion.
563
+
564
+ ```bash
565
+ node ~/.claude/blueprint/bin/blueprint-tools.js commit "chore: complete v[X.Y] milestone" --files .blueprint/milestones/v[X.Y]-ROADMAP.md .blueprint/milestones/v[X.Y]-REQUIREMENTS.md .blueprint/milestones/v[X.Y]-MILESTONE-AUDIT.md .blueprint/MILESTONES.md .blueprint/PROJECT.md .blueprint/STATE.md
566
+ ```
567
+ ```
568
+
569
+ Confirm: "Committed: chore: complete v[X.Y] milestone"
570
+
571
+ </step>
572
+
573
+ <step name="offer_next">
574
+
575
+ ```
576
+ ✅ Milestone v[X.Y] [Name] complete
577
+
578
+ Shipped:
579
+ - [N] phases ([M] plans, [P] tasks)
580
+ - [One sentence of what shipped]
581
+
582
+ Archived:
583
+ - milestones/v[X.Y]-ROADMAP.md
584
+ - milestones/v[X.Y]-REQUIREMENTS.md
585
+
586
+ Summary: .blueprint/MILESTONES.md
587
+ Tag: v[X.Y]
588
+
589
+ ---
590
+
591
+ ## ▶ Next Up
592
+
593
+ **Start Next Milestone** — questioning → research → requirements → roadmap
594
+
595
+ `/bp:new-milestone`
596
+
597
+ <sub>`/clear` first → fresh context window</sub>
598
+
599
+ ---
600
+ ```
601
+
602
+ </step>
603
+
604
+ </process>
605
+
606
+ <milestone_naming>
607
+
608
+ **Version conventions:**
609
+ - **v1.0** — Initial MVP
610
+ - **v1.1, v1.2** — Minor updates, new features, fixes
611
+ - **v2.0, v3.0** — Major rewrites, breaking changes, new direction
612
+
613
+ **Names:** Short 1-2 words (v1.0 MVP, v1.1 Security, v1.2 Performance, v2.0 Redesign).
614
+
615
+ </milestone_naming>
616
+
617
+ <what_qualifies>
618
+
619
+ **Create milestones for:** Initial release, public releases, major feature sets shipped, before archiving planning.
620
+
621
+ **Don't create milestones for:** Every phase completion (too granular), work in progress, internal dev iterations (unless truly shipped).
622
+
623
+ Heuristic: "Is this deployed/usable/shipped?" If yes → milestone. If no → keep working.
624
+
625
+ </what_qualifies>
626
+
627
+ <success_criteria>
628
+
629
+ Milestone completion is successful when:
630
+
631
+ - [ ] MILESTONES.md entry created with stats and accomplishments
632
+ - [ ] PROJECT.md full evolution review completed
633
+ - [ ] All shipped requirements moved to Validated in PROJECT.md
634
+ - [ ] Key Decisions updated with outcomes
635
+ - [ ] ROADMAP.md reorganized with milestone grouping
636
+ - [ ] Roadmap archive created (milestones/v[X.Y]-ROADMAP.md)
637
+ - [ ] Requirements archive created (milestones/v[X.Y]-REQUIREMENTS.md)
638
+ - [ ] REQUIREMENTS.md deleted (fresh for next milestone)
639
+ - [ ] STATE.md updated with fresh project reference
640
+ - [ ] Git tag created (v[X.Y])
641
+ - [ ] Milestone commit made (includes archive files and deletion)
642
+ - [ ] User knows next step (/bp:new-milestone)
643
+
644
+ </success_criteria>