substrate-ai 0.1.21 → 0.1.23

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.
package/dist/index.d.ts CHANGED
@@ -231,6 +231,68 @@ interface StoryStallEvent {
231
231
  /** Milliseconds since the last progress event */
232
232
  elapsed_ms: number;
233
233
  }
234
+ /**
235
+ * Emitted when the supervisor kills a stalled pipeline process tree.
236
+ */
237
+ interface SupervisorKillEvent {
238
+ type: 'supervisor:kill';
239
+ /** ISO-8601 timestamp generated at emit time */
240
+ ts: string;
241
+ /** Pipeline run ID that was killed */
242
+ run_id: string | null;
243
+ /** Reason for the kill — always 'stall' for threshold-triggered kills */
244
+ reason: 'stall';
245
+ /** Seconds the pipeline had been stalled */
246
+ staleness_seconds: number;
247
+ /** PIDs that were killed (orchestrator + child processes) */
248
+ pids: number[];
249
+ }
250
+ /**
251
+ * Emitted when the supervisor restarts a killed pipeline.
252
+ */
253
+ interface SupervisorRestartEvent {
254
+ type: 'supervisor:restart';
255
+ /** ISO-8601 timestamp generated at emit time */
256
+ ts: string;
257
+ /** Pipeline run ID being resumed */
258
+ run_id: string | null;
259
+ /** Restart attempt number (1-based) */
260
+ attempt: number;
261
+ }
262
+ /**
263
+ * Emitted when the supervisor exceeds the maximum restart limit and aborts.
264
+ */
265
+ interface SupervisorAbortEvent {
266
+ type: 'supervisor:abort';
267
+ /** ISO-8601 timestamp generated at emit time */
268
+ ts: string;
269
+ /** Pipeline run ID that was abandoned */
270
+ run_id: string | null;
271
+ /** Reason for aborting */
272
+ reason: 'max_restarts_exceeded';
273
+ /** Number of restart attempts that were made */
274
+ attempts: number;
275
+ }
276
+ /**
277
+ * Emitted when the supervisor detects a terminal pipeline state and exits.
278
+ */
279
+ interface SupervisorSummaryEvent {
280
+ type: 'supervisor:summary';
281
+ /** ISO-8601 timestamp generated at emit time */
282
+ ts: string;
283
+ /** Pipeline run ID */
284
+ run_id: string | null;
285
+ /** Total elapsed seconds from supervisor start to terminal state */
286
+ elapsed_seconds: number;
287
+ /** Story keys that completed successfully */
288
+ succeeded: string[];
289
+ /** Story keys that failed (non-COMPLETE, non-PENDING phases) */
290
+ failed: string[];
291
+ /** Story keys that were escalated */
292
+ escalated: string[];
293
+ /** Number of restart cycles performed by the supervisor */
294
+ restarts: number;
295
+ }
234
296
  /**
235
297
  * Discriminated union of all pipeline event types.
236
298
  *
@@ -243,7 +305,7 @@ interface StoryStallEvent {
243
305
  * }
244
306
  * ```
245
307
  */
246
- type PipelineEvent = PipelineStartEvent | PipelineCompleteEvent | StoryPhaseEvent | StoryDoneEvent | StoryEscalationEvent | StoryWarnEvent | StoryLogEvent | PipelineHeartbeatEvent | StoryStallEvent; //#endregion
308
+ type PipelineEvent = PipelineStartEvent | PipelineCompleteEvent | StoryPhaseEvent | StoryDoneEvent | StoryEscalationEvent | StoryWarnEvent | StoryLogEvent | PipelineHeartbeatEvent | StoryStallEvent | SupervisorKillEvent | SupervisorRestartEvent | SupervisorAbortEvent | SupervisorSummaryEvent; //#endregion
247
309
  //#region src/core/errors.d.ts
248
310
 
