pi-maestro-flow 0.2.0 → 0.3.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 (235) hide show
  1. package/README.md +44 -72
  2. package/agents/cross-role-reviewer.md +1 -1
  3. package/agents/impeccable-agent.md +1 -1
  4. package/agents/ralph-executor.md +1 -1
  5. package/agents/team-worker.md +1 -1
  6. package/agents/workflow-analyzer.md +1 -1
  7. package/agents/workflow-codebase-mapper.md +1 -1
  8. package/agents/workflow-collab-planner.md +1 -1
  9. package/agents/workflow-debugger.md +1 -1
  10. package/agents/workflow-executor.md +1 -1
  11. package/agents/workflow-integration-checker.md +1 -1
  12. package/agents/workflow-nyquist-auditor.md +1 -1
  13. package/agents/workflow-phase-researcher.md +1 -1
  14. package/agents/workflow-planner.md +1 -1
  15. package/agents/workflow-project-researcher.md +1 -1
  16. package/agents/workflow-reviewer.md +1 -1
  17. package/agents/workflow-verifier.md +1 -1
  18. package/package.json +18 -4
  19. package/skills/codify-to-knowhow/SKILL.md +1 -1
  20. package/skills/delegation-check/SKILL.md +1 -1
  21. package/skills/domain-add/SKILL.md +5 -5
  22. package/skills/insight-challenge/SKILL.md +1 -1
  23. package/skills/learn-decompose/SKILL.md +4 -4
  24. package/skills/learn-follow/SKILL.md +5 -5
  25. package/skills/learn-investigate/SKILL.md +5 -5
  26. package/skills/learn-second-opinion/SKILL.md +5 -5
  27. package/skills/maestro/SKILL.md +8 -8
  28. package/skills/maestro-amend/SKILL.md +4 -4
  29. package/skills/maestro-analyze/SKILL.md +9 -9
  30. package/skills/maestro-blueprint/SKILL.md +7 -7
  31. package/skills/maestro-brainstorm/SKILL.md +10 -10
  32. package/skills/maestro-collab/SKILL.md +4 -4
  33. package/skills/maestro-companion/SKILL.md +3 -3
  34. package/skills/maestro-composer/SKILL.md +10 -10
  35. package/skills/maestro-execute/SKILL.md +8 -8
  36. package/skills/maestro-fork/SKILL.md +7 -7
  37. package/skills/maestro-grill/SKILL.md +12 -12
  38. package/skills/maestro-guard/SKILL.md +5 -5
  39. package/skills/maestro-help/SKILL.md +3 -3
  40. package/skills/maestro-impeccable/SKILL.md +7 -7
  41. package/skills/maestro-init/SKILL.md +8 -8
  42. package/skills/maestro-merge/SKILL.md +6 -6
  43. package/skills/maestro-milestone-audit/SKILL.md +3 -3
  44. package/skills/maestro-milestone-complete/SKILL.md +8 -8
  45. package/skills/maestro-milestone-release/SKILL.md +9 -9
  46. package/skills/maestro-next/SKILL.md +5 -5
  47. package/skills/maestro-overlay/SKILL.md +19 -19
  48. package/skills/maestro-plan/SKILL.md +8 -8
  49. package/skills/maestro-player/SKILL.md +5 -5
  50. package/skills/maestro-quick/SKILL.md +5 -5
  51. package/skills/maestro-ralph/SKILL.md +15 -15
  52. package/skills/maestro-ralph-cli/SKILL.md +6 -6
  53. package/skills/maestro-ralph-cli-execute/SKILL.md +2 -2
  54. package/skills/maestro-ralph-execute/SKILL.md +4 -4
  55. package/skills/maestro-ralph-v2/SKILL.md +17 -17
  56. package/skills/maestro-roadmap/SKILL.md +7 -7
  57. package/skills/maestro-swarm-workflow/SKILL.md +9 -9
  58. package/skills/maestro-tools-execute/SKILL.md +5 -5
  59. package/skills/maestro-tools-register/SKILL.md +7 -7
  60. package/skills/maestro-ui-codify/SKILL.md +8 -8
  61. package/skills/maestro-universal-workflow/SKILL.md +15 -15
  62. package/skills/maestro-update/SKILL.md +10 -10
  63. package/skills/manage-codebase-rebuild/SKILL.md +4 -4
  64. package/skills/manage-drift-realign/SKILL.md +7 -7
  65. package/skills/manage-harvest/SKILL.md +5 -5
  66. package/skills/manage-issue/SKILL.md +4 -4
  67. package/skills/manage-issue-discover/SKILL.md +7 -7
  68. package/skills/manage-kg-extractors/SKILL.md +3 -3
  69. package/skills/manage-knowhow/SKILL.md +3 -3
  70. package/skills/manage-knowhow-capture/SKILL.md +4 -4
  71. package/skills/manage-knowledge-audit/SKILL.md +5 -5
  72. package/skills/manage-status/SKILL.md +3 -3
  73. package/skills/manage-wiki/SKILL.md +5 -5
  74. package/skills/odyssey-debug/SKILL.md +13 -13
  75. package/skills/odyssey-improve/SKILL.md +15 -15
  76. package/skills/odyssey-planex/SKILL.md +16 -16
  77. package/skills/odyssey-review-test-fix/SKILL.md +11 -11
  78. package/skills/odyssey-ui/SKILL.md +10 -10
  79. package/skills/prompt-generator/SKILL.md +5 -5
  80. package/skills/quality-auto-test/SKILL.md +3 -3
  81. package/skills/quality-debug/SKILL.md +3 -3
  82. package/skills/quality-refactor/SKILL.md +3 -3
  83. package/skills/quality-retrospective/SKILL.md +9 -9
  84. package/skills/quality-review/SKILL.md +4 -4
  85. package/skills/quality-sync/SKILL.md +3 -3
  86. package/skills/quality-test/SKILL.md +4 -4
  87. package/skills/scholar-anti-ai-writing/SKILL.md +1 -1
  88. package/skills/scholar-citation-verify/SKILL.md +1 -1
  89. package/skills/scholar-experiment/SKILL.md +2 -2
  90. package/skills/scholar-ideation/SKILL.md +7 -7
  91. package/skills/scholar-latex-organizer/SKILL.md +1 -1
  92. package/skills/scholar-publish/SKILL.md +3 -3
  93. package/skills/scholar-rebuttal-pro/SKILL.md +3 -3
  94. package/skills/scholar-review/SKILL.md +1 -1
  95. package/skills/scholar-writing/SKILL.md +1 -1
  96. package/skills/security-audit/SKILL.md +2 -2
  97. package/skills/skill-generator/SKILL.md +3 -3
  98. package/skills/skill-iter-tune/SKILL.md +3 -3
  99. package/skills/skill-simplify/SKILL.md +1 -1
  100. package/skills/skill-tuning/SKILL.md +1 -1
  101. package/skills/spec-add/SKILL.md +5 -5
  102. package/skills/spec-load/SKILL.md +3 -3
  103. package/skills/spec-remove/SKILL.md +4 -4
  104. package/skills/spec-setup/SKILL.md +6 -6
  105. package/skills/team-adversarial-swarm/SKILL.md +5 -5
  106. package/skills/team-arch-opt/SKILL.md +2 -2
  107. package/skills/team-brainstorm/SKILL.md +3 -3
  108. package/skills/team-coordinate/SKILL.md +4 -4
  109. package/skills/team-designer/SKILL.md +1 -1
  110. package/skills/team-executor/SKILL.md +3 -3
  111. package/skills/team-frontend/SKILL.md +2 -2
  112. package/skills/team-frontend-debug/SKILL.md +3 -3
  113. package/skills/team-interactive-craft/SKILL.md +2 -2
  114. package/skills/team-issue/SKILL.md +3 -3
  115. package/skills/team-lifecycle-v4/SKILL.md +4 -4
  116. package/skills/team-motion-design/SKILL.md +2 -2
  117. package/skills/team-perf-opt/SKILL.md +3 -3
  118. package/skills/team-planex/SKILL.md +2 -2
  119. package/skills/team-quality-assurance/SKILL.md +3 -3
  120. package/skills/team-review/SKILL.md +3 -3
  121. package/skills/team-roadmap-dev/SKILL.md +3 -3
  122. package/skills/team-swarm/SKILL.md +4 -4
  123. package/skills/team-tech-debt/SKILL.md +2 -2
  124. package/skills/team-testing/SKILL.md +3 -3
  125. package/skills/team-ui-polish/SKILL.md +2 -2
  126. package/skills/team-uidesign/SKILL.md +2 -2
  127. package/skills/team-ultra-analyze/SKILL.md +4 -4
  128. package/skills/team-ux-improve/SKILL.md +3 -3
  129. package/skills/team-visual-a11y/SKILL.md +2 -2
  130. package/skills/workflow-skill-designer/SKILL.md +8 -8
  131. package/templates/business-test-report.json +68 -0
  132. package/templates/config.json +48 -0
  133. package/templates/context.md +16 -0
  134. package/templates/doc-index.json +11 -0
  135. package/templates/index.json +68 -0
  136. package/templates/issue.json +36 -0
  137. package/templates/plan.json +38 -0
  138. package/templates/project.md +60 -0
  139. package/templates/reflection-log.md +20 -0
  140. package/templates/roadmap.md +45 -0
  141. package/templates/scratch-index.json +19 -0
  142. package/templates/search-tool.json +1 -0
  143. package/templates/search-tools.md +47 -0
  144. package/templates/state.json +18 -0
  145. package/templates/task-summary.md +21 -0
  146. package/templates/task.json +89 -0
  147. package/templates/terminology-template.json +22 -0
  148. package/templates/uat.md +21 -0
  149. package/templates/validation.json +31 -0
  150. package/templates/verification.json +37 -0
  151. package/templates/workflow.md +14 -0
  152. package/templates/worktree-scope.json +9 -0
  153. package/templates/worktrees.json +26 -0
  154. package/workflows/agy-instructions.md +156 -0
  155. package/workflows/analyze.md +768 -0
  156. package/workflows/auto-test.md +705 -0
  157. package/workflows/blueprint.md +406 -0
  158. package/workflows/boundary-grill.md +50 -0
  159. package/workflows/brainstorm.md +508 -0
  160. package/workflows/business-test.md +574 -0
  161. package/workflows/chinese-response.md +25 -0
  162. package/workflows/claude-instructions.md +167 -0
  163. package/workflows/codebase-rebuild.md +267 -0
  164. package/workflows/codebase-refresh.md +168 -0
  165. package/workflows/codex-instructions.md +156 -0
  166. package/workflows/coding-philosophy.md +70 -0
  167. package/workflows/command-authoring.md +823 -0
  168. package/workflows/debug.md +409 -0
  169. package/workflows/delegate-usage.md +99 -0
  170. package/workflows/domain-add.md +121 -0
  171. package/workflows/drift-realign.md +396 -0
  172. package/workflows/execute.md +631 -0
  173. package/workflows/explore-usage.md +93 -0
  174. package/workflows/finish-work.md +124 -0
  175. package/workflows/fork.md +162 -0
  176. package/workflows/grill.md +494 -0
  177. package/workflows/harvest.md +478 -0
  178. package/workflows/impeccable.md +168 -0
  179. package/workflows/init.md +157 -0
  180. package/workflows/instruction-authoring-guide.md +97 -0
  181. package/workflows/integration-test.md +186 -0
  182. package/workflows/interview-mechanics.md +8 -0
  183. package/workflows/issue-analyze.md +20 -0
  184. package/workflows/issue-discover.md +238 -0
  185. package/workflows/issue-execute.md +110 -0
  186. package/workflows/issue-gaps-analyze.codex.md +256 -0
  187. package/workflows/issue-gaps-analyze.md +215 -0
  188. package/workflows/issue-plan.md +110 -0
  189. package/workflows/issue.md +338 -0
  190. package/workflows/knowhow.md +429 -0
  191. package/workflows/knowledge-audit.md +355 -0
  192. package/workflows/learn.md +271 -0
  193. package/workflows/maestro-chain-execute.md +20 -0
  194. package/workflows/maestro-link-coordinate.md +114 -0
  195. package/workflows/maestro-super.md +120 -0
  196. package/workflows/maestro.md +501 -0
  197. package/workflows/map.md +74 -0
  198. package/workflows/merge.md +122 -0
  199. package/workflows/milestone-audit.md +155 -0
  200. package/workflows/milestone-complete.md +167 -0
  201. package/workflows/milestone-release.md +82 -0
  202. package/workflows/odyssey-base-codex.md +305 -0
  203. package/workflows/odyssey-base.md +256 -0
  204. package/workflows/overlays.md +109 -0
  205. package/workflows/plan.md +520 -0
  206. package/workflows/quick.md +350 -0
  207. package/workflows/ralph-amend-goal.md +177 -0
  208. package/workflows/refactor.md +87 -0
  209. package/workflows/retrospective.md +471 -0
  210. package/workflows/review.md +448 -0
  211. package/workflows/roadmap-common.md +193 -0
  212. package/workflows/roadmap.md +106 -0
  213. package/workflows/shell-exec-protocol.md +30 -0
  214. package/workflows/skill-authoring.md +265 -0
  215. package/workflows/spec-generate.md +475 -0
  216. package/workflows/specs-add.md +123 -0
  217. package/workflows/specs-load.md +76 -0
  218. package/workflows/specs-remove.md +104 -0
  219. package/workflows/specs-setup.md +316 -0
  220. package/workflows/status.md +149 -0
  221. package/workflows/sync.md +116 -0
  222. package/workflows/tdd.md +255 -0
  223. package/workflows/test-gen.md +226 -0
  224. package/workflows/test.md +385 -0
  225. package/workflows/tools-spec.md +70 -0
  226. package/workflows/ui-codify-extract.md +372 -0
  227. package/workflows/ui-codify-knowhow.md +258 -0
  228. package/workflows/ui-codify-package.md +159 -0
  229. package/workflows/ui-codify.md +227 -0
  230. package/workflows/ui-design.md +393 -0
  231. package/workflows/ui-style.md +201 -0
  232. package/workflows/verify.md +557 -0
  233. package/workflows/wiki-connect.md +153 -0
  234. package/workflows/wiki-digest.md +180 -0
  235. package/workflows/wiki-manage.md +113 -0
