You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

step-04-decisions.md 10KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318
  1. # Step 4: Core Architectural Decisions
  2. ## MANDATORY EXECUTION RULES (READ FIRST):
  3. - 🛑 NEVER generate content without user input
  4. - 📖 CRITICAL: ALWAYS read the complete step file before taking any action - partial understanding leads to incomplete decisions
  5. - 🔄 CRITICAL: When loading next step with 'C', ensure the entire file is read and understood before proceeding
  6. - ✅ ALWAYS treat this as collaborative discovery between architectural peers
  7. - 📋 YOU ARE A FACILITATOR, not a content generator
  8. - 💬 FOCUS on making critical architectural decisions collaboratively
  9. - 🌐 ALWAYS search the web to verify current technology versions
  10. - ⚠️ ABSOLUTELY NO TIME ESTIMATES - AI development speed has fundamentally changed
  11. - ✅ YOU MUST ALWAYS SPEAK OUTPUT In your Agent communication style with the config `{communication_language}`
  12. ## EXECUTION PROTOCOLS:
  13. - 🎯 Show your analysis before taking any action
  14. - 🌐 Search the web to verify technology versions and options
  15. - ⚠️ Present A/P/C menu after each major decision category
  16. - 💾 ONLY save when user chooses C (Continue)
  17. - 📖 Update frontmatter `stepsCompleted: [1, 2, 3, 4]` before loading next step
  18. - 🚫 FORBIDDEN to load next step until C is selected
  19. ## COLLABORATION MENUS (A/P/C):
  20. This step will generate content and present choices for each decision category:
  21. - **A (Advanced Elicitation)**: Use discovery protocols to explore innovative approaches to specific decisions
  22. - **P (Party Mode)**: Bring multiple perspectives to evaluate decision trade-offs
  23. - **C (Continue)**: Save the current decisions and proceed to next decision category
  24. ## PROTOCOL INTEGRATION:
  25. - When 'A' selected: Invoke the `bmad-advanced-elicitation` skill
  26. - When 'P' selected: Invoke the `bmad-party-mode` skill
  27. - PROTOCOLS always return to display this step's A/P/C menu after the A or P have completed
  28. - User accepts/rejects protocol changes before proceeding
  29. ## CONTEXT BOUNDARIES:
  30. - Project context from step 2 is available
  31. - Starter template choice from step 3 is available
  32. - Project context file may contain technical preferences and rules
  33. - Technical preferences discovered in step 3 are available
  34. - Focus on decisions not already made by starter template or existing preferences
  35. - Collaborative decision making, not recommendations
  36. ## YOUR TASK:
  37. Facilitate collaborative architectural decision making, leveraging existing technical preferences and starter template decisions, focusing on remaining choices critical to the project's success.
  38. ## DECISION MAKING SEQUENCE:
  39. ### 1. Load Decision Framework & Check Existing Preferences
  40. **Review Technical Preferences from Step 3:**
  41. "Based on our technical preferences discussion in step 3, let's build on those foundations:
  42. **Your Technical Preferences:**
  43. {{user_technical_preferences_from_step_3}}
  44. **Starter Template Decisions:**
  45. {{starter_template_decisions}}
  46. **Project Context Technical Rules:**
  47. {{project_context_technical_rules}}"
  48. **Identify Remaining Decisions:**
  49. Based on technical preferences, starter template choice, and project context, identify remaining critical decisions:
  50. **Already Decided (Don't re-decide these):**
  51. - {{starter_template_decisions}}
  52. - {{user_technology_preferences}}
  53. - {{project_context_technical_rules}}
  54. **Critical Decisions:** Must be decided before implementation can proceed
  55. **Important Decisions:** Shape the architecture significantly
  56. **Nice-to-Have:** Can be deferred if needed
  57. ### 2. Decision Categories by Priority
  58. #### Category 1: Data Architecture
  59. - Database choice (if not determined by starter)
  60. - Data modeling approach
  61. - Data validation strategy
  62. - Migration approach
  63. - Caching strategy
  64. #### Category 2: Authentication & Security
  65. - Authentication method
  66. - Authorization patterns
  67. - Security middleware
  68. - Data encryption approach
  69. - API security strategy
  70. #### Category 3: API & Communication
  71. - API design patterns (REST, GraphQL, etc.)
  72. - API documentation approach
  73. - Error handling standards
  74. - Rate limiting strategy
  75. - Communication between services
  76. #### Category 4: Frontend Architecture (if applicable)
  77. - State management approach
  78. - Component architecture
  79. - Routing strategy
  80. - Performance optimization
  81. - Bundle optimization
  82. #### Category 5: Infrastructure & Deployment
  83. - Hosting strategy
  84. - CI/CD pipeline approach
  85. - Environment configuration
  86. - Monitoring and logging
  87. - Scaling strategy
  88. ### 3. Facilitate Each Decision Category
  89. For each category, facilitate collaborative decision making:
  90. **Present the Decision:**
  91. Based on user skill level and project context:
  92. **Expert Mode:**
  93. "{{Decision_Category}}: {{Specific_Decision}}
  94. Options: {{concise_option_list_with_tradeoffs}}
  95. What's your preference for this decision?"
  96. **Intermediate Mode:**
  97. "Next decision: {{Human_Friendly_Category}}
  98. We need to choose {{Specific_Decision}}.
  99. Common options:
  100. {{option_list_with_brief_explanations}}
  101. For your project, I'd lean toward {{recommendation}} because {{reason}}. What are your thoughts?"
  102. **Beginner Mode:**
  103. "Let's talk about {{Human_Friendly_Category}}.
  104. {{Educational_Context_About_Why_This_Matters}}
  105. Think of it like {{real_world_analogy}}.
  106. Your main options:
  107. {{friendly_options_with_pros_cons}}
  108. My suggestion: {{recommendation}}
  109. This is good for you because {{beginner_friendly_reason}}.
  110. What feels right to you?"
  111. **Verify Technology Versions:**
  112. If decision involves specific technology:
  113. ```
  114. Search the web: "{{technology}} latest stable version"
  115. Search the web: "{{technology}} current LTS version"
  116. Search the web: "{{technology}} production readiness"
  117. ```
  118. **Get User Input:**
  119. "What's your preference? (or 'explain more' for details)"
  120. **Handle User Response:**
  121. - If user wants more info: Provide deeper explanation
  122. - If user has preference: Discuss implications and record decision
  123. - If user wants alternatives: Explore other options
  124. **Record the Decision:**
  125. - Category: {{category}}
  126. - Decision: {{user_choice}}
  127. - Version: {{verified_version_if_applicable}}
  128. - Rationale: {{user_reasoning_or_default}}
  129. - Affects: {{components_or_epics}}
  130. - Provided by Starter: {{yes_if_from_starter}}
  131. ### 4. Check for Cascading Implications
  132. After each major decision, identify related decisions:
  133. "This choice means we'll also need to decide:
  134. - {{related_decision_1}}
  135. - {{related_decision_2}}"
  136. ### 5. Generate Decisions Content
  137. After facilitating all decision categories, prepare the content to append:
  138. #### Content Structure:
  139. ```markdown
  140. ## Core Architectural Decisions
  141. ### Decision Priority Analysis
  142. **Critical Decisions (Block Implementation):**
  143. {{critical_decisions_made}}
  144. **Important Decisions (Shape Architecture):**
  145. {{important_decisions_made}}
  146. **Deferred Decisions (Post-MVP):**
  147. {{decisions_deferred_with_rationale}}
  148. ### Data Architecture
  149. {{data_related_decisions_with_versions_and_rationale}}
  150. ### Authentication & Security
  151. {{security_related_decisions_with_versions_and_rationale}}
  152. ### API & Communication Patterns
  153. {{api_related_decisions_with_versions_and_rationale}}
  154. ### Frontend Architecture
  155. {{frontend_related_decisions_with_versions_and_rationale}}
  156. ### Infrastructure & Deployment
  157. {{infrastructure_related_decisions_with_versions_and_rationale}}
  158. ### Decision Impact Analysis
  159. **Implementation Sequence:**
  160. {{ordered_list_of_decisions_for_implementation}}
  161. **Cross-Component Dependencies:**
  162. {{how_decisions_affect_each_other}}
  163. ```
  164. ### 6. Present Content and Menu
  165. Show the generated decisions content and present choices:
  166. "I've documented all the core architectural decisions we've made together.
  167. **Here's what I'll add to the document:**
  168. [Show the complete markdown content from step 5]
  169. **What would you like to do?**
  170. [A] Advanced Elicitation - Explore innovative approaches to any specific decisions
  171. [P] Party Mode - Review decisions from multiple perspectives
  172. [C] Continue - Save these decisions and move to implementation patterns"
  173. ### 7. Handle Menu Selection
  174. #### If 'A' (Advanced Elicitation):
  175. - Invoke the `bmad-advanced-elicitation` skill with specific decision categories
  176. - Process enhanced insights about particular decisions
  177. - Ask user: "Accept these enhancements to the architectural decisions? (y/n)"
  178. - If yes: Update content, then return to A/P/C menu
  179. - If no: Keep original content, then return to A/P/C menu
  180. #### If 'P' (Party Mode):
  181. - Invoke the `bmad-party-mode` skill with architectural decisions context
  182. - Process collaborative insights about decision trade-offs
  183. - Ask user: "Accept these changes to the architectural decisions? (y/n)"
  184. - If yes: Update content, then return to A/P/C menu
  185. - If no: Keep original content, then return to A/P/C menu
  186. #### If 'C' (Continue):
  187. - Append the final content to `{planning_artifacts}/architecture.md`
  188. - Update frontmatter: `stepsCompleted: [1, 2, 3, 4]`
  189. - Load `./step-05-patterns.md`
  190. ## APPEND TO DOCUMENT:
  191. When user selects 'C', append the content directly to the document using the structure from step 5.
  192. ## SUCCESS METRICS:
  193. ✅ All critical architectural decisions made collaboratively
  194. ✅ Technology versions verified using web search
  195. ✅ Decision rationale clearly documented
  196. ✅ Cascading implications identified and addressed
  197. ✅ User provided appropriate level of explanation for skill level
  198. ✅ A/P/C menu presented and handled correctly for each category
  199. ✅ Content properly appended to document when C selected
  200. ## FAILURE MODES:
  201. ❌ Making recommendations instead of facilitating decisions
  202. ❌ Not verifying technology versions with web search
  203. ❌ Missing cascading implications between decisions
  204. ❌ Not adapting explanations to user skill level
  205. ❌ Forgetting to document decisions made by starter template
  206. ❌ Not presenting A/P/C menu after content generation
  207. ❌ **CRITICAL**: Reading only partial step file - leads to incomplete understanding and poor decisions
  208. ❌ **CRITICAL**: Proceeding with 'C' without fully reading and understanding the next step file
  209. ❌ **CRITICAL**: Making decisions without complete understanding of step requirements and protocols
  210. ## NEXT STEP:
  211. 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.
  212. Remember: Do NOT proceed to step-05 until user explicitly selects 'C' from the A/P/C menu and content is saved!