249
311
  /**
@@ -841,6 +903,26 @@ interface OrchestratorEvents {
841
903
  phase: string;
842
904
  elapsedMs: number;
843
905
  };
906
+ /** Readiness check has completed — emitted for all verdicts (READY, NEEDS_WORK, NOT_READY) */
907
+ 'solutioning:readiness-check': {
908
+ runId: string;
909
+ verdict: 'READY' | 'NEEDS_WORK' | 'NOT_READY';
910
+ coverageScore: number;
911
+ findingCount: number;
912
+ blockerCount: number;
913
+ };
914
+ /** Readiness check returned NOT_READY — solutioning phase will not proceed to implementation */
915
+ 'solutioning:readiness-failed': {
916
+ runId: string;
917
+ verdict: 'NOT_READY';
918
+ coverageScore: number;
919
+ findings: Array<{
920
+ category: string;
921
+ severity: string;
922
+ description: string;
923
+ affected_items: string[];
924
+ }>;
925
+ };
844
926
  }
845
927
 
846
928
  //#endregion
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { AdapterRegistry, AdtError, BudgetExceededError, ClaudeCodeAdapter, CodexCLIAdapter, ConfigError, ConfigIncompatibleFormatError, GeminiCLIAdapter, GitError, RecoveryError, TaskConfigError, TaskGraphCycleError, TaskGraphError, TaskGraphIncompatibleFormatError, WorkerError, WorkerNotFoundError, childLogger, computeChangedKeys, createConfigWatcher, createDatabaseService, createEventBus, createGitWorktreeManager, createLogger, createMonitorAgent, createMonitorDatabase, createRoutingEngine, createTaskGraphEngine, createTuiApp, createWorkerPoolManager, isTuiCapable, logger, printNonTtyWarning } from "./app-Bltq6BEm.js";
1
+ import { AdapterRegistry, AdtError, BudgetExceededError, ClaudeCodeAdapter, CodexCLIAdapter, ConfigError, ConfigIncompatibleFormatError, GeminiCLIAdapter, GitError, RecoveryError, TaskConfigError, TaskGraphCycleError, TaskGraphError, TaskGraphIncompatibleFormatError, WorkerError, WorkerNotFoundError, childLogger, computeChangedKeys, createConfigWatcher, createDatabaseService, createEventBus, createGitWorktreeManager, createLogger, createMonitorAgent, createMonitorDatabase, createRoutingEngine, createTaskGraphEngine, createTuiApp, createWorkerPoolManager, isTuiCapable, logger, printNonTtyWarning } from "./app-CY3MaJtP.js";
2
2
  import "./config-schema-C9tTMcm1.js";
3
3
  import { join } from "node:path";
4
4
  import { randomUUID } from "crypto";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "substrate-ai",
3
- "version": "0.1.21",
3
+ "version": "0.1.23",
4
4
  "description": "Substrate — multi-agent orchestration daemon for AI coding agents",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -64,7 +64,7 @@
64
64
  "js-yaml": "^4.1.1",
65
65
  "pino": "^9.6.0",
66
66
  "semver": "^7.6.3",
67
- "substrate-ai": "^0.1.19",
67
+ "substrate-ai": "^0.1.22",
68
68
  "zod": "^4.3.6"
69
69
  },
