bmm-opencode 1.4.2 → 1.4.3

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 (126) hide show
  1. package/.opencode/agents/bmad-bmad-master.md +11 -0
  2. package/.opencode/agents/bmm-analyst.md +10 -32
  3. package/.opencode/agents/bmm-architect.md +6 -34
  4. package/.opencode/agents/bmm-dev.md +6 -32
  5. package/.opencode/agents/bmm-pm.md +10 -41
  6. package/.opencode/agents/bmm-qa.md +5 -31
  7. package/.opencode/agents/bmm-quick-flow-solo-dev.md +7 -32
  8. package/.opencode/agents/bmm-sm.md +8 -32
  9. package/.opencode/agents/bmm-tech-writer.md +12 -0
  10. package/.opencode/agents/bmm-ux-designer.md +5 -37
  11. package/.opencode/commands/bmad-bmm-check-implementation-readiness.md +7 -0
  12. package/.opencode/commands/bmad-bmm-code-review.md +7 -0
  13. package/.opencode/commands/bmad-bmm-correct-course.md +7 -0
  14. package/.opencode/commands/bmad-bmm-create-architecture.md +7 -0
  15. package/.opencode/commands/bmad-bmm-create-epics-and-stories.md +7 -0
  16. package/.opencode/commands/bmad-bmm-create-prd.md +7 -0
  17. package/.opencode/commands/bmad-bmm-create-product-brief.md +7 -0
  18. package/.opencode/commands/bmad-bmm-create-story.md +7 -0
  19. package/.opencode/commands/bmad-bmm-create-ux-design.md +7 -0
  20. package/.opencode/commands/bmad-bmm-dev-story.md +7 -0
  21. package/.opencode/commands/bmad-bmm-document-project.md +7 -0
  22. package/.opencode/commands/bmad-bmm-domain-research.md +7 -0
  23. package/.opencode/commands/bmad-bmm-edit-prd.md +7 -0
  24. package/.opencode/commands/bmad-bmm-generate-project-context.md +5 -0
  25. package/.opencode/commands/bmad-bmm-market-research.md +7 -0
  26. package/.opencode/commands/bmad-bmm-quick-dev.md +7 -0
  27. package/.opencode/commands/bmad-bmm-quick-spec.md +7 -0
  28. package/.opencode/commands/bmad-bmm-retrospective.md +7 -0
  29. package/.opencode/commands/bmad-bmm-sprint-planning.md +7 -0
  30. package/.opencode/commands/bmad-bmm-sprint-status.md +5 -0
  31. package/.opencode/commands/bmad-bmm-technical-research.md +7 -0
  32. package/.opencode/commands/bmad-bmm-validate-prd.md +7 -0
  33. package/.opencode/commands/bmad-brainstorming.md +7 -0
  34. package/.opencode/commands/bmad-editorial-review-prose.md +5 -0
  35. package/.opencode/commands/bmad-editorial-review-structure.md +5 -0
  36. package/.opencode/commands/bmad-help.md +5 -0
  37. package/.opencode/commands/bmad-index-docs.md +5 -0
  38. package/.opencode/commands/bmad-review-adversarial-general.md +5 -0
  39. package/.opencode/commands/bmad-shard-doc.md +5 -0
  40. package/.opencode/skills/bmad-bmad-master/SKILL.md +56 -0
  41. package/.opencode/skills/bmad-bmm-analyst/SKILL.md +65 -38
  42. package/.opencode/skills/bmad-bmm-architect/SKILL.md +49 -38
  43. package/.opencode/skills/bmad-bmm-check-implementation-readiness/SKILL.md +1092 -24
  44. package/.opencode/skills/bmad-bmm-code-review/SKILL.md +45 -13
  45. package/.opencode/skills/bmad-bmm-correct-course/SKILL.md +56 -94
  46. package/.opencode/skills/bmad-bmm-create-architecture/SKILL.md +2391 -27
  47. package/.opencode/skills/bmad-bmm-create-epics-and-stories/SKILL.md +927 -23
  48. package/.opencode/skills/bmad-bmm-create-prd/SKILL.md +9 -26
  49. package/.opencode/skills/bmad-bmm-create-product-brief/SKILL.md +1358 -22
  50. package/.opencode/skills/bmad-bmm-create-story/SKILL.md +61 -24
  51. package/.opencode/skills/bmad-bmm-create-ux-design/SKILL.md +3275 -26
  52. package/.opencode/skills/bmad-bmm-dev/SKILL.md +57 -43
  53. package/.opencode/skills/bmad-bmm-dev-story/SKILL.md +20 -13
  54. package/.opencode/skills/bmad-bmm-document-project/SKILL.md +22 -81
  55. package/.opencode/skills/bmad-bmm-domain-research/SKILL.md +53 -37
  56. package/.opencode/skills/bmad-bmm-edit-prd/SKILL.md +10 -27
  57. package/.opencode/skills/bmad-bmm-generate-project-context/SKILL.md +797 -28
  58. package/.opencode/skills/bmad-bmm-market-research/SKILL.md +53 -37
  59. package/.opencode/skills/bmad-bmm-pm/SKILL.md +60 -39
  60. package/.opencode/skills/bmad-bmm-qa/SKILL.md +77 -35
  61. package/.opencode/skills/bmad-bmm-qa-automate/SKILL.md +47 -129
  62. package/.opencode/skills/bmad-bmm-quick-dev/SKILL.md +802 -30
  63. package/.opencode/skills/bmad-bmm-quick-flow-solo-dev/SKILL.md +57 -36
  64. package/.opencode/skills/bmad-bmm-quick-spec/SKILL.md +684 -27
  65. package/.opencode/skills/bmad-bmm-retrospective/SKILL.md +55 -200
  66. package/.opencode/skills/bmad-bmm-sm/SKILL.md +57 -36
  67. package/.opencode/skills/bmad-bmm-sprint-planning/SKILL.md +51 -52
  68. package/.opencode/skills/bmad-bmm-sprint-status/SKILL.md +30 -99
  69. package/.opencode/skills/bmad-bmm-tech-writer/SKILL.md +70 -0
  70. package/.opencode/skills/bmad-bmm-technical-research/SKILL.md +53 -37
  71. package/.opencode/skills/bmad-bmm-ux-designer/SKILL.md +48 -37
  72. package/.opencode/skills/bmad-bmm-validate-prd/SKILL.md +10 -27
  73. package/.opencode/skills/bmad-brainstorming/SKILL.md +2048 -0
  74. package/.opencode/skills/bmad-editorial-review-prose/SKILL.md +107 -0
  75. package/.opencode/skills/bmad-editorial-review-structure/SKILL.md +214 -0
  76. package/.opencode/skills/bmad-help/SKILL.md +82 -0
  77. package/.opencode/skills/bmad-index-docs/SKILL.md +70 -0
  78. package/.opencode/skills/bmad-party-mode/SKILL.md +682 -0
  79. package/.opencode/skills/bmad-review-adversarial-general/SKILL.md +53 -0
  80. package/.opencode/skills/bmad-shard-doc/SKILL.md +113 -0
  81. package/README.md +28 -4
  82. package/dist/index.d.ts.map +1 -1
  83. package/dist/index.js +350 -47
  84. package/package.json +4 -3
  85. package/.opencode/agents/bmm-tech-writer-tech-writer.md +0 -44
  86. package/.opencode/agents/cis-brainstorming-coach.md +0 -38
  87. package/.opencode/agents/cis-creative-problem-solver.md +0 -38
  88. package/.opencode/agents/cis-design-thinking-coach.md +0 -38
  89. package/.opencode/agents/cis-innovation-strategist.md +0 -38
  90. package/.opencode/agents/cis-presentation-master.md +0 -54
  91. package/.opencode/agents/cis-storyteller-storyteller.md +0 -38
  92. package/.opencode/agents/core-bmad-master.md +0 -39
  93. package/.opencode/agents/gen-subagent.md +0 -311
  94. package/.opencode/agents/party-mode.md +0 -812
  95. package/.opencode/agents/tea-tea.md +0 -48
  96. package/.opencode/skills/bmad-bmm-dev-team-mode/SKILL.md +0 -300
  97. package/.opencode/skills/bmad-bmm-tech-writer-tech-writer/SKILL.md +0 -51
  98. package/.opencode/skills/bmad-cis-brainstorming-coach/SKILL.md +0 -46
  99. package/.opencode/skills/bmad-cis-creative-problem-solver/SKILL.md +0 -46
  100. package/.opencode/skills/bmad-cis-design-thinking/SKILL.md +0 -156
  101. package/.opencode/skills/bmad-cis-design-thinking-coach/SKILL.md +0 -46
  102. package/.opencode/skills/bmad-cis-innovation-strategist/SKILL.md +0 -46
  103. package/.opencode/skills/bmad-cis-innovation-strategy/SKILL.md +0 -238
  104. package/.opencode/skills/bmad-cis-presentation-master/SKILL.md +0 -52
  105. package/.opencode/skills/bmad-cis-problem-solving/SKILL.md +0 -212
  106. package/.opencode/skills/bmad-cis-storyteller-storyteller/SKILL.md +0 -48
  107. package/.opencode/skills/bmad-cis-storytelling/SKILL.md +0 -290
  108. package/.opencode/skills/bmad-core-bmad-master/SKILL.md +0 -48
  109. package/.opencode/skills/bmad-core-brainstorming/SKILL.md +0 -74
  110. package/.opencode/skills/bmad-core-party-mode/SKILL.md +0 -241
  111. package/.opencode/skills/bmad-core-task-editorial-review-prose/SKILL.md +0 -74
  112. package/.opencode/skills/bmad-core-task-editorial-review-structure/SKILL.md +0 -151
  113. package/.opencode/skills/bmad-core-task-help/SKILL.md +0 -100
  114. package/.opencode/skills/bmad-core-task-index-docs/SKILL.md +0 -46
  115. package/.opencode/skills/bmad-core-task-review-adversarial-general/SKILL.md +0 -36
  116. package/.opencode/skills/bmad-core-task-shard-doc/SKILL.md +0 -80
  117. package/.opencode/skills/bmad-tea-tea/SKILL.md +0 -57
  118. package/.opencode/skills/bmad-tea-teach-me-testing/SKILL.md +0 -106
  119. package/.opencode/skills/bmad-tea-testarch-atdd/SKILL.md +0 -62
  120. package/.opencode/skills/bmad-tea-testarch-automate/SKILL.md +0 -67
  121. package/.opencode/skills/bmad-tea-testarch-ci/SKILL.md +0 -62
  122. package/.opencode/skills/bmad-tea-testarch-framework/SKILL.md +0 -62
  123. package/.opencode/skills/bmad-tea-testarch-nfr/SKILL.md +0 -60
  124. package/.opencode/skills/bmad-tea-testarch-test-design/SKILL.md +0 -76
  125. package/.opencode/skills/bmad-tea-testarch-test-review/SKILL.md +0 -60
  126. package/.opencode/skills/bmad-tea-testarch-trace/SKILL.md +0 -60
@@ -1,25 +1,8 @@
1
1
  ---
2
2
  name: bmad-bmm-create-architecture
3
3
  description: "Collaborative architectural decision facilitation for AI-agent consistency. Replaces template-driven architecture with intelligent, adaptive conversation that produces a decision-focused architecture document optimized for preventing agent conflicts."
4
- license: MIT
5
- compatibility: opencode
6
- metadata:
7
- source: "bmad-method"
8
- module: "bmm"
9
- workflow: "create-architecture"
10
- standalone: false
11
4
  ---
12
5
 
13
- # create-architecture Workflow
14
-
15
- Collaborative architectural decision facilitation for AI-agent consistency. Replaces template-driven architecture with intelligent, adaptive conversation that produces a decision-focused architecture document optimized for preventing agent conflicts.
16
-
17
- ## How to Use
18
-
19
- This skill provides a structured workflow. Follow the steps below:
20
-
21
- ## Instructions
22
-
23
6
  # Architecture Workflow
24
7
 
25
8
  **Goal:** Create comprehensive architecture decisions through collaborative step-by-step discovery that ensures AI agents implement consistently.
@@ -44,23 +27,2404 @@ This uses **micro-file architecture** for disciplined execution:
44
27
 
45
28
  ### Configuration Loading
46
29
 
47
- Load config from `{project-root}/_bmad/bmm/config.yaml` and resolve:
30
+ Load config from `{project-root}/_bmad/bmm/config.yaml` and resolve:
48
31
 
49
- - `project_name`, `output_folder`, `planning_artifacts`, `user_name`
50
- - `communication_language`, `document_output_language`, `user_skill_level`
51
- - `date` as system-generated current datetime
52
- - ✅ YOU MUST ALWAYS SPEAK OUTPUT In your Agent communication style with the config `{communication_language}`
32
+ - `project_name`, `output_folder`, `planning_artifacts`, `user_name`
33
+ - `communication_language`, `document_output_language`, `user_skill_level`
34
+ - `date` as system-generated current datetime
35
+ - ✅ YOU MUST ALWAYS SPEAK OUTPUT In your Agent communication style with the config `{communication_language}`
53
36
 
54
37
  ### Paths
55
38
 
56
- - `installed_path` = `{project-root}/_bmad/bmm/workflows/3-solutioning/architecture`
57
- - `template_path` = `{installed_path}/architecture-decision-template.md`
58
- - `data_files_path` = `{installed_path}/data/`
39
+ - `installed_path` = `{project-root}/_bmad/bmm/workflows/3-solutioning/architecture`
40
+ - `template_path` = `{installed_path}/architecture-decision-template.md`
41
+ - `data_files_path` = `{installed_path}/data/`
59
42
 
60
43
  ---
61
44
 
62
45
  ## EXECUTION
63
46
 
