@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,958 @@
1
+ <purpose>
2
+ Initialize a new project through unified flow: questioning, research (optional), requirements, roadmap. This is the most leveraged moment in any project — deep questioning here means better plans, better execution, better outcomes. One workflow takes you from idea to ready-for-planning.
3
+ </purpose>
4
+
5
+ <required_reading>
6
+ Read all files referenced by the invoking prompt's execution_context before starting.
7
+ </required_reading>
8
+
9
+ <auto_mode>
10
+ ## Auto Mode Detection
11
+
12
+ Check if `--auto` flag is present in $ARGUMENTS.
13
+
14
+ **If auto mode:**
15
+ - Skip brownfield mapping offer (assume greenfield)
16
+ - Skip deep questioning (extract context from provided document)
17
+ - Config questions still required (Step 5)
18
+ - After config: run Steps 6-9 automatically with smart defaults:
19
+ - Research: Always yes
20
+ - Requirements: Include all table stakes + features from provided document
21
+ - Requirements approval: Auto-approve
22
+ - Roadmap approval: Auto-approve
23
+
24
+ **Document requirement:**
25
+ Auto mode requires an idea document via @ reference (e.g., `/bp:new-project --auto @prd.md`). If no document provided, error:
26
+
27
+ ```
28
+ Error: --auto requires an idea document via @ reference.
29
+
30
+ Usage: /bp:new-project --auto @your-idea.md
31
+
32
+ The document should describe what you want to build.
33
+ ```
34
+ </auto_mode>
35
+
36
+ <process>
37
+
38
+ ## 1. Setup
39
+
40
+ **MANDATORY FIRST STEP — Execute these checks before ANY user interaction:**
41
+
42
+ ```bash
43
+ INIT=$(node ~/.claude/blueprint/bin/blueprint-tools.js init new-project)
44
+ ```
45
+
46
+ Parse JSON for: `researcher_model`, `synthesizer_model`, `roadmapper_model`, `commit_docs`, `project_exists`, `has_codebase_map`, `planning_exists`, `has_existing_code`, `has_package_file`, `is_brownfield`, `needs_codebase_map`, `has_git`.
47
+
48
+ **If `project_exists` is true:** Error — project already initialized. Use `/bp:progress`.
49
+
50
+ **If `has_git` is false:** Initialize git:
51
+ ```bash
52
+ git init
53
+ ```
54
+
55
+ ## 2. Brownfield Offer
56
+
57
+ **If auto mode:** Skip to Step 4 (assume greenfield, synthesize PROJECT.md from provided document).
58
+
59
+ **If `needs_codebase_map` is true** (from init — existing code detected but no codebase map):
60
+
61
+ Use AskUserQuestion:
62
+ - header: "Existing Code"
63
+ - question: "I detected existing code in this directory. Would you like to map the codebase first?"
64
+ - options:
65
+ - "Map codebase first" — Run /bp:map-codebase to understand existing architecture (Recommended)
66
+ - "Skip mapping" — Proceed with project initialization
67
+
68
+ **If "Map codebase first":**
69
+ ```
70
+ Run `/bp:map-codebase` first, then return to `/bp:new-project`
71
+ ```
72
+ Exit command.
73
+
74
+ **If "Skip mapping" OR `needs_codebase_map` is false:** Continue to Step 3.
75
+
76
+ ## 3. Deep Questioning
77
+
78
+ **If auto mode:** Skip. Extract project context from provided document instead and proceed to Step 4.
79
+
80
+ **Display stage banner:**
81
+
82
+ ```
83
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
84
+ Blueprint ► QUESTIONING
85
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
86
+ ```
87
+
88
+ **Open the conversation:**
89
+
90
+ Ask inline (freeform, NOT AskUserQuestion):
91
+
92
+ "What do you want to build?"
93
+
94
+ Wait for their response. This gives you the context needed to ask intelligent follow-up questions.
95
+
96
+ **Follow the thread:**
97
+
98
+ Based on what they said, ask follow-up questions that dig into their response. Use AskUserQuestion with options that probe what they mentioned — interpretations, clarifications, concrete examples.
99
+
100
+ Keep following threads. Each answer opens new threads to explore. Ask about:
101
+ - What excited them
102
+ - What problem sparked this
103
+ - What they mean by vague terms
104
+ - What it would actually look like
105
+ - What's already decided
106
+
107
+ Consult `questioning.md` for techniques:
108
+ - Challenge vagueness
109
+ - Make abstract concrete
110
+ - Surface assumptions
111
+ - Find edges
112
+ - Reveal motivation
113
+
114
+ **Check context (background, not out loud):**
115
+
116
+ As you go, mentally check the context checklist from `questioning.md`. If gaps remain, weave questions naturally. Don't suddenly switch to checklist mode.
117
+
118
+ **Decision gate:**
119
+
120
+ When you could write a clear PROJECT.md, use AskUserQuestion:
121
+
122
+ - header: "Ready?"
123
+ - question: "I think I understand what you're after. Ready to create PROJECT.md?"
124
+ - options:
125
+ - "Create PROJECT.md" — Let's move forward
126
+ - "Keep exploring" — I want to share more / ask me more
127
+
128
+ If "Keep exploring" — ask what they want to add, or identify gaps and probe naturally.
129
+
130
+ Loop until "Create PROJECT.md" selected.
131
+
132
+ ## 4. Write PROJECT.md
133
+
134
+ **If auto mode:** Synthesize from provided document. No "Ready?" gate was shown — proceed directly to commit.
135
+
136
+ Synthesize all context into `.blueprint/PROJECT.md` using the template from `templates/project.md`.
137
+
138
+ **For greenfield projects:**
139
+
140
+ Initialize requirements as hypotheses:
141
+
142
+ ```markdown
143
+ ## Requirements
144
+
145
+ ### Validated
146
+
147
+ (None yet — ship to validate)
148
+
149
+ ### Active
150
+
151
+ - [ ] [Requirement 1]
152
+ - [ ] [Requirement 2]
153
+ - [ ] [Requirement 3]
154
+
155
+ ### Out of Scope
156
+
157
+ - [Exclusion 1] — [why]
158
+ - [Exclusion 2] — [why]
159
+ ```
160
+
161
+ All Active requirements are hypotheses until shipped and validated.
162
+
163
+ **For brownfield projects (codebase map exists):**
164
+
165
+ Infer Validated requirements from existing code:
166
+
167
+ 1. Read `.blueprint/codebase/ARCHITECTURE.md` and `STACK.md`
168
+ 2. Identify what the codebase already does
169
+ 3. These become the initial Validated set
170
+
171
+ ```markdown
172
+ ## Requirements
173
+
174
+ ### Validated
175
+
176
+ - ✓ [Existing capability 1] — existing
177
+ - ✓ [Existing capability 2] — existing
178
+ - ✓ [Existing capability 3] — existing
179
+
180
+ ### Active
181
+
182
+ - [ ] [New requirement 1]
183
+ - [ ] [New requirement 2]
184
+
185
+ ### Out of Scope
186
+
187
+ - [Exclusion 1] — [why]
188
+ ```
189
+
190
+ **Key Decisions:**
191
+
192
+ Initialize with any decisions made during questioning:
193
+
194
+ ```markdown
195
+ ## Key Decisions
196
+
197
+ | Decision | Rationale | Outcome |
198
+ |----------|-----------|---------|
199
+ | [Choice from questioning] | [Why] | — Pending |
200
+ ```
201
+
202
+ **Last updated footer:**
203
+
204
+ ```markdown
205
+ ---
206
+ *Last updated: [date] after initialization*
207
+ ```
208
+
209
+ Do not compress. Capture everything gathered.
210
+
211
+ **Commit PROJECT.md:**
212
+
213
+ ```bash
214
+ mkdir -p .blueprint
215
+ node ~/.claude/blueprint/bin/blueprint-tools.js commit "docs: initialize project" --files .blueprint/PROJECT.md
216
+ ```
217
+
218
+ ## 5. Workflow Preferences
219
+
220
+ **Round 1 — Core workflow settings (4 questions):**
221
+
222
+ ```
223
+ questions: [
224
+ {
225
+ header: "Mode",
226
+ question: "How do you want to work?",
227
+ multiSelect: false,
228
+ options: [
229
+ { label: "YOLO (Recommended)", description: "Auto-approve, just execute" },
230
+ { label: "Interactive", description: "Confirm at each step" }
231
+ ]
232
+ },
233
+ {
234
+ header: "Depth",
235
+ question: "How thorough should planning be?",
236
+ multiSelect: false,
237
+ options: [
238
+ { label: "Quick", description: "Ship fast (3-5 phases, 1-3 plans each)" },
239
+ { label: "Standard", description: "Balanced scope and speed (5-8 phases, 3-5 plans each)" },
240
+ { label: "Comprehensive", description: "Thorough coverage (8-12 phases, 5-10 plans each)" }
241
+ ]
242
+ },
243
+ {
244
+ header: "Execution",
245
+ question: "Run plans in parallel?",
246
+ multiSelect: false,
247
+ options: [
248
+ { label: "Parallel (Recommended)", description: "Independent plans run simultaneously" },
249
+ { label: "Sequential", description: "One plan at a time" }
250
+ ]
251
+ },
252
+ {
253
+ header: "Git Tracking",
254
+ question: "Commit planning docs to git?",
255
+ multiSelect: false,
256
+ options: [
257
+ { label: "Yes (Recommended)", description: "Planning docs tracked in version control" },
258
+ { label: "No", description: "Keep .blueprint/ local-only (add to .gitignore)" }
259
+ ]
260
+ }
261
+ ]
262
+ ```
263
+
264
+ **Round 2 — Workflow agents:**
265
+
266
+ These spawn additional agents during planning/execution. They add tokens and time but improve quality.
267
+
268
+ | Agent | When it runs | What it does |
269
+ |-------|--------------|--------------|
270
+ | **Researcher** | Before planning each phase | Investigates domain, finds patterns, surfaces gotchas |
271
+ | **Plan Checker** | After plan is created | Verifies plan actually achieves the phase goal |
272
+ | **Verifier** | After phase execution | Confirms must-haves were delivered |
273
+
274
+ All recommended for important projects. Skip for quick experiments.
275
+
276
+ ```
277
+ questions: [
278
+ {
279
+ header: "Research",
280
+ question: "Research before planning each phase? (adds tokens/time)",
281
+ multiSelect: false,
282
+ options: [
283
+ { label: "Yes (Recommended)", description: "Investigate domain, find patterns, surface gotchas" },
284
+ { label: "No", description: "Plan directly from requirements" }
285
+ ]
286
+ },
287
+ {
288
+ header: "Plan Check",
289
+ question: "Verify plans will achieve their goals? (adds tokens/time)",
290
+ multiSelect: false,
291
+ options: [
292
+ { label: "Yes (Recommended)", description: "Catch gaps before execution starts" },
293
+ { label: "No", description: "Execute plans without verification" }
294
+ ]
295
+ },
296
+ {
297
+ header: "Verifier",
298
+ question: "Verify work satisfies requirements after each phase? (adds tokens/time)",
299
+ multiSelect: false,
300
+ options: [
301
+ { label: "Yes (Recommended)", description: "Confirm deliverables match phase goals" },
302
+ { label: "No", description: "Trust execution, skip verification" }
303
+ ]
304
+ },
305
+ {
306
+ header: "Model Profile",
307
+ question: "Which AI models for planning agents?",
308
+ multiSelect: false,
309
+ options: [
310
+ { label: "Balanced (Recommended)", description: "Sonnet for most agents — good quality/cost ratio" },
311
+ { label: "Quality", description: "Opus for research/roadmap — higher cost, deeper analysis" },
312
+ { label: "Budget", description: "Haiku where possible — fastest, lowest cost" }
313
+ ]
314
+ }
315
+ ]
316
+ ```
317
+
318
+ Create `.blueprint/config.json` with all settings:
319
+
320
+ ```json
321
+ {
322
+ "mode": "yolo|interactive",
323
+ "depth": "quick|standard|comprehensive",
324
+ "parallelization": true|false,
325
+ "commit_docs": true|false,
326
+ "model_profile": "quality|balanced|budget",
327
+ "workflow": {
328
+ "research": true|false,
329
+ "plan_check": true|false,
330
+ "verifier": true|false
331
+ }
332
+ }
333
+ ```
334
+
335
+ **If commit_docs = No:**
336
+ - Set `commit_docs: false` in config.json
337
+ - Add `.blueprint/` to `.gitignore` (create if needed)
338
+
339
+ **If commit_docs = Yes:**
340
+ - No additional gitignore entries needed
341
+
342
+ **Commit config.json:**
343
+
344
+ ```bash
345
+ node ~/.claude/blueprint/bin/blueprint-tools.js commit "chore: add project config" --files .blueprint/config.json
346
+ ```
347
+
348
+ **Note:** Run `/bp:settings` anytime to update these preferences.
349
+
350
+ ## 5.5. Resolve Model Profile
351
+
352
+ Use models from init: `researcher_model`, `synthesizer_model`, `roadmapper_model`.
353
+
354
+ ## 6. Research Decision
355
+
356
+ **If auto mode:** Default to "Research first" without asking.
357
+
358
+ Use AskUserQuestion:
359
+ - header: "Research"
360
+ - question: "Research the domain ecosystem before defining requirements?"
361
+ - options:
362
+ - "Research first (Recommended)" — Discover standard stacks, expected features, architecture patterns
363
+ - "Skip research" — I know this domain well, go straight to requirements
364
+
365
+ **If "Research first":**
366
+
367
+ Display stage banner:
368
+ ```
369
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
370
+ Blueprint ► RESEARCHING
371
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
372
+
373
+ Researching [domain] ecosystem...
374
+ ```
375
+
376
+ Create research directory:
377
+ ```bash
378
+ mkdir -p .blueprint/research
379
+ ```
380
+
381
+ **Determine milestone context:**
382
+
383
+ Check if this is greenfield or subsequent milestone:
384
+ - If no "Validated" requirements in PROJECT.md → Greenfield (building from scratch)
385
+ - If "Validated" requirements exist → Subsequent milestone (adding to existing app)
386
+
387
+ Display spawning indicator:
388
+ ```
389
+ ◆ Spawning 4 researchers in parallel...
390
+ → Stack research
391
+ → Features research
392
+ → Architecture research
393
+ → Pitfalls research
394
+ ```
395
+
396
+ Spawn 4 parallel bp-project-researcher agents with rich context:
397
+
398
+ ```
399
+ Task(prompt="First, read ~/.claude/agents/bp-project-researcher.md for your role and instructions.
400
+
401
+ <research_type>
402
+ Project Research — Stack dimension for [domain].
403
+ </research_type>
404
+
405
+ <milestone_context>
406
+ [greenfield OR subsequent]
407
+
408
+ Greenfield: Research the standard stack for building [domain] from scratch.
409
+ Subsequent: Research what's needed to add [target features] to an existing [domain] app. Don't re-research the existing system.
410
+ </milestone_context>
411
+
412
+ <question>
413
+ What's the standard 2025 stack for [domain]?
414
+ </question>
415
+
416
+ <project_context>
417
+ [PROJECT.md summary - core value, constraints, what they're building]
418
+ </project_context>
419
+
420
+ <downstream_consumer>
421
+ Your STACK.md feeds into roadmap creation. Be prescriptive:
422
+ - Specific libraries with versions
423
+ - Clear rationale for each choice
424
+ - What NOT to use and why
425
+ </downstream_consumer>
426
+
427
+ <quality_gate>
428
+ - [ ] Versions are current (verify with Context7/official docs, not training data)
429
+ - [ ] Rationale explains WHY, not just WHAT
430
+ - [ ] Confidence levels assigned to each recommendation
431
+ </quality_gate>
432
+
433
+ <output>
434
+ Write to: .blueprint/research/STACK.md
435
+ Use template: ~/.claude/blueprint/templates/research-project/STACK.md
436
+ </output>
437
+ ", subagent_type="general-purpose", model="{researcher_model}", description="Stack research")
438
+
439
+ Task(prompt="First, read ~/.claude/agents/bp-project-researcher.md for your role and instructions.
440
+
441
+ <research_type>
442
+ Project Research — Features dimension for [domain].
443
+ </research_type>
444
+
445
+ <milestone_context>
446
+ [greenfield OR subsequent]
447
+
448
+ Greenfield: What features do [domain] products have? What's table stakes vs differentiating?
449
+ Subsequent: How do [target features] typically work? What's expected behavior?
450
+ </milestone_context>
451
+
452
+ <question>
453
+ What features do [domain] products have? What's table stakes vs differentiating?
454
+ </question>
455
+
456
+ <project_context>
457
+ [PROJECT.md summary]
458
+ </project_context>
459
+
460
+ <downstream_consumer>
461
+ Your FEATURES.md feeds into requirements definition. Categorize clearly:
462
+ - Table stakes (must have or users leave)
463
+ - Differentiators (competitive advantage)
464
+ - Anti-features (things to deliberately NOT build)
465
+ </downstream_consumer>
466
+
467
+ <quality_gate>
468
+ - [ ] Categories are clear (table stakes vs differentiators vs anti-features)
469
+ - [ ] Complexity noted for each feature
470
+ - [ ] Dependencies between features identified
471
+ </quality_gate>
472
+
473
+ <output>
474
+ Write to: .blueprint/research/FEATURES.md
475
+ Use template: ~/.claude/blueprint/templates/research-project/FEATURES.md
476
+ </output>
477
+ ", subagent_type="general-purpose", model="{researcher_model}", description="Features research")
478
+
479
+ Task(prompt="First, read ~/.claude/agents/bp-project-researcher.md for your role and instructions.
480
+
481
+ <research_type>
482
+ Project Research — Architecture dimension for [domain].
483
+ </research_type>
484
+
485
+ <milestone_context>
486
+ [greenfield OR subsequent]
487
+
488
+ Greenfield: How are [domain] systems typically structured? What are major components?
489
+ Subsequent: How do [target features] integrate with existing [domain] architecture?
490
+ </milestone_context>
491
+
492
+ <question>
493
+ How are [domain] systems typically structured? What are major components?
494
+ </question>
495
+
496
+ <project_context>
497
+ [PROJECT.md summary]
498
+ </project_context>
499
+
500
+ <downstream_consumer>
501
+ Your ARCHITECTURE.md informs phase structure in roadmap. Include:
502
+ - Component boundaries (what talks to what)
503
+ - Data flow (how information moves)
504
+ - Suggested build order (dependencies between components)
505
+ </downstream_consumer>
506
+
507
+ <quality_gate>
508
+ - [ ] Components clearly defined with boundaries
509
+ - [ ] Data flow direction explicit
510
+ - [ ] Build order implications noted
511
+ </quality_gate>
512
+
513
+ <output>
514
+ Write to: .blueprint/research/ARCHITECTURE.md
515
+ Use template: ~/.claude/blueprint/templates/research-project/ARCHITECTURE.md
516
+ </output>
517
+ ", subagent_type="general-purpose", model="{researcher_model}", description="Architecture research")
518
+
519
+ Task(prompt="First, read ~/.claude/agents/bp-project-researcher.md for your role and instructions.
520
+
521
+ <research_type>
522
+ Project Research — Pitfalls dimension for [domain].
523
+ </research_type>
524
+
525
+ <milestone_context>
526
+ [greenfield OR subsequent]
527
+
528
+ Greenfield: What do [domain] projects commonly get wrong? Critical mistakes?
529
+ Subsequent: What are common mistakes when adding [target features] to [domain]?
530
+ </milestone_context>
531
+
532
+ <question>
533
+ What do [domain] projects commonly get wrong? Critical mistakes?
534
+ </question>
535
+
536
+ <project_context>
537
+ [PROJECT.md summary]
538
+ </project_context>
539
+
540
+ <downstream_consumer>
541
+ Your PITFALLS.md prevents mistakes in roadmap/planning. For each pitfall:
542
+ - Warning signs (how to detect early)
543
+ - Prevention strategy (how to avoid)
544
+ - Which phase should address it
545
+ </downstream_consumer>
546
+
547
+ <quality_gate>
548
+ - [ ] Pitfalls are specific to this domain (not generic advice)
549
+ - [ ] Prevention strategies are actionable
550
+ - [ ] Phase mapping included where relevant
551
+ </quality_gate>
552
+
553
+ <output>
554
+ Write to: .blueprint/research/PITFALLS.md
555
+ Use template: ~/.claude/blueprint/templates/research-project/PITFALLS.md
556
+ </output>
557
+ ", subagent_type="general-purpose", model="{researcher_model}", description="Pitfalls research")
558
+ ```
559
+
560
+ After all 4 agents complete, spawn synthesizer to create SUMMARY.md:
561
+
562
+ ```
563
+ Task(prompt="
564
+ <task>
565
+ Synthesize research outputs into SUMMARY.md.
566
+ </task>
567
+
568
+ <research_files>
569
+ Read these files:
570
+ - .blueprint/research/STACK.md
571
+ - .blueprint/research/FEATURES.md
572
+ - .blueprint/research/ARCHITECTURE.md
573
+ - .blueprint/research/PITFALLS.md
574
+ </research_files>
575
+
576
+ <output>
577
+ Write to: .blueprint/research/SUMMARY.md
578
+ Use template: ~/.claude/blueprint/templates/research-project/SUMMARY.md
579
+ Commit after writing.
580
+ </output>
581
+ ", subagent_type="bp-research-synthesizer", model="{synthesizer_model}", description="Synthesize research")
582
+ ```
583
+
584
+ Display research complete banner and key findings:
585
+ ```
586
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
587
+ Blueprint ► RESEARCH COMPLETE ✓
588
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
589
+
590
+ ## Key Findings
591
+
592
+ **Stack:** [from SUMMARY.md]
593
+ **Table Stakes:** [from SUMMARY.md]
594
+ **Watch Out For:** [from SUMMARY.md]
595
+
596
+ Files: `.blueprint/research/`
597
+ ```
598
+
599
+ **If "Skip research":** Continue to Step 7.
600
+
601
+ ## 7. Define Requirements
602
+
603
+ Display stage banner:
604
+ ```
605
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
606
+ Blueprint ► DEFINING REQUIREMENTS
607
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
608
+ ```
609
+
610
+ **Load context:**
611
+
612
+ Read PROJECT.md and extract:
613
+ - Core value (the ONE thing that must work)
614
+ - Stated constraints (budget, timeline, tech limitations)
615
+ - Any explicit scope boundaries
616
+
617
+ **If research exists:** Read research/FEATURES.md and extract feature categories.
618
+
619
+ **If auto mode:**
620
+ - Auto-include all table stakes features (users expect these)
621
+ - Include features explicitly mentioned in provided document
622
+ - Auto-defer differentiators not mentioned in document
623
+ - Skip per-category AskUserQuestion loops
624
+ - Skip "Any additions?" question
625
+ - Skip requirements approval gate
626
+ - Generate REQUIREMENTS.md and commit directly
627
+
628
+ **Present features by category (interactive mode only):**
629
+
630
+ ```
631
+ Here are the features for [domain]:
632
+
633
+ ## Authentication
634
+ **Table stakes:**
635
+ - Sign up with email/password
636
+ - Email verification
637
+ - Password reset
638
+ - Session management
639
+
640
+ **Differentiators:**
641
+ - Magic link login
642
+ - OAuth (Google, GitHub)
643
+ - 2FA
644
+
645
+ **Research notes:** [any relevant notes]
646
+
647
+ ---
648
+
649
+ ## [Next Category]
650
+ ...
651
+ ```
652
+
653
+ **If no research:** Gather requirements through conversation instead.
654
+
655
+ Ask: "What are the main things users need to be able to do?"
656
+
657
+ For each capability mentioned:
658
+ - Ask clarifying questions to make it specific
659
+ - Probe for related capabilities
660
+ - Group into categories
661
+
662
+ **Scope each category:**
663
+
664
+ For each category, use AskUserQuestion:
665
+
666
+ - header: "[Category name]"
667
+ - question: "Which [category] features are in v1?"
668
+ - multiSelect: true
669
+ - options:
670
+ - "[Feature 1]" — [brief description]
671
+ - "[Feature 2]" — [brief description]
672
+ - "[Feature 3]" — [brief description]
673
+ - "None for v1" — Defer entire category
674
+
675
+ Track responses:
676
+ - Selected features → v1 requirements
677
+ - Unselected table stakes → v2 (users expect these)
678
+ - Unselected differentiators → out of scope
679
+
680
+ **Identify gaps:**
681
+
682
+ Use AskUserQuestion:
683
+ - header: "Additions"
684
+ - question: "Any requirements research missed? (Features specific to your vision)"
685
+ - options:
686
+ - "No, research covered it" — Proceed
687
+ - "Yes, let me add some" — Capture additions
688
+
689
+ **Validate core value:**
690
+
691
+ Cross-check requirements against Core Value from PROJECT.md. If gaps detected, surface them.
692
+
693
+ **Generate REQUIREMENTS.md:**
694
+
695
+ Create `.blueprint/REQUIREMENTS.md` with:
696
+ - v1 Requirements grouped by category (checkboxes, REQ-IDs)
697
+ - v2 Requirements (deferred)
698
+ - Out of Scope (explicit exclusions with reasoning)
699
+ - Traceability section (empty, filled by roadmap)
700
+
701
+ **REQ-ID format:** `[CATEGORY]-[NUMBER]` (AUTH-01, CONTENT-02)
702
+
703
+ **Requirement quality criteria:**
704
+
705
+ Good requirements are:
706
+ - **Specific and testable:** "User can reset password via email link" (not "Handle password reset")
707
+ - **User-centric:** "User can X" (not "System does Y")
708
+ - **Atomic:** One capability per requirement (not "User can login and manage profile")
709
+ - **Independent:** Minimal dependencies on other requirements
710
+
711
+ Reject vague requirements. Push for specificity:
712
+ - "Handle authentication" → "User can log in with email/password and stay logged in across sessions"
713
+ - "Support sharing" → "User can share post via link that opens in recipient's browser"
714
+
715
+ **Present full requirements list (interactive mode only):**
716
+
717
+ Show every requirement (not counts) for user confirmation:
718
+
719
+ ```
720
+ ## v1 Requirements
721
+
722
+ ### Authentication
723
+ - [ ] **AUTH-01**: User can create account with email/password
724
+ - [ ] **AUTH-02**: User can log in and stay logged in across sessions
725
+ - [ ] **AUTH-03**: User can log out from any page
726
+
727
+ ### Content
728
+ - [ ] **CONT-01**: User can create posts with text
729
+ - [ ] **CONT-02**: User can edit their own posts
730
+
731
+ [... full list ...]
732
+
733
+ ---
734
+
735
+ Does this capture what you're building? (yes / adjust)
736
+ ```
737
+
738
+ If "adjust": Return to scoping.
739
+
740
+ **Commit requirements:**
741
+
742
+ ```bash
743
+ node ~/.claude/blueprint/bin/blueprint-tools.js commit "docs: define v1 requirements" --files .blueprint/REQUIREMENTS.md
744
+ ```
745
+
746
+ ## 8. Create Roadmap
747
+
748
+ Display stage banner:
749
+ ```
750
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
751
+ Blueprint ► CREATING ROADMAP
752
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
753
+
754
+ ◆ Spawning roadmapper...
755
+ ```
756
+
757
+ Spawn bp-roadmapper agent with context:
758
+
759
+ ```
760
+ Task(prompt="
761
+ <planning_context>
762
+
763
+ **Project:**
764
+ @.blueprint/PROJECT.md
765
+
766
+ **Requirements:**
767
+ @.blueprint/REQUIREMENTS.md
768
+
769
+ **Research (if exists):**
770
+ @.blueprint/research/SUMMARY.md
771
+
772
+ **Config:**
773
+ @.blueprint/config.json
774
+
775
+ </planning_context>
776
+
777
+ <instructions>
778
+ Create roadmap:
779
+ 1. Derive phases from requirements (don't impose structure)
780
+ 2. Map every v1 requirement to exactly one phase
781
+ 3. Derive 2-5 success criteria per phase (observable user behaviors)
782
+ 4. Validate 100% coverage
783
+ 5. Write files immediately (ROADMAP.md, STATE.md, update REQUIREMENTS.md traceability)
784
+ 6. Return ROADMAP CREATED with summary
785
+
786
+ Write files first, then return. This ensures artifacts persist even if context is lost.
787
+ </instructions>
788
+ ", subagent_type="bp-roadmapper", model="{roadmapper_model}", description="Create roadmap")
789
+ ```
790
+
791
+ **Handle roadmapper return:**
792
+
793
+ **If `## ROADMAP BLOCKED`:**
794
+ - Present blocker information
795
+ - Work with user to resolve
796
+ - Re-spawn when resolved
797
+
798
+ **If `## ROADMAP CREATED`:**
799
+
800
+ Read the created ROADMAP.md and present it nicely inline:
801
+
802
+ ```
803
+ ---
804
+
805
+ ## Proposed Roadmap
806
+
807
+ **[N] phases** | **[X] requirements mapped** | All v1 requirements covered ✓
808
+
809
+ | # | Phase | Goal | Requirements | Success Criteria |
810
+ |---|-------|------|--------------|------------------|
811
+ | 1 | [Name] | [Goal] | [REQ-IDs] | [count] |
812
+ | 2 | [Name] | [Goal] | [REQ-IDs] | [count] |
813
+ | 3 | [Name] | [Goal] | [REQ-IDs] | [count] |
814
+ ...
815
+
816
+ ### Phase Details
817
+
818
+ **Phase 1: [Name]**
819
+ Goal: [goal]
820
+ Requirements: [REQ-IDs]
821
+ Success criteria:
822
+ 1. [criterion]
823
+ 2. [criterion]
824
+ 3. [criterion]
825
+
826
+ **Phase 2: [Name]**
827
+ Goal: [goal]
828
+ Requirements: [REQ-IDs]
829
+ Success criteria:
830
+ 1. [criterion]
831
+ 2. [criterion]
832
+
833
+ [... continue for all phases ...]
834
+
835
+ ---
836
+ ```
837
+
838
+ **If auto mode:** Skip approval gate — auto-approve and commit directly.
839
+
840
+ **CRITICAL: Ask for approval before committing (interactive mode only):**
841
+
842
+ Use AskUserQuestion:
843
+ - header: "Roadmap"
844
+ - question: "Does this roadmap structure work for you?"
845
+ - options:
846
+ - "Approve" — Commit and continue
847
+ - "Adjust phases" — Tell me what to change
848
+ - "Review full file" — Show raw ROADMAP.md
849
+
850
+ **If "Approve":** Continue to commit.
851
+
852
+ **If "Adjust phases":**
853
+ - Get user's adjustment notes
854
+ - Re-spawn roadmapper with revision context:
855
+ ```
856
+ Task(prompt="
857
+ <revision>
858
+ User feedback on roadmap:
859
+ [user's notes]
860
+
861
+ Current ROADMAP.md: @.blueprint/ROADMAP.md
862
+
863
+ Update the roadmap based on feedback. Edit files in place.
864
+ Return ROADMAP REVISED with changes made.
865
+ </revision>
866
+ ", subagent_type="bp-roadmapper", model="{roadmapper_model}", description="Revise roadmap")
867
+ ```
868
+ - Present revised roadmap
869
+ - Loop until user approves
870
+
871
+ **If "Review full file":** Display raw `cat .blueprint/ROADMAP.md`, then re-ask.
872
+
873
+ **Commit roadmap (after approval or auto mode):**
874
+
875
+ ```bash
876
+ node ~/.claude/blueprint/bin/blueprint-tools.js commit "docs: create roadmap ([N] phases)" --files .blueprint/ROADMAP.md .blueprint/STATE.md .blueprint/REQUIREMENTS.md
877
+ ```
878
+
879
+ ## 9. Done
880
+
881
+ Present completion with next steps:
882
+
883
+ ```
884
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
885
+ Blueprint ► PROJECT INITIALIZED ✓
886
+ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
887
+
888
+ **[Project Name]**
889
+
890
+ | Artifact | Location |
891
+ |----------------|-----------------------------|
892
+ | Project | `.blueprint/PROJECT.md` |
893
+ | Config | `.blueprint/config.json` |
894
+ | Research | `.blueprint/research/` |
895
+ | Requirements | `.blueprint/REQUIREMENTS.md` |
896
+ | Roadmap | `.blueprint/ROADMAP.md` |
897
+
898
+ **[N] phases** | **[X] requirements** | Ready to build ✓
899
+
900
+ ───────────────────────────────────────────────────────────────
901
+
902
+ ## ▶ Next Up
903
+
904
+ **Phase 1: [Phase Name]** — [Goal from ROADMAP.md]
905
+
906
+ /bp:discuss-phase 1 — gather context and clarify approach
907
+
908
+ <sub>/clear first → fresh context window</sub>
909
+
910
+ ---
911
+
912
+ **Also available:**
913
+ - /bp:plan-phase 1 — skip discussion, plan directly
914
+
915
+ ───────────────────────────────────────────────────────────────
916
+ ```
917
+
918
+ </process>
919
+
920
+ <output>
921
+
922
+ - `.blueprint/PROJECT.md`
923
+ - `.blueprint/config.json`
924
+ - `.blueprint/research/` (if research selected)
925
+ - `STACK.md`
926
+ - `FEATURES.md`
927
+ - `ARCHITECTURE.md`
928
+ - `PITFALLS.md`
929
+ - `SUMMARY.md`
930
+ - `.blueprint/REQUIREMENTS.md`
931
+ - `.blueprint/ROADMAP.md`
932
+ - `.blueprint/STATE.md`
933
+
934
+ </output>
935
+
936
+ <success_criteria>
937
+
938
+ - [ ] .blueprint/ directory created
939
+ - [ ] Git repo initialized
940
+ - [ ] Brownfield detection completed
941
+ - [ ] Deep questioning completed (threads followed, not rushed)
942
+ - [ ] PROJECT.md captures full context → **committed**
943
+ - [ ] config.json has workflow mode, depth, parallelization → **committed**
944
+ - [ ] Research completed (if selected) — 4 parallel agents spawned → **committed**
945
+ - [ ] Requirements gathered (from research or conversation)
946
+ - [ ] User scoped each category (v1/v2/out of scope)
947
+ - [ ] REQUIREMENTS.md created with REQ-IDs → **committed**
948
+ - [ ] bp-roadmapper spawned with context
949
+ - [ ] Roadmap files written immediately (not draft)
950
+ - [ ] User feedback incorporated (if any)
951
+ - [ ] ROADMAP.md created with phases, requirement mappings, success criteria
952
+ - [ ] STATE.md initialized
953
+ - [ ] REQUIREMENTS.md traceability updated
954
+ - [ ] User knows next step is `/bp:discuss-phase 1`
955
+
956
+ **Atomic commits:** Each phase commits its artifacts immediately. If context is lost, artifacts persist.
957
+
958
+ </success_criteria>