70
70
  "devDependencies": {
@@ -0,0 +1,51 @@
1
+ num,category,method_name,description,output_pattern
2
+ 1,collaboration,Stakeholder Round Table,Convene multiple personas to contribute diverse perspectives - essential for requirements gathering and finding balanced solutions across competing interests,perspectives → synthesis → alignment
3
+ 2,collaboration,Expert Panel Review,Assemble domain experts for deep specialized analysis - ideal when technical depth and peer review quality are needed,expert views → consensus → recommendations
4
+ 3,collaboration,Debate Club Showdown,Two personas argue opposing positions while a moderator scores points - great for exploring controversial decisions and finding middle ground,thesis → antithesis → synthesis
5
+ 4,collaboration,User Persona Focus Group,Gather your product's user personas to react to proposals and share frustrations - essential for validating features and discovering unmet needs,reactions → concerns → priorities
6
+ 5,collaboration,Time Traveler Council,Past-you and future-you advise present-you on decisions - powerful for gaining perspective on long-term consequences vs short-term pressures,past wisdom → present choice → future impact
7
+ 6,collaboration,Cross-Functional War Room,Product manager + engineer + designer tackle a problem together - reveals trade-offs between feasibility desirability and viability,constraints → trade-offs → balanced solution
8
+ 7,collaboration,Mentor and Apprentice,Senior expert teaches junior while junior asks naive questions - surfaces hidden assumptions through teaching,explanation → questions → deeper understanding
9
+ 8,collaboration,Good Cop Bad Cop,Supportive persona and critical persona alternate - finds both strengths to build on and weaknesses to address,encouragement → criticism → balanced view
10
+ 9,collaboration,Improv Yes-And,Multiple personas build on each other's ideas without blocking - generates unexpected creative directions through collaborative building,idea → build → build → surprising result
11
+ 10,collaboration,Customer Support Theater,Angry customer and support rep roleplay to find pain points - reveals real user frustrations and service gaps,complaint → investigation → resolution → prevention
12
+ 11,advanced,Tree of Thoughts,Explore multiple reasoning paths simultaneously then evaluate and select the best - perfect for complex problems with multiple valid approaches,paths → evaluation → selection
13
+ 12,advanced,Graph of Thoughts,Model reasoning as an interconnected network of ideas to reveal hidden relationships - ideal for systems thinking and discovering emergent patterns,nodes → connections → patterns
14
+ 13,advanced,Thread of Thought,Maintain coherent reasoning across long contexts by weaving a continuous narrative thread - essential for RAG systems and maintaining consistency,context → thread → synthesis
15
+ 14,advanced,Self-Consistency Validation,Generate multiple independent approaches then compare for consistency - crucial for high-stakes decisions where verification matters,approaches → comparison → consensus
16
+ 15,advanced,Meta-Prompting Analysis,Step back to analyze the approach structure and methodology itself - valuable for optimizing prompts and improving problem-solving,current → analysis → optimization
17
+ 16,advanced,Reasoning via Planning,Build a reasoning tree guided by world models and goal states - excellent for strategic planning and sequential decision-making,model → planning → strategy
18
+ 17,competitive,Red Team vs Blue Team,Adversarial attack-defend analysis to find vulnerabilities - critical for security testing and building robust solutions,defense → attack → hardening
19
+ 18,competitive,Shark Tank Pitch,Entrepreneur pitches to skeptical investors who poke holes - stress-tests business viability and forces clarity on value proposition,pitch → challenges → refinement
20
+ 19,competitive,Code Review Gauntlet,Senior devs with different philosophies review the same code - surfaces style debates and finds consensus on best practices,reviews → debates → standards
21
+ 20,technical,Architecture Decision Records,Multiple architect personas propose and debate architectural choices with explicit trade-offs - ensures decisions are well-reasoned and documented,options → trade-offs → decision → rationale
22
+ 21,technical,Rubber Duck Debugging Evolved,Explain your code to progressively more technical ducks until you find the bug - forces clarity at multiple abstraction levels,simple → detailed → technical → aha
23
+ 22,technical,Algorithm Olympics,Multiple approaches compete on the same problem with benchmarks - finds optimal solution through direct comparison,implementations → benchmarks → winner
24
+ 23,technical,Security Audit Personas,Hacker + defender + auditor examine system from different threat models - comprehensive security review from multiple angles,vulnerabilities → defenses → compliance
25
+ 24,technical,Performance Profiler Panel,Database expert + frontend specialist + DevOps engineer diagnose slowness - finds bottlenecks across the full stack,symptoms → analysis → optimizations
26
+ 25,creative,SCAMPER Method,Apply seven creativity lenses (Substitute/Combine/Adapt/Modify/Put/Eliminate/Reverse) - systematic ideation for product innovation,S→C→A→M→P→E→R
27
+ 26,creative,Reverse Engineering,Work backwards from desired outcome to find implementation path - powerful for goal achievement and understanding endpoints,end state → steps backward → path forward
28
+ 27,creative,What If Scenarios,Explore alternative realities to understand possibilities and implications - valuable for contingency planning and exploration,scenarios → implications → insights
29
+ 28,creative,Random Input Stimulus,Inject unrelated concepts to spark unexpected connections - breaks creative blocks through forced lateral thinking,random word → associations → novel ideas
30
+ 29,creative,Exquisite Corpse Brainstorm,Each persona adds to the idea seeing only the previous contribution - generates surprising combinations through constrained collaboration,contribution → handoff → contribution → surprise
31
+ 30,creative,Genre Mashup,Combine two unrelated domains to find fresh approaches - innovation through unexpected cross-pollination,domain A + domain B → hybrid insights
32
+ 31,research,Literature Review Personas,Optimist researcher + skeptic researcher + synthesizer review sources - balanced assessment of evidence quality,sources → critiques → synthesis
33
+ 32,research,Thesis Defense Simulation,Student defends hypothesis against committee with different concerns - stress-tests research methodology and conclusions,thesis → challenges → defense → refinements
34
+ 33,research,Comparative Analysis Matrix,Multiple analysts evaluate options against weighted criteria - structured decision-making with explicit scoring,options → criteria → scores → recommendation
35
+ 34,risk,Pre-mortem Analysis,Imagine future failure then work backwards to prevent it - powerful technique for risk mitigation before major launches,failure scenario → causes → prevention
36
+ 35,risk,Failure Mode Analysis,Systematically explore how each component could fail - critical for reliability engineering and safety-critical systems,components → failures → prevention
37
+ 36,risk,Challenge from Critical Perspective,Play devil's advocate to stress-test ideas and find weaknesses - essential for overcoming groupthink,assumptions → challenges → strengthening
38
+ 37,risk,Identify Potential Risks,Brainstorm what could go wrong across all categories - fundamental for project planning and deployment preparation,categories → risks → mitigations
39
+ 38,risk,Chaos Monkey Scenarios,Deliberately break things to test resilience and recovery - ensures systems handle failures gracefully,break → observe → harden
40
+ 39,core,First Principles Analysis,Strip away assumptions to rebuild from fundamental truths - breakthrough technique for innovation and solving impossible problems,assumptions → truths → new approach
41
+ 40,core,5 Whys Deep Dive,Repeatedly ask why to drill down to root causes - simple but powerful for understanding failures,why chain → root cause → solution
42
+ 41,core,Socratic Questioning,Use targeted questions to reveal hidden assumptions and guide discovery - excellent for teaching and self-discovery,questions → revelations → understanding
43
+ 42,core,Critique and Refine,Systematic review to identify strengths and weaknesses then improve - standard quality check for drafts,strengths/weaknesses → improvements → refined
44
+ 43,core,Explain Reasoning,Walk through step-by-step thinking to show how conclusions were reached - crucial for transparency,steps → logic → conclusion
45
+ 44,core,Expand or Contract for Audience,Dynamically adjust detail level and technical depth for target audience - matches content to reader capabilities,audience → adjustments → refined content
46
+ 45,learning,Feynman Technique,Explain complex concepts simply as if teaching a child - the ultimate test of true understanding,complex → simple → gaps → mastery
47
+ 46,learning,Active Recall Testing,Test understanding without references to verify true knowledge - essential for identifying gaps,test → gaps → reinforcement
48
+ 47,philosophical,Occam's Razor Application,Find the simplest sufficient explanation by eliminating unnecessary complexity - essential for debugging,options → simplification → selection
49
+ 48,philosophical,Trolley Problem Variations,Explore ethical trade-offs through moral dilemmas - valuable for understanding values and difficult decisions,dilemma → analysis → decision
50
+ 49,retrospective,Hindsight Reflection,Imagine looking back from the future to gain perspective - powerful for project reviews,future view → insights → application
51
+ 50,retrospective,Lessons Learned Extraction,Systematically identify key takeaways and actionable improvements - essential for continuous improvement,experience → lessons → actions
@@ -2,22 +2,149 @@ name: bmad
2
2
  version: 1.0.0
3
3
  description: BMAD methodology for autonomous software development
4
4
 
5
+ # Optional UX design phase (Story 16.5).
6
+ # When true, a 'ux-design' phase runs between planning and solutioning.
7
+ # Set to false (or omit) to skip UX design and proceed directly to solutioning.
8
+ uxDesign: true
9
+
5
10
  phases:
6
11
  - name: analysis
7
12
  description: Product discovery and brief creation
8
13
  entryGates: []
9
14
  exitGates: [product-brief-complete]
10
15
  artifacts: [product-brief]
16
+ steps:
17
+ - name: analysis-step-1-vision
18
+ template: analysis-step-1-vision
19
+ context:
20
+ - placeholder: concept
21
+ source: "param:concept"
22
+ elicitate: true
23
+ - name: analysis-step-2-scope
24
+ template: analysis-step-2-scope
25
+ context:
26
+ - placeholder: concept
27
+ source: "param:concept"
28
+ - placeholder: vision_output
29
+ source: "step:analysis-step-1-vision"
30
+ critique: true
11
31
  - name: planning
12
32
  description: PRD and requirements generation
13
33
  entryGates: [product-brief-complete]
14
34
  exitGates: [prd-complete]
15
35
  artifacts: [prd]
36
+ steps:
37
+ - name: planning-step-1-classification
38
+ template: planning-step-1-classification
39
+ context:
40
+ - placeholder: product_brief
41
+ source: "decision:analysis.product-brief"
42
+ - name: planning-step-2-frs
43
+ template: planning-step-2-frs
44
+ context:
45
+ - placeholder: product_brief
46
+ source: "decision:analysis.product-brief"
47
+ - placeholder: classification
48
+ source: "step:planning-step-1-classification"
49
+ elicitate: true
50
+ - name: planning-step-3-nfrs
51
+ template: planning-step-3-nfrs
52
+ context:
53
+ - placeholder: product_brief
54
+ source: "decision:analysis.product-brief"
55
+ - placeholder: classification
56
+ source: "step:planning-step-1-classification"
57
+ - placeholder: functional_requirements
58
+ source: "step:planning-step-2-frs"
59
+ critique: true
60
+ - name: ux-design
61
+ description: UX discovery, design system, and user journey mapping (optional — runs when uxDesign is true)
62
+ entryGates: [prd-complete]
63
+ exitGates: [ux-design-complete]
64
+ artifacts: [ux-design]
65
+ steps:
66
+ - name: ux-step-1-discovery
67
+ template: ux-step-1-discovery
68
+ context:
69
+ - placeholder: product_brief
70
+ source: "decision:analysis.product-brief"
71
+ - placeholder: requirements
72
+ source: "decision:planning.functional-requirements"
73
+ elicitate: true
74
+ - name: ux-step-2-design-system
75
+ template: ux-step-2-design-system
76
+ context:
77
+ - placeholder: product_brief
78
+ source: "decision:analysis.product-brief"
79
+ - placeholder: requirements
80
+ source: "decision:planning.functional-requirements"
81
+ - placeholder: ux_discovery
82
+ source: "step:ux-step-1-discovery"
83
+ elicitate: true
84
+ - name: ux-step-3-journeys
85
+ template: ux-step-3-journeys
86
+ context:
87
+ - placeholder: product_brief
88
+ source: "decision:analysis.product-brief"
89
+ - placeholder: requirements
90
+ source: "decision:planning.functional-requirements"
91
+ - placeholder: ux_discovery
92
+ source: "step:ux-step-1-discovery"
93
+ - placeholder: design_system
94
+ source: "step:ux-step-2-design-system"
95
+ critique: true
16
96
  - name: solutioning
17
97
  description: Architecture and epic/story breakdown
18
98
  entryGates: [prd-complete]
19
99
  exitGates: [architecture-complete, stories-complete, readiness-check]
20
100
  artifacts: [architecture, epics, stories]
101
+ steps:
102
+ - name: architecture-step-1-context
103
+ template: architecture-step-1-context
104
+ context:
105
+ - placeholder: requirements
106
+ source: "decision:planning.functional-requirements"
107
+ - placeholder: nfr
108
+ source: "decision:planning.non-functional-requirements"
109
+ outputCategory: architecture
110
+ - name: architecture-step-2-decisions
111
+ template: architecture-step-2-decisions
112
+ context:
113
+ - placeholder: requirements
114
+ source: "decision:planning.functional-requirements"
115
+ - placeholder: starter_decisions
116
+ source: "step:architecture-step-1-context"
117
+ - placeholder: ux_decisions
118
+ source: "decision:ux-design.ux-design"
119
+ outputCategory: architecture
120
+ elicitate: true
121
+ - name: architecture-step-3-patterns
122
+ template: architecture-step-3-patterns
123
+ context:
124
+ - placeholder: architecture_decisions
125
+ source: "decision:solutioning.architecture"
126
+ outputCategory: architecture
127
+ critique: true
128
+ - name: stories-step-1-epics
129
+ template: stories-step-1-epics
130
+ context:
131
+ - placeholder: requirements
132
+ source: "decision:planning.functional-requirements"
133
+ - placeholder: architecture_decisions
134
+ source: "decision:solutioning.architecture"
135
+ outputCategory: epic-design
136
+ elicitate: true
137
+ - name: stories-step-2-stories
138
+ template: stories-step-2-stories
139
+ context:
140
+ - placeholder: epic_structure
141
+ source: "step:stories-step-1-epics"
142
+ - placeholder: requirements
143
+ source: "decision:planning.functional-requirements"
144
+ - placeholder: architecture_decisions
145
+ source: "decision:solutioning.architecture"
146
+ outputCategory: stories
147
+ critique: true
21
148
  - name: implementation
22
149
  description: Code generation, testing, and review
23
150
  entryGates: [stories-complete]
@@ -33,6 +160,31 @@ prompts:
33
160
  dev-story: prompts/dev-story.md
34
161
  code-review: prompts/code-review.md
35
162
  fix-story: prompts/fix-story.md
163
+ # Multi-step phase decomposition prompts
164
+ analysis-step-1-vision: prompts/analysis-step-1-vision.md
165
+ analysis-step-2-scope: prompts/analysis-step-2-scope.md
166
+ planning-step-1-classification: prompts/planning-step-1-classification.md
167
+ planning-step-2-frs: prompts/planning-step-2-frs.md
168
+ planning-step-3-nfrs: prompts/planning-step-3-nfrs.md
169
+ architecture-step-1-context: prompts/architecture-step-1-context.md
170
+ architecture-step-2-decisions: prompts/architecture-step-2-decisions.md
171
+ architecture-step-3-patterns: prompts/architecture-step-3-patterns.md
172
+ stories-step-1-epics: prompts/stories-step-1-epics.md
173
+ stories-step-2-stories: prompts/stories-step-2-stories.md
174
+ # UX design step prompts (Story 16-5)
175
+ ux-step-1-discovery: prompts/ux-step-1-discovery.md
176
+ ux-step-2-design-system: prompts/ux-step-2-design-system.md
177
+ ux-step-3-journeys: prompts/ux-step-3-journeys.md
178
+ # Elicitation prompt (Story 16-3)
179
+ elicitation-apply: prompts/elicitation-apply.md
180
+ # Critique and refinement prompts (Story 16-4)
181
+ critique-analysis: prompts/critique-analysis.md
182
+ critique-planning: prompts/critique-planning.md
183
+ critique-architecture: prompts/critique-architecture.md
184
+ critique-stories: prompts/critique-stories.md
185
+ refine-artifact: prompts/refine-artifact.md
186
+ # Readiness check prompt (Story 16-6)
187
+ readiness-check: prompts/readiness-check.md
36
188
 
37
189
  constraints:
38
190
  create-story: constraints/create-story.yaml
@@ -0,0 +1,51 @@
1
+ # BMAD Analysis Step 1: Vision & Problem Analysis
2
+
3
+ ## Context (pre-assembled by pipeline)
4
+
5
+ ### Project Concept
6
+ {{concept}}
7
+
8
+ ---
9
+
10
+ ## Mission
11
+
12
+ Analyze the project concept above and produce a focused **vision analysis**: a clear problem statement and identification of target users. Do NOT define features or metrics yet — those come in a subsequent step.
13
+
14
+ ## Instructions
15
+
16
+ 1. **Analyze the concept deeply:**
17
+ - What problem does this solve? Who experiences this problem most acutely?
18
+ - What existing solutions exist? Why do they fall short?
19
+ - What would make this succeed vs. fail?
20
+
21
+ 2. **Generate a research-grade problem statement:**
22
+ - A clear, specific articulation of the problem (minimum 2-3 sentences)
23
+ - Ground it in user pain, not technology
24
+ - Include the impact of the problem remaining unsolved
25
+
26
+ 3. **Identify target users:**
27
+ - Specific user segments (not generic labels)
28
+ - Include role, context, and why they care
29
+ - Minimum 2 distinct segments
30
+
31
+ 4. **Quality bar**: Every field should contain enough detail that a product manager could begin scoping from this analysis alone.
32
+
33
+ ## Output Contract
34
+
35
+ Emit ONLY this YAML block as your final output — no other text.
36
+
37
+ **CRITICAL**: All array items MUST be plain strings, NOT objects/maps.
38
+
39
+ ```yaml
40
+ result: success
41
+ problem_statement: "A clear articulation of the problem in 2-3 sentences."
42
+ target_users:
43
+ - "Software developers who work in terminal environments and want habit tracking"
44
+ - "DevOps engineers who need to maintain daily operational checklists"
45
+ ```
46
+
47
+ If you cannot produce valid output:
48
+
49
+ ```yaml
50
+ result: failed
51
+ ```
@@ -0,0 +1,59 @@
1
+ # BMAD Analysis Step 2: Scope & Features
2
+
3
+ ## Context (pre-assembled by pipeline)
4
+
5
+ ### Project Concept
6
+ {{concept}}
7
+
8
+ ### Vision Analysis (from Step 1)
9
+ {{vision_output}}
10
+
11
+ ---
12
+
13
+ ## Mission
14
+
15
+ Building on the vision analysis above, define the **scope**: core features, success metrics, and constraints. The problem statement and target users are already established — now determine WHAT to build and HOW to measure success.
16
+
17
+ ## Instructions
18
+
19
+ 1. **Define core features** that directly address the problem statement:
20
+ - Each feature should be a concrete capability, not a vague category
21
+ - Prioritize by user impact — list the most critical features first
22
+ - Ensure features serve the identified target users
23
+
24
+ 2. **Define measurable success metrics:**
25
+ - Tied to user value and business objectives
26
+ - Include both leading indicators (engagement, adoption) and lagging indicators (retention, revenue)
27
+ - Be specific enough to measure
28
+
29
+ 3. **Identify constraints:**
30
+ - Technical limitations, regulatory requirements, budget boundaries
31
+ - Timeline pressures, platform restrictions, or integration requirements
32
+ - Omit if genuinely none exist
33
+
34
+ 4. **Quality bar**: A product manager should be able to write a PRD from the combined vision + scope output.
35
+
36
+ ## Output Contract
37
+
38
+ Emit ONLY this YAML block as your final output — no other text.
39
+
40
+ **CRITICAL**: All array items MUST be plain strings, NOT objects/maps.
41
+
42
+ ```yaml
43
+ result: success
44
+ core_features:
45
+ - "CLI command to register, check-off, and view daily habits with streak tracking"
46
+ - "Local SQLite storage with export to JSON/CSV for portability"
47
+ success_metrics:
48
+ - "Daily active usage rate >60% among onboarded users within 30 days"
49
+ - "Streak completion rate >40% across all tracked habits"
50
+ constraints:
51
+ - "CLI-only interface limits audience to terminal-comfortable users"
52
+ - "Must work offline with local storage, no cloud dependency"
53
+ ```
54
+
55
+ If you cannot produce valid output:
56
+
57
+ ```yaml
58
+ result: failed
59
+ ```
@@ -0,0 +1,69 @@
1
+ # BMAD Architecture Step 1: Context Analysis
2
+
3
+ ## Context (pre-assembled by pipeline)
4
+
5
+ ### Requirements (from Planning Phase)
6
+ {{requirements}}
7
+
8
+ ### Non-Functional Requirements
9
+ {{nfr}}
10
+
11
+ ---
12
+
13
+ ## Mission
14
+
15
+ Analyze the requirements context and produce **initial architecture decisions** focused on the foundational technology choices: system architecture style, API design, data storage, and project structure. Think like a pragmatic senior architect — choose boring technology that ships.
16
+
17
+ ## Instructions
18
+
19
+ 1. **Make concrete decisions, not suggestions:**
20
+ - Each decision is a key-value pair capturing one architectural concern
21
+ - The `key` identifies WHAT is being decided
22
+ - The `value` states the CHOICE
23
+ - The `rationale` explains WHY this choice over alternatives
24
+
25
+ 2. **Focus on foundational decisions:**
26
+ - **System architecture**: Monolith, modular monolith, microservices, or serverless
27
+ - **API design**: REST, GraphQL, gRPC, or hybrid
28
+ - **Data storage**: Database engine, schema strategy, migration approach
29
+ - **Project structure**: Directory layout, module boundaries, dependency rules
30
+
31
+ 3. **Align with requirements:**
32
+ - Every `must` functional requirement should be architecturally supportable
33
+ - NFRs should directly inform decisions
34
+ - Tech stack choices from planning should be respected
35
+
36
+ 4. **Use the `category` field** to group related decisions:
37
+ - `infrastructure`: deployment, hosting, CI/CD
38
+ - `backend`: API, database, auth, services
39
+ - `frontend`: UI framework, state, routing
40
+ - `crosscutting`: logging, error handling, testing, security
41
+
42
+ ## Output Contract
43
+
44
+ Emit ONLY this YAML block as your final output — no other text.
45
+
46
+ **CRITICAL**: All string values MUST be quoted with double quotes.
47
+
48
+ ```yaml
49
+ result: success
50
+ architecture_decisions:
51
+ - category: "backend"
52
+ key: "system-architecture"
53
+ value: "Modular monolith with clear module boundaries"
54
+ rationale: "Right complexity level for the project scope"
55
+ - category: "backend"
56
+ key: "database"
57
+ value: "SQLite with better-sqlite3 driver"
58
+ rationale: "Zero-config local storage, perfect for CLI tools"
59
+ - category: "backend"
60
+ key: "api-style"
61
+ value: "CLI command interface with Commander.js"
62
+ rationale: "Direct command-line interaction, no HTTP needed"
63
+ ```
64
+
65
+ If you cannot produce valid output:
66
+
67
+ ```yaml
68
+ result: failed
69
+ ```
@@ -0,0 +1,69 @@
1
+ # BMAD Architecture Step 2: Detailed Decisions
2
+
3
+ ## Context (pre-assembled by pipeline)
4
+
5
+ ### Requirements (from Planning Phase)
6
+ {{requirements}}
7
+
8
+ ### Foundational Decisions (from Step 1)
9
+ {{starter_decisions}}
10
+
11
+ ### UX Design Decisions (from UX Design Phase, if applicable)
12
+ {{ux_decisions}}
13
+
14
+ ---
15
+
16
+ ## Mission
17
+
18
+ Building on the foundational architecture decisions, produce **detailed architecture decisions** covering authentication, error handling, testing strategy, and remaining architectural concerns. Do NOT repeat decisions from Step 1 — extend and complement them.
19
+
20
+ If UX Design decisions are provided above, use them to inform frontend framework selection, component library choices, and UI rendering approach.
21
+
22
+ ## Instructions
23
+
24
+ 1. **Extend the architecture with detailed decisions:**
25
+ - **Authentication/authorization**: Strategy and implementation approach
26
+ - **Error handling**: Strategy for errors, logging, monitoring
27
+ - **Testing strategy**: Unit/integration/E2E split, framework choices
28
+ - **Security**: Input validation, data protection, dependency management
29
+ - **Frontend (if applicable)**: Framework, component library, and rendering strategy — informed by UX design decisions if available
30
+
31
+ 2. **Build on foundational decisions:**
32
+ - Reference the system architecture and data storage choices from Step 1
33
+ - If UX decisions are present, align frontend architecture with the specified design system and component strategy
34
+ - Ensure new decisions are compatible with existing ones
35
+ - Don't contradict or repeat previous decisions
36
+
37
+ 3. **Be concrete:**
38
+ - "JWT with RS256 and 15-minute expiry" not "Use tokens"
39
+ - "Vitest with 80% coverage threshold" not "Write tests"
40
+ - Include rationale for each decision
41
+
42
+ ## Output Contract
43
+
44
+ Emit ONLY this YAML block as your final output — no other text.
45
+
46
+ **CRITICAL**: All string values MUST be quoted with double quotes.
47
+
48
+ ```yaml
49
+ result: success
50
+ architecture_decisions:
51
+ - category: "crosscutting"
52
+ key: "testing-strategy"
53
+ value: "Vitest for unit and integration, no E2E needed for CLI"
54
+ rationale: "Fast execution, native ESM support, compatible with TypeScript"
55
+ - category: "crosscutting"
56
+ key: "error-handling"
57
+ value: "Structured error types with error codes, stderr for errors"
58
+ rationale: "Machine-parseable errors enable automation and debugging"
59
+ - category: "crosscutting"
60
+ key: "logging"
61
+ value: "Structured JSON logging to stderr, configurable verbosity"
62
+ rationale: "Separates data output from diagnostic output"
63
+ ```
64
+
65
+ If you cannot produce valid output:
66
+
67
+ ```yaml
68
+ result: failed
69
+ ```