@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,408 @@
1
+ <purpose>
2
+ Extract implementation decisions that downstream agents need. Analyze the phase to identify gray areas, let the user choose what to discuss, then deep-dive each selected area until satisfied.
3
+
4
+ You are a thinking partner, not an interviewer. The user is the visionary — you are the builder. Your job is to capture decisions that will guide research and planning, not to figure out implementation yourself.
5
+ </purpose>
6
+
7
+ <downstream_awareness>
8
+ **CONTEXT.md feeds into:**
9
+
10
+ 1. **bp-phase-researcher** — Reads CONTEXT.md to know WHAT to research
11
+ - "User wants card-based layout" → researcher investigates card component patterns
12
+ - "Infinite scroll decided" → researcher looks into virtualization libraries
13
+
14
+ 2. **bp-planner** — Reads CONTEXT.md to know WHAT decisions are locked
15
+ - "Pull-to-refresh on mobile" → planner includes that in task specs
16
+ - "Claude's Discretion: loading skeleton" → planner can decide approach
17
+
18
+ **Your job:** Capture decisions clearly enough that downstream agents can act on them without asking the user again.
19
+
20
+ **Not your job:** Figure out HOW to implement. That's what research and planning do with the decisions you capture.
21
+ </downstream_awareness>
22
+
23
+ <philosophy>
24
+ **User = founder/visionary. Claude = builder.**
25
+
26
+ The user knows:
27
+ - How they imagine it working
28
+ - What it should look/feel like
29
+ - What's essential vs nice-to-have
30
+ - Specific behaviors or references they have in mind
31
+
32
+ The user doesn't know (and shouldn't be asked):
33
+ - Codebase patterns (researcher reads the code)
34
+ - Technical risks (researcher identifies these)
35
+ - Implementation approach (planner figures this out)
36
+ - Success metrics (inferred from the work)
37
+
38
+ Ask about vision and implementation choices. Capture decisions for downstream agents.
39
+ </philosophy>
40
+
41
+ <scope_guardrail>
42
+ **CRITICAL: No scope creep.**
43
+
44
+ The phase boundary comes from ROADMAP.md and is FIXED. Discussion clarifies HOW to implement what's scoped, never WHETHER to add new capabilities.
45
+
46
+ **Allowed (clarifying ambiguity):**
47
+ - "How should posts be displayed?" (layout, density, info shown)
48
+ - "What happens on empty state?" (within the feature)
49
+ - "Pull to refresh or manual?" (behavior choice)
50
+
51
+ **Not allowed (scope creep):**
52
+ - "Should we also add comments?" (new capability)
53
+ - "What about search/filtering?" (new capability)
54
+ - "Maybe include bookmarking?" (new capability)
55
+
56
+ **The heuristic:** Does this clarify how we implement what's already in the phase, or does it add a new capability that could be its own phase?
57
+
58
+ **When user suggests scope creep:**
59
+ ```
60
+ "[Feature X] would be a new capability — that's its own phase.
61
+ Want me to note it for the roadmap backlog?
62
+
63
+ For now, let's focus on [phase domain]."
64
+ ```
65
+
66
+ Capture the idea in a "Deferred Ideas" section. Don't lose it, don't act on it.
67
+ </scope_guardrail>
68
+
69
+ <gray_area_identification>
70
+ Gray areas are **implementation decisions the user cares about** — things that could go multiple ways and would change the result.
71
+
72
+ **How to identify gray areas:**
73
+
74
+ 1. **Read the phase goal** from ROADMAP.md
75
+ 2. **Understand the domain** — What kind of thing is being built?
76
+ - Something users SEE → visual presentation, interactions, states matter
77
+ - Something users CALL → interface contracts, responses, errors matter
78
+ - Something users RUN → invocation, output, behavior modes matter
79
+ - Something users READ → structure, tone, depth, flow matter
80
+ - Something being ORGANIZED → criteria, grouping, handling exceptions matter
81
+ 3. **Generate phase-specific gray areas** — Not generic categories, but concrete decisions for THIS phase
82
+
83
+ **Don't use generic category labels** (UI, UX, Behavior). Generate specific gray areas:
84
+
85
+ ```
86
+ Phase: "User authentication"
87
+ → Session handling, Error responses, Multi-device policy, Recovery flow
88
+
89
+ Phase: "Organize photo library"
90
+ → Grouping criteria, Duplicate handling, Naming convention, Folder structure
91
+
92
+ Phase: "CLI for database backups"
93
+ → Output format, Flag design, Progress reporting, Error recovery
94
+
95
+ Phase: "API documentation"
96
+ → Structure/navigation, Code examples depth, Versioning approach, Interactive elements
97
+ ```
98
+
99
+ **The key question:** What decisions would change the outcome that the user should weigh in on?
100
+
101
+ **Claude handles these (don't ask):**
102
+ - Technical implementation details
103
+ - Architecture patterns
104
+ - Performance optimization
105
+ - Scope (roadmap defines this)
106
+ </gray_area_identification>
107
+
108
+ <process>
109
+
110
+ <step name="initialize" priority="first">
111
+ Phase number from argument (required).
112
+
113
+ ```bash
114
+ INIT=$(node ~/.claude/blueprint/bin/blueprint-tools.js init phase-op "${PHASE}")
115
+ ```
116
+
117
+ Parse JSON for: `commit_docs`, `phase_found`, `phase_dir`, `phase_number`, `phase_name`, `phase_slug`, `padded_phase`, `has_research`, `has_context`, `has_plans`, `has_verification`, `plan_count`, `roadmap_exists`, `planning_exists`.
118
+
119
+ **If `phase_found` is false:**
120
+ ```
121
+ Phase [X] not found in roadmap.
122
+
123
+ Use /bp:progress to see available phases.
124
+ ```
125
+ Exit workflow.
126
+
127
+ **If `phase_found` is true:** Continue to check_existing.
128
+ </step>
129
+
130
+ <step name="check_existing">
131
+ Check if CONTEXT.md already exists using `has_context` from init.
132
+
133
+ ```bash
134
+ ls ${phase_dir}/*-CONTEXT.md 2>/dev/null
135
+ ```
136
+
137
+ **If exists:**
138
+ Use AskUserQuestion:
139
+ - header: "Existing context"
140
+ - question: "Phase [X] already has context. What do you want to do?"
141
+ - options:
142
+ - "Update it" — Review and revise existing context
143
+ - "View it" — Show me what's there
144
+ - "Skip" — Use existing context as-is
145
+
146
+ If "Update": Load existing, continue to analyze_phase
147
+ If "View": Display CONTEXT.md, then offer update/skip
148
+ If "Skip": Exit workflow
149
+
150
+ **If doesn't exist:** Continue to analyze_phase.
151
+ </step>
152
+
153
+ <step name="analyze_phase">
154
+ Analyze the phase to identify gray areas worth discussing.
155
+
156
+ **Read the phase description from ROADMAP.md and determine:**
157
+
158
+ 1. **Domain boundary** — What capability is this phase delivering? State it clearly.
159
+
160
+ 2. **Gray areas by category** — For each relevant category (UI, UX, Behavior, Empty States, Content), identify 1-2 specific ambiguities that would change implementation.
161
+
162
+ 3. **Skip assessment** — If no meaningful gray areas exist (pure infrastructure, clear-cut implementation), the phase may not need discussion.
163
+
164
+ **Output your analysis internally, then present to user.**
165
+
166
+ Example analysis for "Post Feed" phase:
167
+ ```
168
+ Domain: Displaying posts from followed users
169
+ Gray areas:
170
+ - UI: Layout style (cards vs timeline vs grid)
171
+ - UI: Information density (full posts vs previews)
172
+ - Behavior: Loading pattern (infinite scroll vs pagination)
173
+ - Empty State: What shows when no posts exist
174
+ - Content: What metadata displays (time, author, reactions count)
175
+ ```
176
+ </step>
177
+
178
+ <step name="present_gray_areas">
179
+ Present the domain boundary and gray areas to user.
180
+
181
+ **First, state the boundary:**
182
+ ```
183
+ Phase [X]: [Name]
184
+ Domain: [What this phase delivers — from your analysis]
185
+
186
+ We'll clarify HOW to implement this.
187
+ (New capabilities belong in other phases.)
188
+ ```
189
+
190
+ **Then use AskUserQuestion (multiSelect: true):**
191
+ - header: "Discuss"
192
+ - question: "Which areas do you want to discuss for [phase name]?"
193
+ - options: Generate 3-4 phase-specific gray areas, each formatted as:
194
+ - "[Specific area]" (label) — concrete, not generic
195
+ - [1-2 questions this covers] (description)
196
+
197
+ **Do NOT include a "skip" or "you decide" option.** User ran this command to discuss — give them real choices.
198
+
199
+ **Examples by domain:**
200
+
201
+ For "Post Feed" (visual feature):
202
+ ```
203
+ ☐ Layout style — Cards vs list vs timeline? Information density?
204
+ ☐ Loading behavior — Infinite scroll or pagination? Pull to refresh?
205
+ ☐ Content ordering — Chronological, algorithmic, or user choice?
206
+ ☐ Post metadata — What info per post? Timestamps, reactions, author?
207
+ ```
208
+
209
+ For "Database backup CLI" (command-line tool):
210
+ ```
211
+ ☐ Output format — JSON, table, or plain text? Verbosity levels?
212
+ ☐ Flag design — Short flags, long flags, or both? Required vs optional?
213
+ ☐ Progress reporting — Silent, progress bar, or verbose logging?
214
+ ☐ Error recovery — Fail fast, retry, or prompt for action?
215
+ ```
216
+
217
+ For "Organize photo library" (organization task):
218
+ ```
219
+ ☐ Grouping criteria — By date, location, faces, or events?
220
+ ☐ Duplicate handling — Keep best, keep all, or prompt each time?
221
+ ☐ Naming convention — Original names, dates, or descriptive?
222
+ ☐ Folder structure — Flat, nested by year, or by category?
223
+ ```
224
+
225
+ Continue to discuss_areas with selected areas.
226
+ </step>
227
+
228
+ <step name="discuss_areas">
229
+ For each selected area, conduct a focused discussion loop.
230
+
231
+ **Philosophy: 4 questions, then check.**
232
+
233
+ Ask 4 questions per area before offering to continue or move on. Each answer often reveals the next question.
234
+
235
+ **For each area:**
236
+
237
+ 1. **Announce the area:**
238
+ ```
239
+ Let's talk about [Area].
240
+ ```
241
+
242
+ 2. **Ask 4 questions using AskUserQuestion:**
243
+ - header: "[Area]"
244
+ - question: Specific decision for this area
245
+ - options: 2-3 concrete choices (AskUserQuestion adds "Other" automatically)
246
+ - Include "You decide" as an option when reasonable — captures Claude discretion
247
+
248
+ 3. **After 4 questions, check:**
249
+ - header: "[Area]"
250
+ - question: "More questions about [area], or move to next?"
251
+ - options: "More questions" / "Next area"
252
+
253
+ If "More questions" → ask 4 more, then check again
254
+ If "Next area" → proceed to next selected area
255
+
256
+ 4. **After all areas complete:**
257
+ - header: "Done"
258
+ - question: "That covers [list areas]. Ready to create context?"
259
+ - options: "Create context" / "Revisit an area"
260
+
261
+ **Question design:**
262
+ - Options should be concrete, not abstract ("Cards" not "Option A")
263
+ - Each answer should inform the next question
264
+ - If user picks "Other", receive their input, reflect it back, confirm
265
+
266
+ **Scope creep handling:**
267
+ If user mentions something outside the phase domain:
268
+ ```
269
+ "[Feature] sounds like a new capability — that belongs in its own phase.
270
+ I'll note it as a deferred idea.
271
+
272
+ Back to [current area]: [return to current question]"
273
+ ```
274
+
275
+ Track deferred ideas internally.
276
+ </step>
277
+
278
+ <step name="write_context">
279
+ Create CONTEXT.md capturing decisions made.
280
+
281
+ **Find or create phase directory:**
282
+
283
+ Use values from init: `phase_dir`, `phase_slug`, `padded_phase`.
284
+
285
+ If `phase_dir` is null (phase exists in roadmap but no directory):
286
+ ```bash
287
+ mkdir -p ".blueprint/phases/${padded_phase}-${phase_slug}"
288
+ ```
289
+
290
+ **File location:** `${phase_dir}/${padded_phase}-CONTEXT.md`
291
+
292
+ **Structure the content by what was discussed:**
293
+
294
+ ```markdown
295
+ # Phase [X]: [Name] - Context
296
+
297
+ **Gathered:** [date]
298
+ **Status:** Ready for planning
299
+
300
+ <domain>
301
+ ## Phase Boundary
302
+
303
+ [Clear statement of what this phase delivers — the scope anchor]
304
+
305
+ </domain>
306
+
307
+ <decisions>
308
+ ## Implementation Decisions
309
+
310
+ ### [Category 1 that was discussed]
311
+ - [Decision or preference captured]
312
+ - [Another decision if applicable]
313
+
314
+ ### [Category 2 that was discussed]
315
+ - [Decision or preference captured]
316
+
317
+ ### Claude's Discretion
318
+ [Areas where user said "you decide" — note that Claude has flexibility here]
319
+
320
+ </decisions>
321
+
322
+ <specifics>
323
+ ## Specific Ideas
324
+
325
+ [Any particular references, examples, or "I want it like X" moments from discussion]
326
+
327
+ [If none: "No specific requirements — open to standard approaches"]
328
+
329
+ </specifics>
330
+
331
+ <deferred>
332
+ ## Deferred Ideas
333
+
334
+ [Ideas that came up but belong in other phases. Don't lose them.]
335
+
336
+ [If none: "None — discussion stayed within phase scope"]
337
+
338
+ </deferred>
339
+
340
+ ---
341
+
342
+ *Phase: XX-name*
343
+ *Context gathered: [date]*
344
+ ```
345
+
346
+ Write file.
347
+ </step>
348
+
349
+ <step name="confirm_creation">
350
+ Present summary and next steps:
351
+
352
+ ```
353
+ Created: .blueprint/phases/${PADDED_PHASE}-${SLUG}/${PADDED_PHASE}-CONTEXT.md
354
+
355
+ ## Decisions Captured
356
+
357
+ ### [Category]
358
+ - [Key decision]
359
+
360
+ ### [Category]
361
+ - [Key decision]
362
+
363
+ [If deferred ideas exist:]
364
+ ## Noted for Later
365
+ - [Deferred idea] — future phase
366
+
367
+ ---
368
+
369
+ ## ▶ Next Up
370
+
371
+ **Phase ${PHASE}: [Name]** — [Goal from ROADMAP.md]
372
+
373
+ `/bp:plan-phase ${PHASE}`
374
+
375
+ <sub>`/clear` first → fresh context window</sub>
376
+
377
+ ---
378
+
379
+ **Also available:**
380
+ - `/bp:plan-phase ${PHASE} --skip-research` — plan without research
381
+ - Review/edit CONTEXT.md before continuing
382
+
383
+ ---
384
+ ```
385
+ </step>
386
+
387
+ <step name="git_commit">
388
+ Commit phase context (uses `commit_docs` from init internally):
389
+
390
+ ```bash
391
+ node ~/.claude/blueprint/bin/blueprint-tools.js commit "docs(${padded_phase}): capture phase context" --files "${phase_dir}/${padded_phase}-CONTEXT.md"
392
+ ```
393
+
394
+ Confirm: "Committed: docs(${padded_phase}): capture phase context"
395
+ </step>
396
+
397
+ </process>
398
+
399
+ <success_criteria>
400
+ - Phase validated against roadmap
401
+ - Gray areas identified through intelligent analysis (not generic questions)
402
+ - User selected which areas to discuss
403
+ - Each selected area explored until user satisfied
404
+ - Scope creep redirected to deferred ideas
405
+ - CONTEXT.md captures actual decisions, not vague vision
406
+ - Deferred ideas preserved for future phases
407
+ - User knows next steps
408
+ </success_criteria>