64
- Read fully and follow: `steps/step-01-init.md` to begin the workflow.
47
+ Read fully and follow: `steps/step-01-init.md` to begin the workflow.
48
+
49
+ **Note:** Input document discovery and all initialization protocols are handled in step-01-init.md.
50
+
51
+ # Step 1: Architecture Workflow Initialization
52
+
53
+ ## MANDATORY EXECUTION RULES (READ FIRST):
54
+
55
+ - 🛑 NEVER generate content without user input
56
+ - 📖 CRITICAL: ALWAYS read the complete step file before taking any action - partial understanding leads to incomplete decisions
57
+ - 🔄 CRITICAL: When loading next step with 'C', ensure the entire file is read and understood before proceeding
58
+ - ✅ ALWAYS treat this as collaborative discovery between architectural peers
59
+ - 📋 YOU ARE A FACILITATOR, not a content generator
60
+ - 💬 FOCUS on initialization and setup only - don't look ahead to future steps
61
+ - 🚪 DETECT existing workflow state and handle continuation properly
62
+ - ⚠️ ABSOLUTELY NO TIME ESTIMATES - AI development speed has fundamentally changed
63
+ - ✅ YOU MUST ALWAYS SPEAK OUTPUT In your Agent communication style with the config `{communication_language}`
64
+
65
+ ## EXECUTION PROTOCOLS:
66
+
67
+ - 🎯 Show your analysis before taking any action
68
+ - 💾 Initialize document and update frontmatter
69
+ - 📖 Set up frontmatter `stepsCompleted: [1]` before loading next step
70
+ - 🚫 FORBIDDEN to load next step until setup is complete
71
+
72
+ ## CONTEXT BOUNDARIES:
73
+
74
+ - Variables from workflow.md are available in memory
75
+ - Previous context = what's in output document + frontmatter
76
+ - Don't assume knowledge from other steps
77
+ - Input document discovery happens in this step
78
+
79
+ ## YOUR TASK:
80
+
81
+ Initialize the Architecture workflow by detecting continuation state, discovering input documents, and setting up the document for collaborative architectural decision making.
82
+
83
+ ## INITIALIZATION SEQUENCE:
84
+
85
+ ### 1. Check for Existing Workflow
86
+
87
+ First, check if the output document already exists:
88
+
89
+ - Look for existing {planning_artifacts}/`*architecture*.md`
90
+ - If exists, read the complete file(s) including frontmatter
91
+ - If not exists, this is a fresh workflow
92
+
93
+ ### 2. Handle Continuation (If Document Exists)
94
+
95
+ If the document exists and has frontmatter with `stepsCompleted`:
96
+
97
+ - **STOP here** and load `./step-01b-continue.md` immediately
98
+ - Do not proceed with any initialization tasks
99
+ - Let step-01b handle the continuation logic
100
+
101
+ ### 3. Fresh Workflow Setup (If No Document)
102
+
103
+ If no document exists or no `stepsCompleted` in frontmatter:
104
+
105
+ #### A. Input Document Discovery
106
+
107
+ Discover and load context documents using smart discovery. Documents can be in the following locations:
108
+ - {planning_artifacts}/**
109
+ - {output_folder}/**
110
+ - {product_knowledge}/**
111
+ - docs/**
112
+
113
+ Also - when searching - documents can be a single markdown file, or a folder with an index and multiple files. For Example, if searching for `*foo*.md` and not found, also search for a folder called *foo*/index.md (which indicates sharded content)
114
+
115
+ Try to discover the following:
116
+ - Product Brief (`*brief*.md`)
117
+ - Product Requirements Document (`*prd*.md`)
118
+ - UX Design (`*ux-design*.md`) and other
119
+ - Research Documents (`*research*.md`)
120
+ - Project Documentation (generally multiple documents might be found for this in the `{product_knowledge}` or `docs` folder.)
121
+ - Project Context (`**/project-context.md`)
122
+
123
+ <critical>Confirm what you have found with the user, along with asking if the user wants to provide anything else. Only after this confirmation will you proceed to follow the loading rules</critical>
124
+
125
+ **Loading Rules:**
126
+
127
+ - Load ALL discovered files completely that the user confirmed or provided (no offset/limit)
128
+ - If there is a project context, whatever is relevant should try to be biased in the remainder of this whole workflow process
129
+ - For sharded folders, load ALL files to get complete picture, using the index first to potentially know the potential of each document
130
+ - index.md is a guide to what's relevant whenever available
131
+ - Track all successfully loaded files in frontmatter `inputDocuments` array
132
+
133
+ #### B. Validate Required Inputs
134
+
135
+ Before proceeding, verify we have the essential inputs:
136
+
137
+ **PRD Validation:**
138
+
139
+ - If no PRD found: "Architecture requires a PRD to work from. Please run the PRD workflow first or provide the PRD file path."
140
+ - Do NOT proceed without PRD
141
+
142
+ **Other Input that might exist:**
143
+
144
+ - UX Spec: "Provides UI/UX architectural requirements"
145
+
146
+ #### C. Create Initial Document
147
+
148
+ Copy the template from `{installed_path}/architecture-decision-template.md` to `{planning_artifacts}/architecture.md`
149
+
150
+ #### D. Complete Initialization and Report
151
+
152
+ Complete setup and report to user:
153
+
154
+ **Document Setup:**
155
+
156
+ - Created: `{planning_artifacts}/architecture.md` from template
157
+ - Initialized frontmatter with workflow state
158
+
159
+ **Input Documents Discovered:**
160
+ Report what was found:
161
+ "Welcome {{user_name}}! I've set up your Architecture workspace for {{project_name}}.
162
+
163
+ **Documents Found:**
164
+
165
+ - PRD: {number of PRD files loaded or "None found - REQUIRED"}
166
+ - UX Design: {number of UX files loaded or "None found"}
167
+ - Research: {number of research files loaded or "None found"}
168
+ - Project docs: {number of project files loaded or "None found"}
169
+ - Project context: {project_context_rules count of rules for AI agents found}
170
+
171
+ **Files loaded:** {list of specific file names or "No additional documents found"}
172
+
173
+ Ready to begin architectural decision making. Do you have any other documents you'd like me to include?
174
+
175
+ [C] Continue to project context analysis
176
+
177
+ ## SUCCESS METRICS:
178
+
179
+ ✅ Existing workflow detected and handed off to step-01b correctly
180
+ ✅ Fresh workflow initialized with template and frontmatter
181
+ ✅ Input documents discovered and loaded using sharded-first logic
182
+ ✅ All discovered files tracked in frontmatter `inputDocuments`
183
+ ✅ PRD requirement validated and communicated
184
+ ✅ User confirmed document setup and can proceed
185
+
186
+ ## FAILURE MODES:
187
+
188
+ ❌ Proceeding with fresh initialization when existing workflow exists
189
+ ❌ Not updating frontmatter with discovered input documents
190
+ ❌ Creating document without proper template
191
+ ❌ Not checking sharded folders first before whole files
192
+ ❌ Not reporting what documents were found to user
193
+ ❌ Proceeding without validating PRD requirement
194
+
195
+ ❌ **CRITICAL**: Reading only partial step file - leads to incomplete understanding and poor decisions
196
+ ❌ **CRITICAL**: Proceeding with 'C' without fully reading and understanding the next step file
197
+ ❌ **CRITICAL**: Making decisions without complete understanding of step requirements and protocols
198
+
199
+ ## NEXT STEP:
200
+
201
+ After user selects [C] to continue, only after ensuring all the template output has been created, then load `./step-02-context.md` to analyze the project context and begin architectural decision making.
202
+
203
+ Remember: Do NOT proceed to step-02 until user explicitly selects [C] from the menu and setup is confirmed!
204
+
205
+
206
+ # Step 1b: Workflow Continuation Handler
207
+
208
+ ## MANDATORY EXECUTION RULES (READ FIRST):
209
+
210
+ - 🛑 NEVER generate content without user input
211
+
212
+ - 📖 CRITICAL: ALWAYS read the complete step file before taking any action - partial understanding leads to incomplete decisions
213
+ - 🔄 CRITICAL: When loading next step with 'C', ensure the entire file is read and understood before proceeding
214
+ - ✅ ALWAYS treat this as collaborative discovery between architectural peers
215
+ - 📋 YOU ARE A FACILITATOR, not a content generator
216
+ - 💬 FOCUS on understanding current state and getting user confirmation
217
+ - 🚪 HANDLE workflow resumption smoothly and transparently
218
+ - ⚠️ ABSOLUTELY NO TIME ESTIMATES - AI development speed has fundamentally changed
219
+ - ✅ YOU MUST ALWAYS SPEAK OUTPUT In your Agent communication style with the config `{communication_language}`
220
+
221
+ ## EXECUTION PROTOCOLS:
222
+
223
+ - 🎯 Show your analysis before taking any action
224
+ - 📖 Read existing document completely to understand current state
225
+ - 💾 Update frontmatter to reflect continuation
226
+ - 🚫 FORBIDDEN to proceed to next step without user confirmation
227
+
228
+ ## CONTEXT BOUNDARIES:
229
+
230
+ - Existing document and frontmatter are available
231
+ - Input documents already loaded should be in frontmatter `inputDocuments`
232
+ - Steps already completed are in `stepsCompleted` array
233
+ - Focus on understanding where we left off
234
+
235
+ ## YOUR TASK:
236
+
237
+ Handle workflow continuation by analyzing existing work and guiding the user to resume at the appropriate step.
238
+
239
+ ## CONTINUATION SEQUENCE:
240
+
241
+ ### 1. Analyze Current Document State
242
+
243
+ Read the existing architecture document completely and analyze:
244
+
245
+ **Frontmatter Analysis:**
246
+
247
+ - `stepsCompleted`: What steps have been done
248
+ - `inputDocuments`: What documents were loaded
249
+ - `lastStep`: Last step that was executed
250
+ - `project_name`, `user_name`, `date`: Basic context
251
+
252
+ **Content Analysis:**
253
+
254
+ - What sections exist in the document
255
+ - What architectural decisions have been made
256
+ - What appears incomplete or in progress
257
+ - Any TODOs or placeholders remaining
258
+
259
+ ### 2. Present Continuation Summary
260
+
261
+ Show the user their current progress:
262
+
263
+ "Welcome back {{user_name}}! I found your Architecture work for {{project_name}}.
264
+
265
+ **Current Progress:**
266
+
267
+ - Steps completed: {{stepsCompleted list}}
268
+ - Last step worked on: Step {{lastStep}}
269
+ - Input documents loaded: {{number of inputDocuments}} files
270
+
271
+ **Document Sections Found:**
272
+ {list all H2/H3 sections found in the document}
273
+
274
+ {if_incomplete_sections}
275
+ **Incomplete Areas:**
276
+
277
+ - {areas that appear incomplete or have placeholders}
278
+ {/if_incomplete_sections}
279
+
280
+ **What would you like to do?**
281
+ [R] Resume from where we left off
282
+ [C] Continue to next logical step
283
+ [O] Overview of all remaining steps
284
+ [X] Start over (will overwrite existing work)
285
+ "
286
+
287
+ ### 3. Handle User Choice
288
+
289
+ #### If 'R' (Resume from where we left off):
290
+
291
+ - Identify the next step based on `stepsCompleted`
292
+ - Load the appropriate step file to continue
293
+ - Example: If `stepsCompleted: [1, 2, 3]`, load `step-04-decisions.md`
294
+
295
+ #### If 'C' (Continue to next logical step):
296
+
297
+ - Analyze the document content to determine logical next step
298
+ - May need to review content quality and completeness
299
+ - If content seems complete for current step, advance to next
300
+ - If content seems incomplete, suggest staying on current step
301
+
302
+ #### If 'O' (Overview of all remaining steps):
303
+
304
+ - Provide brief description of all remaining steps
305
+ - Let user choose which step to work on
306
+ - Don't assume sequential progression is always best
307
+
308
+ #### If 'X' (Start over):
309
+
310
+ - Confirm: "This will delete all existing architectural decisions. Are you sure? (y/n)"
311
+ - If confirmed: Delete existing document and return to step-01-init.md
312
+ - If not confirmed: Return to continuation menu
313
+
314
+ ### 4. Navigate to Selected Step
315
+
316
+ After user makes choice:
317
+
318
+ **Load the selected step file:**
319
+
320
+ - Update frontmatter `lastStep` to reflect current navigation
321
+ - Execute the selected step file
322
+ - Let that step handle the detailed continuation logic
323
+
324
+ **State Preservation:**
325
+
326
+ - Maintain all existing content in the document
327
+ - Keep `stepsCompleted` accurate
328
+ - Track the resumption in workflow status
329
+
330
+ ### 5. Special Continuation Cases
331
+
332
+ #### If `stepsCompleted` is empty but document has content:
333
+
334
+ - This suggests an interrupted workflow
335
+ - Ask user: "I see the document has content but no steps are marked as complete. Should I analyze what's here and set the appropriate step status?"
336
+
337
+ #### If document appears corrupted or incomplete:
338
+
339
+ - Ask user: "The document seems incomplete. Would you like me to try to recover what's here, or would you prefer to start fresh?"
340
+
341
+ #### If document is complete but workflow not marked as done:
342
+
343
+ - Ask user: "The architecture looks complete! Should I mark this workflow as finished, or is there more you'd like to work on?"
344
+
345
+ ## SUCCESS METRICS:
346
+
347
+ ✅ Existing document state properly analyzed and understood
348
+ ✅ User presented with clear continuation options
349
+ ✅ User choice handled appropriately and transparently
350
+ ✅ Workflow state preserved and updated correctly
351
+ ✅ Navigation to appropriate step handled smoothly
352
+
353
+ ## FAILURE MODES:
354
+
355
+ ❌ Not reading the complete existing document before making suggestions
356
+ ❌ Losing track of what steps were actually completed
357
+ ❌ Automatically proceeding without user confirmation of next steps
358
+ ❌ Not checking for incomplete or placeholder content
359
+ ❌ Losing existing document content during resumption
360
+
361
+ ❌ **CRITICAL**: Reading only partial step file - leads to incomplete understanding and poor decisions
362
+ ❌ **CRITICAL**: Proceeding with 'C' without fully reading and understanding the next step file
363
+ ❌ **CRITICAL**: Making decisions without complete understanding of step requirements and protocols
364
+
365
+ ## NEXT STEP:
366
+
367
+ After user selects their continuation option, load the appropriate step file based on their choice. The step file will handle the detailed work from that point forward.
368
+
369
+ Remember: The goal is smooth, transparent resumption that respects the work already done while giving the user control over how to proceed.
370
+
371
+
372
+ # Step 2: Project Context Analysis
373
+
374
+ ## MANDATORY EXECUTION RULES (READ FIRST):
375
+
376
+ - 🛑 NEVER generate content without user input
377
+
378
+ - 📖 CRITICAL: ALWAYS read the complete step file before taking any action - partial understanding leads to incomplete decisions
379
+ - 🔄 CRITICAL: When loading next step with 'C', ensure the entire file is read and understood before proceeding
380
+ - ✅ ALWAYS treat this as collaborative discovery between architectural peers
381
+ - 📋 YOU ARE A FACILITATOR, not a content generator
382
+ - 💬 FOCUS on understanding project scope and requirements for architecture
383
+ - 🎯 ANALYZE loaded documents, don't assume or generate requirements
384
+ - ⚠️ ABSOLUTELY NO TIME ESTIMATES - AI development speed has fundamentally changed
385
+ - ✅ YOU MUST ALWAYS SPEAK OUTPUT In your Agent communication style with the config `{communication_language}`
386
+
387
+ ## EXECUTION PROTOCOLS:
388
+
389
+ - 🎯 Show your analysis before taking any action
390
+ - ⚠️ Present A/P/C menu after generating project context analysis
391
+ - 💾 ONLY save when user chooses C (Continue)
392
+ - 📖 Update frontmatter `stepsCompleted: [1, 2]` before loading next step
393
+ - 🚫 FORBIDDEN to load next step until C is selected
394
+
395
+ ## COLLABORATION MENUS (A/P/C):
396
+
397
+ This step will generate content and present choices:
398
+
399
+ - **A (Advanced Elicitation)**: Use discovery protocols to develop deeper insights about project context and architectural implications
400
+ - **P (Party Mode)**: Bring multiple perspectives to analyze project requirements from different architectural angles
401
+ - **C (Continue)**: Save the content to the document and proceed to next step
402
+
403
+ ## PROTOCOL INTEGRATION:
404
+
405
+ - When 'A' selected: Read fully and follow: {project-root}/_bmad/core/workflows/advanced-elicitation/workflow.xml
406
+ - When 'P' selected: Read fully and follow: {project-root}/_bmad/core/workflows/party-mode/workflow.md
407
+ - PROTOCOLS always return to display this step's A/P/C menu after the A or P have completed
408
+ - User accepts/rejects protocol changes before proceeding
409
+
410
+ ## CONTEXT BOUNDARIES:
411
+
412
+ - Current document and frontmatter from step 1 are available
413
+ - Input documents already loaded are in memory (PRD, epics, UX spec, etc.)
414
+ - Focus on architectural implications of requirements
415
+ - No technology decisions yet - pure analysis phase
416
+
417
+ ## YOUR TASK:
418
+
419
+ Fully read and Analyze the loaded project documents to understand architectural scope, requirements, and constraints before beginning decision making.
420
+
421
+ ## CONTEXT ANALYSIS SEQUENCE:
422
+
423
+ ### 1. Review Project Requirements
424
+
425
+ **From PRD Analysis:**
426
+
427
+ - Extract and analyze Functional Requirements (FRs)
428
+ - Identify Non-Functional Requirements (NFRs) like performance, security, compliance
429
+ - Note any technical constraints or dependencies mentioned
430
+ - Count and categorize requirements to understand project scale
431
+
432
+ **From Epics/Stories (if available):**
433
+
434
+ - Map epic structure and user stories to architectural components
435
+ - Extract acceptance criteria for technical implications
436
+ - Identify cross-cutting concerns that span multiple epics
437
+ - Estimate story complexity for architectural planning
438
+
439
+ **From UX Design (if available):**
440
+
441
+ - Extract architectural implications from UX requirements:
442
+ - Component complexity (simple forms vs rich interactions)
443
+ - Animation/transition requirements
444
+ - Real-time update needs (live data, collaborative features)
445
+ - Platform-specific UI requirements
446
+ - Accessibility standards (WCAG compliance level)
447
+ - Responsive design breakpoints
448
+ - Offline capability requirements
449
+ - Performance expectations (load times, interaction responsiveness)
450
+
451
+ ### 2. Project Scale Assessment
452
+
453
+ Calculate and present project complexity:
454
+
455
+ **Complexity Indicators:**
456
+
457
+ - Real-time features requirements
458
+ - Multi-tenancy needs
459
+ - Regulatory compliance requirements
460
+ - Integration complexity
461
+ - User interaction complexity
462
+ - Data complexity and volume
463
+
464
+ ### 3. Reflect Understanding
465
+
466
+ Present your analysis back to user for validation:
467
+
468
+ "I'm reviewing your project documentation for {{project_name}}.
469
+
470
+ {if_epics_loaded}I see {{epic_count}} epics with {{story_count}} total stories.{/if_epics_loaded}
471
+ {if_no_epics}I found {{fr_count}} functional requirements organized into {{fr_category_list}}.{/if_no_epics}
472
+ {if_ux_loaded}I also found your UX specification which defines the user experience requirements.{/if_ux_loaded}
473
+
474
+ **Key architectural aspects I notice:**
475
+
476
+ - [Summarize core functionality from FRs]
477
+ - [Note critical NFRs that will shape architecture]
478
+ - {if_ux_loaded}[Note UX complexity and technical requirements]{/if_ux_loaded}
479
+ - [Identify unique technical challenges or constraints]
480
+ - [Highlight any regulatory or compliance requirements]
481
+
482
+ **Scale indicators:**
483
+
484
+ - Project complexity appears to be: [low/medium/high/enterprise]
485
+ - Primary technical domain: [web/mobile/api/backend/full-stack/etc]
486
+ - Cross-cutting concerns identified: [list major ones]
487
+
488
+ This analysis will help me guide you through the architectural decisions needed to ensure AI agents implement this consistently.
489
+
490
+ Does this match your understanding of the project scope and requirements?"
491
+
492
+ ### 4. Generate Project Context Content
493
+
494
+ Prepare the content to append to the document:
495
+
496
+ #### Content Structure:
497
+
498
+ ```markdown
499
+ ## Project Context Analysis
500
+
501
+ ### Requirements Overview
502
+
503
+ **Functional Requirements:**
504
+ {{analysis of FRs and what they mean architecturally}}
505
+
506
+ **Non-Functional Requirements:**
507
+ {{NFRs that will drive architectural decisions}}
508
+
509
+ **Scale & Complexity:**
510
+ {{project_scale_assessment}}
511
+
512
+ - Primary domain: {{technical_domain}}
513
+ - Complexity level: {{complexity_level}}
514
+ - Estimated architectural components: {{component_count}}
515
+
516
+ ### Technical Constraints & Dependencies
517
+
518
+ {{known_constraints_dependencies}}
519
+
520
+ ### Cross-Cutting Concerns Identified
521
+
522
+ {{concerns_that_will_affect_multiple_components}}
523
+ ```
524
+
525
+ ### 5. Present Content and Menu
526
+
527
+ Show the generated content and present choices:
528
+
529
+ "I've drafted the Project Context Analysis based on your requirements. This sets the foundation for our architectural decisions.
530
+
531
+ **Here's what I'll add to the document:**
532
+
533
+ [Show the complete markdown content from step 4]
534
+
535
+ **What would you like to do?**
536
+ [A] Advanced Elicitation - Let's dive deeper into architectural implications
537
+ [P] Party Mode - Bring different perspectives to analyze requirements
538
+ [C] Continue - Save this analysis and begin architectural decisions"
539
+
540
+ ### 6. Handle Menu Selection
541
+
542
+ #### If 'A' (Advanced Elicitation):
543
+
544
+ - Read fully and follow: {project-root}/_bmad/core/workflows/advanced-elicitation/workflow.xml with the current context analysis
545
+ - Process the enhanced architectural insights that come back
546
+ - Ask user: "Accept these enhancements to the project context analysis? (y/n)"
547
+ - If yes: Update content with improvements, then return to A/P/C menu
548
+ - If no: Keep original content, then return to A/P/C menu
549
+
550
+ #### If 'P' (Party Mode):
551
+
552
+ - Read fully and follow: {project-root}/_bmad/core/workflows/party-mode/workflow.md with the current project context
553
+ - Process the collaborative improvements to architectural understanding
554
+ - Ask user: "Accept these changes to the project context analysis? (y/n)"
555
+ - If yes: Update content with improvements, then return to A/P/C menu
556
+ - If no: Keep original content, then return to A/P/C menu
557
+
558
+ #### If 'C' (Continue):
559
+
560
+ - Append the final content to `{planning_artifacts}/architecture.md`
561
+ - Update frontmatter: `stepsCompleted: [1, 2]`
562
+ - Load `./step-03-starter.md`
563
+
564
+ ## APPEND TO DOCUMENT:
565
+
566
+ When user selects 'C', append the content directly to the document using the structure from step 4.
567
+
568
+ ## SUCCESS METRICS:
569
+
570
+ ✅ All input documents thoroughly analyzed for architectural implications
571
+ ✅ Project scope and complexity clearly assessed and validated
572
+ ✅ Technical constraints and dependencies identified
573
+ ✅ Cross-cutting concerns mapped for architectural planning
574
+ ✅ User confirmation of project understanding
575
+ ✅ A/P/C menu presented and handled correctly
576
+ ✅ Content properly appended to document when C selected
577
+
578
+ ## FAILURE MODES:
579
+
580
+ ❌ Skimming documents without deep architectural analysis
581
+ ❌ Missing or misinterpreting critical NFRs
582
+ ❌ Not validating project understanding with user
583
+ ❌ Underestimating complexity indicators
584
+ ❌ Generating content without real analysis of loaded documents
585
+ ❌ Not presenting A/P/C menu after content generation
586
+
587
+ ❌ **CRITICAL**: Reading only partial step file - leads to incomplete understanding and poor decisions
588
+ ❌ **CRITICAL**: Proceeding with 'C' without fully reading and understanding the next step file
589
+ ❌ **CRITICAL**: Making decisions without complete understanding of step requirements and protocols
590
+
591
+ ## NEXT STEP:
592
+
593
+ After user selects 'C' and content is saved to document, load `./step-03-starter.md` to evaluate starter template options.
594
+
595
+ Remember: Do NOT proceed to step-03 until user explicitly selects 'C' from the A/P/C menu and content is saved!
596
+
597
+
598
+ # Step 3: Starter Template Evaluation
599
+
600
+ ## MANDATORY EXECUTION RULES (READ FIRST):
601
+
602
+ - 🛑 NEVER generate content without user input
603
+ - ✅ ALWAYS treat this as collaborative discovery between architectural peers
604
+ - 📋 YOU ARE A FACILITATOR, not a content generator
605
+ - 💬 FOCUS on evaluating starter template options with current versions
606
+ - 🌐 ALWAYS search the web to verify current versions - NEVER trust hardcoded versions
607
+ - ⚠️ ABSOLUTELY NO TIME ESTIMATES - AI development speed has fundamentally changed
608
+ - 📖 CRITICAL: ALWAYS read the complete step file before taking any action - partial understanding leads to incomplete architecture
609
+ - 🔄 CRITICAL: When loading next step with 'C', ensure the entire file is read and understood before proceeding
610
+ - ✅ YOU MUST ALWAYS SPEAK OUTPUT In your Agent communication style with the config `{communication_language}`
611
+
612
+ ## EXECUTION PROTOCOLS:
613
+
614
+ - 🎯 Show your analysis before taking any action
615
+ - 🌐 Search the web to verify current versions and options
616
+ - ⚠️ Present A/P/C menu after generating starter template analysis
617
+ - 💾 ONLY save when user chooses C (Continue)
618
+ - 📖 Update frontmatter `stepsCompleted: [1, 2, 3]` before loading next step
619
+ - 🚫 FORBIDDEN to load next step until C is selected
620
+
621
+ ## COLLABORATION MENUS (A/P/C):
622
+
623
+ This step will generate content and present choices:
624
+
625
+ - **A (Advanced Elicitation)**: Use discovery protocols to explore unconventional starter options or custom approaches
626
+ - **P (Party Mode)**: Bring multiple perspectives to evaluate starter trade-offs for different use cases
627
+ - **C (Continue)**: Save the content to the document and proceed to next step
628
+
629
+ ## PROTOCOL INTEGRATION:
630
+
631
+ - When 'A' selected: Read fully and follow: {project-root}/_bmad/core/workflows/advanced-elicitation/workflow.xml
632
+ - When 'P' selected: Read fully and follow: {project-root}/_bmad/core/workflows/party-mode/workflow.md
633
+ - PROTOCOLS always return to display this step's A/P/C menu after the A or P have completed
634
+ - User accepts/rejects protocol changes before proceeding
635
+
636
+ ## CONTEXT BOUNDARIES:
637
+
638
+ - Project context from step 2 is available and complete
639
+ - Project context file from step-01 may contain technical preferences
640
+ - No architectural decisions made yet - evaluating foundations
641
+ - Focus on technical preferences discovery and starter evaluation
642
+ - Consider project requirements and existing preferences when evaluating options
643
+
644
+ ## YOUR TASK:
645
+
646
+ Discover technical preferences and evaluate starter template options, leveraging existing technical preferences and establishing solid architectural foundations.
647
+
648
+ ## STARTER EVALUATION SEQUENCE:
649
+
650
+ ### 0. Check Technical Preferences & Context
651
+
652
+ **Check Project Context for Existing Technical Preferences:**
653
+ "Before we dive into starter templates, let me check if you have any technical preferences already documented.
654
+
655
+ {{if_project_context_exists}}
656
+ I found some technical rules in your project context file:
657
+ {{extracted_technical_preferences_from_project_context}}
658
+
659
+ **Project Context Technical Rules Found:**
660
+
661
+ - Languages/Frameworks: {{languages_frameworks_from_context}}
662
+ - Tools & Libraries: {{tools_from_context}}
663
+ - Development Patterns: {{patterns_from_context}}
664
+ - Platform Preferences: {{platforms_from_context}}
665
+
666
+ {{else}}
667
+ No existing technical preferences found in project context file. We'll establish your technical preferences now.
668
+ {{/if_project_context}}"
669
+
670
+ **Discover User Technical Preferences:**
671
+ "Based on your project context, let's discuss your technical preferences:
672
+
673
+ {{primary_technology_category}} Preferences:
674
+
675
+ - **Languages**: Do you have preferences between TypeScript/JavaScript, Python, Go, Rust, etc.?
676
+ - **Frameworks**: Any existing familiarity or preferences (React, Vue, Angular, Next.js, etc.)?
677
+ - **Databases**: Any preferences or existing infrastructure (PostgreSQL, MongoDB, MySQL, etc.)?
678
+
679
+ **Development Experience:**
680
+
681
+ - What's your team's experience level with different technologies?
682
+ - Are there any technologies you want to learn vs. what you're comfortable with?
683
+
684
+ **Platform/Deployment Preferences:**
685
+
686
+ - Cloud provider preferences (AWS, Vercel, Railway, etc.)?
687
+ - Container preferences (Docker, Serverless, Traditional)?
688
+
689
+ **Integrations:**
690
+
691
+ - Any existing systems or APIs you need to integrate with?
692
+ - Third-party services you plan to use (payment, authentication, analytics, etc.)?
693
+
694
+ These preferences will help me recommend the most suitable starter templates and guide our architectural decisions."
695
+
696
+ ### 1. Identify Primary Technology Domain
697
+
698
+ Based on project context analysis and technical preferences, identify the primary technology stack:
699
+
700
+ - **Web application** → Look for Next.js, Vite, Remix, SvelteKit starters
701
+ - **Mobile app** → Look for React Native, Expo, Flutter starters
702
+ - **API/Backend** → Look for NestJS, Express, Fastify, Supabase starters
703
+ - **CLI tool** → Look for CLI framework starters (oclif, commander, etc.)
704
+ - **Full-stack** → Look for T3, RedwoodJS, Blitz, Next.js starters
705
+ - **Desktop** → Look for Electron, Tauri starters
706
+
707
+ ### 2. UX Requirements Consideration
708
+
709
+ If UX specification was loaded, consider UX requirements when selecting starter:
710
+
711
+ - **Rich animations** → Framer Motion compatible starter
712
+ - **Complex forms** → React Hook Form included starter
713
+ - **Real-time features** → Socket.io or WebSocket ready starter
714
+ - **Design system** → Storybook-enabled starter
715
+ - **Offline capability** → Service worker or PWA configured starter
716
+
717
+ ### 3. Research Current Starter Options
718
+
719
+ Search the web to find current, maintained starter templates:
720
+
721
+ ```
722
+ Search the web: "{{primary_technology}} starter template CLI create command latest"
723
+ Search the web: "{{primary_technology}} boilerplate generator latest options"
724
+ Search the web: "{{primary_technology}} production-ready starter best practices"
725
+ ```
726
+
727
+ ### 4. Investigate Top Starter Options
728
+
729
+ For each promising starter found, investigate details:
730
+
731
+ ```
732
+ Search the web: "{{starter_name}} default setup technologies included latest"
733
+ Search the web: "{{starter_name}} project structure file organization"
734
+ Search the web: "{{starter_name}} production deployment capabilities"
735
+ Search the web: "{{starter_name}} recent updates maintenance status"
736
+ ```
737
+
738
+ ### 5. Analyze What Each Starter Provides
739
+
740
+ For each viable starter option, document:
741
+
742
+ **Technology Decisions Made:**
743
+
744
+ - Language/TypeScript configuration
745
+ - Styling solution (CSS, Tailwind, Styled Components, etc.)
746
+ - Testing framework setup
747
+ - Linting/Formatting configuration
748
+ - Build tooling and optimization
749
+ - Project structure and organization
750
+
751
+ **Architectural Patterns Established:**
752
+
753
+ - Code organization patterns
754
+ - Component structure conventions
755
+ - API layering approach
756
+ - State management setup
757
+ - Routing patterns
758
+ - Environment configuration
759
+
760
+ **Development Experience Features:**
761
+
762
+ - Hot reloading and development server
763
+ - TypeScript configuration
764
+ - Debugging setup
765
+ - Testing infrastructure
766
+ - Documentation generation
767
+
768
+ ### 6. Present Starter Options
769
+
770
+ Based on user skill level and project needs:
771
+
772
+ **For Expert Users:**
773
+ "Found {{starter_name}} which provides:
774
+ {{quick_decision_list_of_key_decisions}}
775
+
776
+ This would establish our base architecture with these technical decisions already made. Use it?"
777
+
778
+ **For Intermediate Users:**
779
+ "I found {{starter_name}}, which is a well-maintained starter for {{project_type}} projects.
780
+
781
+ It makes these architectural decisions for us:
782
+ {{decision_list_with_explanations}}
783
+
784
+ This gives us a solid foundation following current best practices. Should we use it?"
785
+
786
+ **For Beginner Users:**
787
+ "I found {{starter_name}}, which is like a pre-built foundation for your project.
788
+
789
+ Think of it like buying a prefab house frame instead of cutting each board yourself.
790
+
791
+ It makes these decisions for us:
792
+ {{friendly_explanation_of_decisions}}
793
+
794
+ This is a great starting point that follows best practices and saves us from making dozens of small technical choices. Should we use it?"
795
+
796
+ ### 7. Get Current CLI Commands
797
+
798
+ If user shows interest in a starter, get the exact current commands:
799
+
800
+ ```
801
+ Search the web: "{{starter_name}} CLI command options flags latest"
802
+ Search the web: "{{starter_name}} create new project command examples"
803
+ ```
804
+
805
+ ### 8. Generate Starter Template Content
806
+
807
+ Prepare the content to append to the document:
808
+
809
+ #### Content Structure:
810
+
811
+ ````markdown
812
+ ## Starter Template Evaluation
813
+
814
+ ### Primary Technology Domain
815
+
816
+ {{identified_domain}} based on project requirements analysis
817
+
818
+ ### Starter Options Considered
819
+
820
+ {{analysis_of_evaluated_starters}}
821
+
822
+ ### Selected Starter: {{starter_name}}
823
+
824
+ **Rationale for Selection:**
825
+ {{why_this_starter_was_chosen}}
826
+
827
+ **Initialization Command:**
828
+
829
+ ```bash
830
+ {{full_starter_command_with_options}}
831
+ ```
832
+ ````
833
+
834
+ **Architectural Decisions Provided by Starter:**
835
+
836
+ **Language & Runtime:**
837
+ {{language_typescript_setup}}
838
+
839
+ **Styling Solution:**
840
+ {{styling_solution_configuration}}
841
+
842
+ **Build Tooling:**
843
+ {{build_tools_and_optimization}}
844
+
845
+ **Testing Framework:**
846
+ {{testing_setup_and_configuration}}
847
+
848
+ **Code Organization:**
849
+ {{project_structure_and_patterns}}
850
+
851
+ **Development Experience:**
852
+ {{development_tools_and_workflow}}
853
+
854
+ **Note:** Project initialization using this command should be the first implementation story.
855
+
856
+ ```
857
+
858
+ ### 9. Present Content and Menu
859
+
860
+ Show the generated content and present choices:
861
+
862
+ "I've analyzed starter template options for {{project_type}} projects.
863
+
864
+ **Here's what I'll add to the document:**
865
+
866
+ [Show the complete markdown content from step 8]
867
+
868
+ **What would you like to do?**
869
+ [A] Advanced Elicitation - Explore custom approaches or unconventional starters
870
+ [P] Party Mode - Evaluate trade-offs from different perspectives
871
+ [C] Continue - Save this decision and move to architectural decisions"
872
+
873
+ ### 10. Handle Menu Selection
874
+
875
+ #### If 'A' (Advanced Elicitation):
876
+
877
+ - Read fully and follow: {project-root}/_bmad/core/workflows/advanced-elicitation/workflow.xml with current starter analysis
878
+ - Process enhanced insights about starter options or custom approaches
879
+ - Ask user: "Accept these changes to the starter template evaluation? (y/n)"
880
+ - If yes: Update content, then return to A/P/C menu
881
+ - If no: Keep original content, then return to A/P/C menu
882
+
883
+ #### If 'P' (Party Mode):
884
+
885
+ - Read fully and follow: {project-root}/_bmad/core/workflows/party-mode/workflow.md with starter evaluation context
886
+ - Process collaborative insights about starter trade-offs
887
+ - Ask user: "Accept these changes to the starter template evaluation? (y/n)"
888
+ - If yes: Update content, then return to A/P/C menu
889
+ - If no: Keep original content, then return to A/P/C menu
890
+
891
+ #### If 'C' (Continue):
892
+
893
+ - Append the final content to `{planning_artifacts}/architecture.md`
894
+ - Update frontmatter: `stepsCompleted: [1, 2, 3]`
895
+ - Load `./step-04-decisions.md`
896
+
897
+ ## APPEND TO DOCUMENT:
898
+
899
+ When user selects 'C', append the content directly to the document using the structure from step 8.
900
+
901
+ ## SUCCESS METRICS:
902
+
903
+ ✅ Primary technology domain correctly identified from project context
904
+ ✅ Current, maintained starter templates researched and evaluated
905
+ ✅ All versions verified using web search, not hardcoded
906
+ ✅ Architectural implications of starter choice clearly documented
907
+ ✅ User provided with clear rationale for starter selection
908
+ ✅ A/P/C menu presented and handled correctly
909
+ ✅ Content properly appended to document when C selected
910
+
911
+ ## FAILURE MODES:
912
+
913
+ ❌ Not verifying current versions with web search
914
+ ❌ Ignoring UX requirements when evaluating starters
915
+ ❌ Not documenting what architectural decisions the starter makes
916
+ ❌ Failing to consider maintenance status of starter templates
917
+ ❌ Not providing clear rationale for starter selection
918
+ ❌ Not presenting A/P/C menu after content generation
919
+ ❌ **CRITICAL**: Reading only partial step file - leads to incomplete understanding and poor decisions
920
+ ❌ **CRITICAL**: Proceeding with 'C' without fully reading and understanding the next step file
921
+ ❌ **CRITICAL**: Making decisions without complete understanding of step requirements and protocols
922
+
923
+ ## NEXT STEP:
924
+
925
+ After user selects 'C' and content is saved to document, load `./step-04-decisions.md` to begin making specific architectural decisions.
926
+
927
+ Remember: Do NOT proceed to step-04 until user explicitly selects 'C' from the A/P/C menu and content is saved!
928
+ ```
929
+
930
+
931
+ # Step 4: Core Architectural Decisions
932
+
933
+ ## MANDATORY EXECUTION RULES (READ FIRST):
934
+
935
+ - 🛑 NEVER generate content without user input
936
+
937
+ - 📖 CRITICAL: ALWAYS read the complete step file before taking any action - partial understanding leads to incomplete decisions
938
+ - 🔄 CRITICAL: When loading next step with 'C', ensure the entire file is read and understood before proceeding
939
+ - ✅ ALWAYS treat this as collaborative discovery between architectural peers
940
+ - 📋 YOU ARE A FACILITATOR, not a content generator
941
+ - 💬 FOCUS on making critical architectural decisions collaboratively
942
+ - 🌐 ALWAYS search the web to verify current technology versions
943
+ - ⚠️ ABSOLUTELY NO TIME ESTIMATES - AI development speed has fundamentally changed
944
+ - ✅ YOU MUST ALWAYS SPEAK OUTPUT In your Agent communication style with the config `{communication_language}`
945
+
946
+ ## EXECUTION PROTOCOLS:
947
+
948
+ - 🎯 Show your analysis before taking any action
949
+ - 🌐 Search the web to verify technology versions and options
950
+ - ⚠️ Present A/P/C menu after each major decision category
951
+ - 💾 ONLY save when user chooses C (Continue)
952
+ - 📖 Update frontmatter `stepsCompleted: [1, 2, 3, 4]` before loading next step
953
+ - 🚫 FORBIDDEN to load next step until C is selected
954
+
955
+ ## COLLABORATION MENUS (A/P/C):
956
+
957
+ This step will generate content and present choices for each decision category:
958
+
959
+ - **A (Advanced Elicitation)**: Use discovery protocols to explore innovative approaches to specific decisions
960
+ - **P (Party Mode)**: Bring multiple perspectives to evaluate decision trade-offs
961
+ - **C (Continue)**: Save the current decisions and proceed to next decision category
962
+
963
+ ## PROTOCOL INTEGRATION:
964
+
965
+ - When 'A' selected: Read fully and follow: {project-root}/_bmad/core/workflows/advanced-elicitation/workflow.xml
966
+ - When 'P' selected: Read fully and follow: {project-root}/_bmad/core/workflows/party-mode/workflow.md
967
+ - PROTOCOLS always return to display this step's A/P/C menu after the A or P have completed
968
+ - User accepts/rejects protocol changes before proceeding
969
+
970
+ ## CONTEXT BOUNDARIES:
971
+
972
+ - Project context from step 2 is available
973
+ - Starter template choice from step 3 is available
974
+ - Project context file may contain technical preferences and rules
975
+ - Technical preferences discovered in step 3 are available
976
+ - Focus on decisions not already made by starter template or existing preferences
977
+ - Collaborative decision making, not recommendations
978
+
979
+ ## YOUR TASK:
980
+
981
+ Facilitate collaborative architectural decision making, leveraging existing technical preferences and starter template decisions, focusing on remaining choices critical to the project's success.
982
+
983
+ ## DECISION MAKING SEQUENCE:
984
+
985
+ ### 1. Load Decision Framework & Check Existing Preferences
986
+
987
+ **Review Technical Preferences from Step 3:**
988
+ "Based on our technical preferences discussion in step 3, let's build on those foundations:
989
+
990
+ **Your Technical Preferences:**
991
+ {{user_technical_preferences_from_step_3}}
992
+
993
+ **Starter Template Decisions:**
994
+ {{starter_template_decisions}}
995
+
996
+ **Project Context Technical Rules:**
997
+ {{project_context_technical_rules}}"
998
+
999
+ **Identify Remaining Decisions:**
1000
+ Based on technical preferences, starter template choice, and project context, identify remaining critical decisions:
1001
+
1002
+ **Already Decided (Don't re-decide these):**
1003
+
1004
+ - {{starter_template_decisions}}
1005
+ - {{user_technology_preferences}}
1006
+ - {{project_context_technical_rules}}
1007
+
1008
+ **Critical Decisions:** Must be decided before implementation can proceed
1009
+ **Important Decisions:** Shape the architecture significantly
1010
+ **Nice-to-Have:** Can be deferred if needed
1011
+
1012
+ ### 2. Decision Categories by Priority
1013
+
1014
+ #### Category 1: Data Architecture
1015
+
1016
+ - Database choice (if not determined by starter)
1017
+ - Data modeling approach
1018
+ - Data validation strategy
1019
+ - Migration approach
1020
+ - Caching strategy
1021
+
1022
+ #### Category 2: Authentication & Security
1023
+
1024
+ - Authentication method
1025
+ - Authorization patterns
1026
+ - Security middleware
1027
+ - Data encryption approach
1028
+ - API security strategy
1029
+
1030
+ #### Category 3: API & Communication
1031
+
1032
+ - API design patterns (REST, GraphQL, etc.)
1033
+ - API documentation approach
1034
+ - Error handling standards
1035
+ - Rate limiting strategy
1036
+ - Communication between services
1037
+
1038
+ #### Category 4: Frontend Architecture (if applicable)
1039
+
1040
+ - State management approach
1041
+ - Component architecture
1042
+ - Routing strategy
1043
+ - Performance optimization
1044
+ - Bundle optimization
1045
+
1046
+ #### Category 5: Infrastructure & Deployment
1047
+
1048
+ - Hosting strategy
1049
+ - CI/CD pipeline approach
1050
+ - Environment configuration
1051
+ - Monitoring and logging
1052
+ - Scaling strategy
1053
+
1054
+ ### 3. Facilitate Each Decision Category
1055
+
1056
+ For each category, facilitate collaborative decision making:
1057
+
1058
+ **Present the Decision:**
1059
+ Based on user skill level and project context:
1060
+
1061
+ **Expert Mode:**
1062
+ "{{Decision_Category}}: {{Specific_Decision}}
1063
+
1064
+ Options: {{concise_option_list_with_tradeoffs}}
1065
+
1066
+ What's your preference for this decision?"
1067
+
1068
+ **Intermediate Mode:**
1069
+ "Next decision: {{Human_Friendly_Category}}
1070
+
1071
+ We need to choose {{Specific_Decision}}.
1072
+
1073
+ Common options:
1074
+ {{option_list_with_brief_explanations}}
1075
+
1076
+ For your project, I'd lean toward {{recommendation}} because {{reason}}. What are your thoughts?"
1077
+
1078
+ **Beginner Mode:**
1079
+ "Let's talk about {{Human_Friendly_Category}}.
1080
+
1081
+ {{Educational_Context_About_Why_This_Matters}}
1082
+
1083
+ Think of it like {{real_world_analogy}}.
1084
+
1085
+ Your main options:
1086
+ {{friendly_options_with_pros_cons}}
1087
+
1088
+ My suggestion: {{recommendation}}
1089
+ This is good for you because {{beginner_friendly_reason}}.
1090
+
1091
+ What feels right to you?"
1092
+
1093
+ **Verify Technology Versions:**
1094
+ If decision involves specific technology:
1095
+
1096
+ ```
1097
+ Search the web: "{{technology}} latest stable version"
1098
+ Search the web: "{{technology}} current LTS version"
1099
+ Search the web: "{{technology}} production readiness"
1100
+ ```
1101
+
1102
+ **Get User Input:**
1103
+ "What's your preference? (or 'explain more' for details)"
1104
+
1105
+ **Handle User Response:**
1106
+
1107
+ - If user wants more info: Provide deeper explanation
1108
+ - If user has preference: Discuss implications and record decision
1109
+ - If user wants alternatives: Explore other options
1110
+
1111
+ **Record the Decision:**
1112
+
1113
+ - Category: {{category}}
1114
+ - Decision: {{user_choice}}
1115
+ - Version: {{verified_version_if_applicable}}
1116
+ - Rationale: {{user_reasoning_or_default}}
1117
+ - Affects: {{components_or_epics}}
1118
+ - Provided by Starter: {{yes_if_from_starter}}
1119
+
1120
+ ### 4. Check for Cascading Implications
1121
+
1122
+ After each major decision, identify related decisions:
1123
+
1124
+ "This choice means we'll also need to decide:
1125
+
1126
+ - {{related_decision_1}}
1127
+ - {{related_decision_2}}"
1128
+
1129
+ ### 5. Generate Decisions Content
1130
+
1131
+ After facilitating all decision categories, prepare the content to append:
1132
+
1133
+ #### Content Structure:
1134
+
1135
+ ```markdown
1136
+ ## Core Architectural Decisions
1137
+
1138
+ ### Decision Priority Analysis
1139
+
1140
+ **Critical Decisions (Block Implementation):**
1141
+ {{critical_decisions_made}}
1142
+
1143
+ **Important Decisions (Shape Architecture):**
1144
+ {{important_decisions_made}}
1145
+
1146
+ **Deferred Decisions (Post-MVP):**
1147
+ {{decisions_deferred_with_rationale}}
1148
+
1149
+ ### Data Architecture
1150
+
1151
+ {{data_related_decisions_with_versions_and_rationale}}
1152
+
1153
+ ### Authentication & Security
1154
+
1155
+ {{security_related_decisions_with_versions_and_rationale}}
1156
+
1157
+ ### API & Communication Patterns
1158
+
1159
+ {{api_related_decisions_with_versions_and_rationale}}
1160
+
1161
+ ### Frontend Architecture
1162
+
1163
+ {{frontend_related_decisions_with_versions_and_rationale}}
1164
+
1165
+ ### Infrastructure & Deployment
1166
+
1167
+ {{infrastructure_related_decisions_with_versions_and_rationale}}
1168
+
1169
+ ### Decision Impact Analysis
1170
+
1171
+ **Implementation Sequence:**
1172
+ {{ordered_list_of_decisions_for_implementation}}
1173
+
1174
+ **Cross-Component Dependencies:**
1175
+ {{how_decisions_affect_each_other}}
1176
+ ```
1177
+
1178
+ ### 6. Present Content and Menu
1179
+
1180
+ Show the generated decisions content and present choices:
1181
+
1182
+ "I've documented all the core architectural decisions we've made together.
1183
+
1184
+ **Here's what I'll add to the document:**
1185
+
1186
+ [Show the complete markdown content from step 5]
1187
+
1188
+ **What would you like to do?**
1189
+ [A] Advanced Elicitation - Explore innovative approaches to any specific decisions
1190
+ [P] Party Mode - Review decisions from multiple perspectives
1191
+ [C] Continue - Save these decisions and move to implementation patterns"
1192
+
1193
+ ### 7. Handle Menu Selection
1194
+
1195
+ #### If 'A' (Advanced Elicitation):
1196
+
1197
+ - Read fully and follow: {project-root}/_bmad/core/workflows/advanced-elicitation/workflow.xml with specific decision categories
1198
+ - Process enhanced insights about particular decisions
1199
+ - Ask user: "Accept these enhancements to the architectural decisions? (y/n)"
1200
+ - If yes: Update content, then return to A/P/C menu
1201
+ - If no: Keep original content, then return to A/P/C menu
1202
+
1203
+ #### If 'P' (Party Mode):
1204
+
1205
+ - Read fully and follow: {project-root}/_bmad/core/workflows/party-mode/workflow.md with architectural decisions context
1206
+ - Process collaborative insights about decision trade-offs
1207
+ - Ask user: "Accept these changes to the architectural decisions? (y/n)"
1208
+ - If yes: Update content, then return to A/P/C menu
1209
+ - If no: Keep original content, then return to A/P/C menu
1210
+
1211
+ #### If 'C' (Continue):
1212
+
1213
+ - Append the final content to `{planning_artifacts}/architecture.md`
1214
+ - Update frontmatter: `stepsCompleted: [1, 2, 3, 4]`
1215
+ - Load `./step-05-patterns.md`
1216
+
1217
+ ## APPEND TO DOCUMENT:
1218
+
1219
+ When user selects 'C', append the content directly to the document using the structure from step 5.
1220
+
1221
+ ## SUCCESS METRICS:
1222
+
1223
+ ✅ All critical architectural decisions made collaboratively
1224
+ ✅ Technology versions verified using web search
1225
+ ✅ Decision rationale clearly documented
1226
+ ✅ Cascading implications identified and addressed
1227
+ ✅ User provided appropriate level of explanation for skill level
1228
+ ✅ A/P/C menu presented and handled correctly for each category
1229
+ ✅ Content properly appended to document when C selected
1230
+
1231
+ ## FAILURE MODES:
1232
+
1233
+ ❌ Making recommendations instead of facilitating decisions
1234
+ ❌ Not verifying technology versions with web search
1235
+ ❌ Missing cascading implications between decisions
1236
+ ❌ Not adapting explanations to user skill level
1237
+ ❌ Forgetting to document decisions made by starter template
1238
+ ❌ Not presenting A/P/C menu after content generation
1239
+
1240
+ ❌ **CRITICAL**: Reading only partial step file - leads to incomplete understanding and poor decisions
1241
+ ❌ **CRITICAL**: Proceeding with 'C' without fully reading and understanding the next step file
1242
+ ❌ **CRITICAL**: Making decisions without complete understanding of step requirements and protocols
1243
+
1244
+ ## NEXT STEP:
1245
+
1246
+ After user selects 'C' and content is saved to document, load `./step-05-patterns.md` to define implementation patterns that ensure consistency across AI agents.
1247
+
1248
+ Remember: Do NOT proceed to step-05 until user explicitly selects 'C' from the A/P/C menu and content is saved!
1249
+
1250
+
1251
+ # Step 5: Implementation Patterns & Consistency Rules
1252
+
1253
+ ## MANDATORY EXECUTION RULES (READ FIRST):
1254
+
1255
+ - 🛑 NEVER generate content without user input
1256
+
1257
+ - 📖 CRITICAL: ALWAYS read the complete step file before taking any action - partial understanding leads to incomplete decisions
1258
+ - 🔄 CRITICAL: When loading next step with 'C', ensure the entire file is read and understood before proceeding
1259
+ - ✅ ALWAYS treat this as collaborative discovery between architectural peers
1260
+ - 📋 YOU ARE A FACILITATOR, not a content generator
1261
+ - 💬 FOCUS on patterns that prevent AI agent implementation conflicts
1262
+ - 🎯 EMPHASIZE what agents could decide DIFFERENTLY if not specified
1263
+ - ⚠️ ABSOLUTELY NO TIME ESTIMATES - AI development speed has fundamentally changed
1264
+ - ✅ YOU MUST ALWAYS SPEAK OUTPUT In your Agent communication style with the config `{communication_language}`
1265
+
1266
+ ## EXECUTION PROTOCOLS:
1267
+
1268
+ - 🎯 Show your analysis before taking any action
1269
+ - 🎯 Focus on consistency, not implementation details
1270
+ - ⚠️ Present A/P/C menu after generating patterns content
1271
+ - 💾 ONLY save when user chooses C (Continue)
1272
+ - 📖 Update frontmatter `stepsCompleted: [1, 2, 3, 4, 5]` before loading next step
1273
+ - 🚫 FORBIDDEN to load next step until C is selected
1274
+
1275
+ ## COLLABORATION MENUS (A/P/C):
1276
+
1277
+ This step will generate content and present choices:
1278
+
1279
+ - **A (Advanced Elicitation)**: Use discovery protocols to develop comprehensive consistency patterns
1280
+ - **P (Party Mode)**: Bring multiple perspectives to identify potential conflict points
1281
+ - **C (Continue)**: Save the patterns and proceed to project structure
1282
+
1283
+ ## PROTOCOL INTEGRATION:
1284
+
1285
+ - When 'A' selected: Read fully and follow: {project-root}/_bmad/core/workflows/advanced-elicitation/workflow.xml
1286
+ - When 'P' selected: Read fully and follow: {project-root}/_bmad/core/workflows/party-mode/workflow.md
1287
+ - PROTOCOLS always return to display this step's A/P/C menu after the A or P have completed
1288
+ - User accepts/rejects protocol changes before proceeding
1289
+
1290
+ ## CONTEXT BOUNDARIES:
1291
+
1292
+ - Core architectural decisions from step 4 are complete
1293
+ - Technology stack is decided and versions are verified
1294
+ - Focus on HOW agents should implement, not WHAT they should implement
1295
+ - Consider what could vary between different AI agents
1296
+
1297
+ ## YOUR TASK:
1298
+
1299
+ Define implementation patterns and consistency rules that ensure multiple AI agents write compatible, consistent code that works together seamlessly.
1300
+
1301
+ ## PATTERNS DEFINITION SEQUENCE:
1302
+
1303
+ ### 1. Identify Potential Conflict Points
1304
+
1305
+ Based on the chosen technology stack and decisions, identify where AI agents could make different choices:
1306
+
1307
+ **Naming Conflicts:**
1308
+
1309
+ - Database table/column naming conventions
1310
+ - API endpoint naming patterns
1311
+ - File and directory naming
1312
+ - Component/function/variable naming
1313
+ - Route parameter formats
1314
+
1315
+ **Structural Conflicts:**
1316
+
1317
+ - Where tests are located
1318
+ - How components are organized
1319
+ - Where utilities and helpers go
1320
+ - Configuration file organization
1321
+ - Static asset organization
1322
+
1323
+ **Format Conflicts:**
1324
+
1325
+ - API response wrapper formats
1326
+ - Error response structures
1327
+ - Date/time formats in APIs and UI
1328
+ - JSON field naming conventions
1329
+ - API status code usage
1330
+
1331
+ **Communication Conflicts:**
1332
+
1333
+ - Event naming conventions
1334
+ - Event payload structures
1335
+ - State update patterns
1336
+ - Action naming conventions
1337
+ - Logging formats and levels
1338
+
1339
+ **Process Conflicts:**
1340
+
1341
+ - Loading state handling
1342
+ - Error recovery patterns
1343
+ - Retry implementation approaches
1344
+ - Authentication flow patterns
1345
+ - Validation timing and methods
1346
+
1347
+ ### 2. Facilitate Pattern Decisions
1348
+
1349
+ For each conflict category, facilitate collaborative pattern definition:
1350
+
1351
+ **Present the Conflict Point:**
1352
+ "Given that we're using {{tech_stack}}, different AI agents might handle {{conflict_area}} differently.
1353
+
1354
+ For example, one agent might name database tables 'users' while another uses 'Users' - this would cause conflicts.
1355
+
1356
+ We need to establish consistent patterns that all agents follow."
1357
+
1358
+ **Show Options and Trade-offs:**
1359
+ "Common approaches for {{pattern_category}}:
1360
+
1361
+ 1. {{option_1}} - {{pros_and_cons}}
1362
+ 2. {{option_2}} - {{pros_and_cons}}
1363
+ 3. {{option_3}} - {{pros_and_cons}}
1364
+
1365
+ Which approach makes the most sense for our project?"
1366
+
1367
+ **Get User Decision:**
1368
+ "What's your preference for this pattern? (or discuss the trade-offs more)"
1369
+
1370
+ ### 3. Define Pattern Categories
1371
+
1372
+ #### Naming Patterns
1373
+
1374
+ **Database Naming:**
1375
+
1376
+ - Table naming: users, Users, or user?
1377
+ - Column naming: user_id or userId?
1378
+ - Foreign key format: user_id or fk_user?
1379
+ - Index naming: idx_users_email or users_email_index?
1380
+
1381
+ **API Naming:**
1382
+
1383
+ - REST endpoint naming: /users or /user? Plural or singular?
1384
+ - Route parameter format: :id or {id}?
1385
+ - Query parameter naming: user_id or userId?
1386
+ - Header naming conventions: X-Custom-Header or Custom-Header?
1387
+
1388
+ **Code Naming:**
1389
+
1390
+ - Component naming: UserCard or user-card?
1391
+ - File naming: UserCard.tsx or user-card.tsx?
1392
+ - Function naming: getUserData or get_user_data?
1393
+ - Variable naming: userId or user_id?
1394
+
1395
+ #### Structure Patterns
1396
+
1397
+ **Project Organization:**
1398
+
1399
+ - Where do tests live? **tests**/ or \*.test.ts co-located?
1400
+ - How are components organized? By feature or by type?
1401
+ - Where do shared utilities go?
1402
+ - How are services and repositories organized?
1403
+
1404
+ **File Structure:**
1405
+
1406
+ - Config file locations and naming
1407
+ - Static asset organization
1408
+ - Documentation placement
1409
+ - Environment file organization
1410
+
1411
+ #### Format Patterns
1412
+
1413
+ **API Formats:**
1414
+
1415
+ - API response wrapper? {data: ..., error: ...} or direct response?
1416
+ - Error format? {message, code} or {error: {type, detail}}?
1417
+ - Date format in JSON? ISO strings or timestamps?
1418
+ - Success response structure?
1419
+
1420
+ **Data Formats:**
1421
+
1422
+ - JSON field naming: snake_case or camelCase?
1423
+ - Boolean representations: true/false or 1/0?
1424
+ - Null handling patterns
1425
+ - Array vs object for single items
1426
+
1427
+ #### Communication Patterns
1428
+
1429
+ **Event Systems:**
1430
+
1431
+ - Event naming convention: user.created or UserCreated?
1432
+ - Event payload structure standards
1433
+ - Event versioning approach
1434
+ - Async event handling patterns
1435
+
1436
+ **State Management:**
1437
+
1438
+ - State update patterns: immutable updates or direct mutation?
1439
+ - Action naming conventions
1440
+ - Selector patterns
1441
+ - State organization principles
1442
+
1443
+ #### Process Patterns
1444
+
1445
+ **Error Handling:**
1446
+
1447
+ - Global error handling approach
1448
+ - Error boundary patterns
1449
+ - User-facing error message format
1450
+ - Logging vs user error distinction
1451
+
1452
+ **Loading States:**
1453
+
1454
+ - Loading state naming conventions
1455
+ - Global vs local loading states
1456
+ - Loading state persistence
1457
+ - Loading UI patterns
1458
+
1459
+ ### 4. Generate Patterns Content
1460
+
1461
+ Prepare the content to append to the document:
1462
+
1463
+ #### Content Structure:
1464
+
1465
+ ```markdown
1466
+ ## Implementation Patterns & Consistency Rules
1467
+
1468
+ ### Pattern Categories Defined
1469
+
1470
+ **Critical Conflict Points Identified:**
1471
+ {{number_of_potential_conflicts}} areas where AI agents could make different choices
1472
+
1473
+ ### Naming Patterns
1474
+
1475
+ **Database Naming Conventions:**
1476
+ {{database_naming_rules_with_examples}}
1477
+
1478
+ **API Naming Conventions:**
1479
+ {{api_naming_rules_with_examples}}
1480
+
1481
+ **Code Naming Conventions:**
1482
+ {{code_naming_rules_with_examples}}
1483
+
1484
+ ### Structure Patterns
1485
+
1486
+ **Project Organization:**
1487
+ {{project_structure_rules_with_examples}}
1488
+
1489
+ **File Structure Patterns:**
1490
+ {{file_organization_rules_with_examples}}
1491
+
1492
+ ### Format Patterns
1493
+
1494
+ **API Response Formats:**
1495
+ {{api_response_structure_rules}}
1496
+
1497
+ **Data Exchange Formats:**
1498
+ {{data_format_rules_with_examples}}
1499
+
1500
+ ### Communication Patterns
1501
+
1502
+ **Event System Patterns:**
1503
+ {{event_naming_and_structure_rules}}
1504
+
1505
+ **State Management Patterns:**
1506
+ {{state_update_and_organization_rules}}
1507
+
1508
+ ### Process Patterns
1509
+
1510
+ **Error Handling Patterns:**
1511
+ {{consistent_error_handling_approaches}}
1512
+
1513
+ **Loading State Patterns:**
1514
+ {{loading_state_management_rules}}
1515
+
1516
+ ### Enforcement Guidelines
1517
+
1518
+ **All AI Agents MUST:**
1519
+
1520
+ - {{mandatory_pattern_1}}
1521
+ - {{mandatory_pattern_2}}
1522
+ - {{mandatory_pattern_3}}
1523
+
1524
+ **Pattern Enforcement:**
1525
+
1526
+ - How to verify patterns are followed
1527
+ - Where to document pattern violations
1528
+ - Process for updating patterns
1529
+
1530
+ ### Pattern Examples
1531
+
1532
+ **Good Examples:**
1533
+ {{concrete_examples_of_correct_pattern_usage}}
1534
+
1535
+ **Anti-Patterns:**
1536
+ {{examples_of_what_to_avoid}}
1537
+ ```
1538
+
1539
+ ### 5. Present Content and Menu
1540
+
1541
+ Show the generated patterns content and present choices:
1542
+
1543
+ "I've documented implementation patterns that will prevent conflicts between AI agents working on this project.
1544
+
1545
+ **Here's what I'll add to the document:**
1546
+
1547
+ [Show the complete markdown content from step 4]
1548
+
1549
+ **What would you like to do?**
1550
+ [A] Advanced Elicitation - Explore additional consistency patterns
1551
+ [P] Party Mode - Review patterns from different implementation perspectives
1552
+ [C] Continue - Save these patterns and move to project structure"
1553
+
1554
+ ### 6. Handle Menu Selection
1555
+
1556
+ #### If 'A' (Advanced Elicitation):
1557
+
1558
+ - Read fully and follow: {project-root}/_bmad/core/workflows/advanced-elicitation/workflow.xml with current patterns
1559
+ - Process enhanced consistency rules that come back
1560
+ - Ask user: "Accept these additional pattern refinements? (y/n)"
1561
+ - If yes: Update content, then return to A/P/C menu
1562
+ - If no: Keep original content, then return to A/P/C menu
1563
+
1564
+ #### If 'P' (Party Mode):
1565
+
1566
+ - Read fully and follow: {project-root}/_bmad/core/workflows/party-mode/workflow.md with implementation patterns context
1567
+ - Process collaborative insights about potential conflicts
1568
+ - Ask user: "Accept these changes to the implementation patterns? (y/n)"
1569
+ - If yes: Update content, then return to A/P/C menu
1570
+ - If no: Keep original content, then return to A/P/C menu
1571
+
1572
+ #### If 'C' (Continue):
1573
+
1574
+ - Append the final content to `{planning_artifacts}/architecture.md`
1575
+ - Update frontmatter: `stepsCompleted: [1, 2, 3, 4, 5]`
1576
+ - Load `./step-06-structure.md`
1577
+
1578
+ ## APPEND TO DOCUMENT:
1579
+
1580
+ When user selects 'C', append the content directly to the document using the structure from step 4.
1581
+
1582
+ ## SUCCESS METRICS:
1583
+
1584
+ ✅ All potential AI agent conflict points identified and addressed
1585
+ ✅ Comprehensive patterns defined for naming, structure, and communication
1586
+ ✅ Concrete examples provided for each pattern
1587
+ ✅ Enforcement guidelines clearly documented
1588
+ ✅ User collaborated on pattern decisions rather than receiving recommendations
1589
+ ✅ A/P/C menu presented and handled correctly
1590
+ ✅ Content properly appended to document when C selected
1591
+
1592
+ ## FAILURE MODES:
1593
+
1594
+ ❌ Missing potential conflict points that could cause agent conflicts
1595
+ ❌ Being too prescriptive about implementation details instead of focusing on consistency
1596
+ ❌ Not providing concrete examples for each pattern
1597
+ ❌ Failing to address cross-cutting concerns like error handling
1598
+ ❌ Not considering the chosen technology stack when defining patterns
1599
+ ❌ Not presenting A/P/C menu after content generation
1600
+
1601
+ ❌ **CRITICAL**: Reading only partial step file - leads to incomplete understanding and poor decisions
1602
+ ❌ **CRITICAL**: Proceeding with 'C' without fully reading and understanding the next step file
1603
+ ❌ **CRITICAL**: Making decisions without complete understanding of step requirements and protocols
1604
+
1605
+ ## NEXT STEP:
1606
+
1607
+ After user selects 'C' and content is saved to document, load `./step-06-structure.md` to define the complete project structure.
1608
+
1609
+ Remember: Do NOT proceed to step-06 until user explicitly selects 'C' from the A/P/C menu and content is saved!
1610
+
1611
+
1612
+ # Step 6: Project Structure & Boundaries
1613
+
1614
+ ## MANDATORY EXECUTION RULES (READ FIRST):
1615
+
1616
+ - 🛑 NEVER generate content without user input
1617
+
1618
+ - 📖 CRITICAL: ALWAYS read the complete step file before taking any action - partial understanding leads to incomplete decisions
1619
+ - 🔄 CRITICAL: When loading next step with 'C', ensure the entire file is read and understood before proceeding
1620
+ - ✅ ALWAYS treat this as collaborative discovery between architectural peers
1621
+ - 📋 YOU ARE A FACILITATOR, not a content generator
1622
+ - 💬 FOCUS on defining complete project structure and clear boundaries
1623
+ - 🗺️ MAP requirements/epics to architectural components
1624
+ - ⚠️ ABSOLUTELY NO TIME ESTIMATES - AI development speed has fundamentally changed
1625
+ - ✅ YOU MUST ALWAYS SPEAK OUTPUT In your Agent communication style with the config `{communication_language}`
1626
+
1627
+ ## EXECUTION PROTOCOLS:
1628
+
1629
+ - 🎯 Show your analysis before taking any action
1630
+ - 🗺️ Create complete project tree, not generic placeholders
1631
+ - ⚠️ Present A/P/C menu after generating project structure
1632
+ - 💾 ONLY save when user chooses C (Continue)
1633
+ - 📖 Update frontmatter `stepsCompleted: [1, 2, 3, 4, 5, 6]` before loading next step
1634
+ - 🚫 FORBIDDEN to load next step until C is selected
1635
+
1636
+ ## COLLABORATION MENUS (A/P/C):
1637
+
1638
+ This step will generate content and present choices:
1639
+
1640
+ - **A (Advanced Elicitation)**: Use discovery protocols to explore innovative project organization approaches
1641
+ - **P (Party Mode)**: Bring multiple perspectives to evaluate project structure trade-offs
1642
+ - **C (Continue)**: Save the project structure and proceed to validation
1643
+
1644
+ ## PROTOCOL INTEGRATION:
1645
+
1646
+ - When 'A' selected: Read fully and follow: {project-root}/_bmad/core/workflows/advanced-elicitation/workflow.xml
1647
+ - When 'P' selected: Read fully and follow: {project-root}/_bmad/core/workflows/party-mode/workflow.md
1648
+ - PROTOCOLS always return to display this step's A/P/C menu after the A or P have completed
1649
+ - User accepts/rejects protocol changes before proceeding
1650
+
1651
+ ## CONTEXT BOUNDARIES:
1652
+
1653
+ - All previous architectural decisions are complete
1654
+ - Implementation patterns and consistency rules are defined
1655
+ - Focus on physical project structure and component boundaries
1656
+ - Map requirements to specific files and directories
1657
+
1658
+ ## YOUR TASK:
1659
+
1660
+ Define the complete project structure and architectural boundaries based on all decisions made, creating a concrete implementation guide for AI agents.
1661
+
1662
+ ## PROJECT STRUCTURE SEQUENCE:
1663
+
1664
+ ### 1. Analyze Requirements Mapping
1665
+
1666
+ Map project requirements to architectural components:
1667
+
1668
+ **From Epics (if available):**
1669
+ "Epic: {{epic_name}} → Lives in {{module/directory/service}}"
1670
+
1671
+ - User stories within the epic
1672
+ - Cross-epic dependencies
1673
+ - Shared components needed
1674
+
1675
+ **From FR Categories (if no epics):**
1676
+ "FR Category: {{fr_category_name}} → Lives in {{module/directory/service}}"
1677
+
1678
+ - Related functional requirements
1679
+ - Shared functionality across categories
1680
+ - Integration points between categories
1681
+
1682
+ ### 2. Define Project Directory Structure
1683
+
1684
+ Based on technology stack and patterns, create the complete project structure:
1685
+
1686
+ **Root Configuration Files:**
1687
+
1688
+ - Package management files (package.json, requirements.txt, etc.)
1689
+ - Build and development configuration
1690
+ - Environment configuration files
1691
+ - CI/CD pipeline files
1692
+ - Documentation files
1693
+
1694
+ **Source Code Organization:**
1695
+
1696
+ - Application entry points
1697
+ - Core application structure
1698
+ - Feature/module organization
1699
+ - Shared utilities and libraries
1700
+ - Configuration and environment files
1701
+
1702
+ **Test Organization:**
1703
+
1704
+ - Unit test locations and structure
1705
+ - Integration test organization
1706
+ - End-to-end test structure
1707
+ - Test utilities and fixtures
1708
+
1709
+ **Build and Distribution:**
1710
+
1711
+ - Build output directories
1712
+ - Distribution files
1713
+ - Static assets
1714
+ - Documentation build
1715
+
1716
+ ### 3. Define Integration Boundaries
1717
+
1718
+ Map how components communicate and where boundaries exist:
1719
+
1720
+ **API Boundaries:**
1721
+
1722
+ - External API endpoints
1723
+ - Internal service boundaries
1724
+ - Authentication and authorization boundaries
1725
+ - Data access layer boundaries
1726
+
1727
+ **Component Boundaries:**
1728
+
1729
+ - Frontend component communication patterns
1730
+ - State management boundaries
1731
+ - Service communication patterns
1732
+ - Event-driven integration points
1733
+
1734
+ **Data Boundaries:**
1735
+
1736
+ - Database schema boundaries
1737
+ - Data access patterns
1738
+ - Caching boundaries
1739
+ - External data integration points
1740
+
1741
+ ### 4. Create Complete Project Tree
1742
+
1743
+ Generate a comprehensive directory structure showing all files and directories:
1744
+
1745
+ **Technology-Specific Structure Examples:**
1746
+
1747
+ **Next.js Full-Stack:**
1748
+
1749
+ ```
1750
+ project-name/
1751
+ ├── README.md
1752
+ ├── package.json
1753
+ ├── next.config.js
1754
+ ├── tailwind.config.js
1755
+ ├── tsconfig.json
1756
+ ├── .env.local
1757
+ ├── .env.example
1758
+ ├── .gitignore
1759
+ ├── .github/
1760
+ │ └── workflows/
1761
+ │ └── ci.yml
1762
+ ├── src/
1763
+ │ ├── app/
1764
+ │ │ ├── globals.css
1765
+ │ │ ├── layout.tsx
1766
+ │ │ └── page.tsx
1767
+ │ ├── components/
1768
+ │ │ ├── ui/
1769
+ │ │ ├── forms/
1770
+ │ │ └── features/
1771
+ │ ├── lib/
1772
+ │ │ ├── db.ts
1773
+ │ │ ├── auth.ts
1774
+ │ │ └── utils.ts
1775
+ │ ├── types/
1776
+ │ └── middleware.ts
1777
+ ├── prisma/
1778
+ │ ├── schema.prisma
1779
+ │ └── migrations/
1780
+ ├── tests/
1781
+ │ ├── __mocks__/
1782
+ │ ├── components/
1783
+ │ └── e2e/
1784
+ └── public/
1785
+ └── assets/
1786
+ ```
1787
+
1788
+ **API Backend (NestJS):**
1789
+
1790
+ ```
1791
+ project-name/
1792
+ ├── package.json
1793
+ ├── nest-cli.json
1794
+ ├── tsconfig.json
1795
+ ├── .env
1796
+ ├── .env.example
1797
+ ├── .gitignore
1798
+ ├── README.md
1799
+ ├── src/
1800
+ │ ├── main.ts
1801
+ │ ├── app.module.ts
1802
+ │ ├── config/
1803
+ │ ├── modules/
1804
+ │ │ ├── auth/
1805
+ │ │ ├── users/
1806
+ │ │ └── common/
1807
+ │ ├── services/
1808
+ │ ├── repositories/
1809
+ │ ├── decorators/
1810
+ │ ├── pipes/
1811
+ │ ├── guards/
1812
+ │ └── interceptors/
1813
+ ├── test/
1814
+ │ ├── unit/
1815
+ │ ├── integration/
1816
+ │ └── e2e/
1817
+ ├── prisma/
1818
+ │ ├── schema.prisma
1819
+ │ └── migrations/
1820
+ └── docker-compose.yml
1821
+ ```
1822
+
1823
+ ### 5. Map Requirements to Structure
1824
+
1825
+ Create explicit mapping from project requirements to specific files/directories:
1826
+
1827
+ **Epic/Feature Mapping:**
1828
+ "Epic: User Management
1829
+
1830
+ - Components: src/components/features/users/
1831
+ - Services: src/services/users/
1832
+ - API Routes: src/app/api/users/
1833
+ - Database: prisma/migrations/_*users*_
1834
+ - Tests: tests/features/users/"
1835
+
1836
+ **Cross-Cutting Concerns:**
1837
+ "Authentication System
1838
+
1839
+ - Components: src/components/auth/
1840
+ - Services: src/services/auth/
1841
+ - Middleware: src/middleware/auth.ts
1842
+ - Guards: src/guards/auth.guard.ts
1843
+ - Tests: tests/auth/"
1844
+
1845
+ ### 6. Generate Structure Content
1846
+
1847
+ Prepare the content to append to the document:
1848
+
1849
+ #### Content Structure:
1850
+
1851
+ ```markdown
1852
+ ## Project Structure & Boundaries
1853
+
1854
+ ### Complete Project Directory Structure
1855
+ ```
1856
+
1857
+ {{complete_project_tree_with_all_files_and_directories}}
1858
+
1859
+ ```
1860
+
1861
+ ### Architectural Boundaries
1862
+
1863
+ **API Boundaries:**
1864
+ {{api_boundary_definitions_and_endpoints}}
1865
+
1866
+ **Component Boundaries:**
1867
+ {{component_communication_patterns_and_boundaries}}
1868
+
1869
+ **Service Boundaries:**
1870
+ {{service_integration_patterns_and_boundaries}}
1871
+
1872
+ **Data Boundaries:**
1873
+ {{data_access_patterns_and_boundaries}}
1874
+
1875
+ ### Requirements to Structure Mapping
1876
+
1877
+ **Feature/Epic Mapping:**
1878
+ {{mapping_of_epics_or_features_to_specific_directories}}
1879
+
1880
+ **Cross-Cutting Concerns:**
1881
+ {{mapping_of_shared_functionality_to_locations}}
1882
+
1883
+ ### Integration Points
1884
+
1885
+ **Internal Communication:**
1886
+ {{how_components_within_the_project_communicate}}
1887
+
1888
+ **External Integrations:**
1889
+ {{third_party_service_integration_points}}
1890
+
1891
+ **Data Flow:**
1892
+ {{how_data_flows_through_the_architecture}}
1893
+
1894
+ ### File Organization Patterns
1895
+
1896
+ **Configuration Files:**
1897
+ {{where_and_how_config_files_are_organized}}
1898
+
1899
+ **Source Organization:**
1900
+ {{how_source_code_is_structured_and_organized}}
1901
+
1902
+ **Test Organization:**
1903
+ {{how_tests_are_structured_and_organized}}
1904
+
1905
+ **Asset Organization:**
1906
+ {{how_static_and_dynamic_assets_are_organized}}
1907
+
1908
+ ### Development Workflow Integration
1909
+
1910
+ **Development Server Structure:**
1911
+ {{how_the_project_is organized_for_development}}
1912
+
1913
+ **Build Process Structure:**
1914
+ {{how_the_build_process_uses_the_project_structure}}
1915
+
1916
+ **Deployment Structure:**
1917
+ {{how_the_project_structure_supports_deployment}}
1918
+ ```
1919
+
1920
+ ### 7. Present Content and Menu
1921
+
1922
+ Show the generated project structure content and present choices:
1923
+
1924
+ "I've created a complete project structure based on all our architectural decisions.
1925
+
1926
+ **Here's what I'll add to the document:**
1927
+
1928
+ [Show the complete markdown content from step 6]
1929
+
1930
+ **What would you like to do?**
1931
+ [A] Advanced Elicitation - Explore innovative project organization approaches
1932
+ [P] Party Mode - Review structure from different development perspectives
1933
+ [C] Continue - Save this structure and move to architecture validation"
1934
+
1935
+ ### 8. Handle Menu Selection
1936
+
1937
+ #### If 'A' (Advanced Elicitation):
1938
+
1939
+ - Read fully and follow: {project-root}/_bmad/core/workflows/advanced-elicitation/workflow.xml with current project structure
1940
+ - Process enhanced organizational insights that come back
1941
+ - Ask user: "Accept these changes to the project structure? (y/n)"
1942
+ - If yes: Update content, then return to A/P/C menu
1943
+ - If no: Keep original content, then return to A/P/C menu
1944
+
1945
+ #### If 'P' (Party Mode):
1946
+
1947
+ - Read fully and follow: {project-root}/_bmad/core/workflows/party-mode/workflow.md with project structure context
1948
+ - Process collaborative insights about organization trade-offs
1949
+ - Ask user: "Accept these changes to the project structure? (y/n)"
1950
+ - If yes: Update content, then return to A/P/C menu
1951
+ - If no: Keep original content, then return to A/P/C menu
1952
+
1953
+ #### If 'C' (Continue):
1954
+
1955
+ - Append the final content to `{planning_artifacts}/architecture.md`
1956
+ - Update frontmatter: `stepsCompleted: [1, 2, 3, 4, 5, 6]`
1957
+ - Load `./step-07-validation.md`
1958
+
1959
+ ## APPEND TO DOCUMENT:
1960
+
1961
+ When user selects 'C', append the content directly to the document using the structure from step 6.
1962
+
1963
+ ## SUCCESS METRICS:
1964
+
1965
+ ✅ Complete project tree defined with all files and directories
1966
+ ✅ All architectural boundaries clearly documented
1967
+ ✅ Requirements/epics mapped to specific locations
1968
+ ✅ Integration points and communication patterns defined
1969
+ ✅ Project structure aligned with chosen technology stack
1970
+ ✅ A/P/C menu presented and handled correctly
1971
+ ✅ Content properly appended to document when C selected
1972
+
1973
+ ## FAILURE MODES:
1974
+
1975
+ ❌ Creating generic placeholder structure instead of specific, complete tree
1976
+ ❌ Not mapping requirements to specific files and directories
1977
+ ❌ Missing important integration boundaries
1978
+ ❌ Not considering the chosen technology stack in structure design
1979
+ ❌ Not defining how components communicate across boundaries
1980
+ ❌ Not presenting A/P/C menu after content generation
1981
+
1982
+ ❌ **CRITICAL**: Reading only partial step file - leads to incomplete understanding and poor decisions
1983
+ ❌ **CRITICAL**: Proceeding with 'C' without fully reading and understanding the next step file
1984
+ ❌ **CRITICAL**: Making decisions without complete understanding of step requirements and protocols
1985
+
1986
+ ## NEXT STEP:
1987
+
1988
+ After user selects 'C' and content is saved to document, load `./step-07-validation.md` to validate architectural coherence and completeness.
1989
+
1990
+ Remember: Do NOT proceed to step-07 until user explicitly selects 'C' from the A/P/C menu and content is saved!
1991
+
1992
+
1993
+ # Step 7: Architecture Validation & Completion
1994
+
1995
+ ## MANDATORY EXECUTION RULES (READ FIRST):
1996
+
1997
+ - 🛑 NEVER generate content without user input
1998
+
1999
+ - 📖 CRITICAL: ALWAYS read the complete step file before taking any action - partial understanding leads to incomplete decisions
2000
+ - 🔄 CRITICAL: When loading next step with 'C', ensure the entire file is read and understood before proceeding
2001
+ - ✅ ALWAYS treat this as collaborative discovery between architectural peers
2002
+ - 📋 YOU ARE A FACILITATOR, not a content generator
2003
+ - 💬 FOCUS on validating architectural coherence and completeness
2004
+ - ✅ VALIDATE all requirements are covered by architectural decisions
2005
+ - ⚠️ ABSOLUTELY NO TIME ESTIMATES - AI development speed has fundamentally changed
2006
+ - ✅ YOU MUST ALWAYS SPEAK OUTPUT In your Agent communication style with the config `{communication_language}`
2007
+
2008
+ ## EXECUTION PROTOCOLS:
2009
+
2010
+ - 🎯 Show your analysis before taking any action
2011
+ - ✅ Run comprehensive validation checks on the complete architecture
2012
+ - ⚠️ Present A/P/C menu after generating validation results
2013
+ - 💾 ONLY save when user chooses C (Continue)
2014
+ - 📖 Update frontmatter `stepsCompleted: [1, 2, 3, 4, 5, 6, 7]` before loading next step
2015
+ - 🚫 FORBIDDEN to load next step until C is selected
2016
+
2017
+ ## COLLABORATION MENUS (A/P/C):
2018
+
2019
+ This step will generate content and present choices:
2020
+
2021
+ - **A (Advanced Elicitation)**: Use discovery protocols to address complex architectural issues found during validation
2022
+ - **P (Party Mode)**: Bring multiple perspectives to resolve validation concerns
2023
+ - **C (Continue)**: Save the validation results and complete the architecture
2024
+
2025
+ ## PROTOCOL INTEGRATION:
2026
+
2027
+ - When 'A' selected: Read fully and follow: {project-root}/_bmad/core/workflows/advanced-elicitation/workflow.xml
2028
+ - When 'P' selected: Read fully and follow: {project-root}/_bmad/core/workflows/party-mode/workflow.md
2029
+ - PROTOCOLS always return to display this step's A/P/C menu after the A or P have completed
2030
+ - User accepts/rejects protocol changes before proceeding
2031
+
2032
+ ## CONTEXT BOUNDARIES:
2033
+
2034
+ - Complete architecture document with all sections is available
2035
+ - All architectural decisions, patterns, and structure are defined
2036
+ - Focus on validation, gap analysis, and coherence checking
2037
+ - Prepare for handoff to implementation phase
2038
+
2039
+ ## YOUR TASK:
2040
+
2041
+ Validate the complete architecture for coherence, completeness, and readiness to guide AI agents through consistent implementation.
2042
+
2043
+ ## VALIDATION SEQUENCE:
2044
+
2045
+ ### 1. Coherence Validation
2046
+
2047
+ Check that all architectural decisions work together:
2048
+
2049
+ **Decision Compatibility:**
2050
+
2051
+ - Do all technology choices work together without conflicts?
2052
+ - Are all versions compatible with each other?
2053
+ - Do patterns align with technology choices?
2054
+ - Are there any contradictory decisions?
2055
+
2056
+ **Pattern Consistency:**
2057
+
2058
+ - Do implementation patterns support the architectural decisions?
2059
+ - Are naming conventions consistent across all areas?
2060
+ - Do structure patterns align with technology stack?
2061
+ - Are communication patterns coherent?
2062
+
2063
+ **Structure Alignment:**
2064
+
2065
+ - Does the project structure support all architectural decisions?
2066
+ - Are boundaries properly defined and respected?
2067
+ - Does the structure enable the chosen patterns?
2068
+ - Are integration points properly structured?
2069
+
2070
+ ### 2. Requirements Coverage Validation
2071
+
2072
+ Verify all project requirements are architecturally supported:
2073
+
2074
+ **From Epics (if available):**
2075
+
2076
+ - Does every epic have architectural support?
2077
+ - Are all user stories implementable with these decisions?
2078
+ - Are cross-epic dependencies handled architecturally?
2079
+ - Are there any gaps in epic coverage?
2080
+
2081
+ **From FR Categories (if no epics):**
2082
+
2083
+ - Does every functional requirement have architectural support?
2084
+ - Are all FR categories fully covered by architectural decisions?
2085
+ - Are cross-cutting FRs properly addressed?
2086
+ - Are there any missing architectural capabilities?
2087
+
2088
+ **Non-Functional Requirements:**
2089
+
2090
+ - Are performance requirements addressed architecturally?
2091
+ - Are security requirements fully covered?
2092
+ - Are scalability considerations properly handled?
2093
+ - Are compliance requirements architecturally supported?
2094
+
2095
+ ### 3. Implementation Readiness Validation
2096
+
2097
+ Assess if AI agents can implement consistently:
2098
+
2099
+ **Decision Completeness:**
2100
+
2101
+ - Are all critical decisions documented with versions?
2102
+ - Are implementation patterns comprehensive enough?
2103
+ - Are consistency rules clear and enforceable?
2104
+ - Are examples provided for all major patterns?
2105
+
2106
+ **Structure Completeness:**
2107
+
2108
+ - Is the project structure complete and specific?
2109
+ - Are all files and directories defined?
2110
+ - Are integration points clearly specified?
2111
+ - Are component boundaries well-defined?
2112
+
2113
+ **Pattern Completeness:**
2114
+
2115
+ - Are all potential conflict points addressed?
2116
+ - Are naming conventions comprehensive?
2117
+ - Are communication patterns fully specified?
2118
+ - Are process patterns (error handling, etc.) complete?
2119
+
2120
+ ### 4. Gap Analysis
2121
+
2122
+ Identify and document any missing elements:
2123
+
2124
+ **Critical Gaps:**
2125
+
2126
+ - Missing architectural decisions that block implementation
2127
+ - Incomplete patterns that could cause conflicts
2128
+ - Missing structural elements needed for development
2129
+ - Undefined integration points
2130
+
2131
+ **Important Gaps:**
2132
+
2133
+ - Areas that need more detailed specification
2134
+ - Patterns that could be more comprehensive
2135
+ - Documentation that would help implementation
2136
+ - Examples that would clarify complex decisions
2137
+
2138
+ **Nice-to-Have Gaps:**
2139
+
2140
+ - Additional patterns that would be helpful
2141
+ - Supplementary documentation
2142
+ - Tooling recommendations
2143
+ - Development workflow optimizations
2144
+
2145
+ ### 5. Address Validation Issues
2146
+
2147
+ For any issues found, facilitate resolution:
2148
+
2149
+ **Critical Issues:**
2150
+ "I found some issues that need to be addressed before implementation:
2151
+
2152
+ {{critical_issue_description}}
2153
+
2154
+ These could cause implementation problems. How would you like to resolve this?"
2155
+
2156
+ **Important Issues:**
2157
+ "I noticed a few areas that could be improved:
2158
+
2159
+ {{important_issue_description}}
2160
+
2161
+ These aren't blocking, but addressing them would make implementation smoother. Should we work on these?"
2162
+
2163
+ **Minor Issues:**
2164
+ "Here are some minor suggestions for improvement:
2165
+
2166
+ {{minor_issue_description}}
2167
+
2168
+ These are optional refinements. Would you like to address any of these?"
2169
+
2170
+ ### 6. Generate Validation Content
2171
+
2172
+ Prepare the content to append to the document:
2173
+
2174
+ #### Content Structure:
2175
+
2176
+ ```markdown
2177
+ ## Architecture Validation Results
2178
+
2179
+ ### Coherence Validation ✅
2180
+
2181
+ **Decision Compatibility:**
2182
+ {{assessment_of_how_all_decisions_work_together}}
2183
+
2184
+ **Pattern Consistency:**
2185
+ {{verification_that_patterns_support_decisions}}
2186
+
2187
+ **Structure Alignment:**
2188
+ {{confirmation_that_structure_supports_architecture}}
2189
+
2190
+ ### Requirements Coverage Validation ✅
2191
+
2192
+ **Epic/Feature Coverage:**
2193
+ {{verification_that_all_epics_or_features_are_supported}}
2194
+
2195
+ **Functional Requirements Coverage:**
2196
+ {{confirmation_that_all_FRs_are_architecturally_supported}}
2197
+
2198
+ **Non-Functional Requirements Coverage:**
2199
+ {{verification_that_NFRs_are_addressed}}
2200
+
2201
+ ### Implementation Readiness Validation ✅
2202
+
2203
+ **Decision Completeness:**
2204
+ {{assessment_of_decision_documentation_completeness}}
2205
+
2206
+ **Structure Completeness:**
2207
+ {{evaluation_of_project_structure_completeness}}
2208
+
2209
+ **Pattern Completeness:**
2210
+ {{verification_of_implementation_patterns_completeness}}
2211
+
2212
+ ### Gap Analysis Results
2213
+
2214
+ {{gap_analysis_findings_with_priority_levels}}
2215
+
2216
+ ### Validation Issues Addressed
2217
+
2218
+ {{description_of_any_issues_found_and_resolutions}}
2219
+
2220
+ ### Architecture Completeness Checklist
2221
+
2222
+ **✅ Requirements Analysis**
2223
+
2224
+ - [x] Project context thoroughly analyzed
2225
+ - [x] Scale and complexity assessed
2226
+ - [x] Technical constraints identified
2227
+ - [x] Cross-cutting concerns mapped
2228
+
2229
+ **✅ Architectural Decisions**
2230
+
2231
+ - [x] Critical decisions documented with versions
2232
+ - [x] Technology stack fully specified
2233
+ - [x] Integration patterns defined
2234
+ - [x] Performance considerations addressed
2235
+
2236
+ **✅ Implementation Patterns**
2237
+
2238
+ - [x] Naming conventions established
2239
+ - [x] Structure patterns defined
2240
+ - [x] Communication patterns specified
2241
+ - [x] Process patterns documented
2242
+
2243
+ **✅ Project Structure**
2244
+
2245
+ - [x] Complete directory structure defined
2246
+ - [x] Component boundaries established
2247
+ - [x] Integration points mapped
2248
+ - [x] Requirements to structure mapping complete
2249
+
2250
+ ### Architecture Readiness Assessment
2251
+
2252
+ **Overall Status:** READY FOR IMPLEMENTATION
2253
+
2254
+ **Confidence Level:** {{high/medium/low}} based on validation results
2255
+
2256
+ **Key Strengths:**
2257
+ {{list_of_architecture_strengths}}
2258
+
2259
+ **Areas for Future Enhancement:**
2260
+ {{areas_that_could_be_improved_later}}
2261
+
2262
+ ### Implementation Handoff
2263
+
2264
+ **AI Agent Guidelines:**
2265
+
2266
+ - Follow all architectural decisions exactly as documented
2267
+ - Use implementation patterns consistently across all components
2268
+ - Respect project structure and boundaries
2269
+ - Refer to this document for all architectural questions
2270
+
2271
+ **First Implementation Priority:**
2272
+ {{starter_template_command_or_first_architectural_step}}
2273
+ ```
2274
+
2275
+ ### 7. Present Content and Menu
2276
+
2277
+ Show the validation results and present choices:
2278
+
2279
+ "I've completed a comprehensive validation of your architecture.
2280
+
2281
+ **Validation Summary:**
2282
+
2283
+ - ✅ Coherence: All decisions work together
2284
+ - ✅ Coverage: All requirements are supported
2285
+ - ✅ Readiness: AI agents can implement consistently
2286
+
2287
+ **Here's what I'll add to complete the architecture document:**
2288
+
2289
+ [Show the complete markdown content from step 6]
2290
+
2291
+ **What would you like to do?**
2292
+ [A] Advanced Elicitation - Address any complex architectural concerns
2293
+ [P] Party Mode - Review validation from different implementation perspectives
2294
+ [C] Continue - Complete the architecture and finish workflow
2295
+
2296
+ ### 8. Handle Menu Selection
2297
+
2298
+ #### If 'A' (Advanced Elicitation):
2299
+
2300
+ - Read fully and follow: {project-root}/_bmad/core/workflows/advanced-elicitation/workflow.xml with validation issues
2301
+ - Process enhanced solutions for complex concerns
2302
+ - Ask user: "Accept these architectural improvements? (y/n)"
2303
+ - If yes: Update content, then return to A/P/C menu
2304
+ - If no: Keep original content, then return to A/P/C menu
2305
+
2306
+ #### If 'P' (Party Mode):
2307
+
2308
+ - Read fully and follow: {project-root}/_bmad/core/workflows/party-mode/workflow.md with validation context
2309
+ - Process collaborative insights on implementation readiness
2310
+ - Ask user: "Accept these changes to the validation results? (y/n)"
2311
+ - If yes: Update content, then return to A/P/C menu
2312
+ - If no: Keep original content, then return to A/P/C menu
2313
+
2314
+ #### If 'C' (Continue):
2315
+
2316
+ - Append the final content to `{planning_artifacts}/architecture.md`
2317
+ - Update frontmatter: `stepsCompleted: [1, 2, 3, 4, 5, 6, 7]`
2318
+ - Load `./step-08-complete.md`
2319
+
2320
+ ## APPEND TO DOCUMENT:
2321
+
2322
+ When user selects 'C', append the content directly to the document using the structure from step 6.
2323
+
2324
+ ## SUCCESS METRICS:
2325
+
2326
+ ✅ All architectural decisions validated for coherence
2327
+ ✅ Complete requirements coverage verified
2328
+ ✅ Implementation readiness confirmed
2329
+ ✅ All gaps identified and addressed
2330
+ ✅ Comprehensive validation checklist completed
2331
+ ✅ A/P/C menu presented and handled correctly
2332
+ ✅ Content properly appended to document when C selected
2333
+
2334
+ ## FAILURE MODES:
2335
+
2336
+ ❌ Skipping validation of decision compatibility
2337
+ ❌ Not verifying all requirements are architecturally supported
2338
+ ❌ Missing potential implementation conflicts
2339
+ ❌ Not addressing gaps found during validation
2340
+ ❌ Providing incomplete validation checklist
2341
+ ❌ Not presenting A/P/C menu after content generation
2342
+
2343
+ ❌ **CRITICAL**: Reading only partial step file - leads to incomplete understanding and poor decisions
2344
+ ❌ **CRITICAL**: Proceeding with 'C' without fully reading and understanding the next step file
2345
+ ❌ **CRITICAL**: Making decisions without complete understanding of step requirements and protocols
2346
+
2347
+ ## NEXT STEP:
2348
+
2349
+ After user selects 'C' and content is saved to document, load `./step-08-complete.md` to complete the workflow and provide implementation guidance.
2350
+
2351
+ Remember: Do NOT proceed to step-08 until user explicitly selects 'C' from the A/P/C menu and content is saved!
2352
+
2353
+
2354
+ # Step 8: Architecture Completion & Handoff
2355
+
2356
+ ## MANDATORY EXECUTION RULES (READ FIRST):
2357
+
2358
+ - 🛑 NEVER generate content without user input
2359
+
2360
+ - 📖 CRITICAL: ALWAYS read the complete step file before taking any action - partial understanding leads to incomplete decisions
2361
+ - ✅ ALWAYS treat this as collaborative completion between architectural peers
2362
+ - 📋 YOU ARE A FACILITATOR, not a content generator
2363
+ - 💬 FOCUS on successful workflow completion and implementation handoff
2364
+ - 🎯 PROVIDE clear next steps for implementation phase
2365
+ - ⚠️ ABSOLUTELY NO TIME ESTIMATES - AI development speed has fundamentally changed
2366
+ - ✅ YOU MUST ALWAYS SPEAK OUTPUT In your Agent communication style with the config `{communication_language}`
2367
+
2368
+ ## EXECUTION PROTOCOLS:
2369
+
2370
+ - 🎯 Show your analysis before taking any action
2371
+ - 🎯 Present completion summary and implementation guidance
2372
+ - 📖 Update frontmatter with final workflow state
2373
+ - 🚫 THIS IS THE FINAL STEP IN THIS WORKFLOW
2374
+
2375
+ ## YOUR TASK:
2376
+
2377
+ Complete the architecture workflow, provide a comprehensive completion summary, and guide the user to the next phase of their project development.
2378
+
2379
+ ## COMPLETION SEQUENCE:
2380
+
2381
+ ### 1. Congratulate the User on Completion
2382
+
2383
+ Both you and the User completed something amazing here - give a summary of what you achieved together and really congratulate the user on a job well done.
2384
+
2385
+ ### 2. Update the created document's frontmatter
2386
+
2387
+ ```yaml
2388
+ stepsCompleted: [1, 2, 3, 4, 5, 6, 7, 8]
2389
+ workflowType: 'architecture'
2390
+ lastStep: 8
2391
+ status: 'complete'
2392
+ completedAt: '{{current_date}}'
2393
+ ```
2394
+
2395
+ ### 3. Next Steps Guidance
2396
+
2397
+ Architecture complete. Read fully and follow: `_bmad/core/tasks/bmad-help.md` with argument `Create Architecture`.
2398
+
2399
+ Upon Completion of task output: offer to answer any questions about the Architecture Document.
2400
+
2401
+
2402
+ ## SUCCESS METRICS:
2403
+
2404
+ ✅ Complete architecture document delivered with all sections
2405
+ ✅ All architectural decisions documented and validated
2406
+ ✅ Implementation patterns and consistency rules finalized
2407
+ ✅ Project structure complete with all files and directories
2408
+ ✅ User provided with clear next steps and implementation guidance
2409
+ ✅ Workflow status properly updated
2410
+ ✅ User collaboration maintained throughout completion process
2411
+
2412
+ ## FAILURE MODES:
2413
+
2414
+ ❌ Not providing clear implementation guidance
2415
+ ❌ Missing final validation of document completeness
2416
+ ❌ Not updating workflow status appropriately
2417
+ ❌ Failing to celebrate the successful completion
2418
+ ❌ Not providing specific next steps for the user
2419
+ ❌ Rushing completion without proper summary
2420
+
2421
+ ❌ **CRITICAL**: Reading only partial step file - leads to incomplete understanding and poor decisions
2422
+ ❌ **CRITICAL**: Proceeding with 'C' without fully reading and understanding the next step file
2423
+ ❌ **CRITICAL**: Making decisions without complete understanding of step requirements and protocols
2424
+
2425
+ ## WORKFLOW COMPLETE:
2426
+
2427
+ This is the final step of the Architecture workflow. The user now has a complete, validated architecture document ready for AI agent implementation.
2428
+
2429
+ The architecture will serve as the single source of truth for all technical decisions, ensuring consistent implementation across the entire project development lifecycle.
65
2430
 
66
- **Note:** Input document discovery and all initialization protocols are handled in step-01-init.md.