@@ -0,0 +1,406 @@
1
+ # Workflow: Blueprint
2
+
3
+ Blueprint specification document chain producing a complete specification package (Product Brief, PRD, Architecture, Epics) through 6 sequential phases with multi-CLI analysis and interactive refinement. Pure documentation — no code generation.
4
+
5
+ ## Pipeline Position
6
+
7
+ ```
8
+ brainstorm (parallel) → blueprint → analyze → plan
9
+ ```
10
+
11
+ ## Architecture
12
+
13
+ ```
14
+ P0: Spec Study → P1: Discovery → P1.5: Req Expansion → P2: Product Brief → P3: PRD → P4: Architecture → P5: Epics → P6: Readiness Check
15
+
16
+ P6 gate: Pass (>=80%) → Handoff | Review (60-79%) → Handoff w/caveats | Fail (<60%) → P6.5 Auto-Fix (max 2 iter) → re-check
17
+
18
+ GATE P2→P3: REQUIRED `product-brief.md` written with ≥5 glossary terms in `glossary.json`; BLOCKED if `product-brief.md` missing or glossary < 5 terms.
19
+ GATE P3→P4: REQUIRED `requirements/_index.md` written with MoSCoW priority table; BLOCKED if `_index.md` missing or MoSCoW table absent.
20
+ ```
21
+
22
+ ## Arguments
23
+
24
+ ```
25
+ $ARGUMENTS: "<idea or @file> [-y] [-c] [--from <source>]"
26
+
27
+ <idea> -- Idea text or @file reference
28
+ -y / --yes -- Auto mode, skip interactive questions
29
+ -c / --continue -- Resume from last checkpoint
30
+ --from <source> -- Load upstream context package (brainstorm:ID, @file, or path) as enriched seed. Alias: --from-brainstorm
31
+ ```
32
+
33
+ ## Output Structure
34
+
35
+ ```
36
+ .workflow/blueprint/BLP-{slug}-{YYYY-MM-DD}/
37
+ ├── blueprint-config.json # Session configuration + phase state
38
+ ├── discovery-context.json # Codebase exploration (optional)
39
+ ├── refined-requirements.json # Phase 1.5: Confirmed requirements
40
+ ├── glossary.json # Phase 2: Terminology glossary
41
+ ├── product-brief.md # Phase 2: Product brief
42
+ ├── requirements/ # Phase 3: Detailed PRD
43
+ │ ├── _index.md # Summary, MoSCoW table, traceability
44
+ │ ├── REQ-NNN-{slug}.md # Functional requirement
45
+ │ └── NFR-{type}-NNN-{slug}.md # Non-functional requirement
46
+ ├── architecture/ # Phase 4: Architecture decisions
47
+ │ ├── _index.md # Overview, components, tech stack
48
+ │ └── ADR-NNN-{slug}.md # Architecture Decision Record
49
+ ├── epics/ # Phase 5: Epic/Story breakdown
50
+ │ ├── _index.md # Epic table, dependency map, MVP
51
+ │ └── EPIC-NNN-{slug}.md # Individual Epic with Stories
52
+ ├── readiness-report.md # Phase 6: Quality report
53
+ └── blueprint-summary.md # Phase 6: Executive summary
54
+ ```
55
+
56
+ ---
57
+
58
+ ## Process
59
+
60
+ ### Step 1: Prerequisite Loading (Phase 0)
61
+
62
+ Load specification and template documents:
63
+
64
+ | Document | Purpose | Priority |
65
+ |----------|---------|----------|
66
+ | Document standards | Format, frontmatter, naming conventions | P0 - must read |
67
+ | Quality gates | Per-phase quality criteria and scoring | P0 - must read |
68
+ | Templates | product-brief, requirements-prd, architecture-doc, epics-template | Read on-demand per phase |
69
+
70
+ **Load project specs and history**:
71
+
72
+ Additional full-mode rules:
73
+ - Features in `already_shipped` are EXCLUDED from spec generation scope
74
+ - `lessons_learned` inform risk assessment in Phase 1 and architecture decisions in Phase 4
75
+ - Pass assembled `project_context` to Phase 1 seed analysis
76
+
77
+ ### Step 2: Discovery & Seed Analysis (Phase 1)
78
+
79
+ Parse input, analyze the seed idea, optionally explore codebase, establish session.
80
+
81
+ **Step 2.1: Input Parsing**
82
+ - Parse $ARGUMENTS: extract idea/topic, flags (-y, -c, --from)
83
+ - If `-c`: read blueprint-config.json, resume from first incomplete phase
84
+ - If `--from <source>` (or `--from-brainstorm SESSION-ID` alias):
85
+ - Resolve source to `context-package.json`:
86
+ - `brainstorm:ID` → `state.json.artifacts[type=brainstorm, id=ID].context_package`
87
+ - `@file` → create import session → delegate extraction → context-package.json
88
+ - `path/` → load `path/context-package.json`
89
+ - `--from-brainstorm SESSION-ID` → alias for `--from brainstorm:{resolve(SESSION-ID)}`
90
+ - Load context-package.json as enriched seed:
91
+ - `requirements[]` → Phase 3 PRD seed requirements (skip Phase 1.5)
92
+ - `constraints[]` → Phase 4 Architecture ADR seed
93
+ - `domain.terminology[]` → Phase 2 Glossary seed
94
+ - `domain.problem_statement` → Phase 2 Product Brief context
95
+ - `non_goals[]` → Phase 2 Product Brief exclusions
96
+ - `insights[]` → Phase 4 Architecture decisions context
97
+ - `references[]` → available for deep-read when needed
98
+ - Set `input_type: "context-package"` — skip Phase 1.5
99
+ - If `@file`: read file content as seed
100
+ - If text: use directly as seed
101
+ - Missing input → error E001
102
+
103
+ **Step 2.2: Session Initialization**
104
+ ```
105
+ Session ID: BLP-{slug}-{YYYY-MM-DD}
106
+ Output dir: .workflow/blueprint/{session_id}/
107
+ ```
108
+
109
+ **Step 2.3: Seed Analysis via CLI** — MANDATORY, NOT SUBSTITUTABLE
110
+ - Spawn CLI analysis to extract: problem_statement, target_users, domain, constraints, dimensions (3-5)
111
+ - Assess complexity: simple (1-2 components) / moderate (3-5) / complex (6+)
112
+ - For context-package input: enrich with feature decomposition data
113
+
114
+ **Step 2.4: Codebase Exploration**
115
+ - Output: `discovery-context.json` with relevant_files, patterns, tech_stack
116
+
117
+ **Step 2.5: External Research**
118
+
119
+ `apiResearchContext` is passed into:
120
+ - Step 4 (Product Brief): technology feasibility assessment
121
+ - Step 5 (Requirements): API-aware requirement writing with concrete constraints
122
+ - Step 6 (Architecture): informed ADR decisions with version-specific details
123
+ - Step 7 (Epics): realistic story sizing based on API complexity
124
+
125
+ **Step 2.6: Spec Type Selection**
126
+ - Interactive (AskUserQuestion): Service / API / Library / Platform
127
+ - `--yes`: default to "service"
128
+ - Each type loads a profile template for domain-specific sections
129
+
130
+ **Step 2.7: User Confirmation (interactive)**
131
+ - Confirm problem statement, select depth (Light/Standard/Comprehensive), select focus areas
132
+ - `--yes`: accept all defaults
133
+
134
+ **Output**: `blueprint-config.json`, `discovery-context.json` (optional), `apiResearchContext` (in-memory, optional)
135
+
136
+ ### Step 3: Requirement Expansion & Clarification (Phase 1.5)
137
+
138
+ Skip if `--from` (requirements already in context-package.json).
139
+
140
+ **Step 3.1: CLI Gap Analysis**
141
+ - Analyze seed for completeness (score 1-10), identify missing dimensions
142
+ - Generate 3-5 clarification areas with questions and expansion suggestions
143
+ - Dimensions checked: functional scope, user scenarios, NFRs, integrations, data model, error handling
144
+
145
+ **Step 3.2: Interactive Discussion Loop (max 5 rounds)**
146
+ - Round 1: present gap analysis + expansion suggestions via AskUserQuestion
147
+ - Round N: CLI follow-up analysis based on user responses, refine requirements
148
+ - User can: answer questions, accept suggestions, or skip to generation
149
+ - `--yes`: CLI auto-expansion without interaction
150
+
151
+ **Step 3.3: User Confirmation**
152
+ - Present requirement summary, user confirms or requests adjustments
153
+ - `--yes`: auto-confirm
154
+
155
+ **Output**: `refined-requirements.json` (confirmed features, NFRs, boundaries, assumptions)
156
+
157
+ ### Step 4: Product Brief (Phase 2)
158
+
159
+ Generate product brief through multi-perspective CLI analysis.
160
+
161
+ **Step 4.1: Load Context**
162
+ - Read refined-requirements.json (preferred) or seed_analysis fallback
163
+ - Read discovery-context.json (if codebase detected)
164
+ - For context-package input: read context-package.json domain and requirements sections
165
+
166
+ **Step 4.2: Multi-CLI Parallel Analysis (3 perspectives)** — MANDATORY, NOT SUBSTITUTABLE
167
+
168
+ | Perspective | Role | Focus |
169
+ |-------------|------|-------|
170
+ | Product | analyze | Vision, market fit, success criteria, scope boundaries |
171
+ | Technical | review | Feasibility, constraints, integration complexity, tech recommendations |
172
+ | User | explore | Personas, journey maps, pain points, UX criteria |
173
+
174
+ **Step 4.3: Synthesis**
175
+ - Extract convergent themes (all agree), conflicts (need resolution), unique insights
176
+ - For context-package input: cross-reference with context-package insights and constraints
177
+ - If `apiResearchContext` is set: inject API details into technical feasibility assessment
178
+
179
+ **Step 4.4: Interactive Refinement**
180
+ - Present synthesis, user adjusts scope/vision
181
+ - `--yes`: accept synthesis as-is
182
+
183
+ **Step 4.5: Generate Outputs**
184
+ - `product-brief.md` from template (YAML frontmatter + filled content)
185
+ - `glossary.json` — 5+ core terms extracted from product brief and CLI analysis
186
+ - Each term: canonical name, definition, aliases, category (core/technical/business)
187
+ - Injected into all subsequent phase CLI prompts for terminology consistency
188
+
189
+ **Output**: `product-brief.md`, `glossary.json`
190
+
191
+ ### Step 5: Requirements / PRD (Phase 3)
192
+
193
+ Generate detailed PRD with functional/non-functional requirements.
194
+
195
+ **Step 5.1: Requirement Expansion via CLI** — MANDATORY, NOT SUBSTITUTABLE
196
+ - For each product brief goal, generate 3-7 functional requirements
197
+ - Each requirement: REQ-NNN ID, title, description, user story, 2-4 acceptance criteria
198
+ - Generate non-functional requirements: performance, security, scalability, usability
199
+ - Apply RFC 2119 keywords (MUST/SHOULD/MAY) to all behavioral constraints
200
+ - Define core entity data models: fields, types, constraints, relationships
201
+ - Inject glossary.json for terminology consistency
202
+
203
+ **Step 5.2: MoSCoW Priority Sorting (interactive)**
204
+ - Present requirements grouped by initial priority
205
+ - User adjusts Must/Should/Could/Won't labels
206
+ - Select MVP scope: Must-only / Must+key Should / Comprehensive
207
+ - `--yes`: accept CLI-suggested priorities
208
+
209
+ **Step 5.3: Generate Directory**
210
+ - `requirements/_index.md` — summary table, MoSCoW breakdown, traceability matrix
211
+ - `requirements/REQ-NNN-{slug}.md` — one per functional requirement
212
+ - `requirements/NFR-{type}-NNN-{slug}.md` — one per non-functional requirement
213
+
214
+ **Output**: `requirements/` directory (index + individual files)
215
+
216
+ ### Step 6: Architecture (Phase 4)
217
+
218
+ Generate architecture decisions, component design, and technology selections.
219
+
220
+ **Step 6.1: Architecture Analysis via CLI (role: review)** — MANDATORY, NOT SUBSTITUTABLE
221
+ - System architecture style with justification
222
+ - Core components and responsibilities
223
+ - Component interaction diagram (Mermaid graph TD)
224
+ - Technology stack: languages, frameworks, databases, infrastructure
225
+ - 2-4 Architecture Decision Records (ADRs): context, decision, alternatives, consequences, evidence_source
226
+ - Data model: entities and relationships (Mermaid erDiagram)
227
+ - Security architecture: auth, authorization, data protection
228
+ - **State machine**: ASCII diagram + transition table for lifecycle entities (service/platform type)
229
+ - **Configuration model**: all configurable fields with type, default, constraint
230
+ - **Error handling strategy**: per-component classification (transient/permanent/degraded), recovery mechanisms
231
+ - **Observability**: key metrics (5+), structured log events, health checks
232
+ - Spec type profile injection for domain-specific depth
233
+ - Glossary injection for terminology consistency
234
+ - If `apiResearchContext` is set: inject as "External API Research" context
235
+
236
+ **Step 6.2: Architecture Review via CLI (role: review)** — MANDATORY, NOT SUBSTITUTABLE
237
+ - Challenge each ADR, identify scalability bottlenecks
238
+ - Assess security gaps, evaluate technology choices
239
+ - Rate overall quality 1-5
240
+
241
+ **Step 6.3: Interactive ADR Decisions**
242
+ - Present ADRs with review feedback, user decides: accept / incorporate feedback / simplify
243
+ - `--yes`: auto-accept
244
+
245
+ **Step 6.4: Codebase Integration Mapping (conditional)**
246
+ - Map new components to existing code modules
247
+
248
+ **Step 6.5: Generate Directory**
249
+ - `architecture/_index.md` — overview, component diagram, tech stack, data model, security
250
+ - `architecture/ADR-NNN-{slug}.md` — one per Architecture Decision Record
251
+
252
+ **Output**: `architecture/` directory (index + individual ADR files)
253
+
254
+ ### Step 7: Epics & Stories (Phase 5)
255
+
256
+ Decompose specification into executable Epics and Stories.
257
+
258
+ **Step 7.1: Epic Decomposition via CLI** — MANDATORY, NOT SUBSTITUTABLE
259
+ - Group requirements into logical Epics (EPIC-NNN IDs). Epic count is unconstrained — downstream workflows will merge Epics into minimal phases via the minimum-phase principle.
260
+ - Tag MVP subset
261
+ - For each Epic: 2-5 Stories in "As a...I want...So that..." format
262
+ - Each Story: 2-4 testable acceptance criteria, relative size (S/M/L/XL), trace to REQ-NNN
263
+ - Cross-Epic dependency map (Mermaid graph LR)
264
+ - Recommended execution order with rationale
265
+ - MVP definition of done (3-5 criteria)
266
+
267
+ **Epic sizing awareness** (informs downstream roadmap generation):
268
+ - Epics that are too small (1-2 Stories, all size S) should be flagged for merge downstream
269
+ - Each Epic should carry enough substance to become part of a phase with 5+ tasks
270
+ - Prefer fewer, larger Epics over many tiny ones
271
+
272
+ **Step 7.2: Interactive Validation**
273
+ - Present Epic overview, user adjusts: merge/split epics, adjust MVP scope
274
+ - `--yes`: accept as-is
275
+
276
+ **Step 7.3: Generate Directory**
277
+ - `epics/_index.md` — overview table, dependency map, MVP scope, execution order, traceability
278
+ - `epics/EPIC-NNN-{slug}.md` — one per Epic with embedded Stories
279
+
280
+ **Output**: `epics/` directory (index + individual Epic files)
281
+
282
+ ### Step 8: Readiness Check & Handoff (Phase 6)
283
+
284
+ Validate specification package and provide execution handoff.
285
+
286
+ **Step 8.1: Cross-Document Validation via CLI** — MANDATORY, NOT SUBSTITUTABLE
287
+ Score on 4 dimensions (25% each):
288
+ 1. **Completeness**: all required sections present with substantive content
289
+ 2. **Consistency**: terminology uniform (glossary compliance), scope containment, non-goals respected
290
+ 3. **Traceability**: goals → requirements → architecture → epics (matrix generated)
291
+ 4. **Depth**: acceptance criteria testable, ADRs justified, stories estimable
292
+
293
+ Gate decision: Pass (>=80) / Review (60-79) / Fail (<60)
294
+
295
+ **Step 8.2: Generate Reports**
296
+ - `readiness-report.md` — quality scores, issue list (Error/Warning/Info), traceability matrix
297
+ - `blueprint-summary.md` — one-page executive summary
298
+
299
+ **Step 8.3: Update Document Status**
300
+ - All document frontmatter updated to `status: complete`
301
+
302
+ **Step 8.4: Gate Routing**
303
+
304
+ | Gate Result | Action |
305
+ |-------------|--------|
306
+ | Pass (>=80%) | Proceed to Step 11 (Final Handoff) |
307
+ | Review (60-79%) | Proceed to Step 11 with caveats logged |
308
+ | Fail (<60%) | Trigger Step 9 (Auto-Fix), then re-run Step 8 |
309
+
310
+ ### Step 9: Auto-Fix (Phase 6.5, conditional)
311
+
312
+ Triggered when Phase 6 score < 60%.
313
+
314
+ **Step 9.1: Parse Readiness Report**
315
+ - Extract Error and Warning items, group by originating phase (2-5), map to affected files
316
+
317
+ **Step 9.2: Fix Affected Phases (sequential, Phase 2→3→4→5)**
318
+ - Read current phase output
319
+ - CLI re-generation with error context injected
320
+ - Inject glossary for terminology consistency
321
+ - Preserve unflagged content, only fix flagged issues
322
+ - Increment document version
323
+
324
+ **Step 9.3: Re-run Phase 6**
325
+ - Generate new readiness-report.md
326
+ - If still Fail and iteration_count < 2: loop back
327
+ - If Pass or max iterations (2) reached: proceed to handoff
328
+
329
+ **Output**: Updated Phase 2-5 documents, updated blueprint-config.json with iteration tracking
330
+
331
+ ### Step 11: Final Handoff
332
+
333
+ Blueprint specification package is complete. Suggest next workflow steps.
334
+
335
+ **Step 11.1: Handoff Options (AskUserQuestion)**
336
+
337
+ | Option | Action |
338
+ |--------|--------|
339
+ | Analyze specification | Run `maestro-analyze` to deep-analyze the blueprint outputs |
340
+ | Generate roadmap | Run `maestro-roadmap` to convert Epics into a phased execution roadmap |
341
+ | Plan first phase | Skill({ skill: "maestro-plan", args: "1" }) |
342
+ | Create issues | Generate issues per Epic via Skill({ skill: "manage-issue" }) |
343
+ | Export only | Blueprint complete, no further action |
344
+
345
+ ### Step 12: Final Report
346
+
347
+ ```
348
+ == blueprint complete ==
349
+ Session: BLP-{slug}-{date} | Quality: {score}% ({gate}) | Phases: {completed_count}/6
350
+ Output: .workflow/blueprint/{session_id}/
351
+ blueprint-config.json, product-brief.md, requirements/, architecture/, epics/,
352
+ readiness-report.md, blueprint-summary.md
353
+
354
+ Next: maestro-analyze (deep analysis) | maestro-roadmap (generate roadmap) | maestro-plan 1 (plan first phase)
355
+ ```
356
+
357
+ ---
358
+
359
+ ## State Management
360
+
361
+ **blueprint-config.json**:
362
+ ```json
363
+ {
364
+ "session_id": "BLP-xxx-2026-03-15",
365
+ "seed_input": "User input text",
366
+ "input_type": "text|file|context-package",
367
+ "timestamp": "ISO8601",
368
+ "mode": "interactive|auto",
369
+ "complexity": "simple|moderate|complex",
370
+ "depth": "light|standard|comprehensive",
371
+ "focus_areas": [],
372
+ "spec_type": "service|api|library|platform",
373
+ "iteration_count": 0,
374
+ "iteration_history": [],
375
+ "seed_analysis": {
376
+ "problem_statement": "...",
377
+ "target_users": [],
378
+ "domain": "...",
379
+ "constraints": [],
380
+ "dimensions": []
381
+ },
382
+ "has_codebase": false,
383
+ "phasesCompleted": [
384
+ { "phase": 1, "name": "discovery", "output_file": "blueprint-config.json", "completed_at": "ISO8601" }
385
+ ]
386
+ }
387
+ ```
388
+
389
+ Resume: `-c` reads blueprint-config.json, resumes from first incomplete phase.
390
+
391
+ ## Error Handling
392
+
393
+ | Phase | Error | Blocking? | Action |
394
+ |-------|-------|-----------|--------|
395
+ | Phase 1 | Empty input | Yes | Error and exit |
396
+ | Phase 1 | CLI analysis fails | No | Basic parsing fallback; flag seed_analysis as [LOW CONFIDENCE] (CLI analysis unavailable) |
397
+ | Phase 1.5 | Gap analysis fails | No | Skip to basic prompts; flag refined-requirements.json as [LOW CONFIDENCE] (no gap analysis) |
398
+ | Phase 2 | Single CLI fails | No | Continue with available; flag product-brief.md as [LOW CONFIDENCE] (missing perspective) |
399
+ | Phase 3 | Gemini fails | No | Codex fallback; flag affected REQ-NNN.md as [LOW CONFIDENCE] (model fallback) |
400
+ | Phase 4 | Review fails | No | Skip review; flag ADR-NNN.md as [LOW CONFIDENCE] (no peer review) |
401
+ | Phase 5 | Story generation fails | No | Generate epics only; flag EPIC-NNN.md stories as [LOW CONFIDENCE] (stories incomplete) |
402
+ | Phase 6 | Validation fails | No | Partial report; flag readiness-report.md as [LOW CONFIDENCE] (validation incomplete) |
403
+ | Phase 6.5 | Max iterations (2) | No | Force handoff; flag readiness-report.md as [LOW CONFIDENCE] (auto-fix exhausted) |
404
+ | Step 2.5 | External research fails | No | apiResearchContext = null, continue; flag apiResearchContext as [LOW CONFIDENCE] (no external research) |
405
+
406
+ CLI Fallback Chain: Role-based resolution → degraded mode (local only); flag affected phase artifacts as [LOW CONFIDENCE] (CLI unavailable, local-only analysis)
@@ -0,0 +1,50 @@
1
+ # Boundary Grill — Embedded Mini-Review Protocol
2
+
3
+
4
+ ## Conflict Types
5
+
6
+ | ID | Signal | Example |
7
+ |----|--------|---------|
8
+ | `RSC` | Decision outside command's scope guard | analyze outputs task-level details (plan scope) |
9
+ | `MOD` | Changes cross 2+ module boundaries | task touches `commands/` and `hooks/` without declaring cross-module |
10
+ | `DEC` | Upstream locked decision contradicts code | locked "use EventEmitter" but code uses Subject at `file:line` |
11
+
12
+ ## Trigger
13
+
14
+ Run boundary grill when ANY of:
15
+ - **RSC**: produced decision matches another command's scope guard keywords
16
+ - **MOD**: `ARCHITECTURE.md` exists AND changes touch 2+ top-level modules
17
+ - **DEC**: upstream Locked decisions AND code grep shows contradicting patterns
18
+
19
+ Priority when >3 conflicts: DEC > RSC > MOD.
20
+
21
+ ## Protocol
22
+
23
+ Per conflict (max 3 conflicts × 3 questions = 9 total):
24
+ 1. State the conflict with `file:line` evidence
25
+ 2. Ask 2-3 adversarial questions via AskUserQuestion — challenge with code reality
26
+ 3. Resolve: RESOLVED (evidence-based) / DEFERRED (needs escalation) / ACCEPTED_RISK
27
+
28
+ **Auto mode (`-y`)**: skip questions, resolve via code evidence weighting:
29
+ - RSC → defer to target scope
30
+ - MOD → follow existing cross-module pattern (or flag as risk)
31
+ - DEC → code wins (current code = ground truth)
32
+
33
+ ## Output
34
+
35
+ Append to calling command's primary output:
36
+
37
+ ```markdown
38
+ ## Boundary Grill Results
39
+
40
+ | # | Type | Conflict | Resolution | Evidence |
41
+ |---|------|----------|------------|----------|
42
+ ```
43
+
44
+ Feed into `context.md`: resolved DEC → amend Locked; unresolved → Deferred with `boundary_grill: true`.
45
+
46
+ ## Constraints
47
+
48
+ - Non-blocking — warnings + resolutions, never hard stops
49
+ - Evidence MUST include `file:line` — generic assertions invalid
50
+ - Results visible in command output — no silent swallowing