diff --git a/bmad-core/agent-teams/team-all.yaml b/bmad-core/agent-teams/team-all.yaml index 76a0576d..8a55772c 100644 --- a/bmad-core/agent-teams/team-all.yaml +++ b/bmad-core/agent-teams/team-all.yaml @@ -6,9 +6,9 @@ agents: - bmad-orchestrator - '*' workflows: - - brownfield-fullstack - - brownfield-service - - brownfield-ui - - greenfield-fullstack - - greenfield-service - - greenfield-ui + - brownfield-fullstack.yaml + - brownfield-service.yaml + - brownfield-ui.yaml + - greenfield-fullstack.yaml + - greenfield-service.yaml + - greenfield-ui.yaml diff --git a/bmad-core/agent-teams/team-fullstack.yaml b/bmad-core/agent-teams/team-fullstack.yaml index d875487c..e75a7201 100644 --- a/bmad-core/agent-teams/team-fullstack.yaml +++ b/bmad-core/agent-teams/team-fullstack.yaml @@ -10,9 +10,9 @@ agents: - architect - po workflows: - - brownfield-fullstack - - brownfield-service - - brownfield-ui - - greenfield-fullstack - - greenfield-service - - greenfield-ui + - brownfield-fullstack.yaml + - brownfield-service.yaml + - brownfield-ui.yaml + - greenfield-fullstack.yaml + - greenfield-service.yaml + - greenfield-ui.yaml diff --git a/bmad-core/agent-teams/team-no-ui.yaml b/bmad-core/agent-teams/team-no-ui.yaml index 17b3c6e5..a8cd4924 100644 --- a/bmad-core/agent-teams/team-no-ui.yaml +++ b/bmad-core/agent-teams/team-no-ui.yaml @@ -9,5 +9,5 @@ agents: - architect - po workflows: - - greenfield-service - - brownfield-service + - greenfield-service.yaml + - brownfield-service.yaml diff --git a/bmad-core/agents/analyst.md b/bmad-core/agents/analyst.md index 5d98379d..78a2e83f 100644 --- a/bmad-core/agents/analyst.md +++ b/bmad-core/agents/analyst.md @@ -51,16 +51,16 @@ commands: dependencies: tasks: - facilitate-brainstorming-session.md - - create-deep-research-prompt - - create-doc - - advanced-elicitation - - document-project + - create-deep-research-prompt.md + - create-doc.md + - advanced-elicitation.md + - document-project.md templates: - project-brief-tmpl.yaml - market-research-tmpl.yaml - competitor-analysis-tmpl.yaml - brainstorming-output-tmpl.yaml data: - - bmad-kb - - brainstorming-techniques + - bmad-kb.md + - brainstorming-techniques.md ``` diff --git a/bmad-core/agents/dev.md b/bmad-core/agents/dev.md index 90cbef84..8d94e4dc 100644 --- a/bmad-core/agents/dev.md +++ b/bmad-core/agents/dev.md @@ -50,8 +50,8 @@ develop-story: dependencies: tasks: - - execute-checklist - - validate-next-story + - execute-checklist.md + - validate-next-story.md checklists: - - story-dod-checklist + - story-dod-checklist.md ``` diff --git a/bmad-core/agents/ux-expert.md b/bmad-core/agents/ux-expert.md index ee59c8bc..207ed38c 100644 --- a/bmad-core/agents/ux-expert.md +++ b/bmad-core/agents/ux-expert.md @@ -43,14 +43,12 @@ commands: - exit: Say goodbye as the UX Expert, and then abandon inhabiting this persona dependencies: tasks: - - generate-ai-frontend-prompt - - create-deep-research-prompt - - create-doc - - execute-checklist + - generate-ai-frontend-prompt.md + - create-deep-research-prompt.md + - create-doc.md + - execute-checklist.md templates: - - front-end-spec-tmpl + - front-end-spec-tmpl.yaml data: - - technical-preferences - utils: - - template-format + - technical-preferences.md ``` diff --git a/dist/agents/analyst.txt b/dist/agents/analyst.txt index eeb61e5e..8dc53f51 100644 --- a/dist/agents/analyst.txt +++ b/dist/agents/analyst.txt @@ -48,8 +48,9 @@ CRITICAL: Read the full YAML, start activation to alter your state of being, fol activation-instructions: - Follow all instructions in this file -> this defines you, your persona and more importantly what you can do. STAY IN CHARACTER! - Only read the files/tasks listed here when user selects them for execution to minimize context usage - - The customization field ALWAYS takes precedence over any conflicting instructions + - The agent.customization field ALWAYS takes precedence over any conflicting instructions - When listing tasks/templates or presenting options during conversations, always show as numbered options list, allowing the user to type a number to select or execute + - Greet the user with your name and role, and inform of the *help command. agent: name: Mary id: analyst @@ -74,36 +75,32 @@ persona: - Maintaining a Broad Perspective - Stay aware of market trends and dynamics - Integrity of Information - Ensure accurate sourcing and representation - Numbered Options Protocol - Always use numbered lists for selections -startup: - - Greet the user with your name and role, and inform of the *help command. commands: - help: Show numbered list of the following commands to allow selection - create-doc {template}: execute task create-doc (no template = ONLY show available templates listed under dependencies/templates below) - - yolo: Toggle Yolo Mode off on - on will skip doc section confirmations + - yolo: Toggle Yolo Mode - doc-out: Output full document to current destination file - execute-checklist {checklist}: Run task execute-checklist (default->architect-checklist) - - research {topic}: execute task create-deep-research-prompt for architectural decisions + - research-prompt {topic}: execute task create-deep-research-prompt for architectural decisions - brainstorm {topic}: Facilitate structured brainstorming session - - elicit: list the options under output set of information + - elicit: run the task advanced-elicitation - document-project: Analyze and document existing project structure comprehensively - exit: Say goodbye as the Business Analyst, and then abandon inhabiting this persona dependencies: tasks: - - facilitate-brainstorming-session - - create-deep-research-prompt - - create-doc - - advanced-elicitation - - document-project + - facilitate-brainstorming-session.md + - create-deep-research-prompt.md + - create-doc.md + - advanced-elicitation.md + - document-project.md templates: - - project-brief-tmpl - - market-research-tmpl - - competitor-analysis-tmpl - - brainstorming-output-tmpl + - project-brief-tmpl.yaml + - market-research-tmpl.yaml + - competitor-analysis-tmpl.yaml + - brainstorming-output-tmpl.yaml data: - - bmad-kb - - brainstorming-techniques - utils: - - template-format + - bmad-kb.md + - brainstorming-techniques.md ``` ==================== END: .bmad-core/agents/analyst.md ==================== @@ -551,97 +548,85 @@ Present these numbered options to the user: ==================== END: .bmad-core/tasks/create-deep-research-prompt.md ==================== ==================== START: .bmad-core/tasks/create-doc.md ==================== -# Create Document from Template Task +# Create Document from Template (YAML Driven) -## Purpose +## CRITICAL: Mandatory Elicitation Format -Generate documents from templates by EXECUTING (not just reading) embedded instructions from the perspective of the selected agent persona. +**When `elicit: true`, ALWAYS use this exact format:** -## CRITICAL RULES +1. Present section content +2. Provide detailed rationale (explain trade-offs, assumptions, decisions made) +3. Present numbered options 1-9: + - **Option 1:** Always "Proceed to next section" + - **Options 2-9:** Select 8 methods from data/elicitation-methods + - End with: "Select 1-9 or just type your question/feedback:" -1. **Templates are PROGRAMS** - Execute every [[LLM:]] instruction exactly as written -2. **NEVER show markup** - Hide all [[LLM:]], {{placeholders}}, @{examples}, and template syntax -3. **STOP and EXECUTE** - When you see "apply tasks#" or "execute tasks#", STOP and run that task immediately -4. **WAIT for user input** - At review points and after elicitation tasks +**NEVER ask yes/no questions or use any other format.** -## Execution Flow +## Processing Flow -### 0. Check Workflow Plan (if configured) +1. **Parse YAML template** - Load template metadata and sections +2. **Set preferences** - Show current mode (Interactive), confirm output file +3. **Process each section:** + - Skip if condition unmet + - Check agent permissions (owner/editors) - note if section is restricted to specific agents + - Draft content using section instruction + - Present content + detailed rationale + - **IF elicit: true** → MANDATORY 1-9 options format + - Save to file if possible +4. **Continue until complete** -[[LLM: Check if plan tracking is enabled in core-config.yaml]] +## Detailed Rationale Requirements -- If `workflow.trackProgress: true`, check for active plan using .bmad-core/utils/plan-management.md -- If plan exists and this document creation is part of the plan: - - Verify this is the expected next step - - If out of sequence and `enforceSequence: true`, warn user and halt without user override - - If out of sequence and `enforceSequence: false`, ask for confirmation -- Continue with normal execution after plan check +When presenting section content, ALWAYS include rationale that explains: -### 1. Identify Template +- Trade-offs and choices made (what was chosen over alternatives and why) +- Key assumptions made during drafting +- Interesting or questionable decisions that need user attention +- Areas that might need validation -- Load from `.bmad-core/templates/*.md` or `.bmad-core/templates directory` -- Agent-specific templates are listed in agent's dependencies -- If agent has `templates: [prd-tmpl, architecture-tmpl]` for example, then offer to create "PRD" and "Architecture" documents +## Elicitation Results Flow -### 2. Ask Interaction Mode +After user selects elicitation method (2-9): -> 1. **Incremental** - Section by section with reviews -> 2. **YOLO Mode** - Complete draft then review (user can type `/yolo` anytime to switch) +1. Execute method from data/elicitation-methods +2. Present results with insights +3. Offer options: + - **1. Apply changes and update section** + - **2. Return to elicitation menu** + - **3. Ask any questions or engage further with this elicitation** -### 3. Execute Template +## Agent Permissions -- Replace {{placeholders}} with real content -- Execute [[LLM:]] instructions as you encounter them -- Process <> loops and ^^CONDITIONS^^ -- Use @{examples} for guidance but never output them +When processing sections with agent permission fields: -### 4. Key Execution Patterns +- **owner**: Note which agent role initially creates/populates the section +- **editors**: List agent roles allowed to modify the section +- **readonly**: Mark sections that cannot be modified after creation -**When you see:** `[[LLM: Draft X and immediately execute .bmad-core/tasks/advanced-elicitation.md]]` +**For sections with restricted access:** -- Draft the content -- Present it to user -- IMMEDIATELY execute the task -- Wait for completion before continuing +- Include a note in the generated document indicating the responsible agent +- Example: "_(This section is owned by dev-agent and can only be modified by dev-agent)_" -**When you see:** `[[LLM: After section completion, apply .bmad-core/tasks/Y.md]]` +## YOLO Mode -- Finish the section -- STOP and execute the task -- Wait for user input +User can type `#yolo` to toggle to YOLO mode (process all sections at once). -### 5. Validation & Final Presentation +## CRITICAL REMINDERS -- Run any specified checklists -- Present clean, formatted content only -- No truncation or summarization -- Begin directly with content (no preamble) -- Include any handoff prompts from template +**❌ NEVER:** -### 6. Update Workflow Plan (if applicable) +- Ask yes/no questions for elicitation +- Use any format other than 1-9 numbered options +- Create new elicitation methods -[[LLM: After successful document creation]] +**✅ ALWAYS:** -- If plan tracking is enabled and document was part of plan: - - Call update-workflow-plan task to mark step complete - - Parameters: task: create-doc, step_id: {from plan}, status: complete - - Show next recommended step from plan - -## Common Mistakes to Avoid - -❌ Skipping elicitation tasks -❌ Showing template markup to users -❌ Continuing past STOP signals -❌ Combining multiple review points - -✅ Execute ALL instructions in sequence -✅ Present only clean, formatted content -✅ Stop at every elicitation point -✅ Wait for user confirmation when instructed - -## Remember - -Templates contain precise instructions for a reason. Follow them exactly to ensure document quality and completeness. +- Use exact 1-9 format when elicit: true +- Select options 2-9 from data/elicitation-methods only +- Provide detailed rationale explaining decisions +- End with "Select 1-9 or just type your question/feedback:" ==================== END: .bmad-core/tasks/create-doc.md ==================== ==================== START: .bmad-core/tasks/advanced-elicitation.md ==================== @@ -1084,952 +1069,939 @@ Apply the advanced elicitation task after major sections to refine based on user - The goal is PRACTICAL documentation for AI agents doing real work ==================== END: .bmad-core/tasks/document-project.md ==================== -==================== START: .bmad-core/templates/project-brief-tmpl.md ==================== ---- -defaultOutput: docs/brief.md ---- - -# Project Brief: {{Project Name}} - -[[LLM: This template guides creation of a comprehensive Project Brief that serves as the foundational input for product development. - -Start by asking the user which mode they prefer: - -1. **Interactive Mode** - Work through each section collaboratively -2. **YOLO Mode** - Generate complete draft for review and refinement - -Before beginning, understand what inputs are available (brainstorming results, market research, competitive analysis, initial ideas) and gather project context.]] - -## Executive Summary - -[[LLM: Create a concise overview that captures the essence of the project. Include: - -- Product concept in 1-2 sentences -- Primary problem being solved -- Target market identification -- Key value proposition]] - -{{Write executive summary based on information gathered}} - -## Problem Statement - -[[LLM: Articulate the problem with clarity and evidence. Address: - -- Current state and pain points -- Impact of the problem (quantify if possible) -- Why existing solutions fall short -- Urgency and importance of solving this now]] - -{{Detailed problem description with supporting evidence}} - -## Proposed Solution - -[[LLM: Describe the solution approach at a high level. Include: - -- Core concept and approach -- Key differentiators from existing solutions -- Why this solution will succeed where others haven't -- High-level vision for the product]] - -{{Solution description focusing on the "what" and "why", not implementation details}} - -## Target Users - -[[LLM: Define and characterize the intended users with specificity. For each user segment include: - -- Demographic/firmographic profile -- Current behaviors and workflows -- Specific needs and pain points -- Goals they're trying to achieve]] - -### Primary User Segment: {{Segment Name}} - -{{Detailed description of primary users}} - -### Secondary User Segment: {{Segment Name}} - -{{Description of secondary users if applicable}} - -## Goals & Success Metrics - -[[LLM: Establish clear objectives and how to measure success. Make goals SMART (Specific, Measurable, Achievable, Relevant, Time-bound)]] - -### Business Objectives - -- {{Objective 1 with metric}} -- {{Objective 2 with metric}} -- {{Objective 3 with metric}} - -### User Success Metrics - -- {{How users will measure value}} -- {{Engagement metrics}} -- {{Satisfaction indicators}} - -### Key Performance Indicators (KPIs) - -- {{KPI 1: Definition and target}} -- {{KPI 2: Definition and target}} -- {{KPI 3: Definition and target}} - -## MVP Scope - -[[LLM: Define the minimum viable product clearly. Be specific about what's in and what's out. Help user distinguish must-haves from nice-to-haves.]] - -### Core Features (Must Have) - -- **Feature 1:** {{Brief description and why it's essential}} -- **Feature 2:** {{Brief description and why it's essential}} -- **Feature 3:** {{Brief description and why it's essential}} - -### Out of Scope for MVP - -- {{Feature/capability explicitly not in MVP}} -- {{Feature/capability to be considered post-MVP}} - -### MVP Success Criteria - -{{Define what constitutes a successful MVP launch}} - -## Post-MVP Vision - -[[LLM: Outline the longer-term product direction without overcommitting to specifics]] - -### Phase 2 Features - -{{Next priority features after MVP success}} - -### Long-term Vision - -{{Where this product could go in 1-2 years}} - -### Expansion Opportunities - -{{Potential new markets, use cases, or integrations}} - -## Technical Considerations - -[[LLM: Document known technical constraints and preferences. Note these are initial thoughts, not final decisions.]] - -### Platform Requirements - -- **Target Platforms:** {{Web, mobile, desktop, etc.}} -- **Browser/OS Support:** {{Specific requirements}} -- **Performance Requirements:** {{Load times, concurrent users, etc.}} - -### Technology Preferences - -- **Frontend:** {{If any preferences exist}} -- **Backend:** {{If any preferences exist}} -- **Database:** {{If any preferences exist}} -- **Hosting/Infrastructure:** {{Cloud preferences, on-prem requirements}} - -### Architecture Considerations - -- **Repository Structure:** {{Initial thoughts on monorepo vs. polyrepo}} -- **Service Architecture:** {{Initial thoughts on monolith vs. microservices}} -- **Integration Requirements:** {{Third-party services, APIs}} -- **Security/Compliance:** {{Any specific requirements}} - -## Constraints & Assumptions - -[[LLM: Clearly state limitations and assumptions to set realistic expectations]] - -### Constraints - -- **Budget:** {{If known}} -- **Timeline:** {{Target launch date or development timeframe}} -- **Resources:** {{Team size, skill constraints}} -- **Technical:** {{Legacy systems, required tech stack}} - -### Key Assumptions - -- {{Assumption about users, market, or technology}} -- {{Assumption about resources or support}} -- {{Assumption about external dependencies}} - -## Risks & Open Questions - -[[LLM: Identify unknowns and potential challenges proactively]] - -### Key Risks - -- **Risk 1:** {{Description and potential impact}} -- **Risk 2:** {{Description and potential impact}} -- **Risk 3:** {{Description and potential impact}} - -### Open Questions - -- {{Question needing research or decision}} -- {{Question about technical approach}} -- {{Question about market or users}} - -### Areas Needing Further Research - -- {{Topic requiring deeper investigation}} -- {{Validation needed before proceeding}} - -## Appendices - -### A. Research Summary - -{{If applicable, summarize key findings from: - -- Market research -- Competitive analysis -- User interviews -- Technical feasibility studies}} - -### B. Stakeholder Input - -{{Key feedback or requirements from stakeholders}} - -### C. References - -{{Links to relevant documents, research, or examples}} - -## Next Steps - -### Immediate Actions - -1. {{First concrete next step}} -2. {{Second concrete next step}} -3. {{Third concrete next step}} - -### PM Handoff - -This Project Brief provides the full context for {{Project Name}}. Please start in 'PRD Generation Mode', review the brief thoroughly to work with the user to create the PRD section by section as the template indicates, asking for any necessary clarification or suggesting improvements. - ---- - -[[LLM: After completing each major section (not subsections), offer advanced elicitation with these custom options for project briefs: - -**Project Brief Elicitation Actions** 0. Expand section with more specific details - -1. Validate against similar successful products -2. Stress test assumptions with edge cases -3. Explore alternative solution approaches -4. Analyze resource/constraint trade-offs -5. Generate risk mitigation strategies -6. Challenge scope from MVP minimalist view -7. Brainstorm creative feature possibilities -8. If only we had [resource/capability/time]... -9. Proceed to next section - -These replace the standard elicitation options when working on project brief documents.]] -==================== END: .bmad-core/templates/project-brief-tmpl.md ==================== - -==================== START: .bmad-core/templates/market-research-tmpl.md ==================== -# Market Research Report: {{Project/Product Name}} - -[[LLM: The default path and filename unless specified is docs/market-research.md]] - -[[LLM: This template guides the creation of a comprehensive market research report. Begin by understanding what market insights the user needs and why. Work through each section systematically, using the appropriate analytical frameworks based on the research objectives.]] - -## Executive Summary - -{{Provide a high-level overview of key findings, market opportunity assessment, and strategic recommendations. Write this section LAST after completing all other sections.}} - -## Research Objectives & Methodology - -### Research Objectives - -{{List the primary objectives of this market research: - -- What decisions will this research inform? -- What specific questions need to be answered? -- What are the success criteria for this research?}} - -### Research Methodology - -{{Describe the research approach: - -- Data sources used (primary/secondary) -- Analysis frameworks applied -- Data collection timeframe -- Limitations and assumptions}} - -## Market Overview - -### Market Definition - -{{Define the market being analyzed: - -- Product/service category -- Geographic scope -- Customer segments included -- Value chain position}} - -### Market Size & Growth - -[[LLM: Guide through TAM, SAM, SOM calculations with clear assumptions. Use one or more approaches: - -- Top-down: Start with industry data, narrow down -- Bottom-up: Build from customer/unit economics -- Value theory: Based on value provided vs. alternatives]] - -#### Total Addressable Market (TAM) - -{{Calculate and explain the total market opportunity}} - -#### Serviceable Addressable Market (SAM) - -{{Define the portion of TAM you can realistically reach}} - -#### Serviceable Obtainable Market (SOM) - -{{Estimate the portion you can realistically capture}} - -### Market Trends & Drivers - -[[LLM: Analyze key trends shaping the market using appropriate frameworks like PESTEL]] - -#### Key Market Trends - -{{List and explain 3-5 major trends: - -- Trend 1: Description and impact -- Trend 2: Description and impact -- etc.}} - -#### Growth Drivers - -{{Identify primary factors driving market growth}} - -#### Market Inhibitors - -{{Identify factors constraining market growth}} - -## Customer Analysis - -### Target Segment Profiles - -[[LLM: For each segment, create detailed profiles including demographics/firmographics, psychographics, behaviors, needs, and willingness to pay]] - -#### Segment 1: {{Segment Name}} - -- **Description:** {{Brief overview}} -- **Size:** {{Number of customers/market value}} -- **Characteristics:** {{Key demographics/firmographics}} -- **Needs & Pain Points:** {{Primary problems they face}} -- **Buying Process:** {{How they make purchasing decisions}} -- **Willingness to Pay:** {{Price sensitivity and value perception}} - -<> - -### Jobs-to-be-Done Analysis - -[[LLM: Uncover what customers are really trying to accomplish]] - -#### Functional Jobs - -{{List practical tasks and objectives customers need to complete}} - -#### Emotional Jobs - -{{Describe feelings and perceptions customers seek}} - -#### Social Jobs - -{{Explain how customers want to be perceived by others}} - -### Customer Journey Mapping - -[[LLM: Map the end-to-end customer experience for primary segments]] - -{{For primary customer segment: - -1. **Awareness:** How they discover solutions -2. **Consideration:** Evaluation criteria and process -3. **Purchase:** Decision triggers and barriers -4. **Onboarding:** Initial experience expectations -5. **Usage:** Ongoing interaction patterns -6. **Advocacy:** Referral and expansion behaviors}} - -## Competitive Landscape - -### Market Structure - -{{Describe the overall competitive environment: - -- Number of competitors -- Market concentration -- Competitive intensity}} - -### Major Players Analysis - -{{For top 3-5 competitors: - -- Company name and brief description -- Market share estimate -- Key strengths and weaknesses -- Target customer focus -- Pricing strategy}} - -### Competitive Positioning - -{{Analyze how competitors are positioned: - -- Value propositions -- Differentiation strategies -- Market gaps and opportunities}} - -## Industry Analysis - -### Porter's Five Forces Assessment - -[[LLM: Analyze each force with specific evidence and implications]] - -#### Supplier Power: {{Low/Medium/High}} - -{{Analysis and implications}} - -#### Buyer Power: {{Low/Medium/High}} - -{{Analysis and implications}} - -#### Competitive Rivalry: {{Low/Medium/High}} - -{{Analysis and implications}} - -#### Threat of New Entry: {{Low/Medium/High}} - -{{Analysis and implications}} - -#### Threat of Substitutes: {{Low/Medium/High}} - -{{Analysis and implications}} - -### Technology Adoption Lifecycle Stage - -{{Identify where the market is in the adoption curve: - -- Current stage and evidence -- Implications for strategy -- Expected progression timeline}} - -## Opportunity Assessment - -### Market Opportunities - -[[LLM: Identify specific opportunities based on the analysis]] - -#### Opportunity 1: {{Name}} - -- **Description:** {{What is the opportunity?}} -- **Size/Potential:** {{Quantify if possible}} -- **Requirements:** {{What's needed to capture it?}} -- **Risks:** {{Key challenges or barriers}} - -<> - -### Strategic Recommendations - -#### Go-to-Market Strategy - -{{Recommend approach for market entry/expansion: - -- Target segment prioritization -- Positioning strategy -- Channel strategy -- Partnership opportunities}} - -#### Pricing Strategy - -{{Based on willingness to pay analysis and competitive landscape: - -- Recommended pricing model -- Price points/ranges -- Value metric -- Competitive positioning}} - -#### Risk Mitigation - -{{Key risks and mitigation strategies: - -- Market risks -- Competitive risks -- Execution risks -- Regulatory/compliance risks}} - -## Appendices - -### A. Data Sources - -{{List all sources used in the research}} - -### B. Detailed Calculations - -{{Include any complex calculations or models}} - -### C. Additional Analysis - -{{Any supplementary analysis not included in main body}} - ---- - -[[LLM: After completing the document, offer advanced elicitation with these custom options for market research: - -**Market Research Elicitation Actions** 0. Expand market sizing calculations with sensitivity analysis - -1. Deep dive into a specific customer segment -2. Analyze an emerging market trend in detail -3. Compare this market to an analogous market -4. Stress test market assumptions -5. Explore adjacent market opportunities -6. Challenge market definition and boundaries -7. Generate strategic scenarios (best/base/worst case) -8. If only we had considered [X market factor]... -9. Proceed to next section - -These replace the standard elicitation options when working on market research documents.]] -==================== END: .bmad-core/templates/market-research-tmpl.md ==================== - -==================== START: .bmad-core/templates/competitor-analysis-tmpl.md ==================== -# Competitive Analysis Report: {{Project/Product Name}} - -[[LLM: The default path and filename unless specified is docs/competitor-analysis.md]] - -[[LLM: This template guides comprehensive competitor analysis. Start by understanding the user's competitive intelligence needs and strategic objectives. Help them identify and prioritize competitors before diving into detailed analysis.]] - -## Executive Summary - -{{Provide high-level competitive insights, main threats and opportunities, and recommended strategic actions. Write this section LAST after completing all analysis.}} - -## Analysis Scope & Methodology - -### Analysis Purpose - -{{Define the primary purpose: - -- New market entry assessment -- Product positioning strategy -- Feature gap analysis -- Pricing strategy development -- Partnership/acquisition targets -- Competitive threat assessment}} - -### Competitor Categories Analyzed - -{{List categories included: - -- Direct Competitors: Same product/service, same target market -- Indirect Competitors: Different product, same need/problem -- Potential Competitors: Could enter market easily -- Substitute Products: Alternative solutions -- Aspirational Competitors: Best-in-class examples}} - -### Research Methodology - -{{Describe approach: - -- Information sources used -- Analysis timeframe -- Confidence levels -- Limitations}} - -## Competitive Landscape Overview - -### Market Structure - -{{Describe the competitive environment: - -- Number of active competitors -- Market concentration (fragmented/consolidated) -- Competitive dynamics -- Recent market entries/exits}} - -### Competitor Prioritization Matrix - -[[LLM: Help categorize competitors by market share and strategic threat level]] - -{{Create a 2x2 matrix: - -- Priority 1 (Core Competitors): High Market Share + High Threat -- Priority 2 (Emerging Threats): Low Market Share + High Threat -- Priority 3 (Established Players): High Market Share + Low Threat -- Priority 4 (Monitor Only): Low Market Share + Low Threat}} - -## Individual Competitor Profiles - -[[LLM: Create detailed profiles for each Priority 1 and Priority 2 competitor. For Priority 3 and 4, create condensed profiles.]] - -### {{Competitor Name}} - Priority {{1/2/3/4}} - -#### Company Overview - -- **Founded:** {{Year, founders}} -- **Headquarters:** {{Location}} -- **Company Size:** {{Employees, revenue if known}} -- **Funding:** {{Total raised, key investors}} -- **Leadership:** {{Key executives}} - -#### Business Model & Strategy - -- **Revenue Model:** {{How they make money}} -- **Target Market:** {{Primary customer segments}} -- **Value Proposition:** {{Core value promise}} -- **Go-to-Market Strategy:** {{Sales and marketing approach}} -- **Strategic Focus:** {{Current priorities}} - -#### Product/Service Analysis - -- **Core Offerings:** {{Main products/services}} -- **Key Features:** {{Standout capabilities}} -- **User Experience:** {{UX strengths/weaknesses}} -- **Technology Stack:** {{If relevant/known}} -- **Pricing:** {{Model and price points}} - -#### Strengths & Weaknesses - -**Strengths:** - -- {{Strength 1}} -- {{Strength 2}} -- {{Strength 3}} - -**Weaknesses:** - -- {{Weakness 1}} -- {{Weakness 2}} -- {{Weakness 3}} - -#### Market Position & Performance - -- **Market Share:** {{Estimate if available}} -- **Customer Base:** {{Size, notable clients}} -- **Growth Trajectory:** {{Trending up/down/stable}} -- **Recent Developments:** {{Key news, releases}} - -<> - -## Comparative Analysis - -### Feature Comparison Matrix - -[[LLM: Create a detailed comparison table of key features across competitors]] - -| Feature Category | {{Your Company}} | {{Competitor 1}} | {{Competitor 2}} | {{Competitor 3}} | -| --------------------------- | ------------------- | ------------------- | ------------------- | ------------------- | -| **Core Functionality** | -| Feature A | {{✓/✗/Partial}} | {{✓/✗/Partial}} | {{✓/✗/Partial}} | {{✓/✗/Partial}} | -| Feature B | {{✓/✗/Partial}} | {{✓/✗/Partial}} | {{✓/✗/Partial}} | {{✓/✗/Partial}} | -| **User Experience** | -| Mobile App | {{Rating/Status}} | {{Rating/Status}} | {{Rating/Status}} | {{Rating/Status}} | -| Onboarding Time | {{Time}} | {{Time}} | {{Time}} | {{Time}} | -| **Integration & Ecosystem** | -| API Availability | {{Yes/No/Limited}} | {{Yes/No/Limited}} | {{Yes/No/Limited}} | {{Yes/No/Limited}} | -| Third-party Integrations | {{Number/Key ones}} | {{Number/Key ones}} | {{Number/Key ones}} | {{Number/Key ones}} | -| **Pricing & Plans** | -| Starting Price | {{$X}} | {{$X}} | {{$X}} | {{$X}} | -| Free Tier | {{Yes/No}} | {{Yes/No}} | {{Yes/No}} | {{Yes/No}} | - -### SWOT Comparison - -[[LLM: Create SWOT analysis for your solution vs. top competitors]] - -#### Your Solution - -- **Strengths:** {{List key strengths}} -- **Weaknesses:** {{List key weaknesses}} -- **Opportunities:** {{List opportunities}} -- **Threats:** {{List threats}} - -#### vs. {{Main Competitor}} - -- **Competitive Advantages:** {{Where you're stronger}} -- **Competitive Disadvantages:** {{Where they're stronger}} -- **Differentiation Opportunities:** {{How to stand out}} - -### Positioning Map - -[[LLM: Describe competitor positions on key dimensions]] - -{{Create a positioning description using 2 key dimensions relevant to the market, such as: - -- Price vs. Features -- Ease of Use vs. Power -- Specialization vs. Breadth -- Self-Serve vs. High-Touch}} - -## Strategic Analysis - -### Competitive Advantages Assessment - -#### Sustainable Advantages - -{{Identify moats and defensible positions: - -- Network effects -- Switching costs -- Brand strength -- Technology barriers -- Regulatory advantages}} - -#### Vulnerable Points - -{{Where competitors could be challenged: - -- Weak customer segments -- Missing features -- Poor user experience -- High prices -- Limited geographic presence}} - -### Blue Ocean Opportunities - -[[LLM: Identify uncontested market spaces]] - -{{List opportunities to create new market space: - -- Underserved segments -- Unaddressed use cases -- New business models -- Geographic expansion -- Different value propositions}} - -## Strategic Recommendations - -### Differentiation Strategy - -{{How to position against competitors: - -- Unique value propositions to emphasize -- Features to prioritize -- Segments to target -- Messaging and positioning}} - -### Competitive Response Planning - -#### Offensive Strategies - -{{How to gain market share: - -- Target competitor weaknesses -- Win competitive deals -- Capture their customers}} - -#### Defensive Strategies - -{{How to protect your position: - -- Strengthen vulnerable areas -- Build switching costs -- Deepen customer relationships}} - -### Partnership & Ecosystem Strategy - -{{Potential collaboration opportunities: - -- Complementary players -- Channel partners -- Technology integrations -- Strategic alliances}} - -## Monitoring & Intelligence Plan - -### Key Competitors to Track - -{{Priority list with rationale}} - -### Monitoring Metrics - -{{What to track: - -- Product updates -- Pricing changes -- Customer wins/losses -- Funding/M&A activity -- Market messaging}} - -### Intelligence Sources - -{{Where to gather ongoing intelligence: - -- Company websites/blogs -- Customer reviews -- Industry reports -- Social media -- Patent filings}} - -### Update Cadence - -{{Recommended review schedule: - -- Weekly: {{What to check}} -- Monthly: {{What to review}} -- Quarterly: {{Deep analysis}}}} - ---- - -[[LLM: After completing the document, offer advanced elicitation with these custom options for competitive analysis: - -**Competitive Analysis Elicitation Actions** 0. Deep dive on a specific competitor's strategy - -1. Analyze competitive dynamics in a specific segment -2. War game competitive responses to your moves -3. Explore partnership vs. competition scenarios -4. Stress test differentiation claims -5. Analyze disruption potential (yours or theirs) -6. Compare to competition in adjacent markets -7. Generate win/loss analysis insights -8. If only we had known about [competitor X's plan]... -9. Proceed to next section - -These replace the standard elicitation options when working on competitive analysis documents.]] -==================== END: .bmad-core/templates/competitor-analysis-tmpl.md ==================== - -==================== START: .bmad-core/templates/brainstorming-output-tmpl.md ==================== ---- -defaultOutput: docs/brainstorming-session-results.md ---- - -# Brainstorming Session Results - -**Session Date:** [DATE] -**Facilitator:** [Agent Role] [Agent Name] -**Participant:** [USER NAME] - -## Executive Summary - -**Topic:** [SESSION TOPIC] - -**Session Goals:** [STATED GOALS] - -**Techniques Used:** [LIST OF TECHNIQUES AND DURATION] - -**Total Ideas Generated:** [NUMBER] - -**Key Themes Identified:** - -- [THEME 1] -- [THEME 2] -- [THEME 3] - ---- - -## Technique Sessions - -### [TECHNIQUE NAME 1] - [DURATION] - -**Description:** [BRIEF DESCRIPTION OF TECHNIQUE] - -**Ideas Generated:** - -1. [USER IDEA 1] -2. [USER IDEA 2] -3. [USER IDEA 3] -[etc.] - -**Insights Discovered:** - -- [INSIGHT 1] -- [INSIGHT 2] - -**Notable Connections:** - -- [CONNECTION OR PATTERN IDENTIFIED] - ---- - -### [TECHNIQUE NAME 2] - [DURATION] - -[Repeat format for each technique used] - ---- - -## Idea Categorization - -### Immediate Opportunities - -*Ideas ready to implement now* - -1. **[IDEA NAME]** - - Description: [BRIEF DESCRIPTION] - - Why immediate: [RATIONALE] - - Resources needed: [BASIC REQUIREMENTS] - -### Future Innovations - -*Ideas requiring development/research* - -1. **[IDEA NAME]** - - Description: [BRIEF DESCRIPTION] - - Development needed: [WHAT'S REQUIRED] - - Timeline estimate: [ROUGH TIMEFRAME] - -### Moonshots - -*Ambitious, transformative concepts* - -1. **[IDEA NAME]** - - Description: [BRIEF DESCRIPTION] - - Transformative potential: [WHY IT'S A MOONSHOT] - - Challenges to overcome: [MAJOR OBSTACLES] - -### Insights & Learnings - -*Key realizations from the session* - -- [INSIGHT 1]: [DESCRIPTION AND IMPLICATIONS] -- [INSIGHT 2]: [DESCRIPTION AND IMPLICATIONS] - ---- - -## Action Planning - -### Top 3 Priority Ideas - -**#1 Priority: [IDEA NAME]** - -- Rationale: [WHY THIS IS TOP PRIORITY] -- Next steps: [SPECIFIC ACTIONS TO TAKE] -- Resources needed: [WHAT'S REQUIRED] -- Timeline: [WHEN TO START/COMPLETE] - -**#2 Priority: [IDEA NAME]** - -- [Same format] - -**#3 Priority: [IDEA NAME]** - -- [Same format] - ---- - -## Reflection & Follow-up - -### What Worked Well - -- [SUCCESSFUL ASPECT 1] -- [SUCCESSFUL ASPECT 2] - -### Areas for Further Exploration - -- [AREA 1]: [WHY IT NEEDS MORE EXPLORATION] -- [AREA 2]: [WHY IT NEEDS MORE EXPLORATION] - -### Recommended Follow-up Techniques - -- [TECHNIQUE 1]: [WHY IT WOULD BE HELPFUL] -- [TECHNIQUE 2]: [WHY IT WOULD BE HELPFUL] - -### Questions That Emerged - -- [QUESTION 1] -- [QUESTION 2] -- [QUESTION 3] - -### Next Session Planning - -- **Suggested topics:** [FOLLOW-UP TOPICS] -- **Recommended timeframe:** [WHEN TO RECONVENE] -- **Preparation needed:** [WHAT TO RESEARCH/PREPARE] - ---- - -*Session facilitated using the BMAD-METHOD brainstorming framework* -==================== END: .bmad-core/templates/brainstorming-output-tmpl.md ==================== +==================== START: .bmad-core/templates/project-brief-tmpl.yaml ==================== +template: + id: project-brief-template-v2 + name: Project Brief + version: 2.0 + output: + format: markdown + filename: docs/brief.md + title: "Project Brief: {{project_name}}" + +workflow: + mode: interactive + elicitation: advanced-elicitation + custom_elicitation: + title: "Project Brief Elicitation Actions" + options: + - "Expand section with more specific details" + - "Validate against similar successful products" + - "Stress test assumptions with edge cases" + - "Explore alternative solution approaches" + - "Analyze resource/constraint trade-offs" + - "Generate risk mitigation strategies" + - "Challenge scope from MVP minimalist view" + - "Brainstorm creative feature possibilities" + - "If only we had [resource/capability/time]..." + - "Proceed to next section" + +sections: + - id: introduction + instruction: | + This template guides creation of a comprehensive Project Brief that serves as the foundational input for product development. + + Start by asking the user which mode they prefer: + + 1. **Interactive Mode** - Work through each section collaboratively + 2. **YOLO Mode** - Generate complete draft for review and refinement + + Before beginning, understand what inputs are available (brainstorming results, market research, competitive analysis, initial ideas) and gather project context. + + - id: executive-summary + title: Executive Summary + instruction: | + Create a concise overview that captures the essence of the project. Include: + - Product concept in 1-2 sentences + - Primary problem being solved + - Target market identification + - Key value proposition + template: "{{executive_summary_content}}" + + - id: problem-statement + title: Problem Statement + instruction: | + Articulate the problem with clarity and evidence. Address: + - Current state and pain points + - Impact of the problem (quantify if possible) + - Why existing solutions fall short + - Urgency and importance of solving this now + template: "{{detailed_problem_description}}" + + - id: proposed-solution + title: Proposed Solution + instruction: | + Describe the solution approach at a high level. Include: + - Core concept and approach + - Key differentiators from existing solutions + - Why this solution will succeed where others haven't + - High-level vision for the product + template: "{{solution_description}}" + + - id: target-users + title: Target Users + instruction: | + Define and characterize the intended users with specificity. For each user segment include: + - Demographic/firmographic profile + - Current behaviors and workflows + - Specific needs and pain points + - Goals they're trying to achieve + sections: + - id: primary-segment + title: "Primary User Segment: {{segment_name}}" + template: "{{primary_user_description}}" + - id: secondary-segment + title: "Secondary User Segment: {{segment_name}}" + condition: Has secondary user segment + template: "{{secondary_user_description}}" + + - id: goals-metrics + title: Goals & Success Metrics + instruction: Establish clear objectives and how to measure success. Make goals SMART (Specific, Measurable, Achievable, Relevant, Time-bound) + sections: + - id: business-objectives + title: Business Objectives + type: bullet-list + template: "- {{objective_with_metric}}" + - id: user-success-metrics + title: User Success Metrics + type: bullet-list + template: "- {{user_metric}}" + - id: kpis + title: Key Performance Indicators (KPIs) + type: bullet-list + template: "- {{kpi}}: {{definition_and_target}}" + + - id: mvp-scope + title: MVP Scope + instruction: Define the minimum viable product clearly. Be specific about what's in and what's out. Help user distinguish must-haves from nice-to-haves. + sections: + - id: core-features + title: Core Features (Must Have) + type: bullet-list + template: "- **{{feature}}:** {{description_and_rationale}}" + - id: out-of-scope + title: Out of Scope for MVP + type: bullet-list + template: "- {{feature_or_capability}}" + - id: mvp-success-criteria + title: MVP Success Criteria + template: "{{mvp_success_definition}}" + + - id: post-mvp-vision + title: Post-MVP Vision + instruction: Outline the longer-term product direction without overcommitting to specifics + sections: + - id: phase-2-features + title: Phase 2 Features + template: "{{next_priority_features}}" + - id: long-term-vision + title: Long-term Vision + template: "{{one_two_year_vision}}" + - id: expansion-opportunities + title: Expansion Opportunities + template: "{{potential_expansions}}" + + - id: technical-considerations + title: Technical Considerations + instruction: Document known technical constraints and preferences. Note these are initial thoughts, not final decisions. + sections: + - id: platform-requirements + title: Platform Requirements + template: | + - **Target Platforms:** {{platforms}} + - **Browser/OS Support:** {{specific_requirements}} + - **Performance Requirements:** {{performance_specs}} + - id: technology-preferences + title: Technology Preferences + template: | + - **Frontend:** {{frontend_preferences}} + - **Backend:** {{backend_preferences}} + - **Database:** {{database_preferences}} + - **Hosting/Infrastructure:** {{infrastructure_preferences}} + - id: architecture-considerations + title: Architecture Considerations + template: | + - **Repository Structure:** {{repo_thoughts}} + - **Service Architecture:** {{service_thoughts}} + - **Integration Requirements:** {{integration_needs}} + - **Security/Compliance:** {{security_requirements}} + + - id: constraints-assumptions + title: Constraints & Assumptions + instruction: Clearly state limitations and assumptions to set realistic expectations + sections: + - id: constraints + title: Constraints + template: | + - **Budget:** {{budget_info}} + - **Timeline:** {{timeline_info}} + - **Resources:** {{resource_info}} + - **Technical:** {{technical_constraints}} + - id: key-assumptions + title: Key Assumptions + type: bullet-list + template: "- {{assumption}}" + + - id: risks-questions + title: Risks & Open Questions + instruction: Identify unknowns and potential challenges proactively + sections: + - id: key-risks + title: Key Risks + type: bullet-list + template: "- **{{risk}}:** {{description_and_impact}}" + - id: open-questions + title: Open Questions + type: bullet-list + template: "- {{question}}" + - id: research-areas + title: Areas Needing Further Research + type: bullet-list + template: "- {{research_topic}}" + + - id: appendices + title: Appendices + sections: + - id: research-summary + title: A. Research Summary + condition: Has research findings + instruction: | + If applicable, summarize key findings from: + - Market research + - Competitive analysis + - User interviews + - Technical feasibility studies + - id: stakeholder-input + title: B. Stakeholder Input + condition: Has stakeholder feedback + template: "{{stakeholder_feedback}}" + - id: references + title: C. References + template: "{{relevant_links_and_docs}}" + + - id: next-steps + title: Next Steps + sections: + - id: immediate-actions + title: Immediate Actions + type: numbered-list + template: "{{action_item}}" + - id: pm-handoff + title: PM Handoff + content: | + This Project Brief provides the full context for {{project_name}}. Please start in 'PRD Generation Mode', review the brief thoroughly to work with the user to create the PRD section by section as the template indicates, asking for any necessary clarification or suggesting improvements. +==================== END: .bmad-core/templates/project-brief-tmpl.yaml ==================== + +==================== START: .bmad-core/templates/market-research-tmpl.yaml ==================== +template: + id: market-research-template-v2 + name: Market Research Report + version: 2.0 + output: + format: markdown + filename: docs/market-research.md + title: "Market Research Report: {{project_product_name}}" + +workflow: + mode: interactive + elicitation: advanced-elicitation + custom_elicitation: + title: "Market Research Elicitation Actions" + options: + - "Expand market sizing calculations with sensitivity analysis" + - "Deep dive into a specific customer segment" + - "Analyze an emerging market trend in detail" + - "Compare this market to an analogous market" + - "Stress test market assumptions" + - "Explore adjacent market opportunities" + - "Challenge market definition and boundaries" + - "Generate strategic scenarios (best/base/worst case)" + - "If only we had considered [X market factor]..." + - "Proceed to next section" + +sections: + - id: executive-summary + title: Executive Summary + instruction: Provide a high-level overview of key findings, market opportunity assessment, and strategic recommendations. Write this section LAST after completing all other sections. + + - id: research-objectives + title: Research Objectives & Methodology + instruction: This template guides the creation of a comprehensive market research report. Begin by understanding what market insights the user needs and why. Work through each section systematically, using the appropriate analytical frameworks based on the research objectives. + sections: + - id: objectives + title: Research Objectives + instruction: | + List the primary objectives of this market research: + - What decisions will this research inform? + - What specific questions need to be answered? + - What are the success criteria for this research? + - id: methodology + title: Research Methodology + instruction: | + Describe the research approach: + - Data sources used (primary/secondary) + - Analysis frameworks applied + - Data collection timeframe + - Limitations and assumptions + + - id: market-overview + title: Market Overview + sections: + - id: market-definition + title: Market Definition + instruction: | + Define the market being analyzed: + - Product/service category + - Geographic scope + - Customer segments included + - Value chain position + - id: market-size-growth + title: Market Size & Growth + instruction: | + Guide through TAM, SAM, SOM calculations with clear assumptions. Use one or more approaches: + - Top-down: Start with industry data, narrow down + - Bottom-up: Build from customer/unit economics + - Value theory: Based on value provided vs. alternatives + sections: + - id: tam + title: Total Addressable Market (TAM) + instruction: Calculate and explain the total market opportunity + - id: sam + title: Serviceable Addressable Market (SAM) + instruction: Define the portion of TAM you can realistically reach + - id: som + title: Serviceable Obtainable Market (SOM) + instruction: Estimate the portion you can realistically capture + - id: market-trends + title: Market Trends & Drivers + instruction: Analyze key trends shaping the market using appropriate frameworks like PESTEL + sections: + - id: key-trends + title: Key Market Trends + instruction: | + List and explain 3-5 major trends: + - Trend 1: Description and impact + - Trend 2: Description and impact + - etc. + - id: growth-drivers + title: Growth Drivers + instruction: Identify primary factors driving market growth + - id: market-inhibitors + title: Market Inhibitors + instruction: Identify factors constraining market growth + + - id: customer-analysis + title: Customer Analysis + sections: + - id: segment-profiles + title: Target Segment Profiles + instruction: For each segment, create detailed profiles including demographics/firmographics, psychographics, behaviors, needs, and willingness to pay + repeatable: true + sections: + - id: segment + title: "Segment {{segment_number}}: {{segment_name}}" + template: | + - **Description:** {{brief_overview}} + - **Size:** {{number_of_customers_market_value}} + - **Characteristics:** {{key_demographics_firmographics}} + - **Needs & Pain Points:** {{primary_problems}} + - **Buying Process:** {{purchasing_decisions}} + - **Willingness to Pay:** {{price_sensitivity}} + - id: jobs-to-be-done + title: Jobs-to-be-Done Analysis + instruction: Uncover what customers are really trying to accomplish + sections: + - id: functional-jobs + title: Functional Jobs + instruction: List practical tasks and objectives customers need to complete + - id: emotional-jobs + title: Emotional Jobs + instruction: Describe feelings and perceptions customers seek + - id: social-jobs + title: Social Jobs + instruction: Explain how customers want to be perceived by others + - id: customer-journey + title: Customer Journey Mapping + instruction: Map the end-to-end customer experience for primary segments + template: | + For primary customer segment: + + 1. **Awareness:** {{discovery_process}} + 2. **Consideration:** {{evaluation_criteria}} + 3. **Purchase:** {{decision_triggers}} + 4. **Onboarding:** {{initial_expectations}} + 5. **Usage:** {{interaction_patterns}} + 6. **Advocacy:** {{referral_behaviors}} + + - id: competitive-landscape + title: Competitive Landscape + sections: + - id: market-structure + title: Market Structure + instruction: | + Describe the overall competitive environment: + - Number of competitors + - Market concentration + - Competitive intensity + - id: major-players + title: Major Players Analysis + instruction: | + For top 3-5 competitors: + - Company name and brief description + - Market share estimate + - Key strengths and weaknesses + - Target customer focus + - Pricing strategy + - id: competitive-positioning + title: Competitive Positioning + instruction: | + Analyze how competitors are positioned: + - Value propositions + - Differentiation strategies + - Market gaps and opportunities + + - id: industry-analysis + title: Industry Analysis + sections: + - id: porters-five-forces + title: Porter's Five Forces Assessment + instruction: Analyze each force with specific evidence and implications + sections: + - id: supplier-power + title: "Supplier Power: {{power_level}}" + template: "{{analysis_and_implications}}" + - id: buyer-power + title: "Buyer Power: {{power_level}}" + template: "{{analysis_and_implications}}" + - id: competitive-rivalry + title: "Competitive Rivalry: {{intensity_level}}" + template: "{{analysis_and_implications}}" + - id: threat-new-entry + title: "Threat of New Entry: {{threat_level}}" + template: "{{analysis_and_implications}}" + - id: threat-substitutes + title: "Threat of Substitutes: {{threat_level}}" + template: "{{analysis_and_implications}}" + - id: adoption-lifecycle + title: Technology Adoption Lifecycle Stage + instruction: | + Identify where the market is in the adoption curve: + - Current stage and evidence + - Implications for strategy + - Expected progression timeline + + - id: opportunity-assessment + title: Opportunity Assessment + sections: + - id: market-opportunities + title: Market Opportunities + instruction: Identify specific opportunities based on the analysis + repeatable: true + sections: + - id: opportunity + title: "Opportunity {{opportunity_number}}: {{name}}" + template: | + - **Description:** {{what_is_the_opportunity}} + - **Size/Potential:** {{quantified_potential}} + - **Requirements:** {{needed_to_capture}} + - **Risks:** {{key_challenges}} + - id: strategic-recommendations + title: Strategic Recommendations + sections: + - id: go-to-market + title: Go-to-Market Strategy + instruction: | + Recommend approach for market entry/expansion: + - Target segment prioritization + - Positioning strategy + - Channel strategy + - Partnership opportunities + - id: pricing-strategy + title: Pricing Strategy + instruction: | + Based on willingness to pay analysis and competitive landscape: + - Recommended pricing model + - Price points/ranges + - Value metric + - Competitive positioning + - id: risk-mitigation + title: Risk Mitigation + instruction: | + Key risks and mitigation strategies: + - Market risks + - Competitive risks + - Execution risks + - Regulatory/compliance risks + + - id: appendices + title: Appendices + sections: + - id: data-sources + title: A. Data Sources + instruction: List all sources used in the research + - id: calculations + title: B. Detailed Calculations + instruction: Include any complex calculations or models + - id: additional-analysis + title: C. Additional Analysis + instruction: Any supplementary analysis not included in main body +==================== END: .bmad-core/templates/market-research-tmpl.yaml ==================== + +==================== START: .bmad-core/templates/competitor-analysis-tmpl.yaml ==================== +template: + id: competitor-analysis-template-v2 + name: Competitive Analysis Report + version: 2.0 + output: + format: markdown + filename: docs/competitor-analysis.md + title: "Competitive Analysis Report: {{project_product_name}}" + +workflow: + mode: interactive + elicitation: advanced-elicitation + custom_elicitation: + title: "Competitive Analysis Elicitation Actions" + options: + - "Deep dive on a specific competitor's strategy" + - "Analyze competitive dynamics in a specific segment" + - "War game competitive responses to your moves" + - "Explore partnership vs. competition scenarios" + - "Stress test differentiation claims" + - "Analyze disruption potential (yours or theirs)" + - "Compare to competition in adjacent markets" + - "Generate win/loss analysis insights" + - "If only we had known about [competitor X's plan]..." + - "Proceed to next section" + +sections: + - id: executive-summary + title: Executive Summary + instruction: Provide high-level competitive insights, main threats and opportunities, and recommended strategic actions. Write this section LAST after completing all analysis. + + - id: analysis-scope + title: Analysis Scope & Methodology + instruction: This template guides comprehensive competitor analysis. Start by understanding the user's competitive intelligence needs and strategic objectives. Help them identify and prioritize competitors before diving into detailed analysis. + sections: + - id: analysis-purpose + title: Analysis Purpose + instruction: | + Define the primary purpose: + - New market entry assessment + - Product positioning strategy + - Feature gap analysis + - Pricing strategy development + - Partnership/acquisition targets + - Competitive threat assessment + - id: competitor-categories + title: Competitor Categories Analyzed + instruction: | + List categories included: + - Direct Competitors: Same product/service, same target market + - Indirect Competitors: Different product, same need/problem + - Potential Competitors: Could enter market easily + - Substitute Products: Alternative solutions + - Aspirational Competitors: Best-in-class examples + - id: research-methodology + title: Research Methodology + instruction: | + Describe approach: + - Information sources used + - Analysis timeframe + - Confidence levels + - Limitations + + - id: competitive-landscape + title: Competitive Landscape Overview + sections: + - id: market-structure + title: Market Structure + instruction: | + Describe the competitive environment: + - Number of active competitors + - Market concentration (fragmented/consolidated) + - Competitive dynamics + - Recent market entries/exits + - id: prioritization-matrix + title: Competitor Prioritization Matrix + instruction: | + Help categorize competitors by market share and strategic threat level + + Create a 2x2 matrix: + - Priority 1 (Core Competitors): High Market Share + High Threat + - Priority 2 (Emerging Threats): Low Market Share + High Threat + - Priority 3 (Established Players): High Market Share + Low Threat + - Priority 4 (Monitor Only): Low Market Share + Low Threat + + - id: competitor-profiles + title: Individual Competitor Profiles + instruction: Create detailed profiles for each Priority 1 and Priority 2 competitor. For Priority 3 and 4, create condensed profiles. + repeatable: true + sections: + - id: competitor + title: "{{competitor_name}} - Priority {{priority_level}}" + sections: + - id: company-overview + title: Company Overview + template: | + - **Founded:** {{year_founders}} + - **Headquarters:** {{location}} + - **Company Size:** {{employees_revenue}} + - **Funding:** {{total_raised_investors}} + - **Leadership:** {{key_executives}} + - id: business-model + title: Business Model & Strategy + template: | + - **Revenue Model:** {{revenue_model}} + - **Target Market:** {{customer_segments}} + - **Value Proposition:** {{value_promise}} + - **Go-to-Market Strategy:** {{gtm_approach}} + - **Strategic Focus:** {{current_priorities}} + - id: product-analysis + title: Product/Service Analysis + template: | + - **Core Offerings:** {{main_products}} + - **Key Features:** {{standout_capabilities}} + - **User Experience:** {{ux_assessment}} + - **Technology Stack:** {{tech_stack}} + - **Pricing:** {{pricing_model}} + - id: strengths-weaknesses + title: Strengths & Weaknesses + sections: + - id: strengths + title: Strengths + type: bullet-list + template: "- {{strength}}" + - id: weaknesses + title: Weaknesses + type: bullet-list + template: "- {{weakness}}" + - id: market-position + title: Market Position & Performance + template: | + - **Market Share:** {{market_share_estimate}} + - **Customer Base:** {{customer_size_notables}} + - **Growth Trajectory:** {{growth_trend}} + - **Recent Developments:** {{key_news}} + + - id: comparative-analysis + title: Comparative Analysis + sections: + - id: feature-comparison + title: Feature Comparison Matrix + instruction: Create a detailed comparison table of key features across competitors + type: table + columns: ["Feature Category", "{{your_company}}", "{{competitor_1}}", "{{competitor_2}}", "{{competitor_3}}"] + rows: + - category: "Core Functionality" + items: + - ["Feature A", "{{status}}", "{{status}}", "{{status}}", "{{status}}"] + - ["Feature B", "{{status}}", "{{status}}", "{{status}}", "{{status}}"] + - category: "User Experience" + items: + - ["Mobile App", "{{rating}}", "{{rating}}", "{{rating}}", "{{rating}}"] + - ["Onboarding Time", "{{time}}", "{{time}}", "{{time}}", "{{time}}"] + - category: "Integration & Ecosystem" + items: + - ["API Availability", "{{availability}}", "{{availability}}", "{{availability}}", "{{availability}}"] + - ["Third-party Integrations", "{{number}}", "{{number}}", "{{number}}", "{{number}}"] + - category: "Pricing & Plans" + items: + - ["Starting Price", "{{price}}", "{{price}}", "{{price}}", "{{price}}"] + - ["Free Tier", "{{yes_no}}", "{{yes_no}}", "{{yes_no}}", "{{yes_no}}"] + - id: swot-comparison + title: SWOT Comparison + instruction: Create SWOT analysis for your solution vs. top competitors + sections: + - id: your-solution + title: Your Solution + template: | + - **Strengths:** {{strengths}} + - **Weaknesses:** {{weaknesses}} + - **Opportunities:** {{opportunities}} + - **Threats:** {{threats}} + - id: vs-competitor + title: "vs. {{main_competitor}}" + template: | + - **Competitive Advantages:** {{your_advantages}} + - **Competitive Disadvantages:** {{their_advantages}} + - **Differentiation Opportunities:** {{differentiation}} + - id: positioning-map + title: Positioning Map + instruction: | + Describe competitor positions on key dimensions + + Create a positioning description using 2 key dimensions relevant to the market, such as: + - Price vs. Features + - Ease of Use vs. Power + - Specialization vs. Breadth + - Self-Serve vs. High-Touch + + - id: strategic-analysis + title: Strategic Analysis + sections: + - id: competitive-advantages + title: Competitive Advantages Assessment + sections: + - id: sustainable-advantages + title: Sustainable Advantages + instruction: | + Identify moats and defensible positions: + - Network effects + - Switching costs + - Brand strength + - Technology barriers + - Regulatory advantages + - id: vulnerable-points + title: Vulnerable Points + instruction: | + Where competitors could be challenged: + - Weak customer segments + - Missing features + - Poor user experience + - High prices + - Limited geographic presence + - id: blue-ocean + title: Blue Ocean Opportunities + instruction: | + Identify uncontested market spaces + + List opportunities to create new market space: + - Underserved segments + - Unaddressed use cases + - New business models + - Geographic expansion + - Different value propositions + + - id: strategic-recommendations + title: Strategic Recommendations + sections: + - id: differentiation-strategy + title: Differentiation Strategy + instruction: | + How to position against competitors: + - Unique value propositions to emphasize + - Features to prioritize + - Segments to target + - Messaging and positioning + - id: competitive-response + title: Competitive Response Planning + sections: + - id: offensive-strategies + title: Offensive Strategies + instruction: | + How to gain market share: + - Target competitor weaknesses + - Win competitive deals + - Capture their customers + - id: defensive-strategies + title: Defensive Strategies + instruction: | + How to protect your position: + - Strengthen vulnerable areas + - Build switching costs + - Deepen customer relationships + - id: partnership-ecosystem + title: Partnership & Ecosystem Strategy + instruction: | + Potential collaboration opportunities: + - Complementary players + - Channel partners + - Technology integrations + - Strategic alliances + + - id: monitoring-plan + title: Monitoring & Intelligence Plan + sections: + - id: key-competitors + title: Key Competitors to Track + instruction: Priority list with rationale + - id: monitoring-metrics + title: Monitoring Metrics + instruction: | + What to track: + - Product updates + - Pricing changes + - Customer wins/losses + - Funding/M&A activity + - Market messaging + - id: intelligence-sources + title: Intelligence Sources + instruction: | + Where to gather ongoing intelligence: + - Company websites/blogs + - Customer reviews + - Industry reports + - Social media + - Patent filings + - id: update-cadence + title: Update Cadence + instruction: | + Recommended review schedule: + - Weekly: {{weekly_items}} + - Monthly: {{monthly_items}} + - Quarterly: {{quarterly_analysis}} +==================== END: .bmad-core/templates/competitor-analysis-tmpl.yaml ==================== + +==================== START: .bmad-core/templates/brainstorming-output-tmpl.yaml ==================== +template: + id: brainstorming-output-template-v2 + name: Brainstorming Session Results + version: 2.0 + output: + format: markdown + filename: docs/brainstorming-session-results.md + title: "Brainstorming Session Results" + +workflow: + mode: non-interactive + +sections: + - id: header + content: | + **Session Date:** {{date}} + **Facilitator:** {{agent_role}} {{agent_name}} + **Participant:** {{user_name}} + + - id: executive-summary + title: Executive Summary + sections: + - id: summary-details + template: | + **Topic:** {{session_topic}} + + **Session Goals:** {{stated_goals}} + + **Techniques Used:** {{techniques_list}} + + **Total Ideas Generated:** {{total_ideas}} + - id: key-themes + title: "Key Themes Identified:" + type: bullet-list + template: "- {{theme}}" + + - id: technique-sessions + title: Technique Sessions + repeatable: true + sections: + - id: technique + title: "{{technique_name}} - {{duration}}" + sections: + - id: description + template: "**Description:** {{technique_description}}" + - id: ideas-generated + title: "Ideas Generated:" + type: numbered-list + template: "{{idea}}" + - id: insights + title: "Insights Discovered:" + type: bullet-list + template: "- {{insight}}" + - id: connections + title: "Notable Connections:" + type: bullet-list + template: "- {{connection}}" + + - id: idea-categorization + title: Idea Categorization + sections: + - id: immediate-opportunities + title: Immediate Opportunities + content: "*Ideas ready to implement now*" + repeatable: true + type: numbered-list + template: | + **{{idea_name}}** + - Description: {{description}} + - Why immediate: {{rationale}} + - Resources needed: {{requirements}} + - id: future-innovations + title: Future Innovations + content: "*Ideas requiring development/research*" + repeatable: true + type: numbered-list + template: | + **{{idea_name}}** + - Description: {{description}} + - Development needed: {{development_needed}} + - Timeline estimate: {{timeline}} + - id: moonshots + title: Moonshots + content: "*Ambitious, transformative concepts*" + repeatable: true + type: numbered-list + template: | + **{{idea_name}}** + - Description: {{description}} + - Transformative potential: {{potential}} + - Challenges to overcome: {{challenges}} + - id: insights-learnings + title: Insights & Learnings + content: "*Key realizations from the session*" + type: bullet-list + template: "- {{insight}}: {{description_and_implications}}" + + - id: action-planning + title: Action Planning + sections: + - id: top-priorities + title: Top 3 Priority Ideas + sections: + - id: priority-1 + title: "#1 Priority: {{idea_name}}" + template: | + - Rationale: {{rationale}} + - Next steps: {{next_steps}} + - Resources needed: {{resources}} + - Timeline: {{timeline}} + - id: priority-2 + title: "#2 Priority: {{idea_name}}" + template: | + - Rationale: {{rationale}} + - Next steps: {{next_steps}} + - Resources needed: {{resources}} + - Timeline: {{timeline}} + - id: priority-3 + title: "#3 Priority: {{idea_name}}" + template: | + - Rationale: {{rationale}} + - Next steps: {{next_steps}} + - Resources needed: {{resources}} + - Timeline: {{timeline}} + + - id: reflection-followup + title: Reflection & Follow-up + sections: + - id: what-worked + title: What Worked Well + type: bullet-list + template: "- {{aspect}}" + - id: areas-exploration + title: Areas for Further Exploration + type: bullet-list + template: "- {{area}}: {{reason}}" + - id: recommended-techniques + title: Recommended Follow-up Techniques + type: bullet-list + template: "- {{technique}}: {{reason}}" + - id: questions-emerged + title: Questions That Emerged + type: bullet-list + template: "- {{question}}" + - id: next-session + title: Next Session Planning + template: | + - **Suggested topics:** {{followup_topics}} + - **Recommended timeframe:** {{timeframe}} + - **Preparation needed:** {{preparation}} + + - id: footer + content: | + --- + + *Session facilitated using the BMAD-METHOD brainstorming framework* +==================== END: .bmad-core/templates/brainstorming-output-tmpl.yaml ==================== ==================== START: .bmad-core/data/bmad-kb.md ==================== # BMad Knowledge Base @@ -2882,32 +2854,3 @@ Use the **expansion-creator** pack to build your own: 19. **Metaphor Mapping**: Use extended metaphors to explore solutions 20. **Question Storming**: Generate questions instead of answers first ==================== END: .bmad-core/data/brainstorming-techniques.md ==================== - -==================== START: .bmad-core/utils/template-format.md ==================== -# Template Format Conventions - -Templates in the BMad method use standardized markup for AI processing. These conventions ensure consistent document generation. - -## Template Markup Elements - -- **{{placeholders}}**: Variables to be replaced with actual content -- **[[LLM: instructions]]**: Internal processing instructions for AI agents (never shown to users) -- **REPEAT** sections: Content blocks that may be repeated as needed -- **^^CONDITION^^** blocks: Conditional content included only if criteria are met -- **@{examples}**: Example content for guidance (never output to users) - -## Processing Rules - -- Replace all {{placeholders}} with project-specific content -- Execute all [[LLM: instructions]] internally without showing users -- Process conditional and repeat blocks as specified -- Use examples for guidance but never include them in final output -- Present only clean, formatted content to users - -## Critical Guidelines - -- **NEVER display template markup, LLM instructions, or examples to users** -- Template elements are for AI processing only -- Focus on faithful template execution and clean output -- All template-specific instructions are embedded within templates -==================== END: .bmad-core/utils/template-format.md ==================== diff --git a/dist/agents/architect.txt b/dist/agents/architect.txt index 00544354..f6fd6bfc 100644 --- a/dist/agents/architect.txt +++ b/dist/agents/architect.txt @@ -50,6 +50,8 @@ activation-instructions: - Only read the files/tasks listed here when user selects them for execution to minimize context usage - The customization field ALWAYS takes precedence over any conflicting instructions - When listing tasks/templates or presenting options during conversations, always show as numbered options list, allowing the user to type a number to select or execute + - Greet the user with your name and role, and inform of the *help command. + - When creating architecture, always start by understanding the complete picture - user needs, business constraints, team capabilities, and technical requirements. agent: name: Winston id: architect @@ -73,129 +75,112 @@ persona: - Data-Centric Design - Let data requirements drive architecture - Cost-Conscious Engineering - Balance technical ideals with financial reality - Living Architecture - Design for change and adaptation -startup: - - Greet the user with your name and role, and inform of the *help command. - - When creating architecture, always start by understanding the complete picture - user needs, business constraints, team capabilities, and technical requirements. commands: - help: Show numbered list of the following commands to allow selection - create-doc {template}: execute task create-doc (no template = ONLY show available templates listed under dependencies/templates below) - - yolo: Toggle Yolo Mode off on - on will skip doc section confirmations + - yolo: Toggle Yolo Mode - doc-out: Output full document to current destination file - execute-checklist {checklist}: Run task execute-checklist (default->architect-checklist) - research {topic}: execute task create-deep-research-prompt for architectural decisions - exit: Say goodbye as the Architect, and then abandon inhabiting this persona dependencies: tasks: - - create-doc - - create-deep-research-prompt - - document-project - - execute-checklist + - create-doc.md + - create-deep-research-prompt.md + - document-project.md + - execute-checklist.md templates: - - architecture-tmpl - - front-end-architecture-tmpl - - fullstack-architecture-tmpl - - brownfield-architecture-tmpl + - architecture-tmpl.yaml + - front-end-architecture-tmpl.yaml + - fullstack-architecture-tmpl.yaml + - brownfield-architecture-tmpl.yaml checklists: - - architect-checklist + - architect-checklist.md data: - - technical-preferences - utils: - - template-format + - technical-preferences.md ``` ==================== END: .bmad-core/agents/architect.md ==================== ==================== START: .bmad-core/tasks/create-doc.md ==================== -# Create Document from Template Task +# Create Document from Template (YAML Driven) -## Purpose +## CRITICAL: Mandatory Elicitation Format -Generate documents from templates by EXECUTING (not just reading) embedded instructions from the perspective of the selected agent persona. +**When `elicit: true`, ALWAYS use this exact format:** -## CRITICAL RULES +1. Present section content +2. Provide detailed rationale (explain trade-offs, assumptions, decisions made) +3. Present numbered options 1-9: + - **Option 1:** Always "Proceed to next section" + - **Options 2-9:** Select 8 methods from data/elicitation-methods + - End with: "Select 1-9 or just type your question/feedback:" -1. **Templates are PROGRAMS** - Execute every [[LLM:]] instruction exactly as written -2. **NEVER show markup** - Hide all [[LLM:]], {{placeholders}}, @{examples}, and template syntax -3. **STOP and EXECUTE** - When you see "apply tasks#" or "execute tasks#", STOP and run that task immediately -4. **WAIT for user input** - At review points and after elicitation tasks +**NEVER ask yes/no questions or use any other format.** -## Execution Flow +## Processing Flow -### 0. Check Workflow Plan (if configured) +1. **Parse YAML template** - Load template metadata and sections +2. **Set preferences** - Show current mode (Interactive), confirm output file +3. **Process each section:** + - Skip if condition unmet + - Check agent permissions (owner/editors) - note if section is restricted to specific agents + - Draft content using section instruction + - Present content + detailed rationale + - **IF elicit: true** → MANDATORY 1-9 options format + - Save to file if possible +4. **Continue until complete** -[[LLM: Check if plan tracking is enabled in core-config.yaml]] +## Detailed Rationale Requirements -- If `workflow.trackProgress: true`, check for active plan using .bmad-core/utils/plan-management.md -- If plan exists and this document creation is part of the plan: - - Verify this is the expected next step - - If out of sequence and `enforceSequence: true`, warn user and halt without user override - - If out of sequence and `enforceSequence: false`, ask for confirmation -- Continue with normal execution after plan check +When presenting section content, ALWAYS include rationale that explains: -### 1. Identify Template +- Trade-offs and choices made (what was chosen over alternatives and why) +- Key assumptions made during drafting +- Interesting or questionable decisions that need user attention +- Areas that might need validation -- Load from `.bmad-core/templates/*.md` or `.bmad-core/templates directory` -- Agent-specific templates are listed in agent's dependencies -- If agent has `templates: [prd-tmpl, architecture-tmpl]` for example, then offer to create "PRD" and "Architecture" documents +## Elicitation Results Flow -### 2. Ask Interaction Mode +After user selects elicitation method (2-9): -> 1. **Incremental** - Section by section with reviews -> 2. **YOLO Mode** - Complete draft then review (user can type `/yolo` anytime to switch) +1. Execute method from data/elicitation-methods +2. Present results with insights +3. Offer options: + - **1. Apply changes and update section** + - **2. Return to elicitation menu** + - **3. Ask any questions or engage further with this elicitation** -### 3. Execute Template +## Agent Permissions -- Replace {{placeholders}} with real content -- Execute [[LLM:]] instructions as you encounter them -- Process <> loops and ^^CONDITIONS^^ -- Use @{examples} for guidance but never output them +When processing sections with agent permission fields: -### 4. Key Execution Patterns +- **owner**: Note which agent role initially creates/populates the section +- **editors**: List agent roles allowed to modify the section +- **readonly**: Mark sections that cannot be modified after creation -**When you see:** `[[LLM: Draft X and immediately execute .bmad-core/tasks/advanced-elicitation.md]]` +**For sections with restricted access:** -- Draft the content -- Present it to user -- IMMEDIATELY execute the task -- Wait for completion before continuing +- Include a note in the generated document indicating the responsible agent +- Example: "_(This section is owned by dev-agent and can only be modified by dev-agent)_" -**When you see:** `[[LLM: After section completion, apply .bmad-core/tasks/Y.md]]` +## YOLO Mode -- Finish the section -- STOP and execute the task -- Wait for user input +User can type `#yolo` to toggle to YOLO mode (process all sections at once). -### 5. Validation & Final Presentation +## CRITICAL REMINDERS -- Run any specified checklists -- Present clean, formatted content only -- No truncation or summarization -- Begin directly with content (no preamble) -- Include any handoff prompts from template +**❌ NEVER:** -### 6. Update Workflow Plan (if applicable) +- Ask yes/no questions for elicitation +- Use any format other than 1-9 numbered options +- Create new elicitation methods -[[LLM: After successful document creation]] +**✅ ALWAYS:** -- If plan tracking is enabled and document was part of plan: - - Call update-workflow-plan task to mark step complete - - Parameters: task: create-doc, step_id: {from plan}, status: complete - - Show next recommended step from plan - -## Common Mistakes to Avoid - -❌ Skipping elicitation tasks -❌ Showing template markup to users -❌ Continuing past STOP signals -❌ Combining multiple review points - -✅ Execute ALL instructions in sequence -✅ Present only clean, formatted content -✅ Stop at every elicitation point -✅ Wait for user confirmation when instructed - -## Remember - -Templates contain precise instructions for a reason. Follow them exactly to ensure document quality and completeness. +- Use exact 1-9 format when elicit: true +- Select options 2-9 from data/elicitation-methods only +- Provide detailed rationale explaining decisions +- End with "Select 1-9 or just type your question/feedback:" ==================== END: .bmad-core/tasks/create-doc.md ==================== ==================== START: .bmad-core/tasks/create-deep-research-prompt.md ==================== @@ -918,2530 +903,2162 @@ The LLM will: - Offer to provide detailed analysis of any section, especially those with warnings or failures ==================== END: .bmad-core/tasks/execute-checklist.md ==================== -==================== START: .bmad-core/templates/architecture-tmpl.md ==================== -# {{Project Name}} Architecture Document - -[[LLM: If available, review any provided relevant documents to gather all relevant context before beginning. If at a minimum you cannot local `docs/prd.md` ask the user what docs will provide the basis for the architecture.]] - -[[LLM: The default path and filename unless specified is docs/architecture.md]] - -## Introduction - -[[LLM: This section establishes the document's purpose and scope. Keep the content below but ensure project name is properly substituted. - -After presenting this section, apply `.bmad-core/tasks/advanced-elicitation.md` protocol]] - -This document outlines the overall project architecture for {{Project Name}}, including backend systems, shared services, and non-UI specific concerns. Its primary goal is to serve as the guiding architectural blueprint for AI-driven development, ensuring consistency and adherence to chosen patterns and technologies. - -**Relationship to Frontend Architecture:** -If the project includes a significant user interface, a separate Frontend Architecture Document will detail the frontend-specific design and MUST be used in conjunction with this document. Core technology stack choices documented herein (see "Tech Stack") are definitive for the entire project, including any frontend components. - -### Starter Template or Existing Project - -[[LLM: Before proceeding further with architecture design, check if the project is based on a starter template or existing codebase: - -1. Review the PRD and brainstorming brief for any mentions of: - -- Starter templates (e.g., Create React App, Next.js, Vue CLI, Angular CLI, etc.) -- Existing projects or codebases being used as a foundation -- Boilerplate projects or scaffolding tools -- Previous projects to be cloned or adapted - -2. If a starter template or existing project is mentioned: - -- Ask the user to provide access via one of these methods: - - Link to the starter template documentation - - Upload/attach the project files (for small projects) - - Share a link to the project repository (GitHub, GitLab, etc.) -- Analyze the starter/existing project to understand: - - Pre-configured technology stack and versions - - Project structure and organization patterns - - Built-in scripts and tooling - - Existing architectural patterns and conventions - - Any limitations or constraints imposed by the starter -- Use this analysis to inform and align your architecture decisions - -3. If no starter template is mentioned but this is a greenfield project: - -- Suggest appropriate starter templates based on the tech stack preferences -- Explain the benefits (faster setup, best practices, community support) -- Let the user decide whether to use one - -4. If the user confirms no starter template will be used: - -- Proceed with architecture design from scratch -- Note that manual setup will be required for all tooling and configuration - -Document the decision here before proceeding with the architecture design. In none, just say N/A - -After presenting this starter template section, apply `.bmad-core/tasks/advanced-elicitation.md` protocol]] - -### Change Log - -[[LLM: Track document versions and changes]] - -| Date | Version | Description | Author | -| :--- | :------ | :---------- | :----- | - -## High Level Architecture - -[[LLM: This section contains multiple subsections that establish the foundation of the architecture. Present all subsections together (Introduction, Technical Summary, High Level Overview, Project Diagram, and Architectural Patterns), then apply `.bmad-core/tasks/advanced-elicitation.md` protocol to the complete High Level Architecture section. The user can choose to refine the entire section or specific subsections.]] - -### Technical Summary - -[[LLM: Provide a brief paragraph (3-5 sentences) overview of: - -- The system's overall architecture style -- Key components and their relationships -- Primary technology choices -- Core architectural patterns being used -- Reference back to the PRD goals and how this architecture supports them]] - -### High Level Overview - -[[LLM: Based on the PRD's Technical Assumptions section, describe: - -1. The main architectural style (e.g., Monolith, Microservices, Serverless, Event-Driven) -2. Repository structure decision from PRD (Monorepo/Polyrepo) -3. Service architecture decision from PRD -4. Primary user interaction flow or data flow at a conceptual level -5. Key architectural decisions and their rationale - -After presenting this section, apply `.bmad-core/tasks/advanced-elicitation.md` protocol]] - -### High Level Project Diagram - -[[LLM: Create a Mermaid diagram that visualizes the high-level architecture. Consider: - -- System boundaries -- Major components/services -- Data flow directions -- External integrations -- User entry points - -Use appropriate Mermaid diagram type (graph TD, C4, sequence) based on what best represents the architecture - -After presenting the diagram, apply `.bmad-core/tasks/advanced-elicitation.md` protocol]] - -### Architectural and Design Patterns - -[[LLM: List the key high-level patterns that will guide the architecture. For each pattern: - -1. Present 2-3 viable options if multiple exist -2. Provide your recommendation with clear rationale -3. Get user confirmation before finalizing -4. These patterns should align with the PRD's technical assumptions and project goals - -Common patterns to consider: - -- Architectural style patterns (Serverless, Event-Driven, Microservices, CQRS, Hexagonal) -- Code organization patterns (Dependency Injection, Repository, Module, Factory) -- Data patterns (Event Sourcing, Saga, Database per Service) -- Communication patterns (REST, GraphQL, Message Queue, Pub/Sub)]] - -<> - -- **{{pattern_name}}:** {{pattern_description}} - _Rationale:_ {{rationale}} - -<> - -@{example: patterns} - -- **Serverless Architecture:** Using AWS Lambda for compute - _Rationale:_ Aligns with PRD requirement for cost optimization and automatic scaling -- **Repository Pattern:** Abstract data access logic - _Rationale:_ Enables testing and future database migration flexibility -- **Event-Driven Communication:** Using SNS/SQS for service decoupling - _Rationale:_ Supports async processing and system resilience - -@{/example} - -[[LLM: After presenting the patterns, apply `.bmad-core/tasks/advanced-elicitation.md` protocol]] - -## Tech Stack - -[[LLM: This is the DEFINITIVE technology selection section. Work with the user to make specific choices: - -1. Review PRD technical assumptions and any preferences from `.bmad-core/data/technical-preferences.yaml` or an attached `technical-preferences` -2. For each category, present 2-3 viable options with pros/cons -3. Make a clear recommendation based on project needs -4. Get explicit user approval for each selection -5. Document exact versions (avoid "latest" - pin specific versions) -6. This table is the single source of truth - all other docs must reference these choices - -Key decisions to finalize - before displaying the table, ensure you are aware of or ask the user about - let the user know if they are not sure on any that you can also provide suggestions with rationale: - -- Starter templates (if any) -- Languages and runtimes with exact versions -- Frameworks and libraries / packages -- Cloud provider and key services choices -- Database and storage solutions - if unclear suggest sql or nosql or other types depending on the project and depending on cloud provider offer a suggestion -- Development tools - -Upon render of the table, ensure the user is aware of the importance of this sections choices, should also look for gaps or disagreements with anything, ask for any clarifications if something is unclear why its in the list, and also right away apply `.bmad-core/tasks/advanced-elicitation.md` display - this statement and the options should be rendered and then prompt right all before allowing user input.]] - -### Cloud Infrastructure - -- **Provider:** {{cloud_provider}} -- **Key Services:** {{core_services_list}} -- **Deployment Regions:** {{regions}} - -### Technology Stack Table - -| Category | Technology | Version | Purpose | Rationale | -| :----------------- | :----------------- | :---------- | :---------- | :------------- | -| **Language** | {{language}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **Runtime** | {{runtime}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **Framework** | {{framework}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **Database** | {{database}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **Cache** | {{cache}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **Message Queue** | {{queue}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **API Style** | {{api_style}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **Authentication** | {{auth}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **Testing** | {{test_framework}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **Build Tool** | {{build_tool}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **IaC Tool** | {{iac_tool}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **Monitoring** | {{monitoring}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **Logging** | {{logging}} | {{version}} | {{purpose}} | {{why_chosen}} | - -@{example: tech_stack_row} -| **Language** | TypeScript | 5.3.3 | Primary development language | Strong typing, excellent tooling, team expertise | -| **Runtime** | Node.js | 20.11.0 | JavaScript runtime | LTS version, stable performance, wide ecosystem | -| **Framework** | NestJS | 10.3.2 | Backend framework | Enterprise-ready, good DI, matches team patterns | -@{/example} - -## Data Models - -[[LLM: Define the core data models/entities: - -1. Review PRD requirements and identify key business entities -2. For each model, explain its purpose and relationships -3. Include key attributes and data types -4. Show relationships between models -5. Discuss design decisions with user - -Create a clear conceptual model before moving to database schema. - -After presenting all data models, apply `.bmad-core/tasks/advanced-elicitation.md` protocol]] - -<> - -### {{model_name}} - -**Purpose:** {{model_purpose}} - -**Key Attributes:** - -- {{attribute_1}}: {{type_1}} - {{description_1}} -- {{attribute_2}}: {{type_2}} - {{description_2}} - -**Relationships:** - -- {{relationship_1}} -- {{relationship_2}} - <> - -## Components - -[[LLM: Based on the architectural patterns, tech stack, and data models from above: - -1. Identify major logical components/services and their responsibilities -2. Consider the repository structure (monorepo/polyrepo) from PRD -3. Define clear boundaries and interfaces between components -4. For each component, specify: - -- Primary responsibility -- Key interfaces/APIs exposed -- Dependencies on other components -- Technology specifics based on tech stack choices - -5. Create component diagrams where helpful -6. After presenting all components, apply `.bmad-core/tasks/advanced-elicitation.md` protocol]] - -<> - -### {{component_name}} - -**Responsibility:** {{component_description}} - -**Key Interfaces:** - -- {{interface_1}} -- {{interface_2}} - -**Dependencies:** {{dependencies}} - -**Technology Stack:** {{component_tech_details}} -<> - -### Component Diagrams - -[[LLM: Create Mermaid diagrams to visualize component relationships. Options: - -- C4 Container diagram for high-level view -- Component diagram for detailed internal structure -- Sequence diagrams for complex interactions - Choose the most appropriate for clarity - -After presenting the diagrams, apply `.bmad-core/tasks/advanced-elicitation.md` protocol]] - -## External APIs - -[[LLM: For each external service integration: - -1. Identify APIs needed based on PRD requirements and component design -2. If documentation URLs are unknown, ask user for specifics -3. Document authentication methods and security considerations -4. List specific endpoints that will be used -5. Note any rate limits or usage constraints - -If no external APIs are needed, state this explicitly and skip to next section.]] - -^^CONDITION: has_external_apis^^ - -<> - -### {{api_name}} API - -- **Purpose:** {{api_purpose}} -- **Documentation:** {{api_docs_url}} -- **Base URL(s):** {{api_base_url}} -- **Authentication:** {{auth_method}} -- **Rate Limits:** {{rate_limits}} - -**Key Endpoints Used:** -<> - -- `{{method}} {{endpoint_path}}` - {{endpoint_purpose}} - <> - -**Integration Notes:** {{integration_considerations}} -<> - -@{example: external_api} - -### Stripe API - -- **Purpose:** Payment processing and subscription management -- **Documentation:** https://stripe.com/docs/api -- **Base URL(s):** `https://api.stripe.com/v1` -- **Authentication:** Bearer token with secret key -- **Rate Limits:** 100 requests per second - -**Key Endpoints Used:** - -- `POST /customers` - Create customer profiles -- `POST /payment_intents` - Process payments -- `POST /subscriptions` - Manage subscriptions - @{/example} - -^^/CONDITION: has_external_apis^^ - -[[LLM: After presenting external APIs (or noting their absence), apply `.bmad-core/tasks/advanced-elicitation.md` protocol]] - -## Core Workflows - -[[LLM: Illustrate key system workflows using sequence diagrams: - -1. Identify critical user journeys from PRD -2. Show component interactions including external APIs -3. Include error handling paths -4. Document async operations -5. Create both high-level and detailed diagrams as needed - -Focus on workflows that clarify architecture decisions or complex interactions. - -After presenting the workflow diagrams, apply `.bmad-core/tasks/advanced-elicitation.md` protocol]] - -## REST API Spec - -[[LLM: If the project includes a REST API: - -1. Create an OpenAPI 3.0 specification -2. Include all endpoints from epics/stories -3. Define request/response schemas based on data models -4. Document authentication requirements -5. Include example requests/responses - -Use YAML format for better readability. If no REST API, skip this section.]] - -^^CONDITION: has_rest_api^^ - -```yaml -openapi: 3.0.0 -info: - title: - '[object Object]': null - version: - '[object Object]': null - description: - '[object Object]': null -servers: - - url: - '[object Object]': null - description: - '[object Object]': null -``` - -^^/CONDITION: has_rest_api^^ - -[[LLM: After presenting the REST API spec (or noting its absence if not applicable), apply `.bmad-core/tasks/advanced-elicitation.md` protocol]] - -## Database Schema - -[[LLM: Transform the conceptual data models into concrete database schemas: - -1. Use the database type(s) selected in Tech Stack -2. Create schema definitions using appropriate notation -3. Include indexes, constraints, and relationships -4. Consider performance and scalability -5. For NoSQL, show document structures - -Present schema in format appropriate to database type (SQL DDL, JSON schema, etc.) - -After presenting the database schema, apply `.bmad-core/tasks/advanced-elicitation.md` protocol]] - -## Source Tree - -[[LLM: Create a project folder structure that reflects: - -1. The chosen repository structure (monorepo/polyrepo) -2. The service architecture (monolith/microservices/serverless) -3. The selected tech stack and languages -4. Component organization from above -5. Best practices for the chosen frameworks -6. Clear separation of concerns - -Adapt the structure based on project needs. For monorepos, show service separation. For serverless, show function organization. Include language-specific conventions. - -After presenting the structure, apply `.bmad-core/tasks/advanced-elicitation.md` protocol to refine based on user feedback.]] - -```plaintext -{{project-root}}/ -├── .github/ # CI/CD workflows -│ └── workflows/ -│ └── main.yaml -├── .vscode/ # VSCode settings (optional) -│ └── settings.json -├── build/ # Compiled output (git-ignored) -├── config/ # Configuration files -├── docs/ # Project documentation -│ ├── PRD.md -│ ├── architecture.md -│ └── ... -├── infra/ # Infrastructure as Code -│ └── {{iac-structure}} -├── {{dependencies-dir}}/ # Dependencies (git-ignored) -├── scripts/ # Utility scripts -├── src/ # Application source code -│ └── {{source-structure}} -├── tests/ # Test files -│ ├── unit/ -│ ├── integration/ -│ └── e2e/ -├── .env.example # Environment variables template -├── .gitignore # Git ignore rules -├── {{package-manifest}} # Dependencies manifest -├── {{config-files}} # Language/framework configs -└── README.md # Project documentation - -@{example: monorepo-structure} -project-root/ -├── packages/ -│ ├── api/ # Backend API service -│ ├── web/ # Frontend application -│ ├── shared/ # Shared utilities/types -│ └── infrastructure/ # IaC definitions -├── scripts/ # Monorepo management scripts -└── package.json # Root package.json with workspaces -@{/example} -``` - -[[LLM: After presenting the source tree structure, apply `.bmad-core/tasks/advanced-elicitation.md` protocol]] - -## Infrastructure and Deployment - -[[LLM: Define the deployment architecture and practices: - -1. Use IaC tool selected in Tech Stack -2. Choose deployment strategy appropriate for the architecture -3. Define environments and promotion flow -4. Establish rollback procedures -5. Consider security, monitoring, and cost optimization - -Get user input on deployment preferences and CI/CD tool choices.]] - -### Infrastructure as Code - -- **Tool:** {{iac_tool}} {{version}} -- **Location:** `{{iac_directory}}` -- **Approach:** {{iac_approach}} - -### Deployment Strategy - -- **Strategy:** {{deployment_strategy}} -- **CI/CD Platform:** {{cicd_platform}} -- **Pipeline Configuration:** `{{pipeline_config_location}}` - -### Environments - -<> - -- **{{env_name}}:** {{env_purpose}} - {{env_details}} - <> - -### Environment Promotion Flow - -```text -{{promotion_flow_diagram}} -``` - -### Rollback Strategy - -- **Primary Method:** {{rollback_method}} -- **Trigger Conditions:** {{rollback_triggers}} -- **Recovery Time Objective:** {{rto}} - -[[LLM: After presenting the infrastructure and deployment section, apply `.bmad-core/tasks/advanced-elicitation.md` protocol]] - -## Error Handling Strategy - -[[LLM: Define comprehensive error handling approach: - -1. Choose appropriate patterns for the language/framework from Tech Stack -2. Define logging standards and tools -3. Establish error categories and handling rules -4. Consider observability and debugging needs -5. Ensure security (no sensitive data in logs) - -This section guides both AI and human developers in consistent error handling.]] - -### General Approach - -- **Error Model:** {{error_model}} -- **Exception Hierarchy:** {{exception_structure}} -- **Error Propagation:** {{propagation_rules}} - -### Logging Standards - -- **Library:** {{logging_library}} {{version}} -- **Format:** {{log_format}} -- **Levels:** {{log_levels_definition}} -- **Required Context:** - - Correlation ID: {{correlation_id_format}} - - Service Context: {{service_context}} - - User Context: {{user_context_rules}} - -### Error Handling Patterns - -#### External API Errors - -- **Retry Policy:** {{retry_strategy}} -- **Circuit Breaker:** {{circuit_breaker_config}} -- **Timeout Configuration:** {{timeout_settings}} -- **Error Translation:** {{error_mapping_rules}} - -#### Business Logic Errors - -- **Custom Exceptions:** {{business_exception_types}} -- **User-Facing Errors:** {{user_error_format}} -- **Error Codes:** {{error_code_system}} - -#### Data Consistency - -- **Transaction Strategy:** {{transaction_approach}} -- **Compensation Logic:** {{compensation_patterns}} -- **Idempotency:** {{idempotency_approach}} - -[[LLM: After presenting the error handling strategy, apply `.bmad-core/tasks/advanced-elicitation.md` protocol]] - -## Coding Standards - -[[LLM: These standards are MANDATORY for AI agents. Work with user to define ONLY the critical rules needed to prevent bad code. Explain that: - -1. This section directly controls AI developer behavior -2. Keep it minimal - assume AI knows general best practices -3. Focus on project-specific conventions and gotchas -4. Overly detailed standards bloat context and slow development -5. Standards will be extracted to separate file for dev agent use - -For each standard, get explicit user confirmation it's necessary.]] - -### Core Standards - -- **Languages & Runtimes:** {{languages_and_versions}} -- **Style & Linting:** {{linter_config}} -- **Test Organization:** {{test_file_convention}} - -### Naming Conventions - -[[LLM: Only include if deviating from language defaults]] - -| Element | Convention | Example | -| :-------- | :------------------- | :---------------- | -| Variables | {{var_convention}} | {{var_example}} | -| Functions | {{func_convention}} | {{func_example}} | -| Classes | {{class_convention}} | {{class_example}} | -| Files | {{file_convention}} | {{file_example}} | - -### Critical Rules - -[[LLM: List ONLY rules that AI might violate or project-specific requirements. Examples: - -- "Never use console.log in production code - use logger" -- "All API responses must use ApiResponse wrapper type" -- "Database queries must use repository pattern, never direct ORM" - -Avoid obvious rules like "use SOLID principles" or "write clean code"]] - -<> - -- **{{rule_name}}:** {{rule_description}} - <> - -### Language-Specific Guidelines - -[[LLM: Add ONLY if critical for preventing AI mistakes. Most teams don't need this section.]] - -^^CONDITION: has_language_specifics^^ - -#### {{language_name}} Specifics - -<> - -- **{{rule_topic}}:** {{rule_detail}} - <> - -^^/CONDITION: has_language_specifics^^ - -[[LLM: After presenting the coding standards, apply `.bmad-core/tasks/advanced-elicitation.md` protocol]] - -## Test Strategy and Standards - -[[LLM: Work with user to define comprehensive test strategy: - -1. Use test frameworks from Tech Stack -2. Decide on TDD vs test-after approach -3. Define test organization and naming -4. Establish coverage goals -5. Determine integration test infrastructure -6. Plan for test data and external dependencies - -Note: Basic info goes in Coding Standards for dev agent. This detailed section is for QA agent and team reference. Apply `.bmad-core/tasks/advanced-elicitation.md` after initial draft.]] - -### Testing Philosophy - -- **Approach:** {{test_approach}} -- **Coverage Goals:** {{coverage_targets}} -- **Test Pyramid:** {{test_distribution}} - -### Test Types and Organization - -#### Unit Tests - -- **Framework:** {{unit_test_framework}} {{version}} -- **File Convention:** {{unit_test_naming}} -- **Location:** {{unit_test_location}} -- **Mocking Library:** {{mocking_library}} -- **Coverage Requirement:** {{unit_coverage}} - -**AI Agent Requirements:** - -- Generate tests for all public methods -- Cover edge cases and error conditions -- Follow AAA pattern (Arrange, Act, Assert) -- Mock all external dependencies - -#### Integration Tests - -- **Scope:** {{integration_scope}} -- **Location:** {{integration_test_location}} -- **Test Infrastructure:** - <> - - **{{dependency_name}}:** {{test_approach}} ({{test_tool}}) - <> - -@{example: test_dependencies} - -- **Database:** In-memory H2 for unit tests, Testcontainers PostgreSQL for integration -- **Message Queue:** Embedded Kafka for tests -- **External APIs:** WireMock for stubbing - @{/example} - -#### End-to-End Tests - -- **Framework:** {{e2e_framework}} {{version}} -- **Scope:** {{e2e_scope}} -- **Environment:** {{e2e_environment}} -- **Test Data:** {{e2e_data_strategy}} - -### Test Data Management - -- **Strategy:** {{test_data_approach}} -- **Fixtures:** {{fixture_location}} -- **Factories:** {{factory_pattern}} -- **Cleanup:** {{cleanup_strategy}} - -### Continuous Testing - -- **CI Integration:** {{ci_test_stages}} -- **Performance Tests:** {{perf_test_approach}} -- **Security Tests:** {{security_test_approach}} - -[[LLM: After presenting the test strategy section, apply `.bmad-core/tasks/advanced-elicitation.md` protocol]] - -## Security - -[[LLM: Define MANDATORY security requirements for AI and human developers: - -1. Focus on implementation-specific rules -2. Reference security tools from Tech Stack -3. Define clear patterns for common scenarios -4. These rules directly impact code generation -5. Work with user to ensure completeness without redundancy]] - -### Input Validation - -- **Validation Library:** {{validation_library}} -- **Validation Location:** {{where_to_validate}} -- **Required Rules:** - - All external inputs MUST be validated - - Validation at API boundary before processing - - Whitelist approach preferred over blacklist - -### Authentication & Authorization - -- **Auth Method:** {{auth_implementation}} -- **Session Management:** {{session_approach}} -- **Required Patterns:** - - {{auth_pattern_1}} - - {{auth_pattern_2}} - -### Secrets Management - -- **Development:** {{dev_secrets_approach}} -- **Production:** {{prod_secrets_service}} -- **Code Requirements:** - - NEVER hardcode secrets - - Access via configuration service only - - No secrets in logs or error messages - -### API Security - -- **Rate Limiting:** {{rate_limit_implementation}} -- **CORS Policy:** {{cors_configuration}} -- **Security Headers:** {{required_headers}} -- **HTTPS Enforcement:** {{https_approach}} - -### Data Protection - -- **Encryption at Rest:** {{encryption_at_rest}} -- **Encryption in Transit:** {{encryption_in_transit}} -- **PII Handling:** {{pii_rules}} -- **Logging Restrictions:** {{what_not_to_log}} - -### Dependency Security - -- **Scanning Tool:** {{dependency_scanner}} -- **Update Policy:** {{update_frequency}} -- **Approval Process:** {{new_dep_process}} - -### Security Testing - -- **SAST Tool:** {{static_analysis}} -- **DAST Tool:** {{dynamic_analysis}} -- **Penetration Testing:** {{pentest_schedule}} - -[[LLM: After presenting the security section, apply `.bmad-core/tasks/advanced-elicitation.md` protocol]] - -## Checklist Results Report - -[[LLM: Before running the checklist, offer to output the full architecture document. Once user confirms, execute the `architect-checklist` and populate results here.]] - ---- - -## Next Steps - -[[LLM: After completing the architecture: - -1. If project has UI components: - -- Recommend engaging Design Architect agent -- Use "Frontend Architecture Mode" -- Provide this document as input - -2. For all projects: - -- Review with Product Owner -- Begin story implementation with Dev agent -- Set up infrastructure with DevOps agent - -3. Include specific prompts for next agents if needed]] - -^^CONDITION: has_ui^^ - -### Design Architect Prompt - -[[LLM: Create a brief prompt to hand off to Design Architect for Frontend Architecture creation. Include: - -- Reference to this architecture document -- Key UI requirements from PRD -- Any frontend-specific decisions made here -- Request for detailed frontend architecture]] - -^^/CONDITION: has_ui^^ - -### Developer Handoff - -[[LLM: Create a brief prompt for developers starting implementation. Include: - -- Reference to this architecture and coding standards -- First epic/story to implement -- Key technical decisions to follow]] -==================== END: .bmad-core/templates/architecture-tmpl.md ==================== - -==================== START: .bmad-core/templates/front-end-architecture-tmpl.md ==================== -# {{Project Name}} Frontend Architecture Document - -[[LLM: The default path and filename unless specified is docs/ui-architecture.md]] - -[[LLM: Review provided documents including PRD, UX-UI Specification, and main Architecture Document. Focus on extracting technical implementation details needed for AI frontend tools and developer agents. Ask the user for any of these documents if you are unable to locate and were not provided.]] - -## Template and Framework Selection - -[[LLM: Before proceeding with frontend architecture design, check if the project is using a frontend starter template or existing codebase: - -1. Review the PRD, main architecture document, and brainstorming brief for mentions of: - - - Frontend starter templates (e.g., Create React App, Next.js, Vite, Vue CLI, Angular CLI, etc.) - - UI kit or component library starters - - Existing frontend projects being used as a foundation - - Admin dashboard templates or other specialized starters - - Design system implementations - -2. If a frontend starter template or existing project is mentioned: - - - Ask the user to provide access via one of these methods: - - Link to the starter template documentation - - Upload/attach the project files (for small projects) - - Share a link to the project repository - - Analyze the starter/existing project to understand: - - Pre-installed dependencies and versions - - Folder structure and file organization - - Built-in components and utilities - - Styling approach (CSS modules, styled-components, Tailwind, etc.) - - State management setup (if any) - - Routing configuration - - Testing setup and patterns - - Build and development scripts - -- Use this analysis to ensure your frontend architecture aligns with the starter's patterns - -3. If no frontend starter is mentioned but this is a new UI, ensure we know what the ui language and framework is: - - - Based on the framework choice, suggest appropriate starters: - - React: Create React App, Next.js, Vite + React - - Vue: Vue CLI, Nuxt.js, Vite + Vue - - Angular: Angular CLI - - Or suggest popular UI templates if applicable - - Explain benefits specific to frontend development - -4. If the user confirms no starter template will be used: - - Note that all tooling, bundling, and configuration will need manual setup - - Proceed with frontend architecture from scratch - -Document the starter template decision and any constraints it imposes before proceeding.]] - -### Change Log - -[[LLM: Track document versions and changes]] - -| Date | Version | Description | Author | -| :--- | :------ | :---------- | :----- | - -## Frontend Tech Stack - -[[LLM: Extract from main architecture's Technology Stack Table. This section MUST remain synchronized with the main architecture document. After presenting this section, apply `tasks#advanced-elicitation` protocol]] - -### Technology Stack Table - -| Category | Technology | Version | Purpose | Rationale | -| :-------------------- | :------------------- | :---------- | :---------- | :------------- | -| **Framework** | {{framework}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **UI Library** | {{ui_library}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **State Management** | {{state_management}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **Routing** | {{routing_library}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **Build Tool** | {{build_tool}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **Styling** | {{styling_solution}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **Testing** | {{test_framework}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **Component Library** | {{component_lib}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **Form Handling** | {{form_library}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **Animation** | {{animation_lib}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **Dev Tools** | {{dev_tools}} | {{version}} | {{purpose}} | {{why_chosen}} | - -[[LLM: Fill in appropriate technology choices based on the selected framework and project requirements.]] - -## Project Structure - -[[LLM: Define exact directory structure for AI tools based on the chosen framework. Be specific about where each type of file goes. Generate a structure that follows the framework's best practices and conventions. After presenting this section, apply `tasks#advanced-elicitation` protocol]] - -## Component Standards - -[[LLM: Define exact patterns for component creation based on the chosen framework. After presenting this section, apply `tasks#advanced-elicitation` protocol]] - -### Component Template - -[[LLM: Generate a minimal but complete component template following the framework's best practices. Include TypeScript types, proper imports, and basic structure.]] - -### Naming Conventions - -[[LLM: Provide naming conventions specific to the chosen framework for components, files, services, state management, and other architectural elements.]] - -## State Management - -[[LLM: Define state management patterns based on the chosen framework. After presenting this section, apply `tasks#advanced-elicitation` protocol]] - -### Store Structure - -[[LLM: Generate the state management directory structure appropriate for the chosen framework and selected state management solution.]] - -### State Management Template - -[[LLM: Provide a basic state management template/example following the framework's recommended patterns. Include TypeScript types and common operations like setting, updating, and clearing state.]] - -## API Integration - -[[LLM: Define API service patterns based on the chosen framework. After presenting this section, apply `tasks#advanced-elicitation` protocol]] - -### Service Template - -[[LLM: Provide an API service template that follows the framework's conventions. Include proper TypeScript types, error handling, and async patterns.]] - -### API Client Configuration - -[[LLM: Show how to configure the HTTP client for the chosen framework, including authentication interceptors/middleware and error handling.]] - -## Routing - -[[LLM: Define routing structure and patterns based on the chosen framework. After presenting this section, apply `tasks#advanced-elicitation` protocol]] - -### Route Configuration - -[[LLM: Provide routing configuration appropriate for the chosen framework. Include protected route patterns, lazy loading where applicable, and authentication guards/middleware.]] - -## Styling Guidelines - -[[LLM: Define styling approach based on the chosen framework. After presenting this section, apply `tasks#advanced-elicitation` protocol]] - -### Styling Approach - -[[LLM: Describe the styling methodology appropriate for the chosen framework (CSS Modules, Styled Components, Tailwind, etc.) and provide basic patterns.]] - -### Global Theme Variables - -[[LLM: Provide a CSS custom properties (CSS variables) theme system that works across all frameworks. Include colors, spacing, typography, shadows, and dark mode support.]] - -## Testing Requirements - -[[LLM: Define minimal testing requirements based on the chosen framework. After presenting this section, apply `tasks#advanced-elicitation` protocol]] - -### Component Test Template - -[[LLM: Provide a basic component test template using the framework's recommended testing library. Include examples of rendering tests, user interaction tests, and mocking.]] - -### Testing Best Practices - -1. **Unit Tests**: Test individual components in isolation -2. **Integration Tests**: Test component interactions -3. **E2E Tests**: Test critical user flows (using Cypress/Playwright) -4. **Coverage Goals**: Aim for 80% code coverage -5. **Test Structure**: Arrange-Act-Assert pattern -6. **Mock External Dependencies**: API calls, routing, state management - -## Environment Configuration - -[[LLM: List required environment variables based on the chosen framework. Show the appropriate format and naming conventions for the framework. After presenting this section, apply `tasks#advanced-elicitation` protocol]] - -## Frontend Developer Standards - -### Critical Coding Rules - -[[LLM: List essential rules that prevent common AI mistakes, including both universal rules and framework-specific ones. After presenting this section, apply `tasks#advanced-elicitation` protocol]] - -### Quick Reference - -[[LLM: Create a framework-specific cheat sheet with: - -- Common commands (dev server, build, test) -- Key import patterns -- File naming conventions -- Project-specific patterns and utilities]] -==================== END: .bmad-core/templates/front-end-architecture-tmpl.md ==================== - -==================== START: .bmad-core/templates/fullstack-architecture-tmpl.md ==================== -# {{Project Name}} Fullstack Architecture Document - -[[LLM: The default path and filename unless specified is docs/architecture.md]] - -[[LLM: If available, review any provided relevant documents to gather all relevant context before beginning. At minimum, you should have access to docs/prd.md and docs/front-end-spec.md. Ask the user for any documents you need but cannot locate. This template creates a unified architecture that covers both backend and frontend concerns to guide AI-driven fullstack development.]] - -## Introduction - -[[LLM: This section establishes the document's purpose and scope. Keep the content below but ensure project name is properly substituted. - -After presenting this section, apply `tasks#advanced-elicitation` protocol]] - -This document outlines the complete fullstack architecture for {{Project Name}}, including backend systems, frontend implementation, and their integration. It serves as the single source of truth for AI-driven development, ensuring consistency across the entire technology stack. - -This unified approach combines what would traditionally be separate backend and frontend architecture documents, streamlining the development process for modern fullstack applications where these concerns are increasingly intertwined. - -### Starter Template or Existing Project - -[[LLM: Before proceeding with architecture design, check if the project is based on any starter templates or existing codebases: - -1. Review the PRD and other documents for mentions of: - -- Fullstack starter templates (e.g., T3 Stack, MEAN/MERN starters, Django + React templates) -- Monorepo templates (e.g., Nx, Turborepo starters) -- Platform-specific starters (e.g., Vercel templates, AWS Amplify starters) -- Existing projects being extended or cloned - -2. If starter templates or existing projects are mentioned: - -- Ask the user to provide access (links, repos, or files) -- Analyze to understand pre-configured choices and constraints -- Note any architectural decisions already made -- Identify what can be modified vs what must be retained - -3. If no starter is mentioned but this is greenfield: - -- Suggest appropriate fullstack starters based on tech preferences -- Consider platform-specific options (Vercel, AWS, etc.) -- Let user decide whether to use one - -4. Document the decision and any constraints it imposes - -If none, state "N/A - Greenfield project" - -### Change Log - -[[LLM: Track document versions and changes]] - -| Date | Version | Description | Author | -| :--- | :------ | :---------- | :----- | - -## High Level Architecture - -[[LLM: This section contains multiple subsections that establish the foundation. Present all subsections together, then apply `tasks#advanced-elicitation` protocol to the complete section.]] - -### Technical Summary - -[[LLM: Provide a comprehensive overview (4-6 sentences) covering: - -- Overall architectural style and deployment approach -- Frontend framework and backend technology choices -- Key integration points between frontend and backend -- Infrastructure platform and services -- How this architecture achieves PRD goals]] - -### Platform and Infrastructure Choice - -[[LLM: Based on PRD requirements and technical assumptions, make a platform recommendation: - -1. Consider common patterns (not an exhaustive list, use your own best judgement and search the web as needed for emerging trends): - - - **Vercel + Supabase**: For rapid development with Next.js, built-in auth/storage - - **AWS Full Stack**: For enterprise scale with Lambda, API Gateway, S3, Cognito - - **Azure**: For .NET ecosystems or enterprise Microsoft environments - - **Google Cloud**: For ML/AI heavy applications or Google ecosystem integration - -2. Present 2-3 viable options with clear pros/cons -3. Make a recommendation with rationale -4. Get explicit user confirmation - -Document the choice and key services that will be used.]] - -**Platform:** {{selected_platform}} -**Key Services:** {{core_services_list}} -**Deployment Host and Regions:** {{regions}} - -### Repository Structure - -[[LLM: Define the repository approach based on PRD requirements and platform choice, explain your rationale or ask quetsions to the user if unsure: - -1. For modern fullstack apps, monorepo is often preferred -2. Consider tooling (Nx, Turborepo, Lerna, npm workspaces) -3. Define package/app boundaries -4. Plan for shared code between frontend and backend]] - -**Structure:** {{repo_structure_choice}} -**Monorepo Tool:** {{monorepo_tool_if_applicable}} -**Package Organization:** {{package_strategy}} - -### High Level Architecture Diagram - -[[LLM: Create a Mermaid diagram showing the complete system architecture including: - -- User entry points (web, mobile) -- Frontend application deployment -- API layer (REST/GraphQL) -- Backend services -- Databases and storage -- External integrations -- CDN and caching layers - -Use appropriate diagram type for clarity.]] - -```mermaid -{{architecture_diagram}} -``` - -### Architectural Patterns - -[[LLM: List patterns that will guide both frontend and backend development. Include patterns for: - -- Overall architecture (e.g., Jamstack, Serverless, Microservices) -- Frontend patterns (e.g., Component-based, State management) -- Backend patterns (e.g., Repository, CQRS, Event-driven) -- Integration patterns (e.g., BFF, API Gateway) - -For each pattern, provide recommendation and rationale.]] - -<> - -- **{{pattern_name}}:** {{pattern_description}} - _Rationale:_ {{rationale}} - <> - -@{example: patterns} - -- **Jamstack Architecture:** Static site generation with serverless APIs - _Rationale:_ Optimal performance and scalability for content-heavy applications -- **Component-Based UI:** Reusable React components with TypeScript - _Rationale:_ Maintainability and type safety across large codebases -- **Repository Pattern:** Abstract data access logic - _Rationale:_ Enables testing and future database migration flexibility -- **API Gateway Pattern:** Single entry point for all API calls - _Rationale:_ Centralized auth, rate limiting, and monitoring - @{/example} - -## Tech Stack - -[[LLM: This is the DEFINITIVE technology selection for the entire project. Work with user to finalize all choices. This table is the single source of truth - all development must use these exact versions. - -Key areas to cover: - -- Frontend and backend languages/frameworks -- Databases and caching -- Authentication and authorization -- API approach -- Testing tools for both frontend and backend -- Build and deployment tools -- Monitoring and logging - -Upon render, apply `tasks#advanced-elicitation` display immediately.]] - -### Technology Stack Table - -| Category | Technology | Version | Purpose | Rationale | -| :----------------------- | :---------------- | :---------- | :---------- | :------------- | -| **Frontend Language** | {{fe_language}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **Frontend Framework** | {{fe_framework}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **UI Component Library** | {{ui_library}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **State Management** | {{state_mgmt}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **Backend Language** | {{be_language}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **Backend Framework** | {{be_framework}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **API Style** | {{api_style}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **Database** | {{database}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **Cache** | {{cache}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **File Storage** | {{storage}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **Authentication** | {{auth}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **Frontend Testing** | {{fe_test}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **Backend Testing** | {{be_test}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **E2E Testing** | {{e2e_test}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **Build Tool** | {{build_tool}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **Bundler** | {{bundler}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **IaC Tool** | {{iac_tool}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **CI/CD** | {{cicd}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **Monitoring** | {{monitoring}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **Logging** | {{logging}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **CSS Framework** | {{css_framework}} | {{version}} | {{purpose}} | {{why_chosen}} | - -@{example: tech_stack_rows} -| **Frontend Language** | TypeScript | 5.3.3 | Type-safe frontend development | Strong typing, excellent tooling | -| **Frontend Framework** | Next.js | 14.1.0 | React framework with SSR/SSG | SEO, performance, Vercel integration | -| **Backend Language** | TypeScript | 5.3.3 | Type-safe backend development | Code sharing with frontend | -| **API Style** | REST + tRPC | - | Type-safe API communication | End-to-end type safety | -| **Database** | PostgreSQL | 16.1 | Primary data store | ACID compliance, JSON support | -| **Authentication** | Supabase Auth | 2.39.0 | User authentication | Built-in auth flows, social providers | -@{/example} - -## Data Models - -[[LLM: Define the core data models/entities that will be shared between frontend and backend: - -1. Review PRD requirements and identify key business entities -2. For each model, explain its purpose and relationships -3. Include key attributes and data types -4. Show relationships between models -5. Create TypeScript interfaces that can be shared -6. Discuss design decisions with user - -Create a clear conceptual model before moving to database schema. - -After presenting all data models, apply `tasks#advanced-elicitation` protocol]] - -<> - -### {{model_name}} - -**Purpose:** {{model_purpose}} - -**Key Attributes:** - -- {{attribute_1}}: {{type_1}} - {{description_1}} -- {{attribute_2}}: {{type_2}} - {{description_2}} - -**TypeScript Interface:** - -```typescript -{ - { - model_interface; - } -} -``` - -**Relationships:** - -- {{relationship_1}} -- {{relationship_2}} - <> - -@{example: data_model} - -### User - -**Purpose:** Represents authenticated users in the system - -**Key Attributes:** - -- id: string - Unique identifier -- email: string - User's email address -- name: string - Display name -- role: enum - User permission level -- timestamps: Date - Created and updated times - -**TypeScript Interface:** - -```typescript -interface User { - id: string; - email: string; - name: string; - role: "admin" | "user" | "guest"; - createdAt: Date; - updatedAt: Date; - profile?: UserProfile; -} - -interface UserProfile { - avatarUrl?: string; - bio?: string; - preferences: Record; -} -``` - -**Relationships:** - -- Has many Posts (1:n) -- Has one Profile (1:1) - @{/example} - -## REST API Spec - -[[LLM: Based on the chosen API style from Tech Stack: - -1. If REST API, create an OpenAPI 3.0 specification -2. If GraphQL, provide the GraphQL schema -3. If tRPC, show router definitions -4. Include all endpoints from epics/stories -5. Define request/response schemas based on data models -6. Document authentication requirements -7. Include example requests/responses - -Use appropriate format for the chosen API style. If no API (e.g., static site), skip this section.]] - -^^CONDITION: has_rest_api^^ - -```yaml -openapi: 3.0.0 -info: - title: - '[object Object]': null - version: - '[object Object]': null - description: - '[object Object]': null -servers: - - url: - '[object Object]': null - description: - '[object Object]': null -``` - -^^/CONDITION: has_rest_api^^ - -^^CONDITION: has_graphql_api^^ - -```graphql -# GraphQL Schema -{{graphql_schema}} -``` - -^^/CONDITION: has_graphql_api^^ - -^^CONDITION: has_trpc_api^^ - -```typescript -// tRPC Router Definitions -{ - { - trpc_routers; - } -} -``` - -^^/CONDITION: has_trpc_api^^ - -[[LLM: After presenting the API spec (or noting its absence if not applicable), apply `tasks#advanced-elicitation` protocol]] - -## Components - -[[LLM: Based on the architectural patterns, tech stack, and data models from above: - -1. Identify major logical components/services across the fullstack -2. Consider both frontend and backend components -3. Define clear boundaries and interfaces between components -4. For each component, specify: - -- Primary responsibility -- Key interfaces/APIs exposed -- Dependencies on other components -- Technology specifics based on tech stack choices - -5. Create component diagrams where helpful -6. After presenting all components, apply `tasks#advanced-elicitation` protocol]] - -<> - -### {{component_name}} - -**Responsibility:** {{component_description}} - -**Key Interfaces:** - -- {{interface_1}} -- {{interface_2}} - -**Dependencies:** {{dependencies}} - -**Technology Stack:** {{component_tech_details}} -<> - -### Component Diagrams - -[[LLM: Create Mermaid diagrams to visualize component relationships. Options: - -- C4 Container diagram for high-level view -- Component diagram for detailed internal structure -- Sequence diagrams for complex interactions - Choose the most appropriate for clarity - -After presenting the diagrams, apply `tasks#advanced-elicitation` protocol]] - -## External APIs - -[[LLM: For each external service integration: - -1. Identify APIs needed based on PRD requirements and component design -2. If documentation URLs are unknown, ask user for specifics -3. Document authentication methods and security considerations -4. List specific endpoints that will be used -5. Note any rate limits or usage constraints - -If no external APIs are needed, state this explicitly and skip to next section.]] - -^^CONDITION: has_external_apis^^ - -<> - -### {{api_name}} API - -- **Purpose:** {{api_purpose}} -- **Documentation:** {{api_docs_url}} -- **Base URL(s):** {{api_base_url}} -- **Authentication:** {{auth_method}} -- **Rate Limits:** {{rate_limits}} - -**Key Endpoints Used:** -<> - -- `{{method}} {{endpoint_path}}` - {{endpoint_purpose}} - <> - -**Integration Notes:** {{integration_considerations}} -<> - -@{example: external_api} - -### Stripe API - -- **Purpose:** Payment processing and subscription management -- **Documentation:** https://stripe.com/docs/api -- **Base URL(s):** `https://api.stripe.com/v1` -- **Authentication:** Bearer token with secret key -- **Rate Limits:** 100 requests per second - -**Key Endpoints Used:** - -- `POST /customers` - Create customer profiles -- `POST /payment_intents` - Process payments -- `POST /subscriptions` - Manage subscriptions - @{/example} - -^^/CONDITION: has_external_apis^^ - -[[LLM: After presenting external APIs (or noting their absence), apply `tasks#advanced-elicitation` protocol]] - -## Core Workflows - -[[LLM: Illustrate key system workflows using sequence diagrams: - -1. Identify critical user journeys from PRD -2. Show component interactions including external APIs -3. Include both frontend and backend flows -4. Include error handling paths -5. Document async operations -6. Create both high-level and detailed diagrams as needed - -Focus on workflows that clarify architecture decisions or complex interactions. - -After presenting the workflow diagrams, apply `tasks#advanced-elicitation` protocol]] - -## Database Schema - -[[LLM: Transform the conceptual data models into concrete database schemas: - -1. Use the database type(s) selected in Tech Stack -2. Create schema definitions using appropriate notation -3. Include indexes, constraints, and relationships -4. Consider performance and scalability -5. For NoSQL, show document structures - -Present schema in format appropriate to database type (SQL DDL, JSON schema, etc.) - -After presenting the database schema, apply `tasks#advanced-elicitation` protocol]] - -## Frontend Architecture - -[[LLM: Define frontend-specific architecture details. After each subsection, note if user wants to refine before continuing. - -After presenting this section, apply `tasks#advanced-elicitation` protocol]] - -### Component Architecture - -[[LLM: Define component organization and patterns based on chosen framework.]] - -**Component Organization:** - -```text -{{component_structure}} -``` - -**Component Template:** - -```typescript -{ - { - component_template; - } -} -``` - -### State Management Architecture - -[[LLM: Detail state management approach based on chosen solution.]] - -**State Structure:** - -```typescript -{ - { - state_structure; - } -} -``` - -**State Management Patterns:** - -- {{pattern_1}} -- {{pattern_2}} - -### Routing Architecture - -[[LLM: Define routing structure based on framework choice.]] - -**Route Organization:** - -```text -{{route_structure}} -``` - -**Protected Route Pattern:** - -```typescript -{ - { - protected_route_example; - } -} -``` - -### Frontend Services Layer - -[[LLM: Define how frontend communicates with backend.]] - -**API Client Setup:** - -```typescript -{ - { - api_client_setup; - } -} -``` - -**Service Example:** - -```typescript -{ - { - service_example; - } -} -``` - -## Backend Architecture - -[[LLM: Define backend-specific architecture details. Consider serverless vs traditional server approaches. - -After presenting this section, apply `tasks#advanced-elicitation` protocol]] - -### Service Architecture - -[[LLM: Based on platform choice, define service organization.]] - -^^CONDITION: serverless^^ -**Function Organization:** - -```text - -{{function_structure}} - -``` - -**Function Template:** - -```typescript -{ - { - function_template; - } -} -``` - -^^/CONDITION: serverless^^ - -^^CONDITION: traditional_server^^ -**Controller/Route Organization:** - -```text -{{controller_structure}} -``` - -**Controller Template:** - -```typescript -{ - { - controller_template; - } -} -``` - -^^/CONDITION: traditional_server^^ - -### Database Architecture - -[[LLM: Define database schema and access patterns.]] - -**Schema Design:** - -```sql -{{database_schema}} -``` - -**Data Access Layer:** - -```typescript -{ - { - repository_pattern; - } -} -``` - -### Authentication and Authorization - -[[LLM: Define auth implementation details.]] - -**Auth Flow:** - -```mermaid -{{auth_flow_diagram}} -``` - -**Middleware/Guards:** - -```typescript -{ - { - auth_middleware; - } -} -``` - -## Unified Project Structure - -[[LLM: Create a monorepo structure that accommodates both frontend and backend. Adapt based on chosen tools and frameworks. After presenting, apply `tasks#advanced-elicitation` protocol.]] - -```plaintext -{{project-name}}/ -├── .github/ # CI/CD workflows -│ └── workflows/ -│ ├── ci.yaml -│ └── deploy.yaml -├── apps/ # Application packages -│ ├── web/ # Frontend application -│ │ ├── src/ -│ │ │ ├── components/ # UI components -│ │ │ ├── pages/ # Page components/routes -│ │ │ ├── hooks/ # Custom React hooks -│ │ │ ├── services/ # API client services -│ │ │ ├── stores/ # State management -│ │ │ ├── styles/ # Global styles/themes -│ │ │ └── utils/ # Frontend utilities -│ │ ├── public/ # Static assets -│ │ ├── tests/ # Frontend tests -│ │ └── package.json -│ └── api/ # Backend application -│ ├── src/ -│ │ ├── routes/ # API routes/controllers -│ │ ├── services/ # Business logic -│ │ ├── models/ # Data models -│ │ ├── middleware/ # Express/API middleware -│ │ ├── utils/ # Backend utilities -│ │ └── {{serverless_or_server_entry}} -│ ├── tests/ # Backend tests -│ └── package.json -├── packages/ # Shared packages -│ ├── shared/ # Shared types/utilities -│ │ ├── src/ -│ │ │ ├── types/ # TypeScript interfaces -│ │ │ ├── constants/ # Shared constants -│ │ │ └── utils/ # Shared utilities -│ │ └── package.json -│ ├── ui/ # Shared UI components -│ │ ├── src/ -│ │ └── package.json -│ └── config/ # Shared configuration -│ ├── eslint/ -│ ├── typescript/ -│ └── jest/ -├── infrastructure/ # IaC definitions -│ └── {{iac_structure}} -├── scripts/ # Build/deploy scripts -├── docs/ # Documentation -│ ├── prd.md -│ ├── front-end-spec.md -│ └── fullstack-architecture.md -├── .env.example # Environment template -├── package.json # Root package.json -├── {{monorepo_config}} # Monorepo configuration -└── README.md -``` - -@{example: vercel_structure} -apps/ -├── web/ # Next.js app -│ ├── app/ # App directory (Next.js 14+) -│ ├── components/ -│ └── lib/ -└── api/ # API routes in Next.js or separate -└── pages/api/ # API routes -@{/example} - -## Development Workflow - -[[LLM: Define the development setup and workflow for the fullstack application. - -After presenting this section, apply `tasks#advanced-elicitation` protocol]] - -### Local Development Setup - -**Prerequisites:** - -```bash -{{prerequisites_commands}} -``` - -**Initial Setup:** - -```bash -{{setup_commands}} -``` - -**Development Commands:** - -```bash -# Start all services -{{start_all_command}} - -# Start frontend only -{{start_frontend_command}} - -# Start backend only -{{start_backend_command}} - -# Run tests -{{test_commands}} -``` - -### Environment Configuration - -**Required Environment Variables:** - -```bash -# Frontend (.env.local) -{{frontend_env_vars}} - -# Backend (.env) -{{backend_env_vars}} - -# Shared -{{shared_env_vars}} -``` - -## Deployment Architecture - -[[LLM: Define deployment strategy based on platform choice. After presenting, apply `tasks#advanced-elicitation` protocol.]] - -### Deployment Strategy - -**Frontend Deployment:** - -- **Platform:** {{frontend_deploy_platform}} -- **Build Command:** {{frontend_build_command}} -- **Output Directory:** {{frontend_output_dir}} -- **CDN/Edge:** {{cdn_strategy}} - -**Backend Deployment:** - -- **Platform:** {{backend_deploy_platform}} -- **Build Command:** {{backend_build_command}} -- **Deployment Method:** {{deployment_method}} - -### CI/CD Pipeline - -```yaml -'[object Object]': null -``` - -### Environments - -| Environment | Frontend URL | Backend URL | Purpose | -| :---------- | :----------------- | :----------------- | :--------------------- | -| Development | {{dev_fe_url}} | {{dev_be_url}} | Local development | -| Staging | {{staging_fe_url}} | {{staging_be_url}} | Pre-production testing | -| Production | {{prod_fe_url}} | {{prod_be_url}} | Live environment | - -## Security and Performance - -[[LLM: Define security and performance considerations for the fullstack application. - -After presenting this section, apply `tasks#advanced-elicitation` protocol]] - -### Security Requirements - -**Frontend Security:** - -- CSP Headers: {{csp_policy}} -- XSS Prevention: {{xss_strategy}} -- Secure Storage: {{storage_strategy}} - -**Backend Security:** - -- Input Validation: {{validation_approach}} -- Rate Limiting: {{rate_limit_config}} -- CORS Policy: {{cors_config}} - -**Authentication Security:** - -- Token Storage: {{token_strategy}} -- Session Management: {{session_approach}} -- Password Policy: {{password_requirements}} - -### Performance Optimization - -**Frontend Performance:** - -- Bundle Size Target: {{bundle_size}} -- Loading Strategy: {{loading_approach}} -- Caching Strategy: {{fe_cache_strategy}} - -**Backend Performance:** - -- Response Time Target: {{response_target}} -- Database Optimization: {{db_optimization}} -- Caching Strategy: {{be_cache_strategy}} - -## Testing Strategy - -[[LLM: Define comprehensive testing approach for fullstack application. - -After presenting this section, apply `tasks#advanced-elicitation` protocol]] - -### Testing Pyramid - -```text - - E2E Tests - / \ - Integration Tests - -/ \ - Frontend Unit Backend Unit - -``` - -### Test Organization - -**Frontend Tests:** - -```text - -{{frontend_test_structure}} - -``` - -**Backend Tests:** - -```text - -{{backend_test_structure}} - -``` - -**E2E Tests:** - -```text - -{{e2e_test_structure}} - -``` - -### Test Examples - -**Frontend Component Test:** - -```typescript -{ - { - frontend_test_example; - } -} -``` - -**Backend API Test:** - -```typescript -{ - { - backend_test_example; - } -} -``` - -**E2E Test:** - -```typescript -{ - { - e2e_test_example; - } -} -``` - -## Coding Standards - -[[LLM: Define MINIMAL but CRITICAL standards for AI agents. Focus only on project-specific rules that prevent common mistakes. These will be used by dev agents. - -After presenting this section, apply `tasks#advanced-elicitation` protocol]] - -### Critical Fullstack Rules - -<> - -- **{{rule_name}}:** {{rule_description}} - <> - -@{example: critical_rules} - -- **Type Sharing:** Always define types in packages/shared and import from there -- **API Calls:** Never make direct HTTP calls - use the service layer -- **Environment Variables:** Access only through config objects, never process.env directly -- **Error Handling:** All API routes must use the standard error handler -- **State Updates:** Never mutate state directly - use proper state management patterns - @{/example} - -### Naming Conventions - -| Element | Frontend | Backend | Example | -| :-------------- | :------------------- | :--------- | :------------------ | -| Components | PascalCase | - | `UserProfile.tsx` | -| Hooks | camelCase with 'use' | - | `useAuth.ts` | -| API Routes | - | kebab-case | `/api/user-profile` | -| Database Tables | - | snake_case | `user_profiles` | - -## Error Handling Strategy - -[[LLM: Define unified error handling across frontend and backend. - -After presenting this section, apply `tasks#advanced-elicitation` protocol]] - -### Error Flow - -```mermaid -{{error_flow_diagram}} -``` - -### Error Response Format - -```typescript -interface ApiError { - error: { - code: string; - message: string; - details?: Record; - timestamp: string; - requestId: string; - }; -} -``` - -### Frontend Error Handling - -```typescript -{ - { - frontend_error_handler; - } -} -``` - -### Backend Error Handling - -```typescript -{ - { - backend_error_handler; - } -} -``` - -## Monitoring and Observability - -[[LLM: Define monitoring strategy for fullstack application. - -After presenting this section, apply `tasks#advanced-elicitation` protocol]] - -### Monitoring Stack - -- **Frontend Monitoring:** {{frontend_monitoring}} -- **Backend Monitoring:** {{backend_monitoring}} -- **Error Tracking:** {{error_tracking}} -- **Performance Monitoring:** {{perf_monitoring}} - -### Key Metrics - -**Frontend Metrics:** - -- Core Web Vitals -- JavaScript errors -- API response times -- User interactions - -**Backend Metrics:** - -- Request rate -- Error rate -- Response time -- Database query performance - -## Checklist Results Report - -[[LLM: Before running the checklist, offer to output the full architecture document. Once user confirms, execute the `architect-checklist` and populate results here.]] -==================== END: .bmad-core/templates/fullstack-architecture-tmpl.md ==================== - -==================== START: .bmad-core/templates/brownfield-architecture-tmpl.md ==================== -# {{Project Name}} Brownfield Enhancement Architecture - -[[LLM: The default path and filename unless specified is docs/architecture.md]] - -[[LLM: IMPORTANT - SCOPE AND ASSESSMENT REQUIRED: - -This architecture document is for SIGNIFICANT enhancements to existing projects that require comprehensive architectural planning. Before proceeding: - -1. **Verify Complexity**: Confirm this enhancement requires architectural planning. For simple additions, recommend: "For simpler changes that don't require architectural planning, consider using the brownfield-create-epic or brownfield-create-story task with the Product Owner instead." - -2. **REQUIRED INPUTS**: - - - Completed brownfield-prd.md - - Existing project technical documentation (from docs folder or user-provided) - - Access to existing project structure (IDE or uploaded files) - -3. **DEEP ANALYSIS MANDATE**: You MUST conduct thorough analysis of the existing codebase, architecture patterns, and technical constraints before making ANY architectural recommendations. Every suggestion must be based on actual project analysis, not assumptions. - -4. **CONTINUOUS VALIDATION**: Throughout this process, explicitly validate your understanding with the user. For every architectural decision, confirm: "Based on my analysis of your existing system, I recommend [decision] because [evidence from actual project]. Does this align with your system's reality?" - -If any required inputs are missing, request them before proceeding.]] - -## Introduction - -[[LLM: This section establishes the document's purpose and scope for brownfield enhancements. Keep the content below but ensure project name and enhancement details are properly substituted. - -After presenting this section, apply `tasks#advanced-elicitation` protocol]] - -This document outlines the architectural approach for enhancing {{Project Name}} with {{Enhancement Description}}. Its primary goal is to serve as the guiding architectural blueprint for AI-driven development of new features while ensuring seamless integration with the existing system. - -**Relationship to Existing Architecture:** -This document supplements existing project architecture by defining how new components will integrate with current systems. Where conflicts arise between new and existing patterns, this document provides guidance on maintaining consistency while implementing enhancements. - -### Existing Project Analysis - -[[LLM: Analyze the existing project structure and architecture: - -1. Review existing documentation in docs folder -2. Examine current technology stack and versions -3. Identify existing architectural patterns and conventions -4. Note current deployment and infrastructure setup -5. Document any constraints or limitations - -CRITICAL: After your analysis, explicitly validate your findings: "Based on my analysis of your project, I've identified the following about your existing system: [key findings]. Please confirm these observations are accurate before I proceed with architectural recommendations." - -Present findings and apply `tasks#advanced-elicitation` protocol]] - -**Current Project State:** - -- **Primary Purpose:** {{existing_project_purpose}} -- **Current Tech Stack:** {{existing_tech_summary}} -- **Architecture Style:** {{existing_architecture_style}} -- **Deployment Method:** {{existing_deployment_approach}} - -**Available Documentation:** - -- {{existing_docs_summary}} - -**Identified Constraints:** - -- {{constraint_1}} -- {{constraint_2}} -- {{constraint_3}} - -### Change Log - -| Change | Date | Version | Description | Author | -| ------ | ---- | ------- | ----------- | ------ | - -## Enhancement Scope and Integration Strategy - -[[LLM: Define how the enhancement will integrate with the existing system: - -1. Review the brownfield PRD enhancement scope -2. Identify integration points with existing code -3. Define boundaries between new and existing functionality -4. Establish compatibility requirements - -VALIDATION CHECKPOINT: Before presenting the integration strategy, confirm: "Based on my analysis, the integration approach I'm proposing takes into account [specific existing system characteristics]. These integration points and boundaries respect your current architecture patterns. Is this assessment accurate?" - -Present complete integration strategy and apply `tasks#advanced-elicitation` protocol]] - -### Enhancement Overview - -**Enhancement Type:** {{enhancement_type}} -**Scope:** {{enhancement_scope}} -**Integration Impact:** {{integration_impact_level}} - -### Integration Approach - -**Code Integration Strategy:** {{code_integration_approach}} -**Database Integration:** {{database_integration_approach}} -**API Integration:** {{api_integration_approach}} -**UI Integration:** {{ui_integration_approach}} - -### Compatibility Requirements - -- **Existing API Compatibility:** {{api_compatibility}} -- **Database Schema Compatibility:** {{db_compatibility}} -- **UI/UX Consistency:** {{ui_compatibility}} -- **Performance Impact:** {{performance_constraints}} - -## Tech Stack Alignment - -[[LLM: Ensure new components align with existing technology choices: - -1. Use existing technology stack as the foundation -2. Only introduce new technologies if absolutely necessary -3. Justify any new additions with clear rationale -4. Ensure version compatibility with existing dependencies - -Present complete tech stack alignment and apply `tasks#advanced-elicitation` protocol]] - -### Existing Technology Stack - -[[LLM: Document the current stack that must be maintained or integrated with]] - -| Category | Current Technology | Version | Usage in Enhancement | Notes | -| :----------------- | :----------------- | :---------- | :------------------- | :-------- | -| **Language** | {{language}} | {{version}} | {{usage}} | {{notes}} | -| **Runtime** | {{runtime}} | {{version}} | {{usage}} | {{notes}} | -| **Framework** | {{framework}} | {{version}} | {{usage}} | {{notes}} | -| **Database** | {{database}} | {{version}} | {{usage}} | {{notes}} | -| **API Style** | {{api_style}} | {{version}} | {{usage}} | {{notes}} | -| **Authentication** | {{auth}} | {{version}} | {{usage}} | {{notes}} | -| **Testing** | {{test_framework}} | {{version}} | {{usage}} | {{notes}} | -| **Build Tool** | {{build_tool}} | {{version}} | {{usage}} | {{notes}} | - -### New Technology Additions - -[[LLM: Only include if new technologies are required for the enhancement]] - -^^CONDITION: has_new_tech^^ - -| Technology | Version | Purpose | Rationale | Integration Method | -| :----------- | :---------- | :---------- | :------------ | :----------------- | -| {{new_tech}} | {{version}} | {{purpose}} | {{rationale}} | {{integration}} | - -^^/CONDITION: has_new_tech^^ - -## Data Models and Schema Changes - -[[LLM: Define new data models and how they integrate with existing schema: - -1. Identify new entities required for the enhancement -2. Define relationships with existing data models -3. Plan database schema changes (additions, modifications) -4. Ensure backward compatibility - -Present data model changes and apply `tasks#advanced-elicitation` protocol]] - -### New Data Models - -<> - -### {{model_name}} - -**Purpose:** {{model_purpose}} -**Integration:** {{integration_with_existing}} - -**Key Attributes:** - -- {{attribute_1}}: {{type_1}} - {{description_1}} -- {{attribute_2}}: {{type_2}} - {{description_2}} - -**Relationships:** - -- **With Existing:** {{existing_relationships}} -- **With New:** {{new_relationships}} - -<> - -### Schema Integration Strategy - -**Database Changes Required:** - -- **New Tables:** {{new_tables_list}} -- **Modified Tables:** {{modified_tables_list}} -- **New Indexes:** {{new_indexes_list}} -- **Migration Strategy:** {{migration_approach}} - -**Backward Compatibility:** - -- {{compatibility_measure_1}} -- {{compatibility_measure_2}} - -## Component Architecture - -[[LLM: Define new components and their integration with existing architecture: - -1. Identify new components required for the enhancement -2. Define interfaces with existing components -3. Establish clear boundaries and responsibilities -4. Plan integration points and data flow - -MANDATORY VALIDATION: Before presenting component architecture, confirm: "The new components I'm proposing follow the existing architectural patterns I identified in your codebase: [specific patterns]. The integration interfaces respect your current component structure and communication patterns. Does this match your project's reality?" - -Present component architecture and apply `tasks#advanced-elicitation` protocol]] - -### New Components - -<> - -### {{component_name}} - -**Responsibility:** {{component_description}} -**Integration Points:** {{integration_points}} - -**Key Interfaces:** - -- {{interface_1}} -- {{interface_2}} - -**Dependencies:** - -- **Existing Components:** {{existing_dependencies}} -- **New Components:** {{new_dependencies}} - -**Technology Stack:** {{component_tech_details}} - -<> - -### Component Interaction Diagram - -[[LLM: Create Mermaid diagram showing how new components interact with existing ones]] - -```mermaid -{{component_interaction_diagram}} -``` - -## API Design and Integration - -[[LLM: Define new API endpoints and integration with existing APIs: - -1. Plan new API endpoints required for the enhancement -2. Ensure consistency with existing API patterns -3. Define authentication and authorization integration -4. Plan versioning strategy if needed - -Present API design and apply `tasks#advanced-elicitation` protocol]] - -### New API Endpoints - -^^CONDITION: has_new_api^^ - -**API Integration Strategy:** {{api_integration_strategy}} -**Authentication:** {{auth_integration}} -**Versioning:** {{versioning_approach}} - -<> - -#### {{endpoint_name}} - -- **Method:** {{http_method}} -- **Endpoint:** {{endpoint_path}} -- **Purpose:** {{endpoint_purpose}} -- **Integration:** {{integration_with_existing}} - -**Request:** - -```json -{{request_schema}} -``` - -**Response:** - -```json -{{response_schema}} -``` - -<> - -^^/CONDITION: has_new_api^^ - -## External API Integration - -[[LLM: Document new external API integrations required for the enhancement]] - -^^CONDITION: has_new_external_apis^^ - -<> - -### {{api_name}} API - -- **Purpose:** {{api_purpose}} -- **Documentation:** {{api_docs_url}} -- **Base URL:** {{api_base_url}} -- **Authentication:** {{auth_method}} -- **Integration Method:** {{integration_approach}} - -**Key Endpoints Used:** - -- `{{method}} {{endpoint_path}}` - {{endpoint_purpose}} - -**Error Handling:** {{error_handling_strategy}} - -<> - -^^/CONDITION: has_new_external_apis^^ - -## Source Tree Integration - -[[LLM: Define how new code will integrate with existing project structure: - -1. Follow existing project organization patterns -2. Identify where new files/folders will be placed -3. Ensure consistency with existing naming conventions -4. Plan for minimal disruption to existing structure - -Present integration plan and apply `tasks#advanced-elicitation` protocol]] - -### Existing Project Structure - -[[LLM: Document relevant parts of current structure]] - -```plaintext -{{existing_structure_relevant_parts}} -``` - -### New File Organization - -[[LLM: Show only new additions to existing structure]] - -```plaintext -{{project-root}}/ -├── {{existing_structure_context}} -│ ├── {{new_folder_1}}/ # {{purpose_1}} -│ │ ├── {{new_file_1}} -│ │ └── {{new_file_2}} -│ ├── {{existing_folder}}/ # Existing folder with additions -│ │ ├── {{existing_file}} # Existing file -│ │ └── {{new_file_3}} # New addition -│ └── {{new_folder_2}}/ # {{purpose_2}} -``` - -### Integration Guidelines - -- **File Naming:** {{file_naming_consistency}} -- **Folder Organization:** {{folder_organization_approach}} -- **Import/Export Patterns:** {{import_export_consistency}} - -## Infrastructure and Deployment Integration - -[[LLM: Define how the enhancement will be deployed alongside existing infrastructure: - -1. Use existing deployment pipeline and infrastructure -2. Identify any infrastructure changes needed -3. Plan deployment strategy to minimize risk -4. Define rollback procedures - -Present deployment integration and apply `tasks#advanced-elicitation` protocol]] - -### Existing Infrastructure - -**Current Deployment:** {{existing_deployment_summary}} -**Infrastructure Tools:** {{existing_infrastructure_tools}} -**Environments:** {{existing_environments}} - -### Enhancement Deployment Strategy - -**Deployment Approach:** {{deployment_approach}} -**Infrastructure Changes:** {{infrastructure_changes}} -**Pipeline Integration:** {{pipeline_integration}} - -### Rollback Strategy - -**Rollback Method:** {{rollback_method}} -**Risk Mitigation:** {{risk_mitigation}} -**Monitoring:** {{monitoring_approach}} - -## Coding Standards and Conventions - -[[LLM: Ensure new code follows existing project conventions: - -1. Document existing coding standards from project analysis -2. Identify any enhancement-specific requirements -3. Ensure consistency with existing codebase patterns -4. Define standards for new code organization - -Present coding standards and apply `tasks#advanced-elicitation` protocol]] - -### Existing Standards Compliance - -**Code Style:** {{existing_code_style}} -**Linting Rules:** {{existing_linting}} -**Testing Patterns:** {{existing_test_patterns}} -**Documentation Style:** {{existing_doc_style}} - -### Enhancement-Specific Standards - -[[LLM: Only include if new patterns are needed for the enhancement]] - -<> - -- **{{standard_name}}:** {{standard_description}} - -<> - -### Critical Integration Rules - -- **Existing API Compatibility:** {{api_compatibility_rule}} -- **Database Integration:** {{db_integration_rule}} -- **Error Handling:** {{error_handling_integration}} -- **Logging Consistency:** {{logging_consistency}} - -## Testing Strategy - -[[LLM: Define testing approach for the enhancement: - -1. Integrate with existing test suite -2. Ensure existing functionality remains intact -3. Plan for testing new features -4. Define integration testing approach - -Present testing strategy and apply `tasks#advanced-elicitation` protocol]] - -### Integration with Existing Tests - -**Existing Test Framework:** {{existing_test_framework}} -**Test Organization:** {{existing_test_organization}} -**Coverage Requirements:** {{existing_coverage_requirements}} - -### New Testing Requirements - -#### Unit Tests for New Components - -- **Framework:** {{test_framework}} -- **Location:** {{test_location}} -- **Coverage Target:** {{coverage_target}} -- **Integration with Existing:** {{test_integration}} - -#### Integration Tests - -- **Scope:** {{integration_test_scope}} -- **Existing System Verification:** {{existing_system_verification}} -- **New Feature Testing:** {{new_feature_testing}} - -#### Regression Testing - -- **Existing Feature Verification:** {{regression_test_approach}} -- **Automated Regression Suite:** {{automated_regression}} -- **Manual Testing Requirements:** {{manual_testing_requirements}} - -## Security Integration - -[[LLM: Ensure security consistency with existing system: - -1. Follow existing security patterns and tools -2. Ensure new features don't introduce vulnerabilities -3. Maintain existing security posture -4. Define security testing for new components - -Present security integration and apply `tasks#advanced-elicitation` protocol]] - -### Existing Security Measures - -**Authentication:** {{existing_auth}} -**Authorization:** {{existing_authz}} -**Data Protection:** {{existing_data_protection}} -**Security Tools:** {{existing_security_tools}} - -### Enhancement Security Requirements - -**New Security Measures:** {{new_security_measures}} -**Integration Points:** {{security_integration_points}} -**Compliance Requirements:** {{compliance_requirements}} - -### Security Testing - -**Existing Security Tests:** {{existing_security_tests}} -**New Security Test Requirements:** {{new_security_tests}} -**Penetration Testing:** {{pentest_requirements}} - -## Risk Assessment and Mitigation - -[[LLM: Identify and plan for risks specific to brownfield development: - -1. Technical integration risks -2. Deployment and operational risks -3. User impact and compatibility risks -4. Mitigation strategies for each risk - -Present risk assessment and apply `tasks#advanced-elicitation` protocol]] - -### Technical Risks - -<> - -**Risk:** {{risk_description}} -**Impact:** {{impact_level}} -**Likelihood:** {{likelihood}} -**Mitigation:** {{mitigation_strategy}} - -<> - -### Operational Risks - -<> - -**Risk:** {{risk_description}} -**Impact:** {{impact_level}} -**Likelihood:** {{likelihood}} -**Mitigation:** {{mitigation_strategy}} - -<> - -### Monitoring and Alerting - -**Enhanced Monitoring:** {{monitoring_additions}} -**New Alerts:** {{new_alerts}} -**Performance Monitoring:** {{performance_monitoring}} - -## Checklist Results Report - -[[LLM: Execute the architect-checklist and populate results here, focusing on brownfield-specific validation]] - -## Next Steps - -[[LLM: After completing the brownfield architecture: - -1. Review integration points with existing system -2. Begin story implementation with Dev agent -3. Set up deployment pipeline integration -4. Plan rollback and monitoring procedures]] - -### Story Manager Handoff - -[[LLM: Create a brief prompt for Story Manager to work with this brownfield enhancement. Include: - -- Reference to this architecture document -- Key integration requirements validated with user -- Existing system constraints based on actual project analysis -- First story to implement with clear integration checkpoints -- Emphasis on maintaining existing system integrity throughout implementation]] - -### Developer Handoff - -[[LLM: Create a brief prompt for developers starting implementation. Include: - -- Reference to this architecture and existing coding standards analyzed from actual project -- Integration requirements with existing codebase validated with user -- Key technical decisions based on real project constraints -- Existing system compatibility requirements with specific verification steps -- Clear sequencing of implementation to minimize risk to existing functionality]] -==================== END: .bmad-core/templates/brownfield-architecture-tmpl.md ==================== +==================== START: .bmad-core/templates/architecture-tmpl.yaml ==================== +template: + id: architecture-template-v2 + name: Architecture Document + version: 2.0 + output: + format: markdown + filename: docs/architecture.md + title: "{{project_name}} Architecture Document" + +workflow: + mode: interactive + elicitation: advanced-elicitation + +sections: + - id: introduction + title: Introduction + instruction: | + If available, review any provided relevant documents to gather all relevant context before beginning. If at a minimum you cannot locate docs/prd.md ask the user what docs will provide the basis for the architecture. + sections: + - id: intro-content + content: | + This document outlines the overall project architecture for {{project_name}}, including backend systems, shared services, and non-UI specific concerns. Its primary goal is to serve as the guiding architectural blueprint for AI-driven development, ensuring consistency and adherence to chosen patterns and technologies. + + **Relationship to Frontend Architecture:** + If the project includes a significant user interface, a separate Frontend Architecture Document will detail the frontend-specific design and MUST be used in conjunction with this document. Core technology stack choices documented herein (see "Tech Stack") are definitive for the entire project, including any frontend components. + - id: starter-template + title: Starter Template or Existing Project + instruction: | + Before proceeding further with architecture design, check if the project is based on a starter template or existing codebase: + + 1. Review the PRD and brainstorming brief for any mentions of: + - Starter templates (e.g., Create React App, Next.js, Vue CLI, Angular CLI, etc.) + - Existing projects or codebases being used as a foundation + - Boilerplate projects or scaffolding tools + - Previous projects to be cloned or adapted + + 2. If a starter template or existing project is mentioned: + - Ask the user to provide access via one of these methods: + - Link to the starter template documentation + - Upload/attach the project files (for small projects) + - Share a link to the project repository (GitHub, GitLab, etc.) + - Analyze the starter/existing project to understand: + - Pre-configured technology stack and versions + - Project structure and organization patterns + - Built-in scripts and tooling + - Existing architectural patterns and conventions + - Any limitations or constraints imposed by the starter + - Use this analysis to inform and align your architecture decisions + + 3. If no starter template is mentioned but this is a greenfield project: + - Suggest appropriate starter templates based on the tech stack preferences + - Explain the benefits (faster setup, best practices, community support) + - Let the user decide whether to use one + + 4. If the user confirms no starter template will be used: + - Proceed with architecture design from scratch + - Note that manual setup will be required for all tooling and configuration + + Document the decision here before proceeding with the architecture design. If none, just say N/A + elicit: true + - id: changelog + title: Change Log + type: table + columns: [Date, Version, Description, Author] + instruction: Track document versions and changes + + - id: high-level-architecture + title: High Level Architecture + instruction: | + This section contains multiple subsections that establish the foundation of the architecture. Present all subsections together at once. + elicit: true + sections: + - id: technical-summary + title: Technical Summary + instruction: | + Provide a brief paragraph (3-5 sentences) overview of: + - The system's overall architecture style + - Key components and their relationships + - Primary technology choices + - Core architectural patterns being used + - Reference back to the PRD goals and how this architecture supports them + - id: high-level-overview + title: High Level Overview + instruction: | + Based on the PRD's Technical Assumptions section, describe: + + 1. The main architectural style (e.g., Monolith, Microservices, Serverless, Event-Driven) + 2. Repository structure decision from PRD (Monorepo/Polyrepo) + 3. Service architecture decision from PRD + 4. Primary user interaction flow or data flow at a conceptual level + 5. Key architectural decisions and their rationale + - id: project-diagram + title: High Level Project Diagram + type: mermaid + mermaid_type: graph + instruction: | + Create a Mermaid diagram that visualizes the high-level architecture. Consider: + - System boundaries + - Major components/services + - Data flow directions + - External integrations + - User entry points + + - id: architectural-patterns + title: Architectural and Design Patterns + instruction: | + List the key high-level patterns that will guide the architecture. For each pattern: + + 1. Present 2-3 viable options if multiple exist + 2. Provide your recommendation with clear rationale + 3. Get user confirmation before finalizing + 4. These patterns should align with the PRD's technical assumptions and project goals + + Common patterns to consider: + - Architectural style patterns (Serverless, Event-Driven, Microservices, CQRS, Hexagonal) + - Code organization patterns (Dependency Injection, Repository, Module, Factory) + - Data patterns (Event Sourcing, Saga, Database per Service) + - Communication patterns (REST, GraphQL, Message Queue, Pub/Sub) + template: "- **{{pattern_name}}:** {{pattern_description}} - _Rationale:_ {{rationale}}" + examples: + - "**Serverless Architecture:** Using AWS Lambda for compute - _Rationale:_ Aligns with PRD requirement for cost optimization and automatic scaling" + - "**Repository Pattern:** Abstract data access logic - _Rationale:_ Enables testing and future database migration flexibility" + - "**Event-Driven Communication:** Using SNS/SQS for service decoupling - _Rationale:_ Supports async processing and system resilience" + + - id: tech-stack + title: Tech Stack + instruction: | + This is the DEFINITIVE technology selection section. Work with the user to make specific choices: + + 1. Review PRD technical assumptions and any preferences from .bmad-core/data/technical-preferences.yaml or an attached technical-preferences + 2. For each category, present 2-3 viable options with pros/cons + 3. Make a clear recommendation based on project needs + 4. Get explicit user approval for each selection + 5. Document exact versions (avoid "latest" - pin specific versions) + 6. This table is the single source of truth - all other docs must reference these choices + + Key decisions to finalize - before displaying the table, ensure you are aware of or ask the user about - let the user know if they are not sure on any that you can also provide suggestions with rationale: + + - Starter templates (if any) + - Languages and runtimes with exact versions + - Frameworks and libraries / packages + - Cloud provider and key services choices + - Database and storage solutions - if unclear suggest sql or nosql or other types depending on the project and depending on cloud provider offer a suggestion + - Development tools + + Upon render of the table, ensure the user is aware of the importance of this sections choices, should also look for gaps or disagreements with anything, ask for any clarifications if something is unclear why its in the list, and also right away elicit feedback - this statement and the options should be rendered and then prompt right all before allowing user input. + elicit: true + sections: + - id: cloud-infrastructure + title: Cloud Infrastructure + template: | + - **Provider:** {{cloud_provider}} + - **Key Services:** {{core_services_list}} + - **Deployment Regions:** {{regions}} + - id: technology-stack-table + title: Technology Stack Table + type: table + columns: [Category, Technology, Version, Purpose, Rationale] + instruction: Populate the technology stack table with all relevant technologies + examples: + - "| **Language** | TypeScript | 5.3.3 | Primary development language | Strong typing, excellent tooling, team expertise |" + - "| **Runtime** | Node.js | 20.11.0 | JavaScript runtime | LTS version, stable performance, wide ecosystem |" + - "| **Framework** | NestJS | 10.3.2 | Backend framework | Enterprise-ready, good DI, matches team patterns |" + + - id: data-models + title: Data Models + instruction: | + Define the core data models/entities: + + 1. Review PRD requirements and identify key business entities + 2. For each model, explain its purpose and relationships + 3. Include key attributes and data types + 4. Show relationships between models + 5. Discuss design decisions with user + + Create a clear conceptual model before moving to database schema. + elicit: true + repeatable: true + sections: + - id: model + title: "{{model_name}}" + template: | + **Purpose:** {{model_purpose}} + + **Key Attributes:** + - {{attribute_1}}: {{type_1}} - {{description_1}} + - {{attribute_2}}: {{type_2}} - {{description_2}} + + **Relationships:** + - {{relationship_1}} + - {{relationship_2}} + + - id: components + title: Components + instruction: | + Based on the architectural patterns, tech stack, and data models from above: + + 1. Identify major logical components/services and their responsibilities + 2. Consider the repository structure (monorepo/polyrepo) from PRD + 3. Define clear boundaries and interfaces between components + 4. For each component, specify: + - Primary responsibility + - Key interfaces/APIs exposed + - Dependencies on other components + - Technology specifics based on tech stack choices + + 5. Create component diagrams where helpful + elicit: true + sections: + - id: component-list + repeatable: true + title: "{{component_name}}" + template: | + **Responsibility:** {{component_description}} + + **Key Interfaces:** + - {{interface_1}} + - {{interface_2}} + + **Dependencies:** {{dependencies}} + + **Technology Stack:** {{component_tech_details}} + - id: component-diagrams + title: Component Diagrams + type: mermaid + instruction: | + Create Mermaid diagrams to visualize component relationships. Options: + - C4 Container diagram for high-level view + - Component diagram for detailed internal structure + - Sequence diagrams for complex interactions + Choose the most appropriate for clarity + + - id: external-apis + title: External APIs + condition: Project requires external API integrations + instruction: | + For each external service integration: + + 1. Identify APIs needed based on PRD requirements and component design + 2. If documentation URLs are unknown, ask user for specifics + 3. Document authentication methods and security considerations + 4. List specific endpoints that will be used + 5. Note any rate limits or usage constraints + + If no external APIs are needed, state this explicitly and skip to next section. + elicit: true + repeatable: true + sections: + - id: api + title: "{{api_name}} API" + template: | + - **Purpose:** {{api_purpose}} + - **Documentation:** {{api_docs_url}} + - **Base URL(s):** {{api_base_url}} + - **Authentication:** {{auth_method}} + - **Rate Limits:** {{rate_limits}} + + **Key Endpoints Used:** + - `{{method}} {{endpoint_path}}` - {{endpoint_purpose}} + + **Integration Notes:** {{integration_considerations}} + + - id: core-workflows + title: Core Workflows + type: mermaid + mermaid_type: sequence + instruction: | + Illustrate key system workflows using sequence diagrams: + + 1. Identify critical user journeys from PRD + 2. Show component interactions including external APIs + 3. Include error handling paths + 4. Document async operations + 5. Create both high-level and detailed diagrams as needed + + Focus on workflows that clarify architecture decisions or complex interactions. + elicit: true + + - id: rest-api-spec + title: REST API Spec + condition: Project includes REST API + type: code + language: yaml + instruction: | + If the project includes a REST API: + + 1. Create an OpenAPI 3.0 specification + 2. Include all endpoints from epics/stories + 3. Define request/response schemas based on data models + 4. Document authentication requirements + 5. Include example requests/responses + + Use YAML format for better readability. If no REST API, skip this section. + elicit: true + template: | + openapi: 3.0.0 + info: + title: {{api_title}} + version: {{api_version}} + description: {{api_description}} + servers: + - url: {{server_url}} + description: {{server_description}} + + - id: database-schema + title: Database Schema + instruction: | + Transform the conceptual data models into concrete database schemas: + + 1. Use the database type(s) selected in Tech Stack + 2. Create schema definitions using appropriate notation + 3. Include indexes, constraints, and relationships + 4. Consider performance and scalability + 5. For NoSQL, show document structures + + Present schema in format appropriate to database type (SQL DDL, JSON schema, etc.) + elicit: true + + - id: source-tree + title: Source Tree + type: code + language: plaintext + instruction: | + Create a project folder structure that reflects: + + 1. The chosen repository structure (monorepo/polyrepo) + 2. The service architecture (monolith/microservices/serverless) + 3. The selected tech stack and languages + 4. Component organization from above + 5. Best practices for the chosen frameworks + 6. Clear separation of concerns + + Adapt the structure based on project needs. For monorepos, show service separation. For serverless, show function organization. Include language-specific conventions. + elicit: true + examples: + - | + project-root/ + ├── packages/ + │ ├── api/ # Backend API service + │ ├── web/ # Frontend application + │ ├── shared/ # Shared utilities/types + │ └── infrastructure/ # IaC definitions + ├── scripts/ # Monorepo management scripts + └── package.json # Root package.json with workspaces + + - id: infrastructure-deployment + title: Infrastructure and Deployment + instruction: | + Define the deployment architecture and practices: + + 1. Use IaC tool selected in Tech Stack + 2. Choose deployment strategy appropriate for the architecture + 3. Define environments and promotion flow + 4. Establish rollback procedures + 5. Consider security, monitoring, and cost optimization + + Get user input on deployment preferences and CI/CD tool choices. + elicit: true + sections: + - id: infrastructure-as-code + title: Infrastructure as Code + template: | + - **Tool:** {{iac_tool}} {{version}} + - **Location:** `{{iac_directory}}` + - **Approach:** {{iac_approach}} + - id: deployment-strategy + title: Deployment Strategy + template: | + - **Strategy:** {{deployment_strategy}} + - **CI/CD Platform:** {{cicd_platform}} + - **Pipeline Configuration:** `{{pipeline_config_location}}` + - id: environments + title: Environments + repeatable: true + template: "- **{{env_name}}:** {{env_purpose}} - {{env_details}}" + - id: promotion-flow + title: Environment Promotion Flow + type: code + language: text + template: "{{promotion_flow_diagram}}" + - id: rollback-strategy + title: Rollback Strategy + template: | + - **Primary Method:** {{rollback_method}} + - **Trigger Conditions:** {{rollback_triggers}} + - **Recovery Time Objective:** {{rto}} + + - id: error-handling-strategy + title: Error Handling Strategy + instruction: | + Define comprehensive error handling approach: + + 1. Choose appropriate patterns for the language/framework from Tech Stack + 2. Define logging standards and tools + 3. Establish error categories and handling rules + 4. Consider observability and debugging needs + 5. Ensure security (no sensitive data in logs) + + This section guides both AI and human developers in consistent error handling. + elicit: true + sections: + - id: general-approach + title: General Approach + template: | + - **Error Model:** {{error_model}} + - **Exception Hierarchy:** {{exception_structure}} + - **Error Propagation:** {{propagation_rules}} + - id: logging-standards + title: Logging Standards + template: | + - **Library:** {{logging_library}} {{version}} + - **Format:** {{log_format}} + - **Levels:** {{log_levels_definition}} + - **Required Context:** + - Correlation ID: {{correlation_id_format}} + - Service Context: {{service_context}} + - User Context: {{user_context_rules}} + - id: error-patterns + title: Error Handling Patterns + sections: + - id: external-api-errors + title: External API Errors + template: | + - **Retry Policy:** {{retry_strategy}} + - **Circuit Breaker:** {{circuit_breaker_config}} + - **Timeout Configuration:** {{timeout_settings}} + - **Error Translation:** {{error_mapping_rules}} + - id: business-logic-errors + title: Business Logic Errors + template: | + - **Custom Exceptions:** {{business_exception_types}} + - **User-Facing Errors:** {{user_error_format}} + - **Error Codes:** {{error_code_system}} + - id: data-consistency + title: Data Consistency + template: | + - **Transaction Strategy:** {{transaction_approach}} + - **Compensation Logic:** {{compensation_patterns}} + - **Idempotency:** {{idempotency_approach}} + + - id: coding-standards + title: Coding Standards + instruction: | + These standards are MANDATORY for AI agents. Work with user to define ONLY the critical rules needed to prevent bad code. Explain that: + + 1. This section directly controls AI developer behavior + 2. Keep it minimal - assume AI knows general best practices + 3. Focus on project-specific conventions and gotchas + 4. Overly detailed standards bloat context and slow development + 5. Standards will be extracted to separate file for dev agent use + + For each standard, get explicit user confirmation it's necessary. + elicit: true + sections: + - id: core-standards + title: Core Standards + template: | + - **Languages & Runtimes:** {{languages_and_versions}} + - **Style & Linting:** {{linter_config}} + - **Test Organization:** {{test_file_convention}} + - id: naming-conventions + title: Naming Conventions + type: table + columns: [Element, Convention, Example] + instruction: Only include if deviating from language defaults + - id: critical-rules + title: Critical Rules + instruction: | + List ONLY rules that AI might violate or project-specific requirements. Examples: + - "Never use console.log in production code - use logger" + - "All API responses must use ApiResponse wrapper type" + - "Database queries must use repository pattern, never direct ORM" + + Avoid obvious rules like "use SOLID principles" or "write clean code" + repeatable: true + template: "- **{{rule_name}}:** {{rule_description}}" + - id: language-specifics + title: Language-Specific Guidelines + condition: Critical language-specific rules needed + instruction: Add ONLY if critical for preventing AI mistakes. Most teams don't need this section. + sections: + - id: language-rules + title: "{{language_name}} Specifics" + repeatable: true + template: "- **{{rule_topic}}:** {{rule_detail}}" + + - id: test-strategy + title: Test Strategy and Standards + instruction: | + Work with user to define comprehensive test strategy: + + 1. Use test frameworks from Tech Stack + 2. Decide on TDD vs test-after approach + 3. Define test organization and naming + 4. Establish coverage goals + 5. Determine integration test infrastructure + 6. Plan for test data and external dependencies + + Note: Basic info goes in Coding Standards for dev agent. This detailed section is for QA agent and team reference. + elicit: true + sections: + - id: testing-philosophy + title: Testing Philosophy + template: | + - **Approach:** {{test_approach}} + - **Coverage Goals:** {{coverage_targets}} + - **Test Pyramid:** {{test_distribution}} + - id: test-types + title: Test Types and Organization + sections: + - id: unit-tests + title: Unit Tests + template: | + - **Framework:** {{unit_test_framework}} {{version}} + - **File Convention:** {{unit_test_naming}} + - **Location:** {{unit_test_location}} + - **Mocking Library:** {{mocking_library}} + - **Coverage Requirement:** {{unit_coverage}} + + **AI Agent Requirements:** + - Generate tests for all public methods + - Cover edge cases and error conditions + - Follow AAA pattern (Arrange, Act, Assert) + - Mock all external dependencies + - id: integration-tests + title: Integration Tests + template: | + - **Scope:** {{integration_scope}} + - **Location:** {{integration_test_location}} + - **Test Infrastructure:** + - **{{dependency_name}}:** {{test_approach}} ({{test_tool}}) + examples: + - "**Database:** In-memory H2 for unit tests, Testcontainers PostgreSQL for integration" + - "**Message Queue:** Embedded Kafka for tests" + - "**External APIs:** WireMock for stubbing" + - id: e2e-tests + title: End-to-End Tests + template: | + - **Framework:** {{e2e_framework}} {{version}} + - **Scope:** {{e2e_scope}} + - **Environment:** {{e2e_environment}} + - **Test Data:** {{e2e_data_strategy}} + - id: test-data-management + title: Test Data Management + template: | + - **Strategy:** {{test_data_approach}} + - **Fixtures:** {{fixture_location}} + - **Factories:** {{factory_pattern}} + - **Cleanup:** {{cleanup_strategy}} + - id: continuous-testing + title: Continuous Testing + template: | + - **CI Integration:** {{ci_test_stages}} + - **Performance Tests:** {{perf_test_approach}} + - **Security Tests:** {{security_test_approach}} + + - id: security + title: Security + instruction: | + Define MANDATORY security requirements for AI and human developers: + + 1. Focus on implementation-specific rules + 2. Reference security tools from Tech Stack + 3. Define clear patterns for common scenarios + 4. These rules directly impact code generation + 5. Work with user to ensure completeness without redundancy + elicit: true + sections: + - id: input-validation + title: Input Validation + template: | + - **Validation Library:** {{validation_library}} + - **Validation Location:** {{where_to_validate}} + - **Required Rules:** + - All external inputs MUST be validated + - Validation at API boundary before processing + - Whitelist approach preferred over blacklist + - id: auth-authorization + title: Authentication & Authorization + template: | + - **Auth Method:** {{auth_implementation}} + - **Session Management:** {{session_approach}} + - **Required Patterns:** + - {{auth_pattern_1}} + - {{auth_pattern_2}} + - id: secrets-management + title: Secrets Management + template: | + - **Development:** {{dev_secrets_approach}} + - **Production:** {{prod_secrets_service}} + - **Code Requirements:** + - NEVER hardcode secrets + - Access via configuration service only + - No secrets in logs or error messages + - id: api-security + title: API Security + template: | + - **Rate Limiting:** {{rate_limit_implementation}} + - **CORS Policy:** {{cors_configuration}} + - **Security Headers:** {{required_headers}} + - **HTTPS Enforcement:** {{https_approach}} + - id: data-protection + title: Data Protection + template: | + - **Encryption at Rest:** {{encryption_at_rest}} + - **Encryption in Transit:** {{encryption_in_transit}} + - **PII Handling:** {{pii_rules}} + - **Logging Restrictions:** {{what_not_to_log}} + - id: dependency-security + title: Dependency Security + template: | + - **Scanning Tool:** {{dependency_scanner}} + - **Update Policy:** {{update_frequency}} + - **Approval Process:** {{new_dep_process}} + - id: security-testing + title: Security Testing + template: | + - **SAST Tool:** {{static_analysis}} + - **DAST Tool:** {{dynamic_analysis}} + - **Penetration Testing:** {{pentest_schedule}} + + - id: checklist-results + title: Checklist Results Report + instruction: Before running the checklist, offer to output the full architecture document. Once user confirms, execute the architect-checklist and populate results here. + + - id: next-steps + title: Next Steps + instruction: | + After completing the architecture: + + 1. If project has UI components: + - Recommend engaging Design Architect agent + - Use "Frontend Architecture Mode" + - Provide this document as input + + 2. For all projects: + - Review with Product Owner + - Begin story implementation with Dev agent + - Set up infrastructure with DevOps agent + + 3. Include specific prompts for next agents if needed + sections: + - id: design-architect-prompt + title: Design Architect Prompt + condition: Project has UI components + instruction: | + Create a brief prompt to hand off to Design Architect for Frontend Architecture creation. Include: + - Reference to this architecture document + - Key UI requirements from PRD + - Any frontend-specific decisions made here + - Request for detailed frontend architecture + - id: developer-handoff + title: Developer Handoff + instruction: | + Create a brief prompt for developers starting implementation. Include: + - Reference to this architecture and coding standards + - First epic/story to implement + - Key technical decisions to follow +==================== END: .bmad-core/templates/architecture-tmpl.yaml ==================== + +==================== START: .bmad-core/templates/front-end-architecture-tmpl.yaml ==================== +template: + id: frontend-architecture-template-v2 + name: Frontend Architecture Document + version: 2.0 + output: + format: markdown + filename: docs/ui-architecture.md + title: "{{project_name}} Frontend Architecture Document" + +workflow: + mode: interactive + elicitation: advanced-elicitation + +sections: + - id: template-framework-selection + title: Template and Framework Selection + instruction: | + Review provided documents including PRD, UX-UI Specification, and main Architecture Document. Focus on extracting technical implementation details needed for AI frontend tools and developer agents. Ask the user for any of these documents if you are unable to locate and were not provided. + + Before proceeding with frontend architecture design, check if the project is using a frontend starter template or existing codebase: + + 1. Review the PRD, main architecture document, and brainstorming brief for mentions of: + - Frontend starter templates (e.g., Create React App, Next.js, Vite, Vue CLI, Angular CLI, etc.) + - UI kit or component library starters + - Existing frontend projects being used as a foundation + - Admin dashboard templates or other specialized starters + - Design system implementations + + 2. If a frontend starter template or existing project is mentioned: + - Ask the user to provide access via one of these methods: + - Link to the starter template documentation + - Upload/attach the project files (for small projects) + - Share a link to the project repository + - Analyze the starter/existing project to understand: + - Pre-installed dependencies and versions + - Folder structure and file organization + - Built-in components and utilities + - Styling approach (CSS modules, styled-components, Tailwind, etc.) + - State management setup (if any) + - Routing configuration + - Testing setup and patterns + - Build and development scripts + - Use this analysis to ensure your frontend architecture aligns with the starter's patterns + + 3. If no frontend starter is mentioned but this is a new UI, ensure we know what the ui language and framework is: + - Based on the framework choice, suggest appropriate starters: + - React: Create React App, Next.js, Vite + React + - Vue: Vue CLI, Nuxt.js, Vite + Vue + - Angular: Angular CLI + - Or suggest popular UI templates if applicable + - Explain benefits specific to frontend development + + 4. If the user confirms no starter template will be used: + - Note that all tooling, bundling, and configuration will need manual setup + - Proceed with frontend architecture from scratch + + Document the starter template decision and any constraints it imposes before proceeding. + sections: + - id: changelog + title: Change Log + type: table + columns: [Date, Version, Description, Author] + instruction: Track document versions and changes + + - id: frontend-tech-stack + title: Frontend Tech Stack + instruction: Extract from main architecture's Technology Stack Table. This section MUST remain synchronized with the main architecture document. + elicit: true + sections: + - id: tech-stack-table + title: Technology Stack Table + type: table + columns: [Category, Technology, Version, Purpose, Rationale] + instruction: Fill in appropriate technology choices based on the selected framework and project requirements. + rows: + - ["Framework", "{{framework}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] + - ["UI Library", "{{ui_library}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] + - ["State Management", "{{state_management}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] + - ["Routing", "{{routing_library}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] + - ["Build Tool", "{{build_tool}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] + - ["Styling", "{{styling_solution}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] + - ["Testing", "{{test_framework}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] + - ["Component Library", "{{component_lib}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] + - ["Form Handling", "{{form_library}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] + - ["Animation", "{{animation_lib}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] + - ["Dev Tools", "{{dev_tools}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] + + - id: project-structure + title: Project Structure + instruction: Define exact directory structure for AI tools based on the chosen framework. Be specific about where each type of file goes. Generate a structure that follows the framework's best practices and conventions. + elicit: true + type: code + language: plaintext + + - id: component-standards + title: Component Standards + instruction: Define exact patterns for component creation based on the chosen framework. + elicit: true + sections: + - id: component-template + title: Component Template + instruction: Generate a minimal but complete component template following the framework's best practices. Include TypeScript types, proper imports, and basic structure. + type: code + language: typescript + - id: naming-conventions + title: Naming Conventions + instruction: Provide naming conventions specific to the chosen framework for components, files, services, state management, and other architectural elements. + + - id: state-management + title: State Management + instruction: Define state management patterns based on the chosen framework. + elicit: true + sections: + - id: store-structure + title: Store Structure + instruction: Generate the state management directory structure appropriate for the chosen framework and selected state management solution. + type: code + language: plaintext + - id: state-template + title: State Management Template + instruction: Provide a basic state management template/example following the framework's recommended patterns. Include TypeScript types and common operations like setting, updating, and clearing state. + type: code + language: typescript + + - id: api-integration + title: API Integration + instruction: Define API service patterns based on the chosen framework. + elicit: true + sections: + - id: service-template + title: Service Template + instruction: Provide an API service template that follows the framework's conventions. Include proper TypeScript types, error handling, and async patterns. + type: code + language: typescript + - id: api-client-config + title: API Client Configuration + instruction: Show how to configure the HTTP client for the chosen framework, including authentication interceptors/middleware and error handling. + type: code + language: typescript + + - id: routing + title: Routing + instruction: Define routing structure and patterns based on the chosen framework. + elicit: true + sections: + - id: route-configuration + title: Route Configuration + instruction: Provide routing configuration appropriate for the chosen framework. Include protected route patterns, lazy loading where applicable, and authentication guards/middleware. + type: code + language: typescript + + - id: styling-guidelines + title: Styling Guidelines + instruction: Define styling approach based on the chosen framework. + elicit: true + sections: + - id: styling-approach + title: Styling Approach + instruction: Describe the styling methodology appropriate for the chosen framework (CSS Modules, Styled Components, Tailwind, etc.) and provide basic patterns. + - id: global-theme + title: Global Theme Variables + instruction: Provide a CSS custom properties (CSS variables) theme system that works across all frameworks. Include colors, spacing, typography, shadows, and dark mode support. + type: code + language: css + + - id: testing-requirements + title: Testing Requirements + instruction: Define minimal testing requirements based on the chosen framework. + elicit: true + sections: + - id: component-test-template + title: Component Test Template + instruction: Provide a basic component test template using the framework's recommended testing library. Include examples of rendering tests, user interaction tests, and mocking. + type: code + language: typescript + - id: testing-best-practices + title: Testing Best Practices + type: numbered-list + items: + - "**Unit Tests**: Test individual components in isolation" + - "**Integration Tests**: Test component interactions" + - "**E2E Tests**: Test critical user flows (using Cypress/Playwright)" + - "**Coverage Goals**: Aim for 80% code coverage" + - "**Test Structure**: Arrange-Act-Assert pattern" + - "**Mock External Dependencies**: API calls, routing, state management" + + - id: environment-configuration + title: Environment Configuration + instruction: List required environment variables based on the chosen framework. Show the appropriate format and naming conventions for the framework. + elicit: true + + - id: frontend-developer-standards + title: Frontend Developer Standards + sections: + - id: critical-coding-rules + title: Critical Coding Rules + instruction: List essential rules that prevent common AI mistakes, including both universal rules and framework-specific ones. + elicit: true + - id: quick-reference + title: Quick Reference + instruction: | + Create a framework-specific cheat sheet with: + - Common commands (dev server, build, test) + - Key import patterns + - File naming conventions + - Project-specific patterns and utilities +==================== END: .bmad-core/templates/front-end-architecture-tmpl.yaml ==================== + +==================== START: .bmad-core/templates/fullstack-architecture-tmpl.yaml ==================== +template: + id: fullstack-architecture-template-v2 + name: Fullstack Architecture Document + version: 2.0 + output: + format: markdown + filename: docs/architecture.md + title: "{{project_name}} Fullstack Architecture Document" + +workflow: + mode: interactive + elicitation: advanced-elicitation + +sections: + - id: introduction + title: Introduction + instruction: | + If available, review any provided relevant documents to gather all relevant context before beginning. At minimum, you should have access to docs/prd.md and docs/front-end-spec.md. Ask the user for any documents you need but cannot locate. This template creates a unified architecture that covers both backend and frontend concerns to guide AI-driven fullstack development. + elicit: true + content: | + This document outlines the complete fullstack architecture for {{project_name}}, including backend systems, frontend implementation, and their integration. It serves as the single source of truth for AI-driven development, ensuring consistency across the entire technology stack. + + This unified approach combines what would traditionally be separate backend and frontend architecture documents, streamlining the development process for modern fullstack applications where these concerns are increasingly intertwined. + sections: + - id: starter-template + title: Starter Template or Existing Project + instruction: | + Before proceeding with architecture design, check if the project is based on any starter templates or existing codebases: + + 1. Review the PRD and other documents for mentions of: + - Fullstack starter templates (e.g., T3 Stack, MEAN/MERN starters, Django + React templates) + - Monorepo templates (e.g., Nx, Turborepo starters) + - Platform-specific starters (e.g., Vercel templates, AWS Amplify starters) + - Existing projects being extended or cloned + + 2. If starter templates or existing projects are mentioned: + - Ask the user to provide access (links, repos, or files) + - Analyze to understand pre-configured choices and constraints + - Note any architectural decisions already made + - Identify what can be modified vs what must be retained + + 3. If no starter is mentioned but this is greenfield: + - Suggest appropriate fullstack starters based on tech preferences + - Consider platform-specific options (Vercel, AWS, etc.) + - Let user decide whether to use one + + 4. Document the decision and any constraints it imposes + + If none, state "N/A - Greenfield project" + - id: changelog + title: Change Log + type: table + columns: [Date, Version, Description, Author] + instruction: Track document versions and changes + + - id: high-level-architecture + title: High Level Architecture + instruction: This section contains multiple subsections that establish the foundation. Present all subsections together, then elicit feedback on the complete section. + elicit: true + sections: + - id: technical-summary + title: Technical Summary + instruction: | + Provide a comprehensive overview (4-6 sentences) covering: + - Overall architectural style and deployment approach + - Frontend framework and backend technology choices + - Key integration points between frontend and backend + - Infrastructure platform and services + - How this architecture achieves PRD goals + - id: platform-infrastructure + title: Platform and Infrastructure Choice + instruction: | + Based on PRD requirements and technical assumptions, make a platform recommendation: + + 1. Consider common patterns (not an exhaustive list, use your own best judgement and search the web as needed for emerging trends): + - **Vercel + Supabase**: For rapid development with Next.js, built-in auth/storage + - **AWS Full Stack**: For enterprise scale with Lambda, API Gateway, S3, Cognito + - **Azure**: For .NET ecosystems or enterprise Microsoft environments + - **Google Cloud**: For ML/AI heavy applications or Google ecosystem integration + + 2. Present 2-3 viable options with clear pros/cons + 3. Make a recommendation with rationale + 4. Get explicit user confirmation + + Document the choice and key services that will be used. + template: | + **Platform:** {{selected_platform}} + **Key Services:** {{core_services_list}} + **Deployment Host and Regions:** {{regions}} + - id: repository-structure + title: Repository Structure + instruction: | + Define the repository approach based on PRD requirements and platform choice, explain your rationale or ask questions to the user if unsure: + + 1. For modern fullstack apps, monorepo is often preferred + 2. Consider tooling (Nx, Turborepo, Lerna, npm workspaces) + 3. Define package/app boundaries + 4. Plan for shared code between frontend and backend + template: | + **Structure:** {{repo_structure_choice}} + **Monorepo Tool:** {{monorepo_tool_if_applicable}} + **Package Organization:** {{package_strategy}} + - id: architecture-diagram + title: High Level Architecture Diagram + type: mermaid + mermaid_type: graph + instruction: | + Create a Mermaid diagram showing the complete system architecture including: + - User entry points (web, mobile) + - Frontend application deployment + - API layer (REST/GraphQL) + - Backend services + - Databases and storage + - External integrations + - CDN and caching layers + + Use appropriate diagram type for clarity. + - id: architectural-patterns + title: Architectural Patterns + instruction: | + List patterns that will guide both frontend and backend development. Include patterns for: + - Overall architecture (e.g., Jamstack, Serverless, Microservices) + - Frontend patterns (e.g., Component-based, State management) + - Backend patterns (e.g., Repository, CQRS, Event-driven) + - Integration patterns (e.g., BFF, API Gateway) + + For each pattern, provide recommendation and rationale. + repeatable: true + template: "- **{{pattern_name}}:** {{pattern_description}} - _Rationale:_ {{rationale}}" + examples: + - "**Jamstack Architecture:** Static site generation with serverless APIs - _Rationale:_ Optimal performance and scalability for content-heavy applications" + - "**Component-Based UI:** Reusable React components with TypeScript - _Rationale:_ Maintainability and type safety across large codebases" + - "**Repository Pattern:** Abstract data access logic - _Rationale:_ Enables testing and future database migration flexibility" + - "**API Gateway Pattern:** Single entry point for all API calls - _Rationale:_ Centralized auth, rate limiting, and monitoring" + + - id: tech-stack + title: Tech Stack + instruction: | + This is the DEFINITIVE technology selection for the entire project. Work with user to finalize all choices. This table is the single source of truth - all development must use these exact versions. + + Key areas to cover: + - Frontend and backend languages/frameworks + - Databases and caching + - Authentication and authorization + - API approach + - Testing tools for both frontend and backend + - Build and deployment tools + - Monitoring and logging + + Upon render, elicit feedback immediately. + elicit: true + sections: + - id: tech-stack-table + title: Technology Stack Table + type: table + columns: [Category, Technology, Version, Purpose, Rationale] + rows: + - ["Frontend Language", "{{fe_language}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] + - ["Frontend Framework", "{{fe_framework}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] + - ["UI Component Library", "{{ui_library}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] + - ["State Management", "{{state_mgmt}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] + - ["Backend Language", "{{be_language}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] + - ["Backend Framework", "{{be_framework}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] + - ["API Style", "{{api_style}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] + - ["Database", "{{database}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] + - ["Cache", "{{cache}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] + - ["File Storage", "{{storage}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] + - ["Authentication", "{{auth}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] + - ["Frontend Testing", "{{fe_test}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] + - ["Backend Testing", "{{be_test}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] + - ["E2E Testing", "{{e2e_test}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] + - ["Build Tool", "{{build_tool}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] + - ["Bundler", "{{bundler}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] + - ["IaC Tool", "{{iac_tool}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] + - ["CI/CD", "{{cicd}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] + - ["Monitoring", "{{monitoring}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] + - ["Logging", "{{logging}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] + - ["CSS Framework", "{{css_framework}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] + + - id: data-models + title: Data Models + instruction: | + Define the core data models/entities that will be shared between frontend and backend: + + 1. Review PRD requirements and identify key business entities + 2. For each model, explain its purpose and relationships + 3. Include key attributes and data types + 4. Show relationships between models + 5. Create TypeScript interfaces that can be shared + 6. Discuss design decisions with user + + Create a clear conceptual model before moving to database schema. + elicit: true + repeatable: true + sections: + - id: model + title: "{{model_name}}" + template: | + **Purpose:** {{model_purpose}} + + **Key Attributes:** + - {{attribute_1}}: {{type_1}} - {{description_1}} + - {{attribute_2}}: {{type_2}} - {{description_2}} + sections: + - id: typescript-interface + title: TypeScript Interface + type: code + language: typescript + template: "{{model_interface}}" + - id: relationships + title: Relationships + type: bullet-list + template: "- {{relationship}}" + + - id: api-spec + title: API Specification + instruction: | + Based on the chosen API style from Tech Stack: + + 1. If REST API, create an OpenAPI 3.0 specification + 2. If GraphQL, provide the GraphQL schema + 3. If tRPC, show router definitions + 4. Include all endpoints from epics/stories + 5. Define request/response schemas based on data models + 6. Document authentication requirements + 7. Include example requests/responses + + Use appropriate format for the chosen API style. If no API (e.g., static site), skip this section. + elicit: true + sections: + - id: rest-api + title: REST API Specification + condition: API style is REST + type: code + language: yaml + template: | + openapi: 3.0.0 + info: + title: {{api_title}} + version: {{api_version}} + description: {{api_description}} + servers: + - url: {{server_url}} + description: {{server_description}} + - id: graphql-api + title: GraphQL Schema + condition: API style is GraphQL + type: code + language: graphql + template: "{{graphql_schema}}" + - id: trpc-api + title: tRPC Router Definitions + condition: API style is tRPC + type: code + language: typescript + template: "{{trpc_routers}}" + + - id: components + title: Components + instruction: | + Based on the architectural patterns, tech stack, and data models from above: + + 1. Identify major logical components/services across the fullstack + 2. Consider both frontend and backend components + 3. Define clear boundaries and interfaces between components + 4. For each component, specify: + - Primary responsibility + - Key interfaces/APIs exposed + - Dependencies on other components + - Technology specifics based on tech stack choices + + 5. Create component diagrams where helpful + elicit: true + sections: + - id: component-list + repeatable: true + title: "{{component_name}}" + template: | + **Responsibility:** {{component_description}} + + **Key Interfaces:** + - {{interface_1}} + - {{interface_2}} + + **Dependencies:** {{dependencies}} + + **Technology Stack:** {{component_tech_details}} + - id: component-diagrams + title: Component Diagrams + type: mermaid + instruction: | + Create Mermaid diagrams to visualize component relationships. Options: + - C4 Container diagram for high-level view + - Component diagram for detailed internal structure + - Sequence diagrams for complex interactions + Choose the most appropriate for clarity + + - id: external-apis + title: External APIs + condition: Project requires external API integrations + instruction: | + For each external service integration: + + 1. Identify APIs needed based on PRD requirements and component design + 2. If documentation URLs are unknown, ask user for specifics + 3. Document authentication methods and security considerations + 4. List specific endpoints that will be used + 5. Note any rate limits or usage constraints + + If no external APIs are needed, state this explicitly and skip to next section. + elicit: true + repeatable: true + sections: + - id: api + title: "{{api_name}} API" + template: | + - **Purpose:** {{api_purpose}} + - **Documentation:** {{api_docs_url}} + - **Base URL(s):** {{api_base_url}} + - **Authentication:** {{auth_method}} + - **Rate Limits:** {{rate_limits}} + + **Key Endpoints Used:** + - `{{method}} {{endpoint_path}}` - {{endpoint_purpose}} + + **Integration Notes:** {{integration_considerations}} + + - id: core-workflows + title: Core Workflows + type: mermaid + mermaid_type: sequence + instruction: | + Illustrate key system workflows using sequence diagrams: + + 1. Identify critical user journeys from PRD + 2. Show component interactions including external APIs + 3. Include both frontend and backend flows + 4. Include error handling paths + 5. Document async operations + 6. Create both high-level and detailed diagrams as needed + + Focus on workflows that clarify architecture decisions or complex interactions. + elicit: true + + - id: database-schema + title: Database Schema + instruction: | + Transform the conceptual data models into concrete database schemas: + + 1. Use the database type(s) selected in Tech Stack + 2. Create schema definitions using appropriate notation + 3. Include indexes, constraints, and relationships + 4. Consider performance and scalability + 5. For NoSQL, show document structures + + Present schema in format appropriate to database type (SQL DDL, JSON schema, etc.) + elicit: true + + - id: frontend-architecture + title: Frontend Architecture + instruction: Define frontend-specific architecture details. After each subsection, note if user wants to refine before continuing. + elicit: true + sections: + - id: component-architecture + title: Component Architecture + instruction: Define component organization and patterns based on chosen framework. + sections: + - id: component-organization + title: Component Organization + type: code + language: text + template: "{{component_structure}}" + - id: component-template + title: Component Template + type: code + language: typescript + template: "{{component_template}}" + - id: state-management + title: State Management Architecture + instruction: Detail state management approach based on chosen solution. + sections: + - id: state-structure + title: State Structure + type: code + language: typescript + template: "{{state_structure}}" + - id: state-patterns + title: State Management Patterns + type: bullet-list + template: "- {{pattern}}" + - id: routing-architecture + title: Routing Architecture + instruction: Define routing structure based on framework choice. + sections: + - id: route-organization + title: Route Organization + type: code + language: text + template: "{{route_structure}}" + - id: protected-routes + title: Protected Route Pattern + type: code + language: typescript + template: "{{protected_route_example}}" + - id: frontend-services + title: Frontend Services Layer + instruction: Define how frontend communicates with backend. + sections: + - id: api-client-setup + title: API Client Setup + type: code + language: typescript + template: "{{api_client_setup}}" + - id: service-example + title: Service Example + type: code + language: typescript + template: "{{service_example}}" + + - id: backend-architecture + title: Backend Architecture + instruction: Define backend-specific architecture details. Consider serverless vs traditional server approaches. + elicit: true + sections: + - id: service-architecture + title: Service Architecture + instruction: Based on platform choice, define service organization. + sections: + - id: serverless-architecture + condition: Serverless architecture chosen + sections: + - id: function-organization + title: Function Organization + type: code + language: text + template: "{{function_structure}}" + - id: function-template + title: Function Template + type: code + language: typescript + template: "{{function_template}}" + - id: traditional-server + condition: Traditional server architecture chosen + sections: + - id: controller-organization + title: Controller/Route Organization + type: code + language: text + template: "{{controller_structure}}" + - id: controller-template + title: Controller Template + type: code + language: typescript + template: "{{controller_template}}" + - id: database-architecture + title: Database Architecture + instruction: Define database schema and access patterns. + sections: + - id: schema-design + title: Schema Design + type: code + language: sql + template: "{{database_schema}}" + - id: data-access-layer + title: Data Access Layer + type: code + language: typescript + template: "{{repository_pattern}}" + - id: auth-architecture + title: Authentication and Authorization + instruction: Define auth implementation details. + sections: + - id: auth-flow + title: Auth Flow + type: mermaid + mermaid_type: sequence + template: "{{auth_flow_diagram}}" + - id: auth-middleware + title: Middleware/Guards + type: code + language: typescript + template: "{{auth_middleware}}" + + - id: unified-project-structure + title: Unified Project Structure + instruction: Create a monorepo structure that accommodates both frontend and backend. Adapt based on chosen tools and frameworks. + elicit: true + type: code + language: plaintext + examples: + - | + {{project-name}}/ + ├── .github/ # CI/CD workflows + │ └── workflows/ + │ ├── ci.yaml + │ └── deploy.yaml + ├── apps/ # Application packages + │ ├── web/ # Frontend application + │ │ ├── src/ + │ │ │ ├── components/ # UI components + │ │ │ ├── pages/ # Page components/routes + │ │ │ ├── hooks/ # Custom React hooks + │ │ │ ├── services/ # API client services + │ │ │ ├── stores/ # State management + │ │ │ ├── styles/ # Global styles/themes + │ │ │ └── utils/ # Frontend utilities + │ │ ├── public/ # Static assets + │ │ ├── tests/ # Frontend tests + │ │ └── package.json + │ └── api/ # Backend application + │ ├── src/ + │ │ ├── routes/ # API routes/controllers + │ │ ├── services/ # Business logic + │ │ ├── models/ # Data models + │ │ ├── middleware/ # Express/API middleware + │ │ ├── utils/ # Backend utilities + │ │ └── {{serverless_or_server_entry}} + │ ├── tests/ # Backend tests + │ └── package.json + ├── packages/ # Shared packages + │ ├── shared/ # Shared types/utilities + │ │ ├── src/ + │ │ │ ├── types/ # TypeScript interfaces + │ │ │ ├── constants/ # Shared constants + │ │ │ └── utils/ # Shared utilities + │ │ └── package.json + │ ├── ui/ # Shared UI components + │ │ ├── src/ + │ │ └── package.json + │ └── config/ # Shared configuration + │ ├── eslint/ + │ ├── typescript/ + │ └── jest/ + ├── infrastructure/ # IaC definitions + │ └── {{iac_structure}} + ├── scripts/ # Build/deploy scripts + ├── docs/ # Documentation + │ ├── prd.md + │ ├── front-end-spec.md + │ └── fullstack-architecture.md + ├── .env.example # Environment template + ├── package.json # Root package.json + ├── {{monorepo_config}} # Monorepo configuration + └── README.md + + - id: development-workflow + title: Development Workflow + instruction: Define the development setup and workflow for the fullstack application. + elicit: true + sections: + - id: local-setup + title: Local Development Setup + sections: + - id: prerequisites + title: Prerequisites + type: code + language: bash + template: "{{prerequisites_commands}}" + - id: initial-setup + title: Initial Setup + type: code + language: bash + template: "{{setup_commands}}" + - id: dev-commands + title: Development Commands + type: code + language: bash + template: | + # Start all services + {{start_all_command}} + + # Start frontend only + {{start_frontend_command}} + + # Start backend only + {{start_backend_command}} + + # Run tests + {{test_commands}} + - id: environment-config + title: Environment Configuration + sections: + - id: env-vars + title: Required Environment Variables + type: code + language: bash + template: | + # Frontend (.env.local) + {{frontend_env_vars}} + + # Backend (.env) + {{backend_env_vars}} + + # Shared + {{shared_env_vars}} + + - id: deployment-architecture + title: Deployment Architecture + instruction: Define deployment strategy based on platform choice. + elicit: true + sections: + - id: deployment-strategy + title: Deployment Strategy + template: | + **Frontend Deployment:** + - **Platform:** {{frontend_deploy_platform}} + - **Build Command:** {{frontend_build_command}} + - **Output Directory:** {{frontend_output_dir}} + - **CDN/Edge:** {{cdn_strategy}} + + **Backend Deployment:** + - **Platform:** {{backend_deploy_platform}} + - **Build Command:** {{backend_build_command}} + - **Deployment Method:** {{deployment_method}} + - id: cicd-pipeline + title: CI/CD Pipeline + type: code + language: yaml + template: "{{cicd_pipeline_config}}" + - id: environments + title: Environments + type: table + columns: [Environment, Frontend URL, Backend URL, Purpose] + rows: + - ["Development", "{{dev_fe_url}}", "{{dev_be_url}}", "Local development"] + - ["Staging", "{{staging_fe_url}}", "{{staging_be_url}}", "Pre-production testing"] + - ["Production", "{{prod_fe_url}}", "{{prod_be_url}}", "Live environment"] + + - id: security-performance + title: Security and Performance + instruction: Define security and performance considerations for the fullstack application. + elicit: true + sections: + - id: security-requirements + title: Security Requirements + template: | + **Frontend Security:** + - CSP Headers: {{csp_policy}} + - XSS Prevention: {{xss_strategy}} + - Secure Storage: {{storage_strategy}} + + **Backend Security:** + - Input Validation: {{validation_approach}} + - Rate Limiting: {{rate_limit_config}} + - CORS Policy: {{cors_config}} + + **Authentication Security:** + - Token Storage: {{token_strategy}} + - Session Management: {{session_approach}} + - Password Policy: {{password_requirements}} + - id: performance-optimization + title: Performance Optimization + template: | + **Frontend Performance:** + - Bundle Size Target: {{bundle_size}} + - Loading Strategy: {{loading_approach}} + - Caching Strategy: {{fe_cache_strategy}} + + **Backend Performance:** + - Response Time Target: {{response_target}} + - Database Optimization: {{db_optimization}} + - Caching Strategy: {{be_cache_strategy}} + + - id: testing-strategy + title: Testing Strategy + instruction: Define comprehensive testing approach for fullstack application. + elicit: true + sections: + - id: testing-pyramid + title: Testing Pyramid + type: code + language: text + template: | + E2E Tests + / \ + Integration Tests + / \ + Frontend Unit Backend Unit + - id: test-organization + title: Test Organization + sections: + - id: frontend-tests + title: Frontend Tests + type: code + language: text + template: "{{frontend_test_structure}}" + - id: backend-tests + title: Backend Tests + type: code + language: text + template: "{{backend_test_structure}}" + - id: e2e-tests + title: E2E Tests + type: code + language: text + template: "{{e2e_test_structure}}" + - id: test-examples + title: Test Examples + sections: + - id: frontend-test + title: Frontend Component Test + type: code + language: typescript + template: "{{frontend_test_example}}" + - id: backend-test + title: Backend API Test + type: code + language: typescript + template: "{{backend_test_example}}" + - id: e2e-test + title: E2E Test + type: code + language: typescript + template: "{{e2e_test_example}}" + + - id: coding-standards + title: Coding Standards + instruction: Define MINIMAL but CRITICAL standards for AI agents. Focus only on project-specific rules that prevent common mistakes. These will be used by dev agents. + elicit: true + sections: + - id: critical-rules + title: Critical Fullstack Rules + repeatable: true + template: "- **{{rule_name}}:** {{rule_description}}" + examples: + - "**Type Sharing:** Always define types in packages/shared and import from there" + - "**API Calls:** Never make direct HTTP calls - use the service layer" + - "**Environment Variables:** Access only through config objects, never process.env directly" + - "**Error Handling:** All API routes must use the standard error handler" + - "**State Updates:** Never mutate state directly - use proper state management patterns" + - id: naming-conventions + title: Naming Conventions + type: table + columns: [Element, Frontend, Backend, Example] + rows: + - ["Components", "PascalCase", "-", "`UserProfile.tsx`"] + - ["Hooks", "camelCase with 'use'", "-", "`useAuth.ts`"] + - ["API Routes", "-", "kebab-case", "`/api/user-profile`"] + - ["Database Tables", "-", "snake_case", "`user_profiles`"] + + - id: error-handling + title: Error Handling Strategy + instruction: Define unified error handling across frontend and backend. + elicit: true + sections: + - id: error-flow + title: Error Flow + type: mermaid + mermaid_type: sequence + template: "{{error_flow_diagram}}" + - id: error-format + title: Error Response Format + type: code + language: typescript + template: | + interface ApiError { + error: { + code: string; + message: string; + details?: Record; + timestamp: string; + requestId: string; + }; + } + - id: frontend-error-handling + title: Frontend Error Handling + type: code + language: typescript + template: "{{frontend_error_handler}}" + - id: backend-error-handling + title: Backend Error Handling + type: code + language: typescript + template: "{{backend_error_handler}}" + + - id: monitoring + title: Monitoring and Observability + instruction: Define monitoring strategy for fullstack application. + elicit: true + sections: + - id: monitoring-stack + title: Monitoring Stack + template: | + - **Frontend Monitoring:** {{frontend_monitoring}} + - **Backend Monitoring:** {{backend_monitoring}} + - **Error Tracking:** {{error_tracking}} + - **Performance Monitoring:** {{perf_monitoring}} + - id: key-metrics + title: Key Metrics + template: | + **Frontend Metrics:** + - Core Web Vitals + - JavaScript errors + - API response times + - User interactions + + **Backend Metrics:** + - Request rate + - Error rate + - Response time + - Database query performance + + - id: checklist-results + title: Checklist Results Report + instruction: Before running the checklist, offer to output the full architecture document. Once user confirms, execute the architect-checklist and populate results here. +==================== END: .bmad-core/templates/fullstack-architecture-tmpl.yaml ==================== + +==================== START: .bmad-core/templates/brownfield-architecture-tmpl.yaml ==================== +template: + id: brownfield-architecture-template-v2 + name: Brownfield Enhancement Architecture + version: 2.0 + output: + format: markdown + filename: docs/architecture.md + title: "{{project_name}} Brownfield Enhancement Architecture" + +workflow: + mode: interactive + elicitation: advanced-elicitation + +sections: + - id: introduction + title: Introduction + instruction: | + IMPORTANT - SCOPE AND ASSESSMENT REQUIRED: + + This architecture document is for SIGNIFICANT enhancements to existing projects that require comprehensive architectural planning. Before proceeding: + + 1. **Verify Complexity**: Confirm this enhancement requires architectural planning. For simple additions, recommend: "For simpler changes that don't require architectural planning, consider using the brownfield-create-epic or brownfield-create-story task with the Product Owner instead." + + 2. **REQUIRED INPUTS**: + - Completed brownfield-prd.md + - Existing project technical documentation (from docs folder or user-provided) + - Access to existing project structure (IDE or uploaded files) + + 3. **DEEP ANALYSIS MANDATE**: You MUST conduct thorough analysis of the existing codebase, architecture patterns, and technical constraints before making ANY architectural recommendations. Every suggestion must be based on actual project analysis, not assumptions. + + 4. **CONTINUOUS VALIDATION**: Throughout this process, explicitly validate your understanding with the user. For every architectural decision, confirm: "Based on my analysis of your existing system, I recommend [decision] because [evidence from actual project]. Does this align with your system's reality?" + + If any required inputs are missing, request them before proceeding. + elicit: true + sections: + - id: intro-content + content: | + This document outlines the architectural approach for enhancing {{project_name}} with {{enhancement_description}}. Its primary goal is to serve as the guiding architectural blueprint for AI-driven development of new features while ensuring seamless integration with the existing system. + + **Relationship to Existing Architecture:** + This document supplements existing project architecture by defining how new components will integrate with current systems. Where conflicts arise between new and existing patterns, this document provides guidance on maintaining consistency while implementing enhancements. + - id: existing-project-analysis + title: Existing Project Analysis + instruction: | + Analyze the existing project structure and architecture: + + 1. Review existing documentation in docs folder + 2. Examine current technology stack and versions + 3. Identify existing architectural patterns and conventions + 4. Note current deployment and infrastructure setup + 5. Document any constraints or limitations + + CRITICAL: After your analysis, explicitly validate your findings: "Based on my analysis of your project, I've identified the following about your existing system: [key findings]. Please confirm these observations are accurate before I proceed with architectural recommendations." + elicit: true + sections: + - id: current-state + title: Current Project State + template: | + - **Primary Purpose:** {{existing_project_purpose}} + - **Current Tech Stack:** {{existing_tech_summary}} + - **Architecture Style:** {{existing_architecture_style}} + - **Deployment Method:** {{existing_deployment_approach}} + - id: available-docs + title: Available Documentation + type: bullet-list + template: "- {{existing_docs_summary}}" + - id: constraints + title: Identified Constraints + type: bullet-list + template: "- {{constraint}}" + - id: changelog + title: Change Log + type: table + columns: [Change, Date, Version, Description, Author] + instruction: Track document versions and changes + + - id: enhancement-scope + title: Enhancement Scope and Integration Strategy + instruction: | + Define how the enhancement will integrate with the existing system: + + 1. Review the brownfield PRD enhancement scope + 2. Identify integration points with existing code + 3. Define boundaries between new and existing functionality + 4. Establish compatibility requirements + + VALIDATION CHECKPOINT: Before presenting the integration strategy, confirm: "Based on my analysis, the integration approach I'm proposing takes into account [specific existing system characteristics]. These integration points and boundaries respect your current architecture patterns. Is this assessment accurate?" + elicit: true + sections: + - id: enhancement-overview + title: Enhancement Overview + template: | + **Enhancement Type:** {{enhancement_type}} + **Scope:** {{enhancement_scope}} + **Integration Impact:** {{integration_impact_level}} + - id: integration-approach + title: Integration Approach + template: | + **Code Integration Strategy:** {{code_integration_approach}} + **Database Integration:** {{database_integration_approach}} + **API Integration:** {{api_integration_approach}} + **UI Integration:** {{ui_integration_approach}} + - id: compatibility-requirements + title: Compatibility Requirements + template: | + - **Existing API Compatibility:** {{api_compatibility}} + - **Database Schema Compatibility:** {{db_compatibility}} + - **UI/UX Consistency:** {{ui_compatibility}} + - **Performance Impact:** {{performance_constraints}} + + - id: tech-stack-alignment + title: Tech Stack Alignment + instruction: | + Ensure new components align with existing technology choices: + + 1. Use existing technology stack as the foundation + 2. Only introduce new technologies if absolutely necessary + 3. Justify any new additions with clear rationale + 4. Ensure version compatibility with existing dependencies + elicit: true + sections: + - id: existing-stack + title: Existing Technology Stack + type: table + columns: [Category, Current Technology, Version, Usage in Enhancement, Notes] + instruction: Document the current stack that must be maintained or integrated with + - id: new-tech-additions + title: New Technology Additions + condition: Enhancement requires new technologies + type: table + columns: [Technology, Version, Purpose, Rationale, Integration Method] + instruction: Only include if new technologies are required for the enhancement + + - id: data-models + title: Data Models and Schema Changes + instruction: | + Define new data models and how they integrate with existing schema: + + 1. Identify new entities required for the enhancement + 2. Define relationships with existing data models + 3. Plan database schema changes (additions, modifications) + 4. Ensure backward compatibility + elicit: true + sections: + - id: new-models + title: New Data Models + repeatable: true + sections: + - id: model + title: "{{model_name}}" + template: | + **Purpose:** {{model_purpose}} + **Integration:** {{integration_with_existing}} + + **Key Attributes:** + - {{attribute_1}}: {{type_1}} - {{description_1}} + - {{attribute_2}}: {{type_2}} - {{description_2}} + + **Relationships:** + - **With Existing:** {{existing_relationships}} + - **With New:** {{new_relationships}} + - id: schema-integration + title: Schema Integration Strategy + template: | + **Database Changes Required:** + - **New Tables:** {{new_tables_list}} + - **Modified Tables:** {{modified_tables_list}} + - **New Indexes:** {{new_indexes_list}} + - **Migration Strategy:** {{migration_approach}} + + **Backward Compatibility:** + - {{compatibility_measure_1}} + - {{compatibility_measure_2}} + + - id: component-architecture + title: Component Architecture + instruction: | + Define new components and their integration with existing architecture: + + 1. Identify new components required for the enhancement + 2. Define interfaces with existing components + 3. Establish clear boundaries and responsibilities + 4. Plan integration points and data flow + + MANDATORY VALIDATION: Before presenting component architecture, confirm: "The new components I'm proposing follow the existing architectural patterns I identified in your codebase: [specific patterns]. The integration interfaces respect your current component structure and communication patterns. Does this match your project's reality?" + elicit: true + sections: + - id: new-components + title: New Components + repeatable: true + sections: + - id: component + title: "{{component_name}}" + template: | + **Responsibility:** {{component_description}} + **Integration Points:** {{integration_points}} + + **Key Interfaces:** + - {{interface_1}} + - {{interface_2}} + + **Dependencies:** + - **Existing Components:** {{existing_dependencies}} + - **New Components:** {{new_dependencies}} + + **Technology Stack:** {{component_tech_details}} + - id: interaction-diagram + title: Component Interaction Diagram + type: mermaid + mermaid_type: graph + instruction: Create Mermaid diagram showing how new components interact with existing ones + + - id: api-design + title: API Design and Integration + condition: Enhancement requires API changes + instruction: | + Define new API endpoints and integration with existing APIs: + + 1. Plan new API endpoints required for the enhancement + 2. Ensure consistency with existing API patterns + 3. Define authentication and authorization integration + 4. Plan versioning strategy if needed + elicit: true + sections: + - id: api-strategy + title: API Integration Strategy + template: | + **API Integration Strategy:** {{api_integration_strategy}} + **Authentication:** {{auth_integration}} + **Versioning:** {{versioning_approach}} + - id: new-endpoints + title: New API Endpoints + repeatable: true + sections: + - id: endpoint + title: "{{endpoint_name}}" + template: | + - **Method:** {{http_method}} + - **Endpoint:** {{endpoint_path}} + - **Purpose:** {{endpoint_purpose}} + - **Integration:** {{integration_with_existing}} + sections: + - id: request + title: Request + type: code + language: json + template: "{{request_schema}}" + - id: response + title: Response + type: code + language: json + template: "{{response_schema}}" + + - id: external-api-integration + title: External API Integration + condition: Enhancement requires new external APIs + instruction: Document new external API integrations required for the enhancement + repeatable: true + sections: + - id: external-api + title: "{{api_name}} API" + template: | + - **Purpose:** {{api_purpose}} + - **Documentation:** {{api_docs_url}} + - **Base URL:** {{api_base_url}} + - **Authentication:** {{auth_method}} + - **Integration Method:** {{integration_approach}} + + **Key Endpoints Used:** + - `{{method}} {{endpoint_path}}` - {{endpoint_purpose}} + + **Error Handling:** {{error_handling_strategy}} + + - id: source-tree-integration + title: Source Tree Integration + instruction: | + Define how new code will integrate with existing project structure: + + 1. Follow existing project organization patterns + 2. Identify where new files/folders will be placed + 3. Ensure consistency with existing naming conventions + 4. Plan for minimal disruption to existing structure + elicit: true + sections: + - id: existing-structure + title: Existing Project Structure + type: code + language: plaintext + instruction: Document relevant parts of current structure + template: "{{existing_structure_relevant_parts}}" + - id: new-file-organization + title: New File Organization + type: code + language: plaintext + instruction: Show only new additions to existing structure + template: | + {{project-root}}/ + ├── {{existing_structure_context}} + │ ├── {{new_folder_1}}/ # {{purpose_1}} + │ │ ├── {{new_file_1}} + │ │ └── {{new_file_2}} + │ ├── {{existing_folder}}/ # Existing folder with additions + │ │ ├── {{existing_file}} # Existing file + │ │ └── {{new_file_3}} # New addition + │ └── {{new_folder_2}}/ # {{purpose_2}} + - id: integration-guidelines + title: Integration Guidelines + template: | + - **File Naming:** {{file_naming_consistency}} + - **Folder Organization:** {{folder_organization_approach}} + - **Import/Export Patterns:** {{import_export_consistency}} + + - id: infrastructure-deployment + title: Infrastructure and Deployment Integration + instruction: | + Define how the enhancement will be deployed alongside existing infrastructure: + + 1. Use existing deployment pipeline and infrastructure + 2. Identify any infrastructure changes needed + 3. Plan deployment strategy to minimize risk + 4. Define rollback procedures + elicit: true + sections: + - id: existing-infrastructure + title: Existing Infrastructure + template: | + **Current Deployment:** {{existing_deployment_summary}} + **Infrastructure Tools:** {{existing_infrastructure_tools}} + **Environments:** {{existing_environments}} + - id: enhancement-deployment + title: Enhancement Deployment Strategy + template: | + **Deployment Approach:** {{deployment_approach}} + **Infrastructure Changes:** {{infrastructure_changes}} + **Pipeline Integration:** {{pipeline_integration}} + - id: rollback-strategy + title: Rollback Strategy + template: | + **Rollback Method:** {{rollback_method}} + **Risk Mitigation:** {{risk_mitigation}} + **Monitoring:** {{monitoring_approach}} + + - id: coding-standards + title: Coding Standards and Conventions + instruction: | + Ensure new code follows existing project conventions: + + 1. Document existing coding standards from project analysis + 2. Identify any enhancement-specific requirements + 3. Ensure consistency with existing codebase patterns + 4. Define standards for new code organization + elicit: true + sections: + - id: existing-standards + title: Existing Standards Compliance + template: | + **Code Style:** {{existing_code_style}} + **Linting Rules:** {{existing_linting}} + **Testing Patterns:** {{existing_test_patterns}} + **Documentation Style:** {{existing_doc_style}} + - id: enhancement-standards + title: Enhancement-Specific Standards + condition: New patterns needed for enhancement + repeatable: true + template: "- **{{standard_name}}:** {{standard_description}}" + - id: integration-rules + title: Critical Integration Rules + template: | + - **Existing API Compatibility:** {{api_compatibility_rule}} + - **Database Integration:** {{db_integration_rule}} + - **Error Handling:** {{error_handling_integration}} + - **Logging Consistency:** {{logging_consistency}} + + - id: testing-strategy + title: Testing Strategy + instruction: | + Define testing approach for the enhancement: + + 1. Integrate with existing test suite + 2. Ensure existing functionality remains intact + 3. Plan for testing new features + 4. Define integration testing approach + elicit: true + sections: + - id: existing-test-integration + title: Integration with Existing Tests + template: | + **Existing Test Framework:** {{existing_test_framework}} + **Test Organization:** {{existing_test_organization}} + **Coverage Requirements:** {{existing_coverage_requirements}} + - id: new-testing + title: New Testing Requirements + sections: + - id: unit-tests + title: Unit Tests for New Components + template: | + - **Framework:** {{test_framework}} + - **Location:** {{test_location}} + - **Coverage Target:** {{coverage_target}} + - **Integration with Existing:** {{test_integration}} + - id: integration-tests + title: Integration Tests + template: | + - **Scope:** {{integration_test_scope}} + - **Existing System Verification:** {{existing_system_verification}} + - **New Feature Testing:** {{new_feature_testing}} + - id: regression-tests + title: Regression Testing + template: | + - **Existing Feature Verification:** {{regression_test_approach}} + - **Automated Regression Suite:** {{automated_regression}} + - **Manual Testing Requirements:** {{manual_testing_requirements}} + + - id: security-integration + title: Security Integration + instruction: | + Ensure security consistency with existing system: + + 1. Follow existing security patterns and tools + 2. Ensure new features don't introduce vulnerabilities + 3. Maintain existing security posture + 4. Define security testing for new components + elicit: true + sections: + - id: existing-security + title: Existing Security Measures + template: | + **Authentication:** {{existing_auth}} + **Authorization:** {{existing_authz}} + **Data Protection:** {{existing_data_protection}} + **Security Tools:** {{existing_security_tools}} + - id: enhancement-security + title: Enhancement Security Requirements + template: | + **New Security Measures:** {{new_security_measures}} + **Integration Points:** {{security_integration_points}} + **Compliance Requirements:** {{compliance_requirements}} + - id: security-testing + title: Security Testing + template: | + **Existing Security Tests:** {{existing_security_tests}} + **New Security Test Requirements:** {{new_security_tests}} + **Penetration Testing:** {{pentest_requirements}} + + - id: checklist-results + title: Checklist Results Report + instruction: Execute the architect-checklist and populate results here, focusing on brownfield-specific validation + + - id: next-steps + title: Next Steps + instruction: | + After completing the brownfield architecture: + + 1. Review integration points with existing system + 2. Begin story implementation with Dev agent + 3. Set up deployment pipeline integration + 4. Plan rollback and monitoring procedures + sections: + - id: story-manager-handoff + title: Story Manager Handoff + instruction: | + Create a brief prompt for Story Manager to work with this brownfield enhancement. Include: + - Reference to this architecture document + - Key integration requirements validated with user + - Existing system constraints based on actual project analysis + - First story to implement with clear integration checkpoints + - Emphasis on maintaining existing system integrity throughout implementation + - id: developer-handoff + title: Developer Handoff + instruction: | + Create a brief prompt for developers starting implementation. Include: + - Reference to this architecture and existing coding standards analyzed from actual project + - Integration requirements with existing codebase validated with user + - Key technical decisions based on real project constraints + - Existing system compatibility requirements with specific verification steps + - Clear sequencing of implementation to minimize risk to existing functionality +==================== END: .bmad-core/templates/brownfield-architecture-tmpl.yaml ==================== ==================== START: .bmad-core/checklists/architect-checklist.md ==================== # Architect Solution Validation Checklist @@ -3894,32 +3511,3 @@ After presenting the report, ask the user if they would like detailed analysis o None Listed ==================== END: .bmad-core/data/technical-preferences.md ==================== - -==================== START: .bmad-core/utils/template-format.md ==================== -# Template Format Conventions - -Templates in the BMad method use standardized markup for AI processing. These conventions ensure consistent document generation. - -## Template Markup Elements - -- **{{placeholders}}**: Variables to be replaced with actual content -- **[[LLM: instructions]]**: Internal processing instructions for AI agents (never shown to users) -- **REPEAT** sections: Content blocks that may be repeated as needed -- **^^CONDITION^^** blocks: Conditional content included only if criteria are met -- **@{examples}**: Example content for guidance (never output to users) - -## Processing Rules - -- Replace all {{placeholders}} with project-specific content -- Execute all [[LLM: instructions]] internally without showing users -- Process conditional and repeat blocks as specified -- Use examples for guidance but never include them in final output -- Present only clean, formatted content to users - -## Critical Guidelines - -- **NEVER display template markup, LLM instructions, or examples to users** -- Template elements are for AI processing only -- Focus on faithful template execution and clean output -- All template-specific instructions are embedded within templates -==================== END: .bmad-core/utils/template-format.md ==================== diff --git a/dist/agents/bmad-master.txt b/dist/agents/bmad-master.txt index c463c6ef..f5645a8d 100644 --- a/dist/agents/bmad-master.txt +++ b/dist/agents/bmad-master.txt @@ -45,6 +45,9 @@ These references map directly to bundle sections: CRITICAL: Read the full YAML, start activation to alter your state of being, follow startup section instructions, stay in this being until told to exit this mode: ```yaml +activation-instructions: + - Greet the user with your name and role, and inform of the *help command. + - Check for active workflow plan using the utils plan-management agent: name: BMad Master id: bmad-master @@ -63,13 +66,6 @@ persona: - Track execution state and guide multi-step plans - Use numbered lists for choices - Process (*) commands immediately, All commands require * prefix when used (e.g., *help) -startup: - - Greet the user with your name and role, and inform of the *help command. - - Check for active workflow plan using the utils plan-management - - If plan exists: Show brief status - Active plan {workflow} in progress - - If plan exists: Suggest next step based on plan - - CRITICAL: Do NOT scan filesystem or load any resources during startup, ONLY when commanded - - CRITICAL: Do NOT run discovery tasks automatically commands: - help: Show these listed commands in a numbered list - kb: Toggle KB mode off (default) or on, when on will load and reference the data/bmad-kb and converse with the user answering his questions with this informational resource @@ -82,7 +78,7 @@ commands: - plan: Execute the task Create workflow plan - plan-status: Show current workflow plan progress - plan-update: Update workflow plan status - - yolo: Toggle Yolo Mode off (default) abd on - on will skip doc section confirmations + - yolo: Toggle Yolo Mode - doc-out: Output full document to current destination file - exit: Exit (confirm) workflow-guidance: @@ -97,57 +93,56 @@ execution: - Suggest related resources after completion dependencies: tasks: - - advanced-elicitation - - facilitate-brainstorming-session - - brownfield-create-epic - - brownfield-create-story - - correct-course - - create-deep-research-prompt - - create-doc - - create-doc2 - - create-workflow-plan - - document-project - - create-next-story - - execute-checklist - - generate-ai-frontend-prompt - - index-docs - - shard-doc - - update-workflow-plan + - advanced-elicitation.md + - facilitate-brainstorming-session.md + - brownfield-create-epic.md + - brownfield-create-story.md + - correct-course.md + - create-deep-research-prompt.md + - create-doc.md + - create-workflow-plan.md + - document-project.md + - create-next-story.md + - execute-checklist.md + - generate-ai-frontend-prompt.md + - index-docs.md + - shard-doc.md + - update-workflow-plan.md templates: - - architecture-tmpl - - brownfield-architecture-tmpl - - brownfield-prd-tmpl - - competitor-analysis-tmpl - - front-end-architecture-tmpl - - front-end-spec-tmpl - - fullstack-architecture-tmpl - - market-research-tmpl - - prd-tmpl - - prd-tmpl2 - - project-brief-tmpl - - story-tmpl + - architecture-tmpl.yaml + - brownfield-architecture-tmpl.yaml + - brownfield-prd-tmpl.yaml + - competitor-analysis-tmpl.yaml + - front-end-architecture-tmpl.yaml + - front-end-spec-tmpl.yaml + - fullstack-architecture-tmpl.yaml + - market-research-tmpl.yaml + - prd-tmpl.yaml + - project-brief-tmpl.yaml + - story-tmpl.yaml data: - - bmad-kb - - brainstorming-techniques - - technical-preferences + - bmad-kb.md + - brainstorming-techniques.md + - elicitation-methods.md + - technical-preferences.md utils: - - plan-management - - template-format - - workflow-management + - plan-management.md + - template-format.md + - workflow-management.md workflows: - - brownfield-fullstack - - brownfield-service - - brownfield-ui - - greenfield-fullstack - - greenfield-service - - greenfield-ui + - brownfield-fullstack.md + - brownfield-service.md + - brownfield-ui.md + - greenfield-fullstack.md + - greenfield-service.md + - greenfield-ui.md checklists: - - architect-checklist - - change-checklist - - pm-checklist - - po-master-checklist - - story-dod-checklist - - story-draft-checklist + - architect-checklist.md + - change-checklist.md + - pm-checklist.md + - po-master-checklist.md + - story-dod-checklist.md + - story-draft-checklist.md ``` ==================== END: .bmad-core/agents/bmad-master.md ==================== @@ -1104,100 +1099,6 @@ Present these numbered options to the user: ==================== END: .bmad-core/tasks/create-deep-research-prompt.md ==================== ==================== START: .bmad-core/tasks/create-doc.md ==================== -# Create Document from Template Task - -## Purpose - -Generate documents from templates by EXECUTING (not just reading) embedded instructions from the perspective of the selected agent persona. - -## CRITICAL RULES - -1. **Templates are PROGRAMS** - Execute every [[LLM:]] instruction exactly as written -2. **NEVER show markup** - Hide all [[LLM:]], {{placeholders}}, @{examples}, and template syntax -3. **STOP and EXECUTE** - When you see "apply tasks#" or "execute tasks#", STOP and run that task immediately -4. **WAIT for user input** - At review points and after elicitation tasks - -## Execution Flow - -### 0. Check Workflow Plan (if configured) - -[[LLM: Check if plan tracking is enabled in core-config.yaml]] - -- If `workflow.trackProgress: true`, check for active plan using .bmad-core/utils/plan-management.md -- If plan exists and this document creation is part of the plan: - - Verify this is the expected next step - - If out of sequence and `enforceSequence: true`, warn user and halt without user override - - If out of sequence and `enforceSequence: false`, ask for confirmation -- Continue with normal execution after plan check - -### 1. Identify Template - -- Load from `.bmad-core/templates/*.md` or `.bmad-core/templates directory` -- Agent-specific templates are listed in agent's dependencies -- If agent has `templates: [prd-tmpl, architecture-tmpl]` for example, then offer to create "PRD" and "Architecture" documents - -### 2. Ask Interaction Mode - -> 1. **Incremental** - Section by section with reviews -> 2. **YOLO Mode** - Complete draft then review (user can type `/yolo` anytime to switch) - -### 3. Execute Template - -- Replace {{placeholders}} with real content -- Execute [[LLM:]] instructions as you encounter them -- Process <> loops and ^^CONDITIONS^^ -- Use @{examples} for guidance but never output them - -### 4. Key Execution Patterns - -**When you see:** `[[LLM: Draft X and immediately execute .bmad-core/tasks/advanced-elicitation.md]]` - -- Draft the content -- Present it to user -- IMMEDIATELY execute the task -- Wait for completion before continuing - -**When you see:** `[[LLM: After section completion, apply .bmad-core/tasks/Y.md]]` - -- Finish the section -- STOP and execute the task -- Wait for user input - -### 5. Validation & Final Presentation - -- Run any specified checklists -- Present clean, formatted content only -- No truncation or summarization -- Begin directly with content (no preamble) -- Include any handoff prompts from template - -### 6. Update Workflow Plan (if applicable) - -[[LLM: After successful document creation]] - -- If plan tracking is enabled and document was part of plan: - - Call update-workflow-plan task to mark step complete - - Parameters: task: create-doc, step_id: {from plan}, status: complete - - Show next recommended step from plan - -## Common Mistakes to Avoid - -❌ Skipping elicitation tasks -❌ Showing template markup to users -❌ Continuing past STOP signals -❌ Combining multiple review points - -✅ Execute ALL instructions in sequence -✅ Present only clean, formatted content -✅ Stop at every elicitation point -✅ Wait for user confirmation when instructed - -## Remember - -Templates contain precise instructions for a reason. Follow them exactly to ensure document quality and completeness. -==================== END: .bmad-core/tasks/create-doc.md ==================== - -==================== START: .bmad-core/tasks/create-doc2.md ==================== # Create Document from Template (YAML Driven) ## CRITICAL: Mandatory Elicitation Format @@ -1219,6 +1120,7 @@ Templates contain precise instructions for a reason. Follow them exactly to ensu 2. **Set preferences** - Show current mode (Interactive), confirm output file 3. **Process each section:** - Skip if condition unmet + - Check agent permissions (owner/editors) - note if section is restricted to specific agents - Draft content using section instruction - Present content + detailed rationale - **IF elicit: true** → MANDATORY 1-9 options format @@ -1245,6 +1147,19 @@ After user selects elicitation method (2-9): - **2. Return to elicitation menu** - **3. Ask any questions or engage further with this elicitation** +## Agent Permissions + +When processing sections with agent permission fields: + +- **owner**: Note which agent role initially creates/populates the section +- **editors**: List agent roles allowed to modify the section +- **readonly**: Mark sections that cannot be modified after creation + +**For sections with restricted access:** + +- Include a note in the generated document indicating the responsible agent +- Example: "_(This section is owned by dev-agent and can only be modified by dev-agent)_" + ## YOLO Mode User can type `#yolo` to toggle to YOLO mode (process all sections at once). @@ -1263,7 +1178,7 @@ User can type `#yolo` to toggle to YOLO mode (process all sections at once). - Select options 2-9 from data/elicitation-methods only - Provide detailed rationale explaining decisions - End with "Select 1-9 or just type your question/feedback:" -==================== END: .bmad-core/tasks/create-doc2.md ==================== +==================== END: .bmad-core/tasks/create-doc.md ==================== ==================== START: .bmad-core/tasks/create-workflow-plan.md ==================== # Create Workflow Plan Task @@ -2771,3982 +2686,3350 @@ The update is successful when: - If plan becomes too cluttered, suggest creating fresh plan for next phase ==================== END: .bmad-core/tasks/update-workflow-plan.md ==================== -==================== START: .bmad-core/templates/architecture-tmpl.md ==================== -# {{Project Name}} Architecture Document - -[[LLM: If available, review any provided relevant documents to gather all relevant context before beginning. If at a minimum you cannot local `docs/prd.md` ask the user what docs will provide the basis for the architecture.]] - -[[LLM: The default path and filename unless specified is docs/architecture.md]] - -## Introduction - -[[LLM: This section establishes the document's purpose and scope. Keep the content below but ensure project name is properly substituted. - -After presenting this section, apply `.bmad-core/tasks/advanced-elicitation.md` protocol]] - -This document outlines the overall project architecture for {{Project Name}}, including backend systems, shared services, and non-UI specific concerns. Its primary goal is to serve as the guiding architectural blueprint for AI-driven development, ensuring consistency and adherence to chosen patterns and technologies. - -**Relationship to Frontend Architecture:** -If the project includes a significant user interface, a separate Frontend Architecture Document will detail the frontend-specific design and MUST be used in conjunction with this document. Core technology stack choices documented herein (see "Tech Stack") are definitive for the entire project, including any frontend components. - -### Starter Template or Existing Project - -[[LLM: Before proceeding further with architecture design, check if the project is based on a starter template or existing codebase: - -1. Review the PRD and brainstorming brief for any mentions of: - -- Starter templates (e.g., Create React App, Next.js, Vue CLI, Angular CLI, etc.) -- Existing projects or codebases being used as a foundation -- Boilerplate projects or scaffolding tools -- Previous projects to be cloned or adapted - -2. If a starter template or existing project is mentioned: - -- Ask the user to provide access via one of these methods: - - Link to the starter template documentation - - Upload/attach the project files (for small projects) - - Share a link to the project repository (GitHub, GitLab, etc.) -- Analyze the starter/existing project to understand: - - Pre-configured technology stack and versions - - Project structure and organization patterns - - Built-in scripts and tooling - - Existing architectural patterns and conventions - - Any limitations or constraints imposed by the starter -- Use this analysis to inform and align your architecture decisions - -3. If no starter template is mentioned but this is a greenfield project: - -- Suggest appropriate starter templates based on the tech stack preferences -- Explain the benefits (faster setup, best practices, community support) -- Let the user decide whether to use one - -4. If the user confirms no starter template will be used: - -- Proceed with architecture design from scratch -- Note that manual setup will be required for all tooling and configuration - -Document the decision here before proceeding with the architecture design. In none, just say N/A - -After presenting this starter template section, apply `.bmad-core/tasks/advanced-elicitation.md` protocol]] - -### Change Log - -[[LLM: Track document versions and changes]] - -| Date | Version | Description | Author | -| :--- | :------ | :---------- | :----- | - -## High Level Architecture - -[[LLM: This section contains multiple subsections that establish the foundation of the architecture. Present all subsections together (Introduction, Technical Summary, High Level Overview, Project Diagram, and Architectural Patterns), then apply `.bmad-core/tasks/advanced-elicitation.md` protocol to the complete High Level Architecture section. The user can choose to refine the entire section or specific subsections.]] - -### Technical Summary - -[[LLM: Provide a brief paragraph (3-5 sentences) overview of: - -- The system's overall architecture style -- Key components and their relationships -- Primary technology choices -- Core architectural patterns being used -- Reference back to the PRD goals and how this architecture supports them]] - -### High Level Overview - -[[LLM: Based on the PRD's Technical Assumptions section, describe: - -1. The main architectural style (e.g., Monolith, Microservices, Serverless, Event-Driven) -2. Repository structure decision from PRD (Monorepo/Polyrepo) -3. Service architecture decision from PRD -4. Primary user interaction flow or data flow at a conceptual level -5. Key architectural decisions and their rationale - -After presenting this section, apply `.bmad-core/tasks/advanced-elicitation.md` protocol]] - -### High Level Project Diagram - -[[LLM: Create a Mermaid diagram that visualizes the high-level architecture. Consider: - -- System boundaries -- Major components/services -- Data flow directions -- External integrations -- User entry points - -Use appropriate Mermaid diagram type (graph TD, C4, sequence) based on what best represents the architecture - -After presenting the diagram, apply `.bmad-core/tasks/advanced-elicitation.md` protocol]] - -### Architectural and Design Patterns - -[[LLM: List the key high-level patterns that will guide the architecture. For each pattern: - -1. Present 2-3 viable options if multiple exist -2. Provide your recommendation with clear rationale -3. Get user confirmation before finalizing -4. These patterns should align with the PRD's technical assumptions and project goals - -Common patterns to consider: - -- Architectural style patterns (Serverless, Event-Driven, Microservices, CQRS, Hexagonal) -- Code organization patterns (Dependency Injection, Repository, Module, Factory) -- Data patterns (Event Sourcing, Saga, Database per Service) -- Communication patterns (REST, GraphQL, Message Queue, Pub/Sub)]] - -<> - -- **{{pattern_name}}:** {{pattern_description}} - _Rationale:_ {{rationale}} - -<> - -@{example: patterns} - -- **Serverless Architecture:** Using AWS Lambda for compute - _Rationale:_ Aligns with PRD requirement for cost optimization and automatic scaling -- **Repository Pattern:** Abstract data access logic - _Rationale:_ Enables testing and future database migration flexibility -- **Event-Driven Communication:** Using SNS/SQS for service decoupling - _Rationale:_ Supports async processing and system resilience - -@{/example} - -[[LLM: After presenting the patterns, apply `.bmad-core/tasks/advanced-elicitation.md` protocol]] - -## Tech Stack - -[[LLM: This is the DEFINITIVE technology selection section. Work with the user to make specific choices: - -1. Review PRD technical assumptions and any preferences from `.bmad-core/data/technical-preferences.yaml` or an attached `technical-preferences` -2. For each category, present 2-3 viable options with pros/cons -3. Make a clear recommendation based on project needs -4. Get explicit user approval for each selection -5. Document exact versions (avoid "latest" - pin specific versions) -6. This table is the single source of truth - all other docs must reference these choices - -Key decisions to finalize - before displaying the table, ensure you are aware of or ask the user about - let the user know if they are not sure on any that you can also provide suggestions with rationale: - -- Starter templates (if any) -- Languages and runtimes with exact versions -- Frameworks and libraries / packages -- Cloud provider and key services choices -- Database and storage solutions - if unclear suggest sql or nosql or other types depending on the project and depending on cloud provider offer a suggestion -- Development tools - -Upon render of the table, ensure the user is aware of the importance of this sections choices, should also look for gaps or disagreements with anything, ask for any clarifications if something is unclear why its in the list, and also right away apply `.bmad-core/tasks/advanced-elicitation.md` display - this statement and the options should be rendered and then prompt right all before allowing user input.]] - -### Cloud Infrastructure - -- **Provider:** {{cloud_provider}} -- **Key Services:** {{core_services_list}} -- **Deployment Regions:** {{regions}} - -### Technology Stack Table - -| Category | Technology | Version | Purpose | Rationale | -| :----------------- | :----------------- | :---------- | :---------- | :------------- | -| **Language** | {{language}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **Runtime** | {{runtime}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **Framework** | {{framework}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **Database** | {{database}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **Cache** | {{cache}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **Message Queue** | {{queue}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **API Style** | {{api_style}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **Authentication** | {{auth}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **Testing** | {{test_framework}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **Build Tool** | {{build_tool}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **IaC Tool** | {{iac_tool}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **Monitoring** | {{monitoring}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **Logging** | {{logging}} | {{version}} | {{purpose}} | {{why_chosen}} | - -@{example: tech_stack_row} -| **Language** | TypeScript | 5.3.3 | Primary development language | Strong typing, excellent tooling, team expertise | -| **Runtime** | Node.js | 20.11.0 | JavaScript runtime | LTS version, stable performance, wide ecosystem | -| **Framework** | NestJS | 10.3.2 | Backend framework | Enterprise-ready, good DI, matches team patterns | -@{/example} - -## Data Models - -[[LLM: Define the core data models/entities: - -1. Review PRD requirements and identify key business entities -2. For each model, explain its purpose and relationships -3. Include key attributes and data types -4. Show relationships between models -5. Discuss design decisions with user - -Create a clear conceptual model before moving to database schema. - -After presenting all data models, apply `.bmad-core/tasks/advanced-elicitation.md` protocol]] - -<> - -### {{model_name}} - -**Purpose:** {{model_purpose}} - -**Key Attributes:** - -- {{attribute_1}}: {{type_1}} - {{description_1}} -- {{attribute_2}}: {{type_2}} - {{description_2}} - -**Relationships:** - -- {{relationship_1}} -- {{relationship_2}} - <> - -## Components - -[[LLM: Based on the architectural patterns, tech stack, and data models from above: - -1. Identify major logical components/services and their responsibilities -2. Consider the repository structure (monorepo/polyrepo) from PRD -3. Define clear boundaries and interfaces between components -4. For each component, specify: - -- Primary responsibility -- Key interfaces/APIs exposed -- Dependencies on other components -- Technology specifics based on tech stack choices - -5. Create component diagrams where helpful -6. After presenting all components, apply `.bmad-core/tasks/advanced-elicitation.md` protocol]] - -<> - -### {{component_name}} - -**Responsibility:** {{component_description}} - -**Key Interfaces:** - -- {{interface_1}} -- {{interface_2}} - -**Dependencies:** {{dependencies}} - -**Technology Stack:** {{component_tech_details}} -<> - -### Component Diagrams - -[[LLM: Create Mermaid diagrams to visualize component relationships. Options: - -- C4 Container diagram for high-level view -- Component diagram for detailed internal structure -- Sequence diagrams for complex interactions - Choose the most appropriate for clarity - -After presenting the diagrams, apply `.bmad-core/tasks/advanced-elicitation.md` protocol]] - -## External APIs - -[[LLM: For each external service integration: - -1. Identify APIs needed based on PRD requirements and component design -2. If documentation URLs are unknown, ask user for specifics -3. Document authentication methods and security considerations -4. List specific endpoints that will be used -5. Note any rate limits or usage constraints - -If no external APIs are needed, state this explicitly and skip to next section.]] - -^^CONDITION: has_external_apis^^ - -<> - -### {{api_name}} API - -- **Purpose:** {{api_purpose}} -- **Documentation:** {{api_docs_url}} -- **Base URL(s):** {{api_base_url}} -- **Authentication:** {{auth_method}} -- **Rate Limits:** {{rate_limits}} - -**Key Endpoints Used:** -<> - -- `{{method}} {{endpoint_path}}` - {{endpoint_purpose}} - <> - -**Integration Notes:** {{integration_considerations}} -<> - -@{example: external_api} - -### Stripe API - -- **Purpose:** Payment processing and subscription management -- **Documentation:** https://stripe.com/docs/api -- **Base URL(s):** `https://api.stripe.com/v1` -- **Authentication:** Bearer token with secret key -- **Rate Limits:** 100 requests per second - -**Key Endpoints Used:** - -- `POST /customers` - Create customer profiles -- `POST /payment_intents` - Process payments -- `POST /subscriptions` - Manage subscriptions - @{/example} - -^^/CONDITION: has_external_apis^^ - -[[LLM: After presenting external APIs (or noting their absence), apply `.bmad-core/tasks/advanced-elicitation.md` protocol]] - -## Core Workflows - -[[LLM: Illustrate key system workflows using sequence diagrams: - -1. Identify critical user journeys from PRD -2. Show component interactions including external APIs -3. Include error handling paths -4. Document async operations -5. Create both high-level and detailed diagrams as needed - -Focus on workflows that clarify architecture decisions or complex interactions. - -After presenting the workflow diagrams, apply `.bmad-core/tasks/advanced-elicitation.md` protocol]] - -## REST API Spec - -[[LLM: If the project includes a REST API: - -1. Create an OpenAPI 3.0 specification -2. Include all endpoints from epics/stories -3. Define request/response schemas based on data models -4. Document authentication requirements -5. Include example requests/responses - -Use YAML format for better readability. If no REST API, skip this section.]] - -^^CONDITION: has_rest_api^^ - -```yaml -openapi: 3.0.0 -info: - title: - '[object Object]': null - version: - '[object Object]': null - description: - '[object Object]': null -servers: - - url: - '[object Object]': null - description: - '[object Object]': null -``` - -^^/CONDITION: has_rest_api^^ - -[[LLM: After presenting the REST API spec (or noting its absence if not applicable), apply `.bmad-core/tasks/advanced-elicitation.md` protocol]] - -## Database Schema - -[[LLM: Transform the conceptual data models into concrete database schemas: - -1. Use the database type(s) selected in Tech Stack -2. Create schema definitions using appropriate notation -3. Include indexes, constraints, and relationships -4. Consider performance and scalability -5. For NoSQL, show document structures - -Present schema in format appropriate to database type (SQL DDL, JSON schema, etc.) - -After presenting the database schema, apply `.bmad-core/tasks/advanced-elicitation.md` protocol]] - -## Source Tree - -[[LLM: Create a project folder structure that reflects: - -1. The chosen repository structure (monorepo/polyrepo) -2. The service architecture (monolith/microservices/serverless) -3. The selected tech stack and languages -4. Component organization from above -5. Best practices for the chosen frameworks -6. Clear separation of concerns - -Adapt the structure based on project needs. For monorepos, show service separation. For serverless, show function organization. Include language-specific conventions. - -After presenting the structure, apply `.bmad-core/tasks/advanced-elicitation.md` protocol to refine based on user feedback.]] - -```plaintext -{{project-root}}/ -├── .github/ # CI/CD workflows -│ └── workflows/ -│ └── main.yaml -├── .vscode/ # VSCode settings (optional) -│ └── settings.json -├── build/ # Compiled output (git-ignored) -├── config/ # Configuration files -├── docs/ # Project documentation -│ ├── PRD.md -│ ├── architecture.md -│ └── ... -├── infra/ # Infrastructure as Code -│ └── {{iac-structure}} -├── {{dependencies-dir}}/ # Dependencies (git-ignored) -├── scripts/ # Utility scripts -├── src/ # Application source code -│ └── {{source-structure}} -├── tests/ # Test files -│ ├── unit/ -│ ├── integration/ -│ └── e2e/ -├── .env.example # Environment variables template -├── .gitignore # Git ignore rules -├── {{package-manifest}} # Dependencies manifest -├── {{config-files}} # Language/framework configs -└── README.md # Project documentation - -@{example: monorepo-structure} -project-root/ -├── packages/ -│ ├── api/ # Backend API service -│ ├── web/ # Frontend application -│ ├── shared/ # Shared utilities/types -│ └── infrastructure/ # IaC definitions -├── scripts/ # Monorepo management scripts -└── package.json # Root package.json with workspaces -@{/example} -``` - -[[LLM: After presenting the source tree structure, apply `.bmad-core/tasks/advanced-elicitation.md` protocol]] - -## Infrastructure and Deployment - -[[LLM: Define the deployment architecture and practices: - -1. Use IaC tool selected in Tech Stack -2. Choose deployment strategy appropriate for the architecture -3. Define environments and promotion flow -4. Establish rollback procedures -5. Consider security, monitoring, and cost optimization - -Get user input on deployment preferences and CI/CD tool choices.]] - -### Infrastructure as Code - -- **Tool:** {{iac_tool}} {{version}} -- **Location:** `{{iac_directory}}` -- **Approach:** {{iac_approach}} - -### Deployment Strategy - -- **Strategy:** {{deployment_strategy}} -- **CI/CD Platform:** {{cicd_platform}} -- **Pipeline Configuration:** `{{pipeline_config_location}}` - -### Environments - -<> - -- **{{env_name}}:** {{env_purpose}} - {{env_details}} - <> - -### Environment Promotion Flow - -```text -{{promotion_flow_diagram}} -``` - -### Rollback Strategy - -- **Primary Method:** {{rollback_method}} -- **Trigger Conditions:** {{rollback_triggers}} -- **Recovery Time Objective:** {{rto}} - -[[LLM: After presenting the infrastructure and deployment section, apply `.bmad-core/tasks/advanced-elicitation.md` protocol]] - -## Error Handling Strategy - -[[LLM: Define comprehensive error handling approach: - -1. Choose appropriate patterns for the language/framework from Tech Stack -2. Define logging standards and tools -3. Establish error categories and handling rules -4. Consider observability and debugging needs -5. Ensure security (no sensitive data in logs) - -This section guides both AI and human developers in consistent error handling.]] - -### General Approach - -- **Error Model:** {{error_model}} -- **Exception Hierarchy:** {{exception_structure}} -- **Error Propagation:** {{propagation_rules}} - -### Logging Standards - -- **Library:** {{logging_library}} {{version}} -- **Format:** {{log_format}} -- **Levels:** {{log_levels_definition}} -- **Required Context:** - - Correlation ID: {{correlation_id_format}} - - Service Context: {{service_context}} - - User Context: {{user_context_rules}} - -### Error Handling Patterns - -#### External API Errors - -- **Retry Policy:** {{retry_strategy}} -- **Circuit Breaker:** {{circuit_breaker_config}} -- **Timeout Configuration:** {{timeout_settings}} -- **Error Translation:** {{error_mapping_rules}} - -#### Business Logic Errors - -- **Custom Exceptions:** {{business_exception_types}} -- **User-Facing Errors:** {{user_error_format}} -- **Error Codes:** {{error_code_system}} - -#### Data Consistency - -- **Transaction Strategy:** {{transaction_approach}} -- **Compensation Logic:** {{compensation_patterns}} -- **Idempotency:** {{idempotency_approach}} - -[[LLM: After presenting the error handling strategy, apply `.bmad-core/tasks/advanced-elicitation.md` protocol]] - -## Coding Standards - -[[LLM: These standards are MANDATORY for AI agents. Work with user to define ONLY the critical rules needed to prevent bad code. Explain that: - -1. This section directly controls AI developer behavior -2. Keep it minimal - assume AI knows general best practices -3. Focus on project-specific conventions and gotchas -4. Overly detailed standards bloat context and slow development -5. Standards will be extracted to separate file for dev agent use - -For each standard, get explicit user confirmation it's necessary.]] - -### Core Standards - -- **Languages & Runtimes:** {{languages_and_versions}} -- **Style & Linting:** {{linter_config}} -- **Test Organization:** {{test_file_convention}} - -### Naming Conventions - -[[LLM: Only include if deviating from language defaults]] - -| Element | Convention | Example | -| :-------- | :------------------- | :---------------- | -| Variables | {{var_convention}} | {{var_example}} | -| Functions | {{func_convention}} | {{func_example}} | -| Classes | {{class_convention}} | {{class_example}} | -| Files | {{file_convention}} | {{file_example}} | - -### Critical Rules - -[[LLM: List ONLY rules that AI might violate or project-specific requirements. Examples: - -- "Never use console.log in production code - use logger" -- "All API responses must use ApiResponse wrapper type" -- "Database queries must use repository pattern, never direct ORM" - -Avoid obvious rules like "use SOLID principles" or "write clean code"]] - -<> - -- **{{rule_name}}:** {{rule_description}} - <> - -### Language-Specific Guidelines - -[[LLM: Add ONLY if critical for preventing AI mistakes. Most teams don't need this section.]] - -^^CONDITION: has_language_specifics^^ - -#### {{language_name}} Specifics - -<> - -- **{{rule_topic}}:** {{rule_detail}} - <> - -^^/CONDITION: has_language_specifics^^ - -[[LLM: After presenting the coding standards, apply `.bmad-core/tasks/advanced-elicitation.md` protocol]] - -## Test Strategy and Standards - -[[LLM: Work with user to define comprehensive test strategy: - -1. Use test frameworks from Tech Stack -2. Decide on TDD vs test-after approach -3. Define test organization and naming -4. Establish coverage goals -5. Determine integration test infrastructure -6. Plan for test data and external dependencies - -Note: Basic info goes in Coding Standards for dev agent. This detailed section is for QA agent and team reference. Apply `.bmad-core/tasks/advanced-elicitation.md` after initial draft.]] - -### Testing Philosophy - -- **Approach:** {{test_approach}} -- **Coverage Goals:** {{coverage_targets}} -- **Test Pyramid:** {{test_distribution}} - -### Test Types and Organization - -#### Unit Tests - -- **Framework:** {{unit_test_framework}} {{version}} -- **File Convention:** {{unit_test_naming}} -- **Location:** {{unit_test_location}} -- **Mocking Library:** {{mocking_library}} -- **Coverage Requirement:** {{unit_coverage}} - -**AI Agent Requirements:** - -- Generate tests for all public methods -- Cover edge cases and error conditions -- Follow AAA pattern (Arrange, Act, Assert) -- Mock all external dependencies - -#### Integration Tests - -- **Scope:** {{integration_scope}} -- **Location:** {{integration_test_location}} -- **Test Infrastructure:** - <> - - **{{dependency_name}}:** {{test_approach}} ({{test_tool}}) - <> - -@{example: test_dependencies} - -- **Database:** In-memory H2 for unit tests, Testcontainers PostgreSQL for integration -- **Message Queue:** Embedded Kafka for tests -- **External APIs:** WireMock for stubbing - @{/example} - -#### End-to-End Tests - -- **Framework:** {{e2e_framework}} {{version}} -- **Scope:** {{e2e_scope}} -- **Environment:** {{e2e_environment}} -- **Test Data:** {{e2e_data_strategy}} - -### Test Data Management - -- **Strategy:** {{test_data_approach}} -- **Fixtures:** {{fixture_location}} -- **Factories:** {{factory_pattern}} -- **Cleanup:** {{cleanup_strategy}} - -### Continuous Testing - -- **CI Integration:** {{ci_test_stages}} -- **Performance Tests:** {{perf_test_approach}} -- **Security Tests:** {{security_test_approach}} - -[[LLM: After presenting the test strategy section, apply `.bmad-core/tasks/advanced-elicitation.md` protocol]] - -## Security - -[[LLM: Define MANDATORY security requirements for AI and human developers: - -1. Focus on implementation-specific rules -2. Reference security tools from Tech Stack -3. Define clear patterns for common scenarios -4. These rules directly impact code generation -5. Work with user to ensure completeness without redundancy]] - -### Input Validation - -- **Validation Library:** {{validation_library}} -- **Validation Location:** {{where_to_validate}} -- **Required Rules:** - - All external inputs MUST be validated - - Validation at API boundary before processing - - Whitelist approach preferred over blacklist - -### Authentication & Authorization - -- **Auth Method:** {{auth_implementation}} -- **Session Management:** {{session_approach}} -- **Required Patterns:** - - {{auth_pattern_1}} - - {{auth_pattern_2}} - -### Secrets Management - -- **Development:** {{dev_secrets_approach}} -- **Production:** {{prod_secrets_service}} -- **Code Requirements:** - - NEVER hardcode secrets - - Access via configuration service only - - No secrets in logs or error messages - -### API Security - -- **Rate Limiting:** {{rate_limit_implementation}} -- **CORS Policy:** {{cors_configuration}} -- **Security Headers:** {{required_headers}} -- **HTTPS Enforcement:** {{https_approach}} - -### Data Protection - -- **Encryption at Rest:** {{encryption_at_rest}} -- **Encryption in Transit:** {{encryption_in_transit}} -- **PII Handling:** {{pii_rules}} -- **Logging Restrictions:** {{what_not_to_log}} - -### Dependency Security - -- **Scanning Tool:** {{dependency_scanner}} -- **Update Policy:** {{update_frequency}} -- **Approval Process:** {{new_dep_process}} - -### Security Testing - -- **SAST Tool:** {{static_analysis}} -- **DAST Tool:** {{dynamic_analysis}} -- **Penetration Testing:** {{pentest_schedule}} - -[[LLM: After presenting the security section, apply `.bmad-core/tasks/advanced-elicitation.md` protocol]] - -## Checklist Results Report - -[[LLM: Before running the checklist, offer to output the full architecture document. Once user confirms, execute the `architect-checklist` and populate results here.]] - ---- - -## Next Steps - -[[LLM: After completing the architecture: - -1. If project has UI components: - -- Recommend engaging Design Architect agent -- Use "Frontend Architecture Mode" -- Provide this document as input - -2. For all projects: - -- Review with Product Owner -- Begin story implementation with Dev agent -- Set up infrastructure with DevOps agent - -3. Include specific prompts for next agents if needed]] - -^^CONDITION: has_ui^^ - -### Design Architect Prompt - -[[LLM: Create a brief prompt to hand off to Design Architect for Frontend Architecture creation. Include: - -- Reference to this architecture document -- Key UI requirements from PRD -- Any frontend-specific decisions made here -- Request for detailed frontend architecture]] - -^^/CONDITION: has_ui^^ - -### Developer Handoff - -[[LLM: Create a brief prompt for developers starting implementation. Include: - -- Reference to this architecture and coding standards -- First epic/story to implement -- Key technical decisions to follow]] -==================== END: .bmad-core/templates/architecture-tmpl.md ==================== - -==================== START: .bmad-core/templates/brownfield-architecture-tmpl.md ==================== -# {{Project Name}} Brownfield Enhancement Architecture - -[[LLM: The default path and filename unless specified is docs/architecture.md]] - -[[LLM: IMPORTANT - SCOPE AND ASSESSMENT REQUIRED: - -This architecture document is for SIGNIFICANT enhancements to existing projects that require comprehensive architectural planning. Before proceeding: - -1. **Verify Complexity**: Confirm this enhancement requires architectural planning. For simple additions, recommend: "For simpler changes that don't require architectural planning, consider using the brownfield-create-epic or brownfield-create-story task with the Product Owner instead." - -2. **REQUIRED INPUTS**: - - - Completed brownfield-prd.md - - Existing project technical documentation (from docs folder or user-provided) - - Access to existing project structure (IDE or uploaded files) - -3. **DEEP ANALYSIS MANDATE**: You MUST conduct thorough analysis of the existing codebase, architecture patterns, and technical constraints before making ANY architectural recommendations. Every suggestion must be based on actual project analysis, not assumptions. - -4. **CONTINUOUS VALIDATION**: Throughout this process, explicitly validate your understanding with the user. For every architectural decision, confirm: "Based on my analysis of your existing system, I recommend [decision] because [evidence from actual project]. Does this align with your system's reality?" - -If any required inputs are missing, request them before proceeding.]] - -## Introduction - -[[LLM: This section establishes the document's purpose and scope for brownfield enhancements. Keep the content below but ensure project name and enhancement details are properly substituted. - -After presenting this section, apply `tasks#advanced-elicitation` protocol]] - -This document outlines the architectural approach for enhancing {{Project Name}} with {{Enhancement Description}}. Its primary goal is to serve as the guiding architectural blueprint for AI-driven development of new features while ensuring seamless integration with the existing system. - -**Relationship to Existing Architecture:** -This document supplements existing project architecture by defining how new components will integrate with current systems. Where conflicts arise between new and existing patterns, this document provides guidance on maintaining consistency while implementing enhancements. - -### Existing Project Analysis - -[[LLM: Analyze the existing project structure and architecture: - -1. Review existing documentation in docs folder -2. Examine current technology stack and versions -3. Identify existing architectural patterns and conventions -4. Note current deployment and infrastructure setup -5. Document any constraints or limitations - -CRITICAL: After your analysis, explicitly validate your findings: "Based on my analysis of your project, I've identified the following about your existing system: [key findings]. Please confirm these observations are accurate before I proceed with architectural recommendations." - -Present findings and apply `tasks#advanced-elicitation` protocol]] - -**Current Project State:** - -- **Primary Purpose:** {{existing_project_purpose}} -- **Current Tech Stack:** {{existing_tech_summary}} -- **Architecture Style:** {{existing_architecture_style}} -- **Deployment Method:** {{existing_deployment_approach}} - -**Available Documentation:** - -- {{existing_docs_summary}} - -**Identified Constraints:** - -- {{constraint_1}} -- {{constraint_2}} -- {{constraint_3}} - -### Change Log - -| Change | Date | Version | Description | Author | -| ------ | ---- | ------- | ----------- | ------ | - -## Enhancement Scope and Integration Strategy - -[[LLM: Define how the enhancement will integrate with the existing system: - -1. Review the brownfield PRD enhancement scope -2. Identify integration points with existing code -3. Define boundaries between new and existing functionality -4. Establish compatibility requirements - -VALIDATION CHECKPOINT: Before presenting the integration strategy, confirm: "Based on my analysis, the integration approach I'm proposing takes into account [specific existing system characteristics]. These integration points and boundaries respect your current architecture patterns. Is this assessment accurate?" - -Present complete integration strategy and apply `tasks#advanced-elicitation` protocol]] - -### Enhancement Overview - -**Enhancement Type:** {{enhancement_type}} -**Scope:** {{enhancement_scope}} -**Integration Impact:** {{integration_impact_level}} - -### Integration Approach - -**Code Integration Strategy:** {{code_integration_approach}} -**Database Integration:** {{database_integration_approach}} -**API Integration:** {{api_integration_approach}} -**UI Integration:** {{ui_integration_approach}} - -### Compatibility Requirements - -- **Existing API Compatibility:** {{api_compatibility}} -- **Database Schema Compatibility:** {{db_compatibility}} -- **UI/UX Consistency:** {{ui_compatibility}} -- **Performance Impact:** {{performance_constraints}} - -## Tech Stack Alignment - -[[LLM: Ensure new components align with existing technology choices: - -1. Use existing technology stack as the foundation -2. Only introduce new technologies if absolutely necessary -3. Justify any new additions with clear rationale -4. Ensure version compatibility with existing dependencies - -Present complete tech stack alignment and apply `tasks#advanced-elicitation` protocol]] - -### Existing Technology Stack - -[[LLM: Document the current stack that must be maintained or integrated with]] - -| Category | Current Technology | Version | Usage in Enhancement | Notes | -| :----------------- | :----------------- | :---------- | :------------------- | :-------- | -| **Language** | {{language}} | {{version}} | {{usage}} | {{notes}} | -| **Runtime** | {{runtime}} | {{version}} | {{usage}} | {{notes}} | -| **Framework** | {{framework}} | {{version}} | {{usage}} | {{notes}} | -| **Database** | {{database}} | {{version}} | {{usage}} | {{notes}} | -| **API Style** | {{api_style}} | {{version}} | {{usage}} | {{notes}} | -| **Authentication** | {{auth}} | {{version}} | {{usage}} | {{notes}} | -| **Testing** | {{test_framework}} | {{version}} | {{usage}} | {{notes}} | -| **Build Tool** | {{build_tool}} | {{version}} | {{usage}} | {{notes}} | - -### New Technology Additions - -[[LLM: Only include if new technologies are required for the enhancement]] - -^^CONDITION: has_new_tech^^ - -| Technology | Version | Purpose | Rationale | Integration Method | -| :----------- | :---------- | :---------- | :------------ | :----------------- | -| {{new_tech}} | {{version}} | {{purpose}} | {{rationale}} | {{integration}} | - -^^/CONDITION: has_new_tech^^ - -## Data Models and Schema Changes - -[[LLM: Define new data models and how they integrate with existing schema: - -1. Identify new entities required for the enhancement -2. Define relationships with existing data models -3. Plan database schema changes (additions, modifications) -4. Ensure backward compatibility - -Present data model changes and apply `tasks#advanced-elicitation` protocol]] - -### New Data Models - -<> - -### {{model_name}} - -**Purpose:** {{model_purpose}} -**Integration:** {{integration_with_existing}} - -**Key Attributes:** - -- {{attribute_1}}: {{type_1}} - {{description_1}} -- {{attribute_2}}: {{type_2}} - {{description_2}} - -**Relationships:** - -- **With Existing:** {{existing_relationships}} -- **With New:** {{new_relationships}} - -<> - -### Schema Integration Strategy - -**Database Changes Required:** - -- **New Tables:** {{new_tables_list}} -- **Modified Tables:** {{modified_tables_list}} -- **New Indexes:** {{new_indexes_list}} -- **Migration Strategy:** {{migration_approach}} - -**Backward Compatibility:** - -- {{compatibility_measure_1}} -- {{compatibility_measure_2}} - -## Component Architecture - -[[LLM: Define new components and their integration with existing architecture: - -1. Identify new components required for the enhancement -2. Define interfaces with existing components -3. Establish clear boundaries and responsibilities -4. Plan integration points and data flow - -MANDATORY VALIDATION: Before presenting component architecture, confirm: "The new components I'm proposing follow the existing architectural patterns I identified in your codebase: [specific patterns]. The integration interfaces respect your current component structure and communication patterns. Does this match your project's reality?" - -Present component architecture and apply `tasks#advanced-elicitation` protocol]] - -### New Components - -<> - -### {{component_name}} - -**Responsibility:** {{component_description}} -**Integration Points:** {{integration_points}} - -**Key Interfaces:** - -- {{interface_1}} -- {{interface_2}} - -**Dependencies:** - -- **Existing Components:** {{existing_dependencies}} -- **New Components:** {{new_dependencies}} - -**Technology Stack:** {{component_tech_details}} - -<> - -### Component Interaction Diagram - -[[LLM: Create Mermaid diagram showing how new components interact with existing ones]] - -```mermaid -{{component_interaction_diagram}} -``` - -## API Design and Integration - -[[LLM: Define new API endpoints and integration with existing APIs: - -1. Plan new API endpoints required for the enhancement -2. Ensure consistency with existing API patterns -3. Define authentication and authorization integration -4. Plan versioning strategy if needed - -Present API design and apply `tasks#advanced-elicitation` protocol]] - -### New API Endpoints - -^^CONDITION: has_new_api^^ - -**API Integration Strategy:** {{api_integration_strategy}} -**Authentication:** {{auth_integration}} -**Versioning:** {{versioning_approach}} - -<> - -#### {{endpoint_name}} - -- **Method:** {{http_method}} -- **Endpoint:** {{endpoint_path}} -- **Purpose:** {{endpoint_purpose}} -- **Integration:** {{integration_with_existing}} - -**Request:** - -```json -{{request_schema}} -``` - -**Response:** - -```json -{{response_schema}} -``` - -<> - -^^/CONDITION: has_new_api^^ - -## External API Integration - -[[LLM: Document new external API integrations required for the enhancement]] - -^^CONDITION: has_new_external_apis^^ - -<> - -### {{api_name}} API - -- **Purpose:** {{api_purpose}} -- **Documentation:** {{api_docs_url}} -- **Base URL:** {{api_base_url}} -- **Authentication:** {{auth_method}} -- **Integration Method:** {{integration_approach}} - -**Key Endpoints Used:** - -- `{{method}} {{endpoint_path}}` - {{endpoint_purpose}} - -**Error Handling:** {{error_handling_strategy}} - -<> - -^^/CONDITION: has_new_external_apis^^ - -## Source Tree Integration - -[[LLM: Define how new code will integrate with existing project structure: - -1. Follow existing project organization patterns -2. Identify where new files/folders will be placed -3. Ensure consistency with existing naming conventions -4. Plan for minimal disruption to existing structure - -Present integration plan and apply `tasks#advanced-elicitation` protocol]] - -### Existing Project Structure - -[[LLM: Document relevant parts of current structure]] - -```plaintext -{{existing_structure_relevant_parts}} -``` - -### New File Organization - -[[LLM: Show only new additions to existing structure]] - -```plaintext -{{project-root}}/ -├── {{existing_structure_context}} -│ ├── {{new_folder_1}}/ # {{purpose_1}} -│ │ ├── {{new_file_1}} -│ │ └── {{new_file_2}} -│ ├── {{existing_folder}}/ # Existing folder with additions -│ │ ├── {{existing_file}} # Existing file -│ │ └── {{new_file_3}} # New addition -│ └── {{new_folder_2}}/ # {{purpose_2}} -``` - -### Integration Guidelines - -- **File Naming:** {{file_naming_consistency}} -- **Folder Organization:** {{folder_organization_approach}} -- **Import/Export Patterns:** {{import_export_consistency}} - -## Infrastructure and Deployment Integration - -[[LLM: Define how the enhancement will be deployed alongside existing infrastructure: - -1. Use existing deployment pipeline and infrastructure -2. Identify any infrastructure changes needed -3. Plan deployment strategy to minimize risk -4. Define rollback procedures - -Present deployment integration and apply `tasks#advanced-elicitation` protocol]] - -### Existing Infrastructure - -**Current Deployment:** {{existing_deployment_summary}} -**Infrastructure Tools:** {{existing_infrastructure_tools}} -**Environments:** {{existing_environments}} - -### Enhancement Deployment Strategy - -**Deployment Approach:** {{deployment_approach}} -**Infrastructure Changes:** {{infrastructure_changes}} -**Pipeline Integration:** {{pipeline_integration}} - -### Rollback Strategy - -**Rollback Method:** {{rollback_method}} -**Risk Mitigation:** {{risk_mitigation}} -**Monitoring:** {{monitoring_approach}} - -## Coding Standards and Conventions - -[[LLM: Ensure new code follows existing project conventions: - -1. Document existing coding standards from project analysis -2. Identify any enhancement-specific requirements -3. Ensure consistency with existing codebase patterns -4. Define standards for new code organization - -Present coding standards and apply `tasks#advanced-elicitation` protocol]] - -### Existing Standards Compliance - -**Code Style:** {{existing_code_style}} -**Linting Rules:** {{existing_linting}} -**Testing Patterns:** {{existing_test_patterns}} -**Documentation Style:** {{existing_doc_style}} - -### Enhancement-Specific Standards - -[[LLM: Only include if new patterns are needed for the enhancement]] - -<> - -- **{{standard_name}}:** {{standard_description}} - -<> - -### Critical Integration Rules - -- **Existing API Compatibility:** {{api_compatibility_rule}} -- **Database Integration:** {{db_integration_rule}} -- **Error Handling:** {{error_handling_integration}} -- **Logging Consistency:** {{logging_consistency}} - -## Testing Strategy - -[[LLM: Define testing approach for the enhancement: - -1. Integrate with existing test suite -2. Ensure existing functionality remains intact -3. Plan for testing new features -4. Define integration testing approach - -Present testing strategy and apply `tasks#advanced-elicitation` protocol]] - -### Integration with Existing Tests - -**Existing Test Framework:** {{existing_test_framework}} -**Test Organization:** {{existing_test_organization}} -**Coverage Requirements:** {{existing_coverage_requirements}} - -### New Testing Requirements - -#### Unit Tests for New Components - -- **Framework:** {{test_framework}} -- **Location:** {{test_location}} -- **Coverage Target:** {{coverage_target}} -- **Integration with Existing:** {{test_integration}} - -#### Integration Tests - -- **Scope:** {{integration_test_scope}} -- **Existing System Verification:** {{existing_system_verification}} -- **New Feature Testing:** {{new_feature_testing}} - -#### Regression Testing - -- **Existing Feature Verification:** {{regression_test_approach}} -- **Automated Regression Suite:** {{automated_regression}} -- **Manual Testing Requirements:** {{manual_testing_requirements}} - -## Security Integration - -[[LLM: Ensure security consistency with existing system: - -1. Follow existing security patterns and tools -2. Ensure new features don't introduce vulnerabilities -3. Maintain existing security posture -4. Define security testing for new components - -Present security integration and apply `tasks#advanced-elicitation` protocol]] - -### Existing Security Measures - -**Authentication:** {{existing_auth}} -**Authorization:** {{existing_authz}} -**Data Protection:** {{existing_data_protection}} -**Security Tools:** {{existing_security_tools}} - -### Enhancement Security Requirements - -**New Security Measures:** {{new_security_measures}} -**Integration Points:** {{security_integration_points}} -**Compliance Requirements:** {{compliance_requirements}} - -### Security Testing - -**Existing Security Tests:** {{existing_security_tests}} -**New Security Test Requirements:** {{new_security_tests}} -**Penetration Testing:** {{pentest_requirements}} - -## Risk Assessment and Mitigation - -[[LLM: Identify and plan for risks specific to brownfield development: - -1. Technical integration risks -2. Deployment and operational risks -3. User impact and compatibility risks -4. Mitigation strategies for each risk - -Present risk assessment and apply `tasks#advanced-elicitation` protocol]] - -### Technical Risks - -<> - -**Risk:** {{risk_description}} -**Impact:** {{impact_level}} -**Likelihood:** {{likelihood}} -**Mitigation:** {{mitigation_strategy}} - -<> - -### Operational Risks - -<> - -**Risk:** {{risk_description}} -**Impact:** {{impact_level}} -**Likelihood:** {{likelihood}} -**Mitigation:** {{mitigation_strategy}} - -<> - -### Monitoring and Alerting - -**Enhanced Monitoring:** {{monitoring_additions}} -**New Alerts:** {{new_alerts}} -**Performance Monitoring:** {{performance_monitoring}} - -## Checklist Results Report - -[[LLM: Execute the architect-checklist and populate results here, focusing on brownfield-specific validation]] - -## Next Steps - -[[LLM: After completing the brownfield architecture: - -1. Review integration points with existing system -2. Begin story implementation with Dev agent -3. Set up deployment pipeline integration -4. Plan rollback and monitoring procedures]] - -### Story Manager Handoff - -[[LLM: Create a brief prompt for Story Manager to work with this brownfield enhancement. Include: - -- Reference to this architecture document -- Key integration requirements validated with user -- Existing system constraints based on actual project analysis -- First story to implement with clear integration checkpoints -- Emphasis on maintaining existing system integrity throughout implementation]] - -### Developer Handoff - -[[LLM: Create a brief prompt for developers starting implementation. Include: - -- Reference to this architecture and existing coding standards analyzed from actual project -- Integration requirements with existing codebase validated with user -- Key technical decisions based on real project constraints -- Existing system compatibility requirements with specific verification steps -- Clear sequencing of implementation to minimize risk to existing functionality]] -==================== END: .bmad-core/templates/brownfield-architecture-tmpl.md ==================== - -==================== START: .bmad-core/templates/brownfield-prd-tmpl.md ==================== -# {{Project Name}} Brownfield Enhancement PRD - -[[LLM: The default path and filename unless specified is docs/prd.md]] - -[[LLM: IMPORTANT - SCOPE ASSESSMENT REQUIRED: - -This PRD is for SIGNIFICANT enhancements to existing projects that require comprehensive planning and multiple stories. Before proceeding: - -1. **Assess Enhancement Complexity**: If this is a simple feature addition or bug fix that could be completed in 1-2 focused development sessions, STOP and recommend: "For simpler changes, consider using the brownfield-create-epic or brownfield-create-story task with the Product Owner instead. This full PRD process is designed for substantial enhancements that require architectural planning and multiple coordinated stories." - -2. **Project Context**: Determine if we're working in an IDE with the project already loaded or if the user needs to provide project information. If project files are available, analyze existing documentation in the docs folder. If insufficient documentation exists, recommend running the document-project task first. - -3. **Deep Assessment Requirement**: You MUST thoroughly analyze the existing project structure, patterns, and constraints before making ANY suggestions. Every recommendation must be grounded in actual project analysis, not assumptions.]] - -## Intro Project Analysis and Context - -[[LLM: Gather comprehensive information about the existing project. This section must be completed before proceeding with requirements. - -CRITICAL: Throughout this analysis, explicitly confirm your understanding with the user. For every assumption you make about the existing project, ask: "Based on my analysis, I understand that [assumption]. Is this correct?" - -Do not proceed with any recommendations until the user has validated your understanding of the existing system.]] - -### Existing Project Overview - -[[LLM: Check if document-project analysis was already performed. If yes, reference that output instead of re-analyzing.]] - -**Analysis Source**: [[LLM: Indicate one of the following: -- Document-project output available at: {{path}} -- IDE-based fresh analysis -- User-provided information -]] - -**Current Project State**: [[LLM: -- If document-project output exists: Extract summary from "High Level Architecture" and "Technical Summary" sections -- Otherwise: Brief description of what the project currently does and its primary purpose -]] - -### Available Documentation Analysis - -[[LLM: -If document-project was run: -- Note: "Document-project analysis available - using existing technical documentation" -- List key documents created by document-project -- Skip the missing documentation check below - -Otherwise, check for existing documentation: -]] - -**Available Documentation**: - -- [ ] Tech Stack Documentation [[LLM: If from document-project, check ✓]] -- [ ] Source Tree/Architecture [[LLM: If from document-project, check ✓]] -- [ ] Coding Standards [[LLM: If from document-project, may be partial]] -- [ ] API Documentation [[LLM: If from document-project, check ✓]] -- [ ] External API Documentation [[LLM: If from document-project, check ✓]] -- [ ] UX/UI Guidelines [[LLM: May not be in document-project]] -- [ ] Technical Debt Documentation [[LLM: If from document-project, check ✓]] -- [ ] Other: \***\*\_\_\_\*\*** - -[[LLM: -- If document-project was already run: "Using existing project analysis from document-project output." -- If critical documentation is missing and no document-project: "I recommend running the document-project task first..." -]] - -### Enhancement Scope Definition - -[[LLM: Work with user to clearly define what type of enhancement this is. This is critical for scoping and approach.]] - -**Enhancement Type**: [[LLM: Determine with user which applies]] - -- [ ] New Feature Addition -- [ ] Major Feature Modification -- [ ] Integration with New Systems -- [ ] Performance/Scalability Improvements -- [ ] UI/UX Overhaul -- [ ] Technology Stack Upgrade -- [ ] Bug Fix and Stability Improvements -- [ ] Other: \***\*\_\_\_\*\*** - -**Enhancement Description**: [[LLM: 2-3 sentences describing what the user wants to add or change]] - -**Impact Assessment**: [[LLM: Assess the scope of impact on existing codebase]] - -- [ ] Minimal Impact (isolated additions) -- [ ] Moderate Impact (some existing code changes) -- [ ] Significant Impact (substantial existing code changes) -- [ ] Major Impact (architectural changes required) - -### Goals and Background Context - -#### Goals - -[[LLM: Bullet list of 1-line desired outcomes this enhancement will deliver if successful]] - -#### Background Context - -[[LLM: 1-2 short paragraphs explaining why this enhancement is needed, what problem it solves, and how it fits with the existing project]] - -### Change Log - -| Change | Date | Version | Description | Author | -| ------ | ---- | ------- | ----------- | ------ | - -## Requirements - -[[LLM: Draft functional and non-functional requirements based on your validated understanding of the existing project. Before presenting requirements, confirm: "These requirements are based on my understanding of your existing system. Please review carefully and confirm they align with your project's reality." Then immediately execute tasks#advanced-elicitation display]] - -### Functional - -[[LLM: Each Requirement will be a bullet markdown with identifier starting with FR]] -@{example: - FR1: The existing Todo List will integrate with the new AI duplicate detection service without breaking current functionality.} - -### Non Functional - -[[LLM: Each Requirement will be a bullet markdown with identifier starting with NFR. Include constraints from existing system]] -@{example: - NFR1: Enhancement must maintain existing performance characteristics and not exceed current memory usage by more than 20%.} - -### Compatibility Requirements - -[[LLM: Critical for brownfield - what must remain compatible]] - -- CR1: [[LLM: Existing API compatibility requirements]] -- CR2: [[LLM: Database schema compatibility requirements]] -- CR3: [[LLM: UI/UX consistency requirements]] -- CR4: [[LLM: Integration compatibility requirements]] - -^^CONDITION: has_ui^^ - -## User Interface Enhancement Goals - -[[LLM: For UI changes, capture how they will integrate with existing UI patterns and design systems]] - -### Integration with Existing UI - -[[LLM: Describe how new UI elements will fit with existing design patterns, style guides, and component libraries]] - -### Modified/New Screens and Views - -[[LLM: List only the screens/views that will be modified or added]] - -### UI Consistency Requirements - -[[LLM: Specific requirements for maintaining visual and interaction consistency with existing application]] - -^^/CONDITION: has_ui^^ - -## Technical Constraints and Integration Requirements - -[[LLM: This section replaces separate architecture documentation. Gather detailed technical constraints from existing project analysis.]] - -### Existing Technology Stack - -[[LLM: -If document-project output available: -- Extract from "Actual Tech Stack" table in High Level Architecture section -- Include version numbers and any noted constraints - -Otherwise, document the current technology stack: -]] - -**Languages**: [[LLM: From document-project or fresh analysis]] -**Frameworks**: [[LLM: From document-project or fresh analysis]] -**Database**: [[LLM: From document-project or fresh analysis]] -**Infrastructure**: [[LLM: From document-project or fresh analysis]] -**External Dependencies**: [[LLM: From document-project "External Services" section or fresh analysis]] - -### Integration Approach - -[[LLM: Define how the enhancement will integrate with existing architecture]] - -**Database Integration Strategy**: [[LLM: How new features will interact with existing database]] -**API Integration Strategy**: [[LLM: How new APIs will integrate with existing API structure]] -**Frontend Integration Strategy**: [[LLM: How new UI components will integrate with existing frontend]] -**Testing Integration Strategy**: [[LLM: How new tests will integrate with existing test suite]] - -### Code Organization and Standards - -[[LLM: Based on existing project analysis, define how new code will fit existing patterns]] - -**File Structure Approach**: [[LLM: How new files will fit existing project structure]] -**Naming Conventions**: [[LLM: Existing naming conventions that must be followed]] -**Coding Standards**: [[LLM: Existing coding standards and linting rules]] -**Documentation Standards**: [[LLM: How new code documentation will match existing patterns]] - -### Deployment and Operations - -[[LLM: How the enhancement fits existing deployment pipeline]] - -**Build Process Integration**: [[LLM: How enhancement builds with existing process]] -**Deployment Strategy**: [[LLM: How enhancement will be deployed alongside existing features]] -**Monitoring and Logging**: [[LLM: How enhancement will integrate with existing monitoring]] -**Configuration Management**: [[LLM: How new configuration will integrate with existing config]] - -### Risk Assessment and Mitigation - -[[LLM: -If document-project output available: -- Reference "Technical Debt and Known Issues" section -- Include "Workarounds and Gotchas" that might impact enhancement -- Note any identified constraints from "Critical Technical Debt" - -Build risk assessment incorporating existing known issues: -]] - -**Technical Risks**: [[LLM: Include risks from document-project + new enhancement risks]] -**Integration Risks**: [[LLM: Reference integration constraints from document-project]] -**Deployment Risks**: [[LLM: Include deployment gotchas from document-project]] -**Mitigation Strategies**: [[LLM: Address both existing and new risks]] - -## Epic and Story Structure - -[[LLM: For brownfield projects, favor a single comprehensive epic unless the user is clearly requesting multiple unrelated enhancements. Before presenting the epic structure, confirm: "Based on my analysis of your existing project, I believe this enhancement should be structured as [single epic/multiple epics] because [rationale based on actual project analysis]. Does this align with your understanding of the work required?" Then present the epic structure and immediately execute tasks#advanced-elicitation display.]] - -### Epic Approach - -[[LLM: Explain the rationale for epic structure - typically single epic for brownfield unless multiple unrelated features]] - -**Epic Structure Decision**: [[LLM: Single Epic or Multiple Epics with rationale]] - -## Epic 1: {{enhancement_title}} - -[[LLM: Comprehensive epic that delivers the brownfield enhancement while maintaining existing functionality]] - -**Epic Goal**: [[LLM: 2-3 sentences describing the complete enhancement objective and value]] - -**Integration Requirements**: [[LLM: Key integration points with existing system]] - -[[LLM: CRITICAL STORY SEQUENCING FOR BROWNFIELD: - -- Stories must ensure existing functionality remains intact -- Each story should include verification that existing features still work -- Stories should be sequenced to minimize risk to existing system -- Include rollback considerations for each story -- Focus on incremental integration rather than big-bang changes -- Size stories for AI agent execution in existing codebase context -- MANDATORY: Present the complete story sequence and ask: "This story sequence is designed to minimize risk to your existing system. Does this order make sense given your project's architecture and constraints?" -- Stories must be logically sequential with clear dependencies identified -- Each story must deliver value while maintaining system integrity]] - -<> - -### Story 1.{{story_number}} {{story_title}} - -As a {{user_type}}, -I want {{action}}, -so that {{benefit}}. - -#### Acceptance Criteria - -[[LLM: Define criteria that include both new functionality and existing system integrity]] - -<> - -- {{criterion number}}: {{criteria}} - -<> - -#### Integration Verification - -[[LLM: Specific verification steps to ensure existing functionality remains intact]] - -- IV1: [[LLM: Existing functionality verification requirement]] -- IV2: [[LLM: Integration point verification requirement]] -- IV3: [[LLM: Performance impact verification requirement]] - -<> -==================== END: .bmad-core/templates/brownfield-prd-tmpl.md ==================== - -==================== START: .bmad-core/templates/competitor-analysis-tmpl.md ==================== -# Competitive Analysis Report: {{Project/Product Name}} - -[[LLM: The default path and filename unless specified is docs/competitor-analysis.md]] - -[[LLM: This template guides comprehensive competitor analysis. Start by understanding the user's competitive intelligence needs and strategic objectives. Help them identify and prioritize competitors before diving into detailed analysis.]] - -## Executive Summary - -{{Provide high-level competitive insights, main threats and opportunities, and recommended strategic actions. Write this section LAST after completing all analysis.}} - -## Analysis Scope & Methodology - -### Analysis Purpose - -{{Define the primary purpose: - -- New market entry assessment -- Product positioning strategy -- Feature gap analysis -- Pricing strategy development -- Partnership/acquisition targets -- Competitive threat assessment}} - -### Competitor Categories Analyzed - -{{List categories included: - -- Direct Competitors: Same product/service, same target market -- Indirect Competitors: Different product, same need/problem -- Potential Competitors: Could enter market easily -- Substitute Products: Alternative solutions -- Aspirational Competitors: Best-in-class examples}} - -### Research Methodology - -{{Describe approach: - -- Information sources used -- Analysis timeframe -- Confidence levels -- Limitations}} - -## Competitive Landscape Overview - -### Market Structure - -{{Describe the competitive environment: - -- Number of active competitors -- Market concentration (fragmented/consolidated) -- Competitive dynamics -- Recent market entries/exits}} - -### Competitor Prioritization Matrix - -[[LLM: Help categorize competitors by market share and strategic threat level]] - -{{Create a 2x2 matrix: - -- Priority 1 (Core Competitors): High Market Share + High Threat -- Priority 2 (Emerging Threats): Low Market Share + High Threat -- Priority 3 (Established Players): High Market Share + Low Threat -- Priority 4 (Monitor Only): Low Market Share + Low Threat}} - -## Individual Competitor Profiles - -[[LLM: Create detailed profiles for each Priority 1 and Priority 2 competitor. For Priority 3 and 4, create condensed profiles.]] - -### {{Competitor Name}} - Priority {{1/2/3/4}} - -#### Company Overview - -- **Founded:** {{Year, founders}} -- **Headquarters:** {{Location}} -- **Company Size:** {{Employees, revenue if known}} -- **Funding:** {{Total raised, key investors}} -- **Leadership:** {{Key executives}} - -#### Business Model & Strategy - -- **Revenue Model:** {{How they make money}} -- **Target Market:** {{Primary customer segments}} -- **Value Proposition:** {{Core value promise}} -- **Go-to-Market Strategy:** {{Sales and marketing approach}} -- **Strategic Focus:** {{Current priorities}} - -#### Product/Service Analysis - -- **Core Offerings:** {{Main products/services}} -- **Key Features:** {{Standout capabilities}} -- **User Experience:** {{UX strengths/weaknesses}} -- **Technology Stack:** {{If relevant/known}} -- **Pricing:** {{Model and price points}} - -#### Strengths & Weaknesses - -**Strengths:** - -- {{Strength 1}} -- {{Strength 2}} -- {{Strength 3}} - -**Weaknesses:** - -- {{Weakness 1}} -- {{Weakness 2}} -- {{Weakness 3}} - -#### Market Position & Performance - -- **Market Share:** {{Estimate if available}} -- **Customer Base:** {{Size, notable clients}} -- **Growth Trajectory:** {{Trending up/down/stable}} -- **Recent Developments:** {{Key news, releases}} - -<> - -## Comparative Analysis - -### Feature Comparison Matrix - -[[LLM: Create a detailed comparison table of key features across competitors]] - -| Feature Category | {{Your Company}} | {{Competitor 1}} | {{Competitor 2}} | {{Competitor 3}} | -| --------------------------- | ------------------- | ------------------- | ------------------- | ------------------- | -| **Core Functionality** | -| Feature A | {{✓/✗/Partial}} | {{✓/✗/Partial}} | {{✓/✗/Partial}} | {{✓/✗/Partial}} | -| Feature B | {{✓/✗/Partial}} | {{✓/✗/Partial}} | {{✓/✗/Partial}} | {{✓/✗/Partial}} | -| **User Experience** | -| Mobile App | {{Rating/Status}} | {{Rating/Status}} | {{Rating/Status}} | {{Rating/Status}} | -| Onboarding Time | {{Time}} | {{Time}} | {{Time}} | {{Time}} | -| **Integration & Ecosystem** | -| API Availability | {{Yes/No/Limited}} | {{Yes/No/Limited}} | {{Yes/No/Limited}} | {{Yes/No/Limited}} | -| Third-party Integrations | {{Number/Key ones}} | {{Number/Key ones}} | {{Number/Key ones}} | {{Number/Key ones}} | -| **Pricing & Plans** | -| Starting Price | {{$X}} | {{$X}} | {{$X}} | {{$X}} | -| Free Tier | {{Yes/No}} | {{Yes/No}} | {{Yes/No}} | {{Yes/No}} | - -### SWOT Comparison - -[[LLM: Create SWOT analysis for your solution vs. top competitors]] - -#### Your Solution - -- **Strengths:** {{List key strengths}} -- **Weaknesses:** {{List key weaknesses}} -- **Opportunities:** {{List opportunities}} -- **Threats:** {{List threats}} - -#### vs. {{Main Competitor}} - -- **Competitive Advantages:** {{Where you're stronger}} -- **Competitive Disadvantages:** {{Where they're stronger}} -- **Differentiation Opportunities:** {{How to stand out}} - -### Positioning Map - -[[LLM: Describe competitor positions on key dimensions]] - -{{Create a positioning description using 2 key dimensions relevant to the market, such as: - -- Price vs. Features -- Ease of Use vs. Power -- Specialization vs. Breadth -- Self-Serve vs. High-Touch}} - -## Strategic Analysis - -### Competitive Advantages Assessment - -#### Sustainable Advantages - -{{Identify moats and defensible positions: - -- Network effects -- Switching costs -- Brand strength -- Technology barriers -- Regulatory advantages}} - -#### Vulnerable Points - -{{Where competitors could be challenged: - -- Weak customer segments -- Missing features -- Poor user experience -- High prices -- Limited geographic presence}} - -### Blue Ocean Opportunities - -[[LLM: Identify uncontested market spaces]] - -{{List opportunities to create new market space: - -- Underserved segments -- Unaddressed use cases -- New business models -- Geographic expansion -- Different value propositions}} - -## Strategic Recommendations - -### Differentiation Strategy - -{{How to position against competitors: - -- Unique value propositions to emphasize -- Features to prioritize -- Segments to target -- Messaging and positioning}} - -### Competitive Response Planning - -#### Offensive Strategies - -{{How to gain market share: - -- Target competitor weaknesses -- Win competitive deals -- Capture their customers}} - -#### Defensive Strategies - -{{How to protect your position: - -- Strengthen vulnerable areas -- Build switching costs -- Deepen customer relationships}} - -### Partnership & Ecosystem Strategy - -{{Potential collaboration opportunities: - -- Complementary players -- Channel partners -- Technology integrations -- Strategic alliances}} - -## Monitoring & Intelligence Plan - -### Key Competitors to Track - -{{Priority list with rationale}} - -### Monitoring Metrics - -{{What to track: - -- Product updates -- Pricing changes -- Customer wins/losses -- Funding/M&A activity -- Market messaging}} - -### Intelligence Sources - -{{Where to gather ongoing intelligence: - -- Company websites/blogs -- Customer reviews -- Industry reports -- Social media -- Patent filings}} - -### Update Cadence - -{{Recommended review schedule: - -- Weekly: {{What to check}} -- Monthly: {{What to review}} -- Quarterly: {{Deep analysis}}}} - ---- - -[[LLM: After completing the document, offer advanced elicitation with these custom options for competitive analysis: - -**Competitive Analysis Elicitation Actions** 0. Deep dive on a specific competitor's strategy - -1. Analyze competitive dynamics in a specific segment -2. War game competitive responses to your moves -3. Explore partnership vs. competition scenarios -4. Stress test differentiation claims -5. Analyze disruption potential (yours or theirs) -6. Compare to competition in adjacent markets -7. Generate win/loss analysis insights -8. If only we had known about [competitor X's plan]... -9. Proceed to next section - -These replace the standard elicitation options when working on competitive analysis documents.]] -==================== END: .bmad-core/templates/competitor-analysis-tmpl.md ==================== - -==================== START: .bmad-core/templates/front-end-architecture-tmpl.md ==================== -# {{Project Name}} Frontend Architecture Document - -[[LLM: The default path and filename unless specified is docs/ui-architecture.md]] - -[[LLM: Review provided documents including PRD, UX-UI Specification, and main Architecture Document. Focus on extracting technical implementation details needed for AI frontend tools and developer agents. Ask the user for any of these documents if you are unable to locate and were not provided.]] - -## Template and Framework Selection - -[[LLM: Before proceeding with frontend architecture design, check if the project is using a frontend starter template or existing codebase: - -1. Review the PRD, main architecture document, and brainstorming brief for mentions of: - - - Frontend starter templates (e.g., Create React App, Next.js, Vite, Vue CLI, Angular CLI, etc.) - - UI kit or component library starters - - Existing frontend projects being used as a foundation - - Admin dashboard templates or other specialized starters - - Design system implementations - -2. If a frontend starter template or existing project is mentioned: - - - Ask the user to provide access via one of these methods: - - Link to the starter template documentation - - Upload/attach the project files (for small projects) - - Share a link to the project repository - - Analyze the starter/existing project to understand: - - Pre-installed dependencies and versions - - Folder structure and file organization - - Built-in components and utilities - - Styling approach (CSS modules, styled-components, Tailwind, etc.) - - State management setup (if any) - - Routing configuration - - Testing setup and patterns - - Build and development scripts - -- Use this analysis to ensure your frontend architecture aligns with the starter's patterns - -3. If no frontend starter is mentioned but this is a new UI, ensure we know what the ui language and framework is: - - - Based on the framework choice, suggest appropriate starters: - - React: Create React App, Next.js, Vite + React - - Vue: Vue CLI, Nuxt.js, Vite + Vue - - Angular: Angular CLI - - Or suggest popular UI templates if applicable - - Explain benefits specific to frontend development - -4. If the user confirms no starter template will be used: - - Note that all tooling, bundling, and configuration will need manual setup - - Proceed with frontend architecture from scratch - -Document the starter template decision and any constraints it imposes before proceeding.]] - -### Change Log - -[[LLM: Track document versions and changes]] - -| Date | Version | Description | Author | -| :--- | :------ | :---------- | :----- | - -## Frontend Tech Stack - -[[LLM: Extract from main architecture's Technology Stack Table. This section MUST remain synchronized with the main architecture document. After presenting this section, apply `tasks#advanced-elicitation` protocol]] - -### Technology Stack Table - -| Category | Technology | Version | Purpose | Rationale | -| :-------------------- | :------------------- | :---------- | :---------- | :------------- | -| **Framework** | {{framework}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **UI Library** | {{ui_library}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **State Management** | {{state_management}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **Routing** | {{routing_library}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **Build Tool** | {{build_tool}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **Styling** | {{styling_solution}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **Testing** | {{test_framework}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **Component Library** | {{component_lib}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **Form Handling** | {{form_library}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **Animation** | {{animation_lib}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **Dev Tools** | {{dev_tools}} | {{version}} | {{purpose}} | {{why_chosen}} | - -[[LLM: Fill in appropriate technology choices based on the selected framework and project requirements.]] - -## Project Structure - -[[LLM: Define exact directory structure for AI tools based on the chosen framework. Be specific about where each type of file goes. Generate a structure that follows the framework's best practices and conventions. After presenting this section, apply `tasks#advanced-elicitation` protocol]] - -## Component Standards - -[[LLM: Define exact patterns for component creation based on the chosen framework. After presenting this section, apply `tasks#advanced-elicitation` protocol]] - -### Component Template - -[[LLM: Generate a minimal but complete component template following the framework's best practices. Include TypeScript types, proper imports, and basic structure.]] - -### Naming Conventions - -[[LLM: Provide naming conventions specific to the chosen framework for components, files, services, state management, and other architectural elements.]] - -## State Management - -[[LLM: Define state management patterns based on the chosen framework. After presenting this section, apply `tasks#advanced-elicitation` protocol]] - -### Store Structure - -[[LLM: Generate the state management directory structure appropriate for the chosen framework and selected state management solution.]] - -### State Management Template - -[[LLM: Provide a basic state management template/example following the framework's recommended patterns. Include TypeScript types and common operations like setting, updating, and clearing state.]] - -## API Integration - -[[LLM: Define API service patterns based on the chosen framework. After presenting this section, apply `tasks#advanced-elicitation` protocol]] - -### Service Template - -[[LLM: Provide an API service template that follows the framework's conventions. Include proper TypeScript types, error handling, and async patterns.]] - -### API Client Configuration - -[[LLM: Show how to configure the HTTP client for the chosen framework, including authentication interceptors/middleware and error handling.]] - -## Routing - -[[LLM: Define routing structure and patterns based on the chosen framework. After presenting this section, apply `tasks#advanced-elicitation` protocol]] - -### Route Configuration - -[[LLM: Provide routing configuration appropriate for the chosen framework. Include protected route patterns, lazy loading where applicable, and authentication guards/middleware.]] - -## Styling Guidelines - -[[LLM: Define styling approach based on the chosen framework. After presenting this section, apply `tasks#advanced-elicitation` protocol]] - -### Styling Approach - -[[LLM: Describe the styling methodology appropriate for the chosen framework (CSS Modules, Styled Components, Tailwind, etc.) and provide basic patterns.]] - -### Global Theme Variables - -[[LLM: Provide a CSS custom properties (CSS variables) theme system that works across all frameworks. Include colors, spacing, typography, shadows, and dark mode support.]] - -## Testing Requirements - -[[LLM: Define minimal testing requirements based on the chosen framework. After presenting this section, apply `tasks#advanced-elicitation` protocol]] - -### Component Test Template - -[[LLM: Provide a basic component test template using the framework's recommended testing library. Include examples of rendering tests, user interaction tests, and mocking.]] - -### Testing Best Practices - -1. **Unit Tests**: Test individual components in isolation -2. **Integration Tests**: Test component interactions -3. **E2E Tests**: Test critical user flows (using Cypress/Playwright) -4. **Coverage Goals**: Aim for 80% code coverage -5. **Test Structure**: Arrange-Act-Assert pattern -6. **Mock External Dependencies**: API calls, routing, state management - -## Environment Configuration - -[[LLM: List required environment variables based on the chosen framework. Show the appropriate format and naming conventions for the framework. After presenting this section, apply `tasks#advanced-elicitation` protocol]] - -## Frontend Developer Standards - -### Critical Coding Rules - -[[LLM: List essential rules that prevent common AI mistakes, including both universal rules and framework-specific ones. After presenting this section, apply `tasks#advanced-elicitation` protocol]] - -### Quick Reference - -[[LLM: Create a framework-specific cheat sheet with: - -- Common commands (dev server, build, test) -- Key import patterns -- File naming conventions -- Project-specific patterns and utilities]] -==================== END: .bmad-core/templates/front-end-architecture-tmpl.md ==================== - -==================== START: .bmad-core/templates/front-end-spec-tmpl.md ==================== -# {{Project Name}} UI/UX Specification - -[[LLM: The default path and filename unless specified is docs/front-end-spec.md]] - -[[LLM: Review provided documents including Project Brief, PRD, and any user research to gather context. Focus on understanding user needs, pain points, and desired outcomes before beginning the specification.]] - -## Introduction - -[[LLM: Establish the document's purpose and scope. Keep the content below but ensure project name is properly substituted.]] - -This document defines the user experience goals, information architecture, user flows, and visual design specifications for {{Project Name}}'s user interface. It serves as the foundation for visual design and frontend development, ensuring a cohesive and user-centered experience. - -### Overall UX Goals & Principles - -[[LLM: Work with the user to establish and document the following. If not already defined, facilitate a discussion to determine: - -1. Target User Personas - elicit details or confirm existing ones from PRD -2. Key Usability Goals - understand what success looks like for users -3. Core Design Principles - establish 3-5 guiding principles - -After presenting this section, apply `tasks#advanced-elicitation` protocol]] - -### Target User Personas - -{{persona_descriptions}} - -@{example: personas} - -- **Power User:** Technical professionals who need advanced features and efficiency -- **Casual User:** Occasional users who prioritize ease of use and clear guidance -- **Administrator:** System managers who need control and oversight capabilities - @{/example} - -### Usability Goals - -{{usability_goals}} - -@{example: usability_goals} - -- Ease of learning: New users can complete core tasks within 5 minutes -- Efficiency of use: Power users can complete frequent tasks with minimal clicks -- Error prevention: Clear validation and confirmation for destructive actions -- Memorability: Infrequent users can return without relearning - @{/example} - -### Design Principles - -{{design_principles}} - -@{example: design_principles} - -1. **Clarity over cleverness** - Prioritize clear communication over aesthetic innovation -2. **Progressive disclosure** - Show only what's needed, when it's needed -3. **Consistent patterns** - Use familiar UI patterns throughout the application -4. **Immediate feedback** - Every action should have a clear, immediate response -5. **Accessible by default** - Design for all users from the start - @{/example} - -### Change Log - -[[LLM: Track document versions and changes]] - -| Date | Version | Description | Author | -| :--- | :------ | :---------- | :----- | - -## Information Architecture (IA) - -[[LLM: Collaborate with the user to create a comprehensive information architecture: - -1. Build a Site Map or Screen Inventory showing all major areas -2. Define the Navigation Structure (primary, secondary, breadcrumbs) -3. Use Mermaid diagrams for visual representation -4. Consider user mental models and expected groupings - -After presenting this section, apply `tasks#advanced-elicitation` protocol]] - -### Site Map / Screen Inventory - -```mermaid -{{sitemap_diagram}} -``` - -@{example: sitemap} - -```mermaid -graph TD - A[Homepage] --> B[Dashboard] - A --> C[Products] - A --> D[Account] - B --> B1[Analytics] - B --> B2[Recent Activity] - C --> C1[Browse] - C --> C2[Search] - C --> C3[Product Details] - D --> D1[Profile] - D --> D2[Settings] - D --> D3[Billing] -``` - -@{/example} - -### Navigation Structure - -**Primary Navigation:** {{primary_nav_description}} - -**Secondary Navigation:** {{secondary_nav_description}} - -**Breadcrumb Strategy:** {{breadcrumb_strategy}} - -## User Flows - -[[LLM: For each critical user task identified in the PRD: - -1. Define the user's goal clearly -2. Map out all steps including decision points -3. Consider edge cases and error states -4. Use Mermaid flow diagrams for clarity -5. Link to external tools (Figma/Miro) if detailed flows exist there - -Create subsections for each major flow. After presenting all flows, apply `tasks#advanced-elicitation` protocol]] - -<> - -### {{flow_name}} - -**User Goal:** {{flow_goal}} - -**Entry Points:** {{entry_points}} - -**Success Criteria:** {{success_criteria}} - -#### Flow Diagram - -```mermaid -{{flow_diagram}} -``` - -**Edge Cases & Error Handling:** - -- {{edge_case_1}} -- {{edge_case_2}} - -**Notes:** {{flow_notes}} -<> - -@{example: user_flow} - -### User Registration - -**User Goal:** Create a new account to access the platform - -**Entry Points:** Homepage CTA, Login page link, Marketing landing pages - -**Success Criteria:** User successfully creates account and reaches dashboard - -#### Flow Diagram - -```mermaid -graph TD - Start[Landing Page] --> Click[Click Sign Up] - Click --> Form[Registration Form] - Form --> Fill[Fill Required Fields] - Fill --> Submit[Submit Form] - Submit --> Validate{Valid?} - Validate -->|No| Error[Show Errors] - Error --> Form - Validate -->|Yes| Verify[Email Verification] - Verify --> Complete[Account Created] - Complete --> Dashboard[Redirect to Dashboard] -``` - -**Edge Cases & Error Handling:** - -- Duplicate email: Show inline error with password recovery option -- Weak password: Real-time feedback on password strength -- Network error: Preserve form data and show retry option - @{/example} - -## Wireframes & Mockups - -[[LLM: Clarify where detailed visual designs will be created (Figma, Sketch, etc.) and how to reference them. If low-fidelity wireframes are needed, offer to help conceptualize layouts for key screens. - -After presenting this section, apply `tasks#advanced-elicitation` protocol]] - -**Primary Design Files:** {{design_tool_link}} - -### Key Screen Layouts - -<> - -#### {{screen_name}} - -**Purpose:** {{screen_purpose}} - -**Key Elements:** - -- {{element_1}} -- {{element_2}} -- {{element_3}} - -**Interaction Notes:** {{interaction_notes}} - -**Design File Reference:** {{specific_frame_link}} -<> - -## Component Library / Design System - -[[LLM: Discuss whether to use an existing design system or create a new one. If creating new, identify foundational components and their key states. Note that detailed technical specs belong in front-end-architecture. - -After presenting this section, apply `tasks#advanced-elicitation` protocol]] - -**Design System Approach:** {{design_system_approach}} - -### Core Components - -<> - -#### {{component_name}} - -**Purpose:** {{component_purpose}} - -**Variants:** {{component_variants}} - -**States:** {{component_states}} - -**Usage Guidelines:** {{usage_guidelines}} -<> - -@{example: component} - -#### Button - -**Purpose:** Primary interaction element for user actions - -**Variants:** Primary, Secondary, Tertiary, Destructive - -**States:** Default, Hover, Active, Disabled, Loading - -**Usage Guidelines:** - -- Use Primary for main CTAs (one per view) -- Secondary for supporting actions -- Destructive only for permanent deletions with confirmation - @{/example} - -## Branding & Style Guide - -[[LLM: Link to existing style guide or define key brand elements. Ensure consistency with company brand guidelines if they exist. - -After presenting this section, apply `tasks#advanced-elicitation` protocol]] - -### Visual Identity - -**Brand Guidelines:** {{brand_guidelines_link}} - -### Color Palette - -| Color Type | Hex Code | Usage | -| :------------ | :------------------ | :------------------------------- | -| **Primary** | {{primary_color}} | {{primary_usage}} | -| **Secondary** | {{secondary_color}} | {{secondary_usage}} | -| **Accent** | {{accent_color}} | {{accent_usage}} | -| **Success** | {{success_color}} | Positive feedback, confirmations | -| **Warning** | {{warning_color}} | Cautions, important notices | -| **Error** | {{error_color}} | Errors, destructive actions | -| **Neutral** | {{neutral_colors}} | Text, borders, backgrounds | - -### Typography - -**Font Families:** - -- **Primary:** {{primary_font}} -- **Secondary:** {{secondary_font}} -- **Monospace:** {{mono_font}} - -**Type Scale:** -| Element | Size | Weight | Line Height | -|:--------|:-----|:-------|:------------| -| H1 | {{h1_size}} | {{h1_weight}} | {{h1_line}} | -| H2 | {{h2_size}} | {{h2_weight}} | {{h2_line}} | -| H3 | {{h3_size}} | {{h3_weight}} | {{h3_line}} | -| Body | {{body_size}} | {{body_weight}} | {{body_line}} | -| Small | {{small_size}} | {{small_weight}} | {{small_line}} | - -### Iconography - -**Icon Library:** {{icon_library}} - -**Usage Guidelines:** {{icon_guidelines}} - -### Spacing & Layout - -**Grid System:** {{grid_system}} - -**Spacing Scale:** {{spacing_scale}} - -## Accessibility Requirements - -[[LLM: Define specific accessibility requirements based on target compliance level and user needs. Be comprehensive but practical. - -After presenting this section, apply `tasks#advanced-elicitation` protocol]] - -### Compliance Target - -**Standard:** {{compliance_standard}} - -### Key Requirements - -**Visual:** - -- Color contrast ratios: {{contrast_requirements}} -- Focus indicators: {{focus_requirements}} -- Text sizing: {{text_requirements}} - -**Interaction:** - -- Keyboard navigation: {{keyboard_requirements}} -- Screen reader support: {{screen_reader_requirements}} -- Touch targets: {{touch_requirements}} - -**Content:** - -- Alternative text: {{alt_text_requirements}} -- Heading structure: {{heading_requirements}} -- Form labels: {{form_requirements}} - -### Testing Strategy - -{{accessibility_testing}} - -## Responsiveness Strategy - -[[LLM: Define breakpoints and adaptation strategies for different device sizes. Consider both technical constraints and user contexts. - -After presenting this section, apply `tasks#advanced-elicitation` protocol]] - -### Breakpoints - -| Breakpoint | Min Width | Max Width | Target Devices | -| :--------- | :-------------- | :-------------- | :------------------ | -| Mobile | {{mobile_min}} | {{mobile_max}} | {{mobile_devices}} | -| Tablet | {{tablet_min}} | {{tablet_max}} | {{tablet_devices}} | -| Desktop | {{desktop_min}} | {{desktop_max}} | {{desktop_devices}} | -| Wide | {{wide_min}} | - | {{wide_devices}} | - -### Adaptation Patterns - -**Layout Changes:** {{layout_adaptations}} - -**Navigation Changes:** {{nav_adaptations}} - -**Content Priority:** {{content_adaptations}} - -**Interaction Changes:** {{interaction_adaptations}} - -## Animation & Micro-interactions - -[[LLM: Define motion design principles and key interactions. Keep performance and accessibility in mind. - -After presenting this section, apply `tasks#advanced-elicitation` protocol]] - -### Motion Principles - -{{motion_principles}} - -### Key Animations - -<> - -- **{{animation_name}}:** {{animation_description}} (Duration: {{duration}}, Easing: {{easing}}) - <> - -## Performance Considerations - -[[LLM: Define performance goals and strategies that impact UX design decisions.]] - -### Performance Goals - -- **Page Load:** {{load_time_goal}} -- **Interaction Response:** {{interaction_goal}} -- **Animation FPS:** {{animation_goal}} - -### Design Strategies - -{{performance_strategies}} - -## Next Steps - -[[LLM: After completing the UI/UX specification: - -1. Recommend review with stakeholders -2. Suggest creating/updating visual designs in design tool -3. Prepare for handoff to Design Architect for frontend architecture -4. Note any open questions or decisions needed]] - -### Immediate Actions - -1. {{next_step_1}} -2. {{next_step_2}} -3. {{next_step_3}} - -### Design Handoff Checklist - -- [ ] All user flows documented -- [ ] Component inventory complete -- [ ] Accessibility requirements defined -- [ ] Responsive strategy clear -- [ ] Brand guidelines incorporated -- [ ] Performance goals established - -## Checklist Results - -[[LLM: If a UI/UX checklist exists, run it against this document and report results here.]] -==================== END: .bmad-core/templates/front-end-spec-tmpl.md ==================== - -==================== START: .bmad-core/templates/fullstack-architecture-tmpl.md ==================== -# {{Project Name}} Fullstack Architecture Document - -[[LLM: The default path and filename unless specified is docs/architecture.md]] - -[[LLM: If available, review any provided relevant documents to gather all relevant context before beginning. At minimum, you should have access to docs/prd.md and docs/front-end-spec.md. Ask the user for any documents you need but cannot locate. This template creates a unified architecture that covers both backend and frontend concerns to guide AI-driven fullstack development.]] - -## Introduction - -[[LLM: This section establishes the document's purpose and scope. Keep the content below but ensure project name is properly substituted. - -After presenting this section, apply `tasks#advanced-elicitation` protocol]] - -This document outlines the complete fullstack architecture for {{Project Name}}, including backend systems, frontend implementation, and their integration. It serves as the single source of truth for AI-driven development, ensuring consistency across the entire technology stack. - -This unified approach combines what would traditionally be separate backend and frontend architecture documents, streamlining the development process for modern fullstack applications where these concerns are increasingly intertwined. - -### Starter Template or Existing Project - -[[LLM: Before proceeding with architecture design, check if the project is based on any starter templates or existing codebases: - -1. Review the PRD and other documents for mentions of: - -- Fullstack starter templates (e.g., T3 Stack, MEAN/MERN starters, Django + React templates) -- Monorepo templates (e.g., Nx, Turborepo starters) -- Platform-specific starters (e.g., Vercel templates, AWS Amplify starters) -- Existing projects being extended or cloned - -2. If starter templates or existing projects are mentioned: - -- Ask the user to provide access (links, repos, or files) -- Analyze to understand pre-configured choices and constraints -- Note any architectural decisions already made -- Identify what can be modified vs what must be retained - -3. If no starter is mentioned but this is greenfield: - -- Suggest appropriate fullstack starters based on tech preferences -- Consider platform-specific options (Vercel, AWS, etc.) -- Let user decide whether to use one - -4. Document the decision and any constraints it imposes - -If none, state "N/A - Greenfield project" - -### Change Log - -[[LLM: Track document versions and changes]] - -| Date | Version | Description | Author | -| :--- | :------ | :---------- | :----- | - -## High Level Architecture - -[[LLM: This section contains multiple subsections that establish the foundation. Present all subsections together, then apply `tasks#advanced-elicitation` protocol to the complete section.]] - -### Technical Summary - -[[LLM: Provide a comprehensive overview (4-6 sentences) covering: - -- Overall architectural style and deployment approach -- Frontend framework and backend technology choices -- Key integration points between frontend and backend -- Infrastructure platform and services -- How this architecture achieves PRD goals]] - -### Platform and Infrastructure Choice - -[[LLM: Based on PRD requirements and technical assumptions, make a platform recommendation: - -1. Consider common patterns (not an exhaustive list, use your own best judgement and search the web as needed for emerging trends): - - - **Vercel + Supabase**: For rapid development with Next.js, built-in auth/storage - - **AWS Full Stack**: For enterprise scale with Lambda, API Gateway, S3, Cognito - - **Azure**: For .NET ecosystems or enterprise Microsoft environments - - **Google Cloud**: For ML/AI heavy applications or Google ecosystem integration - -2. Present 2-3 viable options with clear pros/cons -3. Make a recommendation with rationale -4. Get explicit user confirmation - -Document the choice and key services that will be used.]] - -**Platform:** {{selected_platform}} -**Key Services:** {{core_services_list}} -**Deployment Host and Regions:** {{regions}} - -### Repository Structure - -[[LLM: Define the repository approach based on PRD requirements and platform choice, explain your rationale or ask quetsions to the user if unsure: - -1. For modern fullstack apps, monorepo is often preferred -2. Consider tooling (Nx, Turborepo, Lerna, npm workspaces) -3. Define package/app boundaries -4. Plan for shared code between frontend and backend]] - -**Structure:** {{repo_structure_choice}} -**Monorepo Tool:** {{monorepo_tool_if_applicable}} -**Package Organization:** {{package_strategy}} - -### High Level Architecture Diagram - -[[LLM: Create a Mermaid diagram showing the complete system architecture including: - -- User entry points (web, mobile) -- Frontend application deployment -- API layer (REST/GraphQL) -- Backend services -- Databases and storage -- External integrations -- CDN and caching layers - -Use appropriate diagram type for clarity.]] - -```mermaid -{{architecture_diagram}} -``` - -### Architectural Patterns - -[[LLM: List patterns that will guide both frontend and backend development. Include patterns for: - -- Overall architecture (e.g., Jamstack, Serverless, Microservices) -- Frontend patterns (e.g., Component-based, State management) -- Backend patterns (e.g., Repository, CQRS, Event-driven) -- Integration patterns (e.g., BFF, API Gateway) - -For each pattern, provide recommendation and rationale.]] - -<> - -- **{{pattern_name}}:** {{pattern_description}} - _Rationale:_ {{rationale}} - <> - -@{example: patterns} - -- **Jamstack Architecture:** Static site generation with serverless APIs - _Rationale:_ Optimal performance and scalability for content-heavy applications -- **Component-Based UI:** Reusable React components with TypeScript - _Rationale:_ Maintainability and type safety across large codebases -- **Repository Pattern:** Abstract data access logic - _Rationale:_ Enables testing and future database migration flexibility -- **API Gateway Pattern:** Single entry point for all API calls - _Rationale:_ Centralized auth, rate limiting, and monitoring - @{/example} - -## Tech Stack - -[[LLM: This is the DEFINITIVE technology selection for the entire project. Work with user to finalize all choices. This table is the single source of truth - all development must use these exact versions. - -Key areas to cover: - -- Frontend and backend languages/frameworks -- Databases and caching -- Authentication and authorization -- API approach -- Testing tools for both frontend and backend -- Build and deployment tools -- Monitoring and logging - -Upon render, apply `tasks#advanced-elicitation` display immediately.]] - -### Technology Stack Table - -| Category | Technology | Version | Purpose | Rationale | -| :----------------------- | :---------------- | :---------- | :---------- | :------------- | -| **Frontend Language** | {{fe_language}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **Frontend Framework** | {{fe_framework}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **UI Component Library** | {{ui_library}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **State Management** | {{state_mgmt}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **Backend Language** | {{be_language}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **Backend Framework** | {{be_framework}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **API Style** | {{api_style}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **Database** | {{database}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **Cache** | {{cache}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **File Storage** | {{storage}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **Authentication** | {{auth}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **Frontend Testing** | {{fe_test}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **Backend Testing** | {{be_test}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **E2E Testing** | {{e2e_test}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **Build Tool** | {{build_tool}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **Bundler** | {{bundler}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **IaC Tool** | {{iac_tool}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **CI/CD** | {{cicd}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **Monitoring** | {{monitoring}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **Logging** | {{logging}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **CSS Framework** | {{css_framework}} | {{version}} | {{purpose}} | {{why_chosen}} | - -@{example: tech_stack_rows} -| **Frontend Language** | TypeScript | 5.3.3 | Type-safe frontend development | Strong typing, excellent tooling | -| **Frontend Framework** | Next.js | 14.1.0 | React framework with SSR/SSG | SEO, performance, Vercel integration | -| **Backend Language** | TypeScript | 5.3.3 | Type-safe backend development | Code sharing with frontend | -| **API Style** | REST + tRPC | - | Type-safe API communication | End-to-end type safety | -| **Database** | PostgreSQL | 16.1 | Primary data store | ACID compliance, JSON support | -| **Authentication** | Supabase Auth | 2.39.0 | User authentication | Built-in auth flows, social providers | -@{/example} - -## Data Models - -[[LLM: Define the core data models/entities that will be shared between frontend and backend: - -1. Review PRD requirements and identify key business entities -2. For each model, explain its purpose and relationships -3. Include key attributes and data types -4. Show relationships between models -5. Create TypeScript interfaces that can be shared -6. Discuss design decisions with user - -Create a clear conceptual model before moving to database schema. - -After presenting all data models, apply `tasks#advanced-elicitation` protocol]] - -<> - -### {{model_name}} - -**Purpose:** {{model_purpose}} - -**Key Attributes:** - -- {{attribute_1}}: {{type_1}} - {{description_1}} -- {{attribute_2}}: {{type_2}} - {{description_2}} - -**TypeScript Interface:** - -```typescript -{ - { - model_interface; - } -} -``` - -**Relationships:** - -- {{relationship_1}} -- {{relationship_2}} - <> - -@{example: data_model} - -### User - -**Purpose:** Represents authenticated users in the system - -**Key Attributes:** - -- id: string - Unique identifier -- email: string - User's email address -- name: string - Display name -- role: enum - User permission level -- timestamps: Date - Created and updated times - -**TypeScript Interface:** - -```typescript -interface User { - id: string; - email: string; - name: string; - role: "admin" | "user" | "guest"; - createdAt: Date; - updatedAt: Date; - profile?: UserProfile; -} - -interface UserProfile { - avatarUrl?: string; - bio?: string; - preferences: Record; -} -``` - -**Relationships:** - -- Has many Posts (1:n) -- Has one Profile (1:1) - @{/example} - -## REST API Spec - -[[LLM: Based on the chosen API style from Tech Stack: - -1. If REST API, create an OpenAPI 3.0 specification -2. If GraphQL, provide the GraphQL schema -3. If tRPC, show router definitions -4. Include all endpoints from epics/stories -5. Define request/response schemas based on data models -6. Document authentication requirements -7. Include example requests/responses - -Use appropriate format for the chosen API style. If no API (e.g., static site), skip this section.]] - -^^CONDITION: has_rest_api^^ - -```yaml -openapi: 3.0.0 -info: - title: - '[object Object]': null - version: - '[object Object]': null - description: - '[object Object]': null -servers: - - url: - '[object Object]': null - description: - '[object Object]': null -``` - -^^/CONDITION: has_rest_api^^ - -^^CONDITION: has_graphql_api^^ - -```graphql -# GraphQL Schema -{{graphql_schema}} -``` - -^^/CONDITION: has_graphql_api^^ - -^^CONDITION: has_trpc_api^^ - -```typescript -// tRPC Router Definitions -{ - { - trpc_routers; - } -} -``` - -^^/CONDITION: has_trpc_api^^ - -[[LLM: After presenting the API spec (or noting its absence if not applicable), apply `tasks#advanced-elicitation` protocol]] - -## Components - -[[LLM: Based on the architectural patterns, tech stack, and data models from above: - -1. Identify major logical components/services across the fullstack -2. Consider both frontend and backend components -3. Define clear boundaries and interfaces between components -4. For each component, specify: - -- Primary responsibility -- Key interfaces/APIs exposed -- Dependencies on other components -- Technology specifics based on tech stack choices - -5. Create component diagrams where helpful -6. After presenting all components, apply `tasks#advanced-elicitation` protocol]] - -<> - -### {{component_name}} - -**Responsibility:** {{component_description}} - -**Key Interfaces:** - -- {{interface_1}} -- {{interface_2}} - -**Dependencies:** {{dependencies}} - -**Technology Stack:** {{component_tech_details}} -<> - -### Component Diagrams - -[[LLM: Create Mermaid diagrams to visualize component relationships. Options: - -- C4 Container diagram for high-level view -- Component diagram for detailed internal structure -- Sequence diagrams for complex interactions - Choose the most appropriate for clarity - -After presenting the diagrams, apply `tasks#advanced-elicitation` protocol]] - -## External APIs - -[[LLM: For each external service integration: - -1. Identify APIs needed based on PRD requirements and component design -2. If documentation URLs are unknown, ask user for specifics -3. Document authentication methods and security considerations -4. List specific endpoints that will be used -5. Note any rate limits or usage constraints - -If no external APIs are needed, state this explicitly and skip to next section.]] - -^^CONDITION: has_external_apis^^ - -<> - -### {{api_name}} API - -- **Purpose:** {{api_purpose}} -- **Documentation:** {{api_docs_url}} -- **Base URL(s):** {{api_base_url}} -- **Authentication:** {{auth_method}} -- **Rate Limits:** {{rate_limits}} - -**Key Endpoints Used:** -<> - -- `{{method}} {{endpoint_path}}` - {{endpoint_purpose}} - <> - -**Integration Notes:** {{integration_considerations}} -<> - -@{example: external_api} - -### Stripe API - -- **Purpose:** Payment processing and subscription management -- **Documentation:** https://stripe.com/docs/api -- **Base URL(s):** `https://api.stripe.com/v1` -- **Authentication:** Bearer token with secret key -- **Rate Limits:** 100 requests per second - -**Key Endpoints Used:** - -- `POST /customers` - Create customer profiles -- `POST /payment_intents` - Process payments -- `POST /subscriptions` - Manage subscriptions - @{/example} - -^^/CONDITION: has_external_apis^^ - -[[LLM: After presenting external APIs (or noting their absence), apply `tasks#advanced-elicitation` protocol]] - -## Core Workflows - -[[LLM: Illustrate key system workflows using sequence diagrams: - -1. Identify critical user journeys from PRD -2. Show component interactions including external APIs -3. Include both frontend and backend flows -4. Include error handling paths -5. Document async operations -6. Create both high-level and detailed diagrams as needed - -Focus on workflows that clarify architecture decisions or complex interactions. - -After presenting the workflow diagrams, apply `tasks#advanced-elicitation` protocol]] - -## Database Schema - -[[LLM: Transform the conceptual data models into concrete database schemas: - -1. Use the database type(s) selected in Tech Stack -2. Create schema definitions using appropriate notation -3. Include indexes, constraints, and relationships -4. Consider performance and scalability -5. For NoSQL, show document structures - -Present schema in format appropriate to database type (SQL DDL, JSON schema, etc.) - -After presenting the database schema, apply `tasks#advanced-elicitation` protocol]] - -## Frontend Architecture - -[[LLM: Define frontend-specific architecture details. After each subsection, note if user wants to refine before continuing. - -After presenting this section, apply `tasks#advanced-elicitation` protocol]] - -### Component Architecture - -[[LLM: Define component organization and patterns based on chosen framework.]] - -**Component Organization:** - -```text -{{component_structure}} -``` - -**Component Template:** - -```typescript -{ - { - component_template; - } -} -``` - -### State Management Architecture - -[[LLM: Detail state management approach based on chosen solution.]] - -**State Structure:** - -```typescript -{ - { - state_structure; - } -} -``` - -**State Management Patterns:** - -- {{pattern_1}} -- {{pattern_2}} - -### Routing Architecture - -[[LLM: Define routing structure based on framework choice.]] - -**Route Organization:** - -```text -{{route_structure}} -``` - -**Protected Route Pattern:** - -```typescript -{ - { - protected_route_example; - } -} -``` - -### Frontend Services Layer - -[[LLM: Define how frontend communicates with backend.]] - -**API Client Setup:** - -```typescript -{ - { - api_client_setup; - } -} -``` - -**Service Example:** - -```typescript -{ - { - service_example; - } -} -``` - -## Backend Architecture - -[[LLM: Define backend-specific architecture details. Consider serverless vs traditional server approaches. - -After presenting this section, apply `tasks#advanced-elicitation` protocol]] - -### Service Architecture - -[[LLM: Based on platform choice, define service organization.]] - -^^CONDITION: serverless^^ -**Function Organization:** - -```text - -{{function_structure}} - -``` - -**Function Template:** - -```typescript -{ - { - function_template; - } -} -``` - -^^/CONDITION: serverless^^ - -^^CONDITION: traditional_server^^ -**Controller/Route Organization:** - -```text -{{controller_structure}} -``` - -**Controller Template:** - -```typescript -{ - { - controller_template; - } -} -``` - -^^/CONDITION: traditional_server^^ - -### Database Architecture - -[[LLM: Define database schema and access patterns.]] - -**Schema Design:** - -```sql -{{database_schema}} -``` - -**Data Access Layer:** - -```typescript -{ - { - repository_pattern; - } -} -``` - -### Authentication and Authorization - -[[LLM: Define auth implementation details.]] - -**Auth Flow:** - -```mermaid -{{auth_flow_diagram}} -``` - -**Middleware/Guards:** - -```typescript -{ - { - auth_middleware; - } -} -``` - -## Unified Project Structure - -[[LLM: Create a monorepo structure that accommodates both frontend and backend. Adapt based on chosen tools and frameworks. After presenting, apply `tasks#advanced-elicitation` protocol.]] - -```plaintext -{{project-name}}/ -├── .github/ # CI/CD workflows -│ └── workflows/ -│ ├── ci.yaml -│ └── deploy.yaml -├── apps/ # Application packages -│ ├── web/ # Frontend application -│ │ ├── src/ -│ │ │ ├── components/ # UI components -│ │ │ ├── pages/ # Page components/routes -│ │ │ ├── hooks/ # Custom React hooks -│ │ │ ├── services/ # API client services -│ │ │ ├── stores/ # State management -│ │ │ ├── styles/ # Global styles/themes -│ │ │ └── utils/ # Frontend utilities -│ │ ├── public/ # Static assets -│ │ ├── tests/ # Frontend tests -│ │ └── package.json -│ └── api/ # Backend application -│ ├── src/ -│ │ ├── routes/ # API routes/controllers -│ │ ├── services/ # Business logic -│ │ ├── models/ # Data models -│ │ ├── middleware/ # Express/API middleware -│ │ ├── utils/ # Backend utilities -│ │ └── {{serverless_or_server_entry}} -│ ├── tests/ # Backend tests -│ └── package.json -├── packages/ # Shared packages -│ ├── shared/ # Shared types/utilities -│ │ ├── src/ -│ │ │ ├── types/ # TypeScript interfaces -│ │ │ ├── constants/ # Shared constants -│ │ │ └── utils/ # Shared utilities -│ │ └── package.json -│ ├── ui/ # Shared UI components -│ │ ├── src/ -│ │ └── package.json -│ └── config/ # Shared configuration -│ ├── eslint/ -│ ├── typescript/ -│ └── jest/ -├── infrastructure/ # IaC definitions -│ └── {{iac_structure}} -├── scripts/ # Build/deploy scripts -├── docs/ # Documentation -│ ├── prd.md -│ ├── front-end-spec.md -│ └── fullstack-architecture.md -├── .env.example # Environment template -├── package.json # Root package.json -├── {{monorepo_config}} # Monorepo configuration -└── README.md -``` - -@{example: vercel_structure} -apps/ -├── web/ # Next.js app -│ ├── app/ # App directory (Next.js 14+) -│ ├── components/ -│ └── lib/ -└── api/ # API routes in Next.js or separate -└── pages/api/ # API routes -@{/example} - -## Development Workflow - -[[LLM: Define the development setup and workflow for the fullstack application. - -After presenting this section, apply `tasks#advanced-elicitation` protocol]] - -### Local Development Setup - -**Prerequisites:** - -```bash -{{prerequisites_commands}} -``` - -**Initial Setup:** - -```bash -{{setup_commands}} -``` - -**Development Commands:** - -```bash -# Start all services -{{start_all_command}} - -# Start frontend only -{{start_frontend_command}} - -# Start backend only -{{start_backend_command}} - -# Run tests -{{test_commands}} -``` - -### Environment Configuration - -**Required Environment Variables:** - -```bash -# Frontend (.env.local) -{{frontend_env_vars}} - -# Backend (.env) -{{backend_env_vars}} - -# Shared -{{shared_env_vars}} -``` - -## Deployment Architecture - -[[LLM: Define deployment strategy based on platform choice. After presenting, apply `tasks#advanced-elicitation` protocol.]] - -### Deployment Strategy - -**Frontend Deployment:** - -- **Platform:** {{frontend_deploy_platform}} -- **Build Command:** {{frontend_build_command}} -- **Output Directory:** {{frontend_output_dir}} -- **CDN/Edge:** {{cdn_strategy}} - -**Backend Deployment:** - -- **Platform:** {{backend_deploy_platform}} -- **Build Command:** {{backend_build_command}} -- **Deployment Method:** {{deployment_method}} - -### CI/CD Pipeline - -```yaml -'[object Object]': null -``` - -### Environments - -| Environment | Frontend URL | Backend URL | Purpose | -| :---------- | :----------------- | :----------------- | :--------------------- | -| Development | {{dev_fe_url}} | {{dev_be_url}} | Local development | -| Staging | {{staging_fe_url}} | {{staging_be_url}} | Pre-production testing | -| Production | {{prod_fe_url}} | {{prod_be_url}} | Live environment | - -## Security and Performance - -[[LLM: Define security and performance considerations for the fullstack application. - -After presenting this section, apply `tasks#advanced-elicitation` protocol]] - -### Security Requirements - -**Frontend Security:** - -- CSP Headers: {{csp_policy}} -- XSS Prevention: {{xss_strategy}} -- Secure Storage: {{storage_strategy}} - -**Backend Security:** - -- Input Validation: {{validation_approach}} -- Rate Limiting: {{rate_limit_config}} -- CORS Policy: {{cors_config}} - -**Authentication Security:** - -- Token Storage: {{token_strategy}} -- Session Management: {{session_approach}} -- Password Policy: {{password_requirements}} - -### Performance Optimization - -**Frontend Performance:** - -- Bundle Size Target: {{bundle_size}} -- Loading Strategy: {{loading_approach}} -- Caching Strategy: {{fe_cache_strategy}} - -**Backend Performance:** - -- Response Time Target: {{response_target}} -- Database Optimization: {{db_optimization}} -- Caching Strategy: {{be_cache_strategy}} - -## Testing Strategy - -[[LLM: Define comprehensive testing approach for fullstack application. - -After presenting this section, apply `tasks#advanced-elicitation` protocol]] - -### Testing Pyramid - -```text - - E2E Tests - / \ - Integration Tests - -/ \ - Frontend Unit Backend Unit - -``` - -### Test Organization - -**Frontend Tests:** - -```text - -{{frontend_test_structure}} - -``` - -**Backend Tests:** - -```text - -{{backend_test_structure}} - -``` - -**E2E Tests:** - -```text - -{{e2e_test_structure}} - -``` - -### Test Examples - -**Frontend Component Test:** - -```typescript -{ - { - frontend_test_example; - } -} -``` - -**Backend API Test:** - -```typescript -{ - { - backend_test_example; - } -} -``` - -**E2E Test:** - -```typescript -{ - { - e2e_test_example; - } -} -``` - -## Coding Standards - -[[LLM: Define MINIMAL but CRITICAL standards for AI agents. Focus only on project-specific rules that prevent common mistakes. These will be used by dev agents. - -After presenting this section, apply `tasks#advanced-elicitation` protocol]] - -### Critical Fullstack Rules - -<> - -- **{{rule_name}}:** {{rule_description}} - <> - -@{example: critical_rules} - -- **Type Sharing:** Always define types in packages/shared and import from there -- **API Calls:** Never make direct HTTP calls - use the service layer -- **Environment Variables:** Access only through config objects, never process.env directly -- **Error Handling:** All API routes must use the standard error handler -- **State Updates:** Never mutate state directly - use proper state management patterns - @{/example} - -### Naming Conventions - -| Element | Frontend | Backend | Example | -| :-------------- | :------------------- | :--------- | :------------------ | -| Components | PascalCase | - | `UserProfile.tsx` | -| Hooks | camelCase with 'use' | - | `useAuth.ts` | -| API Routes | - | kebab-case | `/api/user-profile` | -| Database Tables | - | snake_case | `user_profiles` | - -## Error Handling Strategy - -[[LLM: Define unified error handling across frontend and backend. - -After presenting this section, apply `tasks#advanced-elicitation` protocol]] - -### Error Flow - -```mermaid -{{error_flow_diagram}} -``` - -### Error Response Format - -```typescript -interface ApiError { - error: { - code: string; - message: string; - details?: Record; - timestamp: string; - requestId: string; - }; -} -``` - -### Frontend Error Handling - -```typescript -{ - { - frontend_error_handler; - } -} -``` - -### Backend Error Handling - -```typescript -{ - { - backend_error_handler; - } -} -``` - -## Monitoring and Observability - -[[LLM: Define monitoring strategy for fullstack application. - -After presenting this section, apply `tasks#advanced-elicitation` protocol]] - -### Monitoring Stack - -- **Frontend Monitoring:** {{frontend_monitoring}} -- **Backend Monitoring:** {{backend_monitoring}} -- **Error Tracking:** {{error_tracking}} -- **Performance Monitoring:** {{perf_monitoring}} - -### Key Metrics - -**Frontend Metrics:** - -- Core Web Vitals -- JavaScript errors -- API response times -- User interactions - -**Backend Metrics:** - -- Request rate -- Error rate -- Response time -- Database query performance - -## Checklist Results Report - -[[LLM: Before running the checklist, offer to output the full architecture document. Once user confirms, execute the `architect-checklist` and populate results here.]] -==================== END: .bmad-core/templates/fullstack-architecture-tmpl.md ==================== - -==================== START: .bmad-core/templates/market-research-tmpl.md ==================== -# Market Research Report: {{Project/Product Name}} - -[[LLM: The default path and filename unless specified is docs/market-research.md]] - -[[LLM: This template guides the creation of a comprehensive market research report. Begin by understanding what market insights the user needs and why. Work through each section systematically, using the appropriate analytical frameworks based on the research objectives.]] - -## Executive Summary - -{{Provide a high-level overview of key findings, market opportunity assessment, and strategic recommendations. Write this section LAST after completing all other sections.}} - -## Research Objectives & Methodology - -### Research Objectives - -{{List the primary objectives of this market research: - -- What decisions will this research inform? -- What specific questions need to be answered? -- What are the success criteria for this research?}} - -### Research Methodology - -{{Describe the research approach: - -- Data sources used (primary/secondary) -- Analysis frameworks applied -- Data collection timeframe -- Limitations and assumptions}} - -## Market Overview - -### Market Definition - -{{Define the market being analyzed: - -- Product/service category -- Geographic scope -- Customer segments included -- Value chain position}} - -### Market Size & Growth - -[[LLM: Guide through TAM, SAM, SOM calculations with clear assumptions. Use one or more approaches: - -- Top-down: Start with industry data, narrow down -- Bottom-up: Build from customer/unit economics -- Value theory: Based on value provided vs. alternatives]] - -#### Total Addressable Market (TAM) - -{{Calculate and explain the total market opportunity}} - -#### Serviceable Addressable Market (SAM) - -{{Define the portion of TAM you can realistically reach}} - -#### Serviceable Obtainable Market (SOM) - -{{Estimate the portion you can realistically capture}} - -### Market Trends & Drivers - -[[LLM: Analyze key trends shaping the market using appropriate frameworks like PESTEL]] - -#### Key Market Trends - -{{List and explain 3-5 major trends: - -- Trend 1: Description and impact -- Trend 2: Description and impact -- etc.}} - -#### Growth Drivers - -{{Identify primary factors driving market growth}} - -#### Market Inhibitors - -{{Identify factors constraining market growth}} - -## Customer Analysis - -### Target Segment Profiles - -[[LLM: For each segment, create detailed profiles including demographics/firmographics, psychographics, behaviors, needs, and willingness to pay]] - -#### Segment 1: {{Segment Name}} - -- **Description:** {{Brief overview}} -- **Size:** {{Number of customers/market value}} -- **Characteristics:** {{Key demographics/firmographics}} -- **Needs & Pain Points:** {{Primary problems they face}} -- **Buying Process:** {{How they make purchasing decisions}} -- **Willingness to Pay:** {{Price sensitivity and value perception}} - -<> - -### Jobs-to-be-Done Analysis - -[[LLM: Uncover what customers are really trying to accomplish]] - -#### Functional Jobs - -{{List practical tasks and objectives customers need to complete}} - -#### Emotional Jobs - -{{Describe feelings and perceptions customers seek}} - -#### Social Jobs - -{{Explain how customers want to be perceived by others}} - -### Customer Journey Mapping - -[[LLM: Map the end-to-end customer experience for primary segments]] - -{{For primary customer segment: - -1. **Awareness:** How they discover solutions -2. **Consideration:** Evaluation criteria and process -3. **Purchase:** Decision triggers and barriers -4. **Onboarding:** Initial experience expectations -5. **Usage:** Ongoing interaction patterns -6. **Advocacy:** Referral and expansion behaviors}} - -## Competitive Landscape - -### Market Structure - -{{Describe the overall competitive environment: - -- Number of competitors -- Market concentration -- Competitive intensity}} - -### Major Players Analysis - -{{For top 3-5 competitors: - -- Company name and brief description -- Market share estimate -- Key strengths and weaknesses -- Target customer focus -- Pricing strategy}} - -### Competitive Positioning - -{{Analyze how competitors are positioned: - -- Value propositions -- Differentiation strategies -- Market gaps and opportunities}} - -## Industry Analysis - -### Porter's Five Forces Assessment - -[[LLM: Analyze each force with specific evidence and implications]] - -#### Supplier Power: {{Low/Medium/High}} - -{{Analysis and implications}} - -#### Buyer Power: {{Low/Medium/High}} - -{{Analysis and implications}} - -#### Competitive Rivalry: {{Low/Medium/High}} - -{{Analysis and implications}} - -#### Threat of New Entry: {{Low/Medium/High}} - -{{Analysis and implications}} - -#### Threat of Substitutes: {{Low/Medium/High}} - -{{Analysis and implications}} - -### Technology Adoption Lifecycle Stage - -{{Identify where the market is in the adoption curve: - -- Current stage and evidence -- Implications for strategy -- Expected progression timeline}} - -## Opportunity Assessment - -### Market Opportunities - -[[LLM: Identify specific opportunities based on the analysis]] - -#### Opportunity 1: {{Name}} - -- **Description:** {{What is the opportunity?}} -- **Size/Potential:** {{Quantify if possible}} -- **Requirements:** {{What's needed to capture it?}} -- **Risks:** {{Key challenges or barriers}} - -<> - -### Strategic Recommendations - -#### Go-to-Market Strategy - -{{Recommend approach for market entry/expansion: - -- Target segment prioritization -- Positioning strategy -- Channel strategy -- Partnership opportunities}} - -#### Pricing Strategy - -{{Based on willingness to pay analysis and competitive landscape: - -- Recommended pricing model -- Price points/ranges -- Value metric -- Competitive positioning}} - -#### Risk Mitigation - -{{Key risks and mitigation strategies: - -- Market risks -- Competitive risks -- Execution risks -- Regulatory/compliance risks}} - -## Appendices - -### A. Data Sources - -{{List all sources used in the research}} - -### B. Detailed Calculations - -{{Include any complex calculations or models}} - -### C. Additional Analysis - -{{Any supplementary analysis not included in main body}} - ---- - -[[LLM: After completing the document, offer advanced elicitation with these custom options for market research: - -**Market Research Elicitation Actions** 0. Expand market sizing calculations with sensitivity analysis - -1. Deep dive into a specific customer segment -2. Analyze an emerging market trend in detail -3. Compare this market to an analogous market -4. Stress test market assumptions -5. Explore adjacent market opportunities -6. Challenge market definition and boundaries -7. Generate strategic scenarios (best/base/worst case) -8. If only we had considered [X market factor]... -9. Proceed to next section - -These replace the standard elicitation options when working on market research documents.]] -==================== END: .bmad-core/templates/market-research-tmpl.md ==================== - -==================== START: .bmad-core/templates/prd-tmpl.md ==================== -# {{Project Name}} Product Requirements Document (PRD) - -[[LLM: The default path and filename unless specified is docs/prd.md]] - -[[LLM: If available, review any provided document or ask if any are optionally available: Project Brief]] - -## Goals and Background Context - -[[LLM: Populate the 2 child sections based on what we have received from user description or the provided brief. Allow user to review the 2 sections and offer changes before proceeding]] - -### Goals - -[[LLM: Bullet list of 1 line desired outcomes the PRD will deliver if successful - user and project desires]] - -### Background Context - -[[LLM: 1-2 short paragraphs summarizing the background context, such as what we learned in the brief without being redundant with the goals, what and why this solves a problem, what the current landscape or need is etc...]] - -### Change Log - -[[LLM: Track document versions and changes]] - -| Date | Version | Description | Author | -| :--- | :------ | :---------- | :----- | - -## Requirements - -[[LLM: Draft the list of functional and non functional requirements under the two child sections, and immediately execute .bmad-core/tasks/advanced-elicitation.md display]] - -### Functional - -[[LLM: Each Requirement will be a bullet markdown and an identifier sequence starting with FR`.]] -@{example: - FR6: The Todo List uses AI to detect and warn against adding potentially duplicate todo items that are worded differently.} - -### Non Functional - -[[LLM: Each Requirement will be a bullet markdown and an identifier sequence starting with NFR`.]] -@{example: - NFR1: AWS service usage **must** aim to stay within free-tier limits where feasible.} - -^^CONDITION: has_ui^^ - -## User Interface Design Goals - -[[LLM: Capture high-level UI/UX vision to guide Design Architect and to inform story creation. Steps: - -1. Pre-fill all subsections with educated guesses based on project context -2. Present the complete rendered section to user -3. Clearly let the user know where assumptions were made -4. Ask targeted questions for unclear/missing elements or areas needing more specification -5. This is NOT detailed UI spec - focus on product vision and user goals -6. After section completion, immediately apply `.bmad-core/tasks/advanced-elicitation.md` protocol]] - -### Overall UX Vision - -### Key Interaction Paradigms - -### Core Screens and Views - -[[LLM: From a product perspective, what are the most critical screens or views necessary to deliver the the PRD values and goals? This is meant to be Conceptual High Level to Drive Rough Epic or User Stories]] - -@{example} - -- Login Screen -- Main Dashboard -- Item Detail Page -- Settings Page - @{/example} - -### Accessibility: { None, WCAG, etc } - -### Branding - -[[LLM: Any known branding elements or style guides that must be incorporated?]] - -@{example} - -- Replicate the look and feel of early 1900s black and white cinema, including animated effects replicating film damage or projector glitches during page or state transitions. -- Attached is the full color pallet and tokens for our corporate branding. - @{/example} - -### Target Device and Platforms - -@{example} -"Web Responsive, and all mobile platforms", "IPhone Only", "ASCII Windows Desktop" -@{/example} - -^^/CONDITION: has_ui^^ - -## Technical Assumptions - -[[LLM: Gather technical decisions that will guide the Architect. Steps: - -1. Check if `.bmad-core/data/technical-preferences.yaml` or an attached `technical-preferences` file exists - use it to pre-populate choices -2. Ask user about: languages, frameworks, starter templates, libraries, APIs, deployment targets -3. For unknowns, offer guidance based on project goals and MVP scope -4. Document ALL technical choices with rationale (why this choice fits the project) -5. These become constraints for the Architect - be specific and complete -6. After section completion, apply `.bmad-core/tasks/advanced-elicitation.md` protocol.]] - -### Repository Structure: { Monorepo, Polyrepo, etc...} - -### Service Architecture - -[[LLM: CRITICAL DECISION - Document the high-level service architecture (e.g., Monolith, Microservices, Serverless functions within a Monorepo).]] - -### Testing requirements - -[[LLM: CRITICAL DECISION - Document the testing requirements, unit only, integration, e2e, manual, need for manual testing convenience methods).]] - -### Additional Technical Assumptions and Requests - -[[LLM: Throughout the entire process of drafting this document, if any other technical assumptions are raised or discovered appropriate for the architect, add them here as additional bulleted items]] - -## Epics - -[[LLM: First, present a high-level list of all epics for user approval, the epic_list and immediately execute .bmad-core/tasks/advanced-elicitation.md display. Each epic should have a title and a short (1 sentence) goal statement. This allows the user to review the overall structure before diving into details. - -CRITICAL: Epics MUST be logically sequential following agile best practices: - -- Each epic should deliver a significant, end-to-end, fully deployable increment of testable functionality -- Epic 1 must establish foundational project infrastructure (app setup, Git, CI/CD, core services) unless we are adding new functionality to an existing app, while also delivering an initial piece of functionality, even as simple as a health-check route or display of a simple canary page - remember this when we produce the stories for the first epic! -- Each subsequent epic builds upon previous epics' functionality delivering major blocks of functionality that provide tangible value to users or business when deployed -- Not every project needs multiple epics, an epic needs to deliver value. For example, an API completed can deliver value even if a UI is not complete and planned for a separate epic. -- Err on the side of less epics, but let the user know your rationale and offer options for splitting them if it seems some are too large or focused on disparate things. -- Cross Cutting Concerns should flow through epics and stories and not be final stories. For example, adding a logging framework as a last story of an epic, or at the end of a project as a final epic or story would be terrible as we would not have logging from the beginning.]] - -<> - -- Epic{{epic_number}} {{epic_title}}: {{short_goal}} - -<> - -@{example: epic_list} - -1. Foundation & Core Infrastructure: Establish project setup, authentication, and basic user management -2. Core Business Entities: Create and manage primary domain objects with CRUD operations -3. User Workflows & Interactions: Enable key user journeys and business processes -4. Reporting & Analytics: Provide insights and data visualization for users - -@{/example} - -[[LLM: After the epic list is approved, present each `epic_details` with all its stories and acceptance criteria as a complete review unit and immediately execute .bmad-core/tasks/advanced-elicitation.md display, before moving on to the next epic.]] - -<> - -## Epic {{epic_number}} {{epic_title}} - -{{epic_goal}} [[LLM: Expanded goal - 2-3 sentences describing the objective and value all the stories will achieve]] - -[[LLM: CRITICAL STORY SEQUENCING REQUIREMENTS: - -- Stories within each epic MUST be logically sequential -- Each story should be a "vertical slice" delivering complete functionality aside from early enabler stories for project foundation -- No story should depend on work from a later story or epic -- Identify and note any direct prerequisite stories -- Focus on "what" and "why" not "how" (leave technical implementation to Architect) yet be precise enough to support a logical sequential order of operations from story to story. -- Ensure each story delivers clear user or business value, try to avoid enablers and build them into stories that deliver value. -- Size stories for AI agent execution: Each story must be completable by a single AI agent in one focused session without context overflow -- Think "junior developer working for 2-4 hours" - stories must be small, focused, and self-contained -- If a story seems complex, break it down further as long as it can deliver a vertical slice -- Each story should result in working, testable code before the agent's context window fills]] - -<> - -### Story {{epic_number}}.{{story_number}} {{story_title}} - -As a {{user_type}}, -I want {{action}}, -so that {{benefit}}. - -#### Acceptance Criteria - -[[LLM: Define clear, comprehensive, and testable acceptance criteria that: - -- Precisely define what "done" means from a functional perspective -- Are unambiguous and serve as basis for verification -- Include any critical non-functional requirements from the PRD -- Consider local testability for backend/data components -- Specify UI/UX requirements and framework adherence where applicable -- Avoid cross-cutting concerns that should be in other stories or PRD sections]] - -<> - -- {{criterion number}}: {{criteria}} - -<> -<> -<> - -## Checklist Results Report - -[[LLM: Before running the checklist and drafting the prompts, offer to output the full updated PRD. If outputting it, confirm with the user that you will be proceeding to run the checklist and produce the report. Once the user confirms, execute the `pm-checklist` and populate the results in this section.]] - -## Next Steps - -### Design Architect Prompt - -[[LLM: This section will contain the prompt for the Design Architect, keep it short and to the point to initiate create architecture mode using this document as input.]] - -### Architect Prompt - -[[LLM: This section will contain the prompt for the Architect, keep it short and to the point to initiate create architecture mode using this document as input.]] -==================== END: .bmad-core/templates/prd-tmpl.md ==================== - -==================== START: .bmad-core/templates/prd-tmpl2.yaml ==================== +==================== START: .bmad-core/templates/architecture-tmpl.yaml ==================== +template: + id: architecture-template-v2 + name: Architecture Document + version: 2.0 + output: + format: markdown + filename: docs/architecture.md + title: "{{project_name}} Architecture Document" + +workflow: + mode: interactive + elicitation: advanced-elicitation + +sections: + - id: introduction + title: Introduction + instruction: | + If available, review any provided relevant documents to gather all relevant context before beginning. If at a minimum you cannot locate docs/prd.md ask the user what docs will provide the basis for the architecture. + sections: + - id: intro-content + content: | + This document outlines the overall project architecture for {{project_name}}, including backend systems, shared services, and non-UI specific concerns. Its primary goal is to serve as the guiding architectural blueprint for AI-driven development, ensuring consistency and adherence to chosen patterns and technologies. + + **Relationship to Frontend Architecture:** + If the project includes a significant user interface, a separate Frontend Architecture Document will detail the frontend-specific design and MUST be used in conjunction with this document. Core technology stack choices documented herein (see "Tech Stack") are definitive for the entire project, including any frontend components. + - id: starter-template + title: Starter Template or Existing Project + instruction: | + Before proceeding further with architecture design, check if the project is based on a starter template or existing codebase: + + 1. Review the PRD and brainstorming brief for any mentions of: + - Starter templates (e.g., Create React App, Next.js, Vue CLI, Angular CLI, etc.) + - Existing projects or codebases being used as a foundation + - Boilerplate projects or scaffolding tools + - Previous projects to be cloned or adapted + + 2. If a starter template or existing project is mentioned: + - Ask the user to provide access via one of these methods: + - Link to the starter template documentation + - Upload/attach the project files (for small projects) + - Share a link to the project repository (GitHub, GitLab, etc.) + - Analyze the starter/existing project to understand: + - Pre-configured technology stack and versions + - Project structure and organization patterns + - Built-in scripts and tooling + - Existing architectural patterns and conventions + - Any limitations or constraints imposed by the starter + - Use this analysis to inform and align your architecture decisions + + 3. If no starter template is mentioned but this is a greenfield project: + - Suggest appropriate starter templates based on the tech stack preferences + - Explain the benefits (faster setup, best practices, community support) + - Let the user decide whether to use one + + 4. If the user confirms no starter template will be used: + - Proceed with architecture design from scratch + - Note that manual setup will be required for all tooling and configuration + + Document the decision here before proceeding with the architecture design. If none, just say N/A + elicit: true + - id: changelog + title: Change Log + type: table + columns: [Date, Version, Description, Author] + instruction: Track document versions and changes + + - id: high-level-architecture + title: High Level Architecture + instruction: | + This section contains multiple subsections that establish the foundation of the architecture. Present all subsections together at once. + elicit: true + sections: + - id: technical-summary + title: Technical Summary + instruction: | + Provide a brief paragraph (3-5 sentences) overview of: + - The system's overall architecture style + - Key components and their relationships + - Primary technology choices + - Core architectural patterns being used + - Reference back to the PRD goals and how this architecture supports them + - id: high-level-overview + title: High Level Overview + instruction: | + Based on the PRD's Technical Assumptions section, describe: + + 1. The main architectural style (e.g., Monolith, Microservices, Serverless, Event-Driven) + 2. Repository structure decision from PRD (Monorepo/Polyrepo) + 3. Service architecture decision from PRD + 4. Primary user interaction flow or data flow at a conceptual level + 5. Key architectural decisions and their rationale + - id: project-diagram + title: High Level Project Diagram + type: mermaid + mermaid_type: graph + instruction: | + Create a Mermaid diagram that visualizes the high-level architecture. Consider: + - System boundaries + - Major components/services + - Data flow directions + - External integrations + - User entry points + + - id: architectural-patterns + title: Architectural and Design Patterns + instruction: | + List the key high-level patterns that will guide the architecture. For each pattern: + + 1. Present 2-3 viable options if multiple exist + 2. Provide your recommendation with clear rationale + 3. Get user confirmation before finalizing + 4. These patterns should align with the PRD's technical assumptions and project goals + + Common patterns to consider: + - Architectural style patterns (Serverless, Event-Driven, Microservices, CQRS, Hexagonal) + - Code organization patterns (Dependency Injection, Repository, Module, Factory) + - Data patterns (Event Sourcing, Saga, Database per Service) + - Communication patterns (REST, GraphQL, Message Queue, Pub/Sub) + template: "- **{{pattern_name}}:** {{pattern_description}} - _Rationale:_ {{rationale}}" + examples: + - "**Serverless Architecture:** Using AWS Lambda for compute - _Rationale:_ Aligns with PRD requirement for cost optimization and automatic scaling" + - "**Repository Pattern:** Abstract data access logic - _Rationale:_ Enables testing and future database migration flexibility" + - "**Event-Driven Communication:** Using SNS/SQS for service decoupling - _Rationale:_ Supports async processing and system resilience" + + - id: tech-stack + title: Tech Stack + instruction: | + This is the DEFINITIVE technology selection section. Work with the user to make specific choices: + + 1. Review PRD technical assumptions and any preferences from .bmad-core/data/technical-preferences.yaml or an attached technical-preferences + 2. For each category, present 2-3 viable options with pros/cons + 3. Make a clear recommendation based on project needs + 4. Get explicit user approval for each selection + 5. Document exact versions (avoid "latest" - pin specific versions) + 6. This table is the single source of truth - all other docs must reference these choices + + Key decisions to finalize - before displaying the table, ensure you are aware of or ask the user about - let the user know if they are not sure on any that you can also provide suggestions with rationale: + + - Starter templates (if any) + - Languages and runtimes with exact versions + - Frameworks and libraries / packages + - Cloud provider and key services choices + - Database and storage solutions - if unclear suggest sql or nosql or other types depending on the project and depending on cloud provider offer a suggestion + - Development tools + + Upon render of the table, ensure the user is aware of the importance of this sections choices, should also look for gaps or disagreements with anything, ask for any clarifications if something is unclear why its in the list, and also right away elicit feedback - this statement and the options should be rendered and then prompt right all before allowing user input. + elicit: true + sections: + - id: cloud-infrastructure + title: Cloud Infrastructure + template: | + - **Provider:** {{cloud_provider}} + - **Key Services:** {{core_services_list}} + - **Deployment Regions:** {{regions}} + - id: technology-stack-table + title: Technology Stack Table + type: table + columns: [Category, Technology, Version, Purpose, Rationale] + instruction: Populate the technology stack table with all relevant technologies + examples: + - "| **Language** | TypeScript | 5.3.3 | Primary development language | Strong typing, excellent tooling, team expertise |" + - "| **Runtime** | Node.js | 20.11.0 | JavaScript runtime | LTS version, stable performance, wide ecosystem |" + - "| **Framework** | NestJS | 10.3.2 | Backend framework | Enterprise-ready, good DI, matches team patterns |" + + - id: data-models + title: Data Models + instruction: | + Define the core data models/entities: + + 1. Review PRD requirements and identify key business entities + 2. For each model, explain its purpose and relationships + 3. Include key attributes and data types + 4. Show relationships between models + 5. Discuss design decisions with user + + Create a clear conceptual model before moving to database schema. + elicit: true + repeatable: true + sections: + - id: model + title: "{{model_name}}" + template: | + **Purpose:** {{model_purpose}} + + **Key Attributes:** + - {{attribute_1}}: {{type_1}} - {{description_1}} + - {{attribute_2}}: {{type_2}} - {{description_2}} + + **Relationships:** + - {{relationship_1}} + - {{relationship_2}} + + - id: components + title: Components + instruction: | + Based on the architectural patterns, tech stack, and data models from above: + + 1. Identify major logical components/services and their responsibilities + 2. Consider the repository structure (monorepo/polyrepo) from PRD + 3. Define clear boundaries and interfaces between components + 4. For each component, specify: + - Primary responsibility + - Key interfaces/APIs exposed + - Dependencies on other components + - Technology specifics based on tech stack choices + + 5. Create component diagrams where helpful + elicit: true + sections: + - id: component-list + repeatable: true + title: "{{component_name}}" + template: | + **Responsibility:** {{component_description}} + + **Key Interfaces:** + - {{interface_1}} + - {{interface_2}} + + **Dependencies:** {{dependencies}} + + **Technology Stack:** {{component_tech_details}} + - id: component-diagrams + title: Component Diagrams + type: mermaid + instruction: | + Create Mermaid diagrams to visualize component relationships. Options: + - C4 Container diagram for high-level view + - Component diagram for detailed internal structure + - Sequence diagrams for complex interactions + Choose the most appropriate for clarity + + - id: external-apis + title: External APIs + condition: Project requires external API integrations + instruction: | + For each external service integration: + + 1. Identify APIs needed based on PRD requirements and component design + 2. If documentation URLs are unknown, ask user for specifics + 3. Document authentication methods and security considerations + 4. List specific endpoints that will be used + 5. Note any rate limits or usage constraints + + If no external APIs are needed, state this explicitly and skip to next section. + elicit: true + repeatable: true + sections: + - id: api + title: "{{api_name}} API" + template: | + - **Purpose:** {{api_purpose}} + - **Documentation:** {{api_docs_url}} + - **Base URL(s):** {{api_base_url}} + - **Authentication:** {{auth_method}} + - **Rate Limits:** {{rate_limits}} + + **Key Endpoints Used:** + - `{{method}} {{endpoint_path}}` - {{endpoint_purpose}} + + **Integration Notes:** {{integration_considerations}} + + - id: core-workflows + title: Core Workflows + type: mermaid + mermaid_type: sequence + instruction: | + Illustrate key system workflows using sequence diagrams: + + 1. Identify critical user journeys from PRD + 2. Show component interactions including external APIs + 3. Include error handling paths + 4. Document async operations + 5. Create both high-level and detailed diagrams as needed + + Focus on workflows that clarify architecture decisions or complex interactions. + elicit: true + + - id: rest-api-spec + title: REST API Spec + condition: Project includes REST API + type: code + language: yaml + instruction: | + If the project includes a REST API: + + 1. Create an OpenAPI 3.0 specification + 2. Include all endpoints from epics/stories + 3. Define request/response schemas based on data models + 4. Document authentication requirements + 5. Include example requests/responses + + Use YAML format for better readability. If no REST API, skip this section. + elicit: true + template: | + openapi: 3.0.0 + info: + title: {{api_title}} + version: {{api_version}} + description: {{api_description}} + servers: + - url: {{server_url}} + description: {{server_description}} + + - id: database-schema + title: Database Schema + instruction: | + Transform the conceptual data models into concrete database schemas: + + 1. Use the database type(s) selected in Tech Stack + 2. Create schema definitions using appropriate notation + 3. Include indexes, constraints, and relationships + 4. Consider performance and scalability + 5. For NoSQL, show document structures + + Present schema in format appropriate to database type (SQL DDL, JSON schema, etc.) + elicit: true + + - id: source-tree + title: Source Tree + type: code + language: plaintext + instruction: | + Create a project folder structure that reflects: + + 1. The chosen repository structure (monorepo/polyrepo) + 2. The service architecture (monolith/microservices/serverless) + 3. The selected tech stack and languages + 4. Component organization from above + 5. Best practices for the chosen frameworks + 6. Clear separation of concerns + + Adapt the structure based on project needs. For monorepos, show service separation. For serverless, show function organization. Include language-specific conventions. + elicit: true + examples: + - | + project-root/ + ├── packages/ + │ ├── api/ # Backend API service + │ ├── web/ # Frontend application + │ ├── shared/ # Shared utilities/types + │ └── infrastructure/ # IaC definitions + ├── scripts/ # Monorepo management scripts + └── package.json # Root package.json with workspaces + + - id: infrastructure-deployment + title: Infrastructure and Deployment + instruction: | + Define the deployment architecture and practices: + + 1. Use IaC tool selected in Tech Stack + 2. Choose deployment strategy appropriate for the architecture + 3. Define environments and promotion flow + 4. Establish rollback procedures + 5. Consider security, monitoring, and cost optimization + + Get user input on deployment preferences and CI/CD tool choices. + elicit: true + sections: + - id: infrastructure-as-code + title: Infrastructure as Code + template: | + - **Tool:** {{iac_tool}} {{version}} + - **Location:** `{{iac_directory}}` + - **Approach:** {{iac_approach}} + - id: deployment-strategy + title: Deployment Strategy + template: | + - **Strategy:** {{deployment_strategy}} + - **CI/CD Platform:** {{cicd_platform}} + - **Pipeline Configuration:** `{{pipeline_config_location}}` + - id: environments + title: Environments + repeatable: true + template: "- **{{env_name}}:** {{env_purpose}} - {{env_details}}" + - id: promotion-flow + title: Environment Promotion Flow + type: code + language: text + template: "{{promotion_flow_diagram}}" + - id: rollback-strategy + title: Rollback Strategy + template: | + - **Primary Method:** {{rollback_method}} + - **Trigger Conditions:** {{rollback_triggers}} + - **Recovery Time Objective:** {{rto}} + + - id: error-handling-strategy + title: Error Handling Strategy + instruction: | + Define comprehensive error handling approach: + + 1. Choose appropriate patterns for the language/framework from Tech Stack + 2. Define logging standards and tools + 3. Establish error categories and handling rules + 4. Consider observability and debugging needs + 5. Ensure security (no sensitive data in logs) + + This section guides both AI and human developers in consistent error handling. + elicit: true + sections: + - id: general-approach + title: General Approach + template: | + - **Error Model:** {{error_model}} + - **Exception Hierarchy:** {{exception_structure}} + - **Error Propagation:** {{propagation_rules}} + - id: logging-standards + title: Logging Standards + template: | + - **Library:** {{logging_library}} {{version}} + - **Format:** {{log_format}} + - **Levels:** {{log_levels_definition}} + - **Required Context:** + - Correlation ID: {{correlation_id_format}} + - Service Context: {{service_context}} + - User Context: {{user_context_rules}} + - id: error-patterns + title: Error Handling Patterns + sections: + - id: external-api-errors + title: External API Errors + template: | + - **Retry Policy:** {{retry_strategy}} + - **Circuit Breaker:** {{circuit_breaker_config}} + - **Timeout Configuration:** {{timeout_settings}} + - **Error Translation:** {{error_mapping_rules}} + - id: business-logic-errors + title: Business Logic Errors + template: | + - **Custom Exceptions:** {{business_exception_types}} + - **User-Facing Errors:** {{user_error_format}} + - **Error Codes:** {{error_code_system}} + - id: data-consistency + title: Data Consistency + template: | + - **Transaction Strategy:** {{transaction_approach}} + - **Compensation Logic:** {{compensation_patterns}} + - **Idempotency:** {{idempotency_approach}} + + - id: coding-standards + title: Coding Standards + instruction: | + These standards are MANDATORY for AI agents. Work with user to define ONLY the critical rules needed to prevent bad code. Explain that: + + 1. This section directly controls AI developer behavior + 2. Keep it minimal - assume AI knows general best practices + 3. Focus on project-specific conventions and gotchas + 4. Overly detailed standards bloat context and slow development + 5. Standards will be extracted to separate file for dev agent use + + For each standard, get explicit user confirmation it's necessary. + elicit: true + sections: + - id: core-standards + title: Core Standards + template: | + - **Languages & Runtimes:** {{languages_and_versions}} + - **Style & Linting:** {{linter_config}} + - **Test Organization:** {{test_file_convention}} + - id: naming-conventions + title: Naming Conventions + type: table + columns: [Element, Convention, Example] + instruction: Only include if deviating from language defaults + - id: critical-rules + title: Critical Rules + instruction: | + List ONLY rules that AI might violate or project-specific requirements. Examples: + - "Never use console.log in production code - use logger" + - "All API responses must use ApiResponse wrapper type" + - "Database queries must use repository pattern, never direct ORM" + + Avoid obvious rules like "use SOLID principles" or "write clean code" + repeatable: true + template: "- **{{rule_name}}:** {{rule_description}}" + - id: language-specifics + title: Language-Specific Guidelines + condition: Critical language-specific rules needed + instruction: Add ONLY if critical for preventing AI mistakes. Most teams don't need this section. + sections: + - id: language-rules + title: "{{language_name}} Specifics" + repeatable: true + template: "- **{{rule_topic}}:** {{rule_detail}}" + + - id: test-strategy + title: Test Strategy and Standards + instruction: | + Work with user to define comprehensive test strategy: + + 1. Use test frameworks from Tech Stack + 2. Decide on TDD vs test-after approach + 3. Define test organization and naming + 4. Establish coverage goals + 5. Determine integration test infrastructure + 6. Plan for test data and external dependencies + + Note: Basic info goes in Coding Standards for dev agent. This detailed section is for QA agent and team reference. + elicit: true + sections: + - id: testing-philosophy + title: Testing Philosophy + template: | + - **Approach:** {{test_approach}} + - **Coverage Goals:** {{coverage_targets}} + - **Test Pyramid:** {{test_distribution}} + - id: test-types + title: Test Types and Organization + sections: + - id: unit-tests + title: Unit Tests + template: | + - **Framework:** {{unit_test_framework}} {{version}} + - **File Convention:** {{unit_test_naming}} + - **Location:** {{unit_test_location}} + - **Mocking Library:** {{mocking_library}} + - **Coverage Requirement:** {{unit_coverage}} + + **AI Agent Requirements:** + - Generate tests for all public methods + - Cover edge cases and error conditions + - Follow AAA pattern (Arrange, Act, Assert) + - Mock all external dependencies + - id: integration-tests + title: Integration Tests + template: | + - **Scope:** {{integration_scope}} + - **Location:** {{integration_test_location}} + - **Test Infrastructure:** + - **{{dependency_name}}:** {{test_approach}} ({{test_tool}}) + examples: + - "**Database:** In-memory H2 for unit tests, Testcontainers PostgreSQL for integration" + - "**Message Queue:** Embedded Kafka for tests" + - "**External APIs:** WireMock for stubbing" + - id: e2e-tests + title: End-to-End Tests + template: | + - **Framework:** {{e2e_framework}} {{version}} + - **Scope:** {{e2e_scope}} + - **Environment:** {{e2e_environment}} + - **Test Data:** {{e2e_data_strategy}} + - id: test-data-management + title: Test Data Management + template: | + - **Strategy:** {{test_data_approach}} + - **Fixtures:** {{fixture_location}} + - **Factories:** {{factory_pattern}} + - **Cleanup:** {{cleanup_strategy}} + - id: continuous-testing + title: Continuous Testing + template: | + - **CI Integration:** {{ci_test_stages}} + - **Performance Tests:** {{perf_test_approach}} + - **Security Tests:** {{security_test_approach}} + + - id: security + title: Security + instruction: | + Define MANDATORY security requirements for AI and human developers: + + 1. Focus on implementation-specific rules + 2. Reference security tools from Tech Stack + 3. Define clear patterns for common scenarios + 4. These rules directly impact code generation + 5. Work with user to ensure completeness without redundancy + elicit: true + sections: + - id: input-validation + title: Input Validation + template: | + - **Validation Library:** {{validation_library}} + - **Validation Location:** {{where_to_validate}} + - **Required Rules:** + - All external inputs MUST be validated + - Validation at API boundary before processing + - Whitelist approach preferred over blacklist + - id: auth-authorization + title: Authentication & Authorization + template: | + - **Auth Method:** {{auth_implementation}} + - **Session Management:** {{session_approach}} + - **Required Patterns:** + - {{auth_pattern_1}} + - {{auth_pattern_2}} + - id: secrets-management + title: Secrets Management + template: | + - **Development:** {{dev_secrets_approach}} + - **Production:** {{prod_secrets_service}} + - **Code Requirements:** + - NEVER hardcode secrets + - Access via configuration service only + - No secrets in logs or error messages + - id: api-security + title: API Security + template: | + - **Rate Limiting:** {{rate_limit_implementation}} + - **CORS Policy:** {{cors_configuration}} + - **Security Headers:** {{required_headers}} + - **HTTPS Enforcement:** {{https_approach}} + - id: data-protection + title: Data Protection + template: | + - **Encryption at Rest:** {{encryption_at_rest}} + - **Encryption in Transit:** {{encryption_in_transit}} + - **PII Handling:** {{pii_rules}} + - **Logging Restrictions:** {{what_not_to_log}} + - id: dependency-security + title: Dependency Security + template: | + - **Scanning Tool:** {{dependency_scanner}} + - **Update Policy:** {{update_frequency}} + - **Approval Process:** {{new_dep_process}} + - id: security-testing + title: Security Testing + template: | + - **SAST Tool:** {{static_analysis}} + - **DAST Tool:** {{dynamic_analysis}} + - **Penetration Testing:** {{pentest_schedule}} + + - id: checklist-results + title: Checklist Results Report + instruction: Before running the checklist, offer to output the full architecture document. Once user confirms, execute the architect-checklist and populate results here. + + - id: next-steps + title: Next Steps + instruction: | + After completing the architecture: + + 1. If project has UI components: + - Recommend engaging Design Architect agent + - Use "Frontend Architecture Mode" + - Provide this document as input + + 2. For all projects: + - Review with Product Owner + - Begin story implementation with Dev agent + - Set up infrastructure with DevOps agent + + 3. Include specific prompts for next agents if needed + sections: + - id: design-architect-prompt + title: Design Architect Prompt + condition: Project has UI components + instruction: | + Create a brief prompt to hand off to Design Architect for Frontend Architecture creation. Include: + - Reference to this architecture document + - Key UI requirements from PRD + - Any frontend-specific decisions made here + - Request for detailed frontend architecture + - id: developer-handoff + title: Developer Handoff + instruction: | + Create a brief prompt for developers starting implementation. Include: + - Reference to this architecture and coding standards + - First epic/story to implement + - Key technical decisions to follow +==================== END: .bmad-core/templates/architecture-tmpl.yaml ==================== + +==================== START: .bmad-core/templates/brownfield-architecture-tmpl.yaml ==================== +template: + id: brownfield-architecture-template-v2 + name: Brownfield Enhancement Architecture + version: 2.0 + output: + format: markdown + filename: docs/architecture.md + title: "{{project_name}} Brownfield Enhancement Architecture" + +workflow: + mode: interactive + elicitation: advanced-elicitation + +sections: + - id: introduction + title: Introduction + instruction: | + IMPORTANT - SCOPE AND ASSESSMENT REQUIRED: + + This architecture document is for SIGNIFICANT enhancements to existing projects that require comprehensive architectural planning. Before proceeding: + + 1. **Verify Complexity**: Confirm this enhancement requires architectural planning. For simple additions, recommend: "For simpler changes that don't require architectural planning, consider using the brownfield-create-epic or brownfield-create-story task with the Product Owner instead." + + 2. **REQUIRED INPUTS**: + - Completed brownfield-prd.md + - Existing project technical documentation (from docs folder or user-provided) + - Access to existing project structure (IDE or uploaded files) + + 3. **DEEP ANALYSIS MANDATE**: You MUST conduct thorough analysis of the existing codebase, architecture patterns, and technical constraints before making ANY architectural recommendations. Every suggestion must be based on actual project analysis, not assumptions. + + 4. **CONTINUOUS VALIDATION**: Throughout this process, explicitly validate your understanding with the user. For every architectural decision, confirm: "Based on my analysis of your existing system, I recommend [decision] because [evidence from actual project]. Does this align with your system's reality?" + + If any required inputs are missing, request them before proceeding. + elicit: true + sections: + - id: intro-content + content: | + This document outlines the architectural approach for enhancing {{project_name}} with {{enhancement_description}}. Its primary goal is to serve as the guiding architectural blueprint for AI-driven development of new features while ensuring seamless integration with the existing system. + + **Relationship to Existing Architecture:** + This document supplements existing project architecture by defining how new components will integrate with current systems. Where conflicts arise between new and existing patterns, this document provides guidance on maintaining consistency while implementing enhancements. + - id: existing-project-analysis + title: Existing Project Analysis + instruction: | + Analyze the existing project structure and architecture: + + 1. Review existing documentation in docs folder + 2. Examine current technology stack and versions + 3. Identify existing architectural patterns and conventions + 4. Note current deployment and infrastructure setup + 5. Document any constraints or limitations + + CRITICAL: After your analysis, explicitly validate your findings: "Based on my analysis of your project, I've identified the following about your existing system: [key findings]. Please confirm these observations are accurate before I proceed with architectural recommendations." + elicit: true + sections: + - id: current-state + title: Current Project State + template: | + - **Primary Purpose:** {{existing_project_purpose}} + - **Current Tech Stack:** {{existing_tech_summary}} + - **Architecture Style:** {{existing_architecture_style}} + - **Deployment Method:** {{existing_deployment_approach}} + - id: available-docs + title: Available Documentation + type: bullet-list + template: "- {{existing_docs_summary}}" + - id: constraints + title: Identified Constraints + type: bullet-list + template: "- {{constraint}}" + - id: changelog + title: Change Log + type: table + columns: [Change, Date, Version, Description, Author] + instruction: Track document versions and changes + + - id: enhancement-scope + title: Enhancement Scope and Integration Strategy + instruction: | + Define how the enhancement will integrate with the existing system: + + 1. Review the brownfield PRD enhancement scope + 2. Identify integration points with existing code + 3. Define boundaries between new and existing functionality + 4. Establish compatibility requirements + + VALIDATION CHECKPOINT: Before presenting the integration strategy, confirm: "Based on my analysis, the integration approach I'm proposing takes into account [specific existing system characteristics]. These integration points and boundaries respect your current architecture patterns. Is this assessment accurate?" + elicit: true + sections: + - id: enhancement-overview + title: Enhancement Overview + template: | + **Enhancement Type:** {{enhancement_type}} + **Scope:** {{enhancement_scope}} + **Integration Impact:** {{integration_impact_level}} + - id: integration-approach + title: Integration Approach + template: | + **Code Integration Strategy:** {{code_integration_approach}} + **Database Integration:** {{database_integration_approach}} + **API Integration:** {{api_integration_approach}} + **UI Integration:** {{ui_integration_approach}} + - id: compatibility-requirements + title: Compatibility Requirements + template: | + - **Existing API Compatibility:** {{api_compatibility}} + - **Database Schema Compatibility:** {{db_compatibility}} + - **UI/UX Consistency:** {{ui_compatibility}} + - **Performance Impact:** {{performance_constraints}} + + - id: tech-stack-alignment + title: Tech Stack Alignment + instruction: | + Ensure new components align with existing technology choices: + + 1. Use existing technology stack as the foundation + 2. Only introduce new technologies if absolutely necessary + 3. Justify any new additions with clear rationale + 4. Ensure version compatibility with existing dependencies + elicit: true + sections: + - id: existing-stack + title: Existing Technology Stack + type: table + columns: [Category, Current Technology, Version, Usage in Enhancement, Notes] + instruction: Document the current stack that must be maintained or integrated with + - id: new-tech-additions + title: New Technology Additions + condition: Enhancement requires new technologies + type: table + columns: [Technology, Version, Purpose, Rationale, Integration Method] + instruction: Only include if new technologies are required for the enhancement + + - id: data-models + title: Data Models and Schema Changes + instruction: | + Define new data models and how they integrate with existing schema: + + 1. Identify new entities required for the enhancement + 2. Define relationships with existing data models + 3. Plan database schema changes (additions, modifications) + 4. Ensure backward compatibility + elicit: true + sections: + - id: new-models + title: New Data Models + repeatable: true + sections: + - id: model + title: "{{model_name}}" + template: | + **Purpose:** {{model_purpose}} + **Integration:** {{integration_with_existing}} + + **Key Attributes:** + - {{attribute_1}}: {{type_1}} - {{description_1}} + - {{attribute_2}}: {{type_2}} - {{description_2}} + + **Relationships:** + - **With Existing:** {{existing_relationships}} + - **With New:** {{new_relationships}} + - id: schema-integration + title: Schema Integration Strategy + template: | + **Database Changes Required:** + - **New Tables:** {{new_tables_list}} + - **Modified Tables:** {{modified_tables_list}} + - **New Indexes:** {{new_indexes_list}} + - **Migration Strategy:** {{migration_approach}} + + **Backward Compatibility:** + - {{compatibility_measure_1}} + - {{compatibility_measure_2}} + + - id: component-architecture + title: Component Architecture + instruction: | + Define new components and their integration with existing architecture: + + 1. Identify new components required for the enhancement + 2. Define interfaces with existing components + 3. Establish clear boundaries and responsibilities + 4. Plan integration points and data flow + + MANDATORY VALIDATION: Before presenting component architecture, confirm: "The new components I'm proposing follow the existing architectural patterns I identified in your codebase: [specific patterns]. The integration interfaces respect your current component structure and communication patterns. Does this match your project's reality?" + elicit: true + sections: + - id: new-components + title: New Components + repeatable: true + sections: + - id: component + title: "{{component_name}}" + template: | + **Responsibility:** {{component_description}} + **Integration Points:** {{integration_points}} + + **Key Interfaces:** + - {{interface_1}} + - {{interface_2}} + + **Dependencies:** + - **Existing Components:** {{existing_dependencies}} + - **New Components:** {{new_dependencies}} + + **Technology Stack:** {{component_tech_details}} + - id: interaction-diagram + title: Component Interaction Diagram + type: mermaid + mermaid_type: graph + instruction: Create Mermaid diagram showing how new components interact with existing ones + + - id: api-design + title: API Design and Integration + condition: Enhancement requires API changes + instruction: | + Define new API endpoints and integration with existing APIs: + + 1. Plan new API endpoints required for the enhancement + 2. Ensure consistency with existing API patterns + 3. Define authentication and authorization integration + 4. Plan versioning strategy if needed + elicit: true + sections: + - id: api-strategy + title: API Integration Strategy + template: | + **API Integration Strategy:** {{api_integration_strategy}} + **Authentication:** {{auth_integration}} + **Versioning:** {{versioning_approach}} + - id: new-endpoints + title: New API Endpoints + repeatable: true + sections: + - id: endpoint + title: "{{endpoint_name}}" + template: | + - **Method:** {{http_method}} + - **Endpoint:** {{endpoint_path}} + - **Purpose:** {{endpoint_purpose}} + - **Integration:** {{integration_with_existing}} + sections: + - id: request + title: Request + type: code + language: json + template: "{{request_schema}}" + - id: response + title: Response + type: code + language: json + template: "{{response_schema}}" + + - id: external-api-integration + title: External API Integration + condition: Enhancement requires new external APIs + instruction: Document new external API integrations required for the enhancement + repeatable: true + sections: + - id: external-api + title: "{{api_name}} API" + template: | + - **Purpose:** {{api_purpose}} + - **Documentation:** {{api_docs_url}} + - **Base URL:** {{api_base_url}} + - **Authentication:** {{auth_method}} + - **Integration Method:** {{integration_approach}} + + **Key Endpoints Used:** + - `{{method}} {{endpoint_path}}` - {{endpoint_purpose}} + + **Error Handling:** {{error_handling_strategy}} + + - id: source-tree-integration + title: Source Tree Integration + instruction: | + Define how new code will integrate with existing project structure: + + 1. Follow existing project organization patterns + 2. Identify where new files/folders will be placed + 3. Ensure consistency with existing naming conventions + 4. Plan for minimal disruption to existing structure + elicit: true + sections: + - id: existing-structure + title: Existing Project Structure + type: code + language: plaintext + instruction: Document relevant parts of current structure + template: "{{existing_structure_relevant_parts}}" + - id: new-file-organization + title: New File Organization + type: code + language: plaintext + instruction: Show only new additions to existing structure + template: | + {{project-root}}/ + ├── {{existing_structure_context}} + │ ├── {{new_folder_1}}/ # {{purpose_1}} + │ │ ├── {{new_file_1}} + │ │ └── {{new_file_2}} + │ ├── {{existing_folder}}/ # Existing folder with additions + │ │ ├── {{existing_file}} # Existing file + │ │ └── {{new_file_3}} # New addition + │ └── {{new_folder_2}}/ # {{purpose_2}} + - id: integration-guidelines + title: Integration Guidelines + template: | + - **File Naming:** {{file_naming_consistency}} + - **Folder Organization:** {{folder_organization_approach}} + - **Import/Export Patterns:** {{import_export_consistency}} + + - id: infrastructure-deployment + title: Infrastructure and Deployment Integration + instruction: | + Define how the enhancement will be deployed alongside existing infrastructure: + + 1. Use existing deployment pipeline and infrastructure + 2. Identify any infrastructure changes needed + 3. Plan deployment strategy to minimize risk + 4. Define rollback procedures + elicit: true + sections: + - id: existing-infrastructure + title: Existing Infrastructure + template: | + **Current Deployment:** {{existing_deployment_summary}} + **Infrastructure Tools:** {{existing_infrastructure_tools}} + **Environments:** {{existing_environments}} + - id: enhancement-deployment + title: Enhancement Deployment Strategy + template: | + **Deployment Approach:** {{deployment_approach}} + **Infrastructure Changes:** {{infrastructure_changes}} + **Pipeline Integration:** {{pipeline_integration}} + - id: rollback-strategy + title: Rollback Strategy + template: | + **Rollback Method:** {{rollback_method}} + **Risk Mitigation:** {{risk_mitigation}} + **Monitoring:** {{monitoring_approach}} + + - id: coding-standards + title: Coding Standards and Conventions + instruction: | + Ensure new code follows existing project conventions: + + 1. Document existing coding standards from project analysis + 2. Identify any enhancement-specific requirements + 3. Ensure consistency with existing codebase patterns + 4. Define standards for new code organization + elicit: true + sections: + - id: existing-standards + title: Existing Standards Compliance + template: | + **Code Style:** {{existing_code_style}} + **Linting Rules:** {{existing_linting}} + **Testing Patterns:** {{existing_test_patterns}} + **Documentation Style:** {{existing_doc_style}} + - id: enhancement-standards + title: Enhancement-Specific Standards + condition: New patterns needed for enhancement + repeatable: true + template: "- **{{standard_name}}:** {{standard_description}}" + - id: integration-rules + title: Critical Integration Rules + template: | + - **Existing API Compatibility:** {{api_compatibility_rule}} + - **Database Integration:** {{db_integration_rule}} + - **Error Handling:** {{error_handling_integration}} + - **Logging Consistency:** {{logging_consistency}} + + - id: testing-strategy + title: Testing Strategy + instruction: | + Define testing approach for the enhancement: + + 1. Integrate with existing test suite + 2. Ensure existing functionality remains intact + 3. Plan for testing new features + 4. Define integration testing approach + elicit: true + sections: + - id: existing-test-integration + title: Integration with Existing Tests + template: | + **Existing Test Framework:** {{existing_test_framework}} + **Test Organization:** {{existing_test_organization}} + **Coverage Requirements:** {{existing_coverage_requirements}} + - id: new-testing + title: New Testing Requirements + sections: + - id: unit-tests + title: Unit Tests for New Components + template: | + - **Framework:** {{test_framework}} + - **Location:** {{test_location}} + - **Coverage Target:** {{coverage_target}} + - **Integration with Existing:** {{test_integration}} + - id: integration-tests + title: Integration Tests + template: | + - **Scope:** {{integration_test_scope}} + - **Existing System Verification:** {{existing_system_verification}} + - **New Feature Testing:** {{new_feature_testing}} + - id: regression-tests + title: Regression Testing + template: | + - **Existing Feature Verification:** {{regression_test_approach}} + - **Automated Regression Suite:** {{automated_regression}} + - **Manual Testing Requirements:** {{manual_testing_requirements}} + + - id: security-integration + title: Security Integration + instruction: | + Ensure security consistency with existing system: + + 1. Follow existing security patterns and tools + 2. Ensure new features don't introduce vulnerabilities + 3. Maintain existing security posture + 4. Define security testing for new components + elicit: true + sections: + - id: existing-security + title: Existing Security Measures + template: | + **Authentication:** {{existing_auth}} + **Authorization:** {{existing_authz}} + **Data Protection:** {{existing_data_protection}} + **Security Tools:** {{existing_security_tools}} + - id: enhancement-security + title: Enhancement Security Requirements + template: | + **New Security Measures:** {{new_security_measures}} + **Integration Points:** {{security_integration_points}} + **Compliance Requirements:** {{compliance_requirements}} + - id: security-testing + title: Security Testing + template: | + **Existing Security Tests:** {{existing_security_tests}} + **New Security Test Requirements:** {{new_security_tests}} + **Penetration Testing:** {{pentest_requirements}} + + - id: checklist-results + title: Checklist Results Report + instruction: Execute the architect-checklist and populate results here, focusing on brownfield-specific validation + + - id: next-steps + title: Next Steps + instruction: | + After completing the brownfield architecture: + + 1. Review integration points with existing system + 2. Begin story implementation with Dev agent + 3. Set up deployment pipeline integration + 4. Plan rollback and monitoring procedures + sections: + - id: story-manager-handoff + title: Story Manager Handoff + instruction: | + Create a brief prompt for Story Manager to work with this brownfield enhancement. Include: + - Reference to this architecture document + - Key integration requirements validated with user + - Existing system constraints based on actual project analysis + - First story to implement with clear integration checkpoints + - Emphasis on maintaining existing system integrity throughout implementation + - id: developer-handoff + title: Developer Handoff + instruction: | + Create a brief prompt for developers starting implementation. Include: + - Reference to this architecture and existing coding standards analyzed from actual project + - Integration requirements with existing codebase validated with user + - Key technical decisions based on real project constraints + - Existing system compatibility requirements with specific verification steps + - Clear sequencing of implementation to minimize risk to existing functionality +==================== END: .bmad-core/templates/brownfield-architecture-tmpl.yaml ==================== + +==================== START: .bmad-core/templates/brownfield-prd-tmpl.yaml ==================== +template: + id: brownfield-prd-template-v2 + name: Brownfield Enhancement PRD + version: 2.0 + output: + format: markdown + filename: docs/prd.md + title: "{{project_name}} Brownfield Enhancement PRD" + +workflow: + mode: interactive + elicitation: advanced-elicitation + +sections: + - id: intro-analysis + title: Intro Project Analysis and Context + instruction: | + IMPORTANT - SCOPE ASSESSMENT REQUIRED: + + This PRD is for SIGNIFICANT enhancements to existing projects that require comprehensive planning and multiple stories. Before proceeding: + + 1. **Assess Enhancement Complexity**: If this is a simple feature addition or bug fix that could be completed in 1-2 focused development sessions, STOP and recommend: "For simpler changes, consider using the brownfield-create-epic or brownfield-create-story task with the Product Owner instead. This full PRD process is designed for substantial enhancements that require architectural planning and multiple coordinated stories." + + 2. **Project Context**: Determine if we're working in an IDE with the project already loaded or if the user needs to provide project information. If project files are available, analyze existing documentation in the docs folder. If insufficient documentation exists, recommend running the document-project task first. + + 3. **Deep Assessment Requirement**: You MUST thoroughly analyze the existing project structure, patterns, and constraints before making ANY suggestions. Every recommendation must be grounded in actual project analysis, not assumptions. + + Gather comprehensive information about the existing project. This section must be completed before proceeding with requirements. + + CRITICAL: Throughout this analysis, explicitly confirm your understanding with the user. For every assumption you make about the existing project, ask: "Based on my analysis, I understand that [assumption]. Is this correct?" + + Do not proceed with any recommendations until the user has validated your understanding of the existing system. + sections: + - id: existing-project-overview + title: Existing Project Overview + instruction: Check if document-project analysis was already performed. If yes, reference that output instead of re-analyzing. + sections: + - id: analysis-source + title: Analysis Source + instruction: | + Indicate one of the following: + - Document-project output available at: {{path}} + - IDE-based fresh analysis + - User-provided information + - id: current-state + title: Current Project State + instruction: | + - If document-project output exists: Extract summary from "High Level Architecture" and "Technical Summary" sections + - Otherwise: Brief description of what the project currently does and its primary purpose + - id: documentation-analysis + title: Available Documentation Analysis + instruction: | + If document-project was run: + - Note: "Document-project analysis available - using existing technical documentation" + - List key documents created by document-project + - Skip the missing documentation check below + + Otherwise, check for existing documentation: + sections: + - id: available-docs + title: Available Documentation + type: checklist + items: + - Tech Stack Documentation [[LLM: If from document-project, check ✓]] + - Source Tree/Architecture [[LLM: If from document-project, check ✓]] + - Coding Standards [[LLM: If from document-project, may be partial]] + - API Documentation [[LLM: If from document-project, check ✓]] + - External API Documentation [[LLM: If from document-project, check ✓]] + - UX/UI Guidelines [[LLM: May not be in document-project]] + - Technical Debt Documentation [[LLM: If from document-project, check ✓]] + - "Other: {{other_docs}}" + instruction: | + - If document-project was already run: "Using existing project analysis from document-project output." + - If critical documentation is missing and no document-project: "I recommend running the document-project task first..." + - id: enhancement-scope + title: Enhancement Scope Definition + instruction: Work with user to clearly define what type of enhancement this is. This is critical for scoping and approach. + sections: + - id: enhancement-type + title: Enhancement Type + type: checklist + instruction: Determine with user which applies + items: + - New Feature Addition + - Major Feature Modification + - Integration with New Systems + - Performance/Scalability Improvements + - UI/UX Overhaul + - Technology Stack Upgrade + - Bug Fix and Stability Improvements + - "Other: {{other_type}}" + - id: enhancement-description + title: Enhancement Description + instruction: 2-3 sentences describing what the user wants to add or change + - id: impact-assessment + title: Impact Assessment + type: checklist + instruction: Assess the scope of impact on existing codebase + items: + - Minimal Impact (isolated additions) + - Moderate Impact (some existing code changes) + - Significant Impact (substantial existing code changes) + - Major Impact (architectural changes required) + - id: goals-context + title: Goals and Background Context + sections: + - id: goals + title: Goals + type: bullet-list + instruction: Bullet list of 1-line desired outcomes this enhancement will deliver if successful + - id: background + title: Background Context + type: paragraphs + instruction: 1-2 short paragraphs explaining why this enhancement is needed, what problem it solves, and how it fits with the existing project + - id: changelog + title: Change Log + type: table + columns: [Change, Date, Version, Description, Author] + + - id: requirements + title: Requirements + instruction: | + Draft functional and non-functional requirements based on your validated understanding of the existing project. Before presenting requirements, confirm: "These requirements are based on my understanding of your existing system. Please review carefully and confirm they align with your project's reality." + elicit: true + sections: + - id: functional + title: Functional + type: numbered-list + prefix: FR + instruction: Each Requirement will be a bullet markdown with identifier starting with FR + examples: + - "FR1: The existing Todo List will integrate with the new AI duplicate detection service without breaking current functionality." + - id: non-functional + title: Non Functional + type: numbered-list + prefix: NFR + instruction: Each Requirement will be a bullet markdown with identifier starting with NFR. Include constraints from existing system + examples: + - "NFR1: Enhancement must maintain existing performance characteristics and not exceed current memory usage by more than 20%." + - id: compatibility + title: Compatibility Requirements + instruction: Critical for brownfield - what must remain compatible + type: numbered-list + prefix: CR + template: "{{requirement}}: {{description}}" + items: + - id: cr1 + template: "CR1: {{existing_api_compatibility}}" + - id: cr2 + template: "CR2: {{database_schema_compatibility}}" + - id: cr3 + template: "CR3: {{ui_ux_consistency}}" + - id: cr4 + template: "CR4: {{integration_compatibility}}" + + - id: ui-enhancement-goals + title: User Interface Enhancement Goals + condition: Enhancement includes UI changes + instruction: For UI changes, capture how they will integrate with existing UI patterns and design systems + sections: + - id: existing-ui-integration + title: Integration with Existing UI + instruction: Describe how new UI elements will fit with existing design patterns, style guides, and component libraries + - id: modified-screens + title: Modified/New Screens and Views + instruction: List only the screens/views that will be modified or added + - id: ui-consistency + title: UI Consistency Requirements + instruction: Specific requirements for maintaining visual and interaction consistency with existing application + + - id: technical-constraints + title: Technical Constraints and Integration Requirements + instruction: This section replaces separate architecture documentation. Gather detailed technical constraints from existing project analysis. + sections: + - id: existing-tech-stack + title: Existing Technology Stack + instruction: | + If document-project output available: + - Extract from "Actual Tech Stack" table in High Level Architecture section + - Include version numbers and any noted constraints + + Otherwise, document the current technology stack: + template: | + **Languages**: {{languages}} + **Frameworks**: {{frameworks}} + **Database**: {{database}} + **Infrastructure**: {{infrastructure}} + **External Dependencies**: {{external_dependencies}} + - id: integration-approach + title: Integration Approach + instruction: Define how the enhancement will integrate with existing architecture + template: | + **Database Integration Strategy**: {{database_integration}} + **API Integration Strategy**: {{api_integration}} + **Frontend Integration Strategy**: {{frontend_integration}} + **Testing Integration Strategy**: {{testing_integration}} + - id: code-organization + title: Code Organization and Standards + instruction: Based on existing project analysis, define how new code will fit existing patterns + template: | + **File Structure Approach**: {{file_structure}} + **Naming Conventions**: {{naming_conventions}} + **Coding Standards**: {{coding_standards}} + **Documentation Standards**: {{documentation_standards}} + - id: deployment-operations + title: Deployment and Operations + instruction: How the enhancement fits existing deployment pipeline + template: | + **Build Process Integration**: {{build_integration}} + **Deployment Strategy**: {{deployment_strategy}} + **Monitoring and Logging**: {{monitoring_logging}} + **Configuration Management**: {{config_management}} + - id: risk-assessment + title: Risk Assessment and Mitigation + instruction: | + If document-project output available: + - Reference "Technical Debt and Known Issues" section + - Include "Workarounds and Gotchas" that might impact enhancement + - Note any identified constraints from "Critical Technical Debt" + + Build risk assessment incorporating existing known issues: + template: | + **Technical Risks**: {{technical_risks}} + **Integration Risks**: {{integration_risks}} + **Deployment Risks**: {{deployment_risks}} + **Mitigation Strategies**: {{mitigation_strategies}} + + - id: epic-structure + title: Epic and Story Structure + instruction: | + For brownfield projects, favor a single comprehensive epic unless the user is clearly requesting multiple unrelated enhancements. Before presenting the epic structure, confirm: "Based on my analysis of your existing project, I believe this enhancement should be structured as [single epic/multiple epics] because [rationale based on actual project analysis]. Does this align with your understanding of the work required?" + elicit: true + sections: + - id: epic-approach + title: Epic Approach + instruction: Explain the rationale for epic structure - typically single epic for brownfield unless multiple unrelated features + template: "**Epic Structure Decision**: {{epic_decision}} with rationale" + + - id: epic-details + title: "Epic 1: {{enhancement_title}}" + instruction: | + Comprehensive epic that delivers the brownfield enhancement while maintaining existing functionality + + CRITICAL STORY SEQUENCING FOR BROWNFIELD: + - Stories must ensure existing functionality remains intact + - Each story should include verification that existing features still work + - Stories should be sequenced to minimize risk to existing system + - Include rollback considerations for each story + - Focus on incremental integration rather than big-bang changes + - Size stories for AI agent execution in existing codebase context + - MANDATORY: Present the complete story sequence and ask: "This story sequence is designed to minimize risk to your existing system. Does this order make sense given your project's architecture and constraints?" + - Stories must be logically sequential with clear dependencies identified + - Each story must deliver value while maintaining system integrity + template: | + **Epic Goal**: {{epic_goal}} + + **Integration Requirements**: {{integration_requirements}} + sections: + - id: story + title: "Story 1.{{story_number}} {{story_title}}" + repeatable: true + template: | + As a {{user_type}}, + I want {{action}}, + so that {{benefit}}. + sections: + - id: acceptance-criteria + title: Acceptance Criteria + type: numbered-list + instruction: Define criteria that include both new functionality and existing system integrity + item_template: "{{criterion_number}}: {{criteria}}" + - id: integration-verification + title: Integration Verification + instruction: Specific verification steps to ensure existing functionality remains intact + type: numbered-list + prefix: IV + items: + - template: "IV1: {{existing_functionality_verification}}" + - template: "IV2: {{integration_point_verification}}" + - template: "IV3: {{performance_impact_verification}}" +==================== END: .bmad-core/templates/brownfield-prd-tmpl.yaml ==================== + +==================== START: .bmad-core/templates/competitor-analysis-tmpl.yaml ==================== +template: + id: competitor-analysis-template-v2 + name: Competitive Analysis Report + version: 2.0 + output: + format: markdown + filename: docs/competitor-analysis.md + title: "Competitive Analysis Report: {{project_product_name}}" + +workflow: + mode: interactive + elicitation: advanced-elicitation + custom_elicitation: + title: "Competitive Analysis Elicitation Actions" + options: + - "Deep dive on a specific competitor's strategy" + - "Analyze competitive dynamics in a specific segment" + - "War game competitive responses to your moves" + - "Explore partnership vs. competition scenarios" + - "Stress test differentiation claims" + - "Analyze disruption potential (yours or theirs)" + - "Compare to competition in adjacent markets" + - "Generate win/loss analysis insights" + - "If only we had known about [competitor X's plan]..." + - "Proceed to next section" + +sections: + - id: executive-summary + title: Executive Summary + instruction: Provide high-level competitive insights, main threats and opportunities, and recommended strategic actions. Write this section LAST after completing all analysis. + + - id: analysis-scope + title: Analysis Scope & Methodology + instruction: This template guides comprehensive competitor analysis. Start by understanding the user's competitive intelligence needs and strategic objectives. Help them identify and prioritize competitors before diving into detailed analysis. + sections: + - id: analysis-purpose + title: Analysis Purpose + instruction: | + Define the primary purpose: + - New market entry assessment + - Product positioning strategy + - Feature gap analysis + - Pricing strategy development + - Partnership/acquisition targets + - Competitive threat assessment + - id: competitor-categories + title: Competitor Categories Analyzed + instruction: | + List categories included: + - Direct Competitors: Same product/service, same target market + - Indirect Competitors: Different product, same need/problem + - Potential Competitors: Could enter market easily + - Substitute Products: Alternative solutions + - Aspirational Competitors: Best-in-class examples + - id: research-methodology + title: Research Methodology + instruction: | + Describe approach: + - Information sources used + - Analysis timeframe + - Confidence levels + - Limitations + + - id: competitive-landscape + title: Competitive Landscape Overview + sections: + - id: market-structure + title: Market Structure + instruction: | + Describe the competitive environment: + - Number of active competitors + - Market concentration (fragmented/consolidated) + - Competitive dynamics + - Recent market entries/exits + - id: prioritization-matrix + title: Competitor Prioritization Matrix + instruction: | + Help categorize competitors by market share and strategic threat level + + Create a 2x2 matrix: + - Priority 1 (Core Competitors): High Market Share + High Threat + - Priority 2 (Emerging Threats): Low Market Share + High Threat + - Priority 3 (Established Players): High Market Share + Low Threat + - Priority 4 (Monitor Only): Low Market Share + Low Threat + + - id: competitor-profiles + title: Individual Competitor Profiles + instruction: Create detailed profiles for each Priority 1 and Priority 2 competitor. For Priority 3 and 4, create condensed profiles. + repeatable: true + sections: + - id: competitor + title: "{{competitor_name}} - Priority {{priority_level}}" + sections: + - id: company-overview + title: Company Overview + template: | + - **Founded:** {{year_founders}} + - **Headquarters:** {{location}} + - **Company Size:** {{employees_revenue}} + - **Funding:** {{total_raised_investors}} + - **Leadership:** {{key_executives}} + - id: business-model + title: Business Model & Strategy + template: | + - **Revenue Model:** {{revenue_model}} + - **Target Market:** {{customer_segments}} + - **Value Proposition:** {{value_promise}} + - **Go-to-Market Strategy:** {{gtm_approach}} + - **Strategic Focus:** {{current_priorities}} + - id: product-analysis + title: Product/Service Analysis + template: | + - **Core Offerings:** {{main_products}} + - **Key Features:** {{standout_capabilities}} + - **User Experience:** {{ux_assessment}} + - **Technology Stack:** {{tech_stack}} + - **Pricing:** {{pricing_model}} + - id: strengths-weaknesses + title: Strengths & Weaknesses + sections: + - id: strengths + title: Strengths + type: bullet-list + template: "- {{strength}}" + - id: weaknesses + title: Weaknesses + type: bullet-list + template: "- {{weakness}}" + - id: market-position + title: Market Position & Performance + template: | + - **Market Share:** {{market_share_estimate}} + - **Customer Base:** {{customer_size_notables}} + - **Growth Trajectory:** {{growth_trend}} + - **Recent Developments:** {{key_news}} + + - id: comparative-analysis + title: Comparative Analysis + sections: + - id: feature-comparison + title: Feature Comparison Matrix + instruction: Create a detailed comparison table of key features across competitors + type: table + columns: ["Feature Category", "{{your_company}}", "{{competitor_1}}", "{{competitor_2}}", "{{competitor_3}}"] + rows: + - category: "Core Functionality" + items: + - ["Feature A", "{{status}}", "{{status}}", "{{status}}", "{{status}}"] + - ["Feature B", "{{status}}", "{{status}}", "{{status}}", "{{status}}"] + - category: "User Experience" + items: + - ["Mobile App", "{{rating}}", "{{rating}}", "{{rating}}", "{{rating}}"] + - ["Onboarding Time", "{{time}}", "{{time}}", "{{time}}", "{{time}}"] + - category: "Integration & Ecosystem" + items: + - ["API Availability", "{{availability}}", "{{availability}}", "{{availability}}", "{{availability}}"] + - ["Third-party Integrations", "{{number}}", "{{number}}", "{{number}}", "{{number}}"] + - category: "Pricing & Plans" + items: + - ["Starting Price", "{{price}}", "{{price}}", "{{price}}", "{{price}}"] + - ["Free Tier", "{{yes_no}}", "{{yes_no}}", "{{yes_no}}", "{{yes_no}}"] + - id: swot-comparison + title: SWOT Comparison + instruction: Create SWOT analysis for your solution vs. top competitors + sections: + - id: your-solution + title: Your Solution + template: | + - **Strengths:** {{strengths}} + - **Weaknesses:** {{weaknesses}} + - **Opportunities:** {{opportunities}} + - **Threats:** {{threats}} + - id: vs-competitor + title: "vs. {{main_competitor}}" + template: | + - **Competitive Advantages:** {{your_advantages}} + - **Competitive Disadvantages:** {{their_advantages}} + - **Differentiation Opportunities:** {{differentiation}} + - id: positioning-map + title: Positioning Map + instruction: | + Describe competitor positions on key dimensions + + Create a positioning description using 2 key dimensions relevant to the market, such as: + - Price vs. Features + - Ease of Use vs. Power + - Specialization vs. Breadth + - Self-Serve vs. High-Touch + + - id: strategic-analysis + title: Strategic Analysis + sections: + - id: competitive-advantages + title: Competitive Advantages Assessment + sections: + - id: sustainable-advantages + title: Sustainable Advantages + instruction: | + Identify moats and defensible positions: + - Network effects + - Switching costs + - Brand strength + - Technology barriers + - Regulatory advantages + - id: vulnerable-points + title: Vulnerable Points + instruction: | + Where competitors could be challenged: + - Weak customer segments + - Missing features + - Poor user experience + - High prices + - Limited geographic presence + - id: blue-ocean + title: Blue Ocean Opportunities + instruction: | + Identify uncontested market spaces + + List opportunities to create new market space: + - Underserved segments + - Unaddressed use cases + - New business models + - Geographic expansion + - Different value propositions + + - id: strategic-recommendations + title: Strategic Recommendations + sections: + - id: differentiation-strategy + title: Differentiation Strategy + instruction: | + How to position against competitors: + - Unique value propositions to emphasize + - Features to prioritize + - Segments to target + - Messaging and positioning + - id: competitive-response + title: Competitive Response Planning + sections: + - id: offensive-strategies + title: Offensive Strategies + instruction: | + How to gain market share: + - Target competitor weaknesses + - Win competitive deals + - Capture their customers + - id: defensive-strategies + title: Defensive Strategies + instruction: | + How to protect your position: + - Strengthen vulnerable areas + - Build switching costs + - Deepen customer relationships + - id: partnership-ecosystem + title: Partnership & Ecosystem Strategy + instruction: | + Potential collaboration opportunities: + - Complementary players + - Channel partners + - Technology integrations + - Strategic alliances + + - id: monitoring-plan + title: Monitoring & Intelligence Plan + sections: + - id: key-competitors + title: Key Competitors to Track + instruction: Priority list with rationale + - id: monitoring-metrics + title: Monitoring Metrics + instruction: | + What to track: + - Product updates + - Pricing changes + - Customer wins/losses + - Funding/M&A activity + - Market messaging + - id: intelligence-sources + title: Intelligence Sources + instruction: | + Where to gather ongoing intelligence: + - Company websites/blogs + - Customer reviews + - Industry reports + - Social media + - Patent filings + - id: update-cadence + title: Update Cadence + instruction: | + Recommended review schedule: + - Weekly: {{weekly_items}} + - Monthly: {{monthly_items}} + - Quarterly: {{quarterly_analysis}} +==================== END: .bmad-core/templates/competitor-analysis-tmpl.yaml ==================== + +==================== START: .bmad-core/templates/front-end-architecture-tmpl.yaml ==================== +template: + id: frontend-architecture-template-v2 + name: Frontend Architecture Document + version: 2.0 + output: + format: markdown + filename: docs/ui-architecture.md + title: "{{project_name}} Frontend Architecture Document" + +workflow: + mode: interactive + elicitation: advanced-elicitation + +sections: + - id: template-framework-selection + title: Template and Framework Selection + instruction: | + Review provided documents including PRD, UX-UI Specification, and main Architecture Document. Focus on extracting technical implementation details needed for AI frontend tools and developer agents. Ask the user for any of these documents if you are unable to locate and were not provided. + + Before proceeding with frontend architecture design, check if the project is using a frontend starter template or existing codebase: + + 1. Review the PRD, main architecture document, and brainstorming brief for mentions of: + - Frontend starter templates (e.g., Create React App, Next.js, Vite, Vue CLI, Angular CLI, etc.) + - UI kit or component library starters + - Existing frontend projects being used as a foundation + - Admin dashboard templates or other specialized starters + - Design system implementations + + 2. If a frontend starter template or existing project is mentioned: + - Ask the user to provide access via one of these methods: + - Link to the starter template documentation + - Upload/attach the project files (for small projects) + - Share a link to the project repository + - Analyze the starter/existing project to understand: + - Pre-installed dependencies and versions + - Folder structure and file organization + - Built-in components and utilities + - Styling approach (CSS modules, styled-components, Tailwind, etc.) + - State management setup (if any) + - Routing configuration + - Testing setup and patterns + - Build and development scripts + - Use this analysis to ensure your frontend architecture aligns with the starter's patterns + + 3. If no frontend starter is mentioned but this is a new UI, ensure we know what the ui language and framework is: + - Based on the framework choice, suggest appropriate starters: + - React: Create React App, Next.js, Vite + React + - Vue: Vue CLI, Nuxt.js, Vite + Vue + - Angular: Angular CLI + - Or suggest popular UI templates if applicable + - Explain benefits specific to frontend development + + 4. If the user confirms no starter template will be used: + - Note that all tooling, bundling, and configuration will need manual setup + - Proceed with frontend architecture from scratch + + Document the starter template decision and any constraints it imposes before proceeding. + sections: + - id: changelog + title: Change Log + type: table + columns: [Date, Version, Description, Author] + instruction: Track document versions and changes + + - id: frontend-tech-stack + title: Frontend Tech Stack + instruction: Extract from main architecture's Technology Stack Table. This section MUST remain synchronized with the main architecture document. + elicit: true + sections: + - id: tech-stack-table + title: Technology Stack Table + type: table + columns: [Category, Technology, Version, Purpose, Rationale] + instruction: Fill in appropriate technology choices based on the selected framework and project requirements. + rows: + - ["Framework", "{{framework}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] + - ["UI Library", "{{ui_library}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] + - ["State Management", "{{state_management}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] + - ["Routing", "{{routing_library}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] + - ["Build Tool", "{{build_tool}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] + - ["Styling", "{{styling_solution}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] + - ["Testing", "{{test_framework}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] + - ["Component Library", "{{component_lib}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] + - ["Form Handling", "{{form_library}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] + - ["Animation", "{{animation_lib}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] + - ["Dev Tools", "{{dev_tools}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] + + - id: project-structure + title: Project Structure + instruction: Define exact directory structure for AI tools based on the chosen framework. Be specific about where each type of file goes. Generate a structure that follows the framework's best practices and conventions. + elicit: true + type: code + language: plaintext + + - id: component-standards + title: Component Standards + instruction: Define exact patterns for component creation based on the chosen framework. + elicit: true + sections: + - id: component-template + title: Component Template + instruction: Generate a minimal but complete component template following the framework's best practices. Include TypeScript types, proper imports, and basic structure. + type: code + language: typescript + - id: naming-conventions + title: Naming Conventions + instruction: Provide naming conventions specific to the chosen framework for components, files, services, state management, and other architectural elements. + + - id: state-management + title: State Management + instruction: Define state management patterns based on the chosen framework. + elicit: true + sections: + - id: store-structure + title: Store Structure + instruction: Generate the state management directory structure appropriate for the chosen framework and selected state management solution. + type: code + language: plaintext + - id: state-template + title: State Management Template + instruction: Provide a basic state management template/example following the framework's recommended patterns. Include TypeScript types and common operations like setting, updating, and clearing state. + type: code + language: typescript + + - id: api-integration + title: API Integration + instruction: Define API service patterns based on the chosen framework. + elicit: true + sections: + - id: service-template + title: Service Template + instruction: Provide an API service template that follows the framework's conventions. Include proper TypeScript types, error handling, and async patterns. + type: code + language: typescript + - id: api-client-config + title: API Client Configuration + instruction: Show how to configure the HTTP client for the chosen framework, including authentication interceptors/middleware and error handling. + type: code + language: typescript + + - id: routing + title: Routing + instruction: Define routing structure and patterns based on the chosen framework. + elicit: true + sections: + - id: route-configuration + title: Route Configuration + instruction: Provide routing configuration appropriate for the chosen framework. Include protected route patterns, lazy loading where applicable, and authentication guards/middleware. + type: code + language: typescript + + - id: styling-guidelines + title: Styling Guidelines + instruction: Define styling approach based on the chosen framework. + elicit: true + sections: + - id: styling-approach + title: Styling Approach + instruction: Describe the styling methodology appropriate for the chosen framework (CSS Modules, Styled Components, Tailwind, etc.) and provide basic patterns. + - id: global-theme + title: Global Theme Variables + instruction: Provide a CSS custom properties (CSS variables) theme system that works across all frameworks. Include colors, spacing, typography, shadows, and dark mode support. + type: code + language: css + + - id: testing-requirements + title: Testing Requirements + instruction: Define minimal testing requirements based on the chosen framework. + elicit: true + sections: + - id: component-test-template + title: Component Test Template + instruction: Provide a basic component test template using the framework's recommended testing library. Include examples of rendering tests, user interaction tests, and mocking. + type: code + language: typescript + - id: testing-best-practices + title: Testing Best Practices + type: numbered-list + items: + - "**Unit Tests**: Test individual components in isolation" + - "**Integration Tests**: Test component interactions" + - "**E2E Tests**: Test critical user flows (using Cypress/Playwright)" + - "**Coverage Goals**: Aim for 80% code coverage" + - "**Test Structure**: Arrange-Act-Assert pattern" + - "**Mock External Dependencies**: API calls, routing, state management" + + - id: environment-configuration + title: Environment Configuration + instruction: List required environment variables based on the chosen framework. Show the appropriate format and naming conventions for the framework. + elicit: true + + - id: frontend-developer-standards + title: Frontend Developer Standards + sections: + - id: critical-coding-rules + title: Critical Coding Rules + instruction: List essential rules that prevent common AI mistakes, including both universal rules and framework-specific ones. + elicit: true + - id: quick-reference + title: Quick Reference + instruction: | + Create a framework-specific cheat sheet with: + - Common commands (dev server, build, test) + - Key import patterns + - File naming conventions + - Project-specific patterns and utilities +==================== END: .bmad-core/templates/front-end-architecture-tmpl.yaml ==================== + +==================== START: .bmad-core/templates/front-end-spec-tmpl.yaml ==================== +template: + id: frontend-spec-template-v2 + name: UI/UX Specification + version: 2.0 + output: + format: markdown + filename: docs/front-end-spec.md + title: "{{project_name}} UI/UX Specification" + +workflow: + mode: interactive + elicitation: advanced-elicitation + +sections: + - id: introduction + title: Introduction + instruction: | + Review provided documents including Project Brief, PRD, and any user research to gather context. Focus on understanding user needs, pain points, and desired outcomes before beginning the specification. + + Establish the document's purpose and scope. Keep the content below but ensure project name is properly substituted. + content: | + This document defines the user experience goals, information architecture, user flows, and visual design specifications for {{project_name}}'s user interface. It serves as the foundation for visual design and frontend development, ensuring a cohesive and user-centered experience. + sections: + - id: ux-goals-principles + title: Overall UX Goals & Principles + instruction: | + Work with the user to establish and document the following. If not already defined, facilitate a discussion to determine: + + 1. Target User Personas - elicit details or confirm existing ones from PRD + 2. Key Usability Goals - understand what success looks like for users + 3. Core Design Principles - establish 3-5 guiding principles + elicit: true + sections: + - id: user-personas + title: Target User Personas + template: "{{persona_descriptions}}" + examples: + - "**Power User:** Technical professionals who need advanced features and efficiency" + - "**Casual User:** Occasional users who prioritize ease of use and clear guidance" + - "**Administrator:** System managers who need control and oversight capabilities" + - id: usability-goals + title: Usability Goals + template: "{{usability_goals}}" + examples: + - "Ease of learning: New users can complete core tasks within 5 minutes" + - "Efficiency of use: Power users can complete frequent tasks with minimal clicks" + - "Error prevention: Clear validation and confirmation for destructive actions" + - "Memorability: Infrequent users can return without relearning" + - id: design-principles + title: Design Principles + template: "{{design_principles}}" + type: numbered-list + examples: + - "**Clarity over cleverness** - Prioritize clear communication over aesthetic innovation" + - "**Progressive disclosure** - Show only what's needed, when it's needed" + - "**Consistent patterns** - Use familiar UI patterns throughout the application" + - "**Immediate feedback** - Every action should have a clear, immediate response" + - "**Accessible by default** - Design for all users from the start" + - id: changelog + title: Change Log + type: table + columns: [Date, Version, Description, Author] + instruction: Track document versions and changes + + - id: information-architecture + title: Information Architecture (IA) + instruction: | + Collaborate with the user to create a comprehensive information architecture: + + 1. Build a Site Map or Screen Inventory showing all major areas + 2. Define the Navigation Structure (primary, secondary, breadcrumbs) + 3. Use Mermaid diagrams for visual representation + 4. Consider user mental models and expected groupings + elicit: true + sections: + - id: sitemap + title: Site Map / Screen Inventory + type: mermaid + mermaid_type: graph + template: "{{sitemap_diagram}}" + examples: + - | + graph TD + A[Homepage] --> B[Dashboard] + A --> C[Products] + A --> D[Account] + B --> B1[Analytics] + B --> B2[Recent Activity] + C --> C1[Browse] + C --> C2[Search] + C --> C3[Product Details] + D --> D1[Profile] + D --> D2[Settings] + D --> D3[Billing] + - id: navigation-structure + title: Navigation Structure + template: | + **Primary Navigation:** {{primary_nav_description}} + + **Secondary Navigation:** {{secondary_nav_description}} + + **Breadcrumb Strategy:** {{breadcrumb_strategy}} + + - id: user-flows + title: User Flows + instruction: | + For each critical user task identified in the PRD: + + 1. Define the user's goal clearly + 2. Map out all steps including decision points + 3. Consider edge cases and error states + 4. Use Mermaid flow diagrams for clarity + 5. Link to external tools (Figma/Miro) if detailed flows exist there + + Create subsections for each major flow. + elicit: true + repeatable: true + sections: + - id: flow + title: "{{flow_name}}" + template: | + **User Goal:** {{flow_goal}} + + **Entry Points:** {{entry_points}} + + **Success Criteria:** {{success_criteria}} + sections: + - id: flow-diagram + title: Flow Diagram + type: mermaid + mermaid_type: graph + template: "{{flow_diagram}}" + - id: edge-cases + title: "Edge Cases & Error Handling:" + type: bullet-list + template: "- {{edge_case}}" + - id: notes + template: "**Notes:** {{flow_notes}}" + + - id: wireframes-mockups + title: Wireframes & Mockups + instruction: | + Clarify where detailed visual designs will be created (Figma, Sketch, etc.) and how to reference them. If low-fidelity wireframes are needed, offer to help conceptualize layouts for key screens. + elicit: true + sections: + - id: design-files + template: "**Primary Design Files:** {{design_tool_link}}" + - id: key-screen-layouts + title: Key Screen Layouts + repeatable: true + sections: + - id: screen + title: "{{screen_name}}" + template: | + **Purpose:** {{screen_purpose}} + + **Key Elements:** + - {{element_1}} + - {{element_2}} + - {{element_3}} + + **Interaction Notes:** {{interaction_notes}} + + **Design File Reference:** {{specific_frame_link}} + + - id: component-library + title: Component Library / Design System + instruction: | + Discuss whether to use an existing design system or create a new one. If creating new, identify foundational components and their key states. Note that detailed technical specs belong in front-end-architecture. + elicit: true + sections: + - id: design-system-approach + template: "**Design System Approach:** {{design_system_approach}}" + - id: core-components + title: Core Components + repeatable: true + sections: + - id: component + title: "{{component_name}}" + template: | + **Purpose:** {{component_purpose}} + + **Variants:** {{component_variants}} + + **States:** {{component_states}} + + **Usage Guidelines:** {{usage_guidelines}} + + - id: branding-style + title: Branding & Style Guide + instruction: Link to existing style guide or define key brand elements. Ensure consistency with company brand guidelines if they exist. + elicit: true + sections: + - id: visual-identity + title: Visual Identity + template: "**Brand Guidelines:** {{brand_guidelines_link}}" + - id: color-palette + title: Color Palette + type: table + columns: ["Color Type", "Hex Code", "Usage"] + rows: + - ["Primary", "{{primary_color}}", "{{primary_usage}}"] + - ["Secondary", "{{secondary_color}}", "{{secondary_usage}}"] + - ["Accent", "{{accent_color}}", "{{accent_usage}}"] + - ["Success", "{{success_color}}", "Positive feedback, confirmations"] + - ["Warning", "{{warning_color}}", "Cautions, important notices"] + - ["Error", "{{error_color}}", "Errors, destructive actions"] + - ["Neutral", "{{neutral_colors}}", "Text, borders, backgrounds"] + - id: typography + title: Typography + sections: + - id: font-families + title: Font Families + template: | + - **Primary:** {{primary_font}} + - **Secondary:** {{secondary_font}} + - **Monospace:** {{mono_font}} + - id: type-scale + title: Type Scale + type: table + columns: ["Element", "Size", "Weight", "Line Height"] + rows: + - ["H1", "{{h1_size}}", "{{h1_weight}}", "{{h1_line}}"] + - ["H2", "{{h2_size}}", "{{h2_weight}}", "{{h2_line}}"] + - ["H3", "{{h3_size}}", "{{h3_weight}}", "{{h3_line}}"] + - ["Body", "{{body_size}}", "{{body_weight}}", "{{body_line}}"] + - ["Small", "{{small_size}}", "{{small_weight}}", "{{small_line}}"] + - id: iconography + title: Iconography + template: | + **Icon Library:** {{icon_library}} + + **Usage Guidelines:** {{icon_guidelines}} + - id: spacing-layout + title: Spacing & Layout + template: | + **Grid System:** {{grid_system}} + + **Spacing Scale:** {{spacing_scale}} + + - id: accessibility + title: Accessibility Requirements + instruction: Define specific accessibility requirements based on target compliance level and user needs. Be comprehensive but practical. + elicit: true + sections: + - id: compliance-target + title: Compliance Target + template: "**Standard:** {{compliance_standard}}" + - id: key-requirements + title: Key Requirements + template: | + **Visual:** + - Color contrast ratios: {{contrast_requirements}} + - Focus indicators: {{focus_requirements}} + - Text sizing: {{text_requirements}} + + **Interaction:** + - Keyboard navigation: {{keyboard_requirements}} + - Screen reader support: {{screen_reader_requirements}} + - Touch targets: {{touch_requirements}} + + **Content:** + - Alternative text: {{alt_text_requirements}} + - Heading structure: {{heading_requirements}} + - Form labels: {{form_requirements}} + - id: testing-strategy + title: Testing Strategy + template: "{{accessibility_testing}}" + + - id: responsiveness + title: Responsiveness Strategy + instruction: Define breakpoints and adaptation strategies for different device sizes. Consider both technical constraints and user contexts. + elicit: true + sections: + - id: breakpoints + title: Breakpoints + type: table + columns: ["Breakpoint", "Min Width", "Max Width", "Target Devices"] + rows: + - ["Mobile", "{{mobile_min}}", "{{mobile_max}}", "{{mobile_devices}}"] + - ["Tablet", "{{tablet_min}}", "{{tablet_max}}", "{{tablet_devices}}"] + - ["Desktop", "{{desktop_min}}", "{{desktop_max}}", "{{desktop_devices}}"] + - ["Wide", "{{wide_min}}", "-", "{{wide_devices}}"] + - id: adaptation-patterns + title: Adaptation Patterns + template: | + **Layout Changes:** {{layout_adaptations}} + + **Navigation Changes:** {{nav_adaptations}} + + **Content Priority:** {{content_adaptations}} + + **Interaction Changes:** {{interaction_adaptations}} + + - id: animation + title: Animation & Micro-interactions + instruction: Define motion design principles and key interactions. Keep performance and accessibility in mind. + elicit: true + sections: + - id: motion-principles + title: Motion Principles + template: "{{motion_principles}}" + - id: key-animations + title: Key Animations + repeatable: true + template: "- **{{animation_name}}:** {{animation_description}} (Duration: {{duration}}, Easing: {{easing}})" + + - id: performance + title: Performance Considerations + instruction: Define performance goals and strategies that impact UX design decisions. + sections: + - id: performance-goals + title: Performance Goals + template: | + - **Page Load:** {{load_time_goal}} + - **Interaction Response:** {{interaction_goal}} + - **Animation FPS:** {{animation_goal}} + - id: design-strategies + title: Design Strategies + template: "{{performance_strategies}}" + + - id: next-steps + title: Next Steps + instruction: | + After completing the UI/UX specification: + + 1. Recommend review with stakeholders + 2. Suggest creating/updating visual designs in design tool + 3. Prepare for handoff to Design Architect for frontend architecture + 4. Note any open questions or decisions needed + sections: + - id: immediate-actions + title: Immediate Actions + type: numbered-list + template: "{{action}}" + - id: design-handoff-checklist + title: Design Handoff Checklist + type: checklist + items: + - "All user flows documented" + - "Component inventory complete" + - "Accessibility requirements defined" + - "Responsive strategy clear" + - "Brand guidelines incorporated" + - "Performance goals established" + + - id: checklist-results + title: Checklist Results + instruction: If a UI/UX checklist exists, run it against this document and report results here. +==================== END: .bmad-core/templates/front-end-spec-tmpl.yaml ==================== + +==================== START: .bmad-core/templates/fullstack-architecture-tmpl.yaml ==================== +template: + id: fullstack-architecture-template-v2 + name: Fullstack Architecture Document + version: 2.0 + output: + format: markdown + filename: docs/architecture.md + title: "{{project_name}} Fullstack Architecture Document" + +workflow: + mode: interactive + elicitation: advanced-elicitation + +sections: + - id: introduction + title: Introduction + instruction: | + If available, review any provided relevant documents to gather all relevant context before beginning. At minimum, you should have access to docs/prd.md and docs/front-end-spec.md. Ask the user for any documents you need but cannot locate. This template creates a unified architecture that covers both backend and frontend concerns to guide AI-driven fullstack development. + elicit: true + content: | + This document outlines the complete fullstack architecture for {{project_name}}, including backend systems, frontend implementation, and their integration. It serves as the single source of truth for AI-driven development, ensuring consistency across the entire technology stack. + + This unified approach combines what would traditionally be separate backend and frontend architecture documents, streamlining the development process for modern fullstack applications where these concerns are increasingly intertwined. + sections: + - id: starter-template + title: Starter Template or Existing Project + instruction: | + Before proceeding with architecture design, check if the project is based on any starter templates or existing codebases: + + 1. Review the PRD and other documents for mentions of: + - Fullstack starter templates (e.g., T3 Stack, MEAN/MERN starters, Django + React templates) + - Monorepo templates (e.g., Nx, Turborepo starters) + - Platform-specific starters (e.g., Vercel templates, AWS Amplify starters) + - Existing projects being extended or cloned + + 2. If starter templates or existing projects are mentioned: + - Ask the user to provide access (links, repos, or files) + - Analyze to understand pre-configured choices and constraints + - Note any architectural decisions already made + - Identify what can be modified vs what must be retained + + 3. If no starter is mentioned but this is greenfield: + - Suggest appropriate fullstack starters based on tech preferences + - Consider platform-specific options (Vercel, AWS, etc.) + - Let user decide whether to use one + + 4. Document the decision and any constraints it imposes + + If none, state "N/A - Greenfield project" + - id: changelog + title: Change Log + type: table + columns: [Date, Version, Description, Author] + instruction: Track document versions and changes + + - id: high-level-architecture + title: High Level Architecture + instruction: This section contains multiple subsections that establish the foundation. Present all subsections together, then elicit feedback on the complete section. + elicit: true + sections: + - id: technical-summary + title: Technical Summary + instruction: | + Provide a comprehensive overview (4-6 sentences) covering: + - Overall architectural style and deployment approach + - Frontend framework and backend technology choices + - Key integration points between frontend and backend + - Infrastructure platform and services + - How this architecture achieves PRD goals + - id: platform-infrastructure + title: Platform and Infrastructure Choice + instruction: | + Based on PRD requirements and technical assumptions, make a platform recommendation: + + 1. Consider common patterns (not an exhaustive list, use your own best judgement and search the web as needed for emerging trends): + - **Vercel + Supabase**: For rapid development with Next.js, built-in auth/storage + - **AWS Full Stack**: For enterprise scale with Lambda, API Gateway, S3, Cognito + - **Azure**: For .NET ecosystems or enterprise Microsoft environments + - **Google Cloud**: For ML/AI heavy applications or Google ecosystem integration + + 2. Present 2-3 viable options with clear pros/cons + 3. Make a recommendation with rationale + 4. Get explicit user confirmation + + Document the choice and key services that will be used. + template: | + **Platform:** {{selected_platform}} + **Key Services:** {{core_services_list}} + **Deployment Host and Regions:** {{regions}} + - id: repository-structure + title: Repository Structure + instruction: | + Define the repository approach based on PRD requirements and platform choice, explain your rationale or ask questions to the user if unsure: + + 1. For modern fullstack apps, monorepo is often preferred + 2. Consider tooling (Nx, Turborepo, Lerna, npm workspaces) + 3. Define package/app boundaries + 4. Plan for shared code between frontend and backend + template: | + **Structure:** {{repo_structure_choice}} + **Monorepo Tool:** {{monorepo_tool_if_applicable}} + **Package Organization:** {{package_strategy}} + - id: architecture-diagram + title: High Level Architecture Diagram + type: mermaid + mermaid_type: graph + instruction: | + Create a Mermaid diagram showing the complete system architecture including: + - User entry points (web, mobile) + - Frontend application deployment + - API layer (REST/GraphQL) + - Backend services + - Databases and storage + - External integrations + - CDN and caching layers + + Use appropriate diagram type for clarity. + - id: architectural-patterns + title: Architectural Patterns + instruction: | + List patterns that will guide both frontend and backend development. Include patterns for: + - Overall architecture (e.g., Jamstack, Serverless, Microservices) + - Frontend patterns (e.g., Component-based, State management) + - Backend patterns (e.g., Repository, CQRS, Event-driven) + - Integration patterns (e.g., BFF, API Gateway) + + For each pattern, provide recommendation and rationale. + repeatable: true + template: "- **{{pattern_name}}:** {{pattern_description}} - _Rationale:_ {{rationale}}" + examples: + - "**Jamstack Architecture:** Static site generation with serverless APIs - _Rationale:_ Optimal performance and scalability for content-heavy applications" + - "**Component-Based UI:** Reusable React components with TypeScript - _Rationale:_ Maintainability and type safety across large codebases" + - "**Repository Pattern:** Abstract data access logic - _Rationale:_ Enables testing and future database migration flexibility" + - "**API Gateway Pattern:** Single entry point for all API calls - _Rationale:_ Centralized auth, rate limiting, and monitoring" + + - id: tech-stack + title: Tech Stack + instruction: | + This is the DEFINITIVE technology selection for the entire project. Work with user to finalize all choices. This table is the single source of truth - all development must use these exact versions. + + Key areas to cover: + - Frontend and backend languages/frameworks + - Databases and caching + - Authentication and authorization + - API approach + - Testing tools for both frontend and backend + - Build and deployment tools + - Monitoring and logging + + Upon render, elicit feedback immediately. + elicit: true + sections: + - id: tech-stack-table + title: Technology Stack Table + type: table + columns: [Category, Technology, Version, Purpose, Rationale] + rows: + - ["Frontend Language", "{{fe_language}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] + - ["Frontend Framework", "{{fe_framework}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] + - ["UI Component Library", "{{ui_library}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] + - ["State Management", "{{state_mgmt}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] + - ["Backend Language", "{{be_language}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] + - ["Backend Framework", "{{be_framework}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] + - ["API Style", "{{api_style}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] + - ["Database", "{{database}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] + - ["Cache", "{{cache}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] + - ["File Storage", "{{storage}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] + - ["Authentication", "{{auth}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] + - ["Frontend Testing", "{{fe_test}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] + - ["Backend Testing", "{{be_test}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] + - ["E2E Testing", "{{e2e_test}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] + - ["Build Tool", "{{build_tool}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] + - ["Bundler", "{{bundler}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] + - ["IaC Tool", "{{iac_tool}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] + - ["CI/CD", "{{cicd}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] + - ["Monitoring", "{{monitoring}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] + - ["Logging", "{{logging}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] + - ["CSS Framework", "{{css_framework}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] + + - id: data-models + title: Data Models + instruction: | + Define the core data models/entities that will be shared between frontend and backend: + + 1. Review PRD requirements and identify key business entities + 2. For each model, explain its purpose and relationships + 3. Include key attributes and data types + 4. Show relationships between models + 5. Create TypeScript interfaces that can be shared + 6. Discuss design decisions with user + + Create a clear conceptual model before moving to database schema. + elicit: true + repeatable: true + sections: + - id: model + title: "{{model_name}}" + template: | + **Purpose:** {{model_purpose}} + + **Key Attributes:** + - {{attribute_1}}: {{type_1}} - {{description_1}} + - {{attribute_2}}: {{type_2}} - {{description_2}} + sections: + - id: typescript-interface + title: TypeScript Interface + type: code + language: typescript + template: "{{model_interface}}" + - id: relationships + title: Relationships + type: bullet-list + template: "- {{relationship}}" + + - id: api-spec + title: API Specification + instruction: | + Based on the chosen API style from Tech Stack: + + 1. If REST API, create an OpenAPI 3.0 specification + 2. If GraphQL, provide the GraphQL schema + 3. If tRPC, show router definitions + 4. Include all endpoints from epics/stories + 5. Define request/response schemas based on data models + 6. Document authentication requirements + 7. Include example requests/responses + + Use appropriate format for the chosen API style. If no API (e.g., static site), skip this section. + elicit: true + sections: + - id: rest-api + title: REST API Specification + condition: API style is REST + type: code + language: yaml + template: | + openapi: 3.0.0 + info: + title: {{api_title}} + version: {{api_version}} + description: {{api_description}} + servers: + - url: {{server_url}} + description: {{server_description}} + - id: graphql-api + title: GraphQL Schema + condition: API style is GraphQL + type: code + language: graphql + template: "{{graphql_schema}}" + - id: trpc-api + title: tRPC Router Definitions + condition: API style is tRPC + type: code + language: typescript + template: "{{trpc_routers}}" + + - id: components + title: Components + instruction: | + Based on the architectural patterns, tech stack, and data models from above: + + 1. Identify major logical components/services across the fullstack + 2. Consider both frontend and backend components + 3. Define clear boundaries and interfaces between components + 4. For each component, specify: + - Primary responsibility + - Key interfaces/APIs exposed + - Dependencies on other components + - Technology specifics based on tech stack choices + + 5. Create component diagrams where helpful + elicit: true + sections: + - id: component-list + repeatable: true + title: "{{component_name}}" + template: | + **Responsibility:** {{component_description}} + + **Key Interfaces:** + - {{interface_1}} + - {{interface_2}} + + **Dependencies:** {{dependencies}} + + **Technology Stack:** {{component_tech_details}} + - id: component-diagrams + title: Component Diagrams + type: mermaid + instruction: | + Create Mermaid diagrams to visualize component relationships. Options: + - C4 Container diagram for high-level view + - Component diagram for detailed internal structure + - Sequence diagrams for complex interactions + Choose the most appropriate for clarity + + - id: external-apis + title: External APIs + condition: Project requires external API integrations + instruction: | + For each external service integration: + + 1. Identify APIs needed based on PRD requirements and component design + 2. If documentation URLs are unknown, ask user for specifics + 3. Document authentication methods and security considerations + 4. List specific endpoints that will be used + 5. Note any rate limits or usage constraints + + If no external APIs are needed, state this explicitly and skip to next section. + elicit: true + repeatable: true + sections: + - id: api + title: "{{api_name}} API" + template: | + - **Purpose:** {{api_purpose}} + - **Documentation:** {{api_docs_url}} + - **Base URL(s):** {{api_base_url}} + - **Authentication:** {{auth_method}} + - **Rate Limits:** {{rate_limits}} + + **Key Endpoints Used:** + - `{{method}} {{endpoint_path}}` - {{endpoint_purpose}} + + **Integration Notes:** {{integration_considerations}} + + - id: core-workflows + title: Core Workflows + type: mermaid + mermaid_type: sequence + instruction: | + Illustrate key system workflows using sequence diagrams: + + 1. Identify critical user journeys from PRD + 2. Show component interactions including external APIs + 3. Include both frontend and backend flows + 4. Include error handling paths + 5. Document async operations + 6. Create both high-level and detailed diagrams as needed + + Focus on workflows that clarify architecture decisions or complex interactions. + elicit: true + + - id: database-schema + title: Database Schema + instruction: | + Transform the conceptual data models into concrete database schemas: + + 1. Use the database type(s) selected in Tech Stack + 2. Create schema definitions using appropriate notation + 3. Include indexes, constraints, and relationships + 4. Consider performance and scalability + 5. For NoSQL, show document structures + + Present schema in format appropriate to database type (SQL DDL, JSON schema, etc.) + elicit: true + + - id: frontend-architecture + title: Frontend Architecture + instruction: Define frontend-specific architecture details. After each subsection, note if user wants to refine before continuing. + elicit: true + sections: + - id: component-architecture + title: Component Architecture + instruction: Define component organization and patterns based on chosen framework. + sections: + - id: component-organization + title: Component Organization + type: code + language: text + template: "{{component_structure}}" + - id: component-template + title: Component Template + type: code + language: typescript + template: "{{component_template}}" + - id: state-management + title: State Management Architecture + instruction: Detail state management approach based on chosen solution. + sections: + - id: state-structure + title: State Structure + type: code + language: typescript + template: "{{state_structure}}" + - id: state-patterns + title: State Management Patterns + type: bullet-list + template: "- {{pattern}}" + - id: routing-architecture + title: Routing Architecture + instruction: Define routing structure based on framework choice. + sections: + - id: route-organization + title: Route Organization + type: code + language: text + template: "{{route_structure}}" + - id: protected-routes + title: Protected Route Pattern + type: code + language: typescript + template: "{{protected_route_example}}" + - id: frontend-services + title: Frontend Services Layer + instruction: Define how frontend communicates with backend. + sections: + - id: api-client-setup + title: API Client Setup + type: code + language: typescript + template: "{{api_client_setup}}" + - id: service-example + title: Service Example + type: code + language: typescript + template: "{{service_example}}" + + - id: backend-architecture + title: Backend Architecture + instruction: Define backend-specific architecture details. Consider serverless vs traditional server approaches. + elicit: true + sections: + - id: service-architecture + title: Service Architecture + instruction: Based on platform choice, define service organization. + sections: + - id: serverless-architecture + condition: Serverless architecture chosen + sections: + - id: function-organization + title: Function Organization + type: code + language: text + template: "{{function_structure}}" + - id: function-template + title: Function Template + type: code + language: typescript + template: "{{function_template}}" + - id: traditional-server + condition: Traditional server architecture chosen + sections: + - id: controller-organization + title: Controller/Route Organization + type: code + language: text + template: "{{controller_structure}}" + - id: controller-template + title: Controller Template + type: code + language: typescript + template: "{{controller_template}}" + - id: database-architecture + title: Database Architecture + instruction: Define database schema and access patterns. + sections: + - id: schema-design + title: Schema Design + type: code + language: sql + template: "{{database_schema}}" + - id: data-access-layer + title: Data Access Layer + type: code + language: typescript + template: "{{repository_pattern}}" + - id: auth-architecture + title: Authentication and Authorization + instruction: Define auth implementation details. + sections: + - id: auth-flow + title: Auth Flow + type: mermaid + mermaid_type: sequence + template: "{{auth_flow_diagram}}" + - id: auth-middleware + title: Middleware/Guards + type: code + language: typescript + template: "{{auth_middleware}}" + + - id: unified-project-structure + title: Unified Project Structure + instruction: Create a monorepo structure that accommodates both frontend and backend. Adapt based on chosen tools and frameworks. + elicit: true + type: code + language: plaintext + examples: + - | + {{project-name}}/ + ├── .github/ # CI/CD workflows + │ └── workflows/ + │ ├── ci.yaml + │ └── deploy.yaml + ├── apps/ # Application packages + │ ├── web/ # Frontend application + │ │ ├── src/ + │ │ │ ├── components/ # UI components + │ │ │ ├── pages/ # Page components/routes + │ │ │ ├── hooks/ # Custom React hooks + │ │ │ ├── services/ # API client services + │ │ │ ├── stores/ # State management + │ │ │ ├── styles/ # Global styles/themes + │ │ │ └── utils/ # Frontend utilities + │ │ ├── public/ # Static assets + │ │ ├── tests/ # Frontend tests + │ │ └── package.json + │ └── api/ # Backend application + │ ├── src/ + │ │ ├── routes/ # API routes/controllers + │ │ ├── services/ # Business logic + │ │ ├── models/ # Data models + │ │ ├── middleware/ # Express/API middleware + │ │ ├── utils/ # Backend utilities + │ │ └── {{serverless_or_server_entry}} + │ ├── tests/ # Backend tests + │ └── package.json + ├── packages/ # Shared packages + │ ├── shared/ # Shared types/utilities + │ │ ├── src/ + │ │ │ ├── types/ # TypeScript interfaces + │ │ │ ├── constants/ # Shared constants + │ │ │ └── utils/ # Shared utilities + │ │ └── package.json + │ ├── ui/ # Shared UI components + │ │ ├── src/ + │ │ └── package.json + │ └── config/ # Shared configuration + │ ├── eslint/ + │ ├── typescript/ + │ └── jest/ + ├── infrastructure/ # IaC definitions + │ └── {{iac_structure}} + ├── scripts/ # Build/deploy scripts + ├── docs/ # Documentation + │ ├── prd.md + │ ├── front-end-spec.md + │ └── fullstack-architecture.md + ├── .env.example # Environment template + ├── package.json # Root package.json + ├── {{monorepo_config}} # Monorepo configuration + └── README.md + + - id: development-workflow + title: Development Workflow + instruction: Define the development setup and workflow for the fullstack application. + elicit: true + sections: + - id: local-setup + title: Local Development Setup + sections: + - id: prerequisites + title: Prerequisites + type: code + language: bash + template: "{{prerequisites_commands}}" + - id: initial-setup + title: Initial Setup + type: code + language: bash + template: "{{setup_commands}}" + - id: dev-commands + title: Development Commands + type: code + language: bash + template: | + # Start all services + {{start_all_command}} + + # Start frontend only + {{start_frontend_command}} + + # Start backend only + {{start_backend_command}} + + # Run tests + {{test_commands}} + - id: environment-config + title: Environment Configuration + sections: + - id: env-vars + title: Required Environment Variables + type: code + language: bash + template: | + # Frontend (.env.local) + {{frontend_env_vars}} + + # Backend (.env) + {{backend_env_vars}} + + # Shared + {{shared_env_vars}} + + - id: deployment-architecture + title: Deployment Architecture + instruction: Define deployment strategy based on platform choice. + elicit: true + sections: + - id: deployment-strategy + title: Deployment Strategy + template: | + **Frontend Deployment:** + - **Platform:** {{frontend_deploy_platform}} + - **Build Command:** {{frontend_build_command}} + - **Output Directory:** {{frontend_output_dir}} + - **CDN/Edge:** {{cdn_strategy}} + + **Backend Deployment:** + - **Platform:** {{backend_deploy_platform}} + - **Build Command:** {{backend_build_command}} + - **Deployment Method:** {{deployment_method}} + - id: cicd-pipeline + title: CI/CD Pipeline + type: code + language: yaml + template: "{{cicd_pipeline_config}}" + - id: environments + title: Environments + type: table + columns: [Environment, Frontend URL, Backend URL, Purpose] + rows: + - ["Development", "{{dev_fe_url}}", "{{dev_be_url}}", "Local development"] + - ["Staging", "{{staging_fe_url}}", "{{staging_be_url}}", "Pre-production testing"] + - ["Production", "{{prod_fe_url}}", "{{prod_be_url}}", "Live environment"] + + - id: security-performance + title: Security and Performance + instruction: Define security and performance considerations for the fullstack application. + elicit: true + sections: + - id: security-requirements + title: Security Requirements + template: | + **Frontend Security:** + - CSP Headers: {{csp_policy}} + - XSS Prevention: {{xss_strategy}} + - Secure Storage: {{storage_strategy}} + + **Backend Security:** + - Input Validation: {{validation_approach}} + - Rate Limiting: {{rate_limit_config}} + - CORS Policy: {{cors_config}} + + **Authentication Security:** + - Token Storage: {{token_strategy}} + - Session Management: {{session_approach}} + - Password Policy: {{password_requirements}} + - id: performance-optimization + title: Performance Optimization + template: | + **Frontend Performance:** + - Bundle Size Target: {{bundle_size}} + - Loading Strategy: {{loading_approach}} + - Caching Strategy: {{fe_cache_strategy}} + + **Backend Performance:** + - Response Time Target: {{response_target}} + - Database Optimization: {{db_optimization}} + - Caching Strategy: {{be_cache_strategy}} + + - id: testing-strategy + title: Testing Strategy + instruction: Define comprehensive testing approach for fullstack application. + elicit: true + sections: + - id: testing-pyramid + title: Testing Pyramid + type: code + language: text + template: | + E2E Tests + / \ + Integration Tests + / \ + Frontend Unit Backend Unit + - id: test-organization + title: Test Organization + sections: + - id: frontend-tests + title: Frontend Tests + type: code + language: text + template: "{{frontend_test_structure}}" + - id: backend-tests + title: Backend Tests + type: code + language: text + template: "{{backend_test_structure}}" + - id: e2e-tests + title: E2E Tests + type: code + language: text + template: "{{e2e_test_structure}}" + - id: test-examples + title: Test Examples + sections: + - id: frontend-test + title: Frontend Component Test + type: code + language: typescript + template: "{{frontend_test_example}}" + - id: backend-test + title: Backend API Test + type: code + language: typescript + template: "{{backend_test_example}}" + - id: e2e-test + title: E2E Test + type: code + language: typescript + template: "{{e2e_test_example}}" + + - id: coding-standards + title: Coding Standards + instruction: Define MINIMAL but CRITICAL standards for AI agents. Focus only on project-specific rules that prevent common mistakes. These will be used by dev agents. + elicit: true + sections: + - id: critical-rules + title: Critical Fullstack Rules + repeatable: true + template: "- **{{rule_name}}:** {{rule_description}}" + examples: + - "**Type Sharing:** Always define types in packages/shared and import from there" + - "**API Calls:** Never make direct HTTP calls - use the service layer" + - "**Environment Variables:** Access only through config objects, never process.env directly" + - "**Error Handling:** All API routes must use the standard error handler" + - "**State Updates:** Never mutate state directly - use proper state management patterns" + - id: naming-conventions + title: Naming Conventions + type: table + columns: [Element, Frontend, Backend, Example] + rows: + - ["Components", "PascalCase", "-", "`UserProfile.tsx`"] + - ["Hooks", "camelCase with 'use'", "-", "`useAuth.ts`"] + - ["API Routes", "-", "kebab-case", "`/api/user-profile`"] + - ["Database Tables", "-", "snake_case", "`user_profiles`"] + + - id: error-handling + title: Error Handling Strategy + instruction: Define unified error handling across frontend and backend. + elicit: true + sections: + - id: error-flow + title: Error Flow + type: mermaid + mermaid_type: sequence + template: "{{error_flow_diagram}}" + - id: error-format + title: Error Response Format + type: code + language: typescript + template: | + interface ApiError { + error: { + code: string; + message: string; + details?: Record; + timestamp: string; + requestId: string; + }; + } + - id: frontend-error-handling + title: Frontend Error Handling + type: code + language: typescript + template: "{{frontend_error_handler}}" + - id: backend-error-handling + title: Backend Error Handling + type: code + language: typescript + template: "{{backend_error_handler}}" + + - id: monitoring + title: Monitoring and Observability + instruction: Define monitoring strategy for fullstack application. + elicit: true + sections: + - id: monitoring-stack + title: Monitoring Stack + template: | + - **Frontend Monitoring:** {{frontend_monitoring}} + - **Backend Monitoring:** {{backend_monitoring}} + - **Error Tracking:** {{error_tracking}} + - **Performance Monitoring:** {{perf_monitoring}} + - id: key-metrics + title: Key Metrics + template: | + **Frontend Metrics:** + - Core Web Vitals + - JavaScript errors + - API response times + - User interactions + + **Backend Metrics:** + - Request rate + - Error rate + - Response time + - Database query performance + + - id: checklist-results + title: Checklist Results Report + instruction: Before running the checklist, offer to output the full architecture document. Once user confirms, execute the architect-checklist and populate results here. +==================== END: .bmad-core/templates/fullstack-architecture-tmpl.yaml ==================== + +==================== START: .bmad-core/templates/market-research-tmpl.yaml ==================== +template: + id: market-research-template-v2 + name: Market Research Report + version: 2.0 + output: + format: markdown + filename: docs/market-research.md + title: "Market Research Report: {{project_product_name}}" + +workflow: + mode: interactive + elicitation: advanced-elicitation + custom_elicitation: + title: "Market Research Elicitation Actions" + options: + - "Expand market sizing calculations with sensitivity analysis" + - "Deep dive into a specific customer segment" + - "Analyze an emerging market trend in detail" + - "Compare this market to an analogous market" + - "Stress test market assumptions" + - "Explore adjacent market opportunities" + - "Challenge market definition and boundaries" + - "Generate strategic scenarios (best/base/worst case)" + - "If only we had considered [X market factor]..." + - "Proceed to next section" + +sections: + - id: executive-summary + title: Executive Summary + instruction: Provide a high-level overview of key findings, market opportunity assessment, and strategic recommendations. Write this section LAST after completing all other sections. + + - id: research-objectives + title: Research Objectives & Methodology + instruction: This template guides the creation of a comprehensive market research report. Begin by understanding what market insights the user needs and why. Work through each section systematically, using the appropriate analytical frameworks based on the research objectives. + sections: + - id: objectives + title: Research Objectives + instruction: | + List the primary objectives of this market research: + - What decisions will this research inform? + - What specific questions need to be answered? + - What are the success criteria for this research? + - id: methodology + title: Research Methodology + instruction: | + Describe the research approach: + - Data sources used (primary/secondary) + - Analysis frameworks applied + - Data collection timeframe + - Limitations and assumptions + + - id: market-overview + title: Market Overview + sections: + - id: market-definition + title: Market Definition + instruction: | + Define the market being analyzed: + - Product/service category + - Geographic scope + - Customer segments included + - Value chain position + - id: market-size-growth + title: Market Size & Growth + instruction: | + Guide through TAM, SAM, SOM calculations with clear assumptions. Use one or more approaches: + - Top-down: Start with industry data, narrow down + - Bottom-up: Build from customer/unit economics + - Value theory: Based on value provided vs. alternatives + sections: + - id: tam + title: Total Addressable Market (TAM) + instruction: Calculate and explain the total market opportunity + - id: sam + title: Serviceable Addressable Market (SAM) + instruction: Define the portion of TAM you can realistically reach + - id: som + title: Serviceable Obtainable Market (SOM) + instruction: Estimate the portion you can realistically capture + - id: market-trends + title: Market Trends & Drivers + instruction: Analyze key trends shaping the market using appropriate frameworks like PESTEL + sections: + - id: key-trends + title: Key Market Trends + instruction: | + List and explain 3-5 major trends: + - Trend 1: Description and impact + - Trend 2: Description and impact + - etc. + - id: growth-drivers + title: Growth Drivers + instruction: Identify primary factors driving market growth + - id: market-inhibitors + title: Market Inhibitors + instruction: Identify factors constraining market growth + + - id: customer-analysis + title: Customer Analysis + sections: + - id: segment-profiles + title: Target Segment Profiles + instruction: For each segment, create detailed profiles including demographics/firmographics, psychographics, behaviors, needs, and willingness to pay + repeatable: true + sections: + - id: segment + title: "Segment {{segment_number}}: {{segment_name}}" + template: | + - **Description:** {{brief_overview}} + - **Size:** {{number_of_customers_market_value}} + - **Characteristics:** {{key_demographics_firmographics}} + - **Needs & Pain Points:** {{primary_problems}} + - **Buying Process:** {{purchasing_decisions}} + - **Willingness to Pay:** {{price_sensitivity}} + - id: jobs-to-be-done + title: Jobs-to-be-Done Analysis + instruction: Uncover what customers are really trying to accomplish + sections: + - id: functional-jobs + title: Functional Jobs + instruction: List practical tasks and objectives customers need to complete + - id: emotional-jobs + title: Emotional Jobs + instruction: Describe feelings and perceptions customers seek + - id: social-jobs + title: Social Jobs + instruction: Explain how customers want to be perceived by others + - id: customer-journey + title: Customer Journey Mapping + instruction: Map the end-to-end customer experience for primary segments + template: | + For primary customer segment: + + 1. **Awareness:** {{discovery_process}} + 2. **Consideration:** {{evaluation_criteria}} + 3. **Purchase:** {{decision_triggers}} + 4. **Onboarding:** {{initial_expectations}} + 5. **Usage:** {{interaction_patterns}} + 6. **Advocacy:** {{referral_behaviors}} + + - id: competitive-landscape + title: Competitive Landscape + sections: + - id: market-structure + title: Market Structure + instruction: | + Describe the overall competitive environment: + - Number of competitors + - Market concentration + - Competitive intensity + - id: major-players + title: Major Players Analysis + instruction: | + For top 3-5 competitors: + - Company name and brief description + - Market share estimate + - Key strengths and weaknesses + - Target customer focus + - Pricing strategy + - id: competitive-positioning + title: Competitive Positioning + instruction: | + Analyze how competitors are positioned: + - Value propositions + - Differentiation strategies + - Market gaps and opportunities + + - id: industry-analysis + title: Industry Analysis + sections: + - id: porters-five-forces + title: Porter's Five Forces Assessment + instruction: Analyze each force with specific evidence and implications + sections: + - id: supplier-power + title: "Supplier Power: {{power_level}}" + template: "{{analysis_and_implications}}" + - id: buyer-power + title: "Buyer Power: {{power_level}}" + template: "{{analysis_and_implications}}" + - id: competitive-rivalry + title: "Competitive Rivalry: {{intensity_level}}" + template: "{{analysis_and_implications}}" + - id: threat-new-entry + title: "Threat of New Entry: {{threat_level}}" + template: "{{analysis_and_implications}}" + - id: threat-substitutes + title: "Threat of Substitutes: {{threat_level}}" + template: "{{analysis_and_implications}}" + - id: adoption-lifecycle + title: Technology Adoption Lifecycle Stage + instruction: | + Identify where the market is in the adoption curve: + - Current stage and evidence + - Implications for strategy + - Expected progression timeline + + - id: opportunity-assessment + title: Opportunity Assessment + sections: + - id: market-opportunities + title: Market Opportunities + instruction: Identify specific opportunities based on the analysis + repeatable: true + sections: + - id: opportunity + title: "Opportunity {{opportunity_number}}: {{name}}" + template: | + - **Description:** {{what_is_the_opportunity}} + - **Size/Potential:** {{quantified_potential}} + - **Requirements:** {{needed_to_capture}} + - **Risks:** {{key_challenges}} + - id: strategic-recommendations + title: Strategic Recommendations + sections: + - id: go-to-market + title: Go-to-Market Strategy + instruction: | + Recommend approach for market entry/expansion: + - Target segment prioritization + - Positioning strategy + - Channel strategy + - Partnership opportunities + - id: pricing-strategy + title: Pricing Strategy + instruction: | + Based on willingness to pay analysis and competitive landscape: + - Recommended pricing model + - Price points/ranges + - Value metric + - Competitive positioning + - id: risk-mitigation + title: Risk Mitigation + instruction: | + Key risks and mitigation strategies: + - Market risks + - Competitive risks + - Execution risks + - Regulatory/compliance risks + + - id: appendices + title: Appendices + sections: + - id: data-sources + title: A. Data Sources + instruction: List all sources used in the research + - id: calculations + title: B. Detailed Calculations + instruction: Include any complex calculations or models + - id: additional-analysis + title: C. Additional Analysis + instruction: Any supplementary analysis not included in main body +==================== END: .bmad-core/templates/market-research-tmpl.yaml ==================== + +==================== START: .bmad-core/templates/prd-tmpl.yaml ==================== template: id: prd-template-v2 name: Product Requirements Document @@ -6949,303 +6232,371 @@ sections: - id: architect-prompt title: Architect Prompt instruction: This section will contain the prompt for the Architect, keep it short and to the point to initiate create architecture mode using this document as input. -==================== END: .bmad-core/templates/prd-tmpl2.yaml ==================== - -==================== START: .bmad-core/templates/project-brief-tmpl.md ==================== ---- -defaultOutput: docs/brief.md ---- - -# Project Brief: {{Project Name}} - -[[LLM: This template guides creation of a comprehensive Project Brief that serves as the foundational input for product development. - -Start by asking the user which mode they prefer: - -1. **Interactive Mode** - Work through each section collaboratively -2. **YOLO Mode** - Generate complete draft for review and refinement - -Before beginning, understand what inputs are available (brainstorming results, market research, competitive analysis, initial ideas) and gather project context.]] - -## Executive Summary - -[[LLM: Create a concise overview that captures the essence of the project. Include: - -- Product concept in 1-2 sentences -- Primary problem being solved -- Target market identification -- Key value proposition]] - -{{Write executive summary based on information gathered}} - -## Problem Statement - -[[LLM: Articulate the problem with clarity and evidence. Address: - -- Current state and pain points -- Impact of the problem (quantify if possible) -- Why existing solutions fall short -- Urgency and importance of solving this now]] - -{{Detailed problem description with supporting evidence}} - -## Proposed Solution - -[[LLM: Describe the solution approach at a high level. Include: - -- Core concept and approach -- Key differentiators from existing solutions -- Why this solution will succeed where others haven't -- High-level vision for the product]] - -{{Solution description focusing on the "what" and "why", not implementation details}} - -## Target Users - -[[LLM: Define and characterize the intended users with specificity. For each user segment include: - -- Demographic/firmographic profile -- Current behaviors and workflows -- Specific needs and pain points -- Goals they're trying to achieve]] - -### Primary User Segment: {{Segment Name}} - -{{Detailed description of primary users}} - -### Secondary User Segment: {{Segment Name}} - -{{Description of secondary users if applicable}} - -## Goals & Success Metrics - -[[LLM: Establish clear objectives and how to measure success. Make goals SMART (Specific, Measurable, Achievable, Relevant, Time-bound)]] - -### Business Objectives - -- {{Objective 1 with metric}} -- {{Objective 2 with metric}} -- {{Objective 3 with metric}} - -### User Success Metrics - -- {{How users will measure value}} -- {{Engagement metrics}} -- {{Satisfaction indicators}} - -### Key Performance Indicators (KPIs) - -- {{KPI 1: Definition and target}} -- {{KPI 2: Definition and target}} -- {{KPI 3: Definition and target}} - -## MVP Scope - -[[LLM: Define the minimum viable product clearly. Be specific about what's in and what's out. Help user distinguish must-haves from nice-to-haves.]] - -### Core Features (Must Have) - -- **Feature 1:** {{Brief description and why it's essential}} -- **Feature 2:** {{Brief description and why it's essential}} -- **Feature 3:** {{Brief description and why it's essential}} - -### Out of Scope for MVP - -- {{Feature/capability explicitly not in MVP}} -- {{Feature/capability to be considered post-MVP}} - -### MVP Success Criteria - -{{Define what constitutes a successful MVP launch}} - -## Post-MVP Vision - -[[LLM: Outline the longer-term product direction without overcommitting to specifics]] - -### Phase 2 Features - -{{Next priority features after MVP success}} - -### Long-term Vision - -{{Where this product could go in 1-2 years}} - -### Expansion Opportunities - -{{Potential new markets, use cases, or integrations}} - -## Technical Considerations - -[[LLM: Document known technical constraints and preferences. Note these are initial thoughts, not final decisions.]] - -### Platform Requirements - -- **Target Platforms:** {{Web, mobile, desktop, etc.}} -- **Browser/OS Support:** {{Specific requirements}} -- **Performance Requirements:** {{Load times, concurrent users, etc.}} - -### Technology Preferences - -- **Frontend:** {{If any preferences exist}} -- **Backend:** {{If any preferences exist}} -- **Database:** {{If any preferences exist}} -- **Hosting/Infrastructure:** {{Cloud preferences, on-prem requirements}} - -### Architecture Considerations - -- **Repository Structure:** {{Initial thoughts on monorepo vs. polyrepo}} -- **Service Architecture:** {{Initial thoughts on monolith vs. microservices}} -- **Integration Requirements:** {{Third-party services, APIs}} -- **Security/Compliance:** {{Any specific requirements}} - -## Constraints & Assumptions - -[[LLM: Clearly state limitations and assumptions to set realistic expectations]] - -### Constraints - -- **Budget:** {{If known}} -- **Timeline:** {{Target launch date or development timeframe}} -- **Resources:** {{Team size, skill constraints}} -- **Technical:** {{Legacy systems, required tech stack}} - -### Key Assumptions - -- {{Assumption about users, market, or technology}} -- {{Assumption about resources or support}} -- {{Assumption about external dependencies}} - -## Risks & Open Questions - -[[LLM: Identify unknowns and potential challenges proactively]] - -### Key Risks - -- **Risk 1:** {{Description and potential impact}} -- **Risk 2:** {{Description and potential impact}} -- **Risk 3:** {{Description and potential impact}} - -### Open Questions - -- {{Question needing research or decision}} -- {{Question about technical approach}} -- {{Question about market or users}} - -### Areas Needing Further Research - -- {{Topic requiring deeper investigation}} -- {{Validation needed before proceeding}} - -## Appendices - -### A. Research Summary - -{{If applicable, summarize key findings from: - -- Market research -- Competitive analysis -- User interviews -- Technical feasibility studies}} - -### B. Stakeholder Input - -{{Key feedback or requirements from stakeholders}} - -### C. References - -{{Links to relevant documents, research, or examples}} - -## Next Steps - -### Immediate Actions - -1. {{First concrete next step}} -2. {{Second concrete next step}} -3. {{Third concrete next step}} - -### PM Handoff - -This Project Brief provides the full context for {{Project Name}}. Please start in 'PRD Generation Mode', review the brief thoroughly to work with the user to create the PRD section by section as the template indicates, asking for any necessary clarification or suggesting improvements. - ---- - -[[LLM: After completing each major section (not subsections), offer advanced elicitation with these custom options for project briefs: - -**Project Brief Elicitation Actions** 0. Expand section with more specific details - -1. Validate against similar successful products -2. Stress test assumptions with edge cases -3. Explore alternative solution approaches -4. Analyze resource/constraint trade-offs -5. Generate risk mitigation strategies -6. Challenge scope from MVP minimalist view -7. Brainstorm creative feature possibilities -8. If only we had [resource/capability/time]... -9. Proceed to next section - -These replace the standard elicitation options when working on project brief documents.]] -==================== END: .bmad-core/templates/project-brief-tmpl.md ==================== - -==================== START: .bmad-core/templates/story-tmpl.md ==================== ---- -defaultOutput: docs/stories/{{EpicNum}}.{{StoryNum}}.{{Short Title Copied from Epic File specific story}}.md -smAgent: - editableSections: Status, Story, Acceptance Criteria, Tasks / Subtasks, Dev Notes, Testing, Change Log - sectionSpecificInstructions: - "Dev Notes": - - Populate relevant information, only what was pulled from actual artifacts from docs folder, relevant to this story - - Do not invent information. - - If known add Relevant Source Tree info that relates to this story. - - If there were important notes from previous story that are relevant to this one, include them here. - - Put enough information in this section so that the dev agent should NEVER need to read the architecture documents, these notes along with the tasks and subtasks must give the Dev Agent the complete context it needs to comprehend with the least amount of overhead the information to complete the story, meeting all AC and completing all tasks+subtasks. - Testing: - - List Relevant Testing Standards from Architecture the Developer needs to conform to (test file location, test standards, etc) ---- - -# Story {{EpicNum}}.{{StoryNum}}: {{Short Title Copied from Epic File specific story}} - -## Status: {{ Draft | Approved | InProgress | Review | Done }} - -## Story - -**As a** {{role}},\ -**I want** {{action}},\ -**so that** {{benefit}} - -## Acceptance Criteria - -{{ Copy of Acceptance Criteria numbered list }} - -## Tasks / Subtasks - -- [ ] Task 1 (AC: # if applicable) - - [ ] Subtask1.1... -- [ ] Task 2 (AC: # if applicable) - - [ ] Subtask 2.1... -- [ ] Task 3 (AC: # if applicable) - - [ ] Subtask 3.1... - -## Dev Notes - -### Testing - -## Change Log - -| Date | Version | Description | Author | -| :--- | :------ | :---------- | :----- | - -## Dev Agent Record - -### Agent Model Used: {{Agent Model Name/Version}} - -### Debug Log References - -### Completion Notes List - -### File List - -## QA Results -==================== END: .bmad-core/templates/story-tmpl.md ==================== +==================== END: .bmad-core/templates/prd-tmpl.yaml ==================== + +==================== START: .bmad-core/templates/project-brief-tmpl.yaml ==================== +template: + id: project-brief-template-v2 + name: Project Brief + version: 2.0 + output: + format: markdown + filename: docs/brief.md + title: "Project Brief: {{project_name}}" + +workflow: + mode: interactive + elicitation: advanced-elicitation + custom_elicitation: + title: "Project Brief Elicitation Actions" + options: + - "Expand section with more specific details" + - "Validate against similar successful products" + - "Stress test assumptions with edge cases" + - "Explore alternative solution approaches" + - "Analyze resource/constraint trade-offs" + - "Generate risk mitigation strategies" + - "Challenge scope from MVP minimalist view" + - "Brainstorm creative feature possibilities" + - "If only we had [resource/capability/time]..." + - "Proceed to next section" + +sections: + - id: introduction + instruction: | + This template guides creation of a comprehensive Project Brief that serves as the foundational input for product development. + + Start by asking the user which mode they prefer: + + 1. **Interactive Mode** - Work through each section collaboratively + 2. **YOLO Mode** - Generate complete draft for review and refinement + + Before beginning, understand what inputs are available (brainstorming results, market research, competitive analysis, initial ideas) and gather project context. + + - id: executive-summary + title: Executive Summary + instruction: | + Create a concise overview that captures the essence of the project. Include: + - Product concept in 1-2 sentences + - Primary problem being solved + - Target market identification + - Key value proposition + template: "{{executive_summary_content}}" + + - id: problem-statement + title: Problem Statement + instruction: | + Articulate the problem with clarity and evidence. Address: + - Current state and pain points + - Impact of the problem (quantify if possible) + - Why existing solutions fall short + - Urgency and importance of solving this now + template: "{{detailed_problem_description}}" + + - id: proposed-solution + title: Proposed Solution + instruction: | + Describe the solution approach at a high level. Include: + - Core concept and approach + - Key differentiators from existing solutions + - Why this solution will succeed where others haven't + - High-level vision for the product + template: "{{solution_description}}" + + - id: target-users + title: Target Users + instruction: | + Define and characterize the intended users with specificity. For each user segment include: + - Demographic/firmographic profile + - Current behaviors and workflows + - Specific needs and pain points + - Goals they're trying to achieve + sections: + - id: primary-segment + title: "Primary User Segment: {{segment_name}}" + template: "{{primary_user_description}}" + - id: secondary-segment + title: "Secondary User Segment: {{segment_name}}" + condition: Has secondary user segment + template: "{{secondary_user_description}}" + + - id: goals-metrics + title: Goals & Success Metrics + instruction: Establish clear objectives and how to measure success. Make goals SMART (Specific, Measurable, Achievable, Relevant, Time-bound) + sections: + - id: business-objectives + title: Business Objectives + type: bullet-list + template: "- {{objective_with_metric}}" + - id: user-success-metrics + title: User Success Metrics + type: bullet-list + template: "- {{user_metric}}" + - id: kpis + title: Key Performance Indicators (KPIs) + type: bullet-list + template: "- {{kpi}}: {{definition_and_target}}" + + - id: mvp-scope + title: MVP Scope + instruction: Define the minimum viable product clearly. Be specific about what's in and what's out. Help user distinguish must-haves from nice-to-haves. + sections: + - id: core-features + title: Core Features (Must Have) + type: bullet-list + template: "- **{{feature}}:** {{description_and_rationale}}" + - id: out-of-scope + title: Out of Scope for MVP + type: bullet-list + template: "- {{feature_or_capability}}" + - id: mvp-success-criteria + title: MVP Success Criteria + template: "{{mvp_success_definition}}" + + - id: post-mvp-vision + title: Post-MVP Vision + instruction: Outline the longer-term product direction without overcommitting to specifics + sections: + - id: phase-2-features + title: Phase 2 Features + template: "{{next_priority_features}}" + - id: long-term-vision + title: Long-term Vision + template: "{{one_two_year_vision}}" + - id: expansion-opportunities + title: Expansion Opportunities + template: "{{potential_expansions}}" + + - id: technical-considerations + title: Technical Considerations + instruction: Document known technical constraints and preferences. Note these are initial thoughts, not final decisions. + sections: + - id: platform-requirements + title: Platform Requirements + template: | + - **Target Platforms:** {{platforms}} + - **Browser/OS Support:** {{specific_requirements}} + - **Performance Requirements:** {{performance_specs}} + - id: technology-preferences + title: Technology Preferences + template: | + - **Frontend:** {{frontend_preferences}} + - **Backend:** {{backend_preferences}} + - **Database:** {{database_preferences}} + - **Hosting/Infrastructure:** {{infrastructure_preferences}} + - id: architecture-considerations + title: Architecture Considerations + template: | + - **Repository Structure:** {{repo_thoughts}} + - **Service Architecture:** {{service_thoughts}} + - **Integration Requirements:** {{integration_needs}} + - **Security/Compliance:** {{security_requirements}} + + - id: constraints-assumptions + title: Constraints & Assumptions + instruction: Clearly state limitations and assumptions to set realistic expectations + sections: + - id: constraints + title: Constraints + template: | + - **Budget:** {{budget_info}} + - **Timeline:** {{timeline_info}} + - **Resources:** {{resource_info}} + - **Technical:** {{technical_constraints}} + - id: key-assumptions + title: Key Assumptions + type: bullet-list + template: "- {{assumption}}" + + - id: risks-questions + title: Risks & Open Questions + instruction: Identify unknowns and potential challenges proactively + sections: + - id: key-risks + title: Key Risks + type: bullet-list + template: "- **{{risk}}:** {{description_and_impact}}" + - id: open-questions + title: Open Questions + type: bullet-list + template: "- {{question}}" + - id: research-areas + title: Areas Needing Further Research + type: bullet-list + template: "- {{research_topic}}" + + - id: appendices + title: Appendices + sections: + - id: research-summary + title: A. Research Summary + condition: Has research findings + instruction: | + If applicable, summarize key findings from: + - Market research + - Competitive analysis + - User interviews + - Technical feasibility studies + - id: stakeholder-input + title: B. Stakeholder Input + condition: Has stakeholder feedback + template: "{{stakeholder_feedback}}" + - id: references + title: C. References + template: "{{relevant_links_and_docs}}" + + - id: next-steps + title: Next Steps + sections: + - id: immediate-actions + title: Immediate Actions + type: numbered-list + template: "{{action_item}}" + - id: pm-handoff + title: PM Handoff + content: | + This Project Brief provides the full context for {{project_name}}. Please start in 'PRD Generation Mode', review the brief thoroughly to work with the user to create the PRD section by section as the template indicates, asking for any necessary clarification or suggesting improvements. +==================== END: .bmad-core/templates/project-brief-tmpl.yaml ==================== + +==================== START: .bmad-core/templates/story-tmpl.yaml ==================== +template: + id: story-template-v2 + name: Story Document + version: 2.0 + output: + format: markdown + filename: docs/stories/{{epic_num}}.{{story_num}}.{{story_title_short}}.md + title: "Story {{epic_num}}.{{story_num}}: {{story_title_short}}" + +workflow: + mode: interactive + elicitation: advanced-elicitation + +agent_config: + editable_sections: + - Status + - Story + - Acceptance Criteria + - Tasks / Subtasks + - Dev Notes + - Testing + - Change Log + +sections: + - id: status + title: Status + type: choice + choices: [Draft, Approved, InProgress, Review, Done] + instruction: Select the current status of the story + owner: scrum-master + editors: [scrum-master, dev-agent] + + - id: story + title: Story + type: template-text + template: | + **As a** {{role}}, + **I want** {{action}}, + **so that** {{benefit}} + instruction: Define the user story using the standard format with role, action, and benefit + elicit: true + owner: scrum-master + editors: [scrum-master] + + - id: acceptance-criteria + title: Acceptance Criteria + type: numbered-list + instruction: Copy the acceptance criteria numbered list from the epic file + elicit: true + owner: scrum-master + editors: [scrum-master] + + - id: tasks-subtasks + title: Tasks / Subtasks + type: bullet-list + instruction: | + Break down the story into specific tasks and subtasks needed for implementation. + Reference applicable acceptance criteria numbers where relevant. + template: | + - [ ] Task 1 (AC: # if applicable) + - [ ] Subtask1.1... + - [ ] Task 2 (AC: # if applicable) + - [ ] Subtask 2.1... + - [ ] Task 3 (AC: # if applicable) + - [ ] Subtask 3.1... + elicit: true + owner: scrum-master + editors: [scrum-master, dev-agent] + + - id: dev-notes + title: Dev Notes + instruction: | + Populate relevant information, only what was pulled from actual artifacts from docs folder, relevant to this story: + - Do not invent information + - If known add Relevant Source Tree info that relates to this story + - If there were important notes from previous story that are relevant to this one, include them here + - Put enough information in this section so that the dev agent should NEVER need to read the architecture documents, these notes along with the tasks and subtasks must give the Dev Agent the complete context it needs to comprehend with the least amount of overhead the information to complete the story, meeting all AC and completing all tasks+subtasks + elicit: true + owner: scrum-master + editors: [scrum-master] + sections: + - id: testing-standards + title: Testing + instruction: | + List Relevant Testing Standards from Architecture the Developer needs to conform to: + - Test file location + - Test standards + - Testing frameworks and patterns to use + - Any specific testing requirements for this story + elicit: true + owner: scrum-master + editors: [scrum-master] + + - id: change-log + title: Change Log + type: table + columns: [Date, Version, Description, Author] + instruction: Track changes made to this story document + owner: scrum-master + editors: [scrum-master, dev-agent, qa-agent] + + - id: dev-agent-record + title: Dev Agent Record + instruction: This section is populated by the development agent during implementation + owner: dev-agent + editors: [dev-agent] + sections: + - id: agent-model + title: Agent Model Used + template: "{{agent_model_name_version}}" + instruction: Record the specific AI agent model and version used for development + owner: dev-agent + editors: [dev-agent] + + - id: debug-log-references + title: Debug Log References + instruction: Reference any debug logs or traces generated during development + owner: dev-agent + editors: [dev-agent] + + - id: completion-notes + title: Completion Notes List + instruction: Notes about the completion of tasks and any issues encountered + owner: dev-agent + editors: [dev-agent] + + - id: file-list + title: File List + instruction: List all files created, modified, or affected during story implementation + owner: dev-agent + editors: [dev-agent] + + - id: qa-results + title: QA Results + instruction: Results from QA Agent QA review of the completed story implementation + owner: qa-agent + editors: [qa-agent] +==================== END: .bmad-core/templates/story-tmpl.yaml ==================== ==================== START: .bmad-core/checklists/architect-checklist.md ==================== # Architect Solution Validation Checklist @@ -9815,6 +9166,143 @@ Use the **expansion-creator** pack to build your own: 20. **Question Storming**: Generate questions instead of answers first ==================== END: .bmad-core/data/brainstorming-techniques.md ==================== +==================== START: .bmad-core/data/elicitation-methods.md ==================== +# Elicitation Methods Data + +## Core Reflective Methods + +**Expand or Contract for Audience** +- Ask whether to 'expand' (add detail, elaborate) or 'contract' (simplify, clarify) +- Identify specific target audience if relevant +- Tailor content complexity and depth accordingly + +**Explain Reasoning (CoT Step-by-Step)** +- Walk through the step-by-step thinking process +- Reveal underlying assumptions and decision points +- Show how conclusions were reached from current role's perspective + +**Critique and Refine** +- Review output for flaws, inconsistencies, or improvement areas +- Identify specific weaknesses from role's expertise +- Suggest refined version reflecting domain knowledge + +## Structural Analysis Methods + +**Analyze Logical Flow and Dependencies** +- Examine content structure for logical progression +- Check internal consistency and coherence +- Identify and validate dependencies between elements +- Confirm effective ordering and sequencing + +**Assess Alignment with Overall Goals** +- Evaluate content contribution to stated objectives +- Identify any misalignments or gaps +- Interpret alignment from specific role's perspective +- Suggest adjustments to better serve goals + +## Risk and Challenge Methods + +**Identify Potential Risks and Unforeseen Issues** +- Brainstorm potential risks from role's expertise +- Identify overlooked edge cases or scenarios +- Anticipate unintended consequences +- Highlight implementation challenges + +**Challenge from Critical Perspective** +- Adopt critical stance on current content +- Play devil's advocate from specified viewpoint +- Argue against proposal highlighting weaknesses +- Apply YAGNI principles when appropriate (scope trimming) + +## Creative Exploration Methods + +**Tree of Thoughts Deep Dive** +- Break problem into discrete "thoughts" or intermediate steps +- Explore multiple reasoning paths simultaneously +- Use self-evaluation to classify each path as "sure", "likely", or "impossible" +- Apply search algorithms (BFS/DFS) to find optimal solution paths + +**Hindsight is 20/20: The 'If Only...' Reflection** +- Imagine retrospective scenario based on current content +- Identify the one "if only we had known/done X..." insight +- Describe imagined consequences humorously or dramatically +- Extract actionable learnings for current context + +## Multi-Persona Collaboration Methods + +**Agile Team Perspective Shift** +- Rotate through different Scrum team member viewpoints +- Product Owner: Focus on user value and business impact +- Scrum Master: Examine process flow and team dynamics +- Developer: Assess technical implementation and complexity +- QA: Identify testing scenarios and quality concerns + +**Stakeholder Round Table** +- Convene virtual meeting with multiple personas +- Each persona contributes unique perspective on content +- Identify conflicts and synergies between viewpoints +- Synthesize insights into actionable recommendations + +**Meta-Prompting Analysis** +- Step back to analyze the structure and logic of current approach +- Question the format and methodology being used +- Suggest alternative frameworks or mental models +- Optimize the elicitation process itself + +## Advanced 2025 Techniques + +**Self-Consistency Validation** +- Generate multiple reasoning paths for same problem +- Compare consistency across different approaches +- Identify most reliable and robust solution +- Highlight areas where approaches diverge and why + +**ReWOO (Reasoning Without Observation)** +- Separate parametric reasoning from tool-based actions +- Create reasoning plan without external dependencies +- Identify what can be solved through pure reasoning +- Optimize for efficiency and reduced token usage + +**Persona-Pattern Hybrid** +- Combine specific role expertise with elicitation pattern +- Architect + Risk Analysis: Deep technical risk assessment +- UX Expert + User Journey: End-to-end experience critique +- PM + Stakeholder Analysis: Multi-perspective impact review + +**Emergent Collaboration Discovery** +- Allow multiple perspectives to naturally emerge +- Identify unexpected insights from persona interactions +- Explore novel combinations of viewpoints +- Capture serendipitous discoveries from multi-agent thinking + +## Game-Based Elicitation Methods + +**Red Team vs Blue Team** +- Red Team: Attack the proposal, find vulnerabilities +- Blue Team: Defend and strengthen the approach +- Competitive analysis reveals blind spots +- Results in more robust, battle-tested solutions + +**Innovation Tournament** +- Pit multiple alternative approaches against each other +- Score each approach across different criteria +- Crowd-source evaluation from different personas +- Identify winning combination of features + +**Escape Room Challenge** +- Present content as constraints to work within +- Find creative solutions within tight limitations +- Identify minimum viable approach +- Discover innovative workarounds and optimizations + +## Process Control + +**Proceed / No Further Actions** +- Acknowledge choice to finalize current work +- Accept output as-is or move to next step +- Prepare to continue without additional elicitation +==================== END: .bmad-core/data/elicitation-methods.md ==================== + ==================== START: .bmad-core/data/technical-preferences.md ==================== # User-Defined Preferred Patterns and Preferences diff --git a/dist/agents/bmad-orchestrator.txt b/dist/agents/bmad-orchestrator.txt index 4b09f0b5..a002ab86 100644 --- a/dist/agents/bmad-orchestrator.txt +++ b/dist/agents/bmad-orchestrator.txt @@ -45,6 +45,15 @@ These references map directly to bundle sections: CRITICAL: Read the full YAML, start activation to alter your state of being, follow startup section instructions, stay in this being until told to exit this mode: ```yaml +activation-instructions: + - Mention *help shows all available commands and options + - Check for active workflow plan using .bmad-core/utils/plan-management.md + - 'If plan exists: Show 📋 Active plan: {workflow} ({progress}% complete). Use *plan-status for details.' + - 'If plan exists: Suggest next action based on plan progress' + - Assess user goal against available agents and workflows in this bundle + - If clear match to an agent's expertise, suggest transformation with *agent command + - If project-oriented, suggest *workflow-guidance to explore options + - Load resources only when needed - never pre-load agent: name: BMad Orchestrator id: bmad-orchestrator @@ -66,17 +75,6 @@ persona: - Always use numbered lists for choices - Process commands starting with * immediately - Always remind users that commands require * prefix -startup: - - Announce: Introduce yourself as the BMad Orchestrator, explain you can coordinate agents and workflows - - IMPORTANT: Tell users that all commands start with * (e.g., *help, *agent, *workflow) - - Mention *help shows all available commands and options - - Check for active workflow plan using .bmad-core/utils/plan-management.md - - 'If plan exists: Show 📋 Active plan: {workflow} ({progress}% complete). Use *plan-status for details.' - - 'If plan exists: Suggest next action based on plan progress' - - Assess user goal against available agents and workflows in this bundle - - If clear match to an agent's expertise, suggest transformation with *agent command - - If project-oriented, suggest *workflow-guidance to explore options - - Load resources only when needed - never pre-load commands: help: Show this guide with available agents and workflows chat-mode: Start conversational mode for detailed assistance @@ -164,17 +162,18 @@ workflow-guidance: - When *workflow-guidance is called, start an interactive session and list all available workflows with brief descriptions dependencies: tasks: - - advanced-elicitation - - create-doc - - create-workflow-plan - - kb-mode-interaction - - update-workflow-plan + - advanced-elicitation.md + - create-doc.md + - create-workflow-plan.md + - kb-mode-interaction.md + - update-workflow-plan.md data: - - bmad-kb + - bmad-kb.md + - elicitation-methods.md utils: - - plan-management - - workflow-management - - template-format + - plan-management.md + - workflow-management.md + - template-format.md ``` ==================== END: .bmad-core/agents/bmad-orchestrator.md ==================== @@ -299,97 +298,85 @@ Choose a number (0-8) or 9 to proceed: ==================== END: .bmad-core/tasks/advanced-elicitation.md ==================== ==================== START: .bmad-core/tasks/create-doc.md ==================== -# Create Document from Template Task +# Create Document from Template (YAML Driven) -## Purpose +## CRITICAL: Mandatory Elicitation Format -Generate documents from templates by EXECUTING (not just reading) embedded instructions from the perspective of the selected agent persona. +**When `elicit: true`, ALWAYS use this exact format:** -## CRITICAL RULES +1. Present section content +2. Provide detailed rationale (explain trade-offs, assumptions, decisions made) +3. Present numbered options 1-9: + - **Option 1:** Always "Proceed to next section" + - **Options 2-9:** Select 8 methods from data/elicitation-methods + - End with: "Select 1-9 or just type your question/feedback:" -1. **Templates are PROGRAMS** - Execute every [[LLM:]] instruction exactly as written -2. **NEVER show markup** - Hide all [[LLM:]], {{placeholders}}, @{examples}, and template syntax -3. **STOP and EXECUTE** - When you see "apply tasks#" or "execute tasks#", STOP and run that task immediately -4. **WAIT for user input** - At review points and after elicitation tasks +**NEVER ask yes/no questions or use any other format.** -## Execution Flow +## Processing Flow -### 0. Check Workflow Plan (if configured) +1. **Parse YAML template** - Load template metadata and sections +2. **Set preferences** - Show current mode (Interactive), confirm output file +3. **Process each section:** + - Skip if condition unmet + - Check agent permissions (owner/editors) - note if section is restricted to specific agents + - Draft content using section instruction + - Present content + detailed rationale + - **IF elicit: true** → MANDATORY 1-9 options format + - Save to file if possible +4. **Continue until complete** -[[LLM: Check if plan tracking is enabled in core-config.yaml]] +## Detailed Rationale Requirements -- If `workflow.trackProgress: true`, check for active plan using .bmad-core/utils/plan-management.md -- If plan exists and this document creation is part of the plan: - - Verify this is the expected next step - - If out of sequence and `enforceSequence: true`, warn user and halt without user override - - If out of sequence and `enforceSequence: false`, ask for confirmation -- Continue with normal execution after plan check +When presenting section content, ALWAYS include rationale that explains: -### 1. Identify Template +- Trade-offs and choices made (what was chosen over alternatives and why) +- Key assumptions made during drafting +- Interesting or questionable decisions that need user attention +- Areas that might need validation -- Load from `.bmad-core/templates/*.md` or `.bmad-core/templates directory` -- Agent-specific templates are listed in agent's dependencies -- If agent has `templates: [prd-tmpl, architecture-tmpl]` for example, then offer to create "PRD" and "Architecture" documents +## Elicitation Results Flow -### 2. Ask Interaction Mode +After user selects elicitation method (2-9): -> 1. **Incremental** - Section by section with reviews -> 2. **YOLO Mode** - Complete draft then review (user can type `/yolo` anytime to switch) +1. Execute method from data/elicitation-methods +2. Present results with insights +3. Offer options: + - **1. Apply changes and update section** + - **2. Return to elicitation menu** + - **3. Ask any questions or engage further with this elicitation** -### 3. Execute Template +## Agent Permissions -- Replace {{placeholders}} with real content -- Execute [[LLM:]] instructions as you encounter them -- Process <> loops and ^^CONDITIONS^^ -- Use @{examples} for guidance but never output them +When processing sections with agent permission fields: -### 4. Key Execution Patterns +- **owner**: Note which agent role initially creates/populates the section +- **editors**: List agent roles allowed to modify the section +- **readonly**: Mark sections that cannot be modified after creation -**When you see:** `[[LLM: Draft X and immediately execute .bmad-core/tasks/advanced-elicitation.md]]` +**For sections with restricted access:** -- Draft the content -- Present it to user -- IMMEDIATELY execute the task -- Wait for completion before continuing +- Include a note in the generated document indicating the responsible agent +- Example: "_(This section is owned by dev-agent and can only be modified by dev-agent)_" -**When you see:** `[[LLM: After section completion, apply .bmad-core/tasks/Y.md]]` +## YOLO Mode -- Finish the section -- STOP and execute the task -- Wait for user input +User can type `#yolo` to toggle to YOLO mode (process all sections at once). -### 5. Validation & Final Presentation +## CRITICAL REMINDERS -- Run any specified checklists -- Present clean, formatted content only -- No truncation or summarization -- Begin directly with content (no preamble) -- Include any handoff prompts from template +**❌ NEVER:** -### 6. Update Workflow Plan (if applicable) +- Ask yes/no questions for elicitation +- Use any format other than 1-9 numbered options +- Create new elicitation methods -[[LLM: After successful document creation]] +**✅ ALWAYS:** -- If plan tracking is enabled and document was part of plan: - - Call update-workflow-plan task to mark step complete - - Parameters: task: create-doc, step_id: {from plan}, status: complete - - Show next recommended step from plan - -## Common Mistakes to Avoid - -❌ Skipping elicitation tasks -❌ Showing template markup to users -❌ Continuing past STOP signals -❌ Combining multiple review points - -✅ Execute ALL instructions in sequence -✅ Present only clean, formatted content -✅ Stop at every elicitation point -✅ Wait for user confirmation when instructed - -## Remember - -Templates contain precise instructions for a reason. Follow them exactly to ensure document quality and completeness. +- Use exact 1-9 format when elicit: true +- Select options 2-9 from data/elicitation-methods only +- Provide detailed rationale explaining decisions +- End with "Select 1-9 or just type your question/feedback:" ==================== END: .bmad-core/tasks/create-doc.md ==================== ==================== START: .bmad-core/tasks/create-workflow-plan.md ==================== @@ -1821,6 +1808,143 @@ Use the **expansion-creator** pack to build your own: - **Contributing**: See `CONTRIBUTING.md` for full guidelines ==================== END: .bmad-core/data/bmad-kb.md ==================== +==================== START: .bmad-core/data/elicitation-methods.md ==================== +# Elicitation Methods Data + +## Core Reflective Methods + +**Expand or Contract for Audience** +- Ask whether to 'expand' (add detail, elaborate) or 'contract' (simplify, clarify) +- Identify specific target audience if relevant +- Tailor content complexity and depth accordingly + +**Explain Reasoning (CoT Step-by-Step)** +- Walk through the step-by-step thinking process +- Reveal underlying assumptions and decision points +- Show how conclusions were reached from current role's perspective + +**Critique and Refine** +- Review output for flaws, inconsistencies, or improvement areas +- Identify specific weaknesses from role's expertise +- Suggest refined version reflecting domain knowledge + +## Structural Analysis Methods + +**Analyze Logical Flow and Dependencies** +- Examine content structure for logical progression +- Check internal consistency and coherence +- Identify and validate dependencies between elements +- Confirm effective ordering and sequencing + +**Assess Alignment with Overall Goals** +- Evaluate content contribution to stated objectives +- Identify any misalignments or gaps +- Interpret alignment from specific role's perspective +- Suggest adjustments to better serve goals + +## Risk and Challenge Methods + +**Identify Potential Risks and Unforeseen Issues** +- Brainstorm potential risks from role's expertise +- Identify overlooked edge cases or scenarios +- Anticipate unintended consequences +- Highlight implementation challenges + +**Challenge from Critical Perspective** +- Adopt critical stance on current content +- Play devil's advocate from specified viewpoint +- Argue against proposal highlighting weaknesses +- Apply YAGNI principles when appropriate (scope trimming) + +## Creative Exploration Methods + +**Tree of Thoughts Deep Dive** +- Break problem into discrete "thoughts" or intermediate steps +- Explore multiple reasoning paths simultaneously +- Use self-evaluation to classify each path as "sure", "likely", or "impossible" +- Apply search algorithms (BFS/DFS) to find optimal solution paths + +**Hindsight is 20/20: The 'If Only...' Reflection** +- Imagine retrospective scenario based on current content +- Identify the one "if only we had known/done X..." insight +- Describe imagined consequences humorously or dramatically +- Extract actionable learnings for current context + +## Multi-Persona Collaboration Methods + +**Agile Team Perspective Shift** +- Rotate through different Scrum team member viewpoints +- Product Owner: Focus on user value and business impact +- Scrum Master: Examine process flow and team dynamics +- Developer: Assess technical implementation and complexity +- QA: Identify testing scenarios and quality concerns + +**Stakeholder Round Table** +- Convene virtual meeting with multiple personas +- Each persona contributes unique perspective on content +- Identify conflicts and synergies between viewpoints +- Synthesize insights into actionable recommendations + +**Meta-Prompting Analysis** +- Step back to analyze the structure and logic of current approach +- Question the format and methodology being used +- Suggest alternative frameworks or mental models +- Optimize the elicitation process itself + +## Advanced 2025 Techniques + +**Self-Consistency Validation** +- Generate multiple reasoning paths for same problem +- Compare consistency across different approaches +- Identify most reliable and robust solution +- Highlight areas where approaches diverge and why + +**ReWOO (Reasoning Without Observation)** +- Separate parametric reasoning from tool-based actions +- Create reasoning plan without external dependencies +- Identify what can be solved through pure reasoning +- Optimize for efficiency and reduced token usage + +**Persona-Pattern Hybrid** +- Combine specific role expertise with elicitation pattern +- Architect + Risk Analysis: Deep technical risk assessment +- UX Expert + User Journey: End-to-end experience critique +- PM + Stakeholder Analysis: Multi-perspective impact review + +**Emergent Collaboration Discovery** +- Allow multiple perspectives to naturally emerge +- Identify unexpected insights from persona interactions +- Explore novel combinations of viewpoints +- Capture serendipitous discoveries from multi-agent thinking + +## Game-Based Elicitation Methods + +**Red Team vs Blue Team** +- Red Team: Attack the proposal, find vulnerabilities +- Blue Team: Defend and strengthen the approach +- Competitive analysis reveals blind spots +- Results in more robust, battle-tested solutions + +**Innovation Tournament** +- Pit multiple alternative approaches against each other +- Score each approach across different criteria +- Crowd-source evaluation from different personas +- Identify winning combination of features + +**Escape Room Challenge** +- Present content as constraints to work within +- Find creative solutions within tight limitations +- Identify minimum viable approach +- Discover innovative workarounds and optimizations + +## Process Control + +**Proceed / No Further Actions** +- Acknowledge choice to finalize current work +- Accept output as-is or move to next step +- Prepare to continue without additional elicitation +==================== END: .bmad-core/data/elicitation-methods.md ==================== + ==================== START: .bmad-core/utils/plan-management.md ==================== # Plan Management Utility diff --git a/dist/agents/dev.txt b/dist/agents/dev.txt index b5b737b5..21eeac8b 100644 --- a/dist/agents/dev.txt +++ b/dist/agents/dev.txt @@ -45,6 +45,7 @@ These references map directly to bundle sections: CRITICAL: Read the full YAML, start activation to alter your state of being, follow startup section instructions, stay in this being until told to exit this mode: ```yaml +activation-instructions: [] agent: name: James id: dev @@ -52,11 +53,6 @@ agent: icon: 💻 whenToUse: Use for code implementation, debugging, refactoring, and development best practices customization: null -startup: - - Announce: Greet the user with your name and role, and inform of the *help command. - - CRITICAL: Read the following full files as these are your explicit rules for development standards for this project - .bmad-core/core-config.yaml devLoadAlwaysFiles list - - CRITICAL: Do NOT load any other files during startup aside from the assigned story and devLoadAlwaysFiles items, unless user requested you do or the following contradicts - - CRITICAL: Do NOT begin development until a story is not in draft mode and you are told to proceed persona: role: Expert Senior Software Engineer & Implementation Specialist style: Extremely concise, pragmatic, detail-oriented, solution-focused @@ -83,10 +79,10 @@ develop-story: completion: 'All Tasks and Subtasks marked [x] and have tests→Validations and full regression passes (DON''T BE LAZY, EXECUTE ALL TESTS and CONFIRM)→Ensure File List is Complete→run the task execute-checklist for the checklist story-dod-checklist→set story status: ''Ready for Review''→HALT' dependencies: tasks: - - execute-checklist - - validate-next-story + - execute-checklist.md + - validate-next-story.md checklists: - - story-dod-checklist + - story-dod-checklist.md ``` ==================== END: .bmad-core/agents/dev.md ==================== diff --git a/dist/agents/pm.txt b/dist/agents/pm.txt index d11af7df..ff8a869f 100644 --- a/dist/agents/pm.txt +++ b/dist/agents/pm.txt @@ -50,6 +50,7 @@ activation-instructions: - Only read the files/tasks listed here when user selects them for execution to minimize context usage - The customization field ALWAYS takes precedence over any conflicting instructions - When listing tasks/templates or presenting options during conversations, always show as numbered options list, allowing the user to type a number to select or execute + - Greet the user with your name and role, and inform of the *help command. agent: name: John id: pm @@ -71,128 +72,112 @@ persona: - Collaborative & iterative approach - Proactive risk identification - Strategic thinking & outcome-oriented -startup: - - Greet the user with your name and role, and inform of the *help command. commands: - help: Show numbered list of the following commands to allow selection - - create-doc {template}: execute task create-doc (no template = ONLY show available templates listed under dependencies/templates below) - - yolo: Toggle Yolo Mode off on - on will skip doc section confirmations + - create-doc {template}: execute task create-doc for template provided, if no template then ONLY list dependencies.templates + - yolo: Toggle Yolo Mode - doc-out: Output full document to current destination file - exit: Exit (confirm) dependencies: tasks: - - create-doc - - correct-course - - create-deep-research-prompt - - brownfield-create-epic - - brownfield-create-story - - execute-checklist - - shard-doc + - create-doc.md + - correct-course.md + - create-deep-research-prompt.md + - brownfield-create-epic.md + - brownfield-create-story.md + - execute-checklist.md + - shard-doc.md templates: - - prd-tmpl - - brownfield-prd-tmpl + - prd-tmpl.yaml + - brownfield-prd-tmpl.yaml checklists: - - pm-checklist - - change-checklist + - pm-checklist.md + - change-checklist.md data: - - technical-preferences - utils: - - template-format + - technical-preferences.md ``` ==================== END: .bmad-core/agents/pm.md ==================== ==================== START: .bmad-core/tasks/create-doc.md ==================== -# Create Document from Template Task +# Create Document from Template (YAML Driven) -## Purpose +## CRITICAL: Mandatory Elicitation Format -Generate documents from templates by EXECUTING (not just reading) embedded instructions from the perspective of the selected agent persona. +**When `elicit: true`, ALWAYS use this exact format:** -## CRITICAL RULES +1. Present section content +2. Provide detailed rationale (explain trade-offs, assumptions, decisions made) +3. Present numbered options 1-9: + - **Option 1:** Always "Proceed to next section" + - **Options 2-9:** Select 8 methods from data/elicitation-methods + - End with: "Select 1-9 or just type your question/feedback:" -1. **Templates are PROGRAMS** - Execute every [[LLM:]] instruction exactly as written -2. **NEVER show markup** - Hide all [[LLM:]], {{placeholders}}, @{examples}, and template syntax -3. **STOP and EXECUTE** - When you see "apply tasks#" or "execute tasks#", STOP and run that task immediately -4. **WAIT for user input** - At review points and after elicitation tasks +**NEVER ask yes/no questions or use any other format.** -## Execution Flow +## Processing Flow -### 0. Check Workflow Plan (if configured) +1. **Parse YAML template** - Load template metadata and sections +2. **Set preferences** - Show current mode (Interactive), confirm output file +3. **Process each section:** + - Skip if condition unmet + - Check agent permissions (owner/editors) - note if section is restricted to specific agents + - Draft content using section instruction + - Present content + detailed rationale + - **IF elicit: true** → MANDATORY 1-9 options format + - Save to file if possible +4. **Continue until complete** -[[LLM: Check if plan tracking is enabled in core-config.yaml]] +## Detailed Rationale Requirements -- If `workflow.trackProgress: true`, check for active plan using .bmad-core/utils/plan-management.md -- If plan exists and this document creation is part of the plan: - - Verify this is the expected next step - - If out of sequence and `enforceSequence: true`, warn user and halt without user override - - If out of sequence and `enforceSequence: false`, ask for confirmation -- Continue with normal execution after plan check +When presenting section content, ALWAYS include rationale that explains: -### 1. Identify Template +- Trade-offs and choices made (what was chosen over alternatives and why) +- Key assumptions made during drafting +- Interesting or questionable decisions that need user attention +- Areas that might need validation -- Load from `.bmad-core/templates/*.md` or `.bmad-core/templates directory` -- Agent-specific templates are listed in agent's dependencies -- If agent has `templates: [prd-tmpl, architecture-tmpl]` for example, then offer to create "PRD" and "Architecture" documents +## Elicitation Results Flow -### 2. Ask Interaction Mode +After user selects elicitation method (2-9): -> 1. **Incremental** - Section by section with reviews -> 2. **YOLO Mode** - Complete draft then review (user can type `/yolo` anytime to switch) +1. Execute method from data/elicitation-methods +2. Present results with insights +3. Offer options: + - **1. Apply changes and update section** + - **2. Return to elicitation menu** + - **3. Ask any questions or engage further with this elicitation** -### 3. Execute Template +## Agent Permissions -- Replace {{placeholders}} with real content -- Execute [[LLM:]] instructions as you encounter them -- Process <> loops and ^^CONDITIONS^^ -- Use @{examples} for guidance but never output them +When processing sections with agent permission fields: -### 4. Key Execution Patterns +- **owner**: Note which agent role initially creates/populates the section +- **editors**: List agent roles allowed to modify the section +- **readonly**: Mark sections that cannot be modified after creation -**When you see:** `[[LLM: Draft X and immediately execute .bmad-core/tasks/advanced-elicitation.md]]` +**For sections with restricted access:** -- Draft the content -- Present it to user -- IMMEDIATELY execute the task -- Wait for completion before continuing +- Include a note in the generated document indicating the responsible agent +- Example: "_(This section is owned by dev-agent and can only be modified by dev-agent)_" -**When you see:** `[[LLM: After section completion, apply .bmad-core/tasks/Y.md]]` +## YOLO Mode -- Finish the section -- STOP and execute the task -- Wait for user input +User can type `#yolo` to toggle to YOLO mode (process all sections at once). -### 5. Validation & Final Presentation +## CRITICAL REMINDERS -- Run any specified checklists -- Present clean, formatted content only -- No truncation or summarization -- Begin directly with content (no preamble) -- Include any handoff prompts from template +**❌ NEVER:** -### 6. Update Workflow Plan (if applicable) +- Ask yes/no questions for elicitation +- Use any format other than 1-9 numbered options +- Create new elicitation methods -[[LLM: After successful document creation]] +**✅ ALWAYS:** -- If plan tracking is enabled and document was part of plan: - - Call update-workflow-plan task to mark step complete - - Parameters: task: create-doc, step_id: {from plan}, status: complete - - Show next recommended step from plan - -## Common Mistakes to Avoid - -❌ Skipping elicitation tasks -❌ Showing template markup to users -❌ Continuing past STOP signals -❌ Combining multiple review points - -✅ Execute ALL instructions in sequence -✅ Present only clean, formatted content -✅ Stop at every elicitation point -✅ Wait for user confirmation when instructed - -## Remember - -Templates contain precise instructions for a reason. Follow them exactly to ensure document quality and completeness. +- Use exact 1-9 format when elicit: true +- Select options 2-9 from data/elicitation-methods only +- Provide detailed rationale explaining decisions +- End with "Select 1-9 or just type your question/feedback:" ==================== END: .bmad-core/tasks/create-doc.md ==================== ==================== START: .bmad-core/tasks/correct-course.md ==================== @@ -1178,479 +1163,493 @@ Document sharded successfully: - Ensure the sharding is reversible (could reconstruct the original from shards) ==================== END: .bmad-core/tasks/shard-doc.md ==================== -==================== START: .bmad-core/templates/prd-tmpl.md ==================== -# {{Project Name}} Product Requirements Document (PRD) - -[[LLM: The default path and filename unless specified is docs/prd.md]] - -[[LLM: If available, review any provided document or ask if any are optionally available: Project Brief]] - -## Goals and Background Context - -[[LLM: Populate the 2 child sections based on what we have received from user description or the provided brief. Allow user to review the 2 sections and offer changes before proceeding]] - -### Goals - -[[LLM: Bullet list of 1 line desired outcomes the PRD will deliver if successful - user and project desires]] - -### Background Context - -[[LLM: 1-2 short paragraphs summarizing the background context, such as what we learned in the brief without being redundant with the goals, what and why this solves a problem, what the current landscape or need is etc...]] - -### Change Log - -[[LLM: Track document versions and changes]] - -| Date | Version | Description | Author | -| :--- | :------ | :---------- | :----- | - -## Requirements - -[[LLM: Draft the list of functional and non functional requirements under the two child sections, and immediately execute .bmad-core/tasks/advanced-elicitation.md display]] - -### Functional - -[[LLM: Each Requirement will be a bullet markdown and an identifier sequence starting with FR`.]] -@{example: - FR6: The Todo List uses AI to detect and warn against adding potentially duplicate todo items that are worded differently.} - -### Non Functional - -[[LLM: Each Requirement will be a bullet markdown and an identifier sequence starting with NFR`.]] -@{example: - NFR1: AWS service usage **must** aim to stay within free-tier limits where feasible.} - -^^CONDITION: has_ui^^ - -## User Interface Design Goals - -[[LLM: Capture high-level UI/UX vision to guide Design Architect and to inform story creation. Steps: - -1. Pre-fill all subsections with educated guesses based on project context -2. Present the complete rendered section to user -3. Clearly let the user know where assumptions were made -4. Ask targeted questions for unclear/missing elements or areas needing more specification -5. This is NOT detailed UI spec - focus on product vision and user goals -6. After section completion, immediately apply `.bmad-core/tasks/advanced-elicitation.md` protocol]] - -### Overall UX Vision - -### Key Interaction Paradigms - -### Core Screens and Views - -[[LLM: From a product perspective, what are the most critical screens or views necessary to deliver the the PRD values and goals? This is meant to be Conceptual High Level to Drive Rough Epic or User Stories]] - -@{example} - -- Login Screen -- Main Dashboard -- Item Detail Page -- Settings Page - @{/example} - -### Accessibility: { None, WCAG, etc } - -### Branding - -[[LLM: Any known branding elements or style guides that must be incorporated?]] - -@{example} - -- Replicate the look and feel of early 1900s black and white cinema, including animated effects replicating film damage or projector glitches during page or state transitions. -- Attached is the full color pallet and tokens for our corporate branding. - @{/example} - -### Target Device and Platforms - -@{example} -"Web Responsive, and all mobile platforms", "IPhone Only", "ASCII Windows Desktop" -@{/example} - -^^/CONDITION: has_ui^^ - -## Technical Assumptions - -[[LLM: Gather technical decisions that will guide the Architect. Steps: - -1. Check if `.bmad-core/data/technical-preferences.yaml` or an attached `technical-preferences` file exists - use it to pre-populate choices -2. Ask user about: languages, frameworks, starter templates, libraries, APIs, deployment targets -3. For unknowns, offer guidance based on project goals and MVP scope -4. Document ALL technical choices with rationale (why this choice fits the project) -5. These become constraints for the Architect - be specific and complete -6. After section completion, apply `.bmad-core/tasks/advanced-elicitation.md` protocol.]] - -### Repository Structure: { Monorepo, Polyrepo, etc...} - -### Service Architecture - -[[LLM: CRITICAL DECISION - Document the high-level service architecture (e.g., Monolith, Microservices, Serverless functions within a Monorepo).]] - -### Testing requirements - -[[LLM: CRITICAL DECISION - Document the testing requirements, unit only, integration, e2e, manual, need for manual testing convenience methods).]] - -### Additional Technical Assumptions and Requests - -[[LLM: Throughout the entire process of drafting this document, if any other technical assumptions are raised or discovered appropriate for the architect, add them here as additional bulleted items]] - -## Epics - -[[LLM: First, present a high-level list of all epics for user approval, the epic_list and immediately execute .bmad-core/tasks/advanced-elicitation.md display. Each epic should have a title and a short (1 sentence) goal statement. This allows the user to review the overall structure before diving into details. - -CRITICAL: Epics MUST be logically sequential following agile best practices: - -- Each epic should deliver a significant, end-to-end, fully deployable increment of testable functionality -- Epic 1 must establish foundational project infrastructure (app setup, Git, CI/CD, core services) unless we are adding new functionality to an existing app, while also delivering an initial piece of functionality, even as simple as a health-check route or display of a simple canary page - remember this when we produce the stories for the first epic! -- Each subsequent epic builds upon previous epics' functionality delivering major blocks of functionality that provide tangible value to users or business when deployed -- Not every project needs multiple epics, an epic needs to deliver value. For example, an API completed can deliver value even if a UI is not complete and planned for a separate epic. -- Err on the side of less epics, but let the user know your rationale and offer options for splitting them if it seems some are too large or focused on disparate things. -- Cross Cutting Concerns should flow through epics and stories and not be final stories. For example, adding a logging framework as a last story of an epic, or at the end of a project as a final epic or story would be terrible as we would not have logging from the beginning.]] - -<> - -- Epic{{epic_number}} {{epic_title}}: {{short_goal}} - -<> - -@{example: epic_list} - -1. Foundation & Core Infrastructure: Establish project setup, authentication, and basic user management -2. Core Business Entities: Create and manage primary domain objects with CRUD operations -3. User Workflows & Interactions: Enable key user journeys and business processes -4. Reporting & Analytics: Provide insights and data visualization for users - -@{/example} - -[[LLM: After the epic list is approved, present each `epic_details` with all its stories and acceptance criteria as a complete review unit and immediately execute .bmad-core/tasks/advanced-elicitation.md display, before moving on to the next epic.]] - -<> - -## Epic {{epic_number}} {{epic_title}} - -{{epic_goal}} [[LLM: Expanded goal - 2-3 sentences describing the objective and value all the stories will achieve]] - -[[LLM: CRITICAL STORY SEQUENCING REQUIREMENTS: - -- Stories within each epic MUST be logically sequential -- Each story should be a "vertical slice" delivering complete functionality aside from early enabler stories for project foundation -- No story should depend on work from a later story or epic -- Identify and note any direct prerequisite stories -- Focus on "what" and "why" not "how" (leave technical implementation to Architect) yet be precise enough to support a logical sequential order of operations from story to story. -- Ensure each story delivers clear user or business value, try to avoid enablers and build them into stories that deliver value. -- Size stories for AI agent execution: Each story must be completable by a single AI agent in one focused session without context overflow -- Think "junior developer working for 2-4 hours" - stories must be small, focused, and self-contained -- If a story seems complex, break it down further as long as it can deliver a vertical slice -- Each story should result in working, testable code before the agent's context window fills]] - -<> - -### Story {{epic_number}}.{{story_number}} {{story_title}} - -As a {{user_type}}, -I want {{action}}, -so that {{benefit}}. - -#### Acceptance Criteria - -[[LLM: Define clear, comprehensive, and testable acceptance criteria that: - -- Precisely define what "done" means from a functional perspective -- Are unambiguous and serve as basis for verification -- Include any critical non-functional requirements from the PRD -- Consider local testability for backend/data components -- Specify UI/UX requirements and framework adherence where applicable -- Avoid cross-cutting concerns that should be in other stories or PRD sections]] - -<> - -- {{criterion number}}: {{criteria}} - -<> -<> -<> - -## Checklist Results Report - -[[LLM: Before running the checklist and drafting the prompts, offer to output the full updated PRD. If outputting it, confirm with the user that you will be proceeding to run the checklist and produce the report. Once the user confirms, execute the `pm-checklist` and populate the results in this section.]] - -## Next Steps - -### Design Architect Prompt - -[[LLM: This section will contain the prompt for the Design Architect, keep it short and to the point to initiate create architecture mode using this document as input.]] - -### Architect Prompt - -[[LLM: This section will contain the prompt for the Architect, keep it short and to the point to initiate create architecture mode using this document as input.]] -==================== END: .bmad-core/templates/prd-tmpl.md ==================== - -==================== START: .bmad-core/templates/brownfield-prd-tmpl.md ==================== -# {{Project Name}} Brownfield Enhancement PRD - -[[LLM: The default path and filename unless specified is docs/prd.md]] - -[[LLM: IMPORTANT - SCOPE ASSESSMENT REQUIRED: - -This PRD is for SIGNIFICANT enhancements to existing projects that require comprehensive planning and multiple stories. Before proceeding: - -1. **Assess Enhancement Complexity**: If this is a simple feature addition or bug fix that could be completed in 1-2 focused development sessions, STOP and recommend: "For simpler changes, consider using the brownfield-create-epic or brownfield-create-story task with the Product Owner instead. This full PRD process is designed for substantial enhancements that require architectural planning and multiple coordinated stories." - -2. **Project Context**: Determine if we're working in an IDE with the project already loaded or if the user needs to provide project information. If project files are available, analyze existing documentation in the docs folder. If insufficient documentation exists, recommend running the document-project task first. - -3. **Deep Assessment Requirement**: You MUST thoroughly analyze the existing project structure, patterns, and constraints before making ANY suggestions. Every recommendation must be grounded in actual project analysis, not assumptions.]] - -## Intro Project Analysis and Context - -[[LLM: Gather comprehensive information about the existing project. This section must be completed before proceeding with requirements. - -CRITICAL: Throughout this analysis, explicitly confirm your understanding with the user. For every assumption you make about the existing project, ask: "Based on my analysis, I understand that [assumption]. Is this correct?" - -Do not proceed with any recommendations until the user has validated your understanding of the existing system.]] - -### Existing Project Overview - -[[LLM: Check if document-project analysis was already performed. If yes, reference that output instead of re-analyzing.]] - -**Analysis Source**: [[LLM: Indicate one of the following: -- Document-project output available at: {{path}} -- IDE-based fresh analysis -- User-provided information -]] - -**Current Project State**: [[LLM: -- If document-project output exists: Extract summary from "High Level Architecture" and "Technical Summary" sections -- Otherwise: Brief description of what the project currently does and its primary purpose -]] - -### Available Documentation Analysis - -[[LLM: -If document-project was run: -- Note: "Document-project analysis available - using existing technical documentation" -- List key documents created by document-project -- Skip the missing documentation check below - -Otherwise, check for existing documentation: -]] - -**Available Documentation**: - -- [ ] Tech Stack Documentation [[LLM: If from document-project, check ✓]] -- [ ] Source Tree/Architecture [[LLM: If from document-project, check ✓]] -- [ ] Coding Standards [[LLM: If from document-project, may be partial]] -- [ ] API Documentation [[LLM: If from document-project, check ✓]] -- [ ] External API Documentation [[LLM: If from document-project, check ✓]] -- [ ] UX/UI Guidelines [[LLM: May not be in document-project]] -- [ ] Technical Debt Documentation [[LLM: If from document-project, check ✓]] -- [ ] Other: \***\*\_\_\_\*\*** - -[[LLM: -- If document-project was already run: "Using existing project analysis from document-project output." -- If critical documentation is missing and no document-project: "I recommend running the document-project task first..." -]] - -### Enhancement Scope Definition - -[[LLM: Work with user to clearly define what type of enhancement this is. This is critical for scoping and approach.]] - -**Enhancement Type**: [[LLM: Determine with user which applies]] - -- [ ] New Feature Addition -- [ ] Major Feature Modification -- [ ] Integration with New Systems -- [ ] Performance/Scalability Improvements -- [ ] UI/UX Overhaul -- [ ] Technology Stack Upgrade -- [ ] Bug Fix and Stability Improvements -- [ ] Other: \***\*\_\_\_\*\*** - -**Enhancement Description**: [[LLM: 2-3 sentences describing what the user wants to add or change]] - -**Impact Assessment**: [[LLM: Assess the scope of impact on existing codebase]] - -- [ ] Minimal Impact (isolated additions) -- [ ] Moderate Impact (some existing code changes) -- [ ] Significant Impact (substantial existing code changes) -- [ ] Major Impact (architectural changes required) - -### Goals and Background Context - -#### Goals - -[[LLM: Bullet list of 1-line desired outcomes this enhancement will deliver if successful]] - -#### Background Context - -[[LLM: 1-2 short paragraphs explaining why this enhancement is needed, what problem it solves, and how it fits with the existing project]] - -### Change Log - -| Change | Date | Version | Description | Author | -| ------ | ---- | ------- | ----------- | ------ | - -## Requirements - -[[LLM: Draft functional and non-functional requirements based on your validated understanding of the existing project. Before presenting requirements, confirm: "These requirements are based on my understanding of your existing system. Please review carefully and confirm they align with your project's reality." Then immediately execute tasks#advanced-elicitation display]] - -### Functional - -[[LLM: Each Requirement will be a bullet markdown with identifier starting with FR]] -@{example: - FR1: The existing Todo List will integrate with the new AI duplicate detection service without breaking current functionality.} - -### Non Functional - -[[LLM: Each Requirement will be a bullet markdown with identifier starting with NFR. Include constraints from existing system]] -@{example: - NFR1: Enhancement must maintain existing performance characteristics and not exceed current memory usage by more than 20%.} - -### Compatibility Requirements - -[[LLM: Critical for brownfield - what must remain compatible]] - -- CR1: [[LLM: Existing API compatibility requirements]] -- CR2: [[LLM: Database schema compatibility requirements]] -- CR3: [[LLM: UI/UX consistency requirements]] -- CR4: [[LLM: Integration compatibility requirements]] - -^^CONDITION: has_ui^^ - -## User Interface Enhancement Goals - -[[LLM: For UI changes, capture how they will integrate with existing UI patterns and design systems]] - -### Integration with Existing UI - -[[LLM: Describe how new UI elements will fit with existing design patterns, style guides, and component libraries]] - -### Modified/New Screens and Views - -[[LLM: List only the screens/views that will be modified or added]] - -### UI Consistency Requirements - -[[LLM: Specific requirements for maintaining visual and interaction consistency with existing application]] - -^^/CONDITION: has_ui^^ - -## Technical Constraints and Integration Requirements - -[[LLM: This section replaces separate architecture documentation. Gather detailed technical constraints from existing project analysis.]] - -### Existing Technology Stack - -[[LLM: -If document-project output available: -- Extract from "Actual Tech Stack" table in High Level Architecture section -- Include version numbers and any noted constraints - -Otherwise, document the current technology stack: -]] - -**Languages**: [[LLM: From document-project or fresh analysis]] -**Frameworks**: [[LLM: From document-project or fresh analysis]] -**Database**: [[LLM: From document-project or fresh analysis]] -**Infrastructure**: [[LLM: From document-project or fresh analysis]] -**External Dependencies**: [[LLM: From document-project "External Services" section or fresh analysis]] - -### Integration Approach - -[[LLM: Define how the enhancement will integrate with existing architecture]] - -**Database Integration Strategy**: [[LLM: How new features will interact with existing database]] -**API Integration Strategy**: [[LLM: How new APIs will integrate with existing API structure]] -**Frontend Integration Strategy**: [[LLM: How new UI components will integrate with existing frontend]] -**Testing Integration Strategy**: [[LLM: How new tests will integrate with existing test suite]] - -### Code Organization and Standards - -[[LLM: Based on existing project analysis, define how new code will fit existing patterns]] - -**File Structure Approach**: [[LLM: How new files will fit existing project structure]] -**Naming Conventions**: [[LLM: Existing naming conventions that must be followed]] -**Coding Standards**: [[LLM: Existing coding standards and linting rules]] -**Documentation Standards**: [[LLM: How new code documentation will match existing patterns]] - -### Deployment and Operations - -[[LLM: How the enhancement fits existing deployment pipeline]] - -**Build Process Integration**: [[LLM: How enhancement builds with existing process]] -**Deployment Strategy**: [[LLM: How enhancement will be deployed alongside existing features]] -**Monitoring and Logging**: [[LLM: How enhancement will integrate with existing monitoring]] -**Configuration Management**: [[LLM: How new configuration will integrate with existing config]] - -### Risk Assessment and Mitigation - -[[LLM: -If document-project output available: -- Reference "Technical Debt and Known Issues" section -- Include "Workarounds and Gotchas" that might impact enhancement -- Note any identified constraints from "Critical Technical Debt" - -Build risk assessment incorporating existing known issues: -]] - -**Technical Risks**: [[LLM: Include risks from document-project + new enhancement risks]] -**Integration Risks**: [[LLM: Reference integration constraints from document-project]] -**Deployment Risks**: [[LLM: Include deployment gotchas from document-project]] -**Mitigation Strategies**: [[LLM: Address both existing and new risks]] - -## Epic and Story Structure - -[[LLM: For brownfield projects, favor a single comprehensive epic unless the user is clearly requesting multiple unrelated enhancements. Before presenting the epic structure, confirm: "Based on my analysis of your existing project, I believe this enhancement should be structured as [single epic/multiple epics] because [rationale based on actual project analysis]. Does this align with your understanding of the work required?" Then present the epic structure and immediately execute tasks#advanced-elicitation display.]] - -### Epic Approach - -[[LLM: Explain the rationale for epic structure - typically single epic for brownfield unless multiple unrelated features]] - -**Epic Structure Decision**: [[LLM: Single Epic or Multiple Epics with rationale]] - -## Epic 1: {{enhancement_title}} - -[[LLM: Comprehensive epic that delivers the brownfield enhancement while maintaining existing functionality]] - -**Epic Goal**: [[LLM: 2-3 sentences describing the complete enhancement objective and value]] - -**Integration Requirements**: [[LLM: Key integration points with existing system]] - -[[LLM: CRITICAL STORY SEQUENCING FOR BROWNFIELD: - -- Stories must ensure existing functionality remains intact -- Each story should include verification that existing features still work -- Stories should be sequenced to minimize risk to existing system -- Include rollback considerations for each story -- Focus on incremental integration rather than big-bang changes -- Size stories for AI agent execution in existing codebase context -- MANDATORY: Present the complete story sequence and ask: "This story sequence is designed to minimize risk to your existing system. Does this order make sense given your project's architecture and constraints?" -- Stories must be logically sequential with clear dependencies identified -- Each story must deliver value while maintaining system integrity]] - -<> - -### Story 1.{{story_number}} {{story_title}} - -As a {{user_type}}, -I want {{action}}, -so that {{benefit}}. - -#### Acceptance Criteria - -[[LLM: Define criteria that include both new functionality and existing system integrity]] - -<> - -- {{criterion number}}: {{criteria}} - -<> - -#### Integration Verification - -[[LLM: Specific verification steps to ensure existing functionality remains intact]] - -- IV1: [[LLM: Existing functionality verification requirement]] -- IV2: [[LLM: Integration point verification requirement]] -- IV3: [[LLM: Performance impact verification requirement]] - -<> -==================== END: .bmad-core/templates/brownfield-prd-tmpl.md ==================== +==================== START: .bmad-core/templates/prd-tmpl.yaml ==================== +template: + id: prd-template-v2 + name: Product Requirements Document + version: 2.0 + output: + format: markdown + filename: docs/prd.md + title: "{{project_name}} Product Requirements Document (PRD)" + +workflow: + mode: interactive + elicitation: advanced-elicitation + +sections: + - id: goals-context + title: Goals and Background Context + instruction: | + Ask if Project Brief document is available. If NO Project Brief exists, STRONGLY recommend creating one first using project-brief-tmpl (it provides essential foundation: problem statement, target users, success metrics, MVP scope, constraints). If user insists on PRD without brief, gather this information during Goals section. If Project Brief exists, review and use it to populate Goals (bullet list of desired outcomes) and Background Context (1-2 paragraphs on what this solves and why) so we can determine what is and is not in scope for PRD mvp. Either way this is critical to determine the requirements. Include Change Log table. + sections: + - id: goals + title: Goals + type: bullet-list + instruction: Bullet list of 1 line desired outcomes the PRD will deliver if successful - user and project desires + - id: background + title: Background Context + type: paragraphs + instruction: 1-2 short paragraphs summarizing the background context, such as what we learned in the brief without being redundant with the goals, what and why this solves a problem, what the current landscape or need is + - id: changelog + title: Change Log + type: table + columns: [Date, Version, Description, Author] + instruction: Track document versions and changes + + - id: requirements + title: Requirements + instruction: Draft the list of functional and non functional requirements under the two child sections + elicit: true + sections: + - id: functional + title: Functional + type: numbered-list + prefix: FR + instruction: Each Requirement will be a bullet markdown and an identifier sequence starting with FR + examples: + - "FR6: The Todo List uses AI to detect and warn against potentially duplicate todo items that are worded differently." + - id: non-functional + title: Non Functional + type: numbered-list + prefix: NFR + instruction: Each Requirement will be a bullet markdown and an identifier sequence starting with NFR + examples: + - "NFR1: AWS service usage must aim to stay within free-tier limits where feasible." + + - id: ui-goals + title: User Interface Design Goals + condition: PRD has UX/UI requirements + instruction: | + Capture high-level UI/UX vision to guide Design Architect and to inform story creation. Steps: + + 1. Pre-fill all subsections with educated guesses based on project context + 2. Present the complete rendered section to user + 3. Clearly let the user know where assumptions were made + 4. Ask targeted questions for unclear/missing elements or areas needing more specification + 5. This is NOT detailed UI spec - focus on product vision and user goals + elicit: true + choices: + accessibility: [None, WCAG AA, WCAG AAA] + platforms: [Web Responsive, Mobile Only, Desktop Only, Cross-Platform] + sections: + - id: ux-vision + title: Overall UX Vision + - id: interaction-paradigms + title: Key Interaction Paradigms + - id: core-screens + title: Core Screens and Views + instruction: From a product perspective, what are the most critical screens or views necessary to deliver the the PRD values and goals? This is meant to be Conceptual High Level to Drive Rough Epic or User Stories + examples: + - "Login Screen" + - "Main Dashboard" + - "Item Detail Page" + - "Settings Page" + - id: accessibility + title: "Accessibility: {None|WCAG AA|WCAG AAA|Custom Requirements}" + - id: branding + title: Branding + instruction: Any known branding elements or style guides that must be incorporated? + examples: + - "Replicate the look and feel of early 1900s black and white cinema, including animated effects replicating film damage or projector glitches during page or state transitions." + - "Attached is the full color pallet and tokens for our corporate branding." + - id: target-platforms + title: "Target Device and Platforms: {Web Responsive|Mobile Only|Desktop Only|Cross-Platform}" + examples: + - "Web Responsive, and all mobile platforms" + - "iPhone Only" + - "ASCII Windows Desktop" + + - id: technical-assumptions + title: Technical Assumptions + instruction: | + Gather technical decisions that will guide the Architect. Steps: + + 1. Check if .bmad-core/data/technical-preferences.yaml or an attached technical-preferences file exists - use it to pre-populate choices + 2. Ask user about: languages, frameworks, starter templates, libraries, APIs, deployment targets + 3. For unknowns, offer guidance based on project goals and MVP scope + 4. Document ALL technical choices with rationale (why this choice fits the project) + 5. These become constraints for the Architect - be specific and complete + elicit: true + choices: + repository: [Monorepo, Polyrepo] + architecture: [Monolith, Microservices, Serverless] + testing: [Unit Only, Unit + Integration, Full Testing Pyramid] + sections: + - id: repository-structure + title: "Repository Structure: {Monorepo|Polyrepo|Multi-repo}" + - id: service-architecture + title: Service Architecture + instruction: "CRITICAL DECISION - Document the high-level service architecture (e.g., Monolith, Microservices, Serverless functions within a Monorepo)." + - id: testing-requirements + title: Testing Requirements + instruction: "CRITICAL DECISION - Document the testing requirements, unit only, integration, e2e, manual, need for manual testing convenience methods)." + - id: additional-assumptions + title: Additional Technical Assumptions and Requests + instruction: Throughout the entire process of drafting this document, if any other technical assumptions are raised or discovered appropriate for the architect, add them here as additional bulleted items + + - id: epic-list + title: Epic List + instruction: | + Present a high-level list of all epics for user approval. Each epic should have a title and a short (1 sentence) goal statement. This allows the user to review the overall structure before diving into details. + + CRITICAL: Epics MUST be logically sequential following agile best practices: + + - Each epic should deliver a significant, end-to-end, fully deployable increment of testable functionality + - Epic 1 must establish foundational project infrastructure (app setup, Git, CI/CD, core services) unless we are adding new functionality to an existing app, while also delivering an initial piece of functionality, even as simple as a health-check route or display of a simple canary page - remember this when we produce the stories for the first epic! + - Each subsequent epic builds upon previous epics' functionality delivering major blocks of functionality that provide tangible value to users or business when deployed + - Not every project needs multiple epics, an epic needs to deliver value. For example, an API completed can deliver value even if a UI is not complete and planned for a separate epic. + - Err on the side of less epics, but let the user know your rationale and offer options for splitting them if it seems some are too large or focused on disparate things. + - Cross Cutting Concerns should flow through epics and stories and not be final stories. For example, adding a logging framework as a last story of an epic, or at the end of a project as a final epic or story would be terrible as we would not have logging from the beginning. + elicit: true + examples: + - "Epic 1: Foundation & Core Infrastructure: Establish project setup, authentication, and basic user management" + - "Epic 2: Core Business Entities: Create and manage primary domain objects with CRUD operations" + - "Epic 3: User Workflows & Interactions: Enable key user journeys and business processes" + - "Epic 4: Reporting & Analytics: Provide insights and data visualization for users" + + - id: epic-details + title: Epic {{epic_number}} {{epic_title}} + repeatable: true + instruction: | + After the epic list is approved, present each epic with all its stories and acceptance criteria as a complete review unit. + + For each epic provide expanded goal (2-3 sentences describing the objective and value all the stories will achieve). + + CRITICAL STORY SEQUENCING REQUIREMENTS: + + - Stories within each epic MUST be logically sequential + - Each story should be a "vertical slice" delivering complete functionality aside from early enabler stories for project foundation + - No story should depend on work from a later story or epic + - Identify and note any direct prerequisite stories + - Focus on "what" and "why" not "how" (leave technical implementation to Architect) yet be precise enough to support a logical sequential order of operations from story to story. + - Ensure each story delivers clear user or business value, try to avoid enablers and build them into stories that deliver value. + - Size stories for AI agent execution: Each story must be completable by a single AI agent in one focused session without context overflow + - Think "junior developer working for 2-4 hours" - stories must be small, focused, and self-contained + - If a story seems complex, break it down further as long as it can deliver a vertical slice + elicit: true + template: "{{epic_goal}}" + sections: + - id: story + title: Story {{epic_number}}.{{story_number}} {{story_title}} + repeatable: true + template: | + As a {{user_type}}, + I want {{action}}, + so that {{benefit}}. + sections: + - id: acceptance-criteria + title: Acceptance Criteria + type: numbered-list + item_template: "{{criterion_number}}: {{criteria}}" + repeatable: true + instruction: | + Define clear, comprehensive, and testable acceptance criteria that: + + - Precisely define what "done" means from a functional perspective + - Are unambiguous and serve as basis for verification + - Include any critical non-functional requirements from the PRD + - Consider local testability for backend/data components + - Specify UI/UX requirements and framework adherence where applicable + - Avoid cross-cutting concerns that should be in other stories or PRD sections + + - id: checklist-results + title: Checklist Results Report + instruction: Before running the checklist and drafting the prompts, offer to output the full updated PRD. If outputting it, confirm with the user that you will be proceeding to run the checklist and produce the report. Once the user confirms, execute the pm-checklist and populate the results in this section. + + - id: next-steps + title: Next Steps + sections: + - id: design-architect-prompt + title: Design Architect Prompt + instruction: This section will contain the prompt for the Design Architect, keep it short and to the point to initiate create architecture mode using this document as input. + - id: architect-prompt + title: Architect Prompt + instruction: This section will contain the prompt for the Architect, keep it short and to the point to initiate create architecture mode using this document as input. +==================== END: .bmad-core/templates/prd-tmpl.yaml ==================== + +==================== START: .bmad-core/templates/brownfield-prd-tmpl.yaml ==================== +template: + id: brownfield-prd-template-v2 + name: Brownfield Enhancement PRD + version: 2.0 + output: + format: markdown + filename: docs/prd.md + title: "{{project_name}} Brownfield Enhancement PRD" + +workflow: + mode: interactive + elicitation: advanced-elicitation + +sections: + - id: intro-analysis + title: Intro Project Analysis and Context + instruction: | + IMPORTANT - SCOPE ASSESSMENT REQUIRED: + + This PRD is for SIGNIFICANT enhancements to existing projects that require comprehensive planning and multiple stories. Before proceeding: + + 1. **Assess Enhancement Complexity**: If this is a simple feature addition or bug fix that could be completed in 1-2 focused development sessions, STOP and recommend: "For simpler changes, consider using the brownfield-create-epic or brownfield-create-story task with the Product Owner instead. This full PRD process is designed for substantial enhancements that require architectural planning and multiple coordinated stories." + + 2. **Project Context**: Determine if we're working in an IDE with the project already loaded or if the user needs to provide project information. If project files are available, analyze existing documentation in the docs folder. If insufficient documentation exists, recommend running the document-project task first. + + 3. **Deep Assessment Requirement**: You MUST thoroughly analyze the existing project structure, patterns, and constraints before making ANY suggestions. Every recommendation must be grounded in actual project analysis, not assumptions. + + Gather comprehensive information about the existing project. This section must be completed before proceeding with requirements. + + CRITICAL: Throughout this analysis, explicitly confirm your understanding with the user. For every assumption you make about the existing project, ask: "Based on my analysis, I understand that [assumption]. Is this correct?" + + Do not proceed with any recommendations until the user has validated your understanding of the existing system. + sections: + - id: existing-project-overview + title: Existing Project Overview + instruction: Check if document-project analysis was already performed. If yes, reference that output instead of re-analyzing. + sections: + - id: analysis-source + title: Analysis Source + instruction: | + Indicate one of the following: + - Document-project output available at: {{path}} + - IDE-based fresh analysis + - User-provided information + - id: current-state + title: Current Project State + instruction: | + - If document-project output exists: Extract summary from "High Level Architecture" and "Technical Summary" sections + - Otherwise: Brief description of what the project currently does and its primary purpose + - id: documentation-analysis + title: Available Documentation Analysis + instruction: | + If document-project was run: + - Note: "Document-project analysis available - using existing technical documentation" + - List key documents created by document-project + - Skip the missing documentation check below + + Otherwise, check for existing documentation: + sections: + - id: available-docs + title: Available Documentation + type: checklist + items: + - Tech Stack Documentation [[LLM: If from document-project, check ✓]] + - Source Tree/Architecture [[LLM: If from document-project, check ✓]] + - Coding Standards [[LLM: If from document-project, may be partial]] + - API Documentation [[LLM: If from document-project, check ✓]] + - External API Documentation [[LLM: If from document-project, check ✓]] + - UX/UI Guidelines [[LLM: May not be in document-project]] + - Technical Debt Documentation [[LLM: If from document-project, check ✓]] + - "Other: {{other_docs}}" + instruction: | + - If document-project was already run: "Using existing project analysis from document-project output." + - If critical documentation is missing and no document-project: "I recommend running the document-project task first..." + - id: enhancement-scope + title: Enhancement Scope Definition + instruction: Work with user to clearly define what type of enhancement this is. This is critical for scoping and approach. + sections: + - id: enhancement-type + title: Enhancement Type + type: checklist + instruction: Determine with user which applies + items: + - New Feature Addition + - Major Feature Modification + - Integration with New Systems + - Performance/Scalability Improvements + - UI/UX Overhaul + - Technology Stack Upgrade + - Bug Fix and Stability Improvements + - "Other: {{other_type}}" + - id: enhancement-description + title: Enhancement Description + instruction: 2-3 sentences describing what the user wants to add or change + - id: impact-assessment + title: Impact Assessment + type: checklist + instruction: Assess the scope of impact on existing codebase + items: + - Minimal Impact (isolated additions) + - Moderate Impact (some existing code changes) + - Significant Impact (substantial existing code changes) + - Major Impact (architectural changes required) + - id: goals-context + title: Goals and Background Context + sections: + - id: goals + title: Goals + type: bullet-list + instruction: Bullet list of 1-line desired outcomes this enhancement will deliver if successful + - id: background + title: Background Context + type: paragraphs + instruction: 1-2 short paragraphs explaining why this enhancement is needed, what problem it solves, and how it fits with the existing project + - id: changelog + title: Change Log + type: table + columns: [Change, Date, Version, Description, Author] + + - id: requirements + title: Requirements + instruction: | + Draft functional and non-functional requirements based on your validated understanding of the existing project. Before presenting requirements, confirm: "These requirements are based on my understanding of your existing system. Please review carefully and confirm they align with your project's reality." + elicit: true + sections: + - id: functional + title: Functional + type: numbered-list + prefix: FR + instruction: Each Requirement will be a bullet markdown with identifier starting with FR + examples: + - "FR1: The existing Todo List will integrate with the new AI duplicate detection service without breaking current functionality." + - id: non-functional + title: Non Functional + type: numbered-list + prefix: NFR + instruction: Each Requirement will be a bullet markdown with identifier starting with NFR. Include constraints from existing system + examples: + - "NFR1: Enhancement must maintain existing performance characteristics and not exceed current memory usage by more than 20%." + - id: compatibility + title: Compatibility Requirements + instruction: Critical for brownfield - what must remain compatible + type: numbered-list + prefix: CR + template: "{{requirement}}: {{description}}" + items: + - id: cr1 + template: "CR1: {{existing_api_compatibility}}" + - id: cr2 + template: "CR2: {{database_schema_compatibility}}" + - id: cr3 + template: "CR3: {{ui_ux_consistency}}" + - id: cr4 + template: "CR4: {{integration_compatibility}}" + + - id: ui-enhancement-goals + title: User Interface Enhancement Goals + condition: Enhancement includes UI changes + instruction: For UI changes, capture how they will integrate with existing UI patterns and design systems + sections: + - id: existing-ui-integration + title: Integration with Existing UI + instruction: Describe how new UI elements will fit with existing design patterns, style guides, and component libraries + - id: modified-screens + title: Modified/New Screens and Views + instruction: List only the screens/views that will be modified or added + - id: ui-consistency + title: UI Consistency Requirements + instruction: Specific requirements for maintaining visual and interaction consistency with existing application + + - id: technical-constraints + title: Technical Constraints and Integration Requirements + instruction: This section replaces separate architecture documentation. Gather detailed technical constraints from existing project analysis. + sections: + - id: existing-tech-stack + title: Existing Technology Stack + instruction: | + If document-project output available: + - Extract from "Actual Tech Stack" table in High Level Architecture section + - Include version numbers and any noted constraints + + Otherwise, document the current technology stack: + template: | + **Languages**: {{languages}} + **Frameworks**: {{frameworks}} + **Database**: {{database}} + **Infrastructure**: {{infrastructure}} + **External Dependencies**: {{external_dependencies}} + - id: integration-approach + title: Integration Approach + instruction: Define how the enhancement will integrate with existing architecture + template: | + **Database Integration Strategy**: {{database_integration}} + **API Integration Strategy**: {{api_integration}} + **Frontend Integration Strategy**: {{frontend_integration}} + **Testing Integration Strategy**: {{testing_integration}} + - id: code-organization + title: Code Organization and Standards + instruction: Based on existing project analysis, define how new code will fit existing patterns + template: | + **File Structure Approach**: {{file_structure}} + **Naming Conventions**: {{naming_conventions}} + **Coding Standards**: {{coding_standards}} + **Documentation Standards**: {{documentation_standards}} + - id: deployment-operations + title: Deployment and Operations + instruction: How the enhancement fits existing deployment pipeline + template: | + **Build Process Integration**: {{build_integration}} + **Deployment Strategy**: {{deployment_strategy}} + **Monitoring and Logging**: {{monitoring_logging}} + **Configuration Management**: {{config_management}} + - id: risk-assessment + title: Risk Assessment and Mitigation + instruction: | + If document-project output available: + - Reference "Technical Debt and Known Issues" section + - Include "Workarounds and Gotchas" that might impact enhancement + - Note any identified constraints from "Critical Technical Debt" + + Build risk assessment incorporating existing known issues: + template: | + **Technical Risks**: {{technical_risks}} + **Integration Risks**: {{integration_risks}} + **Deployment Risks**: {{deployment_risks}} + **Mitigation Strategies**: {{mitigation_strategies}} + + - id: epic-structure + title: Epic and Story Structure + instruction: | + For brownfield projects, favor a single comprehensive epic unless the user is clearly requesting multiple unrelated enhancements. Before presenting the epic structure, confirm: "Based on my analysis of your existing project, I believe this enhancement should be structured as [single epic/multiple epics] because [rationale based on actual project analysis]. Does this align with your understanding of the work required?" + elicit: true + sections: + - id: epic-approach + title: Epic Approach + instruction: Explain the rationale for epic structure - typically single epic for brownfield unless multiple unrelated features + template: "**Epic Structure Decision**: {{epic_decision}} with rationale" + + - id: epic-details + title: "Epic 1: {{enhancement_title}}" + instruction: | + Comprehensive epic that delivers the brownfield enhancement while maintaining existing functionality + + CRITICAL STORY SEQUENCING FOR BROWNFIELD: + - Stories must ensure existing functionality remains intact + - Each story should include verification that existing features still work + - Stories should be sequenced to minimize risk to existing system + - Include rollback considerations for each story + - Focus on incremental integration rather than big-bang changes + - Size stories for AI agent execution in existing codebase context + - MANDATORY: Present the complete story sequence and ask: "This story sequence is designed to minimize risk to your existing system. Does this order make sense given your project's architecture and constraints?" + - Stories must be logically sequential with clear dependencies identified + - Each story must deliver value while maintaining system integrity + template: | + **Epic Goal**: {{epic_goal}} + + **Integration Requirements**: {{integration_requirements}} + sections: + - id: story + title: "Story 1.{{story_number}} {{story_title}}" + repeatable: true + template: | + As a {{user_type}}, + I want {{action}}, + so that {{benefit}}. + sections: + - id: acceptance-criteria + title: Acceptance Criteria + type: numbered-list + instruction: Define criteria that include both new functionality and existing system integrity + item_template: "{{criterion_number}}: {{criteria}}" + - id: integration-verification + title: Integration Verification + instruction: Specific verification steps to ensure existing functionality remains intact + type: numbered-list + prefix: IV + items: + - template: "IV1: {{existing_functionality_verification}}" + - template: "IV2: {{integration_point_verification}}" + - template: "IV3: {{performance_impact_verification}}" +==================== END: .bmad-core/templates/brownfield-prd-tmpl.yaml ==================== ==================== START: .bmad-core/checklists/pm-checklist.md ==================== # Product Manager (PM) Requirements Checklist @@ -2220,32 +2219,3 @@ Keep it action-oriented and forward-looking.]] None Listed ==================== END: .bmad-core/data/technical-preferences.md ==================== - -==================== START: .bmad-core/utils/template-format.md ==================== -# Template Format Conventions - -Templates in the BMad method use standardized markup for AI processing. These conventions ensure consistent document generation. - -## Template Markup Elements - -- **{{placeholders}}**: Variables to be replaced with actual content -- **[[LLM: instructions]]**: Internal processing instructions for AI agents (never shown to users) -- **REPEAT** sections: Content blocks that may be repeated as needed -- **^^CONDITION^^** blocks: Conditional content included only if criteria are met -- **@{examples}**: Example content for guidance (never output to users) - -## Processing Rules - -- Replace all {{placeholders}} with project-specific content -- Execute all [[LLM: instructions]] internally without showing users -- Process conditional and repeat blocks as specified -- Use examples for guidance but never include them in final output -- Present only clean, formatted content to users - -## Critical Guidelines - -- **NEVER display template markup, LLM instructions, or examples to users** -- Template elements are for AI processing only -- Focus on faithful template execution and clean output -- All template-specific instructions are embedded within templates -==================== END: .bmad-core/utils/template-format.md ==================== diff --git a/dist/agents/po.txt b/dist/agents/po.txt index 6970da79..4daf7ee1 100644 --- a/dist/agents/po.txt +++ b/dist/agents/po.txt @@ -50,6 +50,7 @@ activation-instructions: - Only read the files/tasks listed here when user selects them for execution to minimize context usage - The customization field ALWAYS takes precedence over any conflicting instructions - When listing tasks/templates or presenting options during conversations, always show as numbered options list, allowing the user to type a number to select or execute + - Greet the user with your name and role, and inform of the *help command. agent: name: Sarah id: po @@ -73,8 +74,6 @@ persona: - User Collaboration for Validation - Seek input at critical checkpoints - Focus on Executable & Value-Driven Increments - Ensure work aligns with MVP goals - Documentation Ecosystem Integrity - Maintain consistency across all documents -startup: - - Greet the user with your name and role, and inform of the *help command. commands: - help: Show numbered list of the following commands to allow selection - create-doc {template}: execute task create-doc (no template = ONLY show available templates listed under dependencies/templates below) @@ -89,19 +88,17 @@ commands: - exit: Exit (confirm) dependencies: tasks: - - execute-checklist - - shard-doc - - correct-course - - brownfield-create-epic - - brownfield-create-story - - validate-next-story + - execute-checklist.md + - shard-doc.md + - correct-course.md + - brownfield-create-epic.md + - brownfield-create-story.md + - validate-next-story.md templates: - - story-tmpl + - story-tmpl.yaml checklists: - - po-master-checklist - - change-checklist - utils: - - template-format + - po-master-checklist.md + - change-checklist.md ``` ==================== END: .bmad-core/agents/po.md ==================== @@ -921,66 +918,145 @@ Provide a structured validation report including: - **Confidence Level**: High/Medium/Low for successful implementation ==================== END: .bmad-core/tasks/validate-next-story.md ==================== -==================== START: .bmad-core/templates/story-tmpl.md ==================== ---- -defaultOutput: docs/stories/{{EpicNum}}.{{StoryNum}}.{{Short Title Copied from Epic File specific story}}.md -smAgent: - editableSections: Status, Story, Acceptance Criteria, Tasks / Subtasks, Dev Notes, Testing, Change Log - sectionSpecificInstructions: - "Dev Notes": - - Populate relevant information, only what was pulled from actual artifacts from docs folder, relevant to this story - - Do not invent information. - - If known add Relevant Source Tree info that relates to this story. - - If there were important notes from previous story that are relevant to this one, include them here. - - Put enough information in this section so that the dev agent should NEVER need to read the architecture documents, these notes along with the tasks and subtasks must give the Dev Agent the complete context it needs to comprehend with the least amount of overhead the information to complete the story, meeting all AC and completing all tasks+subtasks. - Testing: - - List Relevant Testing Standards from Architecture the Developer needs to conform to (test file location, test standards, etc) ---- +==================== START: .bmad-core/templates/story-tmpl.yaml ==================== +template: + id: story-template-v2 + name: Story Document + version: 2.0 + output: + format: markdown + filename: docs/stories/{{epic_num}}.{{story_num}}.{{story_title_short}}.md + title: "Story {{epic_num}}.{{story_num}}: {{story_title_short}}" -# Story {{EpicNum}}.{{StoryNum}}: {{Short Title Copied from Epic File specific story}} +workflow: + mode: interactive + elicitation: advanced-elicitation -## Status: {{ Draft | Approved | InProgress | Review | Done }} +agent_config: + editable_sections: + - Status + - Story + - Acceptance Criteria + - Tasks / Subtasks + - Dev Notes + - Testing + - Change Log -## Story - -**As a** {{role}},\ -**I want** {{action}},\ -**so that** {{benefit}} - -## Acceptance Criteria - -{{ Copy of Acceptance Criteria numbered list }} - -## Tasks / Subtasks - -- [ ] Task 1 (AC: # if applicable) - - [ ] Subtask1.1... -- [ ] Task 2 (AC: # if applicable) - - [ ] Subtask 2.1... -- [ ] Task 3 (AC: # if applicable) - - [ ] Subtask 3.1... - -## Dev Notes - -### Testing - -## Change Log - -| Date | Version | Description | Author | -| :--- | :------ | :---------- | :----- | - -## Dev Agent Record - -### Agent Model Used: {{Agent Model Name/Version}} - -### Debug Log References - -### Completion Notes List - -### File List - -## QA Results -==================== END: .bmad-core/templates/story-tmpl.md ==================== +sections: + - id: status + title: Status + type: choice + choices: [Draft, Approved, InProgress, Review, Done] + instruction: Select the current status of the story + owner: scrum-master + editors: [scrum-master, dev-agent] + + - id: story + title: Story + type: template-text + template: | + **As a** {{role}}, + **I want** {{action}}, + **so that** {{benefit}} + instruction: Define the user story using the standard format with role, action, and benefit + elicit: true + owner: scrum-master + editors: [scrum-master] + + - id: acceptance-criteria + title: Acceptance Criteria + type: numbered-list + instruction: Copy the acceptance criteria numbered list from the epic file + elicit: true + owner: scrum-master + editors: [scrum-master] + + - id: tasks-subtasks + title: Tasks / Subtasks + type: bullet-list + instruction: | + Break down the story into specific tasks and subtasks needed for implementation. + Reference applicable acceptance criteria numbers where relevant. + template: | + - [ ] Task 1 (AC: # if applicable) + - [ ] Subtask1.1... + - [ ] Task 2 (AC: # if applicable) + - [ ] Subtask 2.1... + - [ ] Task 3 (AC: # if applicable) + - [ ] Subtask 3.1... + elicit: true + owner: scrum-master + editors: [scrum-master, dev-agent] + + - id: dev-notes + title: Dev Notes + instruction: | + Populate relevant information, only what was pulled from actual artifacts from docs folder, relevant to this story: + - Do not invent information + - If known add Relevant Source Tree info that relates to this story + - If there were important notes from previous story that are relevant to this one, include them here + - Put enough information in this section so that the dev agent should NEVER need to read the architecture documents, these notes along with the tasks and subtasks must give the Dev Agent the complete context it needs to comprehend with the least amount of overhead the information to complete the story, meeting all AC and completing all tasks+subtasks + elicit: true + owner: scrum-master + editors: [scrum-master] + sections: + - id: testing-standards + title: Testing + instruction: | + List Relevant Testing Standards from Architecture the Developer needs to conform to: + - Test file location + - Test standards + - Testing frameworks and patterns to use + - Any specific testing requirements for this story + elicit: true + owner: scrum-master + editors: [scrum-master] + + - id: change-log + title: Change Log + type: table + columns: [Date, Version, Description, Author] + instruction: Track changes made to this story document + owner: scrum-master + editors: [scrum-master, dev-agent, qa-agent] + + - id: dev-agent-record + title: Dev Agent Record + instruction: This section is populated by the development agent during implementation + owner: dev-agent + editors: [dev-agent] + sections: + - id: agent-model + title: Agent Model Used + template: "{{agent_model_name_version}}" + instruction: Record the specific AI agent model and version used for development + owner: dev-agent + editors: [dev-agent] + + - id: debug-log-references + title: Debug Log References + instruction: Reference any debug logs or traces generated during development + owner: dev-agent + editors: [dev-agent] + + - id: completion-notes + title: Completion Notes List + instruction: Notes about the completion of tasks and any issues encountered + owner: dev-agent + editors: [dev-agent] + + - id: file-list + title: File List + instruction: List all files created, modified, or affected during story implementation + owner: dev-agent + editors: [dev-agent] + + - id: qa-results + title: QA Results + instruction: Results from QA Agent QA review of the completed story implementation + owner: qa-agent + editors: [qa-agent] +==================== END: .bmad-core/templates/story-tmpl.yaml ==================== ==================== START: .bmad-core/checklists/po-master-checklist.md ==================== # Product Owner (PO) Master Validation Checklist @@ -1610,32 +1686,3 @@ Keep it action-oriented and forward-looking.]] --- ==================== END: .bmad-core/checklists/change-checklist.md ==================== - -==================== START: .bmad-core/utils/template-format.md ==================== -# Template Format Conventions - -Templates in the BMad method use standardized markup for AI processing. These conventions ensure consistent document generation. - -## Template Markup Elements - -- **{{placeholders}}**: Variables to be replaced with actual content -- **[[LLM: instructions]]**: Internal processing instructions for AI agents (never shown to users) -- **REPEAT** sections: Content blocks that may be repeated as needed -- **^^CONDITION^^** blocks: Conditional content included only if criteria are met -- **@{examples}**: Example content for guidance (never output to users) - -## Processing Rules - -- Replace all {{placeholders}} with project-specific content -- Execute all [[LLM: instructions]] internally without showing users -- Process conditional and repeat blocks as specified -- Use examples for guidance but never include them in final output -- Present only clean, formatted content to users - -## Critical Guidelines - -- **NEVER display template markup, LLM instructions, or examples to users** -- Template elements are for AI processing only -- Focus on faithful template execution and clean output -- All template-specific instructions are embedded within templates -==================== END: .bmad-core/utils/template-format.md ==================== diff --git a/dist/agents/qa.txt b/dist/agents/qa.txt index a939b633..3f4f7c0e 100644 --- a/dist/agents/qa.txt +++ b/dist/agents/qa.txt @@ -50,6 +50,7 @@ activation-instructions: - Only read the files/tasks listed here when user selects them for execution to minimize context usage - The customization field ALWAYS takes precedence over any conflicting instructions - When listing tasks/templates or presenting options during conversations, always show as numbered options list, allowing the user to type a number to select or execute + - Greet the user with your name and role, and inform of the *help command. agent: name: Quinn id: qa @@ -73,8 +74,6 @@ persona: - Risk-Based Testing - Prioritize testing based on risk and critical areas - Continuous Improvement - Balance perfection with pragmatism - Architecture & Design Patterns - Ensure proper patterns and maintainable code structure -startup: - - Greet the user with your name and role, and inform of the *help command. story-file-permissions: - CRITICAL: When reviewing stories, you are ONLY authorized to update the "QA Results" section of story files - CRITICAL: DO NOT modify any other sections including Status, Story, Acceptance Criteria, Tasks/Subtasks, Dev Notes, Testing, Dev Agent Record, Change Log, or any other sections @@ -86,11 +85,11 @@ commands: - exit: Say goodbye as the QA Engineer, and then abandon inhabiting this persona dependencies: tasks: - - review-story + - review-story.md data: - - technical-preferences - utils: - - template-format + - technical-preferences.md + templates: + - story-tmpl.yaml ``` ==================== END: .bmad-core/agents/qa.md ==================== @@ -242,37 +241,148 @@ After review: 3. Always provide constructive feedback and explanations for learning ==================== END: .bmad-core/tasks/review-story.md ==================== +==================== START: .bmad-core/templates/story-tmpl.yaml ==================== +template: + id: story-template-v2 + name: Story Document + version: 2.0 + output: + format: markdown + filename: docs/stories/{{epic_num}}.{{story_num}}.{{story_title_short}}.md + title: "Story {{epic_num}}.{{story_num}}: {{story_title_short}}" + +workflow: + mode: interactive + elicitation: advanced-elicitation + +agent_config: + editable_sections: + - Status + - Story + - Acceptance Criteria + - Tasks / Subtasks + - Dev Notes + - Testing + - Change Log + +sections: + - id: status + title: Status + type: choice + choices: [Draft, Approved, InProgress, Review, Done] + instruction: Select the current status of the story + owner: scrum-master + editors: [scrum-master, dev-agent] + + - id: story + title: Story + type: template-text + template: | + **As a** {{role}}, + **I want** {{action}}, + **so that** {{benefit}} + instruction: Define the user story using the standard format with role, action, and benefit + elicit: true + owner: scrum-master + editors: [scrum-master] + + - id: acceptance-criteria + title: Acceptance Criteria + type: numbered-list + instruction: Copy the acceptance criteria numbered list from the epic file + elicit: true + owner: scrum-master + editors: [scrum-master] + + - id: tasks-subtasks + title: Tasks / Subtasks + type: bullet-list + instruction: | + Break down the story into specific tasks and subtasks needed for implementation. + Reference applicable acceptance criteria numbers where relevant. + template: | + - [ ] Task 1 (AC: # if applicable) + - [ ] Subtask1.1... + - [ ] Task 2 (AC: # if applicable) + - [ ] Subtask 2.1... + - [ ] Task 3 (AC: # if applicable) + - [ ] Subtask 3.1... + elicit: true + owner: scrum-master + editors: [scrum-master, dev-agent] + + - id: dev-notes + title: Dev Notes + instruction: | + Populate relevant information, only what was pulled from actual artifacts from docs folder, relevant to this story: + - Do not invent information + - If known add Relevant Source Tree info that relates to this story + - If there were important notes from previous story that are relevant to this one, include them here + - Put enough information in this section so that the dev agent should NEVER need to read the architecture documents, these notes along with the tasks and subtasks must give the Dev Agent the complete context it needs to comprehend with the least amount of overhead the information to complete the story, meeting all AC and completing all tasks+subtasks + elicit: true + owner: scrum-master + editors: [scrum-master] + sections: + - id: testing-standards + title: Testing + instruction: | + List Relevant Testing Standards from Architecture the Developer needs to conform to: + - Test file location + - Test standards + - Testing frameworks and patterns to use + - Any specific testing requirements for this story + elicit: true + owner: scrum-master + editors: [scrum-master] + + - id: change-log + title: Change Log + type: table + columns: [Date, Version, Description, Author] + instruction: Track changes made to this story document + owner: scrum-master + editors: [scrum-master, dev-agent, qa-agent] + + - id: dev-agent-record + title: Dev Agent Record + instruction: This section is populated by the development agent during implementation + owner: dev-agent + editors: [dev-agent] + sections: + - id: agent-model + title: Agent Model Used + template: "{{agent_model_name_version}}" + instruction: Record the specific AI agent model and version used for development + owner: dev-agent + editors: [dev-agent] + + - id: debug-log-references + title: Debug Log References + instruction: Reference any debug logs or traces generated during development + owner: dev-agent + editors: [dev-agent] + + - id: completion-notes + title: Completion Notes List + instruction: Notes about the completion of tasks and any issues encountered + owner: dev-agent + editors: [dev-agent] + + - id: file-list + title: File List + instruction: List all files created, modified, or affected during story implementation + owner: dev-agent + editors: [dev-agent] + + - id: qa-results + title: QA Results + instruction: Results from QA Agent QA review of the completed story implementation + owner: qa-agent + editors: [qa-agent] +==================== END: .bmad-core/templates/story-tmpl.yaml ==================== + ==================== START: .bmad-core/data/technical-preferences.md ==================== # User-Defined Preferred Patterns and Preferences None Listed ==================== END: .bmad-core/data/technical-preferences.md ==================== - -==================== START: .bmad-core/utils/template-format.md ==================== -# Template Format Conventions - -Templates in the BMad method use standardized markup for AI processing. These conventions ensure consistent document generation. - -## Template Markup Elements - -- **{{placeholders}}**: Variables to be replaced with actual content -- **[[LLM: instructions]]**: Internal processing instructions for AI agents (never shown to users) -- **REPEAT** sections: Content blocks that may be repeated as needed -- **^^CONDITION^^** blocks: Conditional content included only if criteria are met -- **@{examples}**: Example content for guidance (never output to users) - -## Processing Rules - -- Replace all {{placeholders}} with project-specific content -- Execute all [[LLM: instructions]] internally without showing users -- Process conditional and repeat blocks as specified -- Use examples for guidance but never include them in final output -- Present only clean, formatted content to users - -## Critical Guidelines - -- **NEVER display template markup, LLM instructions, or examples to users** -- Template elements are for AI processing only -- Focus on faithful template execution and clean output -- All template-specific instructions are embedded within templates -==================== END: .bmad-core/utils/template-format.md ==================== diff --git a/dist/agents/sm.txt b/dist/agents/sm.txt index 625d4d8c..c5de7a02 100644 --- a/dist/agents/sm.txt +++ b/dist/agents/sm.txt @@ -49,6 +49,7 @@ activation-instructions: - Follow all instructions in this file -> this defines you, your persona and more importantly what you can do. STAY IN CHARACTER! - The customization field ALWAYS takes precedence over any conflicting instructions - When listing tasks/templates or presenting options during conversations, always show as numbered options list, allowing the user to type a number to select or execute + - Greet the user with your name and role, and inform of the *help command and then HALT to await instruction if not given already. agent: name: Bob id: sm @@ -65,10 +66,6 @@ persona: - Rigorously follow `create-next-story` procedure to generate the detailed user story - Will ensure all information comes from the PRD and Architecture to guide the dumb dev agent - You are NOT allowed to implement stories or modify code EVER! -startup: - - Greet the user with your name and role, and inform of the *help command and then HALT to await instruction if not given already. - - Offer to help with story preparation but wait for explicit user confirmation - - Only execute tasks when user explicitly requests them commands: - help: Show numbered list of the following commands to allow selection - draft: Execute task create-next-story @@ -77,15 +74,13 @@ commands: - exit: Say goodbye as the Scrum Master, and then abandon inhabiting this persona dependencies: tasks: - - create-next-story - - execute-checklist - - correct-course + - create-next-story.md + - execute-checklist.md + - correct-course.md templates: - - story-tmpl + - story-tmpl.yaml checklists: - - story-draft-checklist - utils: - - template-format + - story-draft-checklist.md ``` ==================== END: .bmad-core/agents/sm.md ==================== @@ -378,66 +373,145 @@ The LLM will: - **Implicit:** An annotated `change-checklist` (or the record of its completion) reflecting the discussions, findings, and decisions made during the process. ==================== END: .bmad-core/tasks/correct-course.md ==================== -==================== START: .bmad-core/templates/story-tmpl.md ==================== ---- -defaultOutput: docs/stories/{{EpicNum}}.{{StoryNum}}.{{Short Title Copied from Epic File specific story}}.md -smAgent: - editableSections: Status, Story, Acceptance Criteria, Tasks / Subtasks, Dev Notes, Testing, Change Log - sectionSpecificInstructions: - "Dev Notes": - - Populate relevant information, only what was pulled from actual artifacts from docs folder, relevant to this story - - Do not invent information. - - If known add Relevant Source Tree info that relates to this story. - - If there were important notes from previous story that are relevant to this one, include them here. - - Put enough information in this section so that the dev agent should NEVER need to read the architecture documents, these notes along with the tasks and subtasks must give the Dev Agent the complete context it needs to comprehend with the least amount of overhead the information to complete the story, meeting all AC and completing all tasks+subtasks. - Testing: - - List Relevant Testing Standards from Architecture the Developer needs to conform to (test file location, test standards, etc) ---- +==================== START: .bmad-core/templates/story-tmpl.yaml ==================== +template: + id: story-template-v2 + name: Story Document + version: 2.0 + output: + format: markdown + filename: docs/stories/{{epic_num}}.{{story_num}}.{{story_title_short}}.md + title: "Story {{epic_num}}.{{story_num}}: {{story_title_short}}" -# Story {{EpicNum}}.{{StoryNum}}: {{Short Title Copied from Epic File specific story}} +workflow: + mode: interactive + elicitation: advanced-elicitation -## Status: {{ Draft | Approved | InProgress | Review | Done }} +agent_config: + editable_sections: + - Status + - Story + - Acceptance Criteria + - Tasks / Subtasks + - Dev Notes + - Testing + - Change Log -## Story - -**As a** {{role}},\ -**I want** {{action}},\ -**so that** {{benefit}} - -## Acceptance Criteria - -{{ Copy of Acceptance Criteria numbered list }} - -## Tasks / Subtasks - -- [ ] Task 1 (AC: # if applicable) - - [ ] Subtask1.1... -- [ ] Task 2 (AC: # if applicable) - - [ ] Subtask 2.1... -- [ ] Task 3 (AC: # if applicable) - - [ ] Subtask 3.1... - -## Dev Notes - -### Testing - -## Change Log - -| Date | Version | Description | Author | -| :--- | :------ | :---------- | :----- | - -## Dev Agent Record - -### Agent Model Used: {{Agent Model Name/Version}} - -### Debug Log References - -### Completion Notes List - -### File List - -## QA Results -==================== END: .bmad-core/templates/story-tmpl.md ==================== +sections: + - id: status + title: Status + type: choice + choices: [Draft, Approved, InProgress, Review, Done] + instruction: Select the current status of the story + owner: scrum-master + editors: [scrum-master, dev-agent] + + - id: story + title: Story + type: template-text + template: | + **As a** {{role}}, + **I want** {{action}}, + **so that** {{benefit}} + instruction: Define the user story using the standard format with role, action, and benefit + elicit: true + owner: scrum-master + editors: [scrum-master] + + - id: acceptance-criteria + title: Acceptance Criteria + type: numbered-list + instruction: Copy the acceptance criteria numbered list from the epic file + elicit: true + owner: scrum-master + editors: [scrum-master] + + - id: tasks-subtasks + title: Tasks / Subtasks + type: bullet-list + instruction: | + Break down the story into specific tasks and subtasks needed for implementation. + Reference applicable acceptance criteria numbers where relevant. + template: | + - [ ] Task 1 (AC: # if applicable) + - [ ] Subtask1.1... + - [ ] Task 2 (AC: # if applicable) + - [ ] Subtask 2.1... + - [ ] Task 3 (AC: # if applicable) + - [ ] Subtask 3.1... + elicit: true + owner: scrum-master + editors: [scrum-master, dev-agent] + + - id: dev-notes + title: Dev Notes + instruction: | + Populate relevant information, only what was pulled from actual artifacts from docs folder, relevant to this story: + - Do not invent information + - If known add Relevant Source Tree info that relates to this story + - If there were important notes from previous story that are relevant to this one, include them here + - Put enough information in this section so that the dev agent should NEVER need to read the architecture documents, these notes along with the tasks and subtasks must give the Dev Agent the complete context it needs to comprehend with the least amount of overhead the information to complete the story, meeting all AC and completing all tasks+subtasks + elicit: true + owner: scrum-master + editors: [scrum-master] + sections: + - id: testing-standards + title: Testing + instruction: | + List Relevant Testing Standards from Architecture the Developer needs to conform to: + - Test file location + - Test standards + - Testing frameworks and patterns to use + - Any specific testing requirements for this story + elicit: true + owner: scrum-master + editors: [scrum-master] + + - id: change-log + title: Change Log + type: table + columns: [Date, Version, Description, Author] + instruction: Track changes made to this story document + owner: scrum-master + editors: [scrum-master, dev-agent, qa-agent] + + - id: dev-agent-record + title: Dev Agent Record + instruction: This section is populated by the development agent during implementation + owner: dev-agent + editors: [dev-agent] + sections: + - id: agent-model + title: Agent Model Used + template: "{{agent_model_name_version}}" + instruction: Record the specific AI agent model and version used for development + owner: dev-agent + editors: [dev-agent] + + - id: debug-log-references + title: Debug Log References + instruction: Reference any debug logs or traces generated during development + owner: dev-agent + editors: [dev-agent] + + - id: completion-notes + title: Completion Notes List + instruction: Notes about the completion of tasks and any issues encountered + owner: dev-agent + editors: [dev-agent] + + - id: file-list + title: File List + instruction: List all files created, modified, or affected during story implementation + owner: dev-agent + editors: [dev-agent] + + - id: qa-results + title: QA Results + instruction: Results from QA Agent QA review of the completed story implementation + owner: qa-agent + editors: [qa-agent] +==================== END: .bmad-core/templates/story-tmpl.yaml ==================== ==================== START: .bmad-core/checklists/story-draft-checklist.md ==================== # Story Draft Checklist @@ -597,32 +671,3 @@ Be pragmatic - perfect documentation doesn't exist, but it must be enough to pro - NEEDS REVISION: The story requires updates (see issues) - BLOCKED: External information required (specify what information) ==================== END: .bmad-core/checklists/story-draft-checklist.md ==================== - -==================== START: .bmad-core/utils/template-format.md ==================== -# Template Format Conventions - -Templates in the BMad method use standardized markup for AI processing. These conventions ensure consistent document generation. - -## Template Markup Elements - -- **{{placeholders}}**: Variables to be replaced with actual content -- **[[LLM: instructions]]**: Internal processing instructions for AI agents (never shown to users) -- **REPEAT** sections: Content blocks that may be repeated as needed -- **^^CONDITION^^** blocks: Conditional content included only if criteria are met -- **@{examples}**: Example content for guidance (never output to users) - -## Processing Rules - -- Replace all {{placeholders}} with project-specific content -- Execute all [[LLM: instructions]] internally without showing users -- Process conditional and repeat blocks as specified -- Use examples for guidance but never include them in final output -- Present only clean, formatted content to users - -## Critical Guidelines - -- **NEVER display template markup, LLM instructions, or examples to users** -- Template elements are for AI processing only -- Focus on faithful template execution and clean output -- All template-specific instructions are embedded within templates -==================== END: .bmad-core/utils/template-format.md ==================== diff --git a/dist/agents/ux-expert.txt b/dist/agents/ux-expert.txt index 2fd6034e..2f49b1b4 100644 --- a/dist/agents/ux-expert.txt +++ b/dist/agents/ux-expert.txt @@ -50,6 +50,7 @@ activation-instructions: - Only read the files/tasks listed here when user selects them for execution to minimize context usage - The customization field ALWAYS takes precedence over any conflicting instructions - When listing tasks/templates or presenting options during conversations, always show as numbered options list, allowing the user to type a number to select or execute + - Greet the user with your name and role, and inform of the *help command. agent: name: Sally id: ux-expert @@ -71,9 +72,6 @@ persona: - You have a keen eye for detail and a deep empathy for users. - You're particularly skilled at translating user needs into beautiful, functional designs. - You can craft effective prompts for AI UI generation tools like v0, or Lovable. -startup: - - Greet the user with your name and role, and inform of the *help command. - - Always start by understanding the user's context, goals, and constraints before proposing solutions. commands: - help: Show numbered list of the following commands to allow selection - create-doc {template}: execute task create-doc (no template = ONLY show available templates listed under dependencies/templates below) @@ -83,16 +81,14 @@ commands: - exit: Say goodbye as the UX Expert, and then abandon inhabiting this persona dependencies: tasks: - - generate-ai-frontend-prompt - - create-deep-research-prompt - - create-doc - - execute-checklist + - generate-ai-frontend-prompt.md + - create-deep-research-prompt.md + - create-doc.md + - execute-checklist.md templates: - - front-end-spec-tmpl + - front-end-spec-tmpl.yaml data: - - technical-preferences - utils: - - template-format + - technical-preferences.md ``` ==================== END: .bmad-core/agents/ux-expert.md ==================== @@ -455,97 +451,85 @@ Present these numbered options to the user: ==================== END: .bmad-core/tasks/create-deep-research-prompt.md ==================== ==================== START: .bmad-core/tasks/create-doc.md ==================== -# Create Document from Template Task +# Create Document from Template (YAML Driven) -## Purpose +## CRITICAL: Mandatory Elicitation Format -Generate documents from templates by EXECUTING (not just reading) embedded instructions from the perspective of the selected agent persona. +**When `elicit: true`, ALWAYS use this exact format:** -## CRITICAL RULES +1. Present section content +2. Provide detailed rationale (explain trade-offs, assumptions, decisions made) +3. Present numbered options 1-9: + - **Option 1:** Always "Proceed to next section" + - **Options 2-9:** Select 8 methods from data/elicitation-methods + - End with: "Select 1-9 or just type your question/feedback:" -1. **Templates are PROGRAMS** - Execute every [[LLM:]] instruction exactly as written -2. **NEVER show markup** - Hide all [[LLM:]], {{placeholders}}, @{examples}, and template syntax -3. **STOP and EXECUTE** - When you see "apply tasks#" or "execute tasks#", STOP and run that task immediately -4. **WAIT for user input** - At review points and after elicitation tasks +**NEVER ask yes/no questions or use any other format.** -## Execution Flow +## Processing Flow -### 0. Check Workflow Plan (if configured) +1. **Parse YAML template** - Load template metadata and sections +2. **Set preferences** - Show current mode (Interactive), confirm output file +3. **Process each section:** + - Skip if condition unmet + - Check agent permissions (owner/editors) - note if section is restricted to specific agents + - Draft content using section instruction + - Present content + detailed rationale + - **IF elicit: true** → MANDATORY 1-9 options format + - Save to file if possible +4. **Continue until complete** -[[LLM: Check if plan tracking is enabled in core-config.yaml]] +## Detailed Rationale Requirements -- If `workflow.trackProgress: true`, check for active plan using .bmad-core/utils/plan-management.md -- If plan exists and this document creation is part of the plan: - - Verify this is the expected next step - - If out of sequence and `enforceSequence: true`, warn user and halt without user override - - If out of sequence and `enforceSequence: false`, ask for confirmation -- Continue with normal execution after plan check +When presenting section content, ALWAYS include rationale that explains: -### 1. Identify Template +- Trade-offs and choices made (what was chosen over alternatives and why) +- Key assumptions made during drafting +- Interesting or questionable decisions that need user attention +- Areas that might need validation -- Load from `.bmad-core/templates/*.md` or `.bmad-core/templates directory` -- Agent-specific templates are listed in agent's dependencies -- If agent has `templates: [prd-tmpl, architecture-tmpl]` for example, then offer to create "PRD" and "Architecture" documents +## Elicitation Results Flow -### 2. Ask Interaction Mode +After user selects elicitation method (2-9): -> 1. **Incremental** - Section by section with reviews -> 2. **YOLO Mode** - Complete draft then review (user can type `/yolo` anytime to switch) +1. Execute method from data/elicitation-methods +2. Present results with insights +3. Offer options: + - **1. Apply changes and update section** + - **2. Return to elicitation menu** + - **3. Ask any questions or engage further with this elicitation** -### 3. Execute Template +## Agent Permissions -- Replace {{placeholders}} with real content -- Execute [[LLM:]] instructions as you encounter them -- Process <> loops and ^^CONDITIONS^^ -- Use @{examples} for guidance but never output them +When processing sections with agent permission fields: -### 4. Key Execution Patterns +- **owner**: Note which agent role initially creates/populates the section +- **editors**: List agent roles allowed to modify the section +- **readonly**: Mark sections that cannot be modified after creation -**When you see:** `[[LLM: Draft X and immediately execute .bmad-core/tasks/advanced-elicitation.md]]` +**For sections with restricted access:** -- Draft the content -- Present it to user -- IMMEDIATELY execute the task -- Wait for completion before continuing +- Include a note in the generated document indicating the responsible agent +- Example: "_(This section is owned by dev-agent and can only be modified by dev-agent)_" -**When you see:** `[[LLM: After section completion, apply .bmad-core/tasks/Y.md]]` +## YOLO Mode -- Finish the section -- STOP and execute the task -- Wait for user input +User can type `#yolo` to toggle to YOLO mode (process all sections at once). -### 5. Validation & Final Presentation +## CRITICAL REMINDERS -- Run any specified checklists -- Present clean, formatted content only -- No truncation or summarization -- Begin directly with content (no preamble) -- Include any handoff prompts from template +**❌ NEVER:** -### 6. Update Workflow Plan (if applicable) +- Ask yes/no questions for elicitation +- Use any format other than 1-9 numbered options +- Create new elicitation methods -[[LLM: After successful document creation]] +**✅ ALWAYS:** -- If plan tracking is enabled and document was part of plan: - - Call update-workflow-plan task to mark step complete - - Parameters: task: create-doc, step_id: {from plan}, status: complete - - Show next recommended step from plan - -## Common Mistakes to Avoid - -❌ Skipping elicitation tasks -❌ Showing template markup to users -❌ Continuing past STOP signals -❌ Combining multiple review points - -✅ Execute ALL instructions in sequence -✅ Present only clean, formatted content -✅ Stop at every elicitation point -✅ Wait for user confirmation when instructed - -## Remember - -Templates contain precise instructions for a reason. Follow them exactly to ensure document quality and completeness. +- Use exact 1-9 format when elicit: true +- Select options 2-9 from data/elicitation-methods only +- Provide detailed rationale explaining decisions +- End with "Select 1-9 or just type your question/feedback:" ==================== END: .bmad-core/tasks/create-doc.md ==================== ==================== START: .bmad-core/tasks/execute-checklist.md ==================== @@ -644,453 +628,360 @@ The LLM will: - Offer to provide detailed analysis of any section, especially those with warnings or failures ==================== END: .bmad-core/tasks/execute-checklist.md ==================== -==================== START: .bmad-core/templates/front-end-spec-tmpl.md ==================== -# {{Project Name}} UI/UX Specification - -[[LLM: The default path and filename unless specified is docs/front-end-spec.md]] - -[[LLM: Review provided documents including Project Brief, PRD, and any user research to gather context. Focus on understanding user needs, pain points, and desired outcomes before beginning the specification.]] - -## Introduction - -[[LLM: Establish the document's purpose and scope. Keep the content below but ensure project name is properly substituted.]] - -This document defines the user experience goals, information architecture, user flows, and visual design specifications for {{Project Name}}'s user interface. It serves as the foundation for visual design and frontend development, ensuring a cohesive and user-centered experience. - -### Overall UX Goals & Principles - -[[LLM: Work with the user to establish and document the following. If not already defined, facilitate a discussion to determine: - -1. Target User Personas - elicit details or confirm existing ones from PRD -2. Key Usability Goals - understand what success looks like for users -3. Core Design Principles - establish 3-5 guiding principles - -After presenting this section, apply `tasks#advanced-elicitation` protocol]] - -### Target User Personas - -{{persona_descriptions}} - -@{example: personas} - -- **Power User:** Technical professionals who need advanced features and efficiency -- **Casual User:** Occasional users who prioritize ease of use and clear guidance -- **Administrator:** System managers who need control and oversight capabilities - @{/example} - -### Usability Goals - -{{usability_goals}} - -@{example: usability_goals} - -- Ease of learning: New users can complete core tasks within 5 minutes -- Efficiency of use: Power users can complete frequent tasks with minimal clicks -- Error prevention: Clear validation and confirmation for destructive actions -- Memorability: Infrequent users can return without relearning - @{/example} - -### Design Principles - -{{design_principles}} - -@{example: design_principles} - -1. **Clarity over cleverness** - Prioritize clear communication over aesthetic innovation -2. **Progressive disclosure** - Show only what's needed, when it's needed -3. **Consistent patterns** - Use familiar UI patterns throughout the application -4. **Immediate feedback** - Every action should have a clear, immediate response -5. **Accessible by default** - Design for all users from the start - @{/example} - -### Change Log - -[[LLM: Track document versions and changes]] - -| Date | Version | Description | Author | -| :--- | :------ | :---------- | :----- | - -## Information Architecture (IA) - -[[LLM: Collaborate with the user to create a comprehensive information architecture: - -1. Build a Site Map or Screen Inventory showing all major areas -2. Define the Navigation Structure (primary, secondary, breadcrumbs) -3. Use Mermaid diagrams for visual representation -4. Consider user mental models and expected groupings - -After presenting this section, apply `tasks#advanced-elicitation` protocol]] - -### Site Map / Screen Inventory - -```mermaid -{{sitemap_diagram}} -``` - -@{example: sitemap} - -```mermaid -graph TD - A[Homepage] --> B[Dashboard] - A --> C[Products] - A --> D[Account] - B --> B1[Analytics] - B --> B2[Recent Activity] - C --> C1[Browse] - C --> C2[Search] - C --> C3[Product Details] - D --> D1[Profile] - D --> D2[Settings] - D --> D3[Billing] -``` - -@{/example} - -### Navigation Structure - -**Primary Navigation:** {{primary_nav_description}} - -**Secondary Navigation:** {{secondary_nav_description}} - -**Breadcrumb Strategy:** {{breadcrumb_strategy}} - -## User Flows - -[[LLM: For each critical user task identified in the PRD: - -1. Define the user's goal clearly -2. Map out all steps including decision points -3. Consider edge cases and error states -4. Use Mermaid flow diagrams for clarity -5. Link to external tools (Figma/Miro) if detailed flows exist there - -Create subsections for each major flow. After presenting all flows, apply `tasks#advanced-elicitation` protocol]] - -<> - -### {{flow_name}} - -**User Goal:** {{flow_goal}} - -**Entry Points:** {{entry_points}} - -**Success Criteria:** {{success_criteria}} - -#### Flow Diagram - -```mermaid -{{flow_diagram}} -``` - -**Edge Cases & Error Handling:** - -- {{edge_case_1}} -- {{edge_case_2}} - -**Notes:** {{flow_notes}} -<> - -@{example: user_flow} - -### User Registration - -**User Goal:** Create a new account to access the platform - -**Entry Points:** Homepage CTA, Login page link, Marketing landing pages - -**Success Criteria:** User successfully creates account and reaches dashboard - -#### Flow Diagram - -```mermaid -graph TD - Start[Landing Page] --> Click[Click Sign Up] - Click --> Form[Registration Form] - Form --> Fill[Fill Required Fields] - Fill --> Submit[Submit Form] - Submit --> Validate{Valid?} - Validate -->|No| Error[Show Errors] - Error --> Form - Validate -->|Yes| Verify[Email Verification] - Verify --> Complete[Account Created] - Complete --> Dashboard[Redirect to Dashboard] -``` - -**Edge Cases & Error Handling:** - -- Duplicate email: Show inline error with password recovery option -- Weak password: Real-time feedback on password strength -- Network error: Preserve form data and show retry option - @{/example} - -## Wireframes & Mockups - -[[LLM: Clarify where detailed visual designs will be created (Figma, Sketch, etc.) and how to reference them. If low-fidelity wireframes are needed, offer to help conceptualize layouts for key screens. - -After presenting this section, apply `tasks#advanced-elicitation` protocol]] - -**Primary Design Files:** {{design_tool_link}} - -### Key Screen Layouts - -<> - -#### {{screen_name}} - -**Purpose:** {{screen_purpose}} - -**Key Elements:** - -- {{element_1}} -- {{element_2}} -- {{element_3}} - -**Interaction Notes:** {{interaction_notes}} - -**Design File Reference:** {{specific_frame_link}} -<> - -## Component Library / Design System - -[[LLM: Discuss whether to use an existing design system or create a new one. If creating new, identify foundational components and their key states. Note that detailed technical specs belong in front-end-architecture. - -After presenting this section, apply `tasks#advanced-elicitation` protocol]] - -**Design System Approach:** {{design_system_approach}} - -### Core Components - -<> - -#### {{component_name}} - -**Purpose:** {{component_purpose}} - -**Variants:** {{component_variants}} - -**States:** {{component_states}} - -**Usage Guidelines:** {{usage_guidelines}} -<> - -@{example: component} - -#### Button - -**Purpose:** Primary interaction element for user actions - -**Variants:** Primary, Secondary, Tertiary, Destructive - -**States:** Default, Hover, Active, Disabled, Loading - -**Usage Guidelines:** - -- Use Primary for main CTAs (one per view) -- Secondary for supporting actions -- Destructive only for permanent deletions with confirmation - @{/example} - -## Branding & Style Guide - -[[LLM: Link to existing style guide or define key brand elements. Ensure consistency with company brand guidelines if they exist. - -After presenting this section, apply `tasks#advanced-elicitation` protocol]] - -### Visual Identity - -**Brand Guidelines:** {{brand_guidelines_link}} - -### Color Palette - -| Color Type | Hex Code | Usage | -| :------------ | :------------------ | :------------------------------- | -| **Primary** | {{primary_color}} | {{primary_usage}} | -| **Secondary** | {{secondary_color}} | {{secondary_usage}} | -| **Accent** | {{accent_color}} | {{accent_usage}} | -| **Success** | {{success_color}} | Positive feedback, confirmations | -| **Warning** | {{warning_color}} | Cautions, important notices | -| **Error** | {{error_color}} | Errors, destructive actions | -| **Neutral** | {{neutral_colors}} | Text, borders, backgrounds | - -### Typography - -**Font Families:** - -- **Primary:** {{primary_font}} -- **Secondary:** {{secondary_font}} -- **Monospace:** {{mono_font}} - -**Type Scale:** -| Element | Size | Weight | Line Height | -|:--------|:-----|:-------|:------------| -| H1 | {{h1_size}} | {{h1_weight}} | {{h1_line}} | -| H2 | {{h2_size}} | {{h2_weight}} | {{h2_line}} | -| H3 | {{h3_size}} | {{h3_weight}} | {{h3_line}} | -| Body | {{body_size}} | {{body_weight}} | {{body_line}} | -| Small | {{small_size}} | {{small_weight}} | {{small_line}} | - -### Iconography - -**Icon Library:** {{icon_library}} - -**Usage Guidelines:** {{icon_guidelines}} - -### Spacing & Layout - -**Grid System:** {{grid_system}} - -**Spacing Scale:** {{spacing_scale}} - -## Accessibility Requirements - -[[LLM: Define specific accessibility requirements based on target compliance level and user needs. Be comprehensive but practical. - -After presenting this section, apply `tasks#advanced-elicitation` protocol]] - -### Compliance Target - -**Standard:** {{compliance_standard}} - -### Key Requirements - -**Visual:** - -- Color contrast ratios: {{contrast_requirements}} -- Focus indicators: {{focus_requirements}} -- Text sizing: {{text_requirements}} - -**Interaction:** - -- Keyboard navigation: {{keyboard_requirements}} -- Screen reader support: {{screen_reader_requirements}} -- Touch targets: {{touch_requirements}} - -**Content:** - -- Alternative text: {{alt_text_requirements}} -- Heading structure: {{heading_requirements}} -- Form labels: {{form_requirements}} - -### Testing Strategy - -{{accessibility_testing}} - -## Responsiveness Strategy - -[[LLM: Define breakpoints and adaptation strategies for different device sizes. Consider both technical constraints and user contexts. - -After presenting this section, apply `tasks#advanced-elicitation` protocol]] - -### Breakpoints - -| Breakpoint | Min Width | Max Width | Target Devices | -| :--------- | :-------------- | :-------------- | :------------------ | -| Mobile | {{mobile_min}} | {{mobile_max}} | {{mobile_devices}} | -| Tablet | {{tablet_min}} | {{tablet_max}} | {{tablet_devices}} | -| Desktop | {{desktop_min}} | {{desktop_max}} | {{desktop_devices}} | -| Wide | {{wide_min}} | - | {{wide_devices}} | - -### Adaptation Patterns - -**Layout Changes:** {{layout_adaptations}} - -**Navigation Changes:** {{nav_adaptations}} - -**Content Priority:** {{content_adaptations}} - -**Interaction Changes:** {{interaction_adaptations}} - -## Animation & Micro-interactions - -[[LLM: Define motion design principles and key interactions. Keep performance and accessibility in mind. - -After presenting this section, apply `tasks#advanced-elicitation` protocol]] - -### Motion Principles - -{{motion_principles}} - -### Key Animations - -<> - -- **{{animation_name}}:** {{animation_description}} (Duration: {{duration}}, Easing: {{easing}}) - <> - -## Performance Considerations - -[[LLM: Define performance goals and strategies that impact UX design decisions.]] - -### Performance Goals - -- **Page Load:** {{load_time_goal}} -- **Interaction Response:** {{interaction_goal}} -- **Animation FPS:** {{animation_goal}} - -### Design Strategies - -{{performance_strategies}} - -## Next Steps - -[[LLM: After completing the UI/UX specification: - -1. Recommend review with stakeholders -2. Suggest creating/updating visual designs in design tool -3. Prepare for handoff to Design Architect for frontend architecture -4. Note any open questions or decisions needed]] - -### Immediate Actions - -1. {{next_step_1}} -2. {{next_step_2}} -3. {{next_step_3}} - -### Design Handoff Checklist - -- [ ] All user flows documented -- [ ] Component inventory complete -- [ ] Accessibility requirements defined -- [ ] Responsive strategy clear -- [ ] Brand guidelines incorporated -- [ ] Performance goals established - -## Checklist Results - -[[LLM: If a UI/UX checklist exists, run it against this document and report results here.]] -==================== END: .bmad-core/templates/front-end-spec-tmpl.md ==================== +==================== START: .bmad-core/templates/front-end-spec-tmpl.yaml ==================== +template: + id: frontend-spec-template-v2 + name: UI/UX Specification + version: 2.0 + output: + format: markdown + filename: docs/front-end-spec.md + title: "{{project_name}} UI/UX Specification" + +workflow: + mode: interactive + elicitation: advanced-elicitation + +sections: + - id: introduction + title: Introduction + instruction: | + Review provided documents including Project Brief, PRD, and any user research to gather context. Focus on understanding user needs, pain points, and desired outcomes before beginning the specification. + + Establish the document's purpose and scope. Keep the content below but ensure project name is properly substituted. + content: | + This document defines the user experience goals, information architecture, user flows, and visual design specifications for {{project_name}}'s user interface. It serves as the foundation for visual design and frontend development, ensuring a cohesive and user-centered experience. + sections: + - id: ux-goals-principles + title: Overall UX Goals & Principles + instruction: | + Work with the user to establish and document the following. If not already defined, facilitate a discussion to determine: + + 1. Target User Personas - elicit details or confirm existing ones from PRD + 2. Key Usability Goals - understand what success looks like for users + 3. Core Design Principles - establish 3-5 guiding principles + elicit: true + sections: + - id: user-personas + title: Target User Personas + template: "{{persona_descriptions}}" + examples: + - "**Power User:** Technical professionals who need advanced features and efficiency" + - "**Casual User:** Occasional users who prioritize ease of use and clear guidance" + - "**Administrator:** System managers who need control and oversight capabilities" + - id: usability-goals + title: Usability Goals + template: "{{usability_goals}}" + examples: + - "Ease of learning: New users can complete core tasks within 5 minutes" + - "Efficiency of use: Power users can complete frequent tasks with minimal clicks" + - "Error prevention: Clear validation and confirmation for destructive actions" + - "Memorability: Infrequent users can return without relearning" + - id: design-principles + title: Design Principles + template: "{{design_principles}}" + type: numbered-list + examples: + - "**Clarity over cleverness** - Prioritize clear communication over aesthetic innovation" + - "**Progressive disclosure** - Show only what's needed, when it's needed" + - "**Consistent patterns** - Use familiar UI patterns throughout the application" + - "**Immediate feedback** - Every action should have a clear, immediate response" + - "**Accessible by default** - Design for all users from the start" + - id: changelog + title: Change Log + type: table + columns: [Date, Version, Description, Author] + instruction: Track document versions and changes + + - id: information-architecture + title: Information Architecture (IA) + instruction: | + Collaborate with the user to create a comprehensive information architecture: + + 1. Build a Site Map or Screen Inventory showing all major areas + 2. Define the Navigation Structure (primary, secondary, breadcrumbs) + 3. Use Mermaid diagrams for visual representation + 4. Consider user mental models and expected groupings + elicit: true + sections: + - id: sitemap + title: Site Map / Screen Inventory + type: mermaid + mermaid_type: graph + template: "{{sitemap_diagram}}" + examples: + - | + graph TD + A[Homepage] --> B[Dashboard] + A --> C[Products] + A --> D[Account] + B --> B1[Analytics] + B --> B2[Recent Activity] + C --> C1[Browse] + C --> C2[Search] + C --> C3[Product Details] + D --> D1[Profile] + D --> D2[Settings] + D --> D3[Billing] + - id: navigation-structure + title: Navigation Structure + template: | + **Primary Navigation:** {{primary_nav_description}} + + **Secondary Navigation:** {{secondary_nav_description}} + + **Breadcrumb Strategy:** {{breadcrumb_strategy}} + + - id: user-flows + title: User Flows + instruction: | + For each critical user task identified in the PRD: + + 1. Define the user's goal clearly + 2. Map out all steps including decision points + 3. Consider edge cases and error states + 4. Use Mermaid flow diagrams for clarity + 5. Link to external tools (Figma/Miro) if detailed flows exist there + + Create subsections for each major flow. + elicit: true + repeatable: true + sections: + - id: flow + title: "{{flow_name}}" + template: | + **User Goal:** {{flow_goal}} + + **Entry Points:** {{entry_points}} + + **Success Criteria:** {{success_criteria}} + sections: + - id: flow-diagram + title: Flow Diagram + type: mermaid + mermaid_type: graph + template: "{{flow_diagram}}" + - id: edge-cases + title: "Edge Cases & Error Handling:" + type: bullet-list + template: "- {{edge_case}}" + - id: notes + template: "**Notes:** {{flow_notes}}" + + - id: wireframes-mockups + title: Wireframes & Mockups + instruction: | + Clarify where detailed visual designs will be created (Figma, Sketch, etc.) and how to reference them. If low-fidelity wireframes are needed, offer to help conceptualize layouts for key screens. + elicit: true + sections: + - id: design-files + template: "**Primary Design Files:** {{design_tool_link}}" + - id: key-screen-layouts + title: Key Screen Layouts + repeatable: true + sections: + - id: screen + title: "{{screen_name}}" + template: | + **Purpose:** {{screen_purpose}} + + **Key Elements:** + - {{element_1}} + - {{element_2}} + - {{element_3}} + + **Interaction Notes:** {{interaction_notes}} + + **Design File Reference:** {{specific_frame_link}} + + - id: component-library + title: Component Library / Design System + instruction: | + Discuss whether to use an existing design system or create a new one. If creating new, identify foundational components and their key states. Note that detailed technical specs belong in front-end-architecture. + elicit: true + sections: + - id: design-system-approach + template: "**Design System Approach:** {{design_system_approach}}" + - id: core-components + title: Core Components + repeatable: true + sections: + - id: component + title: "{{component_name}}" + template: | + **Purpose:** {{component_purpose}} + + **Variants:** {{component_variants}} + + **States:** {{component_states}} + + **Usage Guidelines:** {{usage_guidelines}} + + - id: branding-style + title: Branding & Style Guide + instruction: Link to existing style guide or define key brand elements. Ensure consistency with company brand guidelines if they exist. + elicit: true + sections: + - id: visual-identity + title: Visual Identity + template: "**Brand Guidelines:** {{brand_guidelines_link}}" + - id: color-palette + title: Color Palette + type: table + columns: ["Color Type", "Hex Code", "Usage"] + rows: + - ["Primary", "{{primary_color}}", "{{primary_usage}}"] + - ["Secondary", "{{secondary_color}}", "{{secondary_usage}}"] + - ["Accent", "{{accent_color}}", "{{accent_usage}}"] + - ["Success", "{{success_color}}", "Positive feedback, confirmations"] + - ["Warning", "{{warning_color}}", "Cautions, important notices"] + - ["Error", "{{error_color}}", "Errors, destructive actions"] + - ["Neutral", "{{neutral_colors}}", "Text, borders, backgrounds"] + - id: typography + title: Typography + sections: + - id: font-families + title: Font Families + template: | + - **Primary:** {{primary_font}} + - **Secondary:** {{secondary_font}} + - **Monospace:** {{mono_font}} + - id: type-scale + title: Type Scale + type: table + columns: ["Element", "Size", "Weight", "Line Height"] + rows: + - ["H1", "{{h1_size}}", "{{h1_weight}}", "{{h1_line}}"] + - ["H2", "{{h2_size}}", "{{h2_weight}}", "{{h2_line}}"] + - ["H3", "{{h3_size}}", "{{h3_weight}}", "{{h3_line}}"] + - ["Body", "{{body_size}}", "{{body_weight}}", "{{body_line}}"] + - ["Small", "{{small_size}}", "{{small_weight}}", "{{small_line}}"] + - id: iconography + title: Iconography + template: | + **Icon Library:** {{icon_library}} + + **Usage Guidelines:** {{icon_guidelines}} + - id: spacing-layout + title: Spacing & Layout + template: | + **Grid System:** {{grid_system}} + + **Spacing Scale:** {{spacing_scale}} + + - id: accessibility + title: Accessibility Requirements + instruction: Define specific accessibility requirements based on target compliance level and user needs. Be comprehensive but practical. + elicit: true + sections: + - id: compliance-target + title: Compliance Target + template: "**Standard:** {{compliance_standard}}" + - id: key-requirements + title: Key Requirements + template: | + **Visual:** + - Color contrast ratios: {{contrast_requirements}} + - Focus indicators: {{focus_requirements}} + - Text sizing: {{text_requirements}} + + **Interaction:** + - Keyboard navigation: {{keyboard_requirements}} + - Screen reader support: {{screen_reader_requirements}} + - Touch targets: {{touch_requirements}} + + **Content:** + - Alternative text: {{alt_text_requirements}} + - Heading structure: {{heading_requirements}} + - Form labels: {{form_requirements}} + - id: testing-strategy + title: Testing Strategy + template: "{{accessibility_testing}}" + + - id: responsiveness + title: Responsiveness Strategy + instruction: Define breakpoints and adaptation strategies for different device sizes. Consider both technical constraints and user contexts. + elicit: true + sections: + - id: breakpoints + title: Breakpoints + type: table + columns: ["Breakpoint", "Min Width", "Max Width", "Target Devices"] + rows: + - ["Mobile", "{{mobile_min}}", "{{mobile_max}}", "{{mobile_devices}}"] + - ["Tablet", "{{tablet_min}}", "{{tablet_max}}", "{{tablet_devices}}"] + - ["Desktop", "{{desktop_min}}", "{{desktop_max}}", "{{desktop_devices}}"] + - ["Wide", "{{wide_min}}", "-", "{{wide_devices}}"] + - id: adaptation-patterns + title: Adaptation Patterns + template: | + **Layout Changes:** {{layout_adaptations}} + + **Navigation Changes:** {{nav_adaptations}} + + **Content Priority:** {{content_adaptations}} + + **Interaction Changes:** {{interaction_adaptations}} + + - id: animation + title: Animation & Micro-interactions + instruction: Define motion design principles and key interactions. Keep performance and accessibility in mind. + elicit: true + sections: + - id: motion-principles + title: Motion Principles + template: "{{motion_principles}}" + - id: key-animations + title: Key Animations + repeatable: true + template: "- **{{animation_name}}:** {{animation_description}} (Duration: {{duration}}, Easing: {{easing}})" + + - id: performance + title: Performance Considerations + instruction: Define performance goals and strategies that impact UX design decisions. + sections: + - id: performance-goals + title: Performance Goals + template: | + - **Page Load:** {{load_time_goal}} + - **Interaction Response:** {{interaction_goal}} + - **Animation FPS:** {{animation_goal}} + - id: design-strategies + title: Design Strategies + template: "{{performance_strategies}}" + + - id: next-steps + title: Next Steps + instruction: | + After completing the UI/UX specification: + + 1. Recommend review with stakeholders + 2. Suggest creating/updating visual designs in design tool + 3. Prepare for handoff to Design Architect for frontend architecture + 4. Note any open questions or decisions needed + sections: + - id: immediate-actions + title: Immediate Actions + type: numbered-list + template: "{{action}}" + - id: design-handoff-checklist + title: Design Handoff Checklist + type: checklist + items: + - "All user flows documented" + - "Component inventory complete" + - "Accessibility requirements defined" + - "Responsive strategy clear" + - "Brand guidelines incorporated" + - "Performance goals established" + + - id: checklist-results + title: Checklist Results + instruction: If a UI/UX checklist exists, run it against this document and report results here. +==================== END: .bmad-core/templates/front-end-spec-tmpl.yaml ==================== ==================== START: .bmad-core/data/technical-preferences.md ==================== # User-Defined Preferred Patterns and Preferences None Listed ==================== END: .bmad-core/data/technical-preferences.md ==================== - -==================== START: .bmad-core/utils/template-format.md ==================== -# Template Format Conventions - -Templates in the BMad method use standardized markup for AI processing. These conventions ensure consistent document generation. - -## Template Markup Elements - -- **{{placeholders}}**: Variables to be replaced with actual content -- **[[LLM: instructions]]**: Internal processing instructions for AI agents (never shown to users) -- **REPEAT** sections: Content blocks that may be repeated as needed -- **^^CONDITION^^** blocks: Conditional content included only if criteria are met -- **@{examples}**: Example content for guidance (never output to users) - -## Processing Rules - -- Replace all {{placeholders}} with project-specific content -- Execute all [[LLM: instructions]] internally without showing users -- Process conditional and repeat blocks as specified -- Use examples for guidance but never include them in final output -- Present only clean, formatted content to users - -## Critical Guidelines - -- **NEVER display template markup, LLM instructions, or examples to users** -- Template elements are for AI processing only -- Focus on faithful template execution and clean output -- All template-specific instructions are embedded within templates -==================== END: .bmad-core/utils/template-format.md ==================== diff --git a/dist/expansion-packs/bmad-2d-phaser-game-dev/agents/game-designer.txt b/dist/expansion-packs/bmad-2d-phaser-game-dev/agents/game-designer.txt index 0f215980..ac1e7d66 100644 --- a/dist/expansion-packs/bmad-2d-phaser-game-dev/agents/game-designer.txt +++ b/dist/expansion-packs/bmad-2d-phaser-game-dev/agents/game-designer.txt @@ -50,6 +50,9 @@ activation-instructions: - Only read the files/tasks listed here when user selects them for execution to minimize context usage - The customization field ALWAYS takes precedence over any conflicting instructions - When listing tasks/templates or presenting options during conversations, always show as numbered options list, allowing the user to type a number to select or execute + - Greet the user with your name and role, and inform of the *help command + - Offer to help with game design documentation but wait for explicit user confirmation + - Only execute tasks when user explicitly requests them agent: name: Alex id: game-designer @@ -69,12 +72,6 @@ core_principles: - Technical Awareness - Design within feasible implementation constraints - Data-Driven Decisions - Use metrics and feedback to guide design choices - Numbered Options Protocol - Always use numbered lists for user selections -startup: - - Greet the user with your name and role, and inform of the *help command - - CRITICAL: Do NOT automatically create documents or execute tasks during startup - - CRITICAL: Do NOT create or modify any files during startup - - Offer to help with game design documentation but wait for explicit user confirmation - - Only execute tasks when user explicitly requests them commands: - '*help" - Show numbered list of available commands for selection' - '*chat-mode" - Conversational mode with advanced-elicitation for design advice' @@ -86,112 +83,100 @@ commands: - '*exit" - Say goodbye as the Game Designer, and then abandon inhabiting this persona' dependencies: tasks: - - create-doc - - execute-checklist - - game-design-brainstorming - - create-deep-research-prompt - - advanced-elicitation + - create-doc.md + - execute-checklist.md + - game-design-brainstorming.md + - create-deep-research-prompt.md + - advanced-elicitation.md templates: - - game-design-doc-tmpl - - level-design-doc-tmpl - - game-brief-tmpl + - game-design-doc-tmpl.yaml + - level-design-doc-tmpl.yaml + - game-brief-tmpl.yaml checklists: - - game-design-checklist + - game-design-checklist.md ``` ==================== END: .bmad-2d-phaser-game-dev/agents/game-designer.md ==================== ==================== START: .bmad-2d-phaser-game-dev/tasks/create-doc.md ==================== -# Create Document from Template Task +# Create Document from Template (YAML Driven) -## Purpose +## CRITICAL: Mandatory Elicitation Format -Generate documents from templates by EXECUTING (not just reading) embedded instructions from the perspective of the selected agent persona. +**When `elicit: true`, ALWAYS use this exact format:** -## CRITICAL RULES +1. Present section content +2. Provide detailed rationale (explain trade-offs, assumptions, decisions made) +3. Present numbered options 1-9: + - **Option 1:** Always "Proceed to next section" + - **Options 2-9:** Select 8 methods from data/elicitation-methods + - End with: "Select 1-9 or just type your question/feedback:" -1. **Templates are PROGRAMS** - Execute every [[LLM:]] instruction exactly as written -2. **NEVER show markup** - Hide all [[LLM:]], {{placeholders}}, @{examples}, and template syntax -3. **STOP and EXECUTE** - When you see "apply tasks#" or "execute tasks#", STOP and run that task immediately -4. **WAIT for user input** - At review points and after elicitation tasks +**NEVER ask yes/no questions or use any other format.** -## Execution Flow +## Processing Flow -### 0. Check Workflow Plan (if configured) +1. **Parse YAML template** - Load template metadata and sections +2. **Set preferences** - Show current mode (Interactive), confirm output file +3. **Process each section:** + - Skip if condition unmet + - Check agent permissions (owner/editors) - note if section is restricted to specific agents + - Draft content using section instruction + - Present content + detailed rationale + - **IF elicit: true** → MANDATORY 1-9 options format + - Save to file if possible +4. **Continue until complete** -[[LLM: Check if plan tracking is enabled in core-config.yaml]] +## Detailed Rationale Requirements -- If `workflow.trackProgress: true`, check for active plan using .bmad-2d-phaser-game-dev/utils/plan-management.md -- If plan exists and this document creation is part of the plan: - - Verify this is the expected next step - - If out of sequence and `enforceSequence: true`, warn user and halt without user override - - If out of sequence and `enforceSequence: false`, ask for confirmation -- Continue with normal execution after plan check +When presenting section content, ALWAYS include rationale that explains: -### 1. Identify Template +- Trade-offs and choices made (what was chosen over alternatives and why) +- Key assumptions made during drafting +- Interesting or questionable decisions that need user attention +- Areas that might need validation -- Load from `.bmad-2d-phaser-game-dev/templates/*.md` or `.bmad-2d-phaser-game-dev/templates directory` -- Agent-specific templates are listed in agent's dependencies -- If agent has `templates: [prd-tmpl, architecture-tmpl]` for example, then offer to create "PRD" and "Architecture" documents +## Elicitation Results Flow -### 2. Ask Interaction Mode +After user selects elicitation method (2-9): -> 1. **Incremental** - Section by section with reviews -> 2. **YOLO Mode** - Complete draft then review (user can type `/yolo` anytime to switch) +1. Execute method from data/elicitation-methods +2. Present results with insights +3. Offer options: + - **1. Apply changes and update section** + - **2. Return to elicitation menu** + - **3. Ask any questions or engage further with this elicitation** -### 3. Execute Template +## Agent Permissions -- Replace {{placeholders}} with real content -- Execute [[LLM:]] instructions as you encounter them -- Process <> loops and ^^CONDITIONS^^ -- Use @{examples} for guidance but never output them +When processing sections with agent permission fields: -### 4. Key Execution Patterns +- **owner**: Note which agent role initially creates/populates the section +- **editors**: List agent roles allowed to modify the section +- **readonly**: Mark sections that cannot be modified after creation -**When you see:** `[[LLM: Draft X and immediately execute .bmad-2d-phaser-game-dev/tasks/advanced-elicitation.md]]` +**For sections with restricted access:** -- Draft the content -- Present it to user -- IMMEDIATELY execute the task -- Wait for completion before continuing +- Include a note in the generated document indicating the responsible agent +- Example: "_(This section is owned by dev-agent and can only be modified by dev-agent)_" -**When you see:** `[[LLM: After section completion, apply .bmad-2d-phaser-game-dev/tasks/Y.md]]` +## YOLO Mode -- Finish the section -- STOP and execute the task -- Wait for user input +User can type `#yolo` to toggle to YOLO mode (process all sections at once). -### 5. Validation & Final Presentation +## CRITICAL REMINDERS -- Run any specified checklists -- Present clean, formatted content only -- No truncation or summarization -- Begin directly with content (no preamble) -- Include any handoff prompts from template +**❌ NEVER:** -### 6. Update Workflow Plan (if applicable) +- Ask yes/no questions for elicitation +- Use any format other than 1-9 numbered options +- Create new elicitation methods -[[LLM: After successful document creation]] +**✅ ALWAYS:** -- If plan tracking is enabled and document was part of plan: - - Call update-workflow-plan task to mark step complete - - Parameters: task: create-doc, step_id: {from plan}, status: complete - - Show next recommended step from plan - -## Common Mistakes to Avoid - -❌ Skipping elicitation tasks -❌ Showing template markup to users -❌ Continuing past STOP signals -❌ Combining multiple review points - -✅ Execute ALL instructions in sequence -✅ Present only clean, formatted content -✅ Stop at every elicitation point -✅ Wait for user confirmation when instructed - -## Remember - -Templates contain precise instructions for a reason. Follow them exactly to ensure document quality and completeness. +- Use exact 1-9 format when elicit: true +- Select options 2-9 from data/elicitation-methods only +- Provide detailed rationale explaining decisions +- End with "Select 1-9 or just type your question/feedback:" ==================== END: .bmad-2d-phaser-game-dev/tasks/create-doc.md ==================== ==================== START: .bmad-2d-phaser-game-dev/tasks/execute-checklist.md ==================== @@ -1019,1160 +1004,1197 @@ The questions and perspectives offered should always consider: - Game development best practices and common pitfalls ==================== END: .bmad-2d-phaser-game-dev/tasks/advanced-elicitation.md ==================== -==================== START: .bmad-2d-phaser-game-dev/templates/game-design-doc-tmpl.md ==================== -# {{Game Title}} Game Design Document (GDD) - -[[LLM: This template creates a comprehensive Game Design Document that will serve as the foundation for all game development work. The GDD should be detailed enough that developers can create user stories and epics from it. Focus on gameplay systems, mechanics, and technical requirements that can be broken down into implementable features. - -If available, review any provided documents or ask if any are optionally available: Project Brief, Market Research, Competitive Analysis]] - -## Executive Summary - -[[LLM: Create a compelling overview that captures the essence of the game. Present this section first and get user feedback before proceeding.]] - -### Core Concept - -[[LLM: 2-3 sentences that clearly describe what the game is and why players will love it]] - -### Target Audience - -[[LLM: Define the primary and secondary audience with demographics and gaming preferences]] - -**Primary:** {{age_range}}, {{player_type}}, {{platform_preference}} -**Secondary:** {{secondary_audience}} - -### Platform & Technical Requirements - -[[LLM: Based on the technical preferences or user input, define the target platforms]] - -**Primary Platform:** {{platform}} -**Engine:** Phaser 3 + TypeScript -**Performance Target:** 60 FPS on {{minimum_device}} -**Screen Support:** {{resolution_range}} - -### Unique Selling Points - -[[LLM: List 3-5 key features that differentiate this game from competitors]] - -1. {{usp_1}} -2. {{usp_2}} -3. {{usp_3}} - -## Core Gameplay - -[[LLM: This section defines the fundamental game mechanics. After presenting each subsection, apply `tasks#advanced-elicitation` protocol to ensure completeness.]] - -### Game Pillars - -[[LLM: Define 3-5 core pillars that guide all design decisions. These should be specific and actionable.]] - -1. **{{pillar_1}}** - {{description}} -2. **{{pillar_2}}** - {{description}} -3. **{{pillar_3}}** - {{description}} - -### Core Gameplay Loop - -[[LLM: Define the 30-60 second loop that players will repeat. Be specific about timing and player actions.]] - -**Primary Loop ({{duration}} seconds):** - -1. {{action_1}} ({{time_1}}s) -2. {{action_2}} ({{time_2}}s) -3. {{action_3}} ({{time_3}}s) -4. {{reward_feedback}} ({{time_4}}s) - -### Win/Loss Conditions - -[[LLM: Clearly define success and failure states]] - -**Victory Conditions:** - -- {{win_condition_1}} -- {{win_condition_2}} - -**Failure States:** - -- {{loss_condition_1}} -- {{loss_condition_2}} - -## Game Mechanics - -[[LLM: Detail each major mechanic that will need to be implemented. Each mechanic should be specific enough for developers to create implementation stories.]] - -### Primary Mechanics - -<> - -#### {{mechanic_name}} - -**Description:** {{detailed_description}} - -**Player Input:** {{input_method}} - -**System Response:** {{game_response}} - -**Implementation Notes:** - -- {{tech_requirement_1}} -- {{tech_requirement_2}} -- {{performance_consideration}} - -**Dependencies:** {{other_mechanics_needed}} - -<> - -### Controls - -[[LLM: Define all input methods for different platforms]] - -| Action | Desktop | Mobile | Gamepad | -| ------------ | ------- | ----------- | ---------- | -| {{action_1}} | {{key}} | {{gesture}} | {{button}} | -| {{action_2}} | {{key}} | {{gesture}} | {{button}} | - -## Progression & Balance - -[[LLM: Define how players advance and how difficulty scales. This section should provide clear parameters for implementation.]] - -### Player Progression - -**Progression Type:** {{linear|branching|metroidvania}} - -**Key Milestones:** - -1. **{{milestone_1}}** - {{unlock_description}} -2. **{{milestone_2}}** - {{unlock_description}} -3. **{{milestone_3}}** - {{unlock_description}} - -### Difficulty Curve - -[[LLM: Provide specific parameters for balancing]] - -**Tutorial Phase:** {{duration}} - {{difficulty_description}} -**Early Game:** {{duration}} - {{difficulty_description}} -**Mid Game:** {{duration}} - {{difficulty_description}} -**Late Game:** {{duration}} - {{difficulty_description}} - -### Economy & Resources - -^^CONDITION: has_economy^^ - -[[LLM: Define any in-game currencies, resources, or collectibles]] - -| Resource | Earn Rate | Spend Rate | Purpose | Cap | -| -------------- | --------- | ---------- | ------- | ------- | -| {{resource_1}} | {{rate}} | {{rate}} | {{use}} | {{max}} | - -^^/CONDITION: has_economy^^ - -## Level Design Framework - -[[LLM: Provide guidelines for level creation that developers can use to create level implementation stories]] - -### Level Types - -<> - -#### {{level_type_name}} - -**Purpose:** {{gameplay_purpose}} -**Duration:** {{target_time}} -**Key Elements:** {{required_mechanics}} -**Difficulty:** {{relative_difficulty}} - -**Structure Template:** - -- Introduction: {{intro_description}} -- Challenge: {{main_challenge}} -- Resolution: {{completion_requirement}} - -<> - -### Level Progression - -**World Structure:** {{linear|hub|open}} -**Total Levels:** {{number}} -**Unlock Pattern:** {{progression_method}} - -## Technical Specifications - -[[LLM: Define technical requirements that will guide architecture and implementation decisions. Review any existing technical preferences.]] - -### Performance Requirements - -**Frame Rate:** 60 FPS (minimum 30 FPS on low-end devices) -**Memory Usage:** <{{memory_limit}}MB -**Load Times:** <{{load_time}}s initial, <{{level_load}}s between levels -**Battery Usage:** Optimized for mobile devices - -### Platform Specific - -**Desktop:** - -- Resolution: {{min_resolution}} - {{max_resolution}} -- Input: Keyboard, Mouse, Gamepad -- Browser: Chrome 80+, Firefox 75+, Safari 13+ - -**Mobile:** - -- Resolution: {{mobile_min}} - {{mobile_max}} -- Input: Touch, Tilt (optional) -- OS: iOS 13+, Android 8+ - -### Asset Requirements - -[[LLM: Define asset specifications for the art and audio teams]] - -**Visual Assets:** - -- Art Style: {{style_description}} -- Color Palette: {{color_specification}} -- Animation: {{animation_requirements}} -- UI Resolution: {{ui_specs}} - -**Audio Assets:** - -- Music Style: {{music_genre}} -- Sound Effects: {{sfx_requirements}} -- Voice Acting: {{voice_needs}} - -## Technical Architecture Requirements - -[[LLM: Define high-level technical requirements that the game architecture must support]] - -### Engine Configuration - -**Phaser 3 Setup:** - -- TypeScript: Strict mode enabled -- Physics: {{physics_system}} (Arcade/Matter) -- Renderer: WebGL with Canvas fallback -- Scale Mode: {{scale_mode}} - -### Code Architecture - -**Required Systems:** - -- Scene Management -- State Management -- Asset Loading -- Save/Load System -- Input Management -- Audio System -- Performance Monitoring - -### Data Management - -**Save Data:** - -- Progress tracking -- Settings persistence -- Statistics collection -- {{additional_data}} - -## Development Phases - -[[LLM: Break down the development into phases that can be converted to epics]] - -### Phase 1: Core Systems ({{duration}}) - -**Epic: Foundation** - -- Engine setup and configuration -- Basic scene management -- Core input handling -- Asset loading pipeline - -**Epic: Core Mechanics** - -- {{primary_mechanic}} implementation -- Basic physics and collision -- Player controller - -### Phase 2: Gameplay Features ({{duration}}) - -**Epic: Game Systems** - -- {{mechanic_2}} implementation -- {{mechanic_3}} implementation -- Game state management - -**Epic: Content Creation** - -- Level loading system -- First playable levels -- Basic UI implementation - -### Phase 3: Polish & Optimization ({{duration}}) - -**Epic: Performance** - -- Optimization and profiling -- Mobile platform testing -- Memory management - -**Epic: User Experience** - -- Audio implementation -- Visual effects and polish -- Final UI/UX refinement - -## Success Metrics - -[[LLM: Define measurable goals for the game]] - -**Technical Metrics:** - -- Frame rate: {{fps_target}} -- Load time: {{load_target}} -- Crash rate: <{{crash_threshold}}% -- Memory usage: <{{memory_target}}MB - -**Gameplay Metrics:** - -- Tutorial completion: {{completion_rate}}% -- Average session: {{session_length}} minutes -- Level completion: {{level_completion}}% -- Player retention: D1 {{d1}}%, D7 {{d7}}% - -## Appendices - -### Change Log - -[[LLM: Track document versions and changes]] - -| Date | Version | Description | Author | -| :--- | :------ | :---------- | :----- | - -### References - -[[LLM: List any competitive analysis, inspiration, or research sources]] - -- {{reference_1}} -- {{reference_2}} -- {{reference_3}} -==================== END: .bmad-2d-phaser-game-dev/templates/game-design-doc-tmpl.md ==================== - -==================== START: .bmad-2d-phaser-game-dev/templates/level-design-doc-tmpl.md ==================== -# {{Game Title}} Level Design Document - -[[LLM: This template creates comprehensive level design documentation that guides both content creation and technical implementation. This document should provide enough detail for developers to create level loading systems and for designers to create specific levels. - -If available, review: Game Design Document (GDD), Game Architecture Document. This document should align with the game mechanics and technical systems defined in those documents.]] - -## Introduction - -[[LLM: Establish the purpose and scope of level design for this game]] - -This document defines the level design framework for {{Game Title}}, providing guidelines for creating engaging, balanced levels that support the core gameplay mechanics defined in the Game Design Document. - -This framework ensures consistency across all levels while providing flexibility for creative level design within established technical and design constraints. - -### Change Log - -[[LLM: Track document versions and changes]] - -| Date | Version | Description | Author | -| :--- | :------ | :---------- | :----- | - -## Level Design Philosophy - -[[LLM: Establish the overall approach to level design based on the game's core pillars and mechanics. Apply `tasks#advanced-elicitation` after presenting this section.]] - -### Design Principles - -[[LLM: Define 3-5 core principles that guide all level design decisions]] - -1. **{{principle_1}}** - {{description}} -2. **{{principle_2}}** - {{description}} -3. **{{principle_3}}** - {{description}} - -### Player Experience Goals - -[[LLM: Define what players should feel and learn in each level category]] - -**Tutorial Levels:** {{experience_description}} -**Standard Levels:** {{experience_description}} -**Challenge Levels:** {{experience_description}} -**Boss Levels:** {{experience_description}} - -### Level Flow Framework - -[[LLM: Define the standard structure for level progression]] - -**Introduction Phase:** {{duration}} - {{purpose}} -**Development Phase:** {{duration}} - {{purpose}} -**Climax Phase:** {{duration}} - {{purpose}} -**Resolution Phase:** {{duration}} - {{purpose}} - -## Level Categories - -[[LLM: Define different types of levels based on the GDD requirements. Each category should be specific enough for implementation.]] - -<> - -### {{category_name}} Levels - -**Purpose:** {{gameplay_purpose}} - -**Target Duration:** {{min_time}} - {{max_time}} minutes - -**Difficulty Range:** {{difficulty_scale}} - -**Key Mechanics Featured:** - -- {{mechanic_1}} - {{usage_description}} -- {{mechanic_2}} - {{usage_description}} - -**Player Objectives:** - -- Primary: {{primary_objective}} -- Secondary: {{secondary_objective}} -- Hidden: {{secret_objective}} - -**Success Criteria:** - -- {{completion_requirement_1}} -- {{completion_requirement_2}} - -**Technical Requirements:** - -- Maximum entities: {{entity_limit}} -- Performance target: {{fps_target}} FPS -- Memory budget: {{memory_limit}}MB -- Asset requirements: {{asset_needs}} - -<> - -## Level Progression System - -[[LLM: Define how players move through levels and how difficulty scales]] - -### World Structure - -[[LLM: Based on GDD requirements, define the overall level organization]] - -**Organization Type:** {{linear|hub_world|open_world}} - -**Total Level Count:** {{number}} - -**World Breakdown:** - -- World 1: {{level_count}} levels - {{theme}} - {{difficulty_range}} -- World 2: {{level_count}} levels - {{theme}} - {{difficulty_range}} -- World 3: {{level_count}} levels - {{theme}} - {{difficulty_range}} - -### Difficulty Progression - -[[LLM: Define how challenge increases across the game]] - -**Progression Curve:** - -````text -Difficulty - ^ ___/``` - | / - | / ___/``` - | / / - | / / - |/ / - +-----------> Level Number - Tutorial Early Mid Late -```` - -**Scaling Parameters:** - -- Enemy count: {{start_count}} → {{end_count}} -- Enemy difficulty: {{start_diff}} → {{end_diff}} -- Level complexity: {{start_complex}} → {{end_complex}} -- Time pressure: {{start_time}} → {{end_time}} - -### Unlock Requirements - -[[LLM: Define how players access new levels]] - -**Progression Gates:** - -- Linear progression: Complete previous level -- Star requirements: {{star_count}} stars to unlock -- Skill gates: Demonstrate {{skill_requirement}} -- Optional content: {{unlock_condition}} - -## Level Design Components - -[[LLM: Define the building blocks used to create levels]] - -### Environmental Elements - -[[LLM: Define all environmental components that can be used in levels]] - -**Terrain Types:** - -- {{terrain_1}}: {{properties_and_usage}} -- {{terrain_2}}: {{properties_and_usage}} - -**Interactive Objects:** - -- {{object_1}}: {{behavior_and_purpose}} -- {{object_2}}: {{behavior_and_purpose}} - -**Hazards and Obstacles:** - -- {{hazard_1}}: {{damage_and_behavior}} -- {{hazard_2}}: {{damage_and_behavior}} - -### Collectibles and Rewards - -[[LLM: Define all collectible items and their placement rules]] - -**Collectible Types:** - -- {{collectible_1}}: {{value_and_purpose}} -- {{collectible_2}}: {{value_and_purpose}} - -**Placement Guidelines:** - -- Mandatory collectibles: {{placement_rules}} -- Optional collectibles: {{placement_rules}} -- Secret collectibles: {{placement_rules}} - -**Reward Distribution:** - -- Easy to find: {{percentage}}% -- Moderate challenge: {{percentage}}% -- High skill required: {{percentage}}% - -### Enemy Placement Framework - -[[LLM: Define how enemies should be placed and balanced in levels]] - -**Enemy Categories:** - -- {{enemy_type_1}}: {{behavior_and_usage}} -- {{enemy_type_2}}: {{behavior_and_usage}} - -**Placement Principles:** - -- Introduction encounters: {{guideline}} -- Standard encounters: {{guideline}} -- Challenge encounters: {{guideline}} - -**Difficulty Scaling:** - -- Enemy count progression: {{scaling_rule}} -- Enemy type introduction: {{pacing_rule}} -- Encounter complexity: {{complexity_rule}} - -## Level Creation Guidelines - -[[LLM: Provide specific guidelines for creating individual levels]] - -### Level Layout Principles - -**Spatial Design:** - -- Grid size: {{grid_dimensions}} -- Minimum path width: {{width_units}} -- Maximum vertical distance: {{height_units}} -- Safe zones placement: {{safety_guidelines}} - -**Navigation Design:** - -- Clear path indication: {{visual_cues}} -- Landmark placement: {{landmark_rules}} -- Dead end avoidance: {{dead_end_policy}} -- Multiple path options: {{branching_rules}} - -### Pacing and Flow - -[[LLM: Define how to control the rhythm and pace of gameplay within levels]] - -**Action Sequences:** - -- High intensity duration: {{max_duration}} -- Rest period requirement: {{min_rest_time}} -- Intensity variation: {{pacing_pattern}} - -**Learning Sequences:** - -- New mechanic introduction: {{teaching_method}} -- Practice opportunity: {{practice_duration}} -- Skill application: {{application_context}} - -### Challenge Design - -[[LLM: Define how to create appropriate challenges for each level type]] - -**Challenge Types:** - -- Execution challenges: {{skill_requirements}} -- Puzzle challenges: {{complexity_guidelines}} -- Time challenges: {{time_pressure_rules}} -- Resource challenges: {{resource_management}} - -**Difficulty Calibration:** - -- Skill check frequency: {{frequency_guidelines}} -- Failure recovery: {{retry_mechanics}} -- Hint system integration: {{help_system}} - -## Technical Implementation - -[[LLM: Define technical requirements for level implementation]] - -### Level Data Structure - -[[LLM: Define how level data should be structured for implementation]] - -**Level File Format:** - -- Data format: {{json|yaml|custom}} -- File naming: `level_{{world}}_{{number}}.{{extension}}` -- Data organization: {{structure_description}} - -**Required Data Fields:** - -```json -{ - "levelId": "{{unique_identifier}}", - "worldId": "{{world_identifier}}", - "difficulty": {{difficulty_value}}, - "targetTime": {{completion_time_seconds}}, - "objectives": { - "primary": "{{primary_objective}}", - "secondary": ["{{secondary_objectives}}"], - "hidden": ["{{secret_objectives}}"] - }, - "layout": { - "width": {{grid_width}}, - "height": {{grid_height}}, - "tilemap": "{{tilemap_reference}}" - }, - "entities": [ - { - "type": "{{entity_type}}", - "position": {"x": {{x}}, "y": {{y}}}, - "properties": {{entity_properties}} - } - ] -} -``` - -### Asset Integration - -[[LLM: Define how level assets are organized and loaded]] - -**Tilemap Requirements:** - -- Tile size: {{tile_dimensions}}px -- Tileset organization: {{tileset_structure}} -- Layer organization: {{layer_system}} -- Collision data: {{collision_format}} - -**Audio Integration:** - -- Background music: {{music_requirements}} -- Ambient sounds: {{ambient_system}} -- Dynamic audio: {{dynamic_audio_rules}} - -### Performance Optimization - -[[LLM: Define performance requirements for level systems]] - -**Entity Limits:** - -- Maximum active entities: {{entity_limit}} -- Maximum particles: {{particle_limit}} -- Maximum audio sources: {{audio_limit}} - -**Memory Management:** - -- Texture memory budget: {{texture_memory}}MB -- Audio memory budget: {{audio_memory}}MB -- Level loading time: <{{load_time}}s - -**Culling and LOD:** - -- Off-screen culling: {{culling_distance}} -- Level-of-detail rules: {{lod_system}} -- Asset streaming: {{streaming_requirements}} - -## Level Testing Framework - -[[LLM: Define how levels should be tested and validated]] - -### Automated Testing - -**Performance Testing:** - -- Frame rate validation: Maintain {{fps_target}} FPS -- Memory usage monitoring: Stay under {{memory_limit}}MB -- Loading time verification: Complete in <{{load_time}}s - -**Gameplay Testing:** - -- Completion path validation: All objectives achievable -- Collectible accessibility: All items reachable -- Softlock prevention: No unwinnable states - -### Manual Testing Protocol - -**Playtesting Checklist:** - -- [ ] Level completes within target time range -- [ ] All mechanics function correctly -- [ ] Difficulty feels appropriate for level category -- [ ] Player guidance is clear and effective -- [ ] No exploits or sequence breaks (unless intended) - -**Player Experience Testing:** - -- [ ] Tutorial levels teach effectively -- [ ] Challenge feels fair and rewarding -- [ ] Flow and pacing maintain engagement -- [ ] Audio and visual feedback support gameplay - -### Balance Validation - -**Metrics Collection:** - -- Completion rate: Target {{completion_percentage}}% -- Average completion time: {{target_time}} ± {{variance}} -- Death count per level: <{{max_deaths}} -- Collectible discovery rate: {{discovery_percentage}}% - -**Iteration Guidelines:** - -- Adjustment criteria: {{criteria_for_changes}} -- Testing sample size: {{minimum_testers}} -- Validation period: {{testing_duration}} - -## Content Creation Pipeline - -[[LLM: Define the workflow for creating new levels]] - -### Design Phase - -**Concept Development:** - -1. Define level purpose and goals -2. Create rough layout sketch -3. Identify key mechanics and challenges -4. Estimate difficulty and duration - -**Documentation Requirements:** - -- Level design brief -- Layout diagrams -- Mechanic integration notes -- Asset requirement list - -### Implementation Phase - -**Technical Implementation:** - -1. Create level data file -2. Build tilemap and layout -3. Place entities and objects -4. Configure level logic and triggers -5. Integrate audio and visual effects - -**Quality Assurance:** - -1. Automated testing execution -2. Internal playtesting -3. Performance validation -4. Bug fixing and polish - -### Integration Phase - -**Game Integration:** - -1. Level progression integration -2. Save system compatibility -3. Analytics integration -4. Achievement system integration - -**Final Validation:** - -1. Full game context testing -2. Performance regression testing -3. Platform compatibility verification -4. Final approval and release - -## Success Metrics - -[[LLM: Define how to measure level design success]] - -**Player Engagement:** - -- Level completion rate: {{target_rate}}% -- Replay rate: {{replay_target}}% -- Time spent per level: {{engagement_time}} -- Player satisfaction scores: {{satisfaction_target}}/10 - -**Technical Performance:** - -- Frame rate consistency: {{fps_consistency}}% -- Loading time compliance: {{load_compliance}}% -- Memory usage efficiency: {{memory_efficiency}}% -- Crash rate: <{{crash_threshold}}% - -**Design Quality:** - -- Difficulty curve adherence: {{curve_accuracy}} -- Mechanic integration effectiveness: {{integration_score}} -- Player guidance clarity: {{guidance_score}} -- Content accessibility: {{accessibility_rate}}% -==================== END: .bmad-2d-phaser-game-dev/templates/level-design-doc-tmpl.md ==================== - -==================== START: .bmad-2d-phaser-game-dev/templates/game-brief-tmpl.md ==================== -# {{Game Title}} Game Brief - -[[LLM: This template creates a comprehensive game brief that serves as the foundation for all subsequent game development work. The brief should capture the essential vision, scope, and requirements needed to create a detailed Game Design Document. - -This brief is typically created early in the ideation process, often after brainstorming sessions, to crystallize the game concept before moving into detailed design.]] - -## Game Vision - -[[LLM: Establish the core vision and identity of the game. Present each subsection and gather user feedback before proceeding.]] - -### Core Concept - -[[LLM: 2-3 sentences that clearly capture what the game is and why it will be compelling to players]] - -### Elevator Pitch - -[[LLM: Single sentence that captures the essence of the game in a memorable way]] - -**"{{game_description_in_one_sentence}}"** - -### Vision Statement - -[[LLM: Inspirational statement about what the game will achieve for players and why it matters]] - -## Target Market - -[[LLM: Define the audience and market context. Apply `tasks#advanced-elicitation` after presenting this section.]] - -### Primary Audience - -**Demographics:** {{age_range}}, {{platform_preference}}, {{gaming_experience}} -**Psychographics:** {{interests}}, {{motivations}}, {{play_patterns}} -**Gaming Preferences:** {{preferred_genres}}, {{session_length}}, {{difficulty_preference}} - -### Secondary Audiences - -**Audience 2:** {{description}} -**Audience 3:** {{description}} - -### Market Context - -**Genre:** {{primary_genre}} / {{secondary_genre}} -**Platform Strategy:** {{platform_focus}} -**Competitive Positioning:** {{differentiation_statement}} - -## Game Fundamentals - -[[LLM: Define the core gameplay elements. Each subsection should be specific enough to guide detailed design work.]] - -### Core Gameplay Pillars - -[[LLM: 3-5 fundamental principles that guide all design decisions]] - -1. **{{pillar_1}}** - {{description_and_rationale}} -2. **{{pillar_2}}** - {{description_and_rationale}} -3. **{{pillar_3}}** - {{description_and_rationale}} - -### Primary Mechanics - -[[LLM: List the 3-5 most important gameplay mechanics that define the player experience]] - -**Core Mechanic 1: {{mechanic_name}}** - -- **Description:** {{how_it_works}} -- **Player Value:** {{why_its_fun}} -- **Implementation Scope:** {{complexity_estimate}} - -**Core Mechanic 2: {{mechanic_name}}** - -- **Description:** {{how_it_works}} -- **Player Value:** {{why_its_fun}} -- **Implementation Scope:** {{complexity_estimate}} - -### Player Experience Goals - -[[LLM: Define what emotions and experiences the game should create for players]] - -**Primary Experience:** {{main_emotional_goal}} -**Secondary Experiences:** {{supporting_emotional_goals}} -**Engagement Pattern:** {{how_player_engagement_evolves}} - -## Scope and Constraints - -[[LLM: Define the boundaries and limitations that will shape development. Apply `tasks#advanced-elicitation` to clarify any constraints.]] - -### Project Scope - -**Game Length:** {{estimated_content_hours}} -**Content Volume:** {{levels_areas_content_amount}} -**Feature Complexity:** {{simple|moderate|complex}} -**Scope Comparison:** "Similar to {{reference_game}} but with {{key_differences}}" - -### Technical Constraints - -**Platform Requirements:** - -- Primary: {{platform_1}} - {{requirements}} -- Secondary: {{platform_2}} - {{requirements}} - -**Technical Specifications:** - -- Engine: Phaser 3 + TypeScript -- Performance Target: {{fps_target}} FPS on {{target_device}} -- Memory Budget: <{{memory_limit}}MB -- Load Time Goal: <{{load_time_seconds}}s - -### Resource Constraints - -**Team Size:** {{team_composition}} -**Timeline:** {{development_duration}} -**Budget Considerations:** {{budget_constraints_or_targets}} -**Asset Requirements:** {{art_audio_content_needs}} - -### Business Constraints - -^^CONDITION: has_business_goals^^ - -**Monetization Model:** {{free|premium|freemium|subscription}} -**Revenue Goals:** {{revenue_targets_if_applicable}} -**Platform Requirements:** {{store_certification_needs}} -**Launch Timeline:** {{target_launch_window}} - -^^/CONDITION: has_business_goals^^ - -## Reference Framework - -[[LLM: Provide context through references and competitive analysis]] - -### Inspiration Games - -**Primary References:** - -1. **{{reference_game_1}}** - {{what_we_learn_from_it}} -2. **{{reference_game_2}}** - {{what_we_learn_from_it}} -3. **{{reference_game_3}}** - {{what_we_learn_from_it}} - -### Competitive Analysis - -**Direct Competitors:** - -- {{competitor_1}}: {{strengths_and_weaknesses}} -- {{competitor_2}}: {{strengths_and_weaknesses}} - -**Differentiation Strategy:** -{{how_we_differ_and_why_thats_valuable}} - -### Market Opportunity - -**Market Gap:** {{underserved_need_or_opportunity}} -**Timing Factors:** {{why_now_is_the_right_time}} -**Success Metrics:** {{how_well_measure_success}} - -## Content Framework - -[[LLM: Outline the content structure and progression without full design detail]] - -### Game Structure - -**Overall Flow:** {{linear|hub_world|open_world|procedural}} -**Progression Model:** {{how_players_advance}} -**Session Structure:** {{typical_play_session_flow}} - -### Content Categories - -**Core Content:** - -- {{content_type_1}}: {{quantity_and_description}} -- {{content_type_2}}: {{quantity_and_description}} - -**Optional Content:** - -- {{optional_content_type}}: {{quantity_and_description}} - -**Replay Elements:** - -- {{replayability_features}} - -### Difficulty and Accessibility - -**Difficulty Approach:** {{how_challenge_is_structured}} -**Accessibility Features:** {{planned_accessibility_support}} -**Skill Requirements:** {{what_skills_players_need}} - -## Art and Audio Direction - -[[LLM: Establish the aesthetic vision that will guide asset creation]] - -### Visual Style - -**Art Direction:** {{style_description}} -**Reference Materials:** {{visual_inspiration_sources}} -**Technical Approach:** {{2d_style_pixel_vector_etc}} -**Color Strategy:** {{color_palette_mood}} - -### Audio Direction - -**Music Style:** {{genre_and_mood}} -**Sound Design:** {{audio_personality}} -**Implementation Needs:** {{technical_audio_requirements}} - -### UI/UX Approach - -**Interface Style:** {{ui_aesthetic}} -**User Experience Goals:** {{ux_priorities}} -**Platform Adaptations:** {{cross_platform_considerations}} - -## Risk Assessment - -[[LLM: Identify potential challenges and mitigation strategies]] - -### Technical Risks - -| Risk | Probability | Impact | Mitigation Strategy | -| -------------------- | ----------- | ------ | ------------------- | ------ | --- | ----- | ----------------------- | -| {{technical_risk_1}} | {{high | med | low}} | {{high | med | low}} | {{mitigation_approach}} | -| {{technical_risk_2}} | {{high | med | low}} | {{high | med | low}} | {{mitigation_approach}} | - -### Design Risks - -| Risk | Probability | Impact | Mitigation Strategy | -| ----------------- | ----------- | ------ | ------------------- | ------ | --- | ----- | ----------------------- | -| {{design_risk_1}} | {{high | med | low}} | {{high | med | low}} | {{mitigation_approach}} | -| {{design_risk_2}} | {{high | med | low}} | {{high | med | low}} | {{mitigation_approach}} | - -### Market Risks - -| Risk | Probability | Impact | Mitigation Strategy | -| ----------------- | ----------- | ------ | ------------------- | ------ | --- | ----- | ----------------------- | -| {{market_risk_1}} | {{high | med | low}} | {{high | med | low}} | {{mitigation_approach}} | - -## Success Criteria - -[[LLM: Define measurable goals for the project]] - -### Player Experience Metrics - -**Engagement Goals:** - -- Tutorial completion rate: >{{percentage}}% -- Average session length: {{duration}} minutes -- Player retention: D1 {{d1}}%, D7 {{d7}}%, D30 {{d30}}% - -**Quality Benchmarks:** - -- Player satisfaction: >{{rating}}/10 -- Completion rate: >{{percentage}}% -- Technical performance: {{fps_target}} FPS consistent - -### Development Metrics - -**Technical Targets:** - -- Zero critical bugs at launch -- Performance targets met on all platforms -- Load times under {{seconds}}s - -**Process Goals:** - -- Development timeline adherence -- Feature scope completion -- Quality assurance standards - -^^CONDITION: has_business_goals^^ - -### Business Metrics - -**Commercial Goals:** - -- {{revenue_target}} in first {{time_period}} -- {{user_acquisition_target}} players in first {{time_period}} -- {{retention_target}} monthly active users - -^^/CONDITION: has_business_goals^^ - -## Next Steps - -[[LLM: Define immediate actions following the brief completion]] - -### Immediate Actions - -1. **Stakeholder Review** - {{review_process_and_timeline}} -2. **Concept Validation** - {{validation_approach}} -3. **Resource Planning** - {{team_and_resource_allocation}} - -### Development Roadmap - -**Phase 1: Pre-Production** ({{duration}}) - -- Detailed Game Design Document creation -- Technical architecture planning -- Art style exploration and pipeline setup - -**Phase 2: Prototype** ({{duration}}) - -- Core mechanic implementation -- Technical proof of concept -- Initial playtesting and iteration - -**Phase 3: Production** ({{duration}}) - -- Full feature development -- Content creation and integration -- Comprehensive testing and optimization - -### Documentation Pipeline - -**Required Documents:** - -1. Game Design Document (GDD) - {{target_completion}} -2. Technical Architecture Document - {{target_completion}} -3. Art Style Guide - {{target_completion}} -4. Production Plan - {{target_completion}} - -### Validation Plan - -**Concept Testing:** - -- {{validation_method_1}} - {{timeline}} -- {{validation_method_2}} - {{timeline}} - -**Prototype Testing:** - -- {{testing_approach}} - {{timeline}} -- {{feedback_collection_method}} - {{timeline}} - -## Appendices - -### Research Materials - -[[LLM: Include any supporting research, competitive analysis, or market data that informed the brief]] - -### Brainstorming Session Notes - -[[LLM: Reference any brainstorming sessions that led to this brief]] - -### Stakeholder Input - -[[LLM: Include key input from stakeholders that shaped the vision]] - -### Change Log - -[[LLM: Track document versions and changes]] - -| Date | Version | Description | Author | -| :--- | :------ | :---------- | :----- | -==================== END: .bmad-2d-phaser-game-dev/templates/game-brief-tmpl.md ==================== +==================== START: .bmad-2d-phaser-game-dev/templates/game-design-doc-tmpl.yaml ==================== +template: + id: game-design-doc-template-v2 + name: Game Design Document (GDD) + version: 2.0 + output: + format: markdown + filename: "docs/{{game_name}}-game-design-document.md" + title: "{{game_title}} Game Design Document (GDD)" + +workflow: + mode: interactive + +sections: + - id: initial-setup + instruction: | + This template creates a comprehensive Game Design Document that will serve as the foundation for all game development work. The GDD should be detailed enough that developers can create user stories and epics from it. Focus on gameplay systems, mechanics, and technical requirements that can be broken down into implementable features. + + If available, review any provided documents or ask if any are optionally available: Project Brief, Market Research, Competitive Analysis + + - id: executive-summary + title: Executive Summary + instruction: Create a compelling overview that captures the essence of the game. Present this section first and get user feedback before proceeding. + sections: + - id: core-concept + title: Core Concept + instruction: 2-3 sentences that clearly describe what the game is and why players will love it + - id: target-audience + title: Target Audience + instruction: Define the primary and secondary audience with demographics and gaming preferences + template: | + **Primary:** {{age_range}}, {{player_type}}, {{platform_preference}} + **Secondary:** {{secondary_audience}} + - id: platform-technical + title: Platform & Technical Requirements + instruction: Based on the technical preferences or user input, define the target platforms + template: | + **Primary Platform:** {{platform}} + **Engine:** Phaser 3 + TypeScript + **Performance Target:** 60 FPS on {{minimum_device}} + **Screen Support:** {{resolution_range}} + - id: unique-selling-points + title: Unique Selling Points + instruction: List 3-5 key features that differentiate this game from competitors + type: numbered-list + template: "{{usp}}" + + - id: core-gameplay + title: Core Gameplay + instruction: This section defines the fundamental game mechanics. After presenting each subsection, apply `tasks#advanced-elicitation` protocol to ensure completeness. + sections: + - id: game-pillars + title: Game Pillars + instruction: Define 3-5 core pillars that guide all design decisions. These should be specific and actionable. + type: numbered-list + template: | + **{{pillar_name}}** - {{description}} + - id: core-gameplay-loop + title: Core Gameplay Loop + instruction: Define the 30-60 second loop that players will repeat. Be specific about timing and player actions. + template: | + **Primary Loop ({{duration}} seconds):** + + 1. {{action_1}} ({{time_1}}s) + 2. {{action_2}} ({{time_2}}s) + 3. {{action_3}} ({{time_3}}s) + 4. {{reward_feedback}} ({{time_4}}s) + - id: win-loss-conditions + title: Win/Loss Conditions + instruction: Clearly define success and failure states + template: | + **Victory Conditions:** + + - {{win_condition_1}} + - {{win_condition_2}} + + **Failure States:** + + - {{loss_condition_1}} + - {{loss_condition_2}} + + - id: game-mechanics + title: Game Mechanics + instruction: Detail each major mechanic that will need to be implemented. Each mechanic should be specific enough for developers to create implementation stories. + sections: + - id: primary-mechanics + title: Primary Mechanics + repeatable: true + sections: + - id: mechanic + title: "{{mechanic_name}}" + template: | + **Description:** {{detailed_description}} + + **Player Input:** {{input_method}} + + **System Response:** {{game_response}} + + **Implementation Notes:** + + - {{tech_requirement_1}} + - {{tech_requirement_2}} + - {{performance_consideration}} + + **Dependencies:** {{other_mechanics_needed}} + - id: controls + title: Controls + instruction: Define all input methods for different platforms + type: table + template: | + | Action | Desktop | Mobile | Gamepad | + | ------ | ------- | ------ | ------- | + | {{action}} | {{key}} | {{gesture}} | {{button}} | + + - id: progression-balance + title: Progression & Balance + instruction: Define how players advance and how difficulty scales. This section should provide clear parameters for implementation. + sections: + - id: player-progression + title: Player Progression + template: | + **Progression Type:** {{linear|branching|metroidvania}} + + **Key Milestones:** + + 1. **{{milestone_1}}** - {{unlock_description}} + 2. **{{milestone_2}}** - {{unlock_description}} + 3. **{{milestone_3}}** - {{unlock_description}} + - id: difficulty-curve + title: Difficulty Curve + instruction: Provide specific parameters for balancing + template: | + **Tutorial Phase:** {{duration}} - {{difficulty_description}} + **Early Game:** {{duration}} - {{difficulty_description}} + **Mid Game:** {{duration}} - {{difficulty_description}} + **Late Game:** {{duration}} - {{difficulty_description}} + - id: economy-resources + title: Economy & Resources + condition: has_economy + instruction: Define any in-game currencies, resources, or collectibles + type: table + template: | + | Resource | Earn Rate | Spend Rate | Purpose | Cap | + | -------- | --------- | ---------- | ------- | --- | + | {{resource}} | {{rate}} | {{rate}} | {{use}} | {{max}} | + + - id: level-design-framework + title: Level Design Framework + instruction: Provide guidelines for level creation that developers can use to create level implementation stories + sections: + - id: level-types + title: Level Types + repeatable: true + sections: + - id: level-type + title: "{{level_type_name}}" + template: | + **Purpose:** {{gameplay_purpose}} + **Duration:** {{target_time}} + **Key Elements:** {{required_mechanics}} + **Difficulty:** {{relative_difficulty}} + + **Structure Template:** + + - Introduction: {{intro_description}} + - Challenge: {{main_challenge}} + - Resolution: {{completion_requirement}} + - id: level-progression + title: Level Progression + template: | + **World Structure:** {{linear|hub|open}} + **Total Levels:** {{number}} + **Unlock Pattern:** {{progression_method}} + + - id: technical-specifications + title: Technical Specifications + instruction: Define technical requirements that will guide architecture and implementation decisions. Review any existing technical preferences. + sections: + - id: performance-requirements + title: Performance Requirements + template: | + **Frame Rate:** 60 FPS (minimum 30 FPS on low-end devices) + **Memory Usage:** <{{memory_limit}}MB + **Load Times:** <{{load_time}}s initial, <{{level_load}}s between levels + **Battery Usage:** Optimized for mobile devices + - id: platform-specific + title: Platform Specific + template: | + **Desktop:** + + - Resolution: {{min_resolution}} - {{max_resolution}} + - Input: Keyboard, Mouse, Gamepad + - Browser: Chrome 80+, Firefox 75+, Safari 13+ + + **Mobile:** + + - Resolution: {{mobile_min}} - {{mobile_max}} + - Input: Touch, Tilt (optional) + - OS: iOS 13+, Android 8+ + - id: asset-requirements + title: Asset Requirements + instruction: Define asset specifications for the art and audio teams + template: | + **Visual Assets:** + + - Art Style: {{style_description}} + - Color Palette: {{color_specification}} + - Animation: {{animation_requirements}} + - UI Resolution: {{ui_specs}} + + **Audio Assets:** + + - Music Style: {{music_genre}} + - Sound Effects: {{sfx_requirements}} + - Voice Acting: {{voice_needs}} + + - id: technical-architecture-requirements + title: Technical Architecture Requirements + instruction: Define high-level technical requirements that the game architecture must support + sections: + - id: engine-configuration + title: Engine Configuration + template: | + **Phaser 3 Setup:** + + - TypeScript: Strict mode enabled + - Physics: {{physics_system}} (Arcade/Matter) + - Renderer: WebGL with Canvas fallback + - Scale Mode: {{scale_mode}} + - id: code-architecture + title: Code Architecture + template: | + **Required Systems:** + + - Scene Management + - State Management + - Asset Loading + - Save/Load System + - Input Management + - Audio System + - Performance Monitoring + - id: data-management + title: Data Management + template: | + **Save Data:** + + - Progress tracking + - Settings persistence + - Statistics collection + - {{additional_data}} + + - id: development-phases + title: Development Phases + instruction: Break down the development into phases that can be converted to epics + sections: + - id: phase-1-core-systems + title: "Phase 1: Core Systems ({{duration}})" + sections: + - id: foundation-epic + title: "Epic: Foundation" + type: bullet-list + template: | + - Engine setup and configuration + - Basic scene management + - Core input handling + - Asset loading pipeline + - id: core-mechanics-epic + title: "Epic: Core Mechanics" + type: bullet-list + template: | + - {{primary_mechanic}} implementation + - Basic physics and collision + - Player controller + - id: phase-2-gameplay-features + title: "Phase 2: Gameplay Features ({{duration}})" + sections: + - id: game-systems-epic + title: "Epic: Game Systems" + type: bullet-list + template: | + - {{mechanic_2}} implementation + - {{mechanic_3}} implementation + - Game state management + - id: content-creation-epic + title: "Epic: Content Creation" + type: bullet-list + template: | + - Level loading system + - First playable levels + - Basic UI implementation + - id: phase-3-polish-optimization + title: "Phase 3: Polish & Optimization ({{duration}})" + sections: + - id: performance-epic + title: "Epic: Performance" + type: bullet-list + template: | + - Optimization and profiling + - Mobile platform testing + - Memory management + - id: user-experience-epic + title: "Epic: User Experience" + type: bullet-list + template: | + - Audio implementation + - Visual effects and polish + - Final UI/UX refinement + + - id: success-metrics + title: Success Metrics + instruction: Define measurable goals for the game + sections: + - id: technical-metrics + title: Technical Metrics + type: bullet-list + template: | + - Frame rate: {{fps_target}} + - Load time: {{load_target}} + - Crash rate: <{{crash_threshold}}% + - Memory usage: <{{memory_target}}MB + - id: gameplay-metrics + title: Gameplay Metrics + type: bullet-list + template: | + - Tutorial completion: {{completion_rate}}% + - Average session: {{session_length}} minutes + - Level completion: {{level_completion}}% + - Player retention: D1 {{d1}}%, D7 {{d7}}% + + - id: appendices + title: Appendices + sections: + - id: change-log + title: Change Log + instruction: Track document versions and changes + type: table + template: | + | Date | Version | Description | Author | + | :--- | :------ | :---------- | :----- | + - id: references + title: References + instruction: List any competitive analysis, inspiration, or research sources + type: bullet-list + template: "{{reference}}" +==================== END: .bmad-2d-phaser-game-dev/templates/game-design-doc-tmpl.yaml ==================== + +==================== START: .bmad-2d-phaser-game-dev/templates/level-design-doc-tmpl.yaml ==================== +template: + id: level-design-doc-template-v2 + name: Level Design Document + version: 2.0 + output: + format: markdown + filename: "docs/{{game_name}}-level-design-document.md" + title: "{{game_title}} Level Design Document" + +workflow: + mode: interactive + +sections: + - id: initial-setup + instruction: | + This template creates comprehensive level design documentation that guides both content creation and technical implementation. This document should provide enough detail for developers to create level loading systems and for designers to create specific levels. + + If available, review: Game Design Document (GDD), Game Architecture Document. This document should align with the game mechanics and technical systems defined in those documents. + + - id: introduction + title: Introduction + instruction: Establish the purpose and scope of level design for this game + content: | + This document defines the level design framework for {{game_title}}, providing guidelines for creating engaging, balanced levels that support the core gameplay mechanics defined in the Game Design Document. + + This framework ensures consistency across all levels while providing flexibility for creative level design within established technical and design constraints. + sections: + - id: change-log + title: Change Log + instruction: Track document versions and changes + type: table + template: | + | Date | Version | Description | Author | + | :--- | :------ | :---------- | :----- | + + - id: level-design-philosophy + title: Level Design Philosophy + instruction: Establish the overall approach to level design based on the game's core pillars and mechanics. Apply `tasks#advanced-elicitation` after presenting this section. + sections: + - id: design-principles + title: Design Principles + instruction: Define 3-5 core principles that guide all level design decisions + type: numbered-list + template: | + **{{principle_name}}** - {{description}} + - id: player-experience-goals + title: Player Experience Goals + instruction: Define what players should feel and learn in each level category + template: | + **Tutorial Levels:** {{experience_description}} + **Standard Levels:** {{experience_description}} + **Challenge Levels:** {{experience_description}} + **Boss Levels:** {{experience_description}} + - id: level-flow-framework + title: Level Flow Framework + instruction: Define the standard structure for level progression + template: | + **Introduction Phase:** {{duration}} - {{purpose}} + **Development Phase:** {{duration}} - {{purpose}} + **Climax Phase:** {{duration}} - {{purpose}} + **Resolution Phase:** {{duration}} - {{purpose}} + + - id: level-categories + title: Level Categories + instruction: Define different types of levels based on the GDD requirements. Each category should be specific enough for implementation. + repeatable: true + sections: + - id: level-category + title: "{{category_name}} Levels" + template: | + **Purpose:** {{gameplay_purpose}} + + **Target Duration:** {{min_time}} - {{max_time}} minutes + + **Difficulty Range:** {{difficulty_scale}} + + **Key Mechanics Featured:** + + - {{mechanic_1}} - {{usage_description}} + - {{mechanic_2}} - {{usage_description}} + + **Player Objectives:** + + - Primary: {{primary_objective}} + - Secondary: {{secondary_objective}} + - Hidden: {{secret_objective}} + + **Success Criteria:** + + - {{completion_requirement_1}} + - {{completion_requirement_2}} + + **Technical Requirements:** + + - Maximum entities: {{entity_limit}} + - Performance target: {{fps_target}} FPS + - Memory budget: {{memory_limit}}MB + - Asset requirements: {{asset_needs}} + + - id: level-progression-system + title: Level Progression System + instruction: Define how players move through levels and how difficulty scales + sections: + - id: world-structure + title: World Structure + instruction: Based on GDD requirements, define the overall level organization + template: | + **Organization Type:** {{linear|hub_world|open_world}} + + **Total Level Count:** {{number}} + + **World Breakdown:** + + - World 1: {{level_count}} levels - {{theme}} - {{difficulty_range}} + - World 2: {{level_count}} levels - {{theme}} - {{difficulty_range}} + - World 3: {{level_count}} levels - {{theme}} - {{difficulty_range}} + - id: difficulty-progression + title: Difficulty Progression + instruction: Define how challenge increases across the game + sections: + - id: progression-curve + title: Progression Curve + type: code + language: text + template: | + Difficulty + ^ ___/``` + | / + | / ___/``` + | / / + | / / + |/ / + +-----------> Level Number + Tutorial Early Mid Late + - id: scaling-parameters + title: Scaling Parameters + type: bullet-list + template: | + - Enemy count: {{start_count}} → {{end_count}} + - Enemy difficulty: {{start_diff}} → {{end_diff}} + - Level complexity: {{start_complex}} → {{end_complex}} + - Time pressure: {{start_time}} → {{end_time}} + - id: unlock-requirements + title: Unlock Requirements + instruction: Define how players access new levels + template: | + **Progression Gates:** + + - Linear progression: Complete previous level + - Star requirements: {{star_count}} stars to unlock + - Skill gates: Demonstrate {{skill_requirement}} + - Optional content: {{unlock_condition}} + + - id: level-design-components + title: Level Design Components + instruction: Define the building blocks used to create levels + sections: + - id: environmental-elements + title: Environmental Elements + instruction: Define all environmental components that can be used in levels + template: | + **Terrain Types:** + + - {{terrain_1}}: {{properties_and_usage}} + - {{terrain_2}}: {{properties_and_usage}} + + **Interactive Objects:** + + - {{object_1}}: {{behavior_and_purpose}} + - {{object_2}}: {{behavior_and_purpose}} + + **Hazards and Obstacles:** + + - {{hazard_1}}: {{damage_and_behavior}} + - {{hazard_2}}: {{damage_and_behavior}} + - id: collectibles-rewards + title: Collectibles and Rewards + instruction: Define all collectible items and their placement rules + template: | + **Collectible Types:** + + - {{collectible_1}}: {{value_and_purpose}} + - {{collectible_2}}: {{value_and_purpose}} + + **Placement Guidelines:** + + - Mandatory collectibles: {{placement_rules}} + - Optional collectibles: {{placement_rules}} + - Secret collectibles: {{placement_rules}} + + **Reward Distribution:** + + - Easy to find: {{percentage}}% + - Moderate challenge: {{percentage}}% + - High skill required: {{percentage}}% + - id: enemy-placement-framework + title: Enemy Placement Framework + instruction: Define how enemies should be placed and balanced in levels + template: | + **Enemy Categories:** + + - {{enemy_type_1}}: {{behavior_and_usage}} + - {{enemy_type_2}}: {{behavior_and_usage}} + + **Placement Principles:** + + - Introduction encounters: {{guideline}} + - Standard encounters: {{guideline}} + - Challenge encounters: {{guideline}} + + **Difficulty Scaling:** + + - Enemy count progression: {{scaling_rule}} + - Enemy type introduction: {{pacing_rule}} + - Encounter complexity: {{complexity_rule}} + + - id: level-creation-guidelines + title: Level Creation Guidelines + instruction: Provide specific guidelines for creating individual levels + sections: + - id: level-layout-principles + title: Level Layout Principles + template: | + **Spatial Design:** + + - Grid size: {{grid_dimensions}} + - Minimum path width: {{width_units}} + - Maximum vertical distance: {{height_units}} + - Safe zones placement: {{safety_guidelines}} + + **Navigation Design:** + + - Clear path indication: {{visual_cues}} + - Landmark placement: {{landmark_rules}} + - Dead end avoidance: {{dead_end_policy}} + - Multiple path options: {{branching_rules}} + - id: pacing-and-flow + title: Pacing and Flow + instruction: Define how to control the rhythm and pace of gameplay within levels + template: | + **Action Sequences:** + + - High intensity duration: {{max_duration}} + - Rest period requirement: {{min_rest_time}} + - Intensity variation: {{pacing_pattern}} + + **Learning Sequences:** + + - New mechanic introduction: {{teaching_method}} + - Practice opportunity: {{practice_duration}} + - Skill application: {{application_context}} + - id: challenge-design + title: Challenge Design + instruction: Define how to create appropriate challenges for each level type + template: | + **Challenge Types:** + + - Execution challenges: {{skill_requirements}} + - Puzzle challenges: {{complexity_guidelines}} + - Time challenges: {{time_pressure_rules}} + - Resource challenges: {{resource_management}} + + **Difficulty Calibration:** + + - Skill check frequency: {{frequency_guidelines}} + - Failure recovery: {{retry_mechanics}} + - Hint system integration: {{help_system}} + + - id: technical-implementation + title: Technical Implementation + instruction: Define technical requirements for level implementation + sections: + - id: level-data-structure + title: Level Data Structure + instruction: Define how level data should be structured for implementation + template: | + **Level File Format:** + + - Data format: {{json|yaml|custom}} + - File naming: `level_{{world}}_{{number}}.{{extension}}` + - Data organization: {{structure_description}} + sections: + - id: required-data-fields + title: Required Data Fields + type: code + language: json + template: | + { + "levelId": "{{unique_identifier}}", + "worldId": "{{world_identifier}}", + "difficulty": {{difficulty_value}}, + "targetTime": {{completion_time_seconds}}, + "objectives": { + "primary": "{{primary_objective}}", + "secondary": ["{{secondary_objectives}}"], + "hidden": ["{{secret_objectives}}"] + }, + "layout": { + "width": {{grid_width}}, + "height": {{grid_height}}, + "tilemap": "{{tilemap_reference}}" + }, + "entities": [ + { + "type": "{{entity_type}}", + "position": {"x": {{x}}, "y": {{y}}}, + "properties": {{entity_properties}} + } + ] + } + - id: asset-integration + title: Asset Integration + instruction: Define how level assets are organized and loaded + template: | + **Tilemap Requirements:** + + - Tile size: {{tile_dimensions}}px + - Tileset organization: {{tileset_structure}} + - Layer organization: {{layer_system}} + - Collision data: {{collision_format}} + + **Audio Integration:** + + - Background music: {{music_requirements}} + - Ambient sounds: {{ambient_system}} + - Dynamic audio: {{dynamic_audio_rules}} + - id: performance-optimization + title: Performance Optimization + instruction: Define performance requirements for level systems + template: | + **Entity Limits:** + + - Maximum active entities: {{entity_limit}} + - Maximum particles: {{particle_limit}} + - Maximum audio sources: {{audio_limit}} + + **Memory Management:** + + - Texture memory budget: {{texture_memory}}MB + - Audio memory budget: {{audio_memory}}MB + - Level loading time: <{{load_time}}s + + **Culling and LOD:** + + - Off-screen culling: {{culling_distance}} + - Level-of-detail rules: {{lod_system}} + - Asset streaming: {{streaming_requirements}} + + - id: level-testing-framework + title: Level Testing Framework + instruction: Define how levels should be tested and validated + sections: + - id: automated-testing + title: Automated Testing + template: | + **Performance Testing:** + + - Frame rate validation: Maintain {{fps_target}} FPS + - Memory usage monitoring: Stay under {{memory_limit}}MB + - Loading time verification: Complete in <{{load_time}}s + + **Gameplay Testing:** + + - Completion path validation: All objectives achievable + - Collectible accessibility: All items reachable + - Softlock prevention: No unwinnable states + - id: manual-testing-protocol + title: Manual Testing Protocol + sections: + - id: playtesting-checklist + title: Playtesting Checklist + type: checklist + items: + - "Level completes within target time range" + - "All mechanics function correctly" + - "Difficulty feels appropriate for level category" + - "Player guidance is clear and effective" + - "No exploits or sequence breaks (unless intended)" + - id: player-experience-testing + title: Player Experience Testing + type: checklist + items: + - "Tutorial levels teach effectively" + - "Challenge feels fair and rewarding" + - "Flow and pacing maintain engagement" + - "Audio and visual feedback support gameplay" + - id: balance-validation + title: Balance Validation + template: | + **Metrics Collection:** + + - Completion rate: Target {{completion_percentage}}% + - Average completion time: {{target_time}} ± {{variance}} + - Death count per level: <{{max_deaths}} + - Collectible discovery rate: {{discovery_percentage}}% + + **Iteration Guidelines:** + + - Adjustment criteria: {{criteria_for_changes}} + - Testing sample size: {{minimum_testers}} + - Validation period: {{testing_duration}} + + - id: content-creation-pipeline + title: Content Creation Pipeline + instruction: Define the workflow for creating new levels + sections: + - id: design-phase + title: Design Phase + template: | + **Concept Development:** + + 1. Define level purpose and goals + 2. Create rough layout sketch + 3. Identify key mechanics and challenges + 4. Estimate difficulty and duration + + **Documentation Requirements:** + + - Level design brief + - Layout diagrams + - Mechanic integration notes + - Asset requirement list + - id: implementation-phase + title: Implementation Phase + template: | + **Technical Implementation:** + + 1. Create level data file + 2. Build tilemap and layout + 3. Place entities and objects + 4. Configure level logic and triggers + 5. Integrate audio and visual effects + + **Quality Assurance:** + + 1. Automated testing execution + 2. Internal playtesting + 3. Performance validation + 4. Bug fixing and polish + - id: integration-phase + title: Integration Phase + template: | + **Game Integration:** + + 1. Level progression integration + 2. Save system compatibility + 3. Analytics integration + 4. Achievement system integration + + **Final Validation:** + + 1. Full game context testing + 2. Performance regression testing + 3. Platform compatibility verification + 4. Final approval and release + + - id: success-metrics + title: Success Metrics + instruction: Define how to measure level design success + sections: + - id: player-engagement + title: Player Engagement + type: bullet-list + template: | + - Level completion rate: {{target_rate}}% + - Replay rate: {{replay_target}}% + - Time spent per level: {{engagement_time}} + - Player satisfaction scores: {{satisfaction_target}}/10 + - id: technical-performance + title: Technical Performance + type: bullet-list + template: | + - Frame rate consistency: {{fps_consistency}}% + - Loading time compliance: {{load_compliance}}% + - Memory usage efficiency: {{memory_efficiency}}% + - Crash rate: <{{crash_threshold}}% + - id: design-quality + title: Design Quality + type: bullet-list + template: | + - Difficulty curve adherence: {{curve_accuracy}} + - Mechanic integration effectiveness: {{integration_score}} + - Player guidance clarity: {{guidance_score}} + - Content accessibility: {{accessibility_rate}}% +==================== END: .bmad-2d-phaser-game-dev/templates/level-design-doc-tmpl.yaml ==================== + +==================== START: .bmad-2d-phaser-game-dev/templates/game-brief-tmpl.yaml ==================== +template: + id: game-brief-template-v2 + name: Game Brief + version: 2.0 + output: + format: markdown + filename: "docs/{{game_name}}-game-brief.md" + title: "{{game_title}} Game Brief" + +workflow: + mode: interactive + +sections: + - id: initial-setup + instruction: | + This template creates a comprehensive game brief that serves as the foundation for all subsequent game development work. The brief should capture the essential vision, scope, and requirements needed to create a detailed Game Design Document. + + This brief is typically created early in the ideation process, often after brainstorming sessions, to crystallize the game concept before moving into detailed design. + + - id: game-vision + title: Game Vision + instruction: Establish the core vision and identity of the game. Present each subsection and gather user feedback before proceeding. + sections: + - id: core-concept + title: Core Concept + instruction: 2-3 sentences that clearly capture what the game is and why it will be compelling to players + - id: elevator-pitch + title: Elevator Pitch + instruction: Single sentence that captures the essence of the game in a memorable way + template: | + **"{{game_description_in_one_sentence}}"** + - id: vision-statement + title: Vision Statement + instruction: Inspirational statement about what the game will achieve for players and why it matters + + - id: target-market + title: Target Market + instruction: Define the audience and market context. Apply `tasks#advanced-elicitation` after presenting this section. + sections: + - id: primary-audience + title: Primary Audience + template: | + **Demographics:** {{age_range}}, {{platform_preference}}, {{gaming_experience}} + **Psychographics:** {{interests}}, {{motivations}}, {{play_patterns}} + **Gaming Preferences:** {{preferred_genres}}, {{session_length}}, {{difficulty_preference}} + - id: secondary-audiences + title: Secondary Audiences + template: | + **Audience 2:** {{description}} + **Audience 3:** {{description}} + - id: market-context + title: Market Context + template: | + **Genre:** {{primary_genre}} / {{secondary_genre}} + **Platform Strategy:** {{platform_focus}} + **Competitive Positioning:** {{differentiation_statement}} + + - id: game-fundamentals + title: Game Fundamentals + instruction: Define the core gameplay elements. Each subsection should be specific enough to guide detailed design work. + sections: + - id: core-gameplay-pillars + title: Core Gameplay Pillars + instruction: 3-5 fundamental principles that guide all design decisions + type: numbered-list + template: | + **{{pillar_name}}** - {{description_and_rationale}} + - id: primary-mechanics + title: Primary Mechanics + instruction: List the 3-5 most important gameplay mechanics that define the player experience + repeatable: true + template: | + **Core Mechanic: {{mechanic_name}}** + + - **Description:** {{how_it_works}} + - **Player Value:** {{why_its_fun}} + - **Implementation Scope:** {{complexity_estimate}} + - id: player-experience-goals + title: Player Experience Goals + instruction: Define what emotions and experiences the game should create for players + template: | + **Primary Experience:** {{main_emotional_goal}} + **Secondary Experiences:** {{supporting_emotional_goals}} + **Engagement Pattern:** {{how_player_engagement_evolves}} + + - id: scope-constraints + title: Scope and Constraints + instruction: Define the boundaries and limitations that will shape development. Apply `tasks#advanced-elicitation` to clarify any constraints. + sections: + - id: project-scope + title: Project Scope + template: | + **Game Length:** {{estimated_content_hours}} + **Content Volume:** {{levels_areas_content_amount}} + **Feature Complexity:** {{simple|moderate|complex}} + **Scope Comparison:** "Similar to {{reference_game}} but with {{key_differences}}" + - id: technical-constraints + title: Technical Constraints + template: | + **Platform Requirements:** + + - Primary: {{platform_1}} - {{requirements}} + - Secondary: {{platform_2}} - {{requirements}} + + **Technical Specifications:** + + - Engine: Phaser 3 + TypeScript + - Performance Target: {{fps_target}} FPS on {{target_device}} + - Memory Budget: <{{memory_limit}}MB + - Load Time Goal: <{{load_time_seconds}}s + - id: resource-constraints + title: Resource Constraints + template: | + **Team Size:** {{team_composition}} + **Timeline:** {{development_duration}} + **Budget Considerations:** {{budget_constraints_or_targets}} + **Asset Requirements:** {{art_audio_content_needs}} + - id: business-constraints + title: Business Constraints + condition: has_business_goals + template: | + **Monetization Model:** {{free|premium|freemium|subscription}} + **Revenue Goals:** {{revenue_targets_if_applicable}} + **Platform Requirements:** {{store_certification_needs}} + **Launch Timeline:** {{target_launch_window}} + + - id: reference-framework + title: Reference Framework + instruction: Provide context through references and competitive analysis + sections: + - id: inspiration-games + title: Inspiration Games + sections: + - id: primary-references + title: Primary References + type: numbered-list + repeatable: true + template: | + **{{reference_game}}** - {{what_we_learn_from_it}} + - id: competitive-analysis + title: Competitive Analysis + template: | + **Direct Competitors:** + + - {{competitor_1}}: {{strengths_and_weaknesses}} + - {{competitor_2}}: {{strengths_and_weaknesses}} + + **Differentiation Strategy:** + {{how_we_differ_and_why_thats_valuable}} + - id: market-opportunity + title: Market Opportunity + template: | + **Market Gap:** {{underserved_need_or_opportunity}} + **Timing Factors:** {{why_now_is_the_right_time}} + **Success Metrics:** {{how_well_measure_success}} + + - id: content-framework + title: Content Framework + instruction: Outline the content structure and progression without full design detail + sections: + - id: game-structure + title: Game Structure + template: | + **Overall Flow:** {{linear|hub_world|open_world|procedural}} + **Progression Model:** {{how_players_advance}} + **Session Structure:** {{typical_play_session_flow}} + - id: content-categories + title: Content Categories + template: | + **Core Content:** + + - {{content_type_1}}: {{quantity_and_description}} + - {{content_type_2}}: {{quantity_and_description}} + + **Optional Content:** + + - {{optional_content_type}}: {{quantity_and_description}} + + **Replay Elements:** + + - {{replayability_features}} + - id: difficulty-accessibility + title: Difficulty and Accessibility + template: | + **Difficulty Approach:** {{how_challenge_is_structured}} + **Accessibility Features:** {{planned_accessibility_support}} + **Skill Requirements:** {{what_skills_players_need}} + + - id: art-audio-direction + title: Art and Audio Direction + instruction: Establish the aesthetic vision that will guide asset creation + sections: + - id: visual-style + title: Visual Style + template: | + **Art Direction:** {{style_description}} + **Reference Materials:** {{visual_inspiration_sources}} + **Technical Approach:** {{2d_style_pixel_vector_etc}} + **Color Strategy:** {{color_palette_mood}} + - id: audio-direction + title: Audio Direction + template: | + **Music Style:** {{genre_and_mood}} + **Sound Design:** {{audio_personality}} + **Implementation Needs:** {{technical_audio_requirements}} + - id: ui-ux-approach + title: UI/UX Approach + template: | + **Interface Style:** {{ui_aesthetic}} + **User Experience Goals:** {{ux_priorities}} + **Platform Adaptations:** {{cross_platform_considerations}} + + - id: risk-assessment + title: Risk Assessment + instruction: Identify potential challenges and mitigation strategies + sections: + - id: technical-risks + title: Technical Risks + type: table + template: | + | Risk | Probability | Impact | Mitigation Strategy | + | ---- | ----------- | ------ | ------------------- | + | {{technical_risk}} | {{high|med|low}} | {{high|med|low}} | {{mitigation_approach}} | + - id: design-risks + title: Design Risks + type: table + template: | + | Risk | Probability | Impact | Mitigation Strategy | + | ---- | ----------- | ------ | ------------------- | + | {{design_risk}} | {{high|med|low}} | {{high|med|low}} | {{mitigation_approach}} | + - id: market-risks + title: Market Risks + type: table + template: | + | Risk | Probability | Impact | Mitigation Strategy | + | ---- | ----------- | ------ | ------------------- | + | {{market_risk}} | {{high|med|low}} | {{high|med|low}} | {{mitigation_approach}} | + + - id: success-criteria + title: Success Criteria + instruction: Define measurable goals for the project + sections: + - id: player-experience-metrics + title: Player Experience Metrics + template: | + **Engagement Goals:** + + - Tutorial completion rate: >{{percentage}}% + - Average session length: {{duration}} minutes + - Player retention: D1 {{d1}}%, D7 {{d7}}%, D30 {{d30}}% + + **Quality Benchmarks:** + + - Player satisfaction: >{{rating}}/10 + - Completion rate: >{{percentage}}% + - Technical performance: {{fps_target}} FPS consistent + - id: development-metrics + title: Development Metrics + template: | + **Technical Targets:** + + - Zero critical bugs at launch + - Performance targets met on all platforms + - Load times under {{seconds}}s + + **Process Goals:** + + - Development timeline adherence + - Feature scope completion + - Quality assurance standards + - id: business-metrics + title: Business Metrics + condition: has_business_goals + template: | + **Commercial Goals:** + + - {{revenue_target}} in first {{time_period}} + - {{user_acquisition_target}} players in first {{time_period}} + - {{retention_target}} monthly active users + + - id: next-steps + title: Next Steps + instruction: Define immediate actions following the brief completion + sections: + - id: immediate-actions + title: Immediate Actions + type: numbered-list + template: | + **{{action_item}}** - {{details_and_timeline}} + - id: development-roadmap + title: Development Roadmap + sections: + - id: phase-1-preproduction + title: "Phase 1: Pre-Production ({{duration}})" + type: bullet-list + template: | + - Detailed Game Design Document creation + - Technical architecture planning + - Art style exploration and pipeline setup + - id: phase-2-prototype + title: "Phase 2: Prototype ({{duration}})" + type: bullet-list + template: | + - Core mechanic implementation + - Technical proof of concept + - Initial playtesting and iteration + - id: phase-3-production + title: "Phase 3: Production ({{duration}})" + type: bullet-list + template: | + - Full feature development + - Content creation and integration + - Comprehensive testing and optimization + - id: documentation-pipeline + title: Documentation Pipeline + sections: + - id: required-documents + title: Required Documents + type: numbered-list + template: | + Game Design Document (GDD) - {{target_completion}} + Technical Architecture Document - {{target_completion}} + Art Style Guide - {{target_completion}} + Production Plan - {{target_completion}} + - id: validation-plan + title: Validation Plan + template: | + **Concept Testing:** + + - {{validation_method_1}} - {{timeline}} + - {{validation_method_2}} - {{timeline}} + + **Prototype Testing:** + + - {{testing_approach}} - {{timeline}} + - {{feedback_collection_method}} - {{timeline}} + + - id: appendices + title: Appendices + sections: + - id: research-materials + title: Research Materials + instruction: Include any supporting research, competitive analysis, or market data that informed the brief + - id: brainstorming-notes + title: Brainstorming Session Notes + instruction: Reference any brainstorming sessions that led to this brief + - id: stakeholder-input + title: Stakeholder Input + instruction: Include key input from stakeholders that shaped the vision + - id: change-log + title: Change Log + instruction: Track document versions and changes + type: table + template: | + | Date | Version | Description | Author | + | :--- | :------ | :---------- | :----- | +==================== END: .bmad-2d-phaser-game-dev/templates/game-brief-tmpl.yaml ==================== ==================== START: .bmad-2d-phaser-game-dev/checklists/game-design-checklist.md ==================== # Game Design Document Quality Checklist diff --git a/dist/expansion-packs/bmad-2d-phaser-game-dev/agents/game-developer.txt b/dist/expansion-packs/bmad-2d-phaser-game-dev/agents/game-developer.txt index 34c4eaab..f2334798 100644 --- a/dist/expansion-packs/bmad-2d-phaser-game-dev/agents/game-developer.txt +++ b/dist/expansion-packs/bmad-2d-phaser-game-dev/agents/game-developer.txt @@ -50,6 +50,10 @@ activation-instructions: - Only read the files/tasks listed here when user selects them for execution to minimize context usage - The customization field ALWAYS takes precedence over any conflicting instructions - When listing tasks/templates or presenting options during conversations, always show as numbered options list, allowing the user to type a number to select or execute + - Greet the user with your name and role, and inform of the *help command + - Load development guidelines to ensure consistent coding standards + - Wait for user to specify story or ask for story selection + - Only load specific story files when user requests implementation agent: name: Maya id: game-developer @@ -70,13 +74,6 @@ core_principles: - Cross-Platform Optimization - Works seamlessly on desktop and mobile - Test-Driven Quality - Comprehensive testing of game logic and systems - Numbered Options Protocol - Always use numbered lists for user selections -startup: - - Greet the user with your name and role, and inform of the *help command - - Load development guidelines to ensure consistent coding standards - - CRITICAL: Do NOT scan docs/stories/ directory automatically during startup - - CRITICAL: Do NOT begin any implementation tasks automatically - - Wait for user to specify story or ask for story selection - - Only load specific story files when user requests implementation commands: - '*help" - Show numbered list of available commands for selection' - '*chat-mode" - Conversational mode for technical advice' @@ -98,13 +95,13 @@ task-execution: done: Game feature works + Tests pass + 60 FPS + No lint errors + Follows Phaser 3 best practices dependencies: tasks: - - execute-checklist + - execute-checklist.md templates: - - game-architecture-tmpl + - game-architecture-tmpl.yaml checklists: - - game-story-dod-checklist + - game-story-dod-checklist.md data: - - development-guidelines + - development-guidelines.md ``` ==================== END: .bmad-2d-phaser-game-dev/agents/game-developer.md ==================== @@ -204,568 +201,621 @@ The LLM will: - Offer to provide detailed analysis of any section, especially those with warnings or failures ==================== END: .bmad-2d-phaser-game-dev/tasks/execute-checklist.md ==================== -==================== START: .bmad-2d-phaser-game-dev/templates/game-architecture-tmpl.md ==================== -# {{Game Title}} Game Architecture Document - -[[LLM: This template creates a comprehensive game architecture document specifically for Phaser 3 + TypeScript projects. This should provide the technical foundation for all game development stories and epics. - -If available, review any provided documents: Game Design Document (GDD), Technical Preferences. This architecture should support all game mechanics defined in the GDD.]] - -## Introduction - -[[LLM: Establish the document's purpose and scope for game development]] - -This document outlines the complete technical architecture for {{Game Title}}, a 2D game built with Phaser 3 and TypeScript. It serves as the technical foundation for AI-driven game development, ensuring consistency and scalability across all game systems. - -This architecture is designed to support the gameplay mechanics defined in the Game Design Document while maintaining 60 FPS performance and cross-platform compatibility. - -### Change Log - -[[LLM: Track document versions and changes]] - -| Date | Version | Description | Author | -| :--- | :------ | :---------- | :----- | - -## Technical Overview - -[[LLM: Present all subsections together, then apply `tasks#advanced-elicitation` protocol to the complete section.]] - -### Architecture Summary - -[[LLM: Provide a comprehensive overview covering: - -- Game engine choice and configuration -- Project structure and organization -- Key systems and their interactions -- Performance and optimization strategy -- How this architecture achieves GDD requirements]] - -### Platform Targets - -[[LLM: Based on GDD requirements, confirm platform support]] - -**Primary Platform:** {{primary_platform}} -**Secondary Platforms:** {{secondary_platforms}} -**Minimum Requirements:** {{min_specs}} -**Target Performance:** 60 FPS on {{target_device}} - -### Technology Stack - -**Core Engine:** Phaser 3.70+ -**Language:** TypeScript 5.0+ (Strict Mode) -**Build Tool:** {{build_tool}} (Webpack/Vite/Parcel) -**Package Manager:** {{package_manager}} -**Testing:** {{test_framework}} -**Deployment:** {{deployment_platform}} - -## Project Structure - -[[LLM: Define the complete project organization that developers will follow]] - -### Repository Organization - -[[LLM: Design a clear folder structure for game development]] - -```text -{{game_name}}/ -├── src/ -│ ├── scenes/ # Game scenes -│ ├── gameObjects/ # Custom game objects -│ ├── systems/ # Core game systems -│ ├── utils/ # Utility functions -│ ├── types/ # TypeScript type definitions -│ ├── config/ # Game configuration -│ └── main.ts # Entry point -├── assets/ -│ ├── images/ # Sprite assets -│ ├── audio/ # Sound files -│ ├── data/ # JSON data files -│ └── fonts/ # Font files -├── public/ # Static web assets -├── tests/ # Test files -├── docs/ # Documentation -│ ├── stories/ # Development stories -│ └── architecture/ # Technical docs -└── dist/ # Built game files -``` - -### Module Organization - -[[LLM: Define how TypeScript modules should be organized]] - -**Scene Structure:** - -- Each scene in separate file -- Scene-specific logic contained -- Clear data passing between scenes - -**Game Object Pattern:** - -- Component-based architecture -- Reusable game object classes -- Type-safe property definitions - -**System Architecture:** - -- Singleton managers for global systems -- Event-driven communication -- Clear separation of concerns - -## Core Game Systems - -[[LLM: Detail each major system that needs to be implemented. Each system should be specific enough for developers to create implementation stories.]] - -### Scene Management System - -**Purpose:** Handle game flow and scene transitions - -**Key Components:** - -- Scene loading and unloading -- Data passing between scenes -- Transition effects -- Memory management - -**Implementation Requirements:** - -- Preload scene for asset loading -- Menu system with navigation -- Gameplay scenes with state management -- Pause/resume functionality - -**Files to Create:** - -- `src/scenes/BootScene.ts` -- `src/scenes/PreloadScene.ts` -- `src/scenes/MenuScene.ts` -- `src/scenes/GameScene.ts` -- `src/systems/SceneManager.ts` - -### Game State Management - -**Purpose:** Track player progress and game status - -**State Categories:** - -- Player progress (levels, unlocks) -- Game settings (audio, controls) -- Session data (current level, score) -- Persistent data (achievements, statistics) - -**Implementation Requirements:** - -- Save/load system with localStorage -- State validation and error recovery -- Cross-session data persistence -- Settings management - -**Files to Create:** - -- `src/systems/GameState.ts` -- `src/systems/SaveManager.ts` -- `src/types/GameData.ts` - -### Asset Management System - -**Purpose:** Efficient loading and management of game assets - -**Asset Categories:** - -- Sprite sheets and animations -- Audio files and music -- Level data and configurations -- UI assets and fonts - -**Implementation Requirements:** - -- Progressive loading strategy -- Asset caching and optimization -- Error handling for failed loads -- Memory management for large assets - -**Files to Create:** - -- `src/systems/AssetManager.ts` -- `src/config/AssetConfig.ts` -- `src/utils/AssetLoader.ts` - -### Input Management System - -**Purpose:** Handle all player input across platforms - -**Input Types:** - -- Keyboard controls -- Mouse/pointer interaction -- Touch gestures (mobile) -- Gamepad support (optional) - -**Implementation Requirements:** - -- Input mapping and configuration -- Touch-friendly mobile controls -- Input buffering for responsive gameplay -- Customizable control schemes - -**Files to Create:** - -- `src/systems/InputManager.ts` -- `src/utils/TouchControls.ts` -- `src/types/InputTypes.ts` - -### Game Mechanics Systems - -[[LLM: For each major mechanic defined in the GDD, create a system specification]] - -<> - -#### {{mechanic_name}} System - -**Purpose:** {{system_purpose}} - -**Core Functionality:** - -- {{feature_1}} -- {{feature_2}} -- {{feature_3}} - -**Dependencies:** {{required_systems}} - -**Performance Considerations:** {{optimization_notes}} - -**Files to Create:** - -- `src/systems/{{SystemName}}.ts` -- `src/gameObjects/{{RelatedObject}}.ts` -- `src/types/{{SystemTypes}}.ts` - -<> - -### Physics & Collision System - -**Physics Engine:** {{physics_choice}} (Arcade Physics/Matter.js) - -**Collision Categories:** - -- Player collision -- Enemy interactions -- Environmental objects -- Collectibles and items - -**Implementation Requirements:** - -- Optimized collision detection -- Physics body management -- Collision callbacks and events -- Performance monitoring - -**Files to Create:** - -- `src/systems/PhysicsManager.ts` -- `src/utils/CollisionGroups.ts` - -### Audio System - -**Audio Requirements:** - -- Background music with looping -- Sound effects for actions -- Audio settings and volume control -- Mobile audio optimization - -**Implementation Features:** - -- Audio sprite management -- Dynamic music system -- Spatial audio (if applicable) -- Audio pooling for performance - -**Files to Create:** - -- `src/systems/AudioManager.ts` -- `src/config/AudioConfig.ts` - -### UI System - -**UI Components:** - -- HUD elements (score, health, etc.) -- Menu navigation -- Modal dialogs -- Settings screens - -**Implementation Requirements:** - -- Responsive layout system -- Touch-friendly interface -- Keyboard navigation support -- Animation and transitions - -**Files to Create:** - -- `src/systems/UIManager.ts` -- `src/gameObjects/UI/` -- `src/types/UITypes.ts` - -## Performance Architecture - -[[LLM: Define performance requirements and optimization strategies]] - -### Performance Targets - -**Frame Rate:** 60 FPS sustained, 30 FPS minimum -**Memory Usage:** <{{memory_limit}}MB total -**Load Times:** <{{initial_load}}s initial, <{{level_load}}s per level -**Battery Optimization:** Reduced updates when not visible - -### Optimization Strategies - -**Object Pooling:** - -- Bullets and projectiles -- Particle effects -- Enemy objects -- UI elements - -**Asset Optimization:** - -- Texture atlases for sprites -- Audio compression -- Lazy loading for large assets -- Progressive enhancement - -**Rendering Optimization:** - -- Sprite batching -- Culling off-screen objects -- Reduced particle counts on mobile -- Texture resolution scaling - -**Files to Create:** - -- `src/utils/ObjectPool.ts` -- `src/utils/PerformanceMonitor.ts` -- `src/config/OptimizationConfig.ts` - -## Game Configuration - -[[LLM: Define all configurable aspects of the game]] - -### Phaser Configuration - -```typescript -// src/config/GameConfig.ts -const gameConfig: Phaser.Types.Core.GameConfig = { - type: Phaser.AUTO, - width: {{game_width}}, - height: {{game_height}}, - scale: { - mode: {{scale_mode}}, - autoCenter: Phaser.Scale.CENTER_BOTH - }, - physics: { - default: '{{physics_system}}', - {{physics_system}}: { - gravity: { y: {{gravity}} }, - debug: false - } - }, - // Additional configuration... -}; -``` - -### Game Balance Configuration - -[[LLM: Based on GDD, define configurable game parameters]] - -```typescript -// src/config/GameBalance.ts -export const GameBalance = { - player: { - speed: {{player_speed}}, - health: {{player_health}}, - // Additional player parameters... - }, - difficulty: { - easy: {{easy_params}}, - normal: {{normal_params}}, - hard: {{hard_params}} - }, - // Additional balance parameters... -}; -``` - -## Development Guidelines - -[[LLM: Provide coding standards specific to game development]] - -### TypeScript Standards - -**Type Safety:** - -- Use strict mode -- Define interfaces for all data structures -- Avoid `any` type usage -- Use enums for game states - -**Code Organization:** - -- One class per file -- Clear naming conventions -- Proper error handling -- Comprehensive documentation - -### Phaser 3 Best Practices - -**Scene Management:** - -- Clean up resources in shutdown() -- Use scene data for communication -- Implement proper event handling -- Avoid memory leaks - -**Game Object Design:** - -- Extend Phaser classes appropriately -- Use component-based architecture -- Implement object pooling where needed -- Follow consistent update patterns - -### Testing Strategy - -**Unit Testing:** - -- Test game logic separately from Phaser -- Mock Phaser dependencies -- Test utility functions -- Validate game balance calculations - -**Integration Testing:** - -- Scene loading and transitions -- Save/load functionality -- Input handling -- Performance benchmarks - -**Files to Create:** - -- `tests/utils/GameLogic.test.ts` -- `tests/systems/SaveManager.test.ts` -- `tests/performance/FrameRate.test.ts` - -## Deployment Architecture - -[[LLM: Define how the game will be built and deployed]] - -### Build Process - -**Development Build:** - -- Fast compilation -- Source maps enabled -- Debug logging active -- Hot reload support - -**Production Build:** - -- Minified and optimized -- Asset compression -- Performance monitoring -- Error tracking - -### Deployment Strategy - -**Web Deployment:** - -- Static hosting ({{hosting_platform}}) -- CDN for assets -- Progressive loading -- Browser compatibility - -**Mobile Packaging:** - -- Cordova/Capacitor wrapper -- Platform-specific optimization -- App store requirements -- Performance testing - -## Implementation Roadmap - -[[LLM: Break down the architecture implementation into phases that align with the GDD development phases]] - -### Phase 1: Foundation ({{duration}}) - -**Core Systems:** - -- Project setup and configuration -- Basic scene management -- Asset loading pipeline -- Input handling framework - -**Story Epics:** - -- "Engine Setup and Configuration" -- "Basic Scene Management System" -- "Asset Loading Foundation" - -### Phase 2: Game Systems ({{duration}}) - -**Gameplay Systems:** - -- {{primary_mechanic}} implementation -- Physics and collision system -- Game state management -- UI framework - -**Story Epics:** - -- "{{Primary_Mechanic}} System Implementation" -- "Physics and Collision Framework" -- "Game State Management System" - -### Phase 3: Content & Polish ({{duration}}) - -**Content Systems:** - -- Level loading and management -- Audio system integration -- Performance optimization -- Final polish and testing - -**Story Epics:** - -- "Level Management System" -- "Audio Integration and Optimization" -- "Performance Optimization and Testing" - -## Risk Assessment - -[[LLM: Identify potential technical risks and mitigation strategies]] - -| Risk | Probability | Impact | Mitigation Strategy | -| ---------------------------- | ----------- | ---------- | ------------------- | -| Performance issues on mobile | {{prob}} | {{impact}} | {{mitigation}} | -| Asset loading bottlenecks | {{prob}} | {{impact}} | {{mitigation}} | -| Cross-platform compatibility | {{prob}} | {{impact}} | {{mitigation}} | - -## Success Criteria - -[[LLM: Define measurable technical success criteria]] - -**Technical Metrics:** - -- All systems implemented per specification -- Performance targets met consistently -- Zero critical bugs in core systems -- Successful deployment across target platforms - -**Code Quality:** - -- 90%+ test coverage on game logic -- Zero TypeScript errors in strict mode -- Consistent adherence to coding standards -- Comprehensive documentation coverage -==================== END: .bmad-2d-phaser-game-dev/templates/game-architecture-tmpl.md ==================== +==================== START: .bmad-2d-phaser-game-dev/templates/game-architecture-tmpl.yaml ==================== +template: + id: game-architecture-template-v2 + name: Game Architecture Document + version: 2.0 + output: + format: markdown + filename: "docs/{{game_name}}-game-architecture.md" + title: "{{game_title}} Game Architecture Document" + +workflow: + mode: interactive + +sections: + - id: initial-setup + instruction: | + This template creates a comprehensive game architecture document specifically for Phaser 3 + TypeScript projects. This should provide the technical foundation for all game development stories and epics. + + If available, review any provided documents: Game Design Document (GDD), Technical Preferences. This architecture should support all game mechanics defined in the GDD. + + - id: introduction + title: Introduction + instruction: Establish the document's purpose and scope for game development + content: | + This document outlines the complete technical architecture for {{game_title}}, a 2D game built with Phaser 3 and TypeScript. It serves as the technical foundation for AI-driven game development, ensuring consistency and scalability across all game systems. + + This architecture is designed to support the gameplay mechanics defined in the Game Design Document while maintaining 60 FPS performance and cross-platform compatibility. + sections: + - id: change-log + title: Change Log + instruction: Track document versions and changes + type: table + template: | + | Date | Version | Description | Author | + | :--- | :------ | :---------- | :----- | + + - id: technical-overview + title: Technical Overview + instruction: Present all subsections together, then apply `tasks#advanced-elicitation` protocol to the complete section. + sections: + - id: architecture-summary + title: Architecture Summary + instruction: | + Provide a comprehensive overview covering: + + - Game engine choice and configuration + - Project structure and organization + - Key systems and their interactions + - Performance and optimization strategy + - How this architecture achieves GDD requirements + - id: platform-targets + title: Platform Targets + instruction: Based on GDD requirements, confirm platform support + template: | + **Primary Platform:** {{primary_platform}} + **Secondary Platforms:** {{secondary_platforms}} + **Minimum Requirements:** {{min_specs}} + **Target Performance:** 60 FPS on {{target_device}} + - id: technology-stack + title: Technology Stack + template: | + **Core Engine:** Phaser 3.70+ + **Language:** TypeScript 5.0+ (Strict Mode) + **Build Tool:** {{build_tool}} (Webpack/Vite/Parcel) + **Package Manager:** {{package_manager}} + **Testing:** {{test_framework}} + **Deployment:** {{deployment_platform}} + + - id: project-structure + title: Project Structure + instruction: Define the complete project organization that developers will follow + sections: + - id: repository-organization + title: Repository Organization + instruction: Design a clear folder structure for game development + type: code + language: text + template: | + {{game_name}}/ + ├── src/ + │ ├── scenes/ # Game scenes + │ ├── gameObjects/ # Custom game objects + │ ├── systems/ # Core game systems + │ ├── utils/ # Utility functions + │ ├── types/ # TypeScript type definitions + │ ├── config/ # Game configuration + │ └── main.ts # Entry point + ├── assets/ + │ ├── images/ # Sprite assets + │ ├── audio/ # Sound files + │ ├── data/ # JSON data files + │ └── fonts/ # Font files + ├── public/ # Static web assets + ├── tests/ # Test files + ├── docs/ # Documentation + │ ├── stories/ # Development stories + │ └── architecture/ # Technical docs + └── dist/ # Built game files + - id: module-organization + title: Module Organization + instruction: Define how TypeScript modules should be organized + sections: + - id: scene-structure + title: Scene Structure + type: bullet-list + template: | + - Each scene in separate file + - Scene-specific logic contained + - Clear data passing between scenes + - id: game-object-pattern + title: Game Object Pattern + type: bullet-list + template: | + - Component-based architecture + - Reusable game object classes + - Type-safe property definitions + - id: system-architecture + title: System Architecture + type: bullet-list + template: | + - Singleton managers for global systems + - Event-driven communication + - Clear separation of concerns + + - id: core-game-systems + title: Core Game Systems + instruction: Detail each major system that needs to be implemented. Each system should be specific enough for developers to create implementation stories. + sections: + - id: scene-management + title: Scene Management System + template: | + **Purpose:** Handle game flow and scene transitions + + **Key Components:** + + - Scene loading and unloading + - Data passing between scenes + - Transition effects + - Memory management + + **Implementation Requirements:** + + - Preload scene for asset loading + - Menu system with navigation + - Gameplay scenes with state management + - Pause/resume functionality + + **Files to Create:** + + - `src/scenes/BootScene.ts` + - `src/scenes/PreloadScene.ts` + - `src/scenes/MenuScene.ts` + - `src/scenes/GameScene.ts` + - `src/systems/SceneManager.ts` + - id: game-state-management + title: Game State Management + template: | + **Purpose:** Track player progress and game status + + **State Categories:** + + - Player progress (levels, unlocks) + - Game settings (audio, controls) + - Session data (current level, score) + - Persistent data (achievements, statistics) + + **Implementation Requirements:** + + - Save/load system with localStorage + - State validation and error recovery + - Cross-session data persistence + - Settings management + + **Files to Create:** + + - `src/systems/GameState.ts` + - `src/systems/SaveManager.ts` + - `src/types/GameData.ts` + - id: asset-management + title: Asset Management System + template: | + **Purpose:** Efficient loading and management of game assets + + **Asset Categories:** + + - Sprite sheets and animations + - Audio files and music + - Level data and configurations + - UI assets and fonts + + **Implementation Requirements:** + + - Progressive loading strategy + - Asset caching and optimization + - Error handling for failed loads + - Memory management for large assets + + **Files to Create:** + + - `src/systems/AssetManager.ts` + - `src/config/AssetConfig.ts` + - `src/utils/AssetLoader.ts` + - id: input-management + title: Input Management System + template: | + **Purpose:** Handle all player input across platforms + + **Input Types:** + + - Keyboard controls + - Mouse/pointer interaction + - Touch gestures (mobile) + - Gamepad support (optional) + + **Implementation Requirements:** + + - Input mapping and configuration + - Touch-friendly mobile controls + - Input buffering for responsive gameplay + - Customizable control schemes + + **Files to Create:** + + - `src/systems/InputManager.ts` + - `src/utils/TouchControls.ts` + - `src/types/InputTypes.ts` + - id: game-mechanics-systems + title: Game Mechanics Systems + instruction: For each major mechanic defined in the GDD, create a system specification + repeatable: true + sections: + - id: mechanic-system + title: "{{mechanic_name}} System" + template: | + **Purpose:** {{system_purpose}} + + **Core Functionality:** + + - {{feature_1}} + - {{feature_2}} + - {{feature_3}} + + **Dependencies:** {{required_systems}} + + **Performance Considerations:** {{optimization_notes}} + + **Files to Create:** + + - `src/systems/{{system_name}}.ts` + - `src/gameObjects/{{related_object}}.ts` + - `src/types/{{system_types}}.ts` + - id: physics-collision + title: Physics & Collision System + template: | + **Physics Engine:** {{physics_choice}} (Arcade Physics/Matter.js) + + **Collision Categories:** + + - Player collision + - Enemy interactions + - Environmental objects + - Collectibles and items + + **Implementation Requirements:** + + - Optimized collision detection + - Physics body management + - Collision callbacks and events + - Performance monitoring + + **Files to Create:** + + - `src/systems/PhysicsManager.ts` + - `src/utils/CollisionGroups.ts` + - id: audio-system + title: Audio System + template: | + **Audio Requirements:** + + - Background music with looping + - Sound effects for actions + - Audio settings and volume control + - Mobile audio optimization + + **Implementation Features:** + + - Audio sprite management + - Dynamic music system + - Spatial audio (if applicable) + - Audio pooling for performance + + **Files to Create:** + + - `src/systems/AudioManager.ts` + - `src/config/AudioConfig.ts` + - id: ui-system + title: UI System + template: | + **UI Components:** + + - HUD elements (score, health, etc.) + - Menu navigation + - Modal dialogs + - Settings screens + + **Implementation Requirements:** + + - Responsive layout system + - Touch-friendly interface + - Keyboard navigation support + - Animation and transitions + + **Files to Create:** + + - `src/systems/UIManager.ts` + - `src/gameObjects/UI/` + - `src/types/UITypes.ts` + + - id: performance-architecture + title: Performance Architecture + instruction: Define performance requirements and optimization strategies + sections: + - id: performance-targets + title: Performance Targets + template: | + **Frame Rate:** 60 FPS sustained, 30 FPS minimum + **Memory Usage:** <{{memory_limit}}MB total + **Load Times:** <{{initial_load}}s initial, <{{level_load}}s per level + **Battery Optimization:** Reduced updates when not visible + - id: optimization-strategies + title: Optimization Strategies + sections: + - id: object-pooling + title: Object Pooling + type: bullet-list + template: | + - Bullets and projectiles + - Particle effects + - Enemy objects + - UI elements + - id: asset-optimization + title: Asset Optimization + type: bullet-list + template: | + - Texture atlases for sprites + - Audio compression + - Lazy loading for large assets + - Progressive enhancement + - id: rendering-optimization + title: Rendering Optimization + type: bullet-list + template: | + - Sprite batching + - Culling off-screen objects + - Reduced particle counts on mobile + - Texture resolution scaling + - id: optimization-files + title: Files to Create + type: bullet-list + template: | + - `src/utils/ObjectPool.ts` + - `src/utils/PerformanceMonitor.ts` + - `src/config/OptimizationConfig.ts` + + - id: game-configuration + title: Game Configuration + instruction: Define all configurable aspects of the game + sections: + - id: phaser-configuration + title: Phaser Configuration + type: code + language: typescript + template: | + // src/config/GameConfig.ts + const gameConfig: Phaser.Types.Core.GameConfig = { + type: Phaser.AUTO, + width: {{game_width}}, + height: {{game_height}}, + scale: { + mode: {{scale_mode}}, + autoCenter: Phaser.Scale.CENTER_BOTH + }, + physics: { + default: '{{physics_system}}', + {{physics_system}}: { + gravity: { y: {{gravity}} }, + debug: false + } + }, + // Additional configuration... + }; + - id: game-balance-configuration + title: Game Balance Configuration + instruction: Based on GDD, define configurable game parameters + type: code + language: typescript + template: | + // src/config/GameBalance.ts + export const GameBalance = { + player: { + speed: {{player_speed}}, + health: {{player_health}}, + // Additional player parameters... + }, + difficulty: { + easy: {{easy_params}}, + normal: {{normal_params}}, + hard: {{hard_params}} + }, + // Additional balance parameters... + }; + + - id: development-guidelines + title: Development Guidelines + instruction: Provide coding standards specific to game development + sections: + - id: typescript-standards + title: TypeScript Standards + sections: + - id: type-safety + title: Type Safety + type: bullet-list + template: | + - Use strict mode + - Define interfaces for all data structures + - Avoid `any` type usage + - Use enums for game states + - id: code-organization + title: Code Organization + type: bullet-list + template: | + - One class per file + - Clear naming conventions + - Proper error handling + - Comprehensive documentation + - id: phaser-best-practices + title: Phaser 3 Best Practices + sections: + - id: scene-management-practices + title: Scene Management + type: bullet-list + template: | + - Clean up resources in shutdown() + - Use scene data for communication + - Implement proper event handling + - Avoid memory leaks + - id: game-object-design + title: Game Object Design + type: bullet-list + template: | + - Extend Phaser classes appropriately + - Use component-based architecture + - Implement object pooling where needed + - Follow consistent update patterns + - id: testing-strategy + title: Testing Strategy + sections: + - id: unit-testing + title: Unit Testing + type: bullet-list + template: | + - Test game logic separately from Phaser + - Mock Phaser dependencies + - Test utility functions + - Validate game balance calculations + - id: integration-testing + title: Integration Testing + type: bullet-list + template: | + - Scene loading and transitions + - Save/load functionality + - Input handling + - Performance benchmarks + - id: test-files + title: Files to Create + type: bullet-list + template: | + - `tests/utils/GameLogic.test.ts` + - `tests/systems/SaveManager.test.ts` + - `tests/performance/FrameRate.test.ts` + + - id: deployment-architecture + title: Deployment Architecture + instruction: Define how the game will be built and deployed + sections: + - id: build-process + title: Build Process + sections: + - id: development-build + title: Development Build + type: bullet-list + template: | + - Fast compilation + - Source maps enabled + - Debug logging active + - Hot reload support + - id: production-build + title: Production Build + type: bullet-list + template: | + - Minified and optimized + - Asset compression + - Performance monitoring + - Error tracking + - id: deployment-strategy + title: Deployment Strategy + sections: + - id: web-deployment + title: Web Deployment + type: bullet-list + template: | + - Static hosting ({{hosting_platform}}) + - CDN for assets + - Progressive loading + - Browser compatibility + - id: mobile-packaging + title: Mobile Packaging + type: bullet-list + template: | + - Cordova/Capacitor wrapper + - Platform-specific optimization + - App store requirements + - Performance testing + + - id: implementation-roadmap + title: Implementation Roadmap + instruction: Break down the architecture implementation into phases that align with the GDD development phases + sections: + - id: phase-1-foundation + title: "Phase 1: Foundation ({{duration}})" + sections: + - id: phase-1-core + title: Core Systems + type: bullet-list + template: | + - Project setup and configuration + - Basic scene management + - Asset loading pipeline + - Input handling framework + - id: phase-1-epics + title: Story Epics + type: bullet-list + template: | + - "Engine Setup and Configuration" + - "Basic Scene Management System" + - "Asset Loading Foundation" + - id: phase-2-game-systems + title: "Phase 2: Game Systems ({{duration}})" + sections: + - id: phase-2-gameplay + title: Gameplay Systems + type: bullet-list + template: | + - {{primary_mechanic}} implementation + - Physics and collision system + - Game state management + - UI framework + - id: phase-2-epics + title: Story Epics + type: bullet-list + template: | + - "{{primary_mechanic}} System Implementation" + - "Physics and Collision Framework" + - "Game State Management System" + - id: phase-3-content-polish + title: "Phase 3: Content & Polish ({{duration}})" + sections: + - id: phase-3-content + title: Content Systems + type: bullet-list + template: | + - Level loading and management + - Audio system integration + - Performance optimization + - Final polish and testing + - id: phase-3-epics + title: Story Epics + type: bullet-list + template: | + - "Level Management System" + - "Audio Integration and Optimization" + - "Performance Optimization and Testing" + + - id: risk-assessment + title: Risk Assessment + instruction: Identify potential technical risks and mitigation strategies + type: table + template: | + | Risk | Probability | Impact | Mitigation Strategy | + | ---------------------------- | ----------- | ---------- | ------------------- | + | Performance issues on mobile | {{prob}} | {{impact}} | {{mitigation}} | + | Asset loading bottlenecks | {{prob}} | {{impact}} | {{mitigation}} | + | Cross-platform compatibility | {{prob}} | {{impact}} | {{mitigation}} | + + - id: success-criteria + title: Success Criteria + instruction: Define measurable technical success criteria + sections: + - id: technical-metrics + title: Technical Metrics + type: bullet-list + template: | + - All systems implemented per specification + - Performance targets met consistently + - Zero critical bugs in core systems + - Successful deployment across target platforms + - id: code-quality + title: Code Quality + type: bullet-list + template: | + - 90%+ test coverage on game logic + - Zero TypeScript errors in strict mode + - Consistent adherence to coding standards + - Comprehensive documentation coverage +==================== END: .bmad-2d-phaser-game-dev/templates/game-architecture-tmpl.yaml ==================== ==================== START: .bmad-2d-phaser-game-dev/checklists/game-story-dod-checklist.md ==================== # Game Development Story Definition of Done Checklist diff --git a/dist/expansion-packs/bmad-2d-phaser-game-dev/agents/game-sm.txt b/dist/expansion-packs/bmad-2d-phaser-game-dev/agents/game-sm.txt index 63ef8c92..eda3a9f8 100644 --- a/dist/expansion-packs/bmad-2d-phaser-game-dev/agents/game-sm.txt +++ b/dist/expansion-packs/bmad-2d-phaser-game-dev/agents/game-sm.txt @@ -50,6 +50,10 @@ activation-instructions: - Only read the files/tasks listed here when user selects them for execution to minimize context usage - The customization field ALWAYS takes precedence over any conflicting instructions - When listing tasks/templates or presenting options during conversations, always show as numbered options list, allowing the user to type a number to select or execute + - Greet the user with your name and role, and inform of the *help command + - Offer to help with game story preparation but wait for explicit user confirmation + - Only execute tasks when user explicitly requests them + - 'CRITICAL RULE: You are ONLY allowed to create/modify story files - NEVER implement! If asked to implement, tell user they MUST switch to Game Developer Agent' agent: name: Jordan id: game-sm @@ -69,13 +73,6 @@ core_principles: - Focus on One Story at a Time - Complete one before starting next - Game-Specific Context - Understand Phaser 3, game mechanics, and performance requirements - Numbered Options Protocol - Always use numbered lists for selections -startup: - - Greet the user with your name and role, and inform of the *help command - - CRITICAL: Do NOT automatically execute create-game-story tasks during startup - - CRITICAL: Do NOT create or modify any files during startup - - Offer to help with game story preparation but wait for explicit user confirmation - - Only execute tasks when user explicitly requests them - - 'CRITICAL RULE: You are ONLY allowed to create/modify story files - NEVER implement! If asked to implement, tell user they MUST switch to Game Developer Agent' commands: - '*help" - Show numbered list of available commands for selection' - '*chat-mode" - Conversational mode with advanced-elicitation for game dev advice' @@ -84,12 +81,12 @@ commands: - '*exit" - Say goodbye as the Game Scrum Master, and then abandon inhabiting this persona' dependencies: tasks: - - create-game-story - - execute-checklist + - create-game-story.md + - execute-checklist.md templates: - - game-story-tmpl + - game-story-tmpl.yaml checklists: - - game-story-dod-checklist + - game-story-dod-checklist.md ``` ==================== END: .bmad-2d-phaser-game-dev/agents/game-sm.md ==================== @@ -408,243 +405,261 @@ The LLM will: - Offer to provide detailed analysis of any section, especially those with warnings or failures ==================== END: .bmad-2d-phaser-game-dev/tasks/execute-checklist.md ==================== -==================== START: .bmad-2d-phaser-game-dev/templates/game-story-tmpl.md ==================== -# Story: {{Story Title}} - -**Epic:** {{Epic Name}} -**Story ID:** {{ID}} -**Priority:** {{High|Medium|Low}} -**Points:** {{Story Points}} -**Status:** Draft - -[[LLM: This template creates detailed game development stories that are immediately actionable by game developers. Each story should focus on a single, implementable feature that contributes to the overall game functionality. - -Before starting, ensure you have access to: - -- Game Design Document (GDD) -- Game Architecture Document -- Any existing stories in this epic - -The story should be specific enough that a developer can implement it without requiring additional design decisions.]] - -## Description - -[[LLM: Provide a clear, concise description of what this story implements. Focus on the specific game feature or system being built. Reference the GDD section that defines this feature.]] - -{{clear_description_of_what_needs_to_be_implemented}} - -## Acceptance Criteria - -[[LLM: Define specific, testable conditions that must be met for the story to be considered complete. Each criterion should be verifiable and directly related to gameplay functionality.]] - -### Functional Requirements - -- [ ] {{specific_functional_requirement_1}} -- [ ] {{specific_functional_requirement_2}} -- [ ] {{specific_functional_requirement_3}} - -### Technical Requirements - -- [ ] Code follows TypeScript strict mode standards -- [ ] Maintains 60 FPS on target devices -- [ ] No memory leaks or performance degradation -- [ ] {{specific_technical_requirement}} - -### Game Design Requirements - -- [ ] {{gameplay_requirement_from_gdd}} -- [ ] {{balance_requirement_if_applicable}} -- [ ] {{player_experience_requirement}} - -## Technical Specifications - -[[LLM: Provide specific technical details that guide implementation. Include class names, file locations, and integration points based on the game architecture.]] - -### Files to Create/Modify - -**New Files:** - -- `{{file_path_1}}` - {{purpose}} -- `{{file_path_2}}` - {{purpose}} - -**Modified Files:** - -- `{{existing_file_1}}` - {{changes_needed}} -- `{{existing_file_2}}` - {{changes_needed}} - -### Class/Interface Definitions - -[[LLM: Define specific TypeScript interfaces and class structures needed]] - -```typescript -// {{interface_name}} -interface {{InterfaceName}} { - {{property_1}}: {{type}}; - {{property_2}}: {{type}}; - {{method_1}}({{params}}): {{return_type}}; -} - -// {{class_name}} -class {{ClassName}} extends {{PhaseClass}} { - private {{property}}: {{type}}; - - constructor({{params}}) { - // Implementation requirements - } - - public {{method}}({{params}}): {{return_type}} { - // Method requirements - } -} -``` - -### Integration Points - -[[LLM: Specify how this feature integrates with existing systems]] - -**Scene Integration:** - -- {{scene_name}}: {{integration_details}} - -**System Dependencies:** - -- {{system_name}}: {{dependency_description}} - -**Event Communication:** - -- Emits: `{{event_name}}` when {{condition}} -- Listens: `{{event_name}}` to {{response}} - -## Implementation Tasks - -[[LLM: Break down the implementation into specific, ordered tasks. Each task should be completable in 1-4 hours.]] - -### Dev Agent Record - -**Tasks:** - -- [ ] {{task_1_description}} -- [ ] {{task_2_description}} -- [ ] {{task_3_description}} -- [ ] {{task_4_description}} -- [ ] Write unit tests for {{component}} -- [ ] Integration testing with {{related_system}} -- [ ] Performance testing and optimization - -**Debug Log:** -| Task | File | Change | Reverted? | -|------|------|--------|-----------| -| | | | | - -**Completion Notes:** - - - -**Change Log:** - - - -## Game Design Context - -[[LLM: Reference the specific sections of the GDD that this story implements]] - -**GDD Reference:** {{section_name}} ({{page_or_section_number}}) - -**Game Mechanic:** {{mechanic_name}} - -**Player Experience Goal:** {{experience_description}} - -**Balance Parameters:** - -- {{parameter_1}}: {{value_or_range}} -- {{parameter_2}}: {{value_or_range}} - -## Testing Requirements - -[[LLM: Define specific testing criteria for this game feature]] - -### Unit Tests - -**Test Files:** - -- `tests/{{component_name}}.test.ts` - -**Test Scenarios:** - -- {{test_scenario_1}} -- {{test_scenario_2}} -- {{edge_case_test}} - -### Game Testing - -**Manual Test Cases:** - -1. {{test_case_1_description}} - - - Expected: {{expected_behavior}} - - Performance: {{performance_expectation}} - -2. {{test_case_2_description}} - - Expected: {{expected_behavior}} - - Edge Case: {{edge_case_handling}} - -### Performance Tests - -**Metrics to Verify:** - -- Frame rate maintains {{fps_target}} FPS -- Memory usage stays under {{memory_limit}}MB -- {{feature_specific_performance_metric}} - -## Dependencies - -[[LLM: List any dependencies that must be completed before this story can be implemented]] - -**Story Dependencies:** - -- {{story_id}}: {{dependency_description}} - -**Technical Dependencies:** - -- {{system_or_file}}: {{requirement}} - -**Asset Dependencies:** - -- {{asset_type}}: {{asset_description}} -- Location: `{{asset_path}}` - -## Definition of Done - -[[LLM: Checklist that must be completed before the story is considered finished]] - -- [ ] All acceptance criteria met -- [ ] Code reviewed and approved -- [ ] Unit tests written and passing -- [ ] Integration tests passing -- [ ] Performance targets met -- [ ] No linting errors -- [ ] Documentation updated -- [ ] {{game_specific_dod_item}} - -## Notes - -[[LLM: Any additional context, design decisions, or implementation notes]] - -**Implementation Notes:** - -- {{note_1}} -- {{note_2}} - -**Design Decisions:** - -- {{decision_1}}: {{rationale}} -- {{decision_2}}: {{rationale}} - -**Future Considerations:** - -- {{future_enhancement_1}} -- {{future_optimization_1}} -==================== END: .bmad-2d-phaser-game-dev/templates/game-story-tmpl.md ==================== +==================== START: .bmad-2d-phaser-game-dev/templates/game-story-tmpl.yaml ==================== +template: + id: game-story-template-v2 + name: Game Development Story + version: 2.0 + output: + format: markdown + filename: "stories/{{epic_name}}/{{story_id}}-{{story_name}}.md" + title: "Story: {{story_title}}" + +workflow: + mode: interactive + +sections: + - id: initial-setup + instruction: | + This template creates detailed game development stories that are immediately actionable by game developers. Each story should focus on a single, implementable feature that contributes to the overall game functionality. + + Before starting, ensure you have access to: + + - Game Design Document (GDD) + - Game Architecture Document + - Any existing stories in this epic + + The story should be specific enough that a developer can implement it without requiring additional design decisions. + + - id: story-header + content: | + **Epic:** {{epic_name}} + **Story ID:** {{story_id}} + **Priority:** {{High|Medium|Low}} + **Points:** {{story_points}} + **Status:** Draft + + - id: description + title: Description + instruction: Provide a clear, concise description of what this story implements. Focus on the specific game feature or system being built. Reference the GDD section that defines this feature. + template: "{{clear_description_of_what_needs_to_be_implemented}}" + + - id: acceptance-criteria + title: Acceptance Criteria + instruction: Define specific, testable conditions that must be met for the story to be considered complete. Each criterion should be verifiable and directly related to gameplay functionality. + sections: + - id: functional-requirements + title: Functional Requirements + type: checklist + items: + - "{{specific_functional_requirement}}" + - id: technical-requirements + title: Technical Requirements + type: checklist + items: + - "Code follows TypeScript strict mode standards" + - "Maintains 60 FPS on target devices" + - "No memory leaks or performance degradation" + - "{{specific_technical_requirement}}" + - id: game-design-requirements + title: Game Design Requirements + type: checklist + items: + - "{{gameplay_requirement_from_gdd}}" + - "{{balance_requirement_if_applicable}}" + - "{{player_experience_requirement}}" + + - id: technical-specifications + title: Technical Specifications + instruction: Provide specific technical details that guide implementation. Include class names, file locations, and integration points based on the game architecture. + sections: + - id: files-to-modify + title: Files to Create/Modify + template: | + **New Files:** + + - `{{file_path_1}}` - {{purpose}} + - `{{file_path_2}}` - {{purpose}} + + **Modified Files:** + + - `{{existing_file_1}}` - {{changes_needed}} + - `{{existing_file_2}}` - {{changes_needed}} + - id: class-interface-definitions + title: Class/Interface Definitions + instruction: Define specific TypeScript interfaces and class structures needed + type: code + language: typescript + template: | + // {{interface_name}} + interface {{interface_name}} { + {{property_1}}: {{type}}; + {{property_2}}: {{type}}; + {{method_1}}({{params}}): {{return_type}}; + } + + // {{class_name}} + class {{class_name}} extends {{phaser_class}} { + private {{property}}: {{type}}; + + constructor({{params}}) { + // Implementation requirements + } + + public {{method}}({{params}}): {{return_type}} { + // Method requirements + } + } + - id: integration-points + title: Integration Points + instruction: Specify how this feature integrates with existing systems + template: | + **Scene Integration:** + + - {{scene_name}}: {{integration_details}} + + **System Dependencies:** + + - {{system_name}}: {{dependency_description}} + + **Event Communication:** + + - Emits: `{{event_name}}` when {{condition}} + - Listens: `{{event_name}}` to {{response}} + + - id: implementation-tasks + title: Implementation Tasks + instruction: Break down the implementation into specific, ordered tasks. Each task should be completable in 1-4 hours. + sections: + - id: dev-agent-record + title: Dev Agent Record + template: | + **Tasks:** + + - [ ] {{task_1_description}} + - [ ] {{task_2_description}} + - [ ] {{task_3_description}} + - [ ] {{task_4_description}} + - [ ] Write unit tests for {{component}} + - [ ] Integration testing with {{related_system}} + - [ ] Performance testing and optimization + + **Debug Log:** + | Task | File | Change | Reverted? | + |------|------|--------|-----------| + | | | | | + + **Completion Notes:** + + + + **Change Log:** + + + + - id: game-design-context + title: Game Design Context + instruction: Reference the specific sections of the GDD that this story implements + template: | + **GDD Reference:** {{section_name}} ({{page_or_section_number}}) + + **Game Mechanic:** {{mechanic_name}} + + **Player Experience Goal:** {{experience_description}} + + **Balance Parameters:** + + - {{parameter_1}}: {{value_or_range}} + - {{parameter_2}}: {{value_or_range}} + + - id: testing-requirements + title: Testing Requirements + instruction: Define specific testing criteria for this game feature + sections: + - id: unit-tests + title: Unit Tests + template: | + **Test Files:** + + - `tests/{{component_name}}.test.ts` + + **Test Scenarios:** + + - {{test_scenario_1}} + - {{test_scenario_2}} + - {{edge_case_test}} + - id: game-testing + title: Game Testing + template: | + **Manual Test Cases:** + + 1. {{test_case_1_description}} + + - Expected: {{expected_behavior}} + - Performance: {{performance_expectation}} + + 2. {{test_case_2_description}} + - Expected: {{expected_behavior}} + - Edge Case: {{edge_case_handling}} + - id: performance-tests + title: Performance Tests + template: | + **Metrics to Verify:** + + - Frame rate maintains {{fps_target}} FPS + - Memory usage stays under {{memory_limit}}MB + - {{feature_specific_performance_metric}} + + - id: dependencies + title: Dependencies + instruction: List any dependencies that must be completed before this story can be implemented + template: | + **Story Dependencies:** + + - {{story_id}}: {{dependency_description}} + + **Technical Dependencies:** + + - {{system_or_file}}: {{requirement}} + + **Asset Dependencies:** + + - {{asset_type}}: {{asset_description}} + - Location: `{{asset_path}}` + + - id: definition-of-done + title: Definition of Done + instruction: Checklist that must be completed before the story is considered finished + type: checklist + items: + - "All acceptance criteria met" + - "Code reviewed and approved" + - "Unit tests written and passing" + - "Integration tests passing" + - "Performance targets met" + - "No linting errors" + - "Documentation updated" + - "{{game_specific_dod_item}}" + + - id: notes + title: Notes + instruction: Any additional context, design decisions, or implementation notes + template: | + **Implementation Notes:** + + - {{note_1}} + - {{note_2}} + + **Design Decisions:** + + - {{decision_1}}: {{rationale}} + - {{decision_2}}: {{rationale}} + + **Future Considerations:** + + - {{future_enhancement_1}} + - {{future_optimization_1}} +==================== END: .bmad-2d-phaser-game-dev/templates/game-story-tmpl.yaml ==================== ==================== START: .bmad-2d-phaser-game-dev/checklists/game-story-dod-checklist.md ==================== # Game Development Story Definition of Done Checklist diff --git a/dist/expansion-packs/bmad-2d-phaser-game-dev/teams/phaser-2d-nodejs-game-team.txt b/dist/expansion-packs/bmad-2d-phaser-game-dev/teams/phaser-2d-nodejs-game-team.txt index 50182499..a641e867 100644 --- a/dist/expansion-packs/bmad-2d-phaser-game-dev/teams/phaser-2d-nodejs-game-team.txt +++ b/dist/expansion-packs/bmad-2d-phaser-game-dev/teams/phaser-2d-nodejs-game-team.txt @@ -51,8 +51,8 @@ agents: - game-developer - game-sm workflows: - - game-dev-greenfield - - game-prototype + - game-dev-greenfield.md + - game-prototype.md ==================== END: .bmad-2d-phaser-game-dev/agent-teams/phaser-2d-nodejs-game-team.yaml ==================== ==================== START: .bmad-2d-phaser-game-dev/agents/analyst.md ==================== @@ -64,8 +64,9 @@ CRITICAL: Read the full YAML, start activation to alter your state of being, fol activation-instructions: - Follow all instructions in this file -> this defines you, your persona and more importantly what you can do. STAY IN CHARACTER! - Only read the files/tasks listed here when user selects them for execution to minimize context usage - - The customization field ALWAYS takes precedence over any conflicting instructions + - The agent.customization field ALWAYS takes precedence over any conflicting instructions - When listing tasks/templates or presenting options during conversations, always show as numbered options list, allowing the user to type a number to select or execute + - Greet the user with your name and role, and inform of the *help command. agent: name: Mary id: analyst @@ -90,36 +91,32 @@ persona: - Maintaining a Broad Perspective - Stay aware of market trends and dynamics - Integrity of Information - Ensure accurate sourcing and representation - Numbered Options Protocol - Always use numbered lists for selections -startup: - - Greet the user with your name and role, and inform of the *help command. commands: - help: Show numbered list of the following commands to allow selection - create-doc {template}: execute task create-doc (no template = ONLY show available templates listed under dependencies/templates below) - - yolo: Toggle Yolo Mode off on - on will skip doc section confirmations + - yolo: Toggle Yolo Mode - doc-out: Output full document to current destination file - execute-checklist {checklist}: Run task execute-checklist (default->architect-checklist) - - research {topic}: execute task create-deep-research-prompt for architectural decisions + - research-prompt {topic}: execute task create-deep-research-prompt for architectural decisions - brainstorm {topic}: Facilitate structured brainstorming session - - elicit: list the options under output set of information + - elicit: run the task advanced-elicitation - document-project: Analyze and document existing project structure comprehensively - exit: Say goodbye as the Business Analyst, and then abandon inhabiting this persona dependencies: tasks: - - facilitate-brainstorming-session - - create-deep-research-prompt - - create-doc - - advanced-elicitation - - document-project + - facilitate-brainstorming-session.md + - create-deep-research-prompt.md + - create-doc.md + - advanced-elicitation.md + - document-project.md templates: - - project-brief-tmpl - - market-research-tmpl - - competitor-analysis-tmpl - - brainstorming-output-tmpl + - project-brief-tmpl.yaml + - market-research-tmpl.yaml + - competitor-analysis-tmpl.yaml + - brainstorming-output-tmpl.yaml data: - - bmad-kb - - brainstorming-techniques - utils: - - template-format + - bmad-kb.md + - brainstorming-techniques.md ``` ==================== END: .bmad-2d-phaser-game-dev/agents/analyst.md ==================== @@ -129,6 +126,15 @@ dependencies: CRITICAL: Read the full YAML, start activation to alter your state of being, follow startup section instructions, stay in this being until told to exit this mode: ```yaml +activation-instructions: + - Mention *help shows all available commands and options + - Check for active workflow plan using .bmad-2d-phaser-game-dev/utils/plan-management.md + - 'If plan exists: Show 📋 Active plan: {workflow} ({progress}% complete). Use *plan-status for details.' + - 'If plan exists: Suggest next action based on plan progress' + - Assess user goal against available agents and workflows in this bundle + - If clear match to an agent's expertise, suggest transformation with *agent command + - If project-oriented, suggest *workflow-guidance to explore options + - Load resources only when needed - never pre-load agent: name: BMad Orchestrator id: bmad-orchestrator @@ -150,17 +156,6 @@ persona: - Always use numbered lists for choices - Process commands starting with * immediately - Always remind users that commands require * prefix -startup: - - Announce: Introduce yourself as the BMad Orchestrator, explain you can coordinate agents and workflows - - IMPORTANT: Tell users that all commands start with * (e.g., *help, *agent, *workflow) - - Mention *help shows all available commands and options - - Check for active workflow plan using .bmad-2d-phaser-game-dev/utils/plan-management.md - - 'If plan exists: Show 📋 Active plan: {workflow} ({progress}% complete). Use *plan-status for details.' - - 'If plan exists: Suggest next action based on plan progress' - - Assess user goal against available agents and workflows in this bundle - - If clear match to an agent's expertise, suggest transformation with *agent command - - If project-oriented, suggest *workflow-guidance to explore options - - Load resources only when needed - never pre-load commands: help: Show this guide with available agents and workflows chat-mode: Start conversational mode for detailed assistance @@ -248,17 +243,18 @@ workflow-guidance: - When *workflow-guidance is called, start an interactive session and list all available workflows with brief descriptions dependencies: tasks: - - advanced-elicitation - - create-doc - - create-workflow-plan - - kb-mode-interaction - - update-workflow-plan + - advanced-elicitation.md + - create-doc.md + - create-workflow-plan.md + - kb-mode-interaction.md + - update-workflow-plan.md data: - - bmad-kb + - bmad-kb.md + - elicitation-methods.md utils: - - plan-management - - workflow-management - - template-format + - plan-management.md + - workflow-management.md + - template-format.md ``` ==================== END: .bmad-2d-phaser-game-dev/agents/bmad-orchestrator.md ==================== @@ -273,6 +269,9 @@ activation-instructions: - Only read the files/tasks listed here when user selects them for execution to minimize context usage - The customization field ALWAYS takes precedence over any conflicting instructions - When listing tasks/templates or presenting options during conversations, always show as numbered options list, allowing the user to type a number to select or execute + - Greet the user with your name and role, and inform of the *help command + - Offer to help with game design documentation but wait for explicit user confirmation + - Only execute tasks when user explicitly requests them agent: name: Alex id: game-designer @@ -292,12 +291,6 @@ core_principles: - Technical Awareness - Design within feasible implementation constraints - Data-Driven Decisions - Use metrics and feedback to guide design choices - Numbered Options Protocol - Always use numbered lists for user selections -startup: - - Greet the user with your name and role, and inform of the *help command - - CRITICAL: Do NOT automatically create documents or execute tasks during startup - - CRITICAL: Do NOT create or modify any files during startup - - Offer to help with game design documentation but wait for explicit user confirmation - - Only execute tasks when user explicitly requests them commands: - '*help" - Show numbered list of available commands for selection' - '*chat-mode" - Conversational mode with advanced-elicitation for design advice' @@ -309,17 +302,17 @@ commands: - '*exit" - Say goodbye as the Game Designer, and then abandon inhabiting this persona' dependencies: tasks: - - create-doc - - execute-checklist - - game-design-brainstorming - - create-deep-research-prompt - - advanced-elicitation + - create-doc.md + - execute-checklist.md + - game-design-brainstorming.md + - create-deep-research-prompt.md + - advanced-elicitation.md templates: - - game-design-doc-tmpl - - level-design-doc-tmpl - - game-brief-tmpl + - game-design-doc-tmpl.yaml + - level-design-doc-tmpl.yaml + - game-brief-tmpl.yaml checklists: - - game-design-checklist + - game-design-checklist.md ``` ==================== END: .bmad-2d-phaser-game-dev/agents/game-designer.md ==================== @@ -334,6 +327,10 @@ activation-instructions: - Only read the files/tasks listed here when user selects them for execution to minimize context usage - The customization field ALWAYS takes precedence over any conflicting instructions - When listing tasks/templates or presenting options during conversations, always show as numbered options list, allowing the user to type a number to select or execute + - Greet the user with your name and role, and inform of the *help command + - Load development guidelines to ensure consistent coding standards + - Wait for user to specify story or ask for story selection + - Only load specific story files when user requests implementation agent: name: Maya id: game-developer @@ -354,13 +351,6 @@ core_principles: - Cross-Platform Optimization - Works seamlessly on desktop and mobile - Test-Driven Quality - Comprehensive testing of game logic and systems - Numbered Options Protocol - Always use numbered lists for user selections -startup: - - Greet the user with your name and role, and inform of the *help command - - Load development guidelines to ensure consistent coding standards - - CRITICAL: Do NOT scan docs/stories/ directory automatically during startup - - CRITICAL: Do NOT begin any implementation tasks automatically - - Wait for user to specify story or ask for story selection - - Only load specific story files when user requests implementation commands: - '*help" - Show numbered list of available commands for selection' - '*chat-mode" - Conversational mode for technical advice' @@ -382,13 +372,13 @@ task-execution: done: Game feature works + Tests pass + 60 FPS + No lint errors + Follows Phaser 3 best practices dependencies: tasks: - - execute-checklist + - execute-checklist.md templates: - - game-architecture-tmpl + - game-architecture-tmpl.yaml checklists: - - game-story-dod-checklist + - game-story-dod-checklist.md data: - - development-guidelines + - development-guidelines.md ``` ==================== END: .bmad-2d-phaser-game-dev/agents/game-developer.md ==================== @@ -403,6 +393,10 @@ activation-instructions: - Only read the files/tasks listed here when user selects them for execution to minimize context usage - The customization field ALWAYS takes precedence over any conflicting instructions - When listing tasks/templates or presenting options during conversations, always show as numbered options list, allowing the user to type a number to select or execute + - Greet the user with your name and role, and inform of the *help command + - Offer to help with game story preparation but wait for explicit user confirmation + - Only execute tasks when user explicitly requests them + - 'CRITICAL RULE: You are ONLY allowed to create/modify story files - NEVER implement! If asked to implement, tell user they MUST switch to Game Developer Agent' agent: name: Jordan id: game-sm @@ -422,13 +416,6 @@ core_principles: - Focus on One Story at a Time - Complete one before starting next - Game-Specific Context - Understand Phaser 3, game mechanics, and performance requirements - Numbered Options Protocol - Always use numbered lists for selections -startup: - - Greet the user with your name and role, and inform of the *help command - - CRITICAL: Do NOT automatically execute create-game-story tasks during startup - - CRITICAL: Do NOT create or modify any files during startup - - Offer to help with game story preparation but wait for explicit user confirmation - - Only execute tasks when user explicitly requests them - - 'CRITICAL RULE: You are ONLY allowed to create/modify story files - NEVER implement! If asked to implement, tell user they MUST switch to Game Developer Agent' commands: - '*help" - Show numbered list of available commands for selection' - '*chat-mode" - Conversational mode with advanced-elicitation for game dev advice' @@ -437,12 +424,12 @@ commands: - '*exit" - Say goodbye as the Game Scrum Master, and then abandon inhabiting this persona' dependencies: tasks: - - create-game-story - - execute-checklist + - create-game-story.md + - execute-checklist.md templates: - - game-story-tmpl + - game-story-tmpl.yaml checklists: - - game-story-dod-checklist + - game-story-dod-checklist.md ``` ==================== END: .bmad-2d-phaser-game-dev/agents/game-sm.md ==================== @@ -890,97 +877,85 @@ Present these numbered options to the user: ==================== END: .bmad-2d-phaser-game-dev/tasks/create-deep-research-prompt.md ==================== ==================== START: .bmad-2d-phaser-game-dev/tasks/create-doc.md ==================== -# Create Document from Template Task +# Create Document from Template (YAML Driven) -## Purpose +## CRITICAL: Mandatory Elicitation Format -Generate documents from templates by EXECUTING (not just reading) embedded instructions from the perspective of the selected agent persona. +**When `elicit: true`, ALWAYS use this exact format:** -## CRITICAL RULES +1. Present section content +2. Provide detailed rationale (explain trade-offs, assumptions, decisions made) +3. Present numbered options 1-9: + - **Option 1:** Always "Proceed to next section" + - **Options 2-9:** Select 8 methods from data/elicitation-methods + - End with: "Select 1-9 or just type your question/feedback:" -1. **Templates are PROGRAMS** - Execute every [[LLM:]] instruction exactly as written -2. **NEVER show markup** - Hide all [[LLM:]], {{placeholders}}, @{examples}, and template syntax -3. **STOP and EXECUTE** - When you see "apply tasks#" or "execute tasks#", STOP and run that task immediately -4. **WAIT for user input** - At review points and after elicitation tasks +**NEVER ask yes/no questions or use any other format.** -## Execution Flow +## Processing Flow -### 0. Check Workflow Plan (if configured) +1. **Parse YAML template** - Load template metadata and sections +2. **Set preferences** - Show current mode (Interactive), confirm output file +3. **Process each section:** + - Skip if condition unmet + - Check agent permissions (owner/editors) - note if section is restricted to specific agents + - Draft content using section instruction + - Present content + detailed rationale + - **IF elicit: true** → MANDATORY 1-9 options format + - Save to file if possible +4. **Continue until complete** -[[LLM: Check if plan tracking is enabled in core-config.yaml]] +## Detailed Rationale Requirements -- If `workflow.trackProgress: true`, check for active plan using .bmad-2d-phaser-game-dev/utils/plan-management.md -- If plan exists and this document creation is part of the plan: - - Verify this is the expected next step - - If out of sequence and `enforceSequence: true`, warn user and halt without user override - - If out of sequence and `enforceSequence: false`, ask for confirmation -- Continue with normal execution after plan check +When presenting section content, ALWAYS include rationale that explains: -### 1. Identify Template +- Trade-offs and choices made (what was chosen over alternatives and why) +- Key assumptions made during drafting +- Interesting or questionable decisions that need user attention +- Areas that might need validation -- Load from `.bmad-2d-phaser-game-dev/templates/*.md` or `.bmad-2d-phaser-game-dev/templates directory` -- Agent-specific templates are listed in agent's dependencies -- If agent has `templates: [prd-tmpl, architecture-tmpl]` for example, then offer to create "PRD" and "Architecture" documents +## Elicitation Results Flow -### 2. Ask Interaction Mode +After user selects elicitation method (2-9): -> 1. **Incremental** - Section by section with reviews -> 2. **YOLO Mode** - Complete draft then review (user can type `/yolo` anytime to switch) +1. Execute method from data/elicitation-methods +2. Present results with insights +3. Offer options: + - **1. Apply changes and update section** + - **2. Return to elicitation menu** + - **3. Ask any questions or engage further with this elicitation** -### 3. Execute Template +## Agent Permissions -- Replace {{placeholders}} with real content -- Execute [[LLM:]] instructions as you encounter them -- Process <> loops and ^^CONDITIONS^^ -- Use @{examples} for guidance but never output them +When processing sections with agent permission fields: -### 4. Key Execution Patterns +- **owner**: Note which agent role initially creates/populates the section +- **editors**: List agent roles allowed to modify the section +- **readonly**: Mark sections that cannot be modified after creation -**When you see:** `[[LLM: Draft X and immediately execute .bmad-2d-phaser-game-dev/tasks/advanced-elicitation.md]]` +**For sections with restricted access:** -- Draft the content -- Present it to user -- IMMEDIATELY execute the task -- Wait for completion before continuing +- Include a note in the generated document indicating the responsible agent +- Example: "_(This section is owned by dev-agent and can only be modified by dev-agent)_" -**When you see:** `[[LLM: After section completion, apply .bmad-2d-phaser-game-dev/tasks/Y.md]]` +## YOLO Mode -- Finish the section -- STOP and execute the task -- Wait for user input +User can type `#yolo` to toggle to YOLO mode (process all sections at once). -### 5. Validation & Final Presentation +## CRITICAL REMINDERS -- Run any specified checklists -- Present clean, formatted content only -- No truncation or summarization -- Begin directly with content (no preamble) -- Include any handoff prompts from template +**❌ NEVER:** -### 6. Update Workflow Plan (if applicable) +- Ask yes/no questions for elicitation +- Use any format other than 1-9 numbered options +- Create new elicitation methods -[[LLM: After successful document creation]] +**✅ ALWAYS:** -- If plan tracking is enabled and document was part of plan: - - Call update-workflow-plan task to mark step complete - - Parameters: task: create-doc, step_id: {from plan}, status: complete - - Show next recommended step from plan - -## Common Mistakes to Avoid - -❌ Skipping elicitation tasks -❌ Showing template markup to users -❌ Continuing past STOP signals -❌ Combining multiple review points - -✅ Execute ALL instructions in sequence -✅ Present only clean, formatted content -✅ Stop at every elicitation point -✅ Wait for user confirmation when instructed - -## Remember - -Templates contain precise instructions for a reason. Follow them exactly to ensure document quality and completeness. +- Use exact 1-9 format when elicit: true +- Select options 2-9 from data/elicitation-methods only +- Provide detailed rationale explaining decisions +- End with "Select 1-9 or just type your question/feedback:" ==================== END: .bmad-2d-phaser-game-dev/tasks/create-doc.md ==================== ==================== START: .bmad-2d-phaser-game-dev/tasks/advanced-elicitation.md ==================== @@ -1417,952 +1392,939 @@ Apply the advanced elicitation task after major sections to refine based on user - The goal is PRACTICAL documentation for AI agents doing real work ==================== END: .bmad-2d-phaser-game-dev/tasks/document-project.md ==================== -==================== START: .bmad-2d-phaser-game-dev/templates/project-brief-tmpl.md ==================== ---- -defaultOutput: docs/brief.md ---- - -# Project Brief: {{Project Name}} - -[[LLM: This template guides creation of a comprehensive Project Brief that serves as the foundational input for product development. - -Start by asking the user which mode they prefer: - -1. **Interactive Mode** - Work through each section collaboratively -2. **YOLO Mode** - Generate complete draft for review and refinement - -Before beginning, understand what inputs are available (brainstorming results, market research, competitive analysis, initial ideas) and gather project context.]] - -## Executive Summary - -[[LLM: Create a concise overview that captures the essence of the project. Include: - -- Product concept in 1-2 sentences -- Primary problem being solved -- Target market identification -- Key value proposition]] - -{{Write executive summary based on information gathered}} - -## Problem Statement - -[[LLM: Articulate the problem with clarity and evidence. Address: - -- Current state and pain points -- Impact of the problem (quantify if possible) -- Why existing solutions fall short -- Urgency and importance of solving this now]] - -{{Detailed problem description with supporting evidence}} - -## Proposed Solution - -[[LLM: Describe the solution approach at a high level. Include: - -- Core concept and approach -- Key differentiators from existing solutions -- Why this solution will succeed where others haven't -- High-level vision for the product]] - -{{Solution description focusing on the "what" and "why", not implementation details}} - -## Target Users - -[[LLM: Define and characterize the intended users with specificity. For each user segment include: - -- Demographic/firmographic profile -- Current behaviors and workflows -- Specific needs and pain points -- Goals they're trying to achieve]] - -### Primary User Segment: {{Segment Name}} - -{{Detailed description of primary users}} - -### Secondary User Segment: {{Segment Name}} - -{{Description of secondary users if applicable}} - -## Goals & Success Metrics - -[[LLM: Establish clear objectives and how to measure success. Make goals SMART (Specific, Measurable, Achievable, Relevant, Time-bound)]] - -### Business Objectives - -- {{Objective 1 with metric}} -- {{Objective 2 with metric}} -- {{Objective 3 with metric}} - -### User Success Metrics - -- {{How users will measure value}} -- {{Engagement metrics}} -- {{Satisfaction indicators}} - -### Key Performance Indicators (KPIs) - -- {{KPI 1: Definition and target}} -- {{KPI 2: Definition and target}} -- {{KPI 3: Definition and target}} - -## MVP Scope - -[[LLM: Define the minimum viable product clearly. Be specific about what's in and what's out. Help user distinguish must-haves from nice-to-haves.]] - -### Core Features (Must Have) - -- **Feature 1:** {{Brief description and why it's essential}} -- **Feature 2:** {{Brief description and why it's essential}} -- **Feature 3:** {{Brief description and why it's essential}} - -### Out of Scope for MVP - -- {{Feature/capability explicitly not in MVP}} -- {{Feature/capability to be considered post-MVP}} - -### MVP Success Criteria - -{{Define what constitutes a successful MVP launch}} - -## Post-MVP Vision - -[[LLM: Outline the longer-term product direction without overcommitting to specifics]] - -### Phase 2 Features - -{{Next priority features after MVP success}} - -### Long-term Vision - -{{Where this product could go in 1-2 years}} - -### Expansion Opportunities - -{{Potential new markets, use cases, or integrations}} - -## Technical Considerations - -[[LLM: Document known technical constraints and preferences. Note these are initial thoughts, not final decisions.]] - -### Platform Requirements - -- **Target Platforms:** {{Web, mobile, desktop, etc.}} -- **Browser/OS Support:** {{Specific requirements}} -- **Performance Requirements:** {{Load times, concurrent users, etc.}} - -### Technology Preferences - -- **Frontend:** {{If any preferences exist}} -- **Backend:** {{If any preferences exist}} -- **Database:** {{If any preferences exist}} -- **Hosting/Infrastructure:** {{Cloud preferences, on-prem requirements}} - -### Architecture Considerations - -- **Repository Structure:** {{Initial thoughts on monorepo vs. polyrepo}} -- **Service Architecture:** {{Initial thoughts on monolith vs. microservices}} -- **Integration Requirements:** {{Third-party services, APIs}} -- **Security/Compliance:** {{Any specific requirements}} - -## Constraints & Assumptions - -[[LLM: Clearly state limitations and assumptions to set realistic expectations]] - -### Constraints - -- **Budget:** {{If known}} -- **Timeline:** {{Target launch date or development timeframe}} -- **Resources:** {{Team size, skill constraints}} -- **Technical:** {{Legacy systems, required tech stack}} - -### Key Assumptions - -- {{Assumption about users, market, or technology}} -- {{Assumption about resources or support}} -- {{Assumption about external dependencies}} - -## Risks & Open Questions - -[[LLM: Identify unknowns and potential challenges proactively]] - -### Key Risks - -- **Risk 1:** {{Description and potential impact}} -- **Risk 2:** {{Description and potential impact}} -- **Risk 3:** {{Description and potential impact}} - -### Open Questions - -- {{Question needing research or decision}} -- {{Question about technical approach}} -- {{Question about market or users}} - -### Areas Needing Further Research - -- {{Topic requiring deeper investigation}} -- {{Validation needed before proceeding}} - -## Appendices - -### A. Research Summary - -{{If applicable, summarize key findings from: - -- Market research -- Competitive analysis -- User interviews -- Technical feasibility studies}} - -### B. Stakeholder Input - -{{Key feedback or requirements from stakeholders}} - -### C. References - -{{Links to relevant documents, research, or examples}} - -## Next Steps - -### Immediate Actions - -1. {{First concrete next step}} -2. {{Second concrete next step}} -3. {{Third concrete next step}} - -### PM Handoff - -This Project Brief provides the full context for {{Project Name}}. Please start in 'PRD Generation Mode', review the brief thoroughly to work with the user to create the PRD section by section as the template indicates, asking for any necessary clarification or suggesting improvements. - ---- - -[[LLM: After completing each major section (not subsections), offer advanced elicitation with these custom options for project briefs: - -**Project Brief Elicitation Actions** 0. Expand section with more specific details - -1. Validate against similar successful products -2. Stress test assumptions with edge cases -3. Explore alternative solution approaches -4. Analyze resource/constraint trade-offs -5. Generate risk mitigation strategies -6. Challenge scope from MVP minimalist view -7. Brainstorm creative feature possibilities -8. If only we had [resource/capability/time]... -9. Proceed to next section - -These replace the standard elicitation options when working on project brief documents.]] -==================== END: .bmad-2d-phaser-game-dev/templates/project-brief-tmpl.md ==================== - -==================== START: .bmad-2d-phaser-game-dev/templates/market-research-tmpl.md ==================== -# Market Research Report: {{Project/Product Name}} - -[[LLM: The default path and filename unless specified is docs/market-research.md]] - -[[LLM: This template guides the creation of a comprehensive market research report. Begin by understanding what market insights the user needs and why. Work through each section systematically, using the appropriate analytical frameworks based on the research objectives.]] - -## Executive Summary - -{{Provide a high-level overview of key findings, market opportunity assessment, and strategic recommendations. Write this section LAST after completing all other sections.}} - -## Research Objectives & Methodology - -### Research Objectives - -{{List the primary objectives of this market research: - -- What decisions will this research inform? -- What specific questions need to be answered? -- What are the success criteria for this research?}} - -### Research Methodology - -{{Describe the research approach: - -- Data sources used (primary/secondary) -- Analysis frameworks applied -- Data collection timeframe -- Limitations and assumptions}} - -## Market Overview - -### Market Definition - -{{Define the market being analyzed: - -- Product/service category -- Geographic scope -- Customer segments included -- Value chain position}} - -### Market Size & Growth - -[[LLM: Guide through TAM, SAM, SOM calculations with clear assumptions. Use one or more approaches: - -- Top-down: Start with industry data, narrow down -- Bottom-up: Build from customer/unit economics -- Value theory: Based on value provided vs. alternatives]] - -#### Total Addressable Market (TAM) - -{{Calculate and explain the total market opportunity}} - -#### Serviceable Addressable Market (SAM) - -{{Define the portion of TAM you can realistically reach}} - -#### Serviceable Obtainable Market (SOM) - -{{Estimate the portion you can realistically capture}} - -### Market Trends & Drivers - -[[LLM: Analyze key trends shaping the market using appropriate frameworks like PESTEL]] - -#### Key Market Trends - -{{List and explain 3-5 major trends: - -- Trend 1: Description and impact -- Trend 2: Description and impact -- etc.}} - -#### Growth Drivers - -{{Identify primary factors driving market growth}} - -#### Market Inhibitors - -{{Identify factors constraining market growth}} - -## Customer Analysis - -### Target Segment Profiles - -[[LLM: For each segment, create detailed profiles including demographics/firmographics, psychographics, behaviors, needs, and willingness to pay]] - -#### Segment 1: {{Segment Name}} - -- **Description:** {{Brief overview}} -- **Size:** {{Number of customers/market value}} -- **Characteristics:** {{Key demographics/firmographics}} -- **Needs & Pain Points:** {{Primary problems they face}} -- **Buying Process:** {{How they make purchasing decisions}} -- **Willingness to Pay:** {{Price sensitivity and value perception}} - -<> - -### Jobs-to-be-Done Analysis - -[[LLM: Uncover what customers are really trying to accomplish]] - -#### Functional Jobs - -{{List practical tasks and objectives customers need to complete}} - -#### Emotional Jobs - -{{Describe feelings and perceptions customers seek}} - -#### Social Jobs - -{{Explain how customers want to be perceived by others}} - -### Customer Journey Mapping - -[[LLM: Map the end-to-end customer experience for primary segments]] - -{{For primary customer segment: - -1. **Awareness:** How they discover solutions -2. **Consideration:** Evaluation criteria and process -3. **Purchase:** Decision triggers and barriers -4. **Onboarding:** Initial experience expectations -5. **Usage:** Ongoing interaction patterns -6. **Advocacy:** Referral and expansion behaviors}} - -## Competitive Landscape - -### Market Structure - -{{Describe the overall competitive environment: - -- Number of competitors -- Market concentration -- Competitive intensity}} - -### Major Players Analysis - -{{For top 3-5 competitors: - -- Company name and brief description -- Market share estimate -- Key strengths and weaknesses -- Target customer focus -- Pricing strategy}} - -### Competitive Positioning - -{{Analyze how competitors are positioned: - -- Value propositions -- Differentiation strategies -- Market gaps and opportunities}} - -## Industry Analysis - -### Porter's Five Forces Assessment - -[[LLM: Analyze each force with specific evidence and implications]] - -#### Supplier Power: {{Low/Medium/High}} - -{{Analysis and implications}} - -#### Buyer Power: {{Low/Medium/High}} - -{{Analysis and implications}} - -#### Competitive Rivalry: {{Low/Medium/High}} - -{{Analysis and implications}} - -#### Threat of New Entry: {{Low/Medium/High}} - -{{Analysis and implications}} - -#### Threat of Substitutes: {{Low/Medium/High}} - -{{Analysis and implications}} - -### Technology Adoption Lifecycle Stage - -{{Identify where the market is in the adoption curve: - -- Current stage and evidence -- Implications for strategy -- Expected progression timeline}} - -## Opportunity Assessment - -### Market Opportunities - -[[LLM: Identify specific opportunities based on the analysis]] - -#### Opportunity 1: {{Name}} - -- **Description:** {{What is the opportunity?}} -- **Size/Potential:** {{Quantify if possible}} -- **Requirements:** {{What's needed to capture it?}} -- **Risks:** {{Key challenges or barriers}} - -<> - -### Strategic Recommendations - -#### Go-to-Market Strategy - -{{Recommend approach for market entry/expansion: - -- Target segment prioritization -- Positioning strategy -- Channel strategy -- Partnership opportunities}} - -#### Pricing Strategy - -{{Based on willingness to pay analysis and competitive landscape: - -- Recommended pricing model -- Price points/ranges -- Value metric -- Competitive positioning}} - -#### Risk Mitigation - -{{Key risks and mitigation strategies: - -- Market risks -- Competitive risks -- Execution risks -- Regulatory/compliance risks}} - -## Appendices - -### A. Data Sources - -{{List all sources used in the research}} - -### B. Detailed Calculations - -{{Include any complex calculations or models}} - -### C. Additional Analysis - -{{Any supplementary analysis not included in main body}} - ---- - -[[LLM: After completing the document, offer advanced elicitation with these custom options for market research: - -**Market Research Elicitation Actions** 0. Expand market sizing calculations with sensitivity analysis - -1. Deep dive into a specific customer segment -2. Analyze an emerging market trend in detail -3. Compare this market to an analogous market -4. Stress test market assumptions -5. Explore adjacent market opportunities -6. Challenge market definition and boundaries -7. Generate strategic scenarios (best/base/worst case) -8. If only we had considered [X market factor]... -9. Proceed to next section - -These replace the standard elicitation options when working on market research documents.]] -==================== END: .bmad-2d-phaser-game-dev/templates/market-research-tmpl.md ==================== - -==================== START: .bmad-2d-phaser-game-dev/templates/competitor-analysis-tmpl.md ==================== -# Competitive Analysis Report: {{Project/Product Name}} - -[[LLM: The default path and filename unless specified is docs/competitor-analysis.md]] - -[[LLM: This template guides comprehensive competitor analysis. Start by understanding the user's competitive intelligence needs and strategic objectives. Help them identify and prioritize competitors before diving into detailed analysis.]] - -## Executive Summary - -{{Provide high-level competitive insights, main threats and opportunities, and recommended strategic actions. Write this section LAST after completing all analysis.}} - -## Analysis Scope & Methodology - -### Analysis Purpose - -{{Define the primary purpose: - -- New market entry assessment -- Product positioning strategy -- Feature gap analysis -- Pricing strategy development -- Partnership/acquisition targets -- Competitive threat assessment}} - -### Competitor Categories Analyzed - -{{List categories included: - -- Direct Competitors: Same product/service, same target market -- Indirect Competitors: Different product, same need/problem -- Potential Competitors: Could enter market easily -- Substitute Products: Alternative solutions -- Aspirational Competitors: Best-in-class examples}} - -### Research Methodology - -{{Describe approach: - -- Information sources used -- Analysis timeframe -- Confidence levels -- Limitations}} - -## Competitive Landscape Overview - -### Market Structure - -{{Describe the competitive environment: - -- Number of active competitors -- Market concentration (fragmented/consolidated) -- Competitive dynamics -- Recent market entries/exits}} - -### Competitor Prioritization Matrix - -[[LLM: Help categorize competitors by market share and strategic threat level]] - -{{Create a 2x2 matrix: - -- Priority 1 (Core Competitors): High Market Share + High Threat -- Priority 2 (Emerging Threats): Low Market Share + High Threat -- Priority 3 (Established Players): High Market Share + Low Threat -- Priority 4 (Monitor Only): Low Market Share + Low Threat}} - -## Individual Competitor Profiles - -[[LLM: Create detailed profiles for each Priority 1 and Priority 2 competitor. For Priority 3 and 4, create condensed profiles.]] - -### {{Competitor Name}} - Priority {{1/2/3/4}} - -#### Company Overview - -- **Founded:** {{Year, founders}} -- **Headquarters:** {{Location}} -- **Company Size:** {{Employees, revenue if known}} -- **Funding:** {{Total raised, key investors}} -- **Leadership:** {{Key executives}} - -#### Business Model & Strategy - -- **Revenue Model:** {{How they make money}} -- **Target Market:** {{Primary customer segments}} -- **Value Proposition:** {{Core value promise}} -- **Go-to-Market Strategy:** {{Sales and marketing approach}} -- **Strategic Focus:** {{Current priorities}} - -#### Product/Service Analysis - -- **Core Offerings:** {{Main products/services}} -- **Key Features:** {{Standout capabilities}} -- **User Experience:** {{UX strengths/weaknesses}} -- **Technology Stack:** {{If relevant/known}} -- **Pricing:** {{Model and price points}} - -#### Strengths & Weaknesses - -**Strengths:** - -- {{Strength 1}} -- {{Strength 2}} -- {{Strength 3}} - -**Weaknesses:** - -- {{Weakness 1}} -- {{Weakness 2}} -- {{Weakness 3}} - -#### Market Position & Performance - -- **Market Share:** {{Estimate if available}} -- **Customer Base:** {{Size, notable clients}} -- **Growth Trajectory:** {{Trending up/down/stable}} -- **Recent Developments:** {{Key news, releases}} - -<> - -## Comparative Analysis - -### Feature Comparison Matrix - -[[LLM: Create a detailed comparison table of key features across competitors]] - -| Feature Category | {{Your Company}} | {{Competitor 1}} | {{Competitor 2}} | {{Competitor 3}} | -| --------------------------- | ------------------- | ------------------- | ------------------- | ------------------- | -| **Core Functionality** | -| Feature A | {{✓/✗/Partial}} | {{✓/✗/Partial}} | {{✓/✗/Partial}} | {{✓/✗/Partial}} | -| Feature B | {{✓/✗/Partial}} | {{✓/✗/Partial}} | {{✓/✗/Partial}} | {{✓/✗/Partial}} | -| **User Experience** | -| Mobile App | {{Rating/Status}} | {{Rating/Status}} | {{Rating/Status}} | {{Rating/Status}} | -| Onboarding Time | {{Time}} | {{Time}} | {{Time}} | {{Time}} | -| **Integration & Ecosystem** | -| API Availability | {{Yes/No/Limited}} | {{Yes/No/Limited}} | {{Yes/No/Limited}} | {{Yes/No/Limited}} | -| Third-party Integrations | {{Number/Key ones}} | {{Number/Key ones}} | {{Number/Key ones}} | {{Number/Key ones}} | -| **Pricing & Plans** | -| Starting Price | {{$X}} | {{$X}} | {{$X}} | {{$X}} | -| Free Tier | {{Yes/No}} | {{Yes/No}} | {{Yes/No}} | {{Yes/No}} | - -### SWOT Comparison - -[[LLM: Create SWOT analysis for your solution vs. top competitors]] - -#### Your Solution - -- **Strengths:** {{List key strengths}} -- **Weaknesses:** {{List key weaknesses}} -- **Opportunities:** {{List opportunities}} -- **Threats:** {{List threats}} - -#### vs. {{Main Competitor}} - -- **Competitive Advantages:** {{Where you're stronger}} -- **Competitive Disadvantages:** {{Where they're stronger}} -- **Differentiation Opportunities:** {{How to stand out}} - -### Positioning Map - -[[LLM: Describe competitor positions on key dimensions]] - -{{Create a positioning description using 2 key dimensions relevant to the market, such as: - -- Price vs. Features -- Ease of Use vs. Power -- Specialization vs. Breadth -- Self-Serve vs. High-Touch}} - -## Strategic Analysis - -### Competitive Advantages Assessment - -#### Sustainable Advantages - -{{Identify moats and defensible positions: - -- Network effects -- Switching costs -- Brand strength -- Technology barriers -- Regulatory advantages}} - -#### Vulnerable Points - -{{Where competitors could be challenged: - -- Weak customer segments -- Missing features -- Poor user experience -- High prices -- Limited geographic presence}} - -### Blue Ocean Opportunities - -[[LLM: Identify uncontested market spaces]] - -{{List opportunities to create new market space: - -- Underserved segments -- Unaddressed use cases -- New business models -- Geographic expansion -- Different value propositions}} - -## Strategic Recommendations - -### Differentiation Strategy - -{{How to position against competitors: - -- Unique value propositions to emphasize -- Features to prioritize -- Segments to target -- Messaging and positioning}} - -### Competitive Response Planning - -#### Offensive Strategies - -{{How to gain market share: - -- Target competitor weaknesses -- Win competitive deals -- Capture their customers}} - -#### Defensive Strategies - -{{How to protect your position: - -- Strengthen vulnerable areas -- Build switching costs -- Deepen customer relationships}} - -### Partnership & Ecosystem Strategy - -{{Potential collaboration opportunities: - -- Complementary players -- Channel partners -- Technology integrations -- Strategic alliances}} - -## Monitoring & Intelligence Plan - -### Key Competitors to Track - -{{Priority list with rationale}} - -### Monitoring Metrics - -{{What to track: - -- Product updates -- Pricing changes -- Customer wins/losses -- Funding/M&A activity -- Market messaging}} - -### Intelligence Sources - -{{Where to gather ongoing intelligence: - -- Company websites/blogs -- Customer reviews -- Industry reports -- Social media -- Patent filings}} - -### Update Cadence - -{{Recommended review schedule: - -- Weekly: {{What to check}} -- Monthly: {{What to review}} -- Quarterly: {{Deep analysis}}}} - ---- - -[[LLM: After completing the document, offer advanced elicitation with these custom options for competitive analysis: - -**Competitive Analysis Elicitation Actions** 0. Deep dive on a specific competitor's strategy - -1. Analyze competitive dynamics in a specific segment -2. War game competitive responses to your moves -3. Explore partnership vs. competition scenarios -4. Stress test differentiation claims -5. Analyze disruption potential (yours or theirs) -6. Compare to competition in adjacent markets -7. Generate win/loss analysis insights -8. If only we had known about [competitor X's plan]... -9. Proceed to next section - -These replace the standard elicitation options when working on competitive analysis documents.]] -==================== END: .bmad-2d-phaser-game-dev/templates/competitor-analysis-tmpl.md ==================== - -==================== START: .bmad-2d-phaser-game-dev/templates/brainstorming-output-tmpl.md ==================== ---- -defaultOutput: docs/brainstorming-session-results.md ---- - -# Brainstorming Session Results - -**Session Date:** [DATE] -**Facilitator:** [Agent Role] [Agent Name] -**Participant:** [USER NAME] - -## Executive Summary - -**Topic:** [SESSION TOPIC] - -**Session Goals:** [STATED GOALS] - -**Techniques Used:** [LIST OF TECHNIQUES AND DURATION] - -**Total Ideas Generated:** [NUMBER] - -**Key Themes Identified:** - -- [THEME 1] -- [THEME 2] -- [THEME 3] - ---- - -## Technique Sessions - -### [TECHNIQUE NAME 1] - [DURATION] - -**Description:** [BRIEF DESCRIPTION OF TECHNIQUE] - -**Ideas Generated:** - -1. [USER IDEA 1] -2. [USER IDEA 2] -3. [USER IDEA 3] -[etc.] - -**Insights Discovered:** - -- [INSIGHT 1] -- [INSIGHT 2] - -**Notable Connections:** - -- [CONNECTION OR PATTERN IDENTIFIED] - ---- - -### [TECHNIQUE NAME 2] - [DURATION] - -[Repeat format for each technique used] - ---- - -## Idea Categorization - -### Immediate Opportunities - -*Ideas ready to implement now* - -1. **[IDEA NAME]** - - Description: [BRIEF DESCRIPTION] - - Why immediate: [RATIONALE] - - Resources needed: [BASIC REQUIREMENTS] - -### Future Innovations - -*Ideas requiring development/research* - -1. **[IDEA NAME]** - - Description: [BRIEF DESCRIPTION] - - Development needed: [WHAT'S REQUIRED] - - Timeline estimate: [ROUGH TIMEFRAME] - -### Moonshots - -*Ambitious, transformative concepts* - -1. **[IDEA NAME]** - - Description: [BRIEF DESCRIPTION] - - Transformative potential: [WHY IT'S A MOONSHOT] - - Challenges to overcome: [MAJOR OBSTACLES] - -### Insights & Learnings - -*Key realizations from the session* - -- [INSIGHT 1]: [DESCRIPTION AND IMPLICATIONS] -- [INSIGHT 2]: [DESCRIPTION AND IMPLICATIONS] - ---- - -## Action Planning - -### Top 3 Priority Ideas - -**#1 Priority: [IDEA NAME]** - -- Rationale: [WHY THIS IS TOP PRIORITY] -- Next steps: [SPECIFIC ACTIONS TO TAKE] -- Resources needed: [WHAT'S REQUIRED] -- Timeline: [WHEN TO START/COMPLETE] - -**#2 Priority: [IDEA NAME]** - -- [Same format] - -**#3 Priority: [IDEA NAME]** - -- [Same format] - ---- - -## Reflection & Follow-up - -### What Worked Well - -- [SUCCESSFUL ASPECT 1] -- [SUCCESSFUL ASPECT 2] - -### Areas for Further Exploration - -- [AREA 1]: [WHY IT NEEDS MORE EXPLORATION] -- [AREA 2]: [WHY IT NEEDS MORE EXPLORATION] - -### Recommended Follow-up Techniques - -- [TECHNIQUE 1]: [WHY IT WOULD BE HELPFUL] -- [TECHNIQUE 2]: [WHY IT WOULD BE HELPFUL] - -### Questions That Emerged - -- [QUESTION 1] -- [QUESTION 2] -- [QUESTION 3] - -### Next Session Planning - -- **Suggested topics:** [FOLLOW-UP TOPICS] -- **Recommended timeframe:** [WHEN TO RECONVENE] -- **Preparation needed:** [WHAT TO RESEARCH/PREPARE] - ---- - -*Session facilitated using the BMAD-METHOD brainstorming framework* -==================== END: .bmad-2d-phaser-game-dev/templates/brainstorming-output-tmpl.md ==================== +==================== START: .bmad-2d-phaser-game-dev/templates/project-brief-tmpl.yaml ==================== +template: + id: project-brief-template-v2 + name: Project Brief + version: 2.0 + output: + format: markdown + filename: docs/brief.md + title: "Project Brief: {{project_name}}" + +workflow: + mode: interactive + elicitation: advanced-elicitation + custom_elicitation: + title: "Project Brief Elicitation Actions" + options: + - "Expand section with more specific details" + - "Validate against similar successful products" + - "Stress test assumptions with edge cases" + - "Explore alternative solution approaches" + - "Analyze resource/constraint trade-offs" + - "Generate risk mitigation strategies" + - "Challenge scope from MVP minimalist view" + - "Brainstorm creative feature possibilities" + - "If only we had [resource/capability/time]..." + - "Proceed to next section" + +sections: + - id: introduction + instruction: | + This template guides creation of a comprehensive Project Brief that serves as the foundational input for product development. + + Start by asking the user which mode they prefer: + + 1. **Interactive Mode** - Work through each section collaboratively + 2. **YOLO Mode** - Generate complete draft for review and refinement + + Before beginning, understand what inputs are available (brainstorming results, market research, competitive analysis, initial ideas) and gather project context. + + - id: executive-summary + title: Executive Summary + instruction: | + Create a concise overview that captures the essence of the project. Include: + - Product concept in 1-2 sentences + - Primary problem being solved + - Target market identification + - Key value proposition + template: "{{executive_summary_content}}" + + - id: problem-statement + title: Problem Statement + instruction: | + Articulate the problem with clarity and evidence. Address: + - Current state and pain points + - Impact of the problem (quantify if possible) + - Why existing solutions fall short + - Urgency and importance of solving this now + template: "{{detailed_problem_description}}" + + - id: proposed-solution + title: Proposed Solution + instruction: | + Describe the solution approach at a high level. Include: + - Core concept and approach + - Key differentiators from existing solutions + - Why this solution will succeed where others haven't + - High-level vision for the product + template: "{{solution_description}}" + + - id: target-users + title: Target Users + instruction: | + Define and characterize the intended users with specificity. For each user segment include: + - Demographic/firmographic profile + - Current behaviors and workflows + - Specific needs and pain points + - Goals they're trying to achieve + sections: + - id: primary-segment + title: "Primary User Segment: {{segment_name}}" + template: "{{primary_user_description}}" + - id: secondary-segment + title: "Secondary User Segment: {{segment_name}}" + condition: Has secondary user segment + template: "{{secondary_user_description}}" + + - id: goals-metrics + title: Goals & Success Metrics + instruction: Establish clear objectives and how to measure success. Make goals SMART (Specific, Measurable, Achievable, Relevant, Time-bound) + sections: + - id: business-objectives + title: Business Objectives + type: bullet-list + template: "- {{objective_with_metric}}" + - id: user-success-metrics + title: User Success Metrics + type: bullet-list + template: "- {{user_metric}}" + - id: kpis + title: Key Performance Indicators (KPIs) + type: bullet-list + template: "- {{kpi}}: {{definition_and_target}}" + + - id: mvp-scope + title: MVP Scope + instruction: Define the minimum viable product clearly. Be specific about what's in and what's out. Help user distinguish must-haves from nice-to-haves. + sections: + - id: core-features + title: Core Features (Must Have) + type: bullet-list + template: "- **{{feature}}:** {{description_and_rationale}}" + - id: out-of-scope + title: Out of Scope for MVP + type: bullet-list + template: "- {{feature_or_capability}}" + - id: mvp-success-criteria + title: MVP Success Criteria + template: "{{mvp_success_definition}}" + + - id: post-mvp-vision + title: Post-MVP Vision + instruction: Outline the longer-term product direction without overcommitting to specifics + sections: + - id: phase-2-features + title: Phase 2 Features + template: "{{next_priority_features}}" + - id: long-term-vision + title: Long-term Vision + template: "{{one_two_year_vision}}" + - id: expansion-opportunities + title: Expansion Opportunities + template: "{{potential_expansions}}" + + - id: technical-considerations + title: Technical Considerations + instruction: Document known technical constraints and preferences. Note these are initial thoughts, not final decisions. + sections: + - id: platform-requirements + title: Platform Requirements + template: | + - **Target Platforms:** {{platforms}} + - **Browser/OS Support:** {{specific_requirements}} + - **Performance Requirements:** {{performance_specs}} + - id: technology-preferences + title: Technology Preferences + template: | + - **Frontend:** {{frontend_preferences}} + - **Backend:** {{backend_preferences}} + - **Database:** {{database_preferences}} + - **Hosting/Infrastructure:** {{infrastructure_preferences}} + - id: architecture-considerations + title: Architecture Considerations + template: | + - **Repository Structure:** {{repo_thoughts}} + - **Service Architecture:** {{service_thoughts}} + - **Integration Requirements:** {{integration_needs}} + - **Security/Compliance:** {{security_requirements}} + + - id: constraints-assumptions + title: Constraints & Assumptions + instruction: Clearly state limitations and assumptions to set realistic expectations + sections: + - id: constraints + title: Constraints + template: | + - **Budget:** {{budget_info}} + - **Timeline:** {{timeline_info}} + - **Resources:** {{resource_info}} + - **Technical:** {{technical_constraints}} + - id: key-assumptions + title: Key Assumptions + type: bullet-list + template: "- {{assumption}}" + + - id: risks-questions + title: Risks & Open Questions + instruction: Identify unknowns and potential challenges proactively + sections: + - id: key-risks + title: Key Risks + type: bullet-list + template: "- **{{risk}}:** {{description_and_impact}}" + - id: open-questions + title: Open Questions + type: bullet-list + template: "- {{question}}" + - id: research-areas + title: Areas Needing Further Research + type: bullet-list + template: "- {{research_topic}}" + + - id: appendices + title: Appendices + sections: + - id: research-summary + title: A. Research Summary + condition: Has research findings + instruction: | + If applicable, summarize key findings from: + - Market research + - Competitive analysis + - User interviews + - Technical feasibility studies + - id: stakeholder-input + title: B. Stakeholder Input + condition: Has stakeholder feedback + template: "{{stakeholder_feedback}}" + - id: references + title: C. References + template: "{{relevant_links_and_docs}}" + + - id: next-steps + title: Next Steps + sections: + - id: immediate-actions + title: Immediate Actions + type: numbered-list + template: "{{action_item}}" + - id: pm-handoff + title: PM Handoff + content: | + This Project Brief provides the full context for {{project_name}}. Please start in 'PRD Generation Mode', review the brief thoroughly to work with the user to create the PRD section by section as the template indicates, asking for any necessary clarification or suggesting improvements. +==================== END: .bmad-2d-phaser-game-dev/templates/project-brief-tmpl.yaml ==================== + +==================== START: .bmad-2d-phaser-game-dev/templates/market-research-tmpl.yaml ==================== +template: + id: market-research-template-v2 + name: Market Research Report + version: 2.0 + output: + format: markdown + filename: docs/market-research.md + title: "Market Research Report: {{project_product_name}}" + +workflow: + mode: interactive + elicitation: advanced-elicitation + custom_elicitation: + title: "Market Research Elicitation Actions" + options: + - "Expand market sizing calculations with sensitivity analysis" + - "Deep dive into a specific customer segment" + - "Analyze an emerging market trend in detail" + - "Compare this market to an analogous market" + - "Stress test market assumptions" + - "Explore adjacent market opportunities" + - "Challenge market definition and boundaries" + - "Generate strategic scenarios (best/base/worst case)" + - "If only we had considered [X market factor]..." + - "Proceed to next section" + +sections: + - id: executive-summary + title: Executive Summary + instruction: Provide a high-level overview of key findings, market opportunity assessment, and strategic recommendations. Write this section LAST after completing all other sections. + + - id: research-objectives + title: Research Objectives & Methodology + instruction: This template guides the creation of a comprehensive market research report. Begin by understanding what market insights the user needs and why. Work through each section systematically, using the appropriate analytical frameworks based on the research objectives. + sections: + - id: objectives + title: Research Objectives + instruction: | + List the primary objectives of this market research: + - What decisions will this research inform? + - What specific questions need to be answered? + - What are the success criteria for this research? + - id: methodology + title: Research Methodology + instruction: | + Describe the research approach: + - Data sources used (primary/secondary) + - Analysis frameworks applied + - Data collection timeframe + - Limitations and assumptions + + - id: market-overview + title: Market Overview + sections: + - id: market-definition + title: Market Definition + instruction: | + Define the market being analyzed: + - Product/service category + - Geographic scope + - Customer segments included + - Value chain position + - id: market-size-growth + title: Market Size & Growth + instruction: | + Guide through TAM, SAM, SOM calculations with clear assumptions. Use one or more approaches: + - Top-down: Start with industry data, narrow down + - Bottom-up: Build from customer/unit economics + - Value theory: Based on value provided vs. alternatives + sections: + - id: tam + title: Total Addressable Market (TAM) + instruction: Calculate and explain the total market opportunity + - id: sam + title: Serviceable Addressable Market (SAM) + instruction: Define the portion of TAM you can realistically reach + - id: som + title: Serviceable Obtainable Market (SOM) + instruction: Estimate the portion you can realistically capture + - id: market-trends + title: Market Trends & Drivers + instruction: Analyze key trends shaping the market using appropriate frameworks like PESTEL + sections: + - id: key-trends + title: Key Market Trends + instruction: | + List and explain 3-5 major trends: + - Trend 1: Description and impact + - Trend 2: Description and impact + - etc. + - id: growth-drivers + title: Growth Drivers + instruction: Identify primary factors driving market growth + - id: market-inhibitors + title: Market Inhibitors + instruction: Identify factors constraining market growth + + - id: customer-analysis + title: Customer Analysis + sections: + - id: segment-profiles + title: Target Segment Profiles + instruction: For each segment, create detailed profiles including demographics/firmographics, psychographics, behaviors, needs, and willingness to pay + repeatable: true + sections: + - id: segment + title: "Segment {{segment_number}}: {{segment_name}}" + template: | + - **Description:** {{brief_overview}} + - **Size:** {{number_of_customers_market_value}} + - **Characteristics:** {{key_demographics_firmographics}} + - **Needs & Pain Points:** {{primary_problems}} + - **Buying Process:** {{purchasing_decisions}} + - **Willingness to Pay:** {{price_sensitivity}} + - id: jobs-to-be-done + title: Jobs-to-be-Done Analysis + instruction: Uncover what customers are really trying to accomplish + sections: + - id: functional-jobs + title: Functional Jobs + instruction: List practical tasks and objectives customers need to complete + - id: emotional-jobs + title: Emotional Jobs + instruction: Describe feelings and perceptions customers seek + - id: social-jobs + title: Social Jobs + instruction: Explain how customers want to be perceived by others + - id: customer-journey + title: Customer Journey Mapping + instruction: Map the end-to-end customer experience for primary segments + template: | + For primary customer segment: + + 1. **Awareness:** {{discovery_process}} + 2. **Consideration:** {{evaluation_criteria}} + 3. **Purchase:** {{decision_triggers}} + 4. **Onboarding:** {{initial_expectations}} + 5. **Usage:** {{interaction_patterns}} + 6. **Advocacy:** {{referral_behaviors}} + + - id: competitive-landscape + title: Competitive Landscape + sections: + - id: market-structure + title: Market Structure + instruction: | + Describe the overall competitive environment: + - Number of competitors + - Market concentration + - Competitive intensity + - id: major-players + title: Major Players Analysis + instruction: | + For top 3-5 competitors: + - Company name and brief description + - Market share estimate + - Key strengths and weaknesses + - Target customer focus + - Pricing strategy + - id: competitive-positioning + title: Competitive Positioning + instruction: | + Analyze how competitors are positioned: + - Value propositions + - Differentiation strategies + - Market gaps and opportunities + + - id: industry-analysis + title: Industry Analysis + sections: + - id: porters-five-forces + title: Porter's Five Forces Assessment + instruction: Analyze each force with specific evidence and implications + sections: + - id: supplier-power + title: "Supplier Power: {{power_level}}" + template: "{{analysis_and_implications}}" + - id: buyer-power + title: "Buyer Power: {{power_level}}" + template: "{{analysis_and_implications}}" + - id: competitive-rivalry + title: "Competitive Rivalry: {{intensity_level}}" + template: "{{analysis_and_implications}}" + - id: threat-new-entry + title: "Threat of New Entry: {{threat_level}}" + template: "{{analysis_and_implications}}" + - id: threat-substitutes + title: "Threat of Substitutes: {{threat_level}}" + template: "{{analysis_and_implications}}" + - id: adoption-lifecycle + title: Technology Adoption Lifecycle Stage + instruction: | + Identify where the market is in the adoption curve: + - Current stage and evidence + - Implications for strategy + - Expected progression timeline + + - id: opportunity-assessment + title: Opportunity Assessment + sections: + - id: market-opportunities + title: Market Opportunities + instruction: Identify specific opportunities based on the analysis + repeatable: true + sections: + - id: opportunity + title: "Opportunity {{opportunity_number}}: {{name}}" + template: | + - **Description:** {{what_is_the_opportunity}} + - **Size/Potential:** {{quantified_potential}} + - **Requirements:** {{needed_to_capture}} + - **Risks:** {{key_challenges}} + - id: strategic-recommendations + title: Strategic Recommendations + sections: + - id: go-to-market + title: Go-to-Market Strategy + instruction: | + Recommend approach for market entry/expansion: + - Target segment prioritization + - Positioning strategy + - Channel strategy + - Partnership opportunities + - id: pricing-strategy + title: Pricing Strategy + instruction: | + Based on willingness to pay analysis and competitive landscape: + - Recommended pricing model + - Price points/ranges + - Value metric + - Competitive positioning + - id: risk-mitigation + title: Risk Mitigation + instruction: | + Key risks and mitigation strategies: + - Market risks + - Competitive risks + - Execution risks + - Regulatory/compliance risks + + - id: appendices + title: Appendices + sections: + - id: data-sources + title: A. Data Sources + instruction: List all sources used in the research + - id: calculations + title: B. Detailed Calculations + instruction: Include any complex calculations or models + - id: additional-analysis + title: C. Additional Analysis + instruction: Any supplementary analysis not included in main body +==================== END: .bmad-2d-phaser-game-dev/templates/market-research-tmpl.yaml ==================== + +==================== START: .bmad-2d-phaser-game-dev/templates/competitor-analysis-tmpl.yaml ==================== +template: + id: competitor-analysis-template-v2 + name: Competitive Analysis Report + version: 2.0 + output: + format: markdown + filename: docs/competitor-analysis.md + title: "Competitive Analysis Report: {{project_product_name}}" + +workflow: + mode: interactive + elicitation: advanced-elicitation + custom_elicitation: + title: "Competitive Analysis Elicitation Actions" + options: + - "Deep dive on a specific competitor's strategy" + - "Analyze competitive dynamics in a specific segment" + - "War game competitive responses to your moves" + - "Explore partnership vs. competition scenarios" + - "Stress test differentiation claims" + - "Analyze disruption potential (yours or theirs)" + - "Compare to competition in adjacent markets" + - "Generate win/loss analysis insights" + - "If only we had known about [competitor X's plan]..." + - "Proceed to next section" + +sections: + - id: executive-summary + title: Executive Summary + instruction: Provide high-level competitive insights, main threats and opportunities, and recommended strategic actions. Write this section LAST after completing all analysis. + + - id: analysis-scope + title: Analysis Scope & Methodology + instruction: This template guides comprehensive competitor analysis. Start by understanding the user's competitive intelligence needs and strategic objectives. Help them identify and prioritize competitors before diving into detailed analysis. + sections: + - id: analysis-purpose + title: Analysis Purpose + instruction: | + Define the primary purpose: + - New market entry assessment + - Product positioning strategy + - Feature gap analysis + - Pricing strategy development + - Partnership/acquisition targets + - Competitive threat assessment + - id: competitor-categories + title: Competitor Categories Analyzed + instruction: | + List categories included: + - Direct Competitors: Same product/service, same target market + - Indirect Competitors: Different product, same need/problem + - Potential Competitors: Could enter market easily + - Substitute Products: Alternative solutions + - Aspirational Competitors: Best-in-class examples + - id: research-methodology + title: Research Methodology + instruction: | + Describe approach: + - Information sources used + - Analysis timeframe + - Confidence levels + - Limitations + + - id: competitive-landscape + title: Competitive Landscape Overview + sections: + - id: market-structure + title: Market Structure + instruction: | + Describe the competitive environment: + - Number of active competitors + - Market concentration (fragmented/consolidated) + - Competitive dynamics + - Recent market entries/exits + - id: prioritization-matrix + title: Competitor Prioritization Matrix + instruction: | + Help categorize competitors by market share and strategic threat level + + Create a 2x2 matrix: + - Priority 1 (Core Competitors): High Market Share + High Threat + - Priority 2 (Emerging Threats): Low Market Share + High Threat + - Priority 3 (Established Players): High Market Share + Low Threat + - Priority 4 (Monitor Only): Low Market Share + Low Threat + + - id: competitor-profiles + title: Individual Competitor Profiles + instruction: Create detailed profiles for each Priority 1 and Priority 2 competitor. For Priority 3 and 4, create condensed profiles. + repeatable: true + sections: + - id: competitor + title: "{{competitor_name}} - Priority {{priority_level}}" + sections: + - id: company-overview + title: Company Overview + template: | + - **Founded:** {{year_founders}} + - **Headquarters:** {{location}} + - **Company Size:** {{employees_revenue}} + - **Funding:** {{total_raised_investors}} + - **Leadership:** {{key_executives}} + - id: business-model + title: Business Model & Strategy + template: | + - **Revenue Model:** {{revenue_model}} + - **Target Market:** {{customer_segments}} + - **Value Proposition:** {{value_promise}} + - **Go-to-Market Strategy:** {{gtm_approach}} + - **Strategic Focus:** {{current_priorities}} + - id: product-analysis + title: Product/Service Analysis + template: | + - **Core Offerings:** {{main_products}} + - **Key Features:** {{standout_capabilities}} + - **User Experience:** {{ux_assessment}} + - **Technology Stack:** {{tech_stack}} + - **Pricing:** {{pricing_model}} + - id: strengths-weaknesses + title: Strengths & Weaknesses + sections: + - id: strengths + title: Strengths + type: bullet-list + template: "- {{strength}}" + - id: weaknesses + title: Weaknesses + type: bullet-list + template: "- {{weakness}}" + - id: market-position + title: Market Position & Performance + template: | + - **Market Share:** {{market_share_estimate}} + - **Customer Base:** {{customer_size_notables}} + - **Growth Trajectory:** {{growth_trend}} + - **Recent Developments:** {{key_news}} + + - id: comparative-analysis + title: Comparative Analysis + sections: + - id: feature-comparison + title: Feature Comparison Matrix + instruction: Create a detailed comparison table of key features across competitors + type: table + columns: ["Feature Category", "{{your_company}}", "{{competitor_1}}", "{{competitor_2}}", "{{competitor_3}}"] + rows: + - category: "Core Functionality" + items: + - ["Feature A", "{{status}}", "{{status}}", "{{status}}", "{{status}}"] + - ["Feature B", "{{status}}", "{{status}}", "{{status}}", "{{status}}"] + - category: "User Experience" + items: + - ["Mobile App", "{{rating}}", "{{rating}}", "{{rating}}", "{{rating}}"] + - ["Onboarding Time", "{{time}}", "{{time}}", "{{time}}", "{{time}}"] + - category: "Integration & Ecosystem" + items: + - ["API Availability", "{{availability}}", "{{availability}}", "{{availability}}", "{{availability}}"] + - ["Third-party Integrations", "{{number}}", "{{number}}", "{{number}}", "{{number}}"] + - category: "Pricing & Plans" + items: + - ["Starting Price", "{{price}}", "{{price}}", "{{price}}", "{{price}}"] + - ["Free Tier", "{{yes_no}}", "{{yes_no}}", "{{yes_no}}", "{{yes_no}}"] + - id: swot-comparison + title: SWOT Comparison + instruction: Create SWOT analysis for your solution vs. top competitors + sections: + - id: your-solution + title: Your Solution + template: | + - **Strengths:** {{strengths}} + - **Weaknesses:** {{weaknesses}} + - **Opportunities:** {{opportunities}} + - **Threats:** {{threats}} + - id: vs-competitor + title: "vs. {{main_competitor}}" + template: | + - **Competitive Advantages:** {{your_advantages}} + - **Competitive Disadvantages:** {{their_advantages}} + - **Differentiation Opportunities:** {{differentiation}} + - id: positioning-map + title: Positioning Map + instruction: | + Describe competitor positions on key dimensions + + Create a positioning description using 2 key dimensions relevant to the market, such as: + - Price vs. Features + - Ease of Use vs. Power + - Specialization vs. Breadth + - Self-Serve vs. High-Touch + + - id: strategic-analysis + title: Strategic Analysis + sections: + - id: competitive-advantages + title: Competitive Advantages Assessment + sections: + - id: sustainable-advantages + title: Sustainable Advantages + instruction: | + Identify moats and defensible positions: + - Network effects + - Switching costs + - Brand strength + - Technology barriers + - Regulatory advantages + - id: vulnerable-points + title: Vulnerable Points + instruction: | + Where competitors could be challenged: + - Weak customer segments + - Missing features + - Poor user experience + - High prices + - Limited geographic presence + - id: blue-ocean + title: Blue Ocean Opportunities + instruction: | + Identify uncontested market spaces + + List opportunities to create new market space: + - Underserved segments + - Unaddressed use cases + - New business models + - Geographic expansion + - Different value propositions + + - id: strategic-recommendations + title: Strategic Recommendations + sections: + - id: differentiation-strategy + title: Differentiation Strategy + instruction: | + How to position against competitors: + - Unique value propositions to emphasize + - Features to prioritize + - Segments to target + - Messaging and positioning + - id: competitive-response + title: Competitive Response Planning + sections: + - id: offensive-strategies + title: Offensive Strategies + instruction: | + How to gain market share: + - Target competitor weaknesses + - Win competitive deals + - Capture their customers + - id: defensive-strategies + title: Defensive Strategies + instruction: | + How to protect your position: + - Strengthen vulnerable areas + - Build switching costs + - Deepen customer relationships + - id: partnership-ecosystem + title: Partnership & Ecosystem Strategy + instruction: | + Potential collaboration opportunities: + - Complementary players + - Channel partners + - Technology integrations + - Strategic alliances + + - id: monitoring-plan + title: Monitoring & Intelligence Plan + sections: + - id: key-competitors + title: Key Competitors to Track + instruction: Priority list with rationale + - id: monitoring-metrics + title: Monitoring Metrics + instruction: | + What to track: + - Product updates + - Pricing changes + - Customer wins/losses + - Funding/M&A activity + - Market messaging + - id: intelligence-sources + title: Intelligence Sources + instruction: | + Where to gather ongoing intelligence: + - Company websites/blogs + - Customer reviews + - Industry reports + - Social media + - Patent filings + - id: update-cadence + title: Update Cadence + instruction: | + Recommended review schedule: + - Weekly: {{weekly_items}} + - Monthly: {{monthly_items}} + - Quarterly: {{quarterly_analysis}} +==================== END: .bmad-2d-phaser-game-dev/templates/competitor-analysis-tmpl.yaml ==================== + +==================== START: .bmad-2d-phaser-game-dev/templates/brainstorming-output-tmpl.yaml ==================== +template: + id: brainstorming-output-template-v2 + name: Brainstorming Session Results + version: 2.0 + output: + format: markdown + filename: docs/brainstorming-session-results.md + title: "Brainstorming Session Results" + +workflow: + mode: non-interactive + +sections: + - id: header + content: | + **Session Date:** {{date}} + **Facilitator:** {{agent_role}} {{agent_name}} + **Participant:** {{user_name}} + + - id: executive-summary + title: Executive Summary + sections: + - id: summary-details + template: | + **Topic:** {{session_topic}} + + **Session Goals:** {{stated_goals}} + + **Techniques Used:** {{techniques_list}} + + **Total Ideas Generated:** {{total_ideas}} + - id: key-themes + title: "Key Themes Identified:" + type: bullet-list + template: "- {{theme}}" + + - id: technique-sessions + title: Technique Sessions + repeatable: true + sections: + - id: technique + title: "{{technique_name}} - {{duration}}" + sections: + - id: description + template: "**Description:** {{technique_description}}" + - id: ideas-generated + title: "Ideas Generated:" + type: numbered-list + template: "{{idea}}" + - id: insights + title: "Insights Discovered:" + type: bullet-list + template: "- {{insight}}" + - id: connections + title: "Notable Connections:" + type: bullet-list + template: "- {{connection}}" + + - id: idea-categorization + title: Idea Categorization + sections: + - id: immediate-opportunities + title: Immediate Opportunities + content: "*Ideas ready to implement now*" + repeatable: true + type: numbered-list + template: | + **{{idea_name}}** + - Description: {{description}} + - Why immediate: {{rationale}} + - Resources needed: {{requirements}} + - id: future-innovations + title: Future Innovations + content: "*Ideas requiring development/research*" + repeatable: true + type: numbered-list + template: | + **{{idea_name}}** + - Description: {{description}} + - Development needed: {{development_needed}} + - Timeline estimate: {{timeline}} + - id: moonshots + title: Moonshots + content: "*Ambitious, transformative concepts*" + repeatable: true + type: numbered-list + template: | + **{{idea_name}}** + - Description: {{description}} + - Transformative potential: {{potential}} + - Challenges to overcome: {{challenges}} + - id: insights-learnings + title: Insights & Learnings + content: "*Key realizations from the session*" + type: bullet-list + template: "- {{insight}}: {{description_and_implications}}" + + - id: action-planning + title: Action Planning + sections: + - id: top-priorities + title: Top 3 Priority Ideas + sections: + - id: priority-1 + title: "#1 Priority: {{idea_name}}" + template: | + - Rationale: {{rationale}} + - Next steps: {{next_steps}} + - Resources needed: {{resources}} + - Timeline: {{timeline}} + - id: priority-2 + title: "#2 Priority: {{idea_name}}" + template: | + - Rationale: {{rationale}} + - Next steps: {{next_steps}} + - Resources needed: {{resources}} + - Timeline: {{timeline}} + - id: priority-3 + title: "#3 Priority: {{idea_name}}" + template: | + - Rationale: {{rationale}} + - Next steps: {{next_steps}} + - Resources needed: {{resources}} + - Timeline: {{timeline}} + + - id: reflection-followup + title: Reflection & Follow-up + sections: + - id: what-worked + title: What Worked Well + type: bullet-list + template: "- {{aspect}}" + - id: areas-exploration + title: Areas for Further Exploration + type: bullet-list + template: "- {{area}}: {{reason}}" + - id: recommended-techniques + title: Recommended Follow-up Techniques + type: bullet-list + template: "- {{technique}}: {{reason}}" + - id: questions-emerged + title: Questions That Emerged + type: bullet-list + template: "- {{question}}" + - id: next-session + title: Next Session Planning + template: | + - **Suggested topics:** {{followup_topics}} + - **Recommended timeframe:** {{timeframe}} + - **Preparation needed:** {{preparation}} + + - id: footer + content: | + --- + + *Session facilitated using the BMAD-METHOD brainstorming framework* +==================== END: .bmad-2d-phaser-game-dev/templates/brainstorming-output-tmpl.yaml ==================== ==================== START: .bmad-2d-phaser-game-dev/data/bmad-kb.md ==================== # Game Development BMad Knowledge Base @@ -2660,35 +2622,6 @@ This knowledge base provides the foundation for effective game development using 20. **Question Storming**: Generate questions instead of answers first ==================== END: .bmad-2d-phaser-game-dev/data/brainstorming-techniques.md ==================== -==================== START: .bmad-2d-phaser-game-dev/utils/template-format.md ==================== -# Template Format Conventions - -Templates in the BMad method use standardized markup for AI processing. These conventions ensure consistent document generation. - -## Template Markup Elements - -- **{{placeholders}}**: Variables to be replaced with actual content -- **[[LLM: instructions]]**: Internal processing instructions for AI agents (never shown to users) -- **REPEAT** sections: Content blocks that may be repeated as needed -- **^^CONDITION^^** blocks: Conditional content included only if criteria are met -- **@{examples}**: Example content for guidance (never output to users) - -## Processing Rules - -- Replace all {{placeholders}} with project-specific content -- Execute all [[LLM: instructions]] internally without showing users -- Process conditional and repeat blocks as specified -- Use examples for guidance but never include them in final output -- Present only clean, formatted content to users - -## Critical Guidelines - -- **NEVER display template markup, LLM instructions, or examples to users** -- Template elements are for AI processing only -- Focus on faithful template execution and clean output -- All template-specific instructions are embedded within templates -==================== END: .bmad-2d-phaser-game-dev/utils/template-format.md ==================== - ==================== START: .bmad-2d-phaser-game-dev/tasks/create-workflow-plan.md ==================== # Create Workflow Plan Task @@ -3305,6 +3238,143 @@ The update is successful when: - If plan becomes too cluttered, suggest creating fresh plan for next phase ==================== END: .bmad-2d-phaser-game-dev/tasks/update-workflow-plan.md ==================== +==================== START: .bmad-2d-phaser-game-dev/data/elicitation-methods.md ==================== +# Elicitation Methods Data + +## Core Reflective Methods + +**Expand or Contract for Audience** +- Ask whether to 'expand' (add detail, elaborate) or 'contract' (simplify, clarify) +- Identify specific target audience if relevant +- Tailor content complexity and depth accordingly + +**Explain Reasoning (CoT Step-by-Step)** +- Walk through the step-by-step thinking process +- Reveal underlying assumptions and decision points +- Show how conclusions were reached from current role's perspective + +**Critique and Refine** +- Review output for flaws, inconsistencies, or improvement areas +- Identify specific weaknesses from role's expertise +- Suggest refined version reflecting domain knowledge + +## Structural Analysis Methods + +**Analyze Logical Flow and Dependencies** +- Examine content structure for logical progression +- Check internal consistency and coherence +- Identify and validate dependencies between elements +- Confirm effective ordering and sequencing + +**Assess Alignment with Overall Goals** +- Evaluate content contribution to stated objectives +- Identify any misalignments or gaps +- Interpret alignment from specific role's perspective +- Suggest adjustments to better serve goals + +## Risk and Challenge Methods + +**Identify Potential Risks and Unforeseen Issues** +- Brainstorm potential risks from role's expertise +- Identify overlooked edge cases or scenarios +- Anticipate unintended consequences +- Highlight implementation challenges + +**Challenge from Critical Perspective** +- Adopt critical stance on current content +- Play devil's advocate from specified viewpoint +- Argue against proposal highlighting weaknesses +- Apply YAGNI principles when appropriate (scope trimming) + +## Creative Exploration Methods + +**Tree of Thoughts Deep Dive** +- Break problem into discrete "thoughts" or intermediate steps +- Explore multiple reasoning paths simultaneously +- Use self-evaluation to classify each path as "sure", "likely", or "impossible" +- Apply search algorithms (BFS/DFS) to find optimal solution paths + +**Hindsight is 20/20: The 'If Only...' Reflection** +- Imagine retrospective scenario based on current content +- Identify the one "if only we had known/done X..." insight +- Describe imagined consequences humorously or dramatically +- Extract actionable learnings for current context + +## Multi-Persona Collaboration Methods + +**Agile Team Perspective Shift** +- Rotate through different Scrum team member viewpoints +- Product Owner: Focus on user value and business impact +- Scrum Master: Examine process flow and team dynamics +- Developer: Assess technical implementation and complexity +- QA: Identify testing scenarios and quality concerns + +**Stakeholder Round Table** +- Convene virtual meeting with multiple personas +- Each persona contributes unique perspective on content +- Identify conflicts and synergies between viewpoints +- Synthesize insights into actionable recommendations + +**Meta-Prompting Analysis** +- Step back to analyze the structure and logic of current approach +- Question the format and methodology being used +- Suggest alternative frameworks or mental models +- Optimize the elicitation process itself + +## Advanced 2025 Techniques + +**Self-Consistency Validation** +- Generate multiple reasoning paths for same problem +- Compare consistency across different approaches +- Identify most reliable and robust solution +- Highlight areas where approaches diverge and why + +**ReWOO (Reasoning Without Observation)** +- Separate parametric reasoning from tool-based actions +- Create reasoning plan without external dependencies +- Identify what can be solved through pure reasoning +- Optimize for efficiency and reduced token usage + +**Persona-Pattern Hybrid** +- Combine specific role expertise with elicitation pattern +- Architect + Risk Analysis: Deep technical risk assessment +- UX Expert + User Journey: End-to-end experience critique +- PM + Stakeholder Analysis: Multi-perspective impact review + +**Emergent Collaboration Discovery** +- Allow multiple perspectives to naturally emerge +- Identify unexpected insights from persona interactions +- Explore novel combinations of viewpoints +- Capture serendipitous discoveries from multi-agent thinking + +## Game-Based Elicitation Methods + +**Red Team vs Blue Team** +- Red Team: Attack the proposal, find vulnerabilities +- Blue Team: Defend and strengthen the approach +- Competitive analysis reveals blind spots +- Results in more robust, battle-tested solutions + +**Innovation Tournament** +- Pit multiple alternative approaches against each other +- Score each approach across different criteria +- Crowd-source evaluation from different personas +- Identify winning combination of features + +**Escape Room Challenge** +- Present content as constraints to work within +- Find creative solutions within tight limitations +- Identify minimum viable approach +- Discover innovative workarounds and optimizations + +## Process Control + +**Proceed / No Further Actions** +- Acknowledge choice to finalize current work +- Accept output as-is or move to next step +- Prepare to continue without additional elicitation +==================== END: .bmad-2d-phaser-game-dev/data/elicitation-methods.md ==================== + ==================== START: .bmad-2d-phaser-game-dev/utils/plan-management.md ==================== # Plan Management Utility @@ -3599,6 +3669,35 @@ Handle conditional paths by asking clarifying questions when needed. Agents should be workflow-aware: know active workflow, their role, access artifacts, understand expected outputs. ==================== END: .bmad-2d-phaser-game-dev/utils/workflow-management.md ==================== +==================== START: .bmad-2d-phaser-game-dev/utils/template-format.md ==================== +# Template Format Conventions + +Templates in the BMad method use standardized markup for AI processing. These conventions ensure consistent document generation. + +## Template Markup Elements + +- **{{placeholders}}**: Variables to be replaced with actual content +- **[[LLM: instructions]]**: Internal processing instructions for AI agents (never shown to users) +- **REPEAT** sections: Content blocks that may be repeated as needed +- **^^CONDITION^^** blocks: Conditional content included only if criteria are met +- **@{examples}**: Example content for guidance (never output to users) + +## Processing Rules + +- Replace all {{placeholders}} with project-specific content +- Execute all [[LLM: instructions]] internally without showing users +- Process conditional and repeat blocks as specified +- Use examples for guidance but never include them in final output +- Present only clean, formatted content to users + +## Critical Guidelines + +- **NEVER display template markup, LLM instructions, or examples to users** +- Template elements are for AI processing only +- Focus on faithful template execution and clean output +- All template-specific instructions are embedded within templates +==================== END: .bmad-2d-phaser-game-dev/utils/template-format.md ==================== + ==================== START: .bmad-2d-phaser-game-dev/tasks/execute-checklist.md ==================== # Checklist Validation Task @@ -4006,1160 +4105,1197 @@ This task provides a comprehensive toolkit of creative brainstorming techniques - Plan for iteration based on player feedback ==================== END: .bmad-2d-phaser-game-dev/tasks/game-design-brainstorming.md ==================== -==================== START: .bmad-2d-phaser-game-dev/templates/game-design-doc-tmpl.md ==================== -# {{Game Title}} Game Design Document (GDD) - -[[LLM: This template creates a comprehensive Game Design Document that will serve as the foundation for all game development work. The GDD should be detailed enough that developers can create user stories and epics from it. Focus on gameplay systems, mechanics, and technical requirements that can be broken down into implementable features. - -If available, review any provided documents or ask if any are optionally available: Project Brief, Market Research, Competitive Analysis]] - -## Executive Summary - -[[LLM: Create a compelling overview that captures the essence of the game. Present this section first and get user feedback before proceeding.]] - -### Core Concept - -[[LLM: 2-3 sentences that clearly describe what the game is and why players will love it]] - -### Target Audience - -[[LLM: Define the primary and secondary audience with demographics and gaming preferences]] - -**Primary:** {{age_range}}, {{player_type}}, {{platform_preference}} -**Secondary:** {{secondary_audience}} - -### Platform & Technical Requirements - -[[LLM: Based on the technical preferences or user input, define the target platforms]] - -**Primary Platform:** {{platform}} -**Engine:** Phaser 3 + TypeScript -**Performance Target:** 60 FPS on {{minimum_device}} -**Screen Support:** {{resolution_range}} - -### Unique Selling Points - -[[LLM: List 3-5 key features that differentiate this game from competitors]] - -1. {{usp_1}} -2. {{usp_2}} -3. {{usp_3}} - -## Core Gameplay - -[[LLM: This section defines the fundamental game mechanics. After presenting each subsection, apply `tasks#advanced-elicitation` protocol to ensure completeness.]] - -### Game Pillars - -[[LLM: Define 3-5 core pillars that guide all design decisions. These should be specific and actionable.]] - -1. **{{pillar_1}}** - {{description}} -2. **{{pillar_2}}** - {{description}} -3. **{{pillar_3}}** - {{description}} - -### Core Gameplay Loop - -[[LLM: Define the 30-60 second loop that players will repeat. Be specific about timing and player actions.]] - -**Primary Loop ({{duration}} seconds):** - -1. {{action_1}} ({{time_1}}s) -2. {{action_2}} ({{time_2}}s) -3. {{action_3}} ({{time_3}}s) -4. {{reward_feedback}} ({{time_4}}s) - -### Win/Loss Conditions - -[[LLM: Clearly define success and failure states]] - -**Victory Conditions:** - -- {{win_condition_1}} -- {{win_condition_2}} - -**Failure States:** - -- {{loss_condition_1}} -- {{loss_condition_2}} - -## Game Mechanics - -[[LLM: Detail each major mechanic that will need to be implemented. Each mechanic should be specific enough for developers to create implementation stories.]] - -### Primary Mechanics - -<> - -#### {{mechanic_name}} - -**Description:** {{detailed_description}} - -**Player Input:** {{input_method}} - -**System Response:** {{game_response}} - -**Implementation Notes:** - -- {{tech_requirement_1}} -- {{tech_requirement_2}} -- {{performance_consideration}} - -**Dependencies:** {{other_mechanics_needed}} - -<> - -### Controls - -[[LLM: Define all input methods for different platforms]] - -| Action | Desktop | Mobile | Gamepad | -| ------------ | ------- | ----------- | ---------- | -| {{action_1}} | {{key}} | {{gesture}} | {{button}} | -| {{action_2}} | {{key}} | {{gesture}} | {{button}} | - -## Progression & Balance - -[[LLM: Define how players advance and how difficulty scales. This section should provide clear parameters for implementation.]] - -### Player Progression - -**Progression Type:** {{linear|branching|metroidvania}} - -**Key Milestones:** - -1. **{{milestone_1}}** - {{unlock_description}} -2. **{{milestone_2}}** - {{unlock_description}} -3. **{{milestone_3}}** - {{unlock_description}} - -### Difficulty Curve - -[[LLM: Provide specific parameters for balancing]] - -**Tutorial Phase:** {{duration}} - {{difficulty_description}} -**Early Game:** {{duration}} - {{difficulty_description}} -**Mid Game:** {{duration}} - {{difficulty_description}} -**Late Game:** {{duration}} - {{difficulty_description}} - -### Economy & Resources - -^^CONDITION: has_economy^^ - -[[LLM: Define any in-game currencies, resources, or collectibles]] - -| Resource | Earn Rate | Spend Rate | Purpose | Cap | -| -------------- | --------- | ---------- | ------- | ------- | -| {{resource_1}} | {{rate}} | {{rate}} | {{use}} | {{max}} | - -^^/CONDITION: has_economy^^ - -## Level Design Framework - -[[LLM: Provide guidelines for level creation that developers can use to create level implementation stories]] - -### Level Types - -<> - -#### {{level_type_name}} - -**Purpose:** {{gameplay_purpose}} -**Duration:** {{target_time}} -**Key Elements:** {{required_mechanics}} -**Difficulty:** {{relative_difficulty}} - -**Structure Template:** - -- Introduction: {{intro_description}} -- Challenge: {{main_challenge}} -- Resolution: {{completion_requirement}} - -<> - -### Level Progression - -**World Structure:** {{linear|hub|open}} -**Total Levels:** {{number}} -**Unlock Pattern:** {{progression_method}} - -## Technical Specifications - -[[LLM: Define technical requirements that will guide architecture and implementation decisions. Review any existing technical preferences.]] - -### Performance Requirements - -**Frame Rate:** 60 FPS (minimum 30 FPS on low-end devices) -**Memory Usage:** <{{memory_limit}}MB -**Load Times:** <{{load_time}}s initial, <{{level_load}}s between levels -**Battery Usage:** Optimized for mobile devices - -### Platform Specific - -**Desktop:** - -- Resolution: {{min_resolution}} - {{max_resolution}} -- Input: Keyboard, Mouse, Gamepad -- Browser: Chrome 80+, Firefox 75+, Safari 13+ - -**Mobile:** - -- Resolution: {{mobile_min}} - {{mobile_max}} -- Input: Touch, Tilt (optional) -- OS: iOS 13+, Android 8+ - -### Asset Requirements - -[[LLM: Define asset specifications for the art and audio teams]] - -**Visual Assets:** - -- Art Style: {{style_description}} -- Color Palette: {{color_specification}} -- Animation: {{animation_requirements}} -- UI Resolution: {{ui_specs}} - -**Audio Assets:** - -- Music Style: {{music_genre}} -- Sound Effects: {{sfx_requirements}} -- Voice Acting: {{voice_needs}} - -## Technical Architecture Requirements - -[[LLM: Define high-level technical requirements that the game architecture must support]] - -### Engine Configuration - -**Phaser 3 Setup:** - -- TypeScript: Strict mode enabled -- Physics: {{physics_system}} (Arcade/Matter) -- Renderer: WebGL with Canvas fallback -- Scale Mode: {{scale_mode}} - -### Code Architecture - -**Required Systems:** - -- Scene Management -- State Management -- Asset Loading -- Save/Load System -- Input Management -- Audio System -- Performance Monitoring - -### Data Management - -**Save Data:** - -- Progress tracking -- Settings persistence -- Statistics collection -- {{additional_data}} - -## Development Phases - -[[LLM: Break down the development into phases that can be converted to epics]] - -### Phase 1: Core Systems ({{duration}}) - -**Epic: Foundation** - -- Engine setup and configuration -- Basic scene management -- Core input handling -- Asset loading pipeline - -**Epic: Core Mechanics** - -- {{primary_mechanic}} implementation -- Basic physics and collision -- Player controller - -### Phase 2: Gameplay Features ({{duration}}) - -**Epic: Game Systems** - -- {{mechanic_2}} implementation -- {{mechanic_3}} implementation -- Game state management - -**Epic: Content Creation** - -- Level loading system -- First playable levels -- Basic UI implementation - -### Phase 3: Polish & Optimization ({{duration}}) - -**Epic: Performance** - -- Optimization and profiling -- Mobile platform testing -- Memory management - -**Epic: User Experience** - -- Audio implementation -- Visual effects and polish -- Final UI/UX refinement - -## Success Metrics - -[[LLM: Define measurable goals for the game]] - -**Technical Metrics:** - -- Frame rate: {{fps_target}} -- Load time: {{load_target}} -- Crash rate: <{{crash_threshold}}% -- Memory usage: <{{memory_target}}MB - -**Gameplay Metrics:** - -- Tutorial completion: {{completion_rate}}% -- Average session: {{session_length}} minutes -- Level completion: {{level_completion}}% -- Player retention: D1 {{d1}}%, D7 {{d7}}% - -## Appendices - -### Change Log - -[[LLM: Track document versions and changes]] - -| Date | Version | Description | Author | -| :--- | :------ | :---------- | :----- | - -### References - -[[LLM: List any competitive analysis, inspiration, or research sources]] - -- {{reference_1}} -- {{reference_2}} -- {{reference_3}} -==================== END: .bmad-2d-phaser-game-dev/templates/game-design-doc-tmpl.md ==================== - -==================== START: .bmad-2d-phaser-game-dev/templates/level-design-doc-tmpl.md ==================== -# {{Game Title}} Level Design Document - -[[LLM: This template creates comprehensive level design documentation that guides both content creation and technical implementation. This document should provide enough detail for developers to create level loading systems and for designers to create specific levels. - -If available, review: Game Design Document (GDD), Game Architecture Document. This document should align with the game mechanics and technical systems defined in those documents.]] - -## Introduction - -[[LLM: Establish the purpose and scope of level design for this game]] - -This document defines the level design framework for {{Game Title}}, providing guidelines for creating engaging, balanced levels that support the core gameplay mechanics defined in the Game Design Document. - -This framework ensures consistency across all levels while providing flexibility for creative level design within established technical and design constraints. - -### Change Log - -[[LLM: Track document versions and changes]] - -| Date | Version | Description | Author | -| :--- | :------ | :---------- | :----- | - -## Level Design Philosophy - -[[LLM: Establish the overall approach to level design based on the game's core pillars and mechanics. Apply `tasks#advanced-elicitation` after presenting this section.]] - -### Design Principles - -[[LLM: Define 3-5 core principles that guide all level design decisions]] - -1. **{{principle_1}}** - {{description}} -2. **{{principle_2}}** - {{description}} -3. **{{principle_3}}** - {{description}} - -### Player Experience Goals - -[[LLM: Define what players should feel and learn in each level category]] - -**Tutorial Levels:** {{experience_description}} -**Standard Levels:** {{experience_description}} -**Challenge Levels:** {{experience_description}} -**Boss Levels:** {{experience_description}} - -### Level Flow Framework - -[[LLM: Define the standard structure for level progression]] - -**Introduction Phase:** {{duration}} - {{purpose}} -**Development Phase:** {{duration}} - {{purpose}} -**Climax Phase:** {{duration}} - {{purpose}} -**Resolution Phase:** {{duration}} - {{purpose}} - -## Level Categories - -[[LLM: Define different types of levels based on the GDD requirements. Each category should be specific enough for implementation.]] - -<> - -### {{category_name}} Levels - -**Purpose:** {{gameplay_purpose}} - -**Target Duration:** {{min_time}} - {{max_time}} minutes - -**Difficulty Range:** {{difficulty_scale}} - -**Key Mechanics Featured:** - -- {{mechanic_1}} - {{usage_description}} -- {{mechanic_2}} - {{usage_description}} - -**Player Objectives:** - -- Primary: {{primary_objective}} -- Secondary: {{secondary_objective}} -- Hidden: {{secret_objective}} - -**Success Criteria:** - -- {{completion_requirement_1}} -- {{completion_requirement_2}} - -**Technical Requirements:** - -- Maximum entities: {{entity_limit}} -- Performance target: {{fps_target}} FPS -- Memory budget: {{memory_limit}}MB -- Asset requirements: {{asset_needs}} - -<> - -## Level Progression System - -[[LLM: Define how players move through levels and how difficulty scales]] - -### World Structure - -[[LLM: Based on GDD requirements, define the overall level organization]] - -**Organization Type:** {{linear|hub_world|open_world}} - -**Total Level Count:** {{number}} - -**World Breakdown:** - -- World 1: {{level_count}} levels - {{theme}} - {{difficulty_range}} -- World 2: {{level_count}} levels - {{theme}} - {{difficulty_range}} -- World 3: {{level_count}} levels - {{theme}} - {{difficulty_range}} - -### Difficulty Progression - -[[LLM: Define how challenge increases across the game]] - -**Progression Curve:** - -````text -Difficulty - ^ ___/``` - | / - | / ___/``` - | / / - | / / - |/ / - +-----------> Level Number - Tutorial Early Mid Late -```` - -**Scaling Parameters:** - -- Enemy count: {{start_count}} → {{end_count}} -- Enemy difficulty: {{start_diff}} → {{end_diff}} -- Level complexity: {{start_complex}} → {{end_complex}} -- Time pressure: {{start_time}} → {{end_time}} - -### Unlock Requirements - -[[LLM: Define how players access new levels]] - -**Progression Gates:** - -- Linear progression: Complete previous level -- Star requirements: {{star_count}} stars to unlock -- Skill gates: Demonstrate {{skill_requirement}} -- Optional content: {{unlock_condition}} - -## Level Design Components - -[[LLM: Define the building blocks used to create levels]] - -### Environmental Elements - -[[LLM: Define all environmental components that can be used in levels]] - -**Terrain Types:** - -- {{terrain_1}}: {{properties_and_usage}} -- {{terrain_2}}: {{properties_and_usage}} - -**Interactive Objects:** - -- {{object_1}}: {{behavior_and_purpose}} -- {{object_2}}: {{behavior_and_purpose}} - -**Hazards and Obstacles:** - -- {{hazard_1}}: {{damage_and_behavior}} -- {{hazard_2}}: {{damage_and_behavior}} - -### Collectibles and Rewards - -[[LLM: Define all collectible items and their placement rules]] - -**Collectible Types:** - -- {{collectible_1}}: {{value_and_purpose}} -- {{collectible_2}}: {{value_and_purpose}} - -**Placement Guidelines:** - -- Mandatory collectibles: {{placement_rules}} -- Optional collectibles: {{placement_rules}} -- Secret collectibles: {{placement_rules}} - -**Reward Distribution:** - -- Easy to find: {{percentage}}% -- Moderate challenge: {{percentage}}% -- High skill required: {{percentage}}% - -### Enemy Placement Framework - -[[LLM: Define how enemies should be placed and balanced in levels]] - -**Enemy Categories:** - -- {{enemy_type_1}}: {{behavior_and_usage}} -- {{enemy_type_2}}: {{behavior_and_usage}} - -**Placement Principles:** - -- Introduction encounters: {{guideline}} -- Standard encounters: {{guideline}} -- Challenge encounters: {{guideline}} - -**Difficulty Scaling:** - -- Enemy count progression: {{scaling_rule}} -- Enemy type introduction: {{pacing_rule}} -- Encounter complexity: {{complexity_rule}} - -## Level Creation Guidelines - -[[LLM: Provide specific guidelines for creating individual levels]] - -### Level Layout Principles - -**Spatial Design:** - -- Grid size: {{grid_dimensions}} -- Minimum path width: {{width_units}} -- Maximum vertical distance: {{height_units}} -- Safe zones placement: {{safety_guidelines}} - -**Navigation Design:** - -- Clear path indication: {{visual_cues}} -- Landmark placement: {{landmark_rules}} -- Dead end avoidance: {{dead_end_policy}} -- Multiple path options: {{branching_rules}} - -### Pacing and Flow - -[[LLM: Define how to control the rhythm and pace of gameplay within levels]] - -**Action Sequences:** - -- High intensity duration: {{max_duration}} -- Rest period requirement: {{min_rest_time}} -- Intensity variation: {{pacing_pattern}} - -**Learning Sequences:** - -- New mechanic introduction: {{teaching_method}} -- Practice opportunity: {{practice_duration}} -- Skill application: {{application_context}} - -### Challenge Design - -[[LLM: Define how to create appropriate challenges for each level type]] - -**Challenge Types:** - -- Execution challenges: {{skill_requirements}} -- Puzzle challenges: {{complexity_guidelines}} -- Time challenges: {{time_pressure_rules}} -- Resource challenges: {{resource_management}} - -**Difficulty Calibration:** - -- Skill check frequency: {{frequency_guidelines}} -- Failure recovery: {{retry_mechanics}} -- Hint system integration: {{help_system}} - -## Technical Implementation - -[[LLM: Define technical requirements for level implementation]] - -### Level Data Structure - -[[LLM: Define how level data should be structured for implementation]] - -**Level File Format:** - -- Data format: {{json|yaml|custom}} -- File naming: `level_{{world}}_{{number}}.{{extension}}` -- Data organization: {{structure_description}} - -**Required Data Fields:** - -```json -{ - "levelId": "{{unique_identifier}}", - "worldId": "{{world_identifier}}", - "difficulty": {{difficulty_value}}, - "targetTime": {{completion_time_seconds}}, - "objectives": { - "primary": "{{primary_objective}}", - "secondary": ["{{secondary_objectives}}"], - "hidden": ["{{secret_objectives}}"] - }, - "layout": { - "width": {{grid_width}}, - "height": {{grid_height}}, - "tilemap": "{{tilemap_reference}}" - }, - "entities": [ - { - "type": "{{entity_type}}", - "position": {"x": {{x}}, "y": {{y}}}, - "properties": {{entity_properties}} - } - ] -} -``` - -### Asset Integration - -[[LLM: Define how level assets are organized and loaded]] - -**Tilemap Requirements:** - -- Tile size: {{tile_dimensions}}px -- Tileset organization: {{tileset_structure}} -- Layer organization: {{layer_system}} -- Collision data: {{collision_format}} - -**Audio Integration:** - -- Background music: {{music_requirements}} -- Ambient sounds: {{ambient_system}} -- Dynamic audio: {{dynamic_audio_rules}} - -### Performance Optimization - -[[LLM: Define performance requirements for level systems]] - -**Entity Limits:** - -- Maximum active entities: {{entity_limit}} -- Maximum particles: {{particle_limit}} -- Maximum audio sources: {{audio_limit}} - -**Memory Management:** - -- Texture memory budget: {{texture_memory}}MB -- Audio memory budget: {{audio_memory}}MB -- Level loading time: <{{load_time}}s - -**Culling and LOD:** - -- Off-screen culling: {{culling_distance}} -- Level-of-detail rules: {{lod_system}} -- Asset streaming: {{streaming_requirements}} - -## Level Testing Framework - -[[LLM: Define how levels should be tested and validated]] - -### Automated Testing - -**Performance Testing:** - -- Frame rate validation: Maintain {{fps_target}} FPS -- Memory usage monitoring: Stay under {{memory_limit}}MB -- Loading time verification: Complete in <{{load_time}}s - -**Gameplay Testing:** - -- Completion path validation: All objectives achievable -- Collectible accessibility: All items reachable -- Softlock prevention: No unwinnable states - -### Manual Testing Protocol - -**Playtesting Checklist:** - -- [ ] Level completes within target time range -- [ ] All mechanics function correctly -- [ ] Difficulty feels appropriate for level category -- [ ] Player guidance is clear and effective -- [ ] No exploits or sequence breaks (unless intended) - -**Player Experience Testing:** - -- [ ] Tutorial levels teach effectively -- [ ] Challenge feels fair and rewarding -- [ ] Flow and pacing maintain engagement -- [ ] Audio and visual feedback support gameplay - -### Balance Validation - -**Metrics Collection:** - -- Completion rate: Target {{completion_percentage}}% -- Average completion time: {{target_time}} ± {{variance}} -- Death count per level: <{{max_deaths}} -- Collectible discovery rate: {{discovery_percentage}}% - -**Iteration Guidelines:** - -- Adjustment criteria: {{criteria_for_changes}} -- Testing sample size: {{minimum_testers}} -- Validation period: {{testing_duration}} - -## Content Creation Pipeline - -[[LLM: Define the workflow for creating new levels]] - -### Design Phase - -**Concept Development:** - -1. Define level purpose and goals -2. Create rough layout sketch -3. Identify key mechanics and challenges -4. Estimate difficulty and duration - -**Documentation Requirements:** - -- Level design brief -- Layout diagrams -- Mechanic integration notes -- Asset requirement list - -### Implementation Phase - -**Technical Implementation:** - -1. Create level data file -2. Build tilemap and layout -3. Place entities and objects -4. Configure level logic and triggers -5. Integrate audio and visual effects - -**Quality Assurance:** - -1. Automated testing execution -2. Internal playtesting -3. Performance validation -4. Bug fixing and polish - -### Integration Phase - -**Game Integration:** - -1. Level progression integration -2. Save system compatibility -3. Analytics integration -4. Achievement system integration - -**Final Validation:** - -1. Full game context testing -2. Performance regression testing -3. Platform compatibility verification -4. Final approval and release - -## Success Metrics - -[[LLM: Define how to measure level design success]] - -**Player Engagement:** - -- Level completion rate: {{target_rate}}% -- Replay rate: {{replay_target}}% -- Time spent per level: {{engagement_time}} -- Player satisfaction scores: {{satisfaction_target}}/10 - -**Technical Performance:** - -- Frame rate consistency: {{fps_consistency}}% -- Loading time compliance: {{load_compliance}}% -- Memory usage efficiency: {{memory_efficiency}}% -- Crash rate: <{{crash_threshold}}% - -**Design Quality:** - -- Difficulty curve adherence: {{curve_accuracy}} -- Mechanic integration effectiveness: {{integration_score}} -- Player guidance clarity: {{guidance_score}} -- Content accessibility: {{accessibility_rate}}% -==================== END: .bmad-2d-phaser-game-dev/templates/level-design-doc-tmpl.md ==================== - -==================== START: .bmad-2d-phaser-game-dev/templates/game-brief-tmpl.md ==================== -# {{Game Title}} Game Brief - -[[LLM: This template creates a comprehensive game brief that serves as the foundation for all subsequent game development work. The brief should capture the essential vision, scope, and requirements needed to create a detailed Game Design Document. - -This brief is typically created early in the ideation process, often after brainstorming sessions, to crystallize the game concept before moving into detailed design.]] - -## Game Vision - -[[LLM: Establish the core vision and identity of the game. Present each subsection and gather user feedback before proceeding.]] - -### Core Concept - -[[LLM: 2-3 sentences that clearly capture what the game is and why it will be compelling to players]] - -### Elevator Pitch - -[[LLM: Single sentence that captures the essence of the game in a memorable way]] - -**"{{game_description_in_one_sentence}}"** - -### Vision Statement - -[[LLM: Inspirational statement about what the game will achieve for players and why it matters]] - -## Target Market - -[[LLM: Define the audience and market context. Apply `tasks#advanced-elicitation` after presenting this section.]] - -### Primary Audience - -**Demographics:** {{age_range}}, {{platform_preference}}, {{gaming_experience}} -**Psychographics:** {{interests}}, {{motivations}}, {{play_patterns}} -**Gaming Preferences:** {{preferred_genres}}, {{session_length}}, {{difficulty_preference}} - -### Secondary Audiences - -**Audience 2:** {{description}} -**Audience 3:** {{description}} - -### Market Context - -**Genre:** {{primary_genre}} / {{secondary_genre}} -**Platform Strategy:** {{platform_focus}} -**Competitive Positioning:** {{differentiation_statement}} - -## Game Fundamentals - -[[LLM: Define the core gameplay elements. Each subsection should be specific enough to guide detailed design work.]] - -### Core Gameplay Pillars - -[[LLM: 3-5 fundamental principles that guide all design decisions]] - -1. **{{pillar_1}}** - {{description_and_rationale}} -2. **{{pillar_2}}** - {{description_and_rationale}} -3. **{{pillar_3}}** - {{description_and_rationale}} - -### Primary Mechanics - -[[LLM: List the 3-5 most important gameplay mechanics that define the player experience]] - -**Core Mechanic 1: {{mechanic_name}}** - -- **Description:** {{how_it_works}} -- **Player Value:** {{why_its_fun}} -- **Implementation Scope:** {{complexity_estimate}} - -**Core Mechanic 2: {{mechanic_name}}** - -- **Description:** {{how_it_works}} -- **Player Value:** {{why_its_fun}} -- **Implementation Scope:** {{complexity_estimate}} - -### Player Experience Goals - -[[LLM: Define what emotions and experiences the game should create for players]] - -**Primary Experience:** {{main_emotional_goal}} -**Secondary Experiences:** {{supporting_emotional_goals}} -**Engagement Pattern:** {{how_player_engagement_evolves}} - -## Scope and Constraints - -[[LLM: Define the boundaries and limitations that will shape development. Apply `tasks#advanced-elicitation` to clarify any constraints.]] - -### Project Scope - -**Game Length:** {{estimated_content_hours}} -**Content Volume:** {{levels_areas_content_amount}} -**Feature Complexity:** {{simple|moderate|complex}} -**Scope Comparison:** "Similar to {{reference_game}} but with {{key_differences}}" - -### Technical Constraints - -**Platform Requirements:** - -- Primary: {{platform_1}} - {{requirements}} -- Secondary: {{platform_2}} - {{requirements}} - -**Technical Specifications:** - -- Engine: Phaser 3 + TypeScript -- Performance Target: {{fps_target}} FPS on {{target_device}} -- Memory Budget: <{{memory_limit}}MB -- Load Time Goal: <{{load_time_seconds}}s - -### Resource Constraints - -**Team Size:** {{team_composition}} -**Timeline:** {{development_duration}} -**Budget Considerations:** {{budget_constraints_or_targets}} -**Asset Requirements:** {{art_audio_content_needs}} - -### Business Constraints - -^^CONDITION: has_business_goals^^ - -**Monetization Model:** {{free|premium|freemium|subscription}} -**Revenue Goals:** {{revenue_targets_if_applicable}} -**Platform Requirements:** {{store_certification_needs}} -**Launch Timeline:** {{target_launch_window}} - -^^/CONDITION: has_business_goals^^ - -## Reference Framework - -[[LLM: Provide context through references and competitive analysis]] - -### Inspiration Games - -**Primary References:** - -1. **{{reference_game_1}}** - {{what_we_learn_from_it}} -2. **{{reference_game_2}}** - {{what_we_learn_from_it}} -3. **{{reference_game_3}}** - {{what_we_learn_from_it}} - -### Competitive Analysis - -**Direct Competitors:** - -- {{competitor_1}}: {{strengths_and_weaknesses}} -- {{competitor_2}}: {{strengths_and_weaknesses}} - -**Differentiation Strategy:** -{{how_we_differ_and_why_thats_valuable}} - -### Market Opportunity - -**Market Gap:** {{underserved_need_or_opportunity}} -**Timing Factors:** {{why_now_is_the_right_time}} -**Success Metrics:** {{how_well_measure_success}} - -## Content Framework - -[[LLM: Outline the content structure and progression without full design detail]] - -### Game Structure - -**Overall Flow:** {{linear|hub_world|open_world|procedural}} -**Progression Model:** {{how_players_advance}} -**Session Structure:** {{typical_play_session_flow}} - -### Content Categories - -**Core Content:** - -- {{content_type_1}}: {{quantity_and_description}} -- {{content_type_2}}: {{quantity_and_description}} - -**Optional Content:** - -- {{optional_content_type}}: {{quantity_and_description}} - -**Replay Elements:** - -- {{replayability_features}} - -### Difficulty and Accessibility - -**Difficulty Approach:** {{how_challenge_is_structured}} -**Accessibility Features:** {{planned_accessibility_support}} -**Skill Requirements:** {{what_skills_players_need}} - -## Art and Audio Direction - -[[LLM: Establish the aesthetic vision that will guide asset creation]] - -### Visual Style - -**Art Direction:** {{style_description}} -**Reference Materials:** {{visual_inspiration_sources}} -**Technical Approach:** {{2d_style_pixel_vector_etc}} -**Color Strategy:** {{color_palette_mood}} - -### Audio Direction - -**Music Style:** {{genre_and_mood}} -**Sound Design:** {{audio_personality}} -**Implementation Needs:** {{technical_audio_requirements}} - -### UI/UX Approach - -**Interface Style:** {{ui_aesthetic}} -**User Experience Goals:** {{ux_priorities}} -**Platform Adaptations:** {{cross_platform_considerations}} - -## Risk Assessment - -[[LLM: Identify potential challenges and mitigation strategies]] - -### Technical Risks - -| Risk | Probability | Impact | Mitigation Strategy | -| -------------------- | ----------- | ------ | ------------------- | ------ | --- | ----- | ----------------------- | -| {{technical_risk_1}} | {{high | med | low}} | {{high | med | low}} | {{mitigation_approach}} | -| {{technical_risk_2}} | {{high | med | low}} | {{high | med | low}} | {{mitigation_approach}} | - -### Design Risks - -| Risk | Probability | Impact | Mitigation Strategy | -| ----------------- | ----------- | ------ | ------------------- | ------ | --- | ----- | ----------------------- | -| {{design_risk_1}} | {{high | med | low}} | {{high | med | low}} | {{mitigation_approach}} | -| {{design_risk_2}} | {{high | med | low}} | {{high | med | low}} | {{mitigation_approach}} | - -### Market Risks - -| Risk | Probability | Impact | Mitigation Strategy | -| ----------------- | ----------- | ------ | ------------------- | ------ | --- | ----- | ----------------------- | -| {{market_risk_1}} | {{high | med | low}} | {{high | med | low}} | {{mitigation_approach}} | - -## Success Criteria - -[[LLM: Define measurable goals for the project]] - -### Player Experience Metrics - -**Engagement Goals:** - -- Tutorial completion rate: >{{percentage}}% -- Average session length: {{duration}} minutes -- Player retention: D1 {{d1}}%, D7 {{d7}}%, D30 {{d30}}% - -**Quality Benchmarks:** - -- Player satisfaction: >{{rating}}/10 -- Completion rate: >{{percentage}}% -- Technical performance: {{fps_target}} FPS consistent - -### Development Metrics - -**Technical Targets:** - -- Zero critical bugs at launch -- Performance targets met on all platforms -- Load times under {{seconds}}s - -**Process Goals:** - -- Development timeline adherence -- Feature scope completion -- Quality assurance standards - -^^CONDITION: has_business_goals^^ - -### Business Metrics - -**Commercial Goals:** - -- {{revenue_target}} in first {{time_period}} -- {{user_acquisition_target}} players in first {{time_period}} -- {{retention_target}} monthly active users - -^^/CONDITION: has_business_goals^^ - -## Next Steps - -[[LLM: Define immediate actions following the brief completion]] - -### Immediate Actions - -1. **Stakeholder Review** - {{review_process_and_timeline}} -2. **Concept Validation** - {{validation_approach}} -3. **Resource Planning** - {{team_and_resource_allocation}} - -### Development Roadmap - -**Phase 1: Pre-Production** ({{duration}}) - -- Detailed Game Design Document creation -- Technical architecture planning -- Art style exploration and pipeline setup - -**Phase 2: Prototype** ({{duration}}) - -- Core mechanic implementation -- Technical proof of concept -- Initial playtesting and iteration - -**Phase 3: Production** ({{duration}}) - -- Full feature development -- Content creation and integration -- Comprehensive testing and optimization - -### Documentation Pipeline - -**Required Documents:** - -1. Game Design Document (GDD) - {{target_completion}} -2. Technical Architecture Document - {{target_completion}} -3. Art Style Guide - {{target_completion}} -4. Production Plan - {{target_completion}} - -### Validation Plan - -**Concept Testing:** - -- {{validation_method_1}} - {{timeline}} -- {{validation_method_2}} - {{timeline}} - -**Prototype Testing:** - -- {{testing_approach}} - {{timeline}} -- {{feedback_collection_method}} - {{timeline}} - -## Appendices - -### Research Materials - -[[LLM: Include any supporting research, competitive analysis, or market data that informed the brief]] - -### Brainstorming Session Notes - -[[LLM: Reference any brainstorming sessions that led to this brief]] - -### Stakeholder Input - -[[LLM: Include key input from stakeholders that shaped the vision]] - -### Change Log - -[[LLM: Track document versions and changes]] - -| Date | Version | Description | Author | -| :--- | :------ | :---------- | :----- | -==================== END: .bmad-2d-phaser-game-dev/templates/game-brief-tmpl.md ==================== +==================== START: .bmad-2d-phaser-game-dev/templates/game-design-doc-tmpl.yaml ==================== +template: + id: game-design-doc-template-v2 + name: Game Design Document (GDD) + version: 2.0 + output: + format: markdown + filename: "docs/{{game_name}}-game-design-document.md" + title: "{{game_title}} Game Design Document (GDD)" + +workflow: + mode: interactive + +sections: + - id: initial-setup + instruction: | + This template creates a comprehensive Game Design Document that will serve as the foundation for all game development work. The GDD should be detailed enough that developers can create user stories and epics from it. Focus on gameplay systems, mechanics, and technical requirements that can be broken down into implementable features. + + If available, review any provided documents or ask if any are optionally available: Project Brief, Market Research, Competitive Analysis + + - id: executive-summary + title: Executive Summary + instruction: Create a compelling overview that captures the essence of the game. Present this section first and get user feedback before proceeding. + sections: + - id: core-concept + title: Core Concept + instruction: 2-3 sentences that clearly describe what the game is and why players will love it + - id: target-audience + title: Target Audience + instruction: Define the primary and secondary audience with demographics and gaming preferences + template: | + **Primary:** {{age_range}}, {{player_type}}, {{platform_preference}} + **Secondary:** {{secondary_audience}} + - id: platform-technical + title: Platform & Technical Requirements + instruction: Based on the technical preferences or user input, define the target platforms + template: | + **Primary Platform:** {{platform}} + **Engine:** Phaser 3 + TypeScript + **Performance Target:** 60 FPS on {{minimum_device}} + **Screen Support:** {{resolution_range}} + - id: unique-selling-points + title: Unique Selling Points + instruction: List 3-5 key features that differentiate this game from competitors + type: numbered-list + template: "{{usp}}" + + - id: core-gameplay + title: Core Gameplay + instruction: This section defines the fundamental game mechanics. After presenting each subsection, apply `tasks#advanced-elicitation` protocol to ensure completeness. + sections: + - id: game-pillars + title: Game Pillars + instruction: Define 3-5 core pillars that guide all design decisions. These should be specific and actionable. + type: numbered-list + template: | + **{{pillar_name}}** - {{description}} + - id: core-gameplay-loop + title: Core Gameplay Loop + instruction: Define the 30-60 second loop that players will repeat. Be specific about timing and player actions. + template: | + **Primary Loop ({{duration}} seconds):** + + 1. {{action_1}} ({{time_1}}s) + 2. {{action_2}} ({{time_2}}s) + 3. {{action_3}} ({{time_3}}s) + 4. {{reward_feedback}} ({{time_4}}s) + - id: win-loss-conditions + title: Win/Loss Conditions + instruction: Clearly define success and failure states + template: | + **Victory Conditions:** + + - {{win_condition_1}} + - {{win_condition_2}} + + **Failure States:** + + - {{loss_condition_1}} + - {{loss_condition_2}} + + - id: game-mechanics + title: Game Mechanics + instruction: Detail each major mechanic that will need to be implemented. Each mechanic should be specific enough for developers to create implementation stories. + sections: + - id: primary-mechanics + title: Primary Mechanics + repeatable: true + sections: + - id: mechanic + title: "{{mechanic_name}}" + template: | + **Description:** {{detailed_description}} + + **Player Input:** {{input_method}} + + **System Response:** {{game_response}} + + **Implementation Notes:** + + - {{tech_requirement_1}} + - {{tech_requirement_2}} + - {{performance_consideration}} + + **Dependencies:** {{other_mechanics_needed}} + - id: controls + title: Controls + instruction: Define all input methods for different platforms + type: table + template: | + | Action | Desktop | Mobile | Gamepad | + | ------ | ------- | ------ | ------- | + | {{action}} | {{key}} | {{gesture}} | {{button}} | + + - id: progression-balance + title: Progression & Balance + instruction: Define how players advance and how difficulty scales. This section should provide clear parameters for implementation. + sections: + - id: player-progression + title: Player Progression + template: | + **Progression Type:** {{linear|branching|metroidvania}} + + **Key Milestones:** + + 1. **{{milestone_1}}** - {{unlock_description}} + 2. **{{milestone_2}}** - {{unlock_description}} + 3. **{{milestone_3}}** - {{unlock_description}} + - id: difficulty-curve + title: Difficulty Curve + instruction: Provide specific parameters for balancing + template: | + **Tutorial Phase:** {{duration}} - {{difficulty_description}} + **Early Game:** {{duration}} - {{difficulty_description}} + **Mid Game:** {{duration}} - {{difficulty_description}} + **Late Game:** {{duration}} - {{difficulty_description}} + - id: economy-resources + title: Economy & Resources + condition: has_economy + instruction: Define any in-game currencies, resources, or collectibles + type: table + template: | + | Resource | Earn Rate | Spend Rate | Purpose | Cap | + | -------- | --------- | ---------- | ------- | --- | + | {{resource}} | {{rate}} | {{rate}} | {{use}} | {{max}} | + + - id: level-design-framework + title: Level Design Framework + instruction: Provide guidelines for level creation that developers can use to create level implementation stories + sections: + - id: level-types + title: Level Types + repeatable: true + sections: + - id: level-type + title: "{{level_type_name}}" + template: | + **Purpose:** {{gameplay_purpose}} + **Duration:** {{target_time}} + **Key Elements:** {{required_mechanics}} + **Difficulty:** {{relative_difficulty}} + + **Structure Template:** + + - Introduction: {{intro_description}} + - Challenge: {{main_challenge}} + - Resolution: {{completion_requirement}} + - id: level-progression + title: Level Progression + template: | + **World Structure:** {{linear|hub|open}} + **Total Levels:** {{number}} + **Unlock Pattern:** {{progression_method}} + + - id: technical-specifications + title: Technical Specifications + instruction: Define technical requirements that will guide architecture and implementation decisions. Review any existing technical preferences. + sections: + - id: performance-requirements + title: Performance Requirements + template: | + **Frame Rate:** 60 FPS (minimum 30 FPS on low-end devices) + **Memory Usage:** <{{memory_limit}}MB + **Load Times:** <{{load_time}}s initial, <{{level_load}}s between levels + **Battery Usage:** Optimized for mobile devices + - id: platform-specific + title: Platform Specific + template: | + **Desktop:** + + - Resolution: {{min_resolution}} - {{max_resolution}} + - Input: Keyboard, Mouse, Gamepad + - Browser: Chrome 80+, Firefox 75+, Safari 13+ + + **Mobile:** + + - Resolution: {{mobile_min}} - {{mobile_max}} + - Input: Touch, Tilt (optional) + - OS: iOS 13+, Android 8+ + - id: asset-requirements + title: Asset Requirements + instruction: Define asset specifications for the art and audio teams + template: | + **Visual Assets:** + + - Art Style: {{style_description}} + - Color Palette: {{color_specification}} + - Animation: {{animation_requirements}} + - UI Resolution: {{ui_specs}} + + **Audio Assets:** + + - Music Style: {{music_genre}} + - Sound Effects: {{sfx_requirements}} + - Voice Acting: {{voice_needs}} + + - id: technical-architecture-requirements + title: Technical Architecture Requirements + instruction: Define high-level technical requirements that the game architecture must support + sections: + - id: engine-configuration + title: Engine Configuration + template: | + **Phaser 3 Setup:** + + - TypeScript: Strict mode enabled + - Physics: {{physics_system}} (Arcade/Matter) + - Renderer: WebGL with Canvas fallback + - Scale Mode: {{scale_mode}} + - id: code-architecture + title: Code Architecture + template: | + **Required Systems:** + + - Scene Management + - State Management + - Asset Loading + - Save/Load System + - Input Management + - Audio System + - Performance Monitoring + - id: data-management + title: Data Management + template: | + **Save Data:** + + - Progress tracking + - Settings persistence + - Statistics collection + - {{additional_data}} + + - id: development-phases + title: Development Phases + instruction: Break down the development into phases that can be converted to epics + sections: + - id: phase-1-core-systems + title: "Phase 1: Core Systems ({{duration}})" + sections: + - id: foundation-epic + title: "Epic: Foundation" + type: bullet-list + template: | + - Engine setup and configuration + - Basic scene management + - Core input handling + - Asset loading pipeline + - id: core-mechanics-epic + title: "Epic: Core Mechanics" + type: bullet-list + template: | + - {{primary_mechanic}} implementation + - Basic physics and collision + - Player controller + - id: phase-2-gameplay-features + title: "Phase 2: Gameplay Features ({{duration}})" + sections: + - id: game-systems-epic + title: "Epic: Game Systems" + type: bullet-list + template: | + - {{mechanic_2}} implementation + - {{mechanic_3}} implementation + - Game state management + - id: content-creation-epic + title: "Epic: Content Creation" + type: bullet-list + template: | + - Level loading system + - First playable levels + - Basic UI implementation + - id: phase-3-polish-optimization + title: "Phase 3: Polish & Optimization ({{duration}})" + sections: + - id: performance-epic + title: "Epic: Performance" + type: bullet-list + template: | + - Optimization and profiling + - Mobile platform testing + - Memory management + - id: user-experience-epic + title: "Epic: User Experience" + type: bullet-list + template: | + - Audio implementation + - Visual effects and polish + - Final UI/UX refinement + + - id: success-metrics + title: Success Metrics + instruction: Define measurable goals for the game + sections: + - id: technical-metrics + title: Technical Metrics + type: bullet-list + template: | + - Frame rate: {{fps_target}} + - Load time: {{load_target}} + - Crash rate: <{{crash_threshold}}% + - Memory usage: <{{memory_target}}MB + - id: gameplay-metrics + title: Gameplay Metrics + type: bullet-list + template: | + - Tutorial completion: {{completion_rate}}% + - Average session: {{session_length}} minutes + - Level completion: {{level_completion}}% + - Player retention: D1 {{d1}}%, D7 {{d7}}% + + - id: appendices + title: Appendices + sections: + - id: change-log + title: Change Log + instruction: Track document versions and changes + type: table + template: | + | Date | Version | Description | Author | + | :--- | :------ | :---------- | :----- | + - id: references + title: References + instruction: List any competitive analysis, inspiration, or research sources + type: bullet-list + template: "{{reference}}" +==================== END: .bmad-2d-phaser-game-dev/templates/game-design-doc-tmpl.yaml ==================== + +==================== START: .bmad-2d-phaser-game-dev/templates/level-design-doc-tmpl.yaml ==================== +template: + id: level-design-doc-template-v2 + name: Level Design Document + version: 2.0 + output: + format: markdown + filename: "docs/{{game_name}}-level-design-document.md" + title: "{{game_title}} Level Design Document" + +workflow: + mode: interactive + +sections: + - id: initial-setup + instruction: | + This template creates comprehensive level design documentation that guides both content creation and technical implementation. This document should provide enough detail for developers to create level loading systems and for designers to create specific levels. + + If available, review: Game Design Document (GDD), Game Architecture Document. This document should align with the game mechanics and technical systems defined in those documents. + + - id: introduction + title: Introduction + instruction: Establish the purpose and scope of level design for this game + content: | + This document defines the level design framework for {{game_title}}, providing guidelines for creating engaging, balanced levels that support the core gameplay mechanics defined in the Game Design Document. + + This framework ensures consistency across all levels while providing flexibility for creative level design within established technical and design constraints. + sections: + - id: change-log + title: Change Log + instruction: Track document versions and changes + type: table + template: | + | Date | Version | Description | Author | + | :--- | :------ | :---------- | :----- | + + - id: level-design-philosophy + title: Level Design Philosophy + instruction: Establish the overall approach to level design based on the game's core pillars and mechanics. Apply `tasks#advanced-elicitation` after presenting this section. + sections: + - id: design-principles + title: Design Principles + instruction: Define 3-5 core principles that guide all level design decisions + type: numbered-list + template: | + **{{principle_name}}** - {{description}} + - id: player-experience-goals + title: Player Experience Goals + instruction: Define what players should feel and learn in each level category + template: | + **Tutorial Levels:** {{experience_description}} + **Standard Levels:** {{experience_description}} + **Challenge Levels:** {{experience_description}} + **Boss Levels:** {{experience_description}} + - id: level-flow-framework + title: Level Flow Framework + instruction: Define the standard structure for level progression + template: | + **Introduction Phase:** {{duration}} - {{purpose}} + **Development Phase:** {{duration}} - {{purpose}} + **Climax Phase:** {{duration}} - {{purpose}} + **Resolution Phase:** {{duration}} - {{purpose}} + + - id: level-categories + title: Level Categories + instruction: Define different types of levels based on the GDD requirements. Each category should be specific enough for implementation. + repeatable: true + sections: + - id: level-category + title: "{{category_name}} Levels" + template: | + **Purpose:** {{gameplay_purpose}} + + **Target Duration:** {{min_time}} - {{max_time}} minutes + + **Difficulty Range:** {{difficulty_scale}} + + **Key Mechanics Featured:** + + - {{mechanic_1}} - {{usage_description}} + - {{mechanic_2}} - {{usage_description}} + + **Player Objectives:** + + - Primary: {{primary_objective}} + - Secondary: {{secondary_objective}} + - Hidden: {{secret_objective}} + + **Success Criteria:** + + - {{completion_requirement_1}} + - {{completion_requirement_2}} + + **Technical Requirements:** + + - Maximum entities: {{entity_limit}} + - Performance target: {{fps_target}} FPS + - Memory budget: {{memory_limit}}MB + - Asset requirements: {{asset_needs}} + + - id: level-progression-system + title: Level Progression System + instruction: Define how players move through levels and how difficulty scales + sections: + - id: world-structure + title: World Structure + instruction: Based on GDD requirements, define the overall level organization + template: | + **Organization Type:** {{linear|hub_world|open_world}} + + **Total Level Count:** {{number}} + + **World Breakdown:** + + - World 1: {{level_count}} levels - {{theme}} - {{difficulty_range}} + - World 2: {{level_count}} levels - {{theme}} - {{difficulty_range}} + - World 3: {{level_count}} levels - {{theme}} - {{difficulty_range}} + - id: difficulty-progression + title: Difficulty Progression + instruction: Define how challenge increases across the game + sections: + - id: progression-curve + title: Progression Curve + type: code + language: text + template: | + Difficulty + ^ ___/``` + | / + | / ___/``` + | / / + | / / + |/ / + +-----------> Level Number + Tutorial Early Mid Late + - id: scaling-parameters + title: Scaling Parameters + type: bullet-list + template: | + - Enemy count: {{start_count}} → {{end_count}} + - Enemy difficulty: {{start_diff}} → {{end_diff}} + - Level complexity: {{start_complex}} → {{end_complex}} + - Time pressure: {{start_time}} → {{end_time}} + - id: unlock-requirements + title: Unlock Requirements + instruction: Define how players access new levels + template: | + **Progression Gates:** + + - Linear progression: Complete previous level + - Star requirements: {{star_count}} stars to unlock + - Skill gates: Demonstrate {{skill_requirement}} + - Optional content: {{unlock_condition}} + + - id: level-design-components + title: Level Design Components + instruction: Define the building blocks used to create levels + sections: + - id: environmental-elements + title: Environmental Elements + instruction: Define all environmental components that can be used in levels + template: | + **Terrain Types:** + + - {{terrain_1}}: {{properties_and_usage}} + - {{terrain_2}}: {{properties_and_usage}} + + **Interactive Objects:** + + - {{object_1}}: {{behavior_and_purpose}} + - {{object_2}}: {{behavior_and_purpose}} + + **Hazards and Obstacles:** + + - {{hazard_1}}: {{damage_and_behavior}} + - {{hazard_2}}: {{damage_and_behavior}} + - id: collectibles-rewards + title: Collectibles and Rewards + instruction: Define all collectible items and their placement rules + template: | + **Collectible Types:** + + - {{collectible_1}}: {{value_and_purpose}} + - {{collectible_2}}: {{value_and_purpose}} + + **Placement Guidelines:** + + - Mandatory collectibles: {{placement_rules}} + - Optional collectibles: {{placement_rules}} + - Secret collectibles: {{placement_rules}} + + **Reward Distribution:** + + - Easy to find: {{percentage}}% + - Moderate challenge: {{percentage}}% + - High skill required: {{percentage}}% + - id: enemy-placement-framework + title: Enemy Placement Framework + instruction: Define how enemies should be placed and balanced in levels + template: | + **Enemy Categories:** + + - {{enemy_type_1}}: {{behavior_and_usage}} + - {{enemy_type_2}}: {{behavior_and_usage}} + + **Placement Principles:** + + - Introduction encounters: {{guideline}} + - Standard encounters: {{guideline}} + - Challenge encounters: {{guideline}} + + **Difficulty Scaling:** + + - Enemy count progression: {{scaling_rule}} + - Enemy type introduction: {{pacing_rule}} + - Encounter complexity: {{complexity_rule}} + + - id: level-creation-guidelines + title: Level Creation Guidelines + instruction: Provide specific guidelines for creating individual levels + sections: + - id: level-layout-principles + title: Level Layout Principles + template: | + **Spatial Design:** + + - Grid size: {{grid_dimensions}} + - Minimum path width: {{width_units}} + - Maximum vertical distance: {{height_units}} + - Safe zones placement: {{safety_guidelines}} + + **Navigation Design:** + + - Clear path indication: {{visual_cues}} + - Landmark placement: {{landmark_rules}} + - Dead end avoidance: {{dead_end_policy}} + - Multiple path options: {{branching_rules}} + - id: pacing-and-flow + title: Pacing and Flow + instruction: Define how to control the rhythm and pace of gameplay within levels + template: | + **Action Sequences:** + + - High intensity duration: {{max_duration}} + - Rest period requirement: {{min_rest_time}} + - Intensity variation: {{pacing_pattern}} + + **Learning Sequences:** + + - New mechanic introduction: {{teaching_method}} + - Practice opportunity: {{practice_duration}} + - Skill application: {{application_context}} + - id: challenge-design + title: Challenge Design + instruction: Define how to create appropriate challenges for each level type + template: | + **Challenge Types:** + + - Execution challenges: {{skill_requirements}} + - Puzzle challenges: {{complexity_guidelines}} + - Time challenges: {{time_pressure_rules}} + - Resource challenges: {{resource_management}} + + **Difficulty Calibration:** + + - Skill check frequency: {{frequency_guidelines}} + - Failure recovery: {{retry_mechanics}} + - Hint system integration: {{help_system}} + + - id: technical-implementation + title: Technical Implementation + instruction: Define technical requirements for level implementation + sections: + - id: level-data-structure + title: Level Data Structure + instruction: Define how level data should be structured for implementation + template: | + **Level File Format:** + + - Data format: {{json|yaml|custom}} + - File naming: `level_{{world}}_{{number}}.{{extension}}` + - Data organization: {{structure_description}} + sections: + - id: required-data-fields + title: Required Data Fields + type: code + language: json + template: | + { + "levelId": "{{unique_identifier}}", + "worldId": "{{world_identifier}}", + "difficulty": {{difficulty_value}}, + "targetTime": {{completion_time_seconds}}, + "objectives": { + "primary": "{{primary_objective}}", + "secondary": ["{{secondary_objectives}}"], + "hidden": ["{{secret_objectives}}"] + }, + "layout": { + "width": {{grid_width}}, + "height": {{grid_height}}, + "tilemap": "{{tilemap_reference}}" + }, + "entities": [ + { + "type": "{{entity_type}}", + "position": {"x": {{x}}, "y": {{y}}}, + "properties": {{entity_properties}} + } + ] + } + - id: asset-integration + title: Asset Integration + instruction: Define how level assets are organized and loaded + template: | + **Tilemap Requirements:** + + - Tile size: {{tile_dimensions}}px + - Tileset organization: {{tileset_structure}} + - Layer organization: {{layer_system}} + - Collision data: {{collision_format}} + + **Audio Integration:** + + - Background music: {{music_requirements}} + - Ambient sounds: {{ambient_system}} + - Dynamic audio: {{dynamic_audio_rules}} + - id: performance-optimization + title: Performance Optimization + instruction: Define performance requirements for level systems + template: | + **Entity Limits:** + + - Maximum active entities: {{entity_limit}} + - Maximum particles: {{particle_limit}} + - Maximum audio sources: {{audio_limit}} + + **Memory Management:** + + - Texture memory budget: {{texture_memory}}MB + - Audio memory budget: {{audio_memory}}MB + - Level loading time: <{{load_time}}s + + **Culling and LOD:** + + - Off-screen culling: {{culling_distance}} + - Level-of-detail rules: {{lod_system}} + - Asset streaming: {{streaming_requirements}} + + - id: level-testing-framework + title: Level Testing Framework + instruction: Define how levels should be tested and validated + sections: + - id: automated-testing + title: Automated Testing + template: | + **Performance Testing:** + + - Frame rate validation: Maintain {{fps_target}} FPS + - Memory usage monitoring: Stay under {{memory_limit}}MB + - Loading time verification: Complete in <{{load_time}}s + + **Gameplay Testing:** + + - Completion path validation: All objectives achievable + - Collectible accessibility: All items reachable + - Softlock prevention: No unwinnable states + - id: manual-testing-protocol + title: Manual Testing Protocol + sections: + - id: playtesting-checklist + title: Playtesting Checklist + type: checklist + items: + - "Level completes within target time range" + - "All mechanics function correctly" + - "Difficulty feels appropriate for level category" + - "Player guidance is clear and effective" + - "No exploits or sequence breaks (unless intended)" + - id: player-experience-testing + title: Player Experience Testing + type: checklist + items: + - "Tutorial levels teach effectively" + - "Challenge feels fair and rewarding" + - "Flow and pacing maintain engagement" + - "Audio and visual feedback support gameplay" + - id: balance-validation + title: Balance Validation + template: | + **Metrics Collection:** + + - Completion rate: Target {{completion_percentage}}% + - Average completion time: {{target_time}} ± {{variance}} + - Death count per level: <{{max_deaths}} + - Collectible discovery rate: {{discovery_percentage}}% + + **Iteration Guidelines:** + + - Adjustment criteria: {{criteria_for_changes}} + - Testing sample size: {{minimum_testers}} + - Validation period: {{testing_duration}} + + - id: content-creation-pipeline + title: Content Creation Pipeline + instruction: Define the workflow for creating new levels + sections: + - id: design-phase + title: Design Phase + template: | + **Concept Development:** + + 1. Define level purpose and goals + 2. Create rough layout sketch + 3. Identify key mechanics and challenges + 4. Estimate difficulty and duration + + **Documentation Requirements:** + + - Level design brief + - Layout diagrams + - Mechanic integration notes + - Asset requirement list + - id: implementation-phase + title: Implementation Phase + template: | + **Technical Implementation:** + + 1. Create level data file + 2. Build tilemap and layout + 3. Place entities and objects + 4. Configure level logic and triggers + 5. Integrate audio and visual effects + + **Quality Assurance:** + + 1. Automated testing execution + 2. Internal playtesting + 3. Performance validation + 4. Bug fixing and polish + - id: integration-phase + title: Integration Phase + template: | + **Game Integration:** + + 1. Level progression integration + 2. Save system compatibility + 3. Analytics integration + 4. Achievement system integration + + **Final Validation:** + + 1. Full game context testing + 2. Performance regression testing + 3. Platform compatibility verification + 4. Final approval and release + + - id: success-metrics + title: Success Metrics + instruction: Define how to measure level design success + sections: + - id: player-engagement + title: Player Engagement + type: bullet-list + template: | + - Level completion rate: {{target_rate}}% + - Replay rate: {{replay_target}}% + - Time spent per level: {{engagement_time}} + - Player satisfaction scores: {{satisfaction_target}}/10 + - id: technical-performance + title: Technical Performance + type: bullet-list + template: | + - Frame rate consistency: {{fps_consistency}}% + - Loading time compliance: {{load_compliance}}% + - Memory usage efficiency: {{memory_efficiency}}% + - Crash rate: <{{crash_threshold}}% + - id: design-quality + title: Design Quality + type: bullet-list + template: | + - Difficulty curve adherence: {{curve_accuracy}} + - Mechanic integration effectiveness: {{integration_score}} + - Player guidance clarity: {{guidance_score}} + - Content accessibility: {{accessibility_rate}}% +==================== END: .bmad-2d-phaser-game-dev/templates/level-design-doc-tmpl.yaml ==================== + +==================== START: .bmad-2d-phaser-game-dev/templates/game-brief-tmpl.yaml ==================== +template: + id: game-brief-template-v2 + name: Game Brief + version: 2.0 + output: + format: markdown + filename: "docs/{{game_name}}-game-brief.md" + title: "{{game_title}} Game Brief" + +workflow: + mode: interactive + +sections: + - id: initial-setup + instruction: | + This template creates a comprehensive game brief that serves as the foundation for all subsequent game development work. The brief should capture the essential vision, scope, and requirements needed to create a detailed Game Design Document. + + This brief is typically created early in the ideation process, often after brainstorming sessions, to crystallize the game concept before moving into detailed design. + + - id: game-vision + title: Game Vision + instruction: Establish the core vision and identity of the game. Present each subsection and gather user feedback before proceeding. + sections: + - id: core-concept + title: Core Concept + instruction: 2-3 sentences that clearly capture what the game is and why it will be compelling to players + - id: elevator-pitch + title: Elevator Pitch + instruction: Single sentence that captures the essence of the game in a memorable way + template: | + **"{{game_description_in_one_sentence}}"** + - id: vision-statement + title: Vision Statement + instruction: Inspirational statement about what the game will achieve for players and why it matters + + - id: target-market + title: Target Market + instruction: Define the audience and market context. Apply `tasks#advanced-elicitation` after presenting this section. + sections: + - id: primary-audience + title: Primary Audience + template: | + **Demographics:** {{age_range}}, {{platform_preference}}, {{gaming_experience}} + **Psychographics:** {{interests}}, {{motivations}}, {{play_patterns}} + **Gaming Preferences:** {{preferred_genres}}, {{session_length}}, {{difficulty_preference}} + - id: secondary-audiences + title: Secondary Audiences + template: | + **Audience 2:** {{description}} + **Audience 3:** {{description}} + - id: market-context + title: Market Context + template: | + **Genre:** {{primary_genre}} / {{secondary_genre}} + **Platform Strategy:** {{platform_focus}} + **Competitive Positioning:** {{differentiation_statement}} + + - id: game-fundamentals + title: Game Fundamentals + instruction: Define the core gameplay elements. Each subsection should be specific enough to guide detailed design work. + sections: + - id: core-gameplay-pillars + title: Core Gameplay Pillars + instruction: 3-5 fundamental principles that guide all design decisions + type: numbered-list + template: | + **{{pillar_name}}** - {{description_and_rationale}} + - id: primary-mechanics + title: Primary Mechanics + instruction: List the 3-5 most important gameplay mechanics that define the player experience + repeatable: true + template: | + **Core Mechanic: {{mechanic_name}}** + + - **Description:** {{how_it_works}} + - **Player Value:** {{why_its_fun}} + - **Implementation Scope:** {{complexity_estimate}} + - id: player-experience-goals + title: Player Experience Goals + instruction: Define what emotions and experiences the game should create for players + template: | + **Primary Experience:** {{main_emotional_goal}} + **Secondary Experiences:** {{supporting_emotional_goals}} + **Engagement Pattern:** {{how_player_engagement_evolves}} + + - id: scope-constraints + title: Scope and Constraints + instruction: Define the boundaries and limitations that will shape development. Apply `tasks#advanced-elicitation` to clarify any constraints. + sections: + - id: project-scope + title: Project Scope + template: | + **Game Length:** {{estimated_content_hours}} + **Content Volume:** {{levels_areas_content_amount}} + **Feature Complexity:** {{simple|moderate|complex}} + **Scope Comparison:** "Similar to {{reference_game}} but with {{key_differences}}" + - id: technical-constraints + title: Technical Constraints + template: | + **Platform Requirements:** + + - Primary: {{platform_1}} - {{requirements}} + - Secondary: {{platform_2}} - {{requirements}} + + **Technical Specifications:** + + - Engine: Phaser 3 + TypeScript + - Performance Target: {{fps_target}} FPS on {{target_device}} + - Memory Budget: <{{memory_limit}}MB + - Load Time Goal: <{{load_time_seconds}}s + - id: resource-constraints + title: Resource Constraints + template: | + **Team Size:** {{team_composition}} + **Timeline:** {{development_duration}} + **Budget Considerations:** {{budget_constraints_or_targets}} + **Asset Requirements:** {{art_audio_content_needs}} + - id: business-constraints + title: Business Constraints + condition: has_business_goals + template: | + **Monetization Model:** {{free|premium|freemium|subscription}} + **Revenue Goals:** {{revenue_targets_if_applicable}} + **Platform Requirements:** {{store_certification_needs}} + **Launch Timeline:** {{target_launch_window}} + + - id: reference-framework + title: Reference Framework + instruction: Provide context through references and competitive analysis + sections: + - id: inspiration-games + title: Inspiration Games + sections: + - id: primary-references + title: Primary References + type: numbered-list + repeatable: true + template: | + **{{reference_game}}** - {{what_we_learn_from_it}} + - id: competitive-analysis + title: Competitive Analysis + template: | + **Direct Competitors:** + + - {{competitor_1}}: {{strengths_and_weaknesses}} + - {{competitor_2}}: {{strengths_and_weaknesses}} + + **Differentiation Strategy:** + {{how_we_differ_and_why_thats_valuable}} + - id: market-opportunity + title: Market Opportunity + template: | + **Market Gap:** {{underserved_need_or_opportunity}} + **Timing Factors:** {{why_now_is_the_right_time}} + **Success Metrics:** {{how_well_measure_success}} + + - id: content-framework + title: Content Framework + instruction: Outline the content structure and progression without full design detail + sections: + - id: game-structure + title: Game Structure + template: | + **Overall Flow:** {{linear|hub_world|open_world|procedural}} + **Progression Model:** {{how_players_advance}} + **Session Structure:** {{typical_play_session_flow}} + - id: content-categories + title: Content Categories + template: | + **Core Content:** + + - {{content_type_1}}: {{quantity_and_description}} + - {{content_type_2}}: {{quantity_and_description}} + + **Optional Content:** + + - {{optional_content_type}}: {{quantity_and_description}} + + **Replay Elements:** + + - {{replayability_features}} + - id: difficulty-accessibility + title: Difficulty and Accessibility + template: | + **Difficulty Approach:** {{how_challenge_is_structured}} + **Accessibility Features:** {{planned_accessibility_support}} + **Skill Requirements:** {{what_skills_players_need}} + + - id: art-audio-direction + title: Art and Audio Direction + instruction: Establish the aesthetic vision that will guide asset creation + sections: + - id: visual-style + title: Visual Style + template: | + **Art Direction:** {{style_description}} + **Reference Materials:** {{visual_inspiration_sources}} + **Technical Approach:** {{2d_style_pixel_vector_etc}} + **Color Strategy:** {{color_palette_mood}} + - id: audio-direction + title: Audio Direction + template: | + **Music Style:** {{genre_and_mood}} + **Sound Design:** {{audio_personality}} + **Implementation Needs:** {{technical_audio_requirements}} + - id: ui-ux-approach + title: UI/UX Approach + template: | + **Interface Style:** {{ui_aesthetic}} + **User Experience Goals:** {{ux_priorities}} + **Platform Adaptations:** {{cross_platform_considerations}} + + - id: risk-assessment + title: Risk Assessment + instruction: Identify potential challenges and mitigation strategies + sections: + - id: technical-risks + title: Technical Risks + type: table + template: | + | Risk | Probability | Impact | Mitigation Strategy | + | ---- | ----------- | ------ | ------------------- | + | {{technical_risk}} | {{high|med|low}} | {{high|med|low}} | {{mitigation_approach}} | + - id: design-risks + title: Design Risks + type: table + template: | + | Risk | Probability | Impact | Mitigation Strategy | + | ---- | ----------- | ------ | ------------------- | + | {{design_risk}} | {{high|med|low}} | {{high|med|low}} | {{mitigation_approach}} | + - id: market-risks + title: Market Risks + type: table + template: | + | Risk | Probability | Impact | Mitigation Strategy | + | ---- | ----------- | ------ | ------------------- | + | {{market_risk}} | {{high|med|low}} | {{high|med|low}} | {{mitigation_approach}} | + + - id: success-criteria + title: Success Criteria + instruction: Define measurable goals for the project + sections: + - id: player-experience-metrics + title: Player Experience Metrics + template: | + **Engagement Goals:** + + - Tutorial completion rate: >{{percentage}}% + - Average session length: {{duration}} minutes + - Player retention: D1 {{d1}}%, D7 {{d7}}%, D30 {{d30}}% + + **Quality Benchmarks:** + + - Player satisfaction: >{{rating}}/10 + - Completion rate: >{{percentage}}% + - Technical performance: {{fps_target}} FPS consistent + - id: development-metrics + title: Development Metrics + template: | + **Technical Targets:** + + - Zero critical bugs at launch + - Performance targets met on all platforms + - Load times under {{seconds}}s + + **Process Goals:** + + - Development timeline adherence + - Feature scope completion + - Quality assurance standards + - id: business-metrics + title: Business Metrics + condition: has_business_goals + template: | + **Commercial Goals:** + + - {{revenue_target}} in first {{time_period}} + - {{user_acquisition_target}} players in first {{time_period}} + - {{retention_target}} monthly active users + + - id: next-steps + title: Next Steps + instruction: Define immediate actions following the brief completion + sections: + - id: immediate-actions + title: Immediate Actions + type: numbered-list + template: | + **{{action_item}}** - {{details_and_timeline}} + - id: development-roadmap + title: Development Roadmap + sections: + - id: phase-1-preproduction + title: "Phase 1: Pre-Production ({{duration}})" + type: bullet-list + template: | + - Detailed Game Design Document creation + - Technical architecture planning + - Art style exploration and pipeline setup + - id: phase-2-prototype + title: "Phase 2: Prototype ({{duration}})" + type: bullet-list + template: | + - Core mechanic implementation + - Technical proof of concept + - Initial playtesting and iteration + - id: phase-3-production + title: "Phase 3: Production ({{duration}})" + type: bullet-list + template: | + - Full feature development + - Content creation and integration + - Comprehensive testing and optimization + - id: documentation-pipeline + title: Documentation Pipeline + sections: + - id: required-documents + title: Required Documents + type: numbered-list + template: | + Game Design Document (GDD) - {{target_completion}} + Technical Architecture Document - {{target_completion}} + Art Style Guide - {{target_completion}} + Production Plan - {{target_completion}} + - id: validation-plan + title: Validation Plan + template: | + **Concept Testing:** + + - {{validation_method_1}} - {{timeline}} + - {{validation_method_2}} - {{timeline}} + + **Prototype Testing:** + + - {{testing_approach}} - {{timeline}} + - {{feedback_collection_method}} - {{timeline}} + + - id: appendices + title: Appendices + sections: + - id: research-materials + title: Research Materials + instruction: Include any supporting research, competitive analysis, or market data that informed the brief + - id: brainstorming-notes + title: Brainstorming Session Notes + instruction: Reference any brainstorming sessions that led to this brief + - id: stakeholder-input + title: Stakeholder Input + instruction: Include key input from stakeholders that shaped the vision + - id: change-log + title: Change Log + instruction: Track document versions and changes + type: table + template: | + | Date | Version | Description | Author | + | :--- | :------ | :---------- | :----- | +==================== END: .bmad-2d-phaser-game-dev/templates/game-brief-tmpl.yaml ==================== ==================== START: .bmad-2d-phaser-game-dev/checklists/game-design-checklist.md ==================== # Game Design Document Quality Checklist @@ -5365,568 +5501,621 @@ _List any critical items that need attention before moving to implementation pha _Outline immediate next actions for the team based on this assessment._ ==================== END: .bmad-2d-phaser-game-dev/checklists/game-design-checklist.md ==================== -==================== START: .bmad-2d-phaser-game-dev/templates/game-architecture-tmpl.md ==================== -# {{Game Title}} Game Architecture Document - -[[LLM: This template creates a comprehensive game architecture document specifically for Phaser 3 + TypeScript projects. This should provide the technical foundation for all game development stories and epics. - -If available, review any provided documents: Game Design Document (GDD), Technical Preferences. This architecture should support all game mechanics defined in the GDD.]] - -## Introduction - -[[LLM: Establish the document's purpose and scope for game development]] - -This document outlines the complete technical architecture for {{Game Title}}, a 2D game built with Phaser 3 and TypeScript. It serves as the technical foundation for AI-driven game development, ensuring consistency and scalability across all game systems. - -This architecture is designed to support the gameplay mechanics defined in the Game Design Document while maintaining 60 FPS performance and cross-platform compatibility. - -### Change Log - -[[LLM: Track document versions and changes]] - -| Date | Version | Description | Author | -| :--- | :------ | :---------- | :----- | - -## Technical Overview - -[[LLM: Present all subsections together, then apply `tasks#advanced-elicitation` protocol to the complete section.]] - -### Architecture Summary - -[[LLM: Provide a comprehensive overview covering: - -- Game engine choice and configuration -- Project structure and organization -- Key systems and their interactions -- Performance and optimization strategy -- How this architecture achieves GDD requirements]] - -### Platform Targets - -[[LLM: Based on GDD requirements, confirm platform support]] - -**Primary Platform:** {{primary_platform}} -**Secondary Platforms:** {{secondary_platforms}} -**Minimum Requirements:** {{min_specs}} -**Target Performance:** 60 FPS on {{target_device}} - -### Technology Stack - -**Core Engine:** Phaser 3.70+ -**Language:** TypeScript 5.0+ (Strict Mode) -**Build Tool:** {{build_tool}} (Webpack/Vite/Parcel) -**Package Manager:** {{package_manager}} -**Testing:** {{test_framework}} -**Deployment:** {{deployment_platform}} - -## Project Structure - -[[LLM: Define the complete project organization that developers will follow]] - -### Repository Organization - -[[LLM: Design a clear folder structure for game development]] - -```text -{{game_name}}/ -├── src/ -│ ├── scenes/ # Game scenes -│ ├── gameObjects/ # Custom game objects -│ ├── systems/ # Core game systems -│ ├── utils/ # Utility functions -│ ├── types/ # TypeScript type definitions -│ ├── config/ # Game configuration -│ └── main.ts # Entry point -├── assets/ -│ ├── images/ # Sprite assets -│ ├── audio/ # Sound files -│ ├── data/ # JSON data files -│ └── fonts/ # Font files -├── public/ # Static web assets -├── tests/ # Test files -├── docs/ # Documentation -│ ├── stories/ # Development stories -│ └── architecture/ # Technical docs -└── dist/ # Built game files -``` - -### Module Organization - -[[LLM: Define how TypeScript modules should be organized]] - -**Scene Structure:** - -- Each scene in separate file -- Scene-specific logic contained -- Clear data passing between scenes - -**Game Object Pattern:** - -- Component-based architecture -- Reusable game object classes -- Type-safe property definitions - -**System Architecture:** - -- Singleton managers for global systems -- Event-driven communication -- Clear separation of concerns - -## Core Game Systems - -[[LLM: Detail each major system that needs to be implemented. Each system should be specific enough for developers to create implementation stories.]] - -### Scene Management System - -**Purpose:** Handle game flow and scene transitions - -**Key Components:** - -- Scene loading and unloading -- Data passing between scenes -- Transition effects -- Memory management - -**Implementation Requirements:** - -- Preload scene for asset loading -- Menu system with navigation -- Gameplay scenes with state management -- Pause/resume functionality - -**Files to Create:** - -- `src/scenes/BootScene.ts` -- `src/scenes/PreloadScene.ts` -- `src/scenes/MenuScene.ts` -- `src/scenes/GameScene.ts` -- `src/systems/SceneManager.ts` - -### Game State Management - -**Purpose:** Track player progress and game status - -**State Categories:** - -- Player progress (levels, unlocks) -- Game settings (audio, controls) -- Session data (current level, score) -- Persistent data (achievements, statistics) - -**Implementation Requirements:** - -- Save/load system with localStorage -- State validation and error recovery -- Cross-session data persistence -- Settings management - -**Files to Create:** - -- `src/systems/GameState.ts` -- `src/systems/SaveManager.ts` -- `src/types/GameData.ts` - -### Asset Management System - -**Purpose:** Efficient loading and management of game assets - -**Asset Categories:** - -- Sprite sheets and animations -- Audio files and music -- Level data and configurations -- UI assets and fonts - -**Implementation Requirements:** - -- Progressive loading strategy -- Asset caching and optimization -- Error handling for failed loads -- Memory management for large assets - -**Files to Create:** - -- `src/systems/AssetManager.ts` -- `src/config/AssetConfig.ts` -- `src/utils/AssetLoader.ts` - -### Input Management System - -**Purpose:** Handle all player input across platforms - -**Input Types:** - -- Keyboard controls -- Mouse/pointer interaction -- Touch gestures (mobile) -- Gamepad support (optional) - -**Implementation Requirements:** - -- Input mapping and configuration -- Touch-friendly mobile controls -- Input buffering for responsive gameplay -- Customizable control schemes - -**Files to Create:** - -- `src/systems/InputManager.ts` -- `src/utils/TouchControls.ts` -- `src/types/InputTypes.ts` - -### Game Mechanics Systems - -[[LLM: For each major mechanic defined in the GDD, create a system specification]] - -<> - -#### {{mechanic_name}} System - -**Purpose:** {{system_purpose}} - -**Core Functionality:** - -- {{feature_1}} -- {{feature_2}} -- {{feature_3}} - -**Dependencies:** {{required_systems}} - -**Performance Considerations:** {{optimization_notes}} - -**Files to Create:** - -- `src/systems/{{SystemName}}.ts` -- `src/gameObjects/{{RelatedObject}}.ts` -- `src/types/{{SystemTypes}}.ts` - -<> - -### Physics & Collision System - -**Physics Engine:** {{physics_choice}} (Arcade Physics/Matter.js) - -**Collision Categories:** - -- Player collision -- Enemy interactions -- Environmental objects -- Collectibles and items - -**Implementation Requirements:** - -- Optimized collision detection -- Physics body management -- Collision callbacks and events -- Performance monitoring - -**Files to Create:** - -- `src/systems/PhysicsManager.ts` -- `src/utils/CollisionGroups.ts` - -### Audio System - -**Audio Requirements:** - -- Background music with looping -- Sound effects for actions -- Audio settings and volume control -- Mobile audio optimization - -**Implementation Features:** - -- Audio sprite management -- Dynamic music system -- Spatial audio (if applicable) -- Audio pooling for performance - -**Files to Create:** - -- `src/systems/AudioManager.ts` -- `src/config/AudioConfig.ts` - -### UI System - -**UI Components:** - -- HUD elements (score, health, etc.) -- Menu navigation -- Modal dialogs -- Settings screens - -**Implementation Requirements:** - -- Responsive layout system -- Touch-friendly interface -- Keyboard navigation support -- Animation and transitions - -**Files to Create:** - -- `src/systems/UIManager.ts` -- `src/gameObjects/UI/` -- `src/types/UITypes.ts` - -## Performance Architecture - -[[LLM: Define performance requirements and optimization strategies]] - -### Performance Targets - -**Frame Rate:** 60 FPS sustained, 30 FPS minimum -**Memory Usage:** <{{memory_limit}}MB total -**Load Times:** <{{initial_load}}s initial, <{{level_load}}s per level -**Battery Optimization:** Reduced updates when not visible - -### Optimization Strategies - -**Object Pooling:** - -- Bullets and projectiles -- Particle effects -- Enemy objects -- UI elements - -**Asset Optimization:** - -- Texture atlases for sprites -- Audio compression -- Lazy loading for large assets -- Progressive enhancement - -**Rendering Optimization:** - -- Sprite batching -- Culling off-screen objects -- Reduced particle counts on mobile -- Texture resolution scaling - -**Files to Create:** - -- `src/utils/ObjectPool.ts` -- `src/utils/PerformanceMonitor.ts` -- `src/config/OptimizationConfig.ts` - -## Game Configuration - -[[LLM: Define all configurable aspects of the game]] - -### Phaser Configuration - -```typescript -// src/config/GameConfig.ts -const gameConfig: Phaser.Types.Core.GameConfig = { - type: Phaser.AUTO, - width: {{game_width}}, - height: {{game_height}}, - scale: { - mode: {{scale_mode}}, - autoCenter: Phaser.Scale.CENTER_BOTH - }, - physics: { - default: '{{physics_system}}', - {{physics_system}}: { - gravity: { y: {{gravity}} }, - debug: false - } - }, - // Additional configuration... -}; -``` - -### Game Balance Configuration - -[[LLM: Based on GDD, define configurable game parameters]] - -```typescript -// src/config/GameBalance.ts -export const GameBalance = { - player: { - speed: {{player_speed}}, - health: {{player_health}}, - // Additional player parameters... - }, - difficulty: { - easy: {{easy_params}}, - normal: {{normal_params}}, - hard: {{hard_params}} - }, - // Additional balance parameters... -}; -``` - -## Development Guidelines - -[[LLM: Provide coding standards specific to game development]] - -### TypeScript Standards - -**Type Safety:** - -- Use strict mode -- Define interfaces for all data structures -- Avoid `any` type usage -- Use enums for game states - -**Code Organization:** - -- One class per file -- Clear naming conventions -- Proper error handling -- Comprehensive documentation - -### Phaser 3 Best Practices - -**Scene Management:** - -- Clean up resources in shutdown() -- Use scene data for communication -- Implement proper event handling -- Avoid memory leaks - -**Game Object Design:** - -- Extend Phaser classes appropriately -- Use component-based architecture -- Implement object pooling where needed -- Follow consistent update patterns - -### Testing Strategy - -**Unit Testing:** - -- Test game logic separately from Phaser -- Mock Phaser dependencies -- Test utility functions -- Validate game balance calculations - -**Integration Testing:** - -- Scene loading and transitions -- Save/load functionality -- Input handling -- Performance benchmarks - -**Files to Create:** - -- `tests/utils/GameLogic.test.ts` -- `tests/systems/SaveManager.test.ts` -- `tests/performance/FrameRate.test.ts` - -## Deployment Architecture - -[[LLM: Define how the game will be built and deployed]] - -### Build Process - -**Development Build:** - -- Fast compilation -- Source maps enabled -- Debug logging active -- Hot reload support - -**Production Build:** - -- Minified and optimized -- Asset compression -- Performance monitoring -- Error tracking - -### Deployment Strategy - -**Web Deployment:** - -- Static hosting ({{hosting_platform}}) -- CDN for assets -- Progressive loading -- Browser compatibility - -**Mobile Packaging:** - -- Cordova/Capacitor wrapper -- Platform-specific optimization -- App store requirements -- Performance testing - -## Implementation Roadmap - -[[LLM: Break down the architecture implementation into phases that align with the GDD development phases]] - -### Phase 1: Foundation ({{duration}}) - -**Core Systems:** - -- Project setup and configuration -- Basic scene management -- Asset loading pipeline -- Input handling framework - -**Story Epics:** - -- "Engine Setup and Configuration" -- "Basic Scene Management System" -- "Asset Loading Foundation" - -### Phase 2: Game Systems ({{duration}}) - -**Gameplay Systems:** - -- {{primary_mechanic}} implementation -- Physics and collision system -- Game state management -- UI framework - -**Story Epics:** - -- "{{Primary_Mechanic}} System Implementation" -- "Physics and Collision Framework" -- "Game State Management System" - -### Phase 3: Content & Polish ({{duration}}) - -**Content Systems:** - -- Level loading and management -- Audio system integration -- Performance optimization -- Final polish and testing - -**Story Epics:** - -- "Level Management System" -- "Audio Integration and Optimization" -- "Performance Optimization and Testing" - -## Risk Assessment - -[[LLM: Identify potential technical risks and mitigation strategies]] - -| Risk | Probability | Impact | Mitigation Strategy | -| ---------------------------- | ----------- | ---------- | ------------------- | -| Performance issues on mobile | {{prob}} | {{impact}} | {{mitigation}} | -| Asset loading bottlenecks | {{prob}} | {{impact}} | {{mitigation}} | -| Cross-platform compatibility | {{prob}} | {{impact}} | {{mitigation}} | - -## Success Criteria - -[[LLM: Define measurable technical success criteria]] - -**Technical Metrics:** - -- All systems implemented per specification -- Performance targets met consistently -- Zero critical bugs in core systems -- Successful deployment across target platforms - -**Code Quality:** - -- 90%+ test coverage on game logic -- Zero TypeScript errors in strict mode -- Consistent adherence to coding standards -- Comprehensive documentation coverage -==================== END: .bmad-2d-phaser-game-dev/templates/game-architecture-tmpl.md ==================== +==================== START: .bmad-2d-phaser-game-dev/templates/game-architecture-tmpl.yaml ==================== +template: + id: game-architecture-template-v2 + name: Game Architecture Document + version: 2.0 + output: + format: markdown + filename: "docs/{{game_name}}-game-architecture.md" + title: "{{game_title}} Game Architecture Document" + +workflow: + mode: interactive + +sections: + - id: initial-setup + instruction: | + This template creates a comprehensive game architecture document specifically for Phaser 3 + TypeScript projects. This should provide the technical foundation for all game development stories and epics. + + If available, review any provided documents: Game Design Document (GDD), Technical Preferences. This architecture should support all game mechanics defined in the GDD. + + - id: introduction + title: Introduction + instruction: Establish the document's purpose and scope for game development + content: | + This document outlines the complete technical architecture for {{game_title}}, a 2D game built with Phaser 3 and TypeScript. It serves as the technical foundation for AI-driven game development, ensuring consistency and scalability across all game systems. + + This architecture is designed to support the gameplay mechanics defined in the Game Design Document while maintaining 60 FPS performance and cross-platform compatibility. + sections: + - id: change-log + title: Change Log + instruction: Track document versions and changes + type: table + template: | + | Date | Version | Description | Author | + | :--- | :------ | :---------- | :----- | + + - id: technical-overview + title: Technical Overview + instruction: Present all subsections together, then apply `tasks#advanced-elicitation` protocol to the complete section. + sections: + - id: architecture-summary + title: Architecture Summary + instruction: | + Provide a comprehensive overview covering: + + - Game engine choice and configuration + - Project structure and organization + - Key systems and their interactions + - Performance and optimization strategy + - How this architecture achieves GDD requirements + - id: platform-targets + title: Platform Targets + instruction: Based on GDD requirements, confirm platform support + template: | + **Primary Platform:** {{primary_platform}} + **Secondary Platforms:** {{secondary_platforms}} + **Minimum Requirements:** {{min_specs}} + **Target Performance:** 60 FPS on {{target_device}} + - id: technology-stack + title: Technology Stack + template: | + **Core Engine:** Phaser 3.70+ + **Language:** TypeScript 5.0+ (Strict Mode) + **Build Tool:** {{build_tool}} (Webpack/Vite/Parcel) + **Package Manager:** {{package_manager}} + **Testing:** {{test_framework}} + **Deployment:** {{deployment_platform}} + + - id: project-structure + title: Project Structure + instruction: Define the complete project organization that developers will follow + sections: + - id: repository-organization + title: Repository Organization + instruction: Design a clear folder structure for game development + type: code + language: text + template: | + {{game_name}}/ + ├── src/ + │ ├── scenes/ # Game scenes + │ ├── gameObjects/ # Custom game objects + │ ├── systems/ # Core game systems + │ ├── utils/ # Utility functions + │ ├── types/ # TypeScript type definitions + │ ├── config/ # Game configuration + │ └── main.ts # Entry point + ├── assets/ + │ ├── images/ # Sprite assets + │ ├── audio/ # Sound files + │ ├── data/ # JSON data files + │ └── fonts/ # Font files + ├── public/ # Static web assets + ├── tests/ # Test files + ├── docs/ # Documentation + │ ├── stories/ # Development stories + │ └── architecture/ # Technical docs + └── dist/ # Built game files + - id: module-organization + title: Module Organization + instruction: Define how TypeScript modules should be organized + sections: + - id: scene-structure + title: Scene Structure + type: bullet-list + template: | + - Each scene in separate file + - Scene-specific logic contained + - Clear data passing between scenes + - id: game-object-pattern + title: Game Object Pattern + type: bullet-list + template: | + - Component-based architecture + - Reusable game object classes + - Type-safe property definitions + - id: system-architecture + title: System Architecture + type: bullet-list + template: | + - Singleton managers for global systems + - Event-driven communication + - Clear separation of concerns + + - id: core-game-systems + title: Core Game Systems + instruction: Detail each major system that needs to be implemented. Each system should be specific enough for developers to create implementation stories. + sections: + - id: scene-management + title: Scene Management System + template: | + **Purpose:** Handle game flow and scene transitions + + **Key Components:** + + - Scene loading and unloading + - Data passing between scenes + - Transition effects + - Memory management + + **Implementation Requirements:** + + - Preload scene for asset loading + - Menu system with navigation + - Gameplay scenes with state management + - Pause/resume functionality + + **Files to Create:** + + - `src/scenes/BootScene.ts` + - `src/scenes/PreloadScene.ts` + - `src/scenes/MenuScene.ts` + - `src/scenes/GameScene.ts` + - `src/systems/SceneManager.ts` + - id: game-state-management + title: Game State Management + template: | + **Purpose:** Track player progress and game status + + **State Categories:** + + - Player progress (levels, unlocks) + - Game settings (audio, controls) + - Session data (current level, score) + - Persistent data (achievements, statistics) + + **Implementation Requirements:** + + - Save/load system with localStorage + - State validation and error recovery + - Cross-session data persistence + - Settings management + + **Files to Create:** + + - `src/systems/GameState.ts` + - `src/systems/SaveManager.ts` + - `src/types/GameData.ts` + - id: asset-management + title: Asset Management System + template: | + **Purpose:** Efficient loading and management of game assets + + **Asset Categories:** + + - Sprite sheets and animations + - Audio files and music + - Level data and configurations + - UI assets and fonts + + **Implementation Requirements:** + + - Progressive loading strategy + - Asset caching and optimization + - Error handling for failed loads + - Memory management for large assets + + **Files to Create:** + + - `src/systems/AssetManager.ts` + - `src/config/AssetConfig.ts` + - `src/utils/AssetLoader.ts` + - id: input-management + title: Input Management System + template: | + **Purpose:** Handle all player input across platforms + + **Input Types:** + + - Keyboard controls + - Mouse/pointer interaction + - Touch gestures (mobile) + - Gamepad support (optional) + + **Implementation Requirements:** + + - Input mapping and configuration + - Touch-friendly mobile controls + - Input buffering for responsive gameplay + - Customizable control schemes + + **Files to Create:** + + - `src/systems/InputManager.ts` + - `src/utils/TouchControls.ts` + - `src/types/InputTypes.ts` + - id: game-mechanics-systems + title: Game Mechanics Systems + instruction: For each major mechanic defined in the GDD, create a system specification + repeatable: true + sections: + - id: mechanic-system + title: "{{mechanic_name}} System" + template: | + **Purpose:** {{system_purpose}} + + **Core Functionality:** + + - {{feature_1}} + - {{feature_2}} + - {{feature_3}} + + **Dependencies:** {{required_systems}} + + **Performance Considerations:** {{optimization_notes}} + + **Files to Create:** + + - `src/systems/{{system_name}}.ts` + - `src/gameObjects/{{related_object}}.ts` + - `src/types/{{system_types}}.ts` + - id: physics-collision + title: Physics & Collision System + template: | + **Physics Engine:** {{physics_choice}} (Arcade Physics/Matter.js) + + **Collision Categories:** + + - Player collision + - Enemy interactions + - Environmental objects + - Collectibles and items + + **Implementation Requirements:** + + - Optimized collision detection + - Physics body management + - Collision callbacks and events + - Performance monitoring + + **Files to Create:** + + - `src/systems/PhysicsManager.ts` + - `src/utils/CollisionGroups.ts` + - id: audio-system + title: Audio System + template: | + **Audio Requirements:** + + - Background music with looping + - Sound effects for actions + - Audio settings and volume control + - Mobile audio optimization + + **Implementation Features:** + + - Audio sprite management + - Dynamic music system + - Spatial audio (if applicable) + - Audio pooling for performance + + **Files to Create:** + + - `src/systems/AudioManager.ts` + - `src/config/AudioConfig.ts` + - id: ui-system + title: UI System + template: | + **UI Components:** + + - HUD elements (score, health, etc.) + - Menu navigation + - Modal dialogs + - Settings screens + + **Implementation Requirements:** + + - Responsive layout system + - Touch-friendly interface + - Keyboard navigation support + - Animation and transitions + + **Files to Create:** + + - `src/systems/UIManager.ts` + - `src/gameObjects/UI/` + - `src/types/UITypes.ts` + + - id: performance-architecture + title: Performance Architecture + instruction: Define performance requirements and optimization strategies + sections: + - id: performance-targets + title: Performance Targets + template: | + **Frame Rate:** 60 FPS sustained, 30 FPS minimum + **Memory Usage:** <{{memory_limit}}MB total + **Load Times:** <{{initial_load}}s initial, <{{level_load}}s per level + **Battery Optimization:** Reduced updates when not visible + - id: optimization-strategies + title: Optimization Strategies + sections: + - id: object-pooling + title: Object Pooling + type: bullet-list + template: | + - Bullets and projectiles + - Particle effects + - Enemy objects + - UI elements + - id: asset-optimization + title: Asset Optimization + type: bullet-list + template: | + - Texture atlases for sprites + - Audio compression + - Lazy loading for large assets + - Progressive enhancement + - id: rendering-optimization + title: Rendering Optimization + type: bullet-list + template: | + - Sprite batching + - Culling off-screen objects + - Reduced particle counts on mobile + - Texture resolution scaling + - id: optimization-files + title: Files to Create + type: bullet-list + template: | + - `src/utils/ObjectPool.ts` + - `src/utils/PerformanceMonitor.ts` + - `src/config/OptimizationConfig.ts` + + - id: game-configuration + title: Game Configuration + instruction: Define all configurable aspects of the game + sections: + - id: phaser-configuration + title: Phaser Configuration + type: code + language: typescript + template: | + // src/config/GameConfig.ts + const gameConfig: Phaser.Types.Core.GameConfig = { + type: Phaser.AUTO, + width: {{game_width}}, + height: {{game_height}}, + scale: { + mode: {{scale_mode}}, + autoCenter: Phaser.Scale.CENTER_BOTH + }, + physics: { + default: '{{physics_system}}', + {{physics_system}}: { + gravity: { y: {{gravity}} }, + debug: false + } + }, + // Additional configuration... + }; + - id: game-balance-configuration + title: Game Balance Configuration + instruction: Based on GDD, define configurable game parameters + type: code + language: typescript + template: | + // src/config/GameBalance.ts + export const GameBalance = { + player: { + speed: {{player_speed}}, + health: {{player_health}}, + // Additional player parameters... + }, + difficulty: { + easy: {{easy_params}}, + normal: {{normal_params}}, + hard: {{hard_params}} + }, + // Additional balance parameters... + }; + + - id: development-guidelines + title: Development Guidelines + instruction: Provide coding standards specific to game development + sections: + - id: typescript-standards + title: TypeScript Standards + sections: + - id: type-safety + title: Type Safety + type: bullet-list + template: | + - Use strict mode + - Define interfaces for all data structures + - Avoid `any` type usage + - Use enums for game states + - id: code-organization + title: Code Organization + type: bullet-list + template: | + - One class per file + - Clear naming conventions + - Proper error handling + - Comprehensive documentation + - id: phaser-best-practices + title: Phaser 3 Best Practices + sections: + - id: scene-management-practices + title: Scene Management + type: bullet-list + template: | + - Clean up resources in shutdown() + - Use scene data for communication + - Implement proper event handling + - Avoid memory leaks + - id: game-object-design + title: Game Object Design + type: bullet-list + template: | + - Extend Phaser classes appropriately + - Use component-based architecture + - Implement object pooling where needed + - Follow consistent update patterns + - id: testing-strategy + title: Testing Strategy + sections: + - id: unit-testing + title: Unit Testing + type: bullet-list + template: | + - Test game logic separately from Phaser + - Mock Phaser dependencies + - Test utility functions + - Validate game balance calculations + - id: integration-testing + title: Integration Testing + type: bullet-list + template: | + - Scene loading and transitions + - Save/load functionality + - Input handling + - Performance benchmarks + - id: test-files + title: Files to Create + type: bullet-list + template: | + - `tests/utils/GameLogic.test.ts` + - `tests/systems/SaveManager.test.ts` + - `tests/performance/FrameRate.test.ts` + + - id: deployment-architecture + title: Deployment Architecture + instruction: Define how the game will be built and deployed + sections: + - id: build-process + title: Build Process + sections: + - id: development-build + title: Development Build + type: bullet-list + template: | + - Fast compilation + - Source maps enabled + - Debug logging active + - Hot reload support + - id: production-build + title: Production Build + type: bullet-list + template: | + - Minified and optimized + - Asset compression + - Performance monitoring + - Error tracking + - id: deployment-strategy + title: Deployment Strategy + sections: + - id: web-deployment + title: Web Deployment + type: bullet-list + template: | + - Static hosting ({{hosting_platform}}) + - CDN for assets + - Progressive loading + - Browser compatibility + - id: mobile-packaging + title: Mobile Packaging + type: bullet-list + template: | + - Cordova/Capacitor wrapper + - Platform-specific optimization + - App store requirements + - Performance testing + + - id: implementation-roadmap + title: Implementation Roadmap + instruction: Break down the architecture implementation into phases that align with the GDD development phases + sections: + - id: phase-1-foundation + title: "Phase 1: Foundation ({{duration}})" + sections: + - id: phase-1-core + title: Core Systems + type: bullet-list + template: | + - Project setup and configuration + - Basic scene management + - Asset loading pipeline + - Input handling framework + - id: phase-1-epics + title: Story Epics + type: bullet-list + template: | + - "Engine Setup and Configuration" + - "Basic Scene Management System" + - "Asset Loading Foundation" + - id: phase-2-game-systems + title: "Phase 2: Game Systems ({{duration}})" + sections: + - id: phase-2-gameplay + title: Gameplay Systems + type: bullet-list + template: | + - {{primary_mechanic}} implementation + - Physics and collision system + - Game state management + - UI framework + - id: phase-2-epics + title: Story Epics + type: bullet-list + template: | + - "{{primary_mechanic}} System Implementation" + - "Physics and Collision Framework" + - "Game State Management System" + - id: phase-3-content-polish + title: "Phase 3: Content & Polish ({{duration}})" + sections: + - id: phase-3-content + title: Content Systems + type: bullet-list + template: | + - Level loading and management + - Audio system integration + - Performance optimization + - Final polish and testing + - id: phase-3-epics + title: Story Epics + type: bullet-list + template: | + - "Level Management System" + - "Audio Integration and Optimization" + - "Performance Optimization and Testing" + + - id: risk-assessment + title: Risk Assessment + instruction: Identify potential technical risks and mitigation strategies + type: table + template: | + | Risk | Probability | Impact | Mitigation Strategy | + | ---------------------------- | ----------- | ---------- | ------------------- | + | Performance issues on mobile | {{prob}} | {{impact}} | {{mitigation}} | + | Asset loading bottlenecks | {{prob}} | {{impact}} | {{mitigation}} | + | Cross-platform compatibility | {{prob}} | {{impact}} | {{mitigation}} | + + - id: success-criteria + title: Success Criteria + instruction: Define measurable technical success criteria + sections: + - id: technical-metrics + title: Technical Metrics + type: bullet-list + template: | + - All systems implemented per specification + - Performance targets met consistently + - Zero critical bugs in core systems + - Successful deployment across target platforms + - id: code-quality + title: Code Quality + type: bullet-list + template: | + - 90%+ test coverage on game logic + - Zero TypeScript errors in strict mode + - Consistent adherence to coding standards + - Comprehensive documentation coverage +==================== END: .bmad-2d-phaser-game-dev/templates/game-architecture-tmpl.yaml ==================== ==================== START: .bmad-2d-phaser-game-dev/checklists/game-story-dod-checklist.md ==================== # Game Development Story Definition of Done Checklist @@ -6964,243 +7153,3336 @@ Execute `.bmad-2d-phaser-game-dev/checklists/game-story-dod-checklist.md` agains This task ensures game development stories are immediately actionable and enable efficient AI-driven development of game features. ==================== END: .bmad-2d-phaser-game-dev/tasks/create-game-story.md ==================== -==================== START: .bmad-2d-phaser-game-dev/templates/game-story-tmpl.md ==================== -# Story: {{Story Title}} +==================== START: .bmad-2d-phaser-game-dev/templates/game-story-tmpl.yaml ==================== +template: + id: game-story-template-v2 + name: Game Development Story + version: 2.0 + output: + format: markdown + filename: "stories/{{epic_name}}/{{story_id}}-{{story_name}}.md" + title: "Story: {{story_title}}" -**Epic:** {{Epic Name}} -**Story ID:** {{ID}} -**Priority:** {{High|Medium|Low}} -**Points:** {{Story Points}} -**Status:** Draft +workflow: + mode: interactive -[[LLM: This template creates detailed game development stories that are immediately actionable by game developers. Each story should focus on a single, implementable feature that contributes to the overall game functionality. +sections: + - id: initial-setup + instruction: | + This template creates detailed game development stories that are immediately actionable by game developers. Each story should focus on a single, implementable feature that contributes to the overall game functionality. + + Before starting, ensure you have access to: + + - Game Design Document (GDD) + - Game Architecture Document + - Any existing stories in this epic + + The story should be specific enough that a developer can implement it without requiring additional design decisions. -Before starting, ensure you have access to: + - id: story-header + content: | + **Epic:** {{epic_name}} + **Story ID:** {{story_id}} + **Priority:** {{High|Medium|Low}} + **Points:** {{story_points}} + **Status:** Draft -- Game Design Document (GDD) + - id: description + title: Description + instruction: Provide a clear, concise description of what this story implements. Focus on the specific game feature or system being built. Reference the GDD section that defines this feature. + template: "{{clear_description_of_what_needs_to_be_implemented}}" + + - id: acceptance-criteria + title: Acceptance Criteria + instruction: Define specific, testable conditions that must be met for the story to be considered complete. Each criterion should be verifiable and directly related to gameplay functionality. + sections: + - id: functional-requirements + title: Functional Requirements + type: checklist + items: + - "{{specific_functional_requirement}}" + - id: technical-requirements + title: Technical Requirements + type: checklist + items: + - "Code follows TypeScript strict mode standards" + - "Maintains 60 FPS on target devices" + - "No memory leaks or performance degradation" + - "{{specific_technical_requirement}}" + - id: game-design-requirements + title: Game Design Requirements + type: checklist + items: + - "{{gameplay_requirement_from_gdd}}" + - "{{balance_requirement_if_applicable}}" + - "{{player_experience_requirement}}" + + - id: technical-specifications + title: Technical Specifications + instruction: Provide specific technical details that guide implementation. Include class names, file locations, and integration points based on the game architecture. + sections: + - id: files-to-modify + title: Files to Create/Modify + template: | + **New Files:** + + - `{{file_path_1}}` - {{purpose}} + - `{{file_path_2}}` - {{purpose}} + + **Modified Files:** + + - `{{existing_file_1}}` - {{changes_needed}} + - `{{existing_file_2}}` - {{changes_needed}} + - id: class-interface-definitions + title: Class/Interface Definitions + instruction: Define specific TypeScript interfaces and class structures needed + type: code + language: typescript + template: | + // {{interface_name}} + interface {{interface_name}} { + {{property_1}}: {{type}}; + {{property_2}}: {{type}}; + {{method_1}}({{params}}): {{return_type}}; + } + + // {{class_name}} + class {{class_name}} extends {{phaser_class}} { + private {{property}}: {{type}}; + + constructor({{params}}) { + // Implementation requirements + } + + public {{method}}({{params}}): {{return_type}} { + // Method requirements + } + } + - id: integration-points + title: Integration Points + instruction: Specify how this feature integrates with existing systems + template: | + **Scene Integration:** + + - {{scene_name}}: {{integration_details}} + + **System Dependencies:** + + - {{system_name}}: {{dependency_description}} + + **Event Communication:** + + - Emits: `{{event_name}}` when {{condition}} + - Listens: `{{event_name}}` to {{response}} + + - id: implementation-tasks + title: Implementation Tasks + instruction: Break down the implementation into specific, ordered tasks. Each task should be completable in 1-4 hours. + sections: + - id: dev-agent-record + title: Dev Agent Record + template: | + **Tasks:** + + - [ ] {{task_1_description}} + - [ ] {{task_2_description}} + - [ ] {{task_3_description}} + - [ ] {{task_4_description}} + - [ ] Write unit tests for {{component}} + - [ ] Integration testing with {{related_system}} + - [ ] Performance testing and optimization + + **Debug Log:** + | Task | File | Change | Reverted? | + |------|------|--------|-----------| + | | | | | + + **Completion Notes:** + + + + **Change Log:** + + + + - id: game-design-context + title: Game Design Context + instruction: Reference the specific sections of the GDD that this story implements + template: | + **GDD Reference:** {{section_name}} ({{page_or_section_number}}) + + **Game Mechanic:** {{mechanic_name}} + + **Player Experience Goal:** {{experience_description}} + + **Balance Parameters:** + + - {{parameter_1}}: {{value_or_range}} + - {{parameter_2}}: {{value_or_range}} + + - id: testing-requirements + title: Testing Requirements + instruction: Define specific testing criteria for this game feature + sections: + - id: unit-tests + title: Unit Tests + template: | + **Test Files:** + + - `tests/{{component_name}}.test.ts` + + **Test Scenarios:** + + - {{test_scenario_1}} + - {{test_scenario_2}} + - {{edge_case_test}} + - id: game-testing + title: Game Testing + template: | + **Manual Test Cases:** + + 1. {{test_case_1_description}} + + - Expected: {{expected_behavior}} + - Performance: {{performance_expectation}} + + 2. {{test_case_2_description}} + - Expected: {{expected_behavior}} + - Edge Case: {{edge_case_handling}} + - id: performance-tests + title: Performance Tests + template: | + **Metrics to Verify:** + + - Frame rate maintains {{fps_target}} FPS + - Memory usage stays under {{memory_limit}}MB + - {{feature_specific_performance_metric}} + + - id: dependencies + title: Dependencies + instruction: List any dependencies that must be completed before this story can be implemented + template: | + **Story Dependencies:** + + - {{story_id}}: {{dependency_description}} + + **Technical Dependencies:** + + - {{system_or_file}}: {{requirement}} + + **Asset Dependencies:** + + - {{asset_type}}: {{asset_description}} + - Location: `{{asset_path}}` + + - id: definition-of-done + title: Definition of Done + instruction: Checklist that must be completed before the story is considered finished + type: checklist + items: + - "All acceptance criteria met" + - "Code reviewed and approved" + - "Unit tests written and passing" + - "Integration tests passing" + - "Performance targets met" + - "No linting errors" + - "Documentation updated" + - "{{game_specific_dod_item}}" + + - id: notes + title: Notes + instruction: Any additional context, design decisions, or implementation notes + template: | + **Implementation Notes:** + + - {{note_1}} + - {{note_2}} + + **Design Decisions:** + + - {{decision_1}}: {{rationale}} + - {{decision_2}}: {{rationale}} + + **Future Considerations:** + + - {{future_enhancement_1}} + - {{future_optimization_1}} +==================== END: .bmad-2d-phaser-game-dev/templates/game-story-tmpl.yaml ==================== + +==================== START: .bmad-2d-phaser-game-dev/templates/game-architecture-tmpl.yaml ==================== +template: + id: game-architecture-template-v2 + name: Game Architecture Document + version: 2.0 + output: + format: markdown + filename: "docs/{{game_name}}-game-architecture.md" + title: "{{game_title}} Game Architecture Document" + +workflow: + mode: interactive + +sections: + - id: initial-setup + instruction: | + This template creates a comprehensive game architecture document specifically for Phaser 3 + TypeScript projects. This should provide the technical foundation for all game development stories and epics. + + If available, review any provided documents: Game Design Document (GDD), Technical Preferences. This architecture should support all game mechanics defined in the GDD. + + - id: introduction + title: Introduction + instruction: Establish the document's purpose and scope for game development + content: | + This document outlines the complete technical architecture for {{game_title}}, a 2D game built with Phaser 3 and TypeScript. It serves as the technical foundation for AI-driven game development, ensuring consistency and scalability across all game systems. + + This architecture is designed to support the gameplay mechanics defined in the Game Design Document while maintaining 60 FPS performance and cross-platform compatibility. + sections: + - id: change-log + title: Change Log + instruction: Track document versions and changes + type: table + template: | + | Date | Version | Description | Author | + | :--- | :------ | :---------- | :----- | + + - id: technical-overview + title: Technical Overview + instruction: Present all subsections together, then apply `tasks#advanced-elicitation` protocol to the complete section. + sections: + - id: architecture-summary + title: Architecture Summary + instruction: | + Provide a comprehensive overview covering: + + - Game engine choice and configuration + - Project structure and organization + - Key systems and their interactions + - Performance and optimization strategy + - How this architecture achieves GDD requirements + - id: platform-targets + title: Platform Targets + instruction: Based on GDD requirements, confirm platform support + template: | + **Primary Platform:** {{primary_platform}} + **Secondary Platforms:** {{secondary_platforms}} + **Minimum Requirements:** {{min_specs}} + **Target Performance:** 60 FPS on {{target_device}} + - id: technology-stack + title: Technology Stack + template: | + **Core Engine:** Phaser 3.70+ + **Language:** TypeScript 5.0+ (Strict Mode) + **Build Tool:** {{build_tool}} (Webpack/Vite/Parcel) + **Package Manager:** {{package_manager}} + **Testing:** {{test_framework}} + **Deployment:** {{deployment_platform}} + + - id: project-structure + title: Project Structure + instruction: Define the complete project organization that developers will follow + sections: + - id: repository-organization + title: Repository Organization + instruction: Design a clear folder structure for game development + type: code + language: text + template: | + {{game_name}}/ + ├── src/ + │ ├── scenes/ # Game scenes + │ ├── gameObjects/ # Custom game objects + │ ├── systems/ # Core game systems + │ ├── utils/ # Utility functions + │ ├── types/ # TypeScript type definitions + │ ├── config/ # Game configuration + │ └── main.ts # Entry point + ├── assets/ + │ ├── images/ # Sprite assets + │ ├── audio/ # Sound files + │ ├── data/ # JSON data files + │ └── fonts/ # Font files + ├── public/ # Static web assets + ├── tests/ # Test files + ├── docs/ # Documentation + │ ├── stories/ # Development stories + │ └── architecture/ # Technical docs + └── dist/ # Built game files + - id: module-organization + title: Module Organization + instruction: Define how TypeScript modules should be organized + sections: + - id: scene-structure + title: Scene Structure + type: bullet-list + template: | + - Each scene in separate file + - Scene-specific logic contained + - Clear data passing between scenes + - id: game-object-pattern + title: Game Object Pattern + type: bullet-list + template: | + - Component-based architecture + - Reusable game object classes + - Type-safe property definitions + - id: system-architecture + title: System Architecture + type: bullet-list + template: | + - Singleton managers for global systems + - Event-driven communication + - Clear separation of concerns + + - id: core-game-systems + title: Core Game Systems + instruction: Detail each major system that needs to be implemented. Each system should be specific enough for developers to create implementation stories. + sections: + - id: scene-management + title: Scene Management System + template: | + **Purpose:** Handle game flow and scene transitions + + **Key Components:** + + - Scene loading and unloading + - Data passing between scenes + - Transition effects + - Memory management + + **Implementation Requirements:** + + - Preload scene for asset loading + - Menu system with navigation + - Gameplay scenes with state management + - Pause/resume functionality + + **Files to Create:** + + - `src/scenes/BootScene.ts` + - `src/scenes/PreloadScene.ts` + - `src/scenes/MenuScene.ts` + - `src/scenes/GameScene.ts` + - `src/systems/SceneManager.ts` + - id: game-state-management + title: Game State Management + template: | + **Purpose:** Track player progress and game status + + **State Categories:** + + - Player progress (levels, unlocks) + - Game settings (audio, controls) + - Session data (current level, score) + - Persistent data (achievements, statistics) + + **Implementation Requirements:** + + - Save/load system with localStorage + - State validation and error recovery + - Cross-session data persistence + - Settings management + + **Files to Create:** + + - `src/systems/GameState.ts` + - `src/systems/SaveManager.ts` + - `src/types/GameData.ts` + - id: asset-management + title: Asset Management System + template: | + **Purpose:** Efficient loading and management of game assets + + **Asset Categories:** + + - Sprite sheets and animations + - Audio files and music + - Level data and configurations + - UI assets and fonts + + **Implementation Requirements:** + + - Progressive loading strategy + - Asset caching and optimization + - Error handling for failed loads + - Memory management for large assets + + **Files to Create:** + + - `src/systems/AssetManager.ts` + - `src/config/AssetConfig.ts` + - `src/utils/AssetLoader.ts` + - id: input-management + title: Input Management System + template: | + **Purpose:** Handle all player input across platforms + + **Input Types:** + + - Keyboard controls + - Mouse/pointer interaction + - Touch gestures (mobile) + - Gamepad support (optional) + + **Implementation Requirements:** + + - Input mapping and configuration + - Touch-friendly mobile controls + - Input buffering for responsive gameplay + - Customizable control schemes + + **Files to Create:** + + - `src/systems/InputManager.ts` + - `src/utils/TouchControls.ts` + - `src/types/InputTypes.ts` + - id: game-mechanics-systems + title: Game Mechanics Systems + instruction: For each major mechanic defined in the GDD, create a system specification + repeatable: true + sections: + - id: mechanic-system + title: "{{mechanic_name}} System" + template: | + **Purpose:** {{system_purpose}} + + **Core Functionality:** + + - {{feature_1}} + - {{feature_2}} + - {{feature_3}} + + **Dependencies:** {{required_systems}} + + **Performance Considerations:** {{optimization_notes}} + + **Files to Create:** + + - `src/systems/{{system_name}}.ts` + - `src/gameObjects/{{related_object}}.ts` + - `src/types/{{system_types}}.ts` + - id: physics-collision + title: Physics & Collision System + template: | + **Physics Engine:** {{physics_choice}} (Arcade Physics/Matter.js) + + **Collision Categories:** + + - Player collision + - Enemy interactions + - Environmental objects + - Collectibles and items + + **Implementation Requirements:** + + - Optimized collision detection + - Physics body management + - Collision callbacks and events + - Performance monitoring + + **Files to Create:** + + - `src/systems/PhysicsManager.ts` + - `src/utils/CollisionGroups.ts` + - id: audio-system + title: Audio System + template: | + **Audio Requirements:** + + - Background music with looping + - Sound effects for actions + - Audio settings and volume control + - Mobile audio optimization + + **Implementation Features:** + + - Audio sprite management + - Dynamic music system + - Spatial audio (if applicable) + - Audio pooling for performance + + **Files to Create:** + + - `src/systems/AudioManager.ts` + - `src/config/AudioConfig.ts` + - id: ui-system + title: UI System + template: | + **UI Components:** + + - HUD elements (score, health, etc.) + - Menu navigation + - Modal dialogs + - Settings screens + + **Implementation Requirements:** + + - Responsive layout system + - Touch-friendly interface + - Keyboard navigation support + - Animation and transitions + + **Files to Create:** + + - `src/systems/UIManager.ts` + - `src/gameObjects/UI/` + - `src/types/UITypes.ts` + + - id: performance-architecture + title: Performance Architecture + instruction: Define performance requirements and optimization strategies + sections: + - id: performance-targets + title: Performance Targets + template: | + **Frame Rate:** 60 FPS sustained, 30 FPS minimum + **Memory Usage:** <{{memory_limit}}MB total + **Load Times:** <{{initial_load}}s initial, <{{level_load}}s per level + **Battery Optimization:** Reduced updates when not visible + - id: optimization-strategies + title: Optimization Strategies + sections: + - id: object-pooling + title: Object Pooling + type: bullet-list + template: | + - Bullets and projectiles + - Particle effects + - Enemy objects + - UI elements + - id: asset-optimization + title: Asset Optimization + type: bullet-list + template: | + - Texture atlases for sprites + - Audio compression + - Lazy loading for large assets + - Progressive enhancement + - id: rendering-optimization + title: Rendering Optimization + type: bullet-list + template: | + - Sprite batching + - Culling off-screen objects + - Reduced particle counts on mobile + - Texture resolution scaling + - id: optimization-files + title: Files to Create + type: bullet-list + template: | + - `src/utils/ObjectPool.ts` + - `src/utils/PerformanceMonitor.ts` + - `src/config/OptimizationConfig.ts` + + - id: game-configuration + title: Game Configuration + instruction: Define all configurable aspects of the game + sections: + - id: phaser-configuration + title: Phaser Configuration + type: code + language: typescript + template: | + // src/config/GameConfig.ts + const gameConfig: Phaser.Types.Core.GameConfig = { + type: Phaser.AUTO, + width: {{game_width}}, + height: {{game_height}}, + scale: { + mode: {{scale_mode}}, + autoCenter: Phaser.Scale.CENTER_BOTH + }, + physics: { + default: '{{physics_system}}', + {{physics_system}}: { + gravity: { y: {{gravity}} }, + debug: false + } + }, + // Additional configuration... + }; + - id: game-balance-configuration + title: Game Balance Configuration + instruction: Based on GDD, define configurable game parameters + type: code + language: typescript + template: | + // src/config/GameBalance.ts + export const GameBalance = { + player: { + speed: {{player_speed}}, + health: {{player_health}}, + // Additional player parameters... + }, + difficulty: { + easy: {{easy_params}}, + normal: {{normal_params}}, + hard: {{hard_params}} + }, + // Additional balance parameters... + }; + + - id: development-guidelines + title: Development Guidelines + instruction: Provide coding standards specific to game development + sections: + - id: typescript-standards + title: TypeScript Standards + sections: + - id: type-safety + title: Type Safety + type: bullet-list + template: | + - Use strict mode + - Define interfaces for all data structures + - Avoid `any` type usage + - Use enums for game states + - id: code-organization + title: Code Organization + type: bullet-list + template: | + - One class per file + - Clear naming conventions + - Proper error handling + - Comprehensive documentation + - id: phaser-best-practices + title: Phaser 3 Best Practices + sections: + - id: scene-management-practices + title: Scene Management + type: bullet-list + template: | + - Clean up resources in shutdown() + - Use scene data for communication + - Implement proper event handling + - Avoid memory leaks + - id: game-object-design + title: Game Object Design + type: bullet-list + template: | + - Extend Phaser classes appropriately + - Use component-based architecture + - Implement object pooling where needed + - Follow consistent update patterns + - id: testing-strategy + title: Testing Strategy + sections: + - id: unit-testing + title: Unit Testing + type: bullet-list + template: | + - Test game logic separately from Phaser + - Mock Phaser dependencies + - Test utility functions + - Validate game balance calculations + - id: integration-testing + title: Integration Testing + type: bullet-list + template: | + - Scene loading and transitions + - Save/load functionality + - Input handling + - Performance benchmarks + - id: test-files + title: Files to Create + type: bullet-list + template: | + - `tests/utils/GameLogic.test.ts` + - `tests/systems/SaveManager.test.ts` + - `tests/performance/FrameRate.test.ts` + + - id: deployment-architecture + title: Deployment Architecture + instruction: Define how the game will be built and deployed + sections: + - id: build-process + title: Build Process + sections: + - id: development-build + title: Development Build + type: bullet-list + template: | + - Fast compilation + - Source maps enabled + - Debug logging active + - Hot reload support + - id: production-build + title: Production Build + type: bullet-list + template: | + - Minified and optimized + - Asset compression + - Performance monitoring + - Error tracking + - id: deployment-strategy + title: Deployment Strategy + sections: + - id: web-deployment + title: Web Deployment + type: bullet-list + template: | + - Static hosting ({{hosting_platform}}) + - CDN for assets + - Progressive loading + - Browser compatibility + - id: mobile-packaging + title: Mobile Packaging + type: bullet-list + template: | + - Cordova/Capacitor wrapper + - Platform-specific optimization + - App store requirements + - Performance testing + + - id: implementation-roadmap + title: Implementation Roadmap + instruction: Break down the architecture implementation into phases that align with the GDD development phases + sections: + - id: phase-1-foundation + title: "Phase 1: Foundation ({{duration}})" + sections: + - id: phase-1-core + title: Core Systems + type: bullet-list + template: | + - Project setup and configuration + - Basic scene management + - Asset loading pipeline + - Input handling framework + - id: phase-1-epics + title: Story Epics + type: bullet-list + template: | + - "Engine Setup and Configuration" + - "Basic Scene Management System" + - "Asset Loading Foundation" + - id: phase-2-game-systems + title: "Phase 2: Game Systems ({{duration}})" + sections: + - id: phase-2-gameplay + title: Gameplay Systems + type: bullet-list + template: | + - {{primary_mechanic}} implementation + - Physics and collision system + - Game state management + - UI framework + - id: phase-2-epics + title: Story Epics + type: bullet-list + template: | + - "{{primary_mechanic}} System Implementation" + - "Physics and Collision Framework" + - "Game State Management System" + - id: phase-3-content-polish + title: "Phase 3: Content & Polish ({{duration}})" + sections: + - id: phase-3-content + title: Content Systems + type: bullet-list + template: | + - Level loading and management + - Audio system integration + - Performance optimization + - Final polish and testing + - id: phase-3-epics + title: Story Epics + type: bullet-list + template: | + - "Level Management System" + - "Audio Integration and Optimization" + - "Performance Optimization and Testing" + + - id: risk-assessment + title: Risk Assessment + instruction: Identify potential technical risks and mitigation strategies + type: table + template: | + | Risk | Probability | Impact | Mitigation Strategy | + | ---------------------------- | ----------- | ---------- | ------------------- | + | Performance issues on mobile | {{prob}} | {{impact}} | {{mitigation}} | + | Asset loading bottlenecks | {{prob}} | {{impact}} | {{mitigation}} | + | Cross-platform compatibility | {{prob}} | {{impact}} | {{mitigation}} | + + - id: success-criteria + title: Success Criteria + instruction: Define measurable technical success criteria + sections: + - id: technical-metrics + title: Technical Metrics + type: bullet-list + template: | + - All systems implemented per specification + - Performance targets met consistently + - Zero critical bugs in core systems + - Successful deployment across target platforms + - id: code-quality + title: Code Quality + type: bullet-list + template: | + - 90%+ test coverage on game logic + - Zero TypeScript errors in strict mode + - Consistent adherence to coding standards + - Comprehensive documentation coverage +==================== END: .bmad-2d-phaser-game-dev/templates/game-architecture-tmpl.yaml ==================== + +==================== START: .bmad-2d-phaser-game-dev/templates/game-brief-tmpl.yaml ==================== +template: + id: game-brief-template-v2 + name: Game Brief + version: 2.0 + output: + format: markdown + filename: "docs/{{game_name}}-game-brief.md" + title: "{{game_title}} Game Brief" + +workflow: + mode: interactive + +sections: + - id: initial-setup + instruction: | + This template creates a comprehensive game brief that serves as the foundation for all subsequent game development work. The brief should capture the essential vision, scope, and requirements needed to create a detailed Game Design Document. + + This brief is typically created early in the ideation process, often after brainstorming sessions, to crystallize the game concept before moving into detailed design. + + - id: game-vision + title: Game Vision + instruction: Establish the core vision and identity of the game. Present each subsection and gather user feedback before proceeding. + sections: + - id: core-concept + title: Core Concept + instruction: 2-3 sentences that clearly capture what the game is and why it will be compelling to players + - id: elevator-pitch + title: Elevator Pitch + instruction: Single sentence that captures the essence of the game in a memorable way + template: | + **"{{game_description_in_one_sentence}}"** + - id: vision-statement + title: Vision Statement + instruction: Inspirational statement about what the game will achieve for players and why it matters + + - id: target-market + title: Target Market + instruction: Define the audience and market context. Apply `tasks#advanced-elicitation` after presenting this section. + sections: + - id: primary-audience + title: Primary Audience + template: | + **Demographics:** {{age_range}}, {{platform_preference}}, {{gaming_experience}} + **Psychographics:** {{interests}}, {{motivations}}, {{play_patterns}} + **Gaming Preferences:** {{preferred_genres}}, {{session_length}}, {{difficulty_preference}} + - id: secondary-audiences + title: Secondary Audiences + template: | + **Audience 2:** {{description}} + **Audience 3:** {{description}} + - id: market-context + title: Market Context + template: | + **Genre:** {{primary_genre}} / {{secondary_genre}} + **Platform Strategy:** {{platform_focus}} + **Competitive Positioning:** {{differentiation_statement}} + + - id: game-fundamentals + title: Game Fundamentals + instruction: Define the core gameplay elements. Each subsection should be specific enough to guide detailed design work. + sections: + - id: core-gameplay-pillars + title: Core Gameplay Pillars + instruction: 3-5 fundamental principles that guide all design decisions + type: numbered-list + template: | + **{{pillar_name}}** - {{description_and_rationale}} + - id: primary-mechanics + title: Primary Mechanics + instruction: List the 3-5 most important gameplay mechanics that define the player experience + repeatable: true + template: | + **Core Mechanic: {{mechanic_name}}** + + - **Description:** {{how_it_works}} + - **Player Value:** {{why_its_fun}} + - **Implementation Scope:** {{complexity_estimate}} + - id: player-experience-goals + title: Player Experience Goals + instruction: Define what emotions and experiences the game should create for players + template: | + **Primary Experience:** {{main_emotional_goal}} + **Secondary Experiences:** {{supporting_emotional_goals}} + **Engagement Pattern:** {{how_player_engagement_evolves}} + + - id: scope-constraints + title: Scope and Constraints + instruction: Define the boundaries and limitations that will shape development. Apply `tasks#advanced-elicitation` to clarify any constraints. + sections: + - id: project-scope + title: Project Scope + template: | + **Game Length:** {{estimated_content_hours}} + **Content Volume:** {{levels_areas_content_amount}} + **Feature Complexity:** {{simple|moderate|complex}} + **Scope Comparison:** "Similar to {{reference_game}} but with {{key_differences}}" + - id: technical-constraints + title: Technical Constraints + template: | + **Platform Requirements:** + + - Primary: {{platform_1}} - {{requirements}} + - Secondary: {{platform_2}} - {{requirements}} + + **Technical Specifications:** + + - Engine: Phaser 3 + TypeScript + - Performance Target: {{fps_target}} FPS on {{target_device}} + - Memory Budget: <{{memory_limit}}MB + - Load Time Goal: <{{load_time_seconds}}s + - id: resource-constraints + title: Resource Constraints + template: | + **Team Size:** {{team_composition}} + **Timeline:** {{development_duration}} + **Budget Considerations:** {{budget_constraints_or_targets}} + **Asset Requirements:** {{art_audio_content_needs}} + - id: business-constraints + title: Business Constraints + condition: has_business_goals + template: | + **Monetization Model:** {{free|premium|freemium|subscription}} + **Revenue Goals:** {{revenue_targets_if_applicable}} + **Platform Requirements:** {{store_certification_needs}} + **Launch Timeline:** {{target_launch_window}} + + - id: reference-framework + title: Reference Framework + instruction: Provide context through references and competitive analysis + sections: + - id: inspiration-games + title: Inspiration Games + sections: + - id: primary-references + title: Primary References + type: numbered-list + repeatable: true + template: | + **{{reference_game}}** - {{what_we_learn_from_it}} + - id: competitive-analysis + title: Competitive Analysis + template: | + **Direct Competitors:** + + - {{competitor_1}}: {{strengths_and_weaknesses}} + - {{competitor_2}}: {{strengths_and_weaknesses}} + + **Differentiation Strategy:** + {{how_we_differ_and_why_thats_valuable}} + - id: market-opportunity + title: Market Opportunity + template: | + **Market Gap:** {{underserved_need_or_opportunity}} + **Timing Factors:** {{why_now_is_the_right_time}} + **Success Metrics:** {{how_well_measure_success}} + + - id: content-framework + title: Content Framework + instruction: Outline the content structure and progression without full design detail + sections: + - id: game-structure + title: Game Structure + template: | + **Overall Flow:** {{linear|hub_world|open_world|procedural}} + **Progression Model:** {{how_players_advance}} + **Session Structure:** {{typical_play_session_flow}} + - id: content-categories + title: Content Categories + template: | + **Core Content:** + + - {{content_type_1}}: {{quantity_and_description}} + - {{content_type_2}}: {{quantity_and_description}} + + **Optional Content:** + + - {{optional_content_type}}: {{quantity_and_description}} + + **Replay Elements:** + + - {{replayability_features}} + - id: difficulty-accessibility + title: Difficulty and Accessibility + template: | + **Difficulty Approach:** {{how_challenge_is_structured}} + **Accessibility Features:** {{planned_accessibility_support}} + **Skill Requirements:** {{what_skills_players_need}} + + - id: art-audio-direction + title: Art and Audio Direction + instruction: Establish the aesthetic vision that will guide asset creation + sections: + - id: visual-style + title: Visual Style + template: | + **Art Direction:** {{style_description}} + **Reference Materials:** {{visual_inspiration_sources}} + **Technical Approach:** {{2d_style_pixel_vector_etc}} + **Color Strategy:** {{color_palette_mood}} + - id: audio-direction + title: Audio Direction + template: | + **Music Style:** {{genre_and_mood}} + **Sound Design:** {{audio_personality}} + **Implementation Needs:** {{technical_audio_requirements}} + - id: ui-ux-approach + title: UI/UX Approach + template: | + **Interface Style:** {{ui_aesthetic}} + **User Experience Goals:** {{ux_priorities}} + **Platform Adaptations:** {{cross_platform_considerations}} + + - id: risk-assessment + title: Risk Assessment + instruction: Identify potential challenges and mitigation strategies + sections: + - id: technical-risks + title: Technical Risks + type: table + template: | + | Risk | Probability | Impact | Mitigation Strategy | + | ---- | ----------- | ------ | ------------------- | + | {{technical_risk}} | {{high|med|low}} | {{high|med|low}} | {{mitigation_approach}} | + - id: design-risks + title: Design Risks + type: table + template: | + | Risk | Probability | Impact | Mitigation Strategy | + | ---- | ----------- | ------ | ------------------- | + | {{design_risk}} | {{high|med|low}} | {{high|med|low}} | {{mitigation_approach}} | + - id: market-risks + title: Market Risks + type: table + template: | + | Risk | Probability | Impact | Mitigation Strategy | + | ---- | ----------- | ------ | ------------------- | + | {{market_risk}} | {{high|med|low}} | {{high|med|low}} | {{mitigation_approach}} | + + - id: success-criteria + title: Success Criteria + instruction: Define measurable goals for the project + sections: + - id: player-experience-metrics + title: Player Experience Metrics + template: | + **Engagement Goals:** + + - Tutorial completion rate: >{{percentage}}% + - Average session length: {{duration}} minutes + - Player retention: D1 {{d1}}%, D7 {{d7}}%, D30 {{d30}}% + + **Quality Benchmarks:** + + - Player satisfaction: >{{rating}}/10 + - Completion rate: >{{percentage}}% + - Technical performance: {{fps_target}} FPS consistent + - id: development-metrics + title: Development Metrics + template: | + **Technical Targets:** + + - Zero critical bugs at launch + - Performance targets met on all platforms + - Load times under {{seconds}}s + + **Process Goals:** + + - Development timeline adherence + - Feature scope completion + - Quality assurance standards + - id: business-metrics + title: Business Metrics + condition: has_business_goals + template: | + **Commercial Goals:** + + - {{revenue_target}} in first {{time_period}} + - {{user_acquisition_target}} players in first {{time_period}} + - {{retention_target}} monthly active users + + - id: next-steps + title: Next Steps + instruction: Define immediate actions following the brief completion + sections: + - id: immediate-actions + title: Immediate Actions + type: numbered-list + template: | + **{{action_item}}** - {{details_and_timeline}} + - id: development-roadmap + title: Development Roadmap + sections: + - id: phase-1-preproduction + title: "Phase 1: Pre-Production ({{duration}})" + type: bullet-list + template: | + - Detailed Game Design Document creation + - Technical architecture planning + - Art style exploration and pipeline setup + - id: phase-2-prototype + title: "Phase 2: Prototype ({{duration}})" + type: bullet-list + template: | + - Core mechanic implementation + - Technical proof of concept + - Initial playtesting and iteration + - id: phase-3-production + title: "Phase 3: Production ({{duration}})" + type: bullet-list + template: | + - Full feature development + - Content creation and integration + - Comprehensive testing and optimization + - id: documentation-pipeline + title: Documentation Pipeline + sections: + - id: required-documents + title: Required Documents + type: numbered-list + template: | + Game Design Document (GDD) - {{target_completion}} + Technical Architecture Document - {{target_completion}} + Art Style Guide - {{target_completion}} + Production Plan - {{target_completion}} + - id: validation-plan + title: Validation Plan + template: | + **Concept Testing:** + + - {{validation_method_1}} - {{timeline}} + - {{validation_method_2}} - {{timeline}} + + **Prototype Testing:** + + - {{testing_approach}} - {{timeline}} + - {{feedback_collection_method}} - {{timeline}} + + - id: appendices + title: Appendices + sections: + - id: research-materials + title: Research Materials + instruction: Include any supporting research, competitive analysis, or market data that informed the brief + - id: brainstorming-notes + title: Brainstorming Session Notes + instruction: Reference any brainstorming sessions that led to this brief + - id: stakeholder-input + title: Stakeholder Input + instruction: Include key input from stakeholders that shaped the vision + - id: change-log + title: Change Log + instruction: Track document versions and changes + type: table + template: | + | Date | Version | Description | Author | + | :--- | :------ | :---------- | :----- | +==================== END: .bmad-2d-phaser-game-dev/templates/game-brief-tmpl.yaml ==================== + +==================== START: .bmad-2d-phaser-game-dev/templates/game-design-doc-tmpl.yaml ==================== +template: + id: game-design-doc-template-v2 + name: Game Design Document (GDD) + version: 2.0 + output: + format: markdown + filename: "docs/{{game_name}}-game-design-document.md" + title: "{{game_title}} Game Design Document (GDD)" + +workflow: + mode: interactive + +sections: + - id: initial-setup + instruction: | + This template creates a comprehensive Game Design Document that will serve as the foundation for all game development work. The GDD should be detailed enough that developers can create user stories and epics from it. Focus on gameplay systems, mechanics, and technical requirements that can be broken down into implementable features. + + If available, review any provided documents or ask if any are optionally available: Project Brief, Market Research, Competitive Analysis + + - id: executive-summary + title: Executive Summary + instruction: Create a compelling overview that captures the essence of the game. Present this section first and get user feedback before proceeding. + sections: + - id: core-concept + title: Core Concept + instruction: 2-3 sentences that clearly describe what the game is and why players will love it + - id: target-audience + title: Target Audience + instruction: Define the primary and secondary audience with demographics and gaming preferences + template: | + **Primary:** {{age_range}}, {{player_type}}, {{platform_preference}} + **Secondary:** {{secondary_audience}} + - id: platform-technical + title: Platform & Technical Requirements + instruction: Based on the technical preferences or user input, define the target platforms + template: | + **Primary Platform:** {{platform}} + **Engine:** Phaser 3 + TypeScript + **Performance Target:** 60 FPS on {{minimum_device}} + **Screen Support:** {{resolution_range}} + - id: unique-selling-points + title: Unique Selling Points + instruction: List 3-5 key features that differentiate this game from competitors + type: numbered-list + template: "{{usp}}" + + - id: core-gameplay + title: Core Gameplay + instruction: This section defines the fundamental game mechanics. After presenting each subsection, apply `tasks#advanced-elicitation` protocol to ensure completeness. + sections: + - id: game-pillars + title: Game Pillars + instruction: Define 3-5 core pillars that guide all design decisions. These should be specific and actionable. + type: numbered-list + template: | + **{{pillar_name}}** - {{description}} + - id: core-gameplay-loop + title: Core Gameplay Loop + instruction: Define the 30-60 second loop that players will repeat. Be specific about timing and player actions. + template: | + **Primary Loop ({{duration}} seconds):** + + 1. {{action_1}} ({{time_1}}s) + 2. {{action_2}} ({{time_2}}s) + 3. {{action_3}} ({{time_3}}s) + 4. {{reward_feedback}} ({{time_4}}s) + - id: win-loss-conditions + title: Win/Loss Conditions + instruction: Clearly define success and failure states + template: | + **Victory Conditions:** + + - {{win_condition_1}} + - {{win_condition_2}} + + **Failure States:** + + - {{loss_condition_1}} + - {{loss_condition_2}} + + - id: game-mechanics + title: Game Mechanics + instruction: Detail each major mechanic that will need to be implemented. Each mechanic should be specific enough for developers to create implementation stories. + sections: + - id: primary-mechanics + title: Primary Mechanics + repeatable: true + sections: + - id: mechanic + title: "{{mechanic_name}}" + template: | + **Description:** {{detailed_description}} + + **Player Input:** {{input_method}} + + **System Response:** {{game_response}} + + **Implementation Notes:** + + - {{tech_requirement_1}} + - {{tech_requirement_2}} + - {{performance_consideration}} + + **Dependencies:** {{other_mechanics_needed}} + - id: controls + title: Controls + instruction: Define all input methods for different platforms + type: table + template: | + | Action | Desktop | Mobile | Gamepad | + | ------ | ------- | ------ | ------- | + | {{action}} | {{key}} | {{gesture}} | {{button}} | + + - id: progression-balance + title: Progression & Balance + instruction: Define how players advance and how difficulty scales. This section should provide clear parameters for implementation. + sections: + - id: player-progression + title: Player Progression + template: | + **Progression Type:** {{linear|branching|metroidvania}} + + **Key Milestones:** + + 1. **{{milestone_1}}** - {{unlock_description}} + 2. **{{milestone_2}}** - {{unlock_description}} + 3. **{{milestone_3}}** - {{unlock_description}} + - id: difficulty-curve + title: Difficulty Curve + instruction: Provide specific parameters for balancing + template: | + **Tutorial Phase:** {{duration}} - {{difficulty_description}} + **Early Game:** {{duration}} - {{difficulty_description}} + **Mid Game:** {{duration}} - {{difficulty_description}} + **Late Game:** {{duration}} - {{difficulty_description}} + - id: economy-resources + title: Economy & Resources + condition: has_economy + instruction: Define any in-game currencies, resources, or collectibles + type: table + template: | + | Resource | Earn Rate | Spend Rate | Purpose | Cap | + | -------- | --------- | ---------- | ------- | --- | + | {{resource}} | {{rate}} | {{rate}} | {{use}} | {{max}} | + + - id: level-design-framework + title: Level Design Framework + instruction: Provide guidelines for level creation that developers can use to create level implementation stories + sections: + - id: level-types + title: Level Types + repeatable: true + sections: + - id: level-type + title: "{{level_type_name}}" + template: | + **Purpose:** {{gameplay_purpose}} + **Duration:** {{target_time}} + **Key Elements:** {{required_mechanics}} + **Difficulty:** {{relative_difficulty}} + + **Structure Template:** + + - Introduction: {{intro_description}} + - Challenge: {{main_challenge}} + - Resolution: {{completion_requirement}} + - id: level-progression + title: Level Progression + template: | + **World Structure:** {{linear|hub|open}} + **Total Levels:** {{number}} + **Unlock Pattern:** {{progression_method}} + + - id: technical-specifications + title: Technical Specifications + instruction: Define technical requirements that will guide architecture and implementation decisions. Review any existing technical preferences. + sections: + - id: performance-requirements + title: Performance Requirements + template: | + **Frame Rate:** 60 FPS (minimum 30 FPS on low-end devices) + **Memory Usage:** <{{memory_limit}}MB + **Load Times:** <{{load_time}}s initial, <{{level_load}}s between levels + **Battery Usage:** Optimized for mobile devices + - id: platform-specific + title: Platform Specific + template: | + **Desktop:** + + - Resolution: {{min_resolution}} - {{max_resolution}} + - Input: Keyboard, Mouse, Gamepad + - Browser: Chrome 80+, Firefox 75+, Safari 13+ + + **Mobile:** + + - Resolution: {{mobile_min}} - {{mobile_max}} + - Input: Touch, Tilt (optional) + - OS: iOS 13+, Android 8+ + - id: asset-requirements + title: Asset Requirements + instruction: Define asset specifications for the art and audio teams + template: | + **Visual Assets:** + + - Art Style: {{style_description}} + - Color Palette: {{color_specification}} + - Animation: {{animation_requirements}} + - UI Resolution: {{ui_specs}} + + **Audio Assets:** + + - Music Style: {{music_genre}} + - Sound Effects: {{sfx_requirements}} + - Voice Acting: {{voice_needs}} + + - id: technical-architecture-requirements + title: Technical Architecture Requirements + instruction: Define high-level technical requirements that the game architecture must support + sections: + - id: engine-configuration + title: Engine Configuration + template: | + **Phaser 3 Setup:** + + - TypeScript: Strict mode enabled + - Physics: {{physics_system}} (Arcade/Matter) + - Renderer: WebGL with Canvas fallback + - Scale Mode: {{scale_mode}} + - id: code-architecture + title: Code Architecture + template: | + **Required Systems:** + + - Scene Management + - State Management + - Asset Loading + - Save/Load System + - Input Management + - Audio System + - Performance Monitoring + - id: data-management + title: Data Management + template: | + **Save Data:** + + - Progress tracking + - Settings persistence + - Statistics collection + - {{additional_data}} + + - id: development-phases + title: Development Phases + instruction: Break down the development into phases that can be converted to epics + sections: + - id: phase-1-core-systems + title: "Phase 1: Core Systems ({{duration}})" + sections: + - id: foundation-epic + title: "Epic: Foundation" + type: bullet-list + template: | + - Engine setup and configuration + - Basic scene management + - Core input handling + - Asset loading pipeline + - id: core-mechanics-epic + title: "Epic: Core Mechanics" + type: bullet-list + template: | + - {{primary_mechanic}} implementation + - Basic physics and collision + - Player controller + - id: phase-2-gameplay-features + title: "Phase 2: Gameplay Features ({{duration}})" + sections: + - id: game-systems-epic + title: "Epic: Game Systems" + type: bullet-list + template: | + - {{mechanic_2}} implementation + - {{mechanic_3}} implementation + - Game state management + - id: content-creation-epic + title: "Epic: Content Creation" + type: bullet-list + template: | + - Level loading system + - First playable levels + - Basic UI implementation + - id: phase-3-polish-optimization + title: "Phase 3: Polish & Optimization ({{duration}})" + sections: + - id: performance-epic + title: "Epic: Performance" + type: bullet-list + template: | + - Optimization and profiling + - Mobile platform testing + - Memory management + - id: user-experience-epic + title: "Epic: User Experience" + type: bullet-list + template: | + - Audio implementation + - Visual effects and polish + - Final UI/UX refinement + + - id: success-metrics + title: Success Metrics + instruction: Define measurable goals for the game + sections: + - id: technical-metrics + title: Technical Metrics + type: bullet-list + template: | + - Frame rate: {{fps_target}} + - Load time: {{load_target}} + - Crash rate: <{{crash_threshold}}% + - Memory usage: <{{memory_target}}MB + - id: gameplay-metrics + title: Gameplay Metrics + type: bullet-list + template: | + - Tutorial completion: {{completion_rate}}% + - Average session: {{session_length}} minutes + - Level completion: {{level_completion}}% + - Player retention: D1 {{d1}}%, D7 {{d7}}% + + - id: appendices + title: Appendices + sections: + - id: change-log + title: Change Log + instruction: Track document versions and changes + type: table + template: | + | Date | Version | Description | Author | + | :--- | :------ | :---------- | :----- | + - id: references + title: References + instruction: List any competitive analysis, inspiration, or research sources + type: bullet-list + template: "{{reference}}" +==================== END: .bmad-2d-phaser-game-dev/templates/game-design-doc-tmpl.yaml ==================== + +==================== START: .bmad-2d-phaser-game-dev/templates/game-story-tmpl.yaml ==================== +template: + id: game-story-template-v2 + name: Game Development Story + version: 2.0 + output: + format: markdown + filename: "stories/{{epic_name}}/{{story_id}}-{{story_name}}.md" + title: "Story: {{story_title}}" + +workflow: + mode: interactive + +sections: + - id: initial-setup + instruction: | + This template creates detailed game development stories that are immediately actionable by game developers. Each story should focus on a single, implementable feature that contributes to the overall game functionality. + + Before starting, ensure you have access to: + + - Game Design Document (GDD) + - Game Architecture Document + - Any existing stories in this epic + + The story should be specific enough that a developer can implement it without requiring additional design decisions. + + - id: story-header + content: | + **Epic:** {{epic_name}} + **Story ID:** {{story_id}} + **Priority:** {{High|Medium|Low}} + **Points:** {{story_points}} + **Status:** Draft + + - id: description + title: Description + instruction: Provide a clear, concise description of what this story implements. Focus on the specific game feature or system being built. Reference the GDD section that defines this feature. + template: "{{clear_description_of_what_needs_to_be_implemented}}" + + - id: acceptance-criteria + title: Acceptance Criteria + instruction: Define specific, testable conditions that must be met for the story to be considered complete. Each criterion should be verifiable and directly related to gameplay functionality. + sections: + - id: functional-requirements + title: Functional Requirements + type: checklist + items: + - "{{specific_functional_requirement}}" + - id: technical-requirements + title: Technical Requirements + type: checklist + items: + - "Code follows TypeScript strict mode standards" + - "Maintains 60 FPS on target devices" + - "No memory leaks or performance degradation" + - "{{specific_technical_requirement}}" + - id: game-design-requirements + title: Game Design Requirements + type: checklist + items: + - "{{gameplay_requirement_from_gdd}}" + - "{{balance_requirement_if_applicable}}" + - "{{player_experience_requirement}}" + + - id: technical-specifications + title: Technical Specifications + instruction: Provide specific technical details that guide implementation. Include class names, file locations, and integration points based on the game architecture. + sections: + - id: files-to-modify + title: Files to Create/Modify + template: | + **New Files:** + + - `{{file_path_1}}` - {{purpose}} + - `{{file_path_2}}` - {{purpose}} + + **Modified Files:** + + - `{{existing_file_1}}` - {{changes_needed}} + - `{{existing_file_2}}` - {{changes_needed}} + - id: class-interface-definitions + title: Class/Interface Definitions + instruction: Define specific TypeScript interfaces and class structures needed + type: code + language: typescript + template: | + // {{interface_name}} + interface {{interface_name}} { + {{property_1}}: {{type}}; + {{property_2}}: {{type}}; + {{method_1}}({{params}}): {{return_type}}; + } + + // {{class_name}} + class {{class_name}} extends {{phaser_class}} { + private {{property}}: {{type}}; + + constructor({{params}}) { + // Implementation requirements + } + + public {{method}}({{params}}): {{return_type}} { + // Method requirements + } + } + - id: integration-points + title: Integration Points + instruction: Specify how this feature integrates with existing systems + template: | + **Scene Integration:** + + - {{scene_name}}: {{integration_details}} + + **System Dependencies:** + + - {{system_name}}: {{dependency_description}} + + **Event Communication:** + + - Emits: `{{event_name}}` when {{condition}} + - Listens: `{{event_name}}` to {{response}} + + - id: implementation-tasks + title: Implementation Tasks + instruction: Break down the implementation into specific, ordered tasks. Each task should be completable in 1-4 hours. + sections: + - id: dev-agent-record + title: Dev Agent Record + template: | + **Tasks:** + + - [ ] {{task_1_description}} + - [ ] {{task_2_description}} + - [ ] {{task_3_description}} + - [ ] {{task_4_description}} + - [ ] Write unit tests for {{component}} + - [ ] Integration testing with {{related_system}} + - [ ] Performance testing and optimization + + **Debug Log:** + | Task | File | Change | Reverted? | + |------|------|--------|-----------| + | | | | | + + **Completion Notes:** + + + + **Change Log:** + + + + - id: game-design-context + title: Game Design Context + instruction: Reference the specific sections of the GDD that this story implements + template: | + **GDD Reference:** {{section_name}} ({{page_or_section_number}}) + + **Game Mechanic:** {{mechanic_name}} + + **Player Experience Goal:** {{experience_description}} + + **Balance Parameters:** + + - {{parameter_1}}: {{value_or_range}} + - {{parameter_2}}: {{value_or_range}} + + - id: testing-requirements + title: Testing Requirements + instruction: Define specific testing criteria for this game feature + sections: + - id: unit-tests + title: Unit Tests + template: | + **Test Files:** + + - `tests/{{component_name}}.test.ts` + + **Test Scenarios:** + + - {{test_scenario_1}} + - {{test_scenario_2}} + - {{edge_case_test}} + - id: game-testing + title: Game Testing + template: | + **Manual Test Cases:** + + 1. {{test_case_1_description}} + + - Expected: {{expected_behavior}} + - Performance: {{performance_expectation}} + + 2. {{test_case_2_description}} + - Expected: {{expected_behavior}} + - Edge Case: {{edge_case_handling}} + - id: performance-tests + title: Performance Tests + template: | + **Metrics to Verify:** + + - Frame rate maintains {{fps_target}} FPS + - Memory usage stays under {{memory_limit}}MB + - {{feature_specific_performance_metric}} + + - id: dependencies + title: Dependencies + instruction: List any dependencies that must be completed before this story can be implemented + template: | + **Story Dependencies:** + + - {{story_id}}: {{dependency_description}} + + **Technical Dependencies:** + + - {{system_or_file}}: {{requirement}} + + **Asset Dependencies:** + + - {{asset_type}}: {{asset_description}} + - Location: `{{asset_path}}` + + - id: definition-of-done + title: Definition of Done + instruction: Checklist that must be completed before the story is considered finished + type: checklist + items: + - "All acceptance criteria met" + - "Code reviewed and approved" + - "Unit tests written and passing" + - "Integration tests passing" + - "Performance targets met" + - "No linting errors" + - "Documentation updated" + - "{{game_specific_dod_item}}" + + - id: notes + title: Notes + instruction: Any additional context, design decisions, or implementation notes + template: | + **Implementation Notes:** + + - {{note_1}} + - {{note_2}} + + **Design Decisions:** + + - {{decision_1}}: {{rationale}} + - {{decision_2}}: {{rationale}} + + **Future Considerations:** + + - {{future_enhancement_1}} + - {{future_optimization_1}} +==================== END: .bmad-2d-phaser-game-dev/templates/game-story-tmpl.yaml ==================== + +==================== START: .bmad-2d-phaser-game-dev/templates/level-design-doc-tmpl.yaml ==================== +template: + id: level-design-doc-template-v2 + name: Level Design Document + version: 2.0 + output: + format: markdown + filename: "docs/{{game_name}}-level-design-document.md" + title: "{{game_title}} Level Design Document" + +workflow: + mode: interactive + +sections: + - id: initial-setup + instruction: | + This template creates comprehensive level design documentation that guides both content creation and technical implementation. This document should provide enough detail for developers to create level loading systems and for designers to create specific levels. + + If available, review: Game Design Document (GDD), Game Architecture Document. This document should align with the game mechanics and technical systems defined in those documents. + + - id: introduction + title: Introduction + instruction: Establish the purpose and scope of level design for this game + content: | + This document defines the level design framework for {{game_title}}, providing guidelines for creating engaging, balanced levels that support the core gameplay mechanics defined in the Game Design Document. + + This framework ensures consistency across all levels while providing flexibility for creative level design within established technical and design constraints. + sections: + - id: change-log + title: Change Log + instruction: Track document versions and changes + type: table + template: | + | Date | Version | Description | Author | + | :--- | :------ | :---------- | :----- | + + - id: level-design-philosophy + title: Level Design Philosophy + instruction: Establish the overall approach to level design based on the game's core pillars and mechanics. Apply `tasks#advanced-elicitation` after presenting this section. + sections: + - id: design-principles + title: Design Principles + instruction: Define 3-5 core principles that guide all level design decisions + type: numbered-list + template: | + **{{principle_name}}** - {{description}} + - id: player-experience-goals + title: Player Experience Goals + instruction: Define what players should feel and learn in each level category + template: | + **Tutorial Levels:** {{experience_description}} + **Standard Levels:** {{experience_description}} + **Challenge Levels:** {{experience_description}} + **Boss Levels:** {{experience_description}} + - id: level-flow-framework + title: Level Flow Framework + instruction: Define the standard structure for level progression + template: | + **Introduction Phase:** {{duration}} - {{purpose}} + **Development Phase:** {{duration}} - {{purpose}} + **Climax Phase:** {{duration}} - {{purpose}} + **Resolution Phase:** {{duration}} - {{purpose}} + + - id: level-categories + title: Level Categories + instruction: Define different types of levels based on the GDD requirements. Each category should be specific enough for implementation. + repeatable: true + sections: + - id: level-category + title: "{{category_name}} Levels" + template: | + **Purpose:** {{gameplay_purpose}} + + **Target Duration:** {{min_time}} - {{max_time}} minutes + + **Difficulty Range:** {{difficulty_scale}} + + **Key Mechanics Featured:** + + - {{mechanic_1}} - {{usage_description}} + - {{mechanic_2}} - {{usage_description}} + + **Player Objectives:** + + - Primary: {{primary_objective}} + - Secondary: {{secondary_objective}} + - Hidden: {{secret_objective}} + + **Success Criteria:** + + - {{completion_requirement_1}} + - {{completion_requirement_2}} + + **Technical Requirements:** + + - Maximum entities: {{entity_limit}} + - Performance target: {{fps_target}} FPS + - Memory budget: {{memory_limit}}MB + - Asset requirements: {{asset_needs}} + + - id: level-progression-system + title: Level Progression System + instruction: Define how players move through levels and how difficulty scales + sections: + - id: world-structure + title: World Structure + instruction: Based on GDD requirements, define the overall level organization + template: | + **Organization Type:** {{linear|hub_world|open_world}} + + **Total Level Count:** {{number}} + + **World Breakdown:** + + - World 1: {{level_count}} levels - {{theme}} - {{difficulty_range}} + - World 2: {{level_count}} levels - {{theme}} - {{difficulty_range}} + - World 3: {{level_count}} levels - {{theme}} - {{difficulty_range}} + - id: difficulty-progression + title: Difficulty Progression + instruction: Define how challenge increases across the game + sections: + - id: progression-curve + title: Progression Curve + type: code + language: text + template: | + Difficulty + ^ ___/``` + | / + | / ___/``` + | / / + | / / + |/ / + +-----------> Level Number + Tutorial Early Mid Late + - id: scaling-parameters + title: Scaling Parameters + type: bullet-list + template: | + - Enemy count: {{start_count}} → {{end_count}} + - Enemy difficulty: {{start_diff}} → {{end_diff}} + - Level complexity: {{start_complex}} → {{end_complex}} + - Time pressure: {{start_time}} → {{end_time}} + - id: unlock-requirements + title: Unlock Requirements + instruction: Define how players access new levels + template: | + **Progression Gates:** + + - Linear progression: Complete previous level + - Star requirements: {{star_count}} stars to unlock + - Skill gates: Demonstrate {{skill_requirement}} + - Optional content: {{unlock_condition}} + + - id: level-design-components + title: Level Design Components + instruction: Define the building blocks used to create levels + sections: + - id: environmental-elements + title: Environmental Elements + instruction: Define all environmental components that can be used in levels + template: | + **Terrain Types:** + + - {{terrain_1}}: {{properties_and_usage}} + - {{terrain_2}}: {{properties_and_usage}} + + **Interactive Objects:** + + - {{object_1}}: {{behavior_and_purpose}} + - {{object_2}}: {{behavior_and_purpose}} + + **Hazards and Obstacles:** + + - {{hazard_1}}: {{damage_and_behavior}} + - {{hazard_2}}: {{damage_and_behavior}} + - id: collectibles-rewards + title: Collectibles and Rewards + instruction: Define all collectible items and their placement rules + template: | + **Collectible Types:** + + - {{collectible_1}}: {{value_and_purpose}} + - {{collectible_2}}: {{value_and_purpose}} + + **Placement Guidelines:** + + - Mandatory collectibles: {{placement_rules}} + - Optional collectibles: {{placement_rules}} + - Secret collectibles: {{placement_rules}} + + **Reward Distribution:** + + - Easy to find: {{percentage}}% + - Moderate challenge: {{percentage}}% + - High skill required: {{percentage}}% + - id: enemy-placement-framework + title: Enemy Placement Framework + instruction: Define how enemies should be placed and balanced in levels + template: | + **Enemy Categories:** + + - {{enemy_type_1}}: {{behavior_and_usage}} + - {{enemy_type_2}}: {{behavior_and_usage}} + + **Placement Principles:** + + - Introduction encounters: {{guideline}} + - Standard encounters: {{guideline}} + - Challenge encounters: {{guideline}} + + **Difficulty Scaling:** + + - Enemy count progression: {{scaling_rule}} + - Enemy type introduction: {{pacing_rule}} + - Encounter complexity: {{complexity_rule}} + + - id: level-creation-guidelines + title: Level Creation Guidelines + instruction: Provide specific guidelines for creating individual levels + sections: + - id: level-layout-principles + title: Level Layout Principles + template: | + **Spatial Design:** + + - Grid size: {{grid_dimensions}} + - Minimum path width: {{width_units}} + - Maximum vertical distance: {{height_units}} + - Safe zones placement: {{safety_guidelines}} + + **Navigation Design:** + + - Clear path indication: {{visual_cues}} + - Landmark placement: {{landmark_rules}} + - Dead end avoidance: {{dead_end_policy}} + - Multiple path options: {{branching_rules}} + - id: pacing-and-flow + title: Pacing and Flow + instruction: Define how to control the rhythm and pace of gameplay within levels + template: | + **Action Sequences:** + + - High intensity duration: {{max_duration}} + - Rest period requirement: {{min_rest_time}} + - Intensity variation: {{pacing_pattern}} + + **Learning Sequences:** + + - New mechanic introduction: {{teaching_method}} + - Practice opportunity: {{practice_duration}} + - Skill application: {{application_context}} + - id: challenge-design + title: Challenge Design + instruction: Define how to create appropriate challenges for each level type + template: | + **Challenge Types:** + + - Execution challenges: {{skill_requirements}} + - Puzzle challenges: {{complexity_guidelines}} + - Time challenges: {{time_pressure_rules}} + - Resource challenges: {{resource_management}} + + **Difficulty Calibration:** + + - Skill check frequency: {{frequency_guidelines}} + - Failure recovery: {{retry_mechanics}} + - Hint system integration: {{help_system}} + + - id: technical-implementation + title: Technical Implementation + instruction: Define technical requirements for level implementation + sections: + - id: level-data-structure + title: Level Data Structure + instruction: Define how level data should be structured for implementation + template: | + **Level File Format:** + + - Data format: {{json|yaml|custom}} + - File naming: `level_{{world}}_{{number}}.{{extension}}` + - Data organization: {{structure_description}} + sections: + - id: required-data-fields + title: Required Data Fields + type: code + language: json + template: | + { + "levelId": "{{unique_identifier}}", + "worldId": "{{world_identifier}}", + "difficulty": {{difficulty_value}}, + "targetTime": {{completion_time_seconds}}, + "objectives": { + "primary": "{{primary_objective}}", + "secondary": ["{{secondary_objectives}}"], + "hidden": ["{{secret_objectives}}"] + }, + "layout": { + "width": {{grid_width}}, + "height": {{grid_height}}, + "tilemap": "{{tilemap_reference}}" + }, + "entities": [ + { + "type": "{{entity_type}}", + "position": {"x": {{x}}, "y": {{y}}}, + "properties": {{entity_properties}} + } + ] + } + - id: asset-integration + title: Asset Integration + instruction: Define how level assets are organized and loaded + template: | + **Tilemap Requirements:** + + - Tile size: {{tile_dimensions}}px + - Tileset organization: {{tileset_structure}} + - Layer organization: {{layer_system}} + - Collision data: {{collision_format}} + + **Audio Integration:** + + - Background music: {{music_requirements}} + - Ambient sounds: {{ambient_system}} + - Dynamic audio: {{dynamic_audio_rules}} + - id: performance-optimization + title: Performance Optimization + instruction: Define performance requirements for level systems + template: | + **Entity Limits:** + + - Maximum active entities: {{entity_limit}} + - Maximum particles: {{particle_limit}} + - Maximum audio sources: {{audio_limit}} + + **Memory Management:** + + - Texture memory budget: {{texture_memory}}MB + - Audio memory budget: {{audio_memory}}MB + - Level loading time: <{{load_time}}s + + **Culling and LOD:** + + - Off-screen culling: {{culling_distance}} + - Level-of-detail rules: {{lod_system}} + - Asset streaming: {{streaming_requirements}} + + - id: level-testing-framework + title: Level Testing Framework + instruction: Define how levels should be tested and validated + sections: + - id: automated-testing + title: Automated Testing + template: | + **Performance Testing:** + + - Frame rate validation: Maintain {{fps_target}} FPS + - Memory usage monitoring: Stay under {{memory_limit}}MB + - Loading time verification: Complete in <{{load_time}}s + + **Gameplay Testing:** + + - Completion path validation: All objectives achievable + - Collectible accessibility: All items reachable + - Softlock prevention: No unwinnable states + - id: manual-testing-protocol + title: Manual Testing Protocol + sections: + - id: playtesting-checklist + title: Playtesting Checklist + type: checklist + items: + - "Level completes within target time range" + - "All mechanics function correctly" + - "Difficulty feels appropriate for level category" + - "Player guidance is clear and effective" + - "No exploits or sequence breaks (unless intended)" + - id: player-experience-testing + title: Player Experience Testing + type: checklist + items: + - "Tutorial levels teach effectively" + - "Challenge feels fair and rewarding" + - "Flow and pacing maintain engagement" + - "Audio and visual feedback support gameplay" + - id: balance-validation + title: Balance Validation + template: | + **Metrics Collection:** + + - Completion rate: Target {{completion_percentage}}% + - Average completion time: {{target_time}} ± {{variance}} + - Death count per level: <{{max_deaths}} + - Collectible discovery rate: {{discovery_percentage}}% + + **Iteration Guidelines:** + + - Adjustment criteria: {{criteria_for_changes}} + - Testing sample size: {{minimum_testers}} + - Validation period: {{testing_duration}} + + - id: content-creation-pipeline + title: Content Creation Pipeline + instruction: Define the workflow for creating new levels + sections: + - id: design-phase + title: Design Phase + template: | + **Concept Development:** + + 1. Define level purpose and goals + 2. Create rough layout sketch + 3. Identify key mechanics and challenges + 4. Estimate difficulty and duration + + **Documentation Requirements:** + + - Level design brief + - Layout diagrams + - Mechanic integration notes + - Asset requirement list + - id: implementation-phase + title: Implementation Phase + template: | + **Technical Implementation:** + + 1. Create level data file + 2. Build tilemap and layout + 3. Place entities and objects + 4. Configure level logic and triggers + 5. Integrate audio and visual effects + + **Quality Assurance:** + + 1. Automated testing execution + 2. Internal playtesting + 3. Performance validation + 4. Bug fixing and polish + - id: integration-phase + title: Integration Phase + template: | + **Game Integration:** + + 1. Level progression integration + 2. Save system compatibility + 3. Analytics integration + 4. Achievement system integration + + **Final Validation:** + + 1. Full game context testing + 2. Performance regression testing + 3. Platform compatibility verification + 4. Final approval and release + + - id: success-metrics + title: Success Metrics + instruction: Define how to measure level design success + sections: + - id: player-engagement + title: Player Engagement + type: bullet-list + template: | + - Level completion rate: {{target_rate}}% + - Replay rate: {{replay_target}}% + - Time spent per level: {{engagement_time}} + - Player satisfaction scores: {{satisfaction_target}}/10 + - id: technical-performance + title: Technical Performance + type: bullet-list + template: | + - Frame rate consistency: {{fps_consistency}}% + - Loading time compliance: {{load_compliance}}% + - Memory usage efficiency: {{memory_efficiency}}% + - Crash rate: <{{crash_threshold}}% + - id: design-quality + title: Design Quality + type: bullet-list + template: | + - Difficulty curve adherence: {{curve_accuracy}} + - Mechanic integration effectiveness: {{integration_score}} + - Player guidance clarity: {{guidance_score}} + - Content accessibility: {{accessibility_rate}}% +==================== END: .bmad-2d-phaser-game-dev/templates/level-design-doc-tmpl.yaml ==================== + +==================== START: .bmad-2d-phaser-game-dev/tasks/advanced-elicitation.md ==================== +# Advanced Game Design Elicitation Task + +## Purpose + +- Provide optional reflective and brainstorming actions to enhance game design content quality +- Enable deeper exploration of game mechanics and player experience through structured elicitation techniques +- Support iterative refinement through multiple game development perspectives +- Apply game-specific critical thinking to design decisions + +## Task Instructions + +### 1. Game Design Context and Review + +[[LLM: When invoked after outputting a game design section: + +1. First, provide a brief 1-2 sentence summary of what the user should look for in the section just presented, with game-specific focus (e.g., "Please review the core mechanics for player engagement and implementation feasibility. Pay special attention to how these mechanics create the intended player experience and whether they're technically achievable with Phaser 3.") + +2. If the section contains game flow diagrams, level layouts, or system diagrams, explain each diagram briefly with game development context before offering elicitation options (e.g., "The gameplay loop diagram shows how player actions lead to rewards and progression. Notice how each step maintains player engagement and creates opportunities for skill development.") + +3. If the section contains multiple game elements (like multiple mechanics, multiple levels, multiple systems, etc.), inform the user they can apply elicitation actions to: + + - The entire section as a whole + - Individual game elements within the section (specify which element when selecting an action) + +4. Then present the action list as specified below.]] + +### 2. Ask for Review and Present Game Design Action List + +[[LLM: Ask the user to review the drafted game design section. In the SAME message, inform them that they can suggest additions, removals, or modifications, OR they can select an action by number from the 'Advanced Game Design Elicitation & Brainstorming Actions'. If there are multiple game elements in the section, mention they can specify which element(s) to apply the action to. Then, present ONLY the numbered list (0-9) of these actions. Conclude by stating that selecting 9 will proceed to the next section. Await user selection. If an elicitation action (0-8) is chosen, execute it and then re-offer this combined review/elicitation choice. If option 9 is chosen, or if the user provides direct feedback, proceed accordingly.]] + +**Present the numbered list (0-9) with this exact format:** + +```text +**Advanced Game Design Elicitation & Brainstorming Actions** +Choose an action (0-9 - 9 to bypass - HELP for explanation of these options): + +0. Expand or Contract for Target Audience +1. Explain Game Design Reasoning (Step-by-Step) +2. Critique and Refine from Player Perspective +3. Analyze Game Flow and Mechanic Dependencies +4. Assess Alignment with Player Experience Goals +5. Identify Potential Player Confusion and Design Risks +6. Challenge from Critical Game Design Perspective +7. Explore Alternative Game Design Approaches +8. Hindsight Postmortem: The 'If Only...' Game Design Reflection +9. Proceed / No Further Actions +``` + +### 2. Processing Guidelines + +**Do NOT show:** + +- The full protocol text with `[[LLM: ...]]` instructions +- Detailed explanations of each option unless executing or the user asks, when giving the definition you can modify to tie its game development relevance +- Any internal template markup + +**After user selection from the list:** + +- Execute the chosen action according to the game design protocol instructions below +- Ask if they want to select another action or proceed with option 9 once complete +- Continue until user selects option 9 or indicates completion + +## Game Design Action Definitions + +0. Expand or Contract for Target Audience + [[LLM: Ask the user whether they want to 'expand' on the game design content (add more detail, elaborate on mechanics, include more examples) or 'contract' it (simplify mechanics, focus on core features, reduce complexity). Also, ask if there's a specific player demographic or experience level they have in mind (casual players, hardcore gamers, children, etc.). Once clarified, perform the expansion or contraction from your current game design role's perspective, tailored to the specified player audience if provided.]] + +1. Explain Game Design Reasoning (Step-by-Step) + [[LLM: Explain the step-by-step game design thinking process that you used to arrive at the current proposal for this game content. Focus on player psychology, engagement mechanics, technical feasibility, and how design decisions support the overall player experience goals.]] + +2. Critique and Refine from Player Perspective + [[LLM: From your current game design role's perspective, review your last output or the current section for potential player confusion, engagement issues, balance problems, or areas for improvement. Consider how players will actually interact with and experience these systems, then suggest a refined version that better serves player enjoyment and understanding.]] + +3. Analyze Game Flow and Mechanic Dependencies + [[LLM: From your game design role's standpoint, examine the content's structure for logical gameplay progression, mechanic interdependencies, and player learning curve. Confirm if game elements are introduced in an effective order that teaches players naturally and maintains engagement throughout the experience.]] + +4. Assess Alignment with Player Experience Goals + [[LLM: Evaluate how well the current game design content contributes to the stated player experience goals and core game pillars. Consider whether the mechanics actually create the intended emotions and engagement patterns. Identify any misalignments between design intentions and likely player reactions.]] + +5. Identify Potential Player Confusion and Design Risks + [[LLM: Based on your game design expertise, brainstorm potential sources of player confusion, overlooked edge cases in gameplay, balance issues, technical implementation risks, or unintended player behaviors that could emerge from the current design. Consider both new and experienced players' perspectives.]] + +6. Challenge from Critical Game Design Perspective + [[LLM: Adopt a critical game design perspective on the current content. If the user specifies another viewpoint (e.g., 'as a casual player', 'as a speedrunner', 'as a mobile player', 'as a technical implementer'), critique the content from that specified perspective. If no other role is specified, play devil's advocate from your game design expertise, arguing against the current design proposal and highlighting potential weaknesses, player experience issues, or implementation challenges. This can include questioning scope creep, unnecessary complexity, or features that don't serve the core player experience.]] + +7. Explore Alternative Game Design Approaches + [[LLM: From your game design role's perspective, first broadly brainstorm a range of diverse approaches to achieving the same player experience goals or solving the same design challenge. Consider different genres, mechanics, interaction models, or technical approaches. Then, from this wider exploration, select and present 2-3 distinct alternative design approaches, detailing the pros, cons, player experience implications, and technical feasibility you foresee for each.]] + +8. Hindsight Postmortem: The 'If Only...' Game Design Reflection + [[LLM: In your current game design persona, imagine this is a postmortem for a shipped game based on the current design content. What's the one 'if only we had designed/considered/tested X...' that your role would highlight from a game design perspective? Include the imagined player reactions, review scores, or development consequences. This should be both insightful and somewhat humorous, focusing on common game design pitfalls.]] + +9. Proceed / No Further Actions + [[LLM: Acknowledge the user's choice to finalize the current game design work, accept the AI's last output as is, or move on to the next step without selecting another action from this list. Prepare to proceed accordingly.]] + +## Game Development Context Integration + +This elicitation task is specifically designed for game development and should be used in contexts where: + +- **Game Mechanics Design**: When defining core gameplay systems and player interactions +- **Player Experience Planning**: When designing for specific emotional responses and engagement patterns +- **Technical Game Architecture**: When balancing design ambitions with implementation realities +- **Game Balance and Progression**: When designing difficulty curves and player advancement systems +- **Platform Considerations**: When adapting designs for different devices and input methods + +The questions and perspectives offered should always consider: + +- Player psychology and motivation +- Technical feasibility with Phaser 3 and TypeScript +- Performance implications for 60 FPS targets +- Cross-platform compatibility (desktop and mobile) +- Game development best practices and common pitfalls +==================== END: .bmad-2d-phaser-game-dev/tasks/advanced-elicitation.md ==================== + +==================== START: .bmad-2d-phaser-game-dev/tasks/create-game-story.md ==================== +# Create Game Development Story Task + +## Purpose + +Create detailed, actionable game development stories that enable AI developers to implement specific game features without requiring additional design decisions. + +## When to Use + +- Breaking down game epics into implementable stories +- Converting GDD features into development tasks +- Preparing work for game developers +- Ensuring clear handoffs from design to development + +## Prerequisites + +Before creating stories, ensure you have: + +- Completed Game Design Document (GDD) - Game Architecture Document -- Any existing stories in this epic +- Epic definition this story belongs to +- Clear understanding of the specific game feature -The story should be specific enough that a developer can implement it without requiring additional design decisions.]] +## Process -## Description +### 1. Story Identification -[[LLM: Provide a clear, concise description of what this story implements. Focus on the specific game feature or system being built. Reference the GDD section that defines this feature.]] +**Review Epic Context:** -{{clear_description_of_what_needs_to_be_implemented}} +- Understand the epic's overall goal +- Identify specific features that need implementation +- Review any existing stories in the epic +- Ensure no duplicate work -## Acceptance Criteria +**Feature Analysis:** -[[LLM: Define specific, testable conditions that must be met for the story to be considered complete. Each criterion should be verifiable and directly related to gameplay functionality.]] +- Reference specific GDD sections +- Understand player experience goals +- Identify technical complexity +- Estimate implementation scope -### Functional Requirements +### 2. Story Scoping -- [ ] {{specific_functional_requirement_1}} -- [ ] {{specific_functional_requirement_2}} -- [ ] {{specific_functional_requirement_3}} +**Single Responsibility:** -### Technical Requirements +- Focus on one specific game feature +- Ensure story is completable in 1-3 days +- Break down complex features into multiple stories +- Maintain clear boundaries with other stories -- [ ] Code follows TypeScript strict mode standards -- [ ] Maintains 60 FPS on target devices -- [ ] No memory leaks or performance degradation -- [ ] {{specific_technical_requirement}} +**Implementation Clarity:** -### Game Design Requirements +- Define exactly what needs to be built +- Specify all technical requirements +- Include all necessary integration points +- Provide clear success criteria -- [ ] {{gameplay_requirement_from_gdd}} -- [ ] {{balance_requirement_if_applicable}} -- [ ] {{player_experience_requirement}} +### 3. Template Execution + +**Load Template:** +Use `.bmad-2d-phaser-game-dev/templates/game-story-tmpl.md` following all embedded LLM instructions + +**Key Focus Areas:** + +- Clear, actionable description +- Specific acceptance criteria +- Detailed technical specifications +- Complete implementation task list +- Comprehensive testing requirements + +### 4. Story Validation + +**Technical Review:** + +- Verify all technical specifications are complete +- Ensure integration points are clearly defined +- Confirm file paths match architecture +- Validate TypeScript interfaces and classes + +**Game Design Alignment:** + +- Confirm story implements GDD requirements +- Verify player experience goals are met +- Check balance parameters are included +- Ensure game mechanics are correctly interpreted + +**Implementation Readiness:** + +- All dependencies identified +- Assets requirements specified +- Testing criteria defined +- Definition of Done complete + +### 5. Quality Assurance + +**Apply Checklist:** +Execute `.bmad-2d-phaser-game-dev/checklists/game-story-dod-checklist.md` against completed story + +**Story Criteria:** + +- Story is immediately actionable +- No design decisions left to developer +- Technical requirements are complete +- Testing requirements are comprehensive +- Performance requirements are specified + +### 6. Story Refinement + +**Developer Perspective:** + +- Can a developer start implementation immediately? +- Are all technical questions answered? +- Is the scope appropriate for the estimated points? +- Are all dependencies clearly identified? + +**Iterative Improvement:** + +- Address any gaps or ambiguities +- Clarify complex technical requirements +- Ensure story fits within epic scope +- Verify story points estimation + +## Story Elements Checklist + +### Required Sections + +- [ ] Clear, specific description +- [ ] Complete acceptance criteria (functional, technical, game design) +- [ ] Detailed technical specifications +- [ ] File creation/modification list +- [ ] TypeScript interfaces and classes +- [ ] Integration point specifications +- [ ] Ordered implementation tasks +- [ ] Comprehensive testing requirements +- [ ] Performance criteria +- [ ] Dependencies clearly identified +- [ ] Definition of Done checklist + +### Game-Specific Requirements + +- [ ] GDD section references +- [ ] Game mechanic implementation details +- [ ] Player experience goals +- [ ] Balance parameters +- [ ] Phaser 3 specific requirements +- [ ] Performance targets (60 FPS) +- [ ] Cross-platform considerations + +### Technical Quality + +- [ ] TypeScript strict mode compliance +- [ ] Architecture document alignment +- [ ] Code organization follows standards +- [ ] Error handling requirements +- [ ] Memory management considerations +- [ ] Testing strategy defined + +## Common Pitfalls + +**Scope Issues:** + +- Story too large (break into multiple stories) +- Story too vague (add specific requirements) +- Missing dependencies (identify all prerequisites) +- Unclear boundaries (define what's in/out of scope) + +**Technical Issues:** + +- Missing integration details +- Incomplete technical specifications +- Undefined interfaces or classes +- Missing performance requirements + +**Game Design Issues:** + +- Not referencing GDD properly +- Missing player experience context +- Unclear game mechanic implementation +- Missing balance parameters + +## Success Criteria + +**Story Readiness:** + +- [ ] Developer can start implementation immediately +- [ ] No additional design decisions required +- [ ] All technical questions answered +- [ ] Testing strategy is complete +- [ ] Performance requirements are clear +- [ ] Story fits within epic scope + +**Quality Validation:** + +- [ ] Game story DOD checklist passes +- [ ] Architecture alignment confirmed +- [ ] GDD requirements covered +- [ ] Implementation tasks are ordered and specific +- [ ] Dependencies are complete and accurate + +## Handoff Protocol + +**To Game Developer:** + +1. Provide story document +2. Confirm GDD and architecture access +3. Verify all dependencies are met +4. Answer any clarification questions +5. Establish check-in schedule + +**Story Status Updates:** + +- Draft → Ready for Development +- In Development → Code Review +- Code Review → Testing +- Testing → Done + +This task ensures game development stories are immediately actionable and enable efficient AI-driven development of game features. +==================== END: .bmad-2d-phaser-game-dev/tasks/create-game-story.md ==================== + +==================== START: .bmad-2d-phaser-game-dev/tasks/game-design-brainstorming.md ==================== +# Game Design Brainstorming Techniques Task + +This task provides a comprehensive toolkit of creative brainstorming techniques specifically designed for game design ideation and innovative thinking. The game designer can use these techniques to facilitate productive brainstorming sessions focused on game mechanics, player experience, and creative concepts. + +## Process + +### 1. Session Setup + +[[LLM: Begin by understanding the game design context and goals. Ask clarifying questions if needed to determine the best approach for game-specific ideation.]] + +1. **Establish Game Context** + + - Understand the game genre or opportunity area + - Identify target audience and platform constraints + - Determine session goals (concept exploration vs. mechanic refinement) + - Clarify scope (full game vs. specific feature) + +2. **Select Technique Approach** + - Option A: User selects specific game design techniques + - Option B: Game Designer recommends techniques based on context + - Option C: Random technique selection for creative variety + - Option D: Progressive technique flow (broad concepts to specific mechanics) + +### 2. Game Design Brainstorming Techniques + +#### Game Concept Expansion Techniques + +1. **"What If" Game Scenarios** + [[LLM: Generate provocative what-if questions that challenge game design assumptions and expand thinking beyond current genre limitations.]] + + - What if players could rewind time in any genre? + - What if the game world reacted to the player's real-world location? + - What if failure was more rewarding than success? + - What if players controlled the antagonist instead? + - What if the game played itself when no one was watching? + +2. **Cross-Genre Fusion** + [[LLM: Help user combine unexpected game genres and mechanics to create unique experiences.]] + + - "How might [genre A] mechanics work in [genre B]?" + - Puzzle mechanics in action games + - Dating sim elements in strategy games + - Horror elements in racing games + - Educational content in roguelike structure + +3. **Player Motivation Reversal** + [[LLM: Flip traditional player motivations to reveal new gameplay possibilities.]] + + - What if losing was the goal? + - What if cooperation was forced in competitive games? + - What if players had to help their enemies? + - What if progress meant giving up abilities? + +4. **Core Loop Deconstruction** + [[LLM: Break down successful games to fundamental mechanics and rebuild differently.]] + - What are the essential 3 actions in this game type? + - How could we make each action more interesting? + - What if we changed the order of these actions? + - What if players could skip or automate certain actions? + +#### Mechanic Innovation Frameworks + +1. **SCAMPER for Game Mechanics** + [[LLM: Guide through each SCAMPER prompt specifically for game design.]] + + - **S** = Substitute: What mechanics can be substituted? (walking → flying → swimming) + - **C** = Combine: What systems can be merged? (inventory + character growth) + - **A** = Adapt: What mechanics from other media? (books, movies, sports) + - **M** = Modify/Magnify: What can be exaggerated? (super speed, massive scale) + - **P** = Put to other uses: What else could this mechanic do? (jumping → attacking) + - **E** = Eliminate: What can be removed? (UI, tutorials, fail states) + - **R** = Reverse/Rearrange: What sequence changes? (end-to-start, simultaneous) + +2. **Player Agency Spectrum** + [[LLM: Explore different levels of player control and agency across game systems.]] + + - Full Control: Direct character movement, combat, building + - Indirect Control: Setting rules, giving commands, environmental changes + - Influence Only: Suggestions, preferences, emotional reactions + - No Control: Observation, interpretation, passive experience + +3. **Temporal Game Design** + [[LLM: Explore how time affects gameplay and player experience.]] + + - Real-time vs. turn-based mechanics + - Time travel and manipulation + - Persistent vs. session-based progress + - Asynchronous multiplayer timing + - Seasonal and event-based content + +#### Player Experience Ideation + +1. **Emotion-First Design** + [[LLM: Start with target emotions and work backward to mechanics that create them.]] + + - Target Emotion: Wonder → Mechanics: Discovery, mystery, scale + - Target Emotion: Triumph → Mechanics: Challenge, skill growth, recognition + - Target Emotion: Connection → Mechanics: Cooperation, shared goals, communication + - Target Emotion: Flow → Mechanics: Clear feedback, progressive difficulty + +2. **Player Archetype Brainstorming** + [[LLM: Design for different player types and motivations.]] + + - Achievers: Progression, completion, mastery + - Explorers: Discovery, secrets, world-building + - Socializers: Interaction, cooperation, community + - Killers: Competition, dominance, conflict + - Creators: Building, customization, expression + +3. **Accessibility-First Innovation** + [[LLM: Generate ideas that make games more accessible while creating new gameplay.]] + + - Visual impairment considerations leading to audio-focused mechanics + - Motor accessibility inspiring one-handed or simplified controls + - Cognitive accessibility driving clear feedback and pacing + - Economic accessibility creating free-to-play innovations + +#### Narrative and World Building + +1. **Environmental Storytelling** + [[LLM: Brainstorm ways the game world itself tells stories without explicit narrative.]] + + - How does the environment show history? + - What do interactive objects reveal about characters? + - How can level design communicate mood? + - What stories do systems and mechanics tell? + +2. **Player-Generated Narrative** + [[LLM: Explore ways players create their own stories through gameplay.]] + + - Emergent storytelling through player choices + - Procedural narrative generation + - Player-to-player story sharing + - Community-driven world events + +3. **Genre Expectation Subversion** + [[LLM: Identify and deliberately subvert player expectations within genres.]] + + - Fantasy RPG where magic is mundane + - Horror game where monsters are friendly + - Racing game where going slow is optimal + - Puzzle game where there are multiple correct answers + +#### Technical Innovation Inspiration + +1. **Platform-Specific Design** + [[LLM: Generate ideas that leverage unique platform capabilities.]] + + - Mobile: GPS, accelerometer, camera, always-connected + - Web: URLs, tabs, social sharing, real-time collaboration + - Console: Controllers, TV viewing, couch co-op + - VR/AR: Physical movement, spatial interaction, presence + +2. **Constraint-Based Creativity** + [[LLM: Use technical or design constraints as creative catalysts.]] + + - One-button games + - Games without graphics + - Games that play in notification bars + - Games using only system sounds + - Games with intentionally bad graphics + +### 3. Game-Specific Technique Selection + +[[LLM: Help user select appropriate techniques based on their specific game design needs.]] + +**For Initial Game Concepts:** + +- What If Game Scenarios +- Cross-Genre Fusion +- Emotion-First Design + +**For Stuck/Blocked Creativity:** + +- Player Motivation Reversal +- Constraint-Based Creativity +- Genre Expectation Subversion + +**For Mechanic Development:** + +- SCAMPER for Game Mechanics +- Core Loop Deconstruction +- Player Agency Spectrum + +**For Player Experience:** + +- Player Archetype Brainstorming +- Emotion-First Design +- Accessibility-First Innovation + +**For World Building:** + +- Environmental Storytelling +- Player-Generated Narrative +- Platform-Specific Design + +### 4. Game Design Session Flow + +[[LLM: Guide the brainstorming session with appropriate pacing for game design exploration.]] + +1. **Inspiration Phase** (10-15 min) + + - Reference existing games and mechanics + - Explore player experiences and emotions + - Gather visual and thematic inspiration + +2. **Divergent Exploration** (25-35 min) + + - Generate many game concepts or mechanics + - Use expansion and fusion techniques + - Encourage wild and impossible ideas + +3. **Player-Centered Filtering** (15-20 min) + + - Consider target audience reactions + - Evaluate emotional impact and engagement + - Group ideas by player experience goals + +4. **Feasibility and Synthesis** (15-20 min) + - Assess technical and design feasibility + - Combine complementary ideas + - Develop most promising concepts + +### 5. Game Design Output Format + +[[LLM: Present brainstorming results in a format useful for game development.]] + +**Session Summary:** + +- Techniques used and focus areas +- Total concepts/mechanics generated +- Key themes and patterns identified + +**Game Concept Categories:** + +1. **Core Game Ideas** - Complete game concepts ready for prototyping +2. **Mechanic Innovations** - Specific gameplay mechanics to explore +3. **Player Experience Goals** - Emotional and engagement targets +4. **Technical Experiments** - Platform or technology-focused concepts +5. **Long-term Vision** - Ambitious ideas for future development + +**Development Readiness:** + +**Prototype-Ready Ideas:** + +- Ideas that can be tested immediately +- Minimum viable implementations +- Quick validation approaches + +**Research-Required Ideas:** + +- Concepts needing technical investigation +- Player testing and market research needs +- Competitive analysis requirements + +**Future Innovation Pipeline:** + +- Ideas requiring significant development +- Technology-dependent concepts +- Market timing considerations + +**Next Steps:** + +- Which concepts to prototype first +- Recommended research areas +- Suggested playtesting approaches +- Documentation and GDD planning + +## Game Design Specific Considerations + +### Platform and Audience Awareness + +- Always consider target platform limitations and advantages +- Keep target audience preferences and expectations in mind +- Balance innovation with familiar game design patterns +- Consider monetization and business model implications + +### Rapid Prototyping Mindset + +- Focus on ideas that can be quickly tested +- Emphasize core mechanics over complex features +- Design for iteration and player feedback +- Consider digital and paper prototyping approaches + +### Player Psychology Integration + +- Understand motivation and engagement drivers +- Consider learning curves and skill development +- Design for different play session lengths +- Balance challenge and reward appropriately + +### Technical Feasibility + +- Keep development resources and timeline in mind +- Consider art and audio asset requirements +- Think about performance and optimization needs +- Plan for testing and debugging complexity + +## Important Notes for Game Design Sessions + +- Encourage "impossible" ideas - constraints can be added later +- Build on game mechanics that have proven engagement +- Consider how ideas scale from prototype to full game +- Document player experience goals alongside mechanics +- Think about community and social aspects of gameplay +- Consider accessibility and inclusivity from the start +- Balance innovation with market viability +- Plan for iteration based on player feedback +==================== END: .bmad-2d-phaser-game-dev/tasks/game-design-brainstorming.md ==================== + +==================== START: .bmad-2d-phaser-game-dev/checklists/game-design-checklist.md ==================== +# Game Design Document Quality Checklist + +## Document Completeness + +### Executive Summary + +- [ ] **Core Concept** - Game concept is clearly explained in 2-3 sentences +- [ ] **Target Audience** - Primary and secondary audiences defined with demographics +- [ ] **Platform Requirements** - Technical platforms and requirements specified +- [ ] **Unique Selling Points** - 3-5 key differentiators from competitors identified +- [ ] **Technical Foundation** - Phaser 3 + TypeScript requirements confirmed + +### Game Design Foundation + +- [ ] **Game Pillars** - 3-5 core design pillars defined and actionable +- [ ] **Core Gameplay Loop** - 30-60 second loop documented with specific timings +- [ ] **Win/Loss Conditions** - Clear victory and failure states defined +- [ ] **Player Motivation** - Clear understanding of why players will engage +- [ ] **Scope Realism** - Game scope is achievable with available resources + +## Gameplay Mechanics + +### Core Mechanics Documentation + +- [ ] **Primary Mechanics** - 3-5 core mechanics detailed with implementation notes +- [ ] **Mechanic Integration** - How mechanics work together is clear +- [ ] **Player Input** - All input methods specified for each platform +- [ ] **System Responses** - Game responses to player actions documented +- [ ] **Performance Impact** - Performance considerations for each mechanic noted + +### Controls and Interaction + +- [ ] **Multi-Platform Controls** - Desktop, mobile, and gamepad controls defined +- [ ] **Input Responsiveness** - Requirements for responsive game feel specified +- [ ] **Accessibility Options** - Control customization and accessibility considered +- [ ] **Touch Optimization** - Mobile-specific control adaptations designed +- [ ] **Edge Case Handling** - Unusual input scenarios addressed + +## Progression and Balance + +### Player Progression + +- [ ] **Progression Type** - Linear, branching, or metroidvania approach defined +- [ ] **Key Milestones** - Major progression points documented +- [ ] **Unlock System** - What players unlock and when is specified +- [ ] **Difficulty Scaling** - How challenge increases over time is detailed +- [ ] **Player Agency** - Meaningful player choices and consequences defined + +### Game Balance + +- [ ] **Balance Parameters** - Numeric values for key game systems provided +- [ ] **Difficulty Curve** - Appropriate challenge progression designed +- [ ] **Economy Design** - Resource systems balanced for engagement +- [ ] **Player Testing** - Plan for validating balance through playtesting +- [ ] **Iteration Framework** - Process for adjusting balance post-implementation + +## Level Design Framework + +### Level Structure + +- [ ] **Level Types** - Different level categories defined with purposes +- [ ] **Level Progression** - How players move through levels specified +- [ ] **Duration Targets** - Expected play time for each level type +- [ ] **Difficulty Distribution** - Appropriate challenge spread across levels +- [ ] **Replay Value** - Elements that encourage repeated play designed + +### Content Guidelines + +- [ ] **Level Creation Rules** - Clear guidelines for level designers +- [ ] **Mechanic Introduction** - How new mechanics are taught in levels +- [ ] **Pacing Variety** - Mix of action, puzzle, and rest moments planned +- [ ] **Secret Content** - Hidden areas and optional challenges designed +- [ ] **Accessibility Options** - Multiple difficulty levels or assist modes considered + +## Technical Implementation Readiness + +### Performance Requirements + +- [ ] **Frame Rate Targets** - 60 FPS target with minimum acceptable rates +- [ ] **Memory Budgets** - Maximum memory usage limits defined +- [ ] **Load Time Goals** - Acceptable loading times for different content +- [ ] **Battery Optimization** - Mobile battery usage considerations addressed +- [ ] **Scalability Plan** - How performance scales across different devices + +### Platform Specifications + +- [ ] **Desktop Requirements** - Minimum and recommended PC/Mac specs +- [ ] **Mobile Optimization** - iOS and Android specific requirements +- [ ] **Browser Compatibility** - Supported browsers and versions listed +- [ ] **Cross-Platform Features** - Shared and platform-specific features identified +- [ ] **Update Strategy** - Plan for post-launch updates and patches + +### Asset Requirements + +- [ ] **Art Style Definition** - Clear visual style with reference materials +- [ ] **Asset Specifications** - Technical requirements for all asset types +- [ ] **Audio Requirements** - Music and sound effect specifications +- [ ] **UI/UX Guidelines** - User interface design principles established +- [ ] **Localization Plan** - Text and cultural localization requirements + +## Development Planning + +### Implementation Phases + +- [ ] **Phase Breakdown** - Development divided into logical phases +- [ ] **Epic Definitions** - Major development epics identified +- [ ] **Dependency Mapping** - Prerequisites between features documented +- [ ] **Risk Assessment** - Technical and design risks identified with mitigation +- [ ] **Milestone Planning** - Key deliverables and deadlines established + +### Team Requirements + +- [ ] **Role Definitions** - Required team roles and responsibilities +- [ ] **Skill Requirements** - Technical skills needed for implementation +- [ ] **Resource Allocation** - Time and effort estimates for major features +- [ ] **External Dependencies** - Third-party tools, assets, or services needed +- [ ] **Communication Plan** - How team members will coordinate work + +## Quality Assurance + +### Success Metrics + +- [ ] **Technical Metrics** - Measurable technical performance goals +- [ ] **Gameplay Metrics** - Player engagement and retention targets +- [ ] **Quality Benchmarks** - Standards for bug rates and polish level +- [ ] **User Experience Goals** - Specific UX objectives and measurements +- [ ] **Business Objectives** - Commercial or project success criteria + +### Testing Strategy + +- [ ] **Playtesting Plan** - How and when player feedback will be gathered +- [ ] **Technical Testing** - Performance and compatibility testing approach +- [ ] **Balance Validation** - Methods for confirming game balance +- [ ] **Accessibility Testing** - Plan for testing with diverse players +- [ ] **Iteration Process** - How feedback will drive design improvements + +## Documentation Quality + +### Clarity and Completeness + +- [ ] **Clear Writing** - All sections are well-written and understandable +- [ ] **Complete Coverage** - No major game systems left undefined +- [ ] **Actionable Detail** - Enough detail for developers to create implementation stories +- [ ] **Consistent Terminology** - Game terms used consistently throughout +- [ ] **Reference Materials** - Links to inspiration, research, and additional resources + +### Maintainability + +- [ ] **Version Control** - Change log established for tracking revisions +- [ ] **Update Process** - Plan for maintaining document during development +- [ ] **Team Access** - All team members can access and reference the document +- [ ] **Search Functionality** - Document organized for easy reference and searching +- [ ] **Living Document** - Process for incorporating feedback and changes + +## Stakeholder Alignment + +### Team Understanding + +- [ ] **Shared Vision** - All team members understand and agree with the game vision +- [ ] **Role Clarity** - Each team member understands their contribution +- [ ] **Decision Framework** - Process for making design decisions during development +- [ ] **Conflict Resolution** - Plan for resolving disagreements about design choices +- [ ] **Communication Channels** - Regular meetings and feedback sessions planned + +### External Validation + +- [ ] **Market Validation** - Competitive analysis and market fit assessment +- [ ] **Technical Validation** - Feasibility confirmed with technical team +- [ ] **Resource Validation** - Required resources available and committed +- [ ] **Timeline Validation** - Development schedule is realistic and achievable +- [ ] **Quality Validation** - Quality standards align with available time and resources + +## Final Readiness Assessment + +### Implementation Preparedness + +- [ ] **Story Creation Ready** - Document provides sufficient detail for story creation +- [ ] **Architecture Alignment** - Game design aligns with technical capabilities +- [ ] **Asset Production** - Asset requirements enable art and audio production +- [ ] **Development Workflow** - Clear path from design to implementation +- [ ] **Quality Assurance** - Testing and validation processes established + +### Document Approval + +- [ ] **Design Review Complete** - Document reviewed by all relevant stakeholders +- [ ] **Technical Review Complete** - Technical feasibility confirmed +- [ ] **Business Review Complete** - Project scope and goals approved +- [ ] **Final Approval** - Document officially approved for implementation +- [ ] **Baseline Established** - Current version established as development baseline + +## Overall Assessment + +**Document Quality Rating:** ⭐⭐⭐⭐⭐ + +**Ready for Development:** [ ] Yes [ ] No + +**Key Recommendations:** +_List any critical items that need attention before moving to implementation phase._ + +**Next Steps:** +_Outline immediate next actions for the team based on this assessment._ +==================== END: .bmad-2d-phaser-game-dev/checklists/game-design-checklist.md ==================== + +==================== START: .bmad-2d-phaser-game-dev/checklists/game-story-dod-checklist.md ==================== +# Game Development Story Definition of Done Checklist + +## Story Completeness + +### Basic Story Elements + +- [ ] **Story Title** - Clear, descriptive title that identifies the feature +- [ ] **Epic Assignment** - Story is properly assigned to relevant epic +- [ ] **Priority Level** - Appropriate priority assigned (High/Medium/Low) +- [ ] **Story Points** - Realistic estimation for implementation complexity +- [ ] **Description** - Clear, concise description of what needs to be implemented + +### Game Design Alignment + +- [ ] **GDD Reference** - Specific Game Design Document section referenced +- [ ] **Game Mechanic Context** - Clear connection to game mechanics defined in GDD +- [ ] **Player Experience Goal** - Describes the intended player experience +- [ ] **Balance Parameters** - Includes any relevant game balance values +- [ ] **Design Intent** - Purpose and rationale for the feature is clear ## Technical Specifications -[[LLM: Provide specific technical details that guide implementation. Include class names, file locations, and integration points based on the game architecture.]] +### Architecture Compliance -### Files to Create/Modify +- [ ] **File Organization** - Follows game architecture document structure +- [ ] **Class Definitions** - TypeScript interfaces and classes are properly defined +- [ ] **Integration Points** - Clear specification of how feature integrates with existing systems +- [ ] **Event Communication** - Event emitting and listening requirements specified +- [ ] **Dependencies** - All system dependencies clearly identified -**New Files:** +### Phaser 3 Requirements -- `{{file_path_1}}` - {{purpose}} -- `{{file_path_2}}` - {{purpose}} +- [ ] **Scene Integration** - Specifies which scenes are affected and how +- [ ] **Game Object Usage** - Proper use of Phaser 3 game objects and components +- [ ] **Physics Integration** - Physics requirements specified if applicable +- [ ] **Asset Requirements** - All needed assets (sprites, audio, data) identified +- [ ] **Performance Considerations** - 60 FPS target and optimization requirements -**Modified Files:** +### Code Quality Standards -- `{{existing_file_1}}` - {{changes_needed}} -- `{{existing_file_2}}` - {{changes_needed}} +- [ ] **TypeScript Strict Mode** - All code must comply with strict TypeScript +- [ ] **Error Handling** - Error scenarios and handling requirements specified +- [ ] **Memory Management** - Object pooling and cleanup requirements where needed +- [ ] **Cross-Platform Support** - Desktop and mobile considerations addressed +- [ ] **Code Organization** - Follows established game project structure -### Class/Interface Definitions +## Implementation Readiness -[[LLM: Define specific TypeScript interfaces and class structures needed]] +### Acceptance Criteria -```typescript -// {{interface_name}} -interface {{InterfaceName}} { - {{property_1}}: {{type}}; - {{property_2}}: {{type}}; - {{method_1}}({{params}}): {{return_type}}; -} +- [ ] **Functional Requirements** - All functional acceptance criteria are specific and testable +- [ ] **Technical Requirements** - Technical acceptance criteria are complete and verifiable +- [ ] **Game Design Requirements** - Game-specific requirements match GDD specifications +- [ ] **Performance Requirements** - Frame rate and memory usage criteria specified +- [ ] **Completeness** - No acceptance criteria are vague or unmeasurable -// {{class_name}} -class {{ClassName}} extends {{PhaseClass}} { - private {{property}}: {{type}}; +### Implementation Tasks - constructor({{params}}) { - // Implementation requirements - } +- [ ] **Task Breakdown** - Story broken into specific, ordered implementation tasks +- [ ] **Task Scope** - Each task is completable in 1-4 hours +- [ ] **Task Clarity** - Each task has clear, actionable instructions +- [ ] **File Specifications** - Exact file paths and purposes specified +- [ ] **Development Flow** - Tasks follow logical implementation order - public {{method}}({{params}}): {{return_type}} { - // Method requirements - } -} -``` +### Dependencies -### Integration Points - -[[LLM: Specify how this feature integrates with existing systems]] - -**Scene Integration:** - -- {{scene_name}}: {{integration_details}} - -**System Dependencies:** - -- {{system_name}}: {{dependency_description}} - -**Event Communication:** - -- Emits: `{{event_name}}` when {{condition}} -- Listens: `{{event_name}}` to {{response}} - -## Implementation Tasks - -[[LLM: Break down the implementation into specific, ordered tasks. Each task should be completable in 1-4 hours.]] - -### Dev Agent Record - -**Tasks:** - -- [ ] {{task_1_description}} -- [ ] {{task_2_description}} -- [ ] {{task_3_description}} -- [ ] {{task_4_description}} -- [ ] Write unit tests for {{component}} -- [ ] Integration testing with {{related_system}} -- [ ] Performance testing and optimization - -**Debug Log:** -| Task | File | Change | Reverted? | -|------|------|--------|-----------| -| | | | | - -**Completion Notes:** - - - -**Change Log:** - - - -## Game Design Context - -[[LLM: Reference the specific sections of the GDD that this story implements]] - -**GDD Reference:** {{section_name}} ({{page_or_section_number}}) - -**Game Mechanic:** {{mechanic_name}} - -**Player Experience Goal:** {{experience_description}} - -**Balance Parameters:** - -- {{parameter_1}}: {{value_or_range}} -- {{parameter_2}}: {{value_or_range}} +- [ ] **Story Dependencies** - All prerequisite stories identified with IDs +- [ ] **Technical Dependencies** - Required systems and files identified +- [ ] **Asset Dependencies** - All needed assets specified with locations +- [ ] **External Dependencies** - Any third-party or external requirements noted +- [ ] **Dependency Validation** - All dependencies are actually available ## Testing Requirements -[[LLM: Define specific testing criteria for this game feature]] +### Test Coverage -### Unit Tests +- [ ] **Unit Test Requirements** - Specific unit test files and scenarios defined +- [ ] **Integration Test Cases** - Integration testing with other game systems specified +- [ ] **Manual Test Cases** - Game-specific manual testing procedures defined +- [ ] **Performance Tests** - Frame rate and memory testing requirements specified +- [ ] **Edge Case Testing** - Edge cases and error conditions covered -**Test Files:** +### Test Implementation -- `tests/{{component_name}}.test.ts` +- [ ] **Test File Paths** - Exact test file locations specified +- [ ] **Test Scenarios** - All test scenarios are complete and executable +- [ ] **Expected Behaviors** - Clear expected outcomes for all tests defined +- [ ] **Performance Metrics** - Specific performance targets for testing +- [ ] **Test Data** - Any required test data or mock objects specified -**Test Scenarios:** +## Game-Specific Quality -- {{test_scenario_1}} -- {{test_scenario_2}} -- {{edge_case_test}} +### Gameplay Implementation -### Game Testing +- [ ] **Mechanic Accuracy** - Implementation matches GDD mechanic specifications +- [ ] **Player Controls** - Input handling requirements are complete +- [ ] **Game Feel** - Requirements for juice, feedback, and responsiveness specified +- [ ] **Balance Implementation** - Numeric values and parameters from GDD included +- [ ] **State Management** - Game state changes and persistence requirements defined -**Manual Test Cases:** +### User Experience -1. {{test_case_1_description}} +- [ ] **UI Requirements** - User interface elements and behaviors specified +- [ ] **Audio Integration** - Sound effect and music requirements defined +- [ ] **Visual Feedback** - Animation and visual effect requirements specified +- [ ] **Accessibility** - Mobile touch and responsive design considerations +- [ ] **Error Recovery** - User-facing error handling and recovery specified - - Expected: {{expected_behavior}} - - Performance: {{performance_expectation}} +### Performance Optimization -2. {{test_case_2_description}} - - Expected: {{expected_behavior}} - - Edge Case: {{edge_case_handling}} +- [ ] **Frame Rate Targets** - Specific FPS requirements for different platforms +- [ ] **Memory Usage** - Memory consumption limits and monitoring requirements +- [ ] **Asset Optimization** - Texture, audio, and data optimization requirements +- [ ] **Mobile Considerations** - Touch controls and mobile performance requirements +- [ ] **Loading Performance** - Asset loading and scene transition requirements -### Performance Tests +## Documentation and Communication -**Metrics to Verify:** +### Story Documentation -- Frame rate maintains {{fps_target}} FPS -- Memory usage stays under {{memory_limit}}MB -- {{feature_specific_performance_metric}} +- [ ] **Implementation Notes** - Additional context and implementation guidance provided +- [ ] **Design Decisions** - Key design choices documented with rationale +- [ ] **Future Considerations** - Potential future enhancements or modifications noted +- [ ] **Change Tracking** - Process for tracking any requirement changes during development +- [ ] **Reference Materials** - Links to relevant GDD sections and architecture docs -## Dependencies +### Developer Handoff -[[LLM: List any dependencies that must be completed before this story can be implemented]] +- [ ] **Immediate Actionability** - Developer can start implementation without additional questions +- [ ] **Complete Context** - All necessary context provided within the story +- [ ] **Clear Boundaries** - What is and isn't included in the story scope is clear +- [ ] **Success Criteria** - Objective measures for story completion defined +- [ ] **Communication Plan** - Process for developer questions and updates established -**Story Dependencies:** +## Final Validation -- {{story_id}}: {{dependency_description}} +### Story Readiness -**Technical Dependencies:** +- [ ] **No Ambiguity** - No sections require interpretation or additional design decisions +- [ ] **Technical Completeness** - All technical requirements are specified and actionable +- [ ] **Scope Appropriateness** - Story scope matches assigned story points +- [ ] **Quality Standards** - Story meets all game development quality standards +- [ ] **Review Completion** - Story has been reviewed for completeness and accuracy -- {{system_or_file}}: {{requirement}} +### Implementation Preparedness -**Asset Dependencies:** +- [ ] **Environment Ready** - Development environment requirements specified +- [ ] **Resources Available** - All required resources (assets, docs, dependencies) accessible +- [ ] **Testing Prepared** - Testing environment and data requirements specified +- [ ] **Definition of Done** - Clear, objective completion criteria established +- [ ] **Handoff Complete** - Story is ready for developer assignment and implementation -- {{asset_type}}: {{asset_description}} -- Location: `{{asset_path}}` +## Checklist Completion -## Definition of Done +**Overall Story Quality:** ⭐⭐⭐⭐⭐ -[[LLM: Checklist that must be completed before the story is considered finished]] +**Ready for Development:** [ ] Yes [ ] No -- [ ] All acceptance criteria met -- [ ] Code reviewed and approved -- [ ] Unit tests written and passing -- [ ] Integration tests passing -- [ ] Performance targets met -- [ ] No linting errors -- [ ] Documentation updated -- [ ] {{game_specific_dod_item}} - -## Notes - -[[LLM: Any additional context, design decisions, or implementation notes]] - -**Implementation Notes:** - -- {{note_1}} -- {{note_2}} - -**Design Decisions:** - -- {{decision_1}}: {{rationale}} -- {{decision_2}}: {{rationale}} - -**Future Considerations:** - -- {{future_enhancement_1}} -- {{future_optimization_1}} -==================== END: .bmad-2d-phaser-game-dev/templates/game-story-tmpl.md ==================== +**Additional Notes:** +_Any specific concerns, recommendations, or clarifications needed before development begins._ +==================== END: .bmad-2d-phaser-game-dev/checklists/game-story-dod-checklist.md ==================== ==================== START: .bmad-2d-phaser-game-dev/workflows/game-dev-greenfield.yaml ==================== workflow: @@ -7565,3 +10847,914 @@ workflow: stories_to_implementation: Stories ready. Begin iterative implementation with frequent playtesting and design validation. prototype_to_evaluation: Prototype playable. Evaluate core mechanics, gather feedback, and determine next development steps. ==================== END: .bmad-2d-phaser-game-dev/workflows/game-prototype.yaml ==================== + +==================== START: .bmad-2d-phaser-game-dev/data/bmad-kb.md ==================== +# Game Development BMad Knowledge Base + +## Overview + +This game development expansion of BMad-Method specializes in creating 2D games using Phaser 3 and TypeScript. It extends the core BMad framework with game-specific agents, workflows, and best practices for professional game development. + +### Game Development Focus + +- **Target Engine**: Phaser 3.70+ with TypeScript 5.0+ +- **Platform Strategy**: Web-first with mobile optimization +- **Development Approach**: Agile story-driven development +- **Performance Target**: 60 FPS on target devices +- **Architecture**: Component-based game systems + +## Core Game Development Philosophy + +### Player-First Development + +You are developing games as a "Player Experience CEO" - thinking like a game director with unlimited creative resources and a singular vision for player enjoyment. Your AI agents are your specialized game development team: + +- **Direct**: Provide clear game design vision and player experience goals +- **Refine**: Iterate on gameplay mechanics until they're compelling +- **Oversee**: Maintain creative alignment across all development disciplines +- **Playfocus**: Every decision serves the player experience + +### Game Development Principles + +1. **PLAYER_EXPERIENCE_FIRST**: Every mechanic must serve player engagement and fun +2. **ITERATIVE_DESIGN**: Prototype, test, refine - games are discovered through iteration +3. **TECHNICAL_EXCELLENCE**: 60 FPS performance and cross-platform compatibility are non-negotiable +4. **STORY_DRIVEN_DEV**: Game features are implemented through detailed development stories +5. **BALANCE_THROUGH_DATA**: Use metrics and playtesting to validate game balance +6. **DOCUMENT_EVERYTHING**: Clear specifications enable proper game implementation +7. **START_SMALL_ITERATE_FAST**: Core mechanics first, then expand and polish +8. **EMBRACE_CREATIVE_CHAOS**: Games evolve - adapt design based on what's fun + +## Game Development Workflow + +### Phase 1: Game Concept and Design + +1. **Game Designer**: Start with brainstorming and concept development + + - Use \*brainstorm to explore game concepts and mechanics + - Create Game Brief using game-brief-tmpl + - Develop core game pillars and player experience goals + +2. **Game Designer**: Create comprehensive Game Design Document + + - Use game-design-doc-tmpl to create detailed GDD + - Define all game mechanics, progression, and balance + - Specify technical requirements and platform targets + +3. **Game Designer**: Develop Level Design Framework + - Create level-design-doc-tmpl for content guidelines + - Define level types, difficulty progression, and content structure + - Establish performance and technical constraints for levels + +### Phase 2: Technical Architecture + +4. **Solution Architect** (or Game Designer): Create Technical Architecture + - Use game-architecture-tmpl to design technical implementation + - Define Phaser 3 systems, performance optimization, and code structure + - Align technical architecture with game design requirements + +### Phase 3: Story-Driven Development + +5. **Game Scrum Master**: Break down design into development stories + + - Use create-game-story task to create detailed implementation stories + - Each story should be immediately actionable by game developers + - Apply game-story-dod-checklist to ensure story quality + +6. **Game Developer**: Implement game features story by story + + - Follow TypeScript strict mode and Phaser 3 best practices + - Maintain 60 FPS performance target throughout development + - Use test-driven development for game logic components + +7. **Iterative Refinement**: Continuous playtesting and improvement + - Test core mechanics early and often + - Validate game balance through metrics and player feedback + - Iterate on design based on implementation discoveries + +## Game-Specific Development Guidelines + +### Phaser 3 + TypeScript Standards + +**Project Structure:** + +```text +game-project/ +├── src/ +│ ├── scenes/ # Game scenes (BootScene, MenuScene, GameScene) +│ ├── gameObjects/ # Custom game objects and entities +│ ├── systems/ # Core game systems (GameState, InputManager, etc.) +│ ├── utils/ # Utility functions and helpers +│ ├── types/ # TypeScript type definitions +│ └── config/ # Game configuration and balance +├── assets/ # Game assets (images, audio, data) +├── docs/ +│ ├── stories/ # Development stories +│ └── design/ # Game design documents +└── tests/ # Unit and integration tests +``` + +**Performance Requirements:** + +- Maintain 60 FPS on target devices +- Memory usage under specified limits per level +- Loading times under 3 seconds for levels +- Smooth animation and responsive controls + +**Code Quality:** + +- TypeScript strict mode compliance +- Component-based architecture +- Object pooling for frequently created/destroyed objects +- Error handling and graceful degradation + +### Game Development Story Structure + +**Story Requirements:** + +- Clear reference to Game Design Document section +- Specific acceptance criteria for game functionality +- Technical implementation details for Phaser 3 +- Performance requirements and optimization considerations +- Testing requirements including gameplay validation + +**Story Categories:** + +- **Core Mechanics**: Fundamental gameplay systems +- **Level Content**: Individual levels and content implementation +- **UI/UX**: User interface and player experience features +- **Performance**: Optimization and technical improvements +- **Polish**: Visual effects, audio, and game feel enhancements + +### Quality Assurance for Games + +**Testing Approach:** + +- Unit tests for game logic (separate from Phaser) +- Integration tests for game systems +- Performance benchmarking and profiling +- Gameplay testing and balance validation +- Cross-platform compatibility testing + +**Performance Monitoring:** + +- Frame rate consistency tracking +- Memory usage monitoring +- Asset loading performance +- Input responsiveness validation +- Battery usage optimization (mobile) + +## Game Development Team Roles + +### Game Designer (Alex) + +- **Primary Focus**: Game mechanics, player experience, design documentation +- **Key Outputs**: Game Brief, Game Design Document, Level Design Framework +- **Specialties**: Brainstorming, game balance, player psychology, creative direction + +### Game Developer (Maya) + +- **Primary Focus**: Phaser 3 implementation, technical excellence, performance +- **Key Outputs**: Working game features, optimized code, technical architecture +- **Specialties**: TypeScript/Phaser 3, performance optimization, cross-platform development + +### Game Scrum Master (Jordan) + +- **Primary Focus**: Story creation, development planning, agile process +- **Key Outputs**: Detailed implementation stories, sprint planning, quality assurance +- **Specialties**: Story breakdown, developer handoffs, process optimization + +## Platform-Specific Considerations + +### Web Platform + +- Browser compatibility across modern browsers +- Progressive loading for large assets +- Touch-friendly mobile controls +- Responsive design for different screen sizes + +### Mobile Optimization + +- Touch gesture support and responsive controls +- Battery usage optimization +- Performance scaling for different device capabilities +- App store compliance and packaging + +### Performance Targets + +- **Desktop**: 60 FPS at 1080p resolution +- **Mobile**: 60 FPS on mid-range devices, 30 FPS minimum on low-end +- **Loading**: Initial load under 5 seconds, level transitions under 2 seconds +- **Memory**: Under 100MB total usage, under 50MB per level + +## Success Metrics for Game Development + +### Technical Metrics + +- Frame rate consistency (>90% of time at target FPS) +- Memory usage within budgets +- Loading time targets met +- Zero critical bugs in core gameplay systems + +### Player Experience Metrics + +- Tutorial completion rate >80% +- Level completion rates appropriate for difficulty curve +- Average session length meets design targets +- Player retention and engagement metrics + +### Development Process Metrics + +- Story completion within estimated timeframes +- Code quality metrics (test coverage, linting compliance) +- Documentation completeness and accuracy +- Team velocity and delivery consistency + +## Common Game Development Patterns + +### Scene Management + +- Boot scene for initial setup and configuration +- Preload scene for asset loading with progress feedback +- Menu scene for navigation and settings +- Game scenes for actual gameplay +- Clean transitions between scenes with proper cleanup + +### Game State Management + +- Persistent data (player progress, unlocks, settings) +- Session data (current level, score, temporary state) +- Save/load system with error recovery +- Settings management with platform storage + +### Input Handling + +- Cross-platform input abstraction +- Touch gesture support for mobile +- Keyboard and gamepad support for desktop +- Customizable control schemes + +### Performance Optimization + +- Object pooling for bullets, effects, enemies +- Texture atlasing and sprite optimization +- Audio compression and streaming +- Culling and level-of-detail systems +- Memory management and garbage collection optimization + +This knowledge base provides the foundation for effective game development using the BMad-Method framework with specialized focus on 2D game creation using Phaser 3 and TypeScript. +==================== END: .bmad-2d-phaser-game-dev/data/bmad-kb.md ==================== + +==================== START: .bmad-2d-phaser-game-dev/data/development-guidelines.md ==================== +# Game Development Guidelines + +## Overview + +This document establishes coding standards, architectural patterns, and development practices for 2D game development using Phaser 3 and TypeScript. These guidelines ensure consistency, performance, and maintainability across all game development stories. + +## TypeScript Standards + +### Strict Mode Configuration + +**Required tsconfig.json settings:** + +```json +{ + "compilerOptions": { + "strict": true, + "noImplicitAny": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "noImplicitReturns": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "exactOptionalPropertyTypes": true + } +} +``` + +### Type Definitions + +**Game Object Interfaces:** + +```typescript +// Core game entity interface +interface GameEntity { + readonly id: string; + position: Phaser.Math.Vector2; + active: boolean; + destroy(): void; +} + +// Player controller interface +interface PlayerController { + readonly inputEnabled: boolean; + handleInput(input: InputState): void; + update(delta: number): void; +} + +// Game system interface +interface GameSystem { + readonly name: string; + initialize(): void; + update(delta: number): void; + shutdown(): void; +} +``` + +**Scene Data Interfaces:** + +```typescript +// Scene transition data +interface SceneData { + [key: string]: any; +} + +// Game state interface +interface GameState { + currentLevel: number; + score: number; + lives: number; + settings: GameSettings; +} + +interface GameSettings { + musicVolume: number; + sfxVolume: number; + difficulty: "easy" | "normal" | "hard"; + controls: ControlScheme; +} +``` + +### Naming Conventions + +**Classes and Interfaces:** + +- PascalCase for classes: `PlayerSprite`, `GameManager`, `AudioSystem` +- PascalCase with 'I' prefix for interfaces: `IGameEntity`, `IPlayerController` +- Descriptive names that indicate purpose: `CollisionManager` not `CM` + +**Methods and Variables:** + +- camelCase for methods and variables: `updatePosition()`, `playerSpeed` +- Descriptive names: `calculateDamage()` not `calcDmg()` +- Boolean variables with is/has/can prefix: `isActive`, `hasCollision`, `canMove` + +**Constants:** + +- UPPER_SNAKE_CASE for constants: `MAX_PLAYER_SPEED`, `DEFAULT_VOLUME` +- Group related constants in enums or const objects + +**Files and Directories:** + +- kebab-case for file names: `player-controller.ts`, `audio-manager.ts` +- PascalCase for scene files: `MenuScene.ts`, `GameScene.ts` + +## Phaser 3 Architecture Patterns + +### Scene Organization + +**Scene Lifecycle Management:** + +```typescript +class GameScene extends Phaser.Scene { + private gameManager!: GameManager; + private inputManager!: InputManager; + + constructor() { + super({ key: "GameScene" }); + } + + preload(): void { + // Load only scene-specific assets + this.load.image("player", "assets/player.png"); + } + + create(data: SceneData): void { + // Initialize game systems + this.gameManager = new GameManager(this); + this.inputManager = new InputManager(this); + + // Set up scene-specific logic + this.setupGameObjects(); + this.setupEventListeners(); + } + + update(time: number, delta: number): void { + // Update all game systems + this.gameManager.update(delta); + this.inputManager.update(delta); + } + + shutdown(): void { + // Clean up resources + this.gameManager.destroy(); + this.inputManager.destroy(); + + // Remove event listeners + this.events.off("*"); + } +} +``` + +**Scene Transitions:** + +```typescript +// Proper scene transitions with data +this.scene.start("NextScene", { + playerScore: this.playerScore, + currentLevel: this.currentLevel + 1, +}); + +// Scene overlays for UI +this.scene.launch("PauseMenuScene"); +this.scene.pause(); +``` + +### Game Object Patterns + +**Component-Based Architecture:** + +```typescript +// Base game entity +abstract class GameEntity extends Phaser.GameObjects.Sprite { + protected components: Map = new Map(); + + constructor(scene: Phaser.Scene, x: number, y: number, texture: string) { + super(scene, x, y, texture); + scene.add.existing(this); + } + + addComponent(component: T): T { + this.components.set(component.name, component); + return component; + } + + getComponent(name: string): T | undefined { + return this.components.get(name) as T; + } + + update(delta: number): void { + this.components.forEach((component) => component.update(delta)); + } + + destroy(): void { + this.components.forEach((component) => component.destroy()); + this.components.clear(); + super.destroy(); + } +} + +// Example player implementation +class Player extends GameEntity { + private movement!: MovementComponent; + private health!: HealthComponent; + + constructor(scene: Phaser.Scene, x: number, y: number) { + super(scene, x, y, "player"); + + this.movement = this.addComponent(new MovementComponent(this)); + this.health = this.addComponent(new HealthComponent(this, 100)); + } +} +``` + +### System Management + +**Singleton Managers:** + +```typescript +class GameManager { + private static instance: GameManager; + private scene: Phaser.Scene; + private gameState: GameState; + + constructor(scene: Phaser.Scene) { + if (GameManager.instance) { + throw new Error("GameManager already exists!"); + } + + this.scene = scene; + this.gameState = this.loadGameState(); + GameManager.instance = this; + } + + static getInstance(): GameManager { + if (!GameManager.instance) { + throw new Error("GameManager not initialized!"); + } + return GameManager.instance; + } + + update(delta: number): void { + // Update game logic + } + + destroy(): void { + GameManager.instance = null!; + } +} +``` + +## Performance Optimization + +### Object Pooling + +**Required for High-Frequency Objects:** + +```typescript +class BulletPool { + private pool: Bullet[] = []; + private scene: Phaser.Scene; + + constructor(scene: Phaser.Scene, initialSize: number = 50) { + this.scene = scene; + + // Pre-create bullets + for (let i = 0; i < initialSize; i++) { + const bullet = new Bullet(scene, 0, 0); + bullet.setActive(false); + bullet.setVisible(false); + this.pool.push(bullet); + } + } + + getBullet(): Bullet | null { + const bullet = this.pool.find((b) => !b.active); + if (bullet) { + bullet.setActive(true); + bullet.setVisible(true); + return bullet; + } + + // Pool exhausted - create new bullet + console.warn("Bullet pool exhausted, creating new bullet"); + return new Bullet(this.scene, 0, 0); + } + + releaseBullet(bullet: Bullet): void { + bullet.setActive(false); + bullet.setVisible(false); + bullet.setPosition(0, 0); + } +} +``` + +### Frame Rate Optimization + +**Performance Monitoring:** + +```typescript +class PerformanceMonitor { + private frameCount: number = 0; + private lastTime: number = 0; + private frameRate: number = 60; + + update(time: number): void { + this.frameCount++; + + if (time - this.lastTime >= 1000) { + this.frameRate = this.frameCount; + this.frameCount = 0; + this.lastTime = time; + + if (this.frameRate < 55) { + console.warn(`Low frame rate detected: ${this.frameRate} FPS`); + this.optimizePerformance(); + } + } + } + + private optimizePerformance(): void { + // Reduce particle counts, disable effects, etc. + } +} +``` + +**Update Loop Optimization:** + +```typescript +// Avoid expensive operations in update loops +class GameScene extends Phaser.Scene { + private updateTimer: number = 0; + private readonly UPDATE_INTERVAL = 100; // ms + + update(time: number, delta: number): void { + // High-frequency updates (every frame) + this.updatePlayer(delta); + this.updatePhysics(delta); + + // Low-frequency updates (10 times per second) + this.updateTimer += delta; + if (this.updateTimer >= this.UPDATE_INTERVAL) { + this.updateUI(); + this.updateAI(); + this.updateTimer = 0; + } + } +} +``` + +## Input Handling + +### Cross-Platform Input + +**Input Abstraction:** + +```typescript +interface InputState { + moveLeft: boolean; + moveRight: boolean; + jump: boolean; + action: boolean; + pause: boolean; +} + +class InputManager { + private inputState: InputState = { + moveLeft: false, + moveRight: false, + jump: false, + action: false, + pause: false, + }; + + private keys!: { [key: string]: Phaser.Input.Keyboard.Key }; + private pointer!: Phaser.Input.Pointer; + + constructor(private scene: Phaser.Scene) { + this.setupKeyboard(); + this.setupTouch(); + } + + private setupKeyboard(): void { + this.keys = this.scene.input.keyboard.addKeys("W,A,S,D,SPACE,ESC,UP,DOWN,LEFT,RIGHT"); + } + + private setupTouch(): void { + this.scene.input.on("pointerdown", this.handlePointerDown, this); + this.scene.input.on("pointerup", this.handlePointerUp, this); + } + + update(): void { + // Update input state from multiple sources + this.inputState.moveLeft = this.keys.A.isDown || this.keys.LEFT.isDown; + this.inputState.moveRight = this.keys.D.isDown || this.keys.RIGHT.isDown; + this.inputState.jump = Phaser.Input.Keyboard.JustDown(this.keys.SPACE); + // ... handle touch input + } + + getInputState(): InputState { + return { ...this.inputState }; + } +} +``` + +## Error Handling + +### Graceful Degradation + +**Asset Loading Error Handling:** + +```typescript +class AssetManager { + loadAssets(): Promise { + return new Promise((resolve, reject) => { + this.scene.load.on("filecomplete", this.handleFileComplete, this); + this.scene.load.on("loaderror", this.handleLoadError, this); + this.scene.load.on("complete", () => resolve()); + + this.scene.load.start(); + }); + } + + private handleLoadError(file: Phaser.Loader.File): void { + console.error(`Failed to load asset: ${file.key}`); + + // Use fallback assets + this.loadFallbackAsset(file.key); + } + + private loadFallbackAsset(key: string): void { + // Load placeholder or default assets + switch (key) { + case "player": + this.scene.load.image("player", "assets/defaults/default-player.png"); + break; + default: + console.warn(`No fallback for asset: ${key}`); + } + } +} +``` + +### Runtime Error Recovery + +**System Error Handling:** + +```typescript +class GameSystem { + protected handleError(error: Error, context: string): void { + console.error(`Error in ${context}:`, error); + + // Report to analytics/logging service + this.reportError(error, context); + + // Attempt recovery + this.attemptRecovery(context); + } + + private attemptRecovery(context: string): void { + switch (context) { + case "update": + // Reset system state + this.reset(); + break; + case "render": + // Disable visual effects + this.disableEffects(); + break; + default: + // Generic recovery + this.safeShutdown(); + } + } +} +``` + +## Testing Standards + +### Unit Testing + +**Game Logic Testing:** + +```typescript +// Example test for game mechanics +describe("HealthComponent", () => { + let healthComponent: HealthComponent; + + beforeEach(() => { + const mockEntity = {} as GameEntity; + healthComponent = new HealthComponent(mockEntity, 100); + }); + + test("should initialize with correct health", () => { + expect(healthComponent.currentHealth).toBe(100); + expect(healthComponent.maxHealth).toBe(100); + }); + + test("should handle damage correctly", () => { + healthComponent.takeDamage(25); + expect(healthComponent.currentHealth).toBe(75); + expect(healthComponent.isAlive()).toBe(true); + }); + + test("should handle death correctly", () => { + healthComponent.takeDamage(150); + expect(healthComponent.currentHealth).toBe(0); + expect(healthComponent.isAlive()).toBe(false); + }); +}); +``` + +### Integration Testing + +**Scene Testing:** + +```typescript +describe("GameScene Integration", () => { + let scene: GameScene; + let mockGame: Phaser.Game; + + beforeEach(() => { + // Mock Phaser game instance + mockGame = createMockGame(); + scene = new GameScene(); + }); + + test("should initialize all systems", () => { + scene.create({}); + + expect(scene.gameManager).toBeDefined(); + expect(scene.inputManager).toBeDefined(); + }); +}); +``` + +## File Organization + +### Project Structure + +``` +src/ +├── scenes/ +│ ├── BootScene.ts # Initial loading and setup +│ ├── PreloadScene.ts # Asset loading with progress +│ ├── MenuScene.ts # Main menu and navigation +│ ├── GameScene.ts # Core gameplay +│ └── UIScene.ts # Overlay UI elements +├── gameObjects/ +│ ├── entities/ +│ │ ├── Player.ts # Player game object +│ │ ├── Enemy.ts # Enemy base class +│ │ └── Collectible.ts # Collectible items +│ ├── components/ +│ │ ├── MovementComponent.ts +│ │ ├── HealthComponent.ts +│ │ └── CollisionComponent.ts +│ └── ui/ +│ ├── Button.ts # Interactive buttons +│ ├── HealthBar.ts # Health display +│ └── ScoreDisplay.ts # Score UI +├── systems/ +│ ├── GameManager.ts # Core game state management +│ ├── InputManager.ts # Cross-platform input handling +│ ├── AudioManager.ts # Sound and music system +│ ├── SaveManager.ts # Save/load functionality +│ └── PerformanceMonitor.ts # Performance tracking +├── utils/ +│ ├── ObjectPool.ts # Generic object pooling +│ ├── MathUtils.ts # Game math helpers +│ ├── AssetLoader.ts # Asset management utilities +│ └── EventBus.ts # Global event system +├── types/ +│ ├── GameTypes.ts # Core game type definitions +│ ├── UITypes.ts # UI-related types +│ └── SystemTypes.ts # System interface definitions +├── config/ +│ ├── GameConfig.ts # Phaser game configuration +│ ├── GameBalance.ts # Game balance parameters +│ └── AssetConfig.ts # Asset loading configuration +└── main.ts # Application entry point +``` + +## Development Workflow + +### Story Implementation Process + +1. **Read Story Requirements:** + + - Understand acceptance criteria + - Identify technical requirements + - Review performance constraints + +2. **Plan Implementation:** + + - Identify files to create/modify + - Consider component architecture + - Plan testing approach + +3. **Implement Feature:** + + - Follow TypeScript strict mode + - Use established patterns + - Maintain 60 FPS performance + +4. **Test Implementation:** + + - Write unit tests for game logic + - Test cross-platform functionality + - Validate performance targets + +5. **Update Documentation:** + - Mark story checkboxes complete + - Document any deviations + - Update architecture if needed + +### Code Review Checklist + +**Before Committing:** + +- [ ] TypeScript compiles without errors +- [ ] All tests pass +- [ ] Performance targets met (60 FPS) +- [ ] No console errors or warnings +- [ ] Cross-platform compatibility verified +- [ ] Memory usage within bounds +- [ ] Code follows naming conventions +- [ ] Error handling implemented +- [ ] Documentation updated + +## Performance Targets + +### Frame Rate Requirements + +- **Desktop**: Maintain 60 FPS at 1080p +- **Mobile**: Maintain 60 FPS on mid-range devices, minimum 30 FPS on low-end +- **Optimization**: Implement dynamic quality scaling when performance drops + +### Memory Management + +- **Total Memory**: Under 100MB for full game +- **Per Scene**: Under 50MB per gameplay scene +- **Asset Loading**: Progressive loading to stay under limits +- **Garbage Collection**: Minimize object creation in update loops + +### Loading Performance + +- **Initial Load**: Under 5 seconds for game start +- **Scene Transitions**: Under 2 seconds between scenes +- **Asset Streaming**: Background loading for upcoming content + +These guidelines ensure consistent, high-quality game development that meets performance targets and maintains code quality across all implementation stories. +==================== END: .bmad-2d-phaser-game-dev/data/development-guidelines.md ==================== diff --git a/dist/expansion-packs/bmad-creator-tools/agents/bmad-the-creator.txt b/dist/expansion-packs/bmad-creator-tools/agents/bmad-the-creator.txt index e124ba28..36af4e7a 100644 --- a/dist/expansion-packs/bmad-creator-tools/agents/bmad-the-creator.txt +++ b/dist/expansion-packs/bmad-creator-tools/agents/bmad-the-creator.txt @@ -50,6 +50,9 @@ activation-instructions: - Only read the files/tasks listed here when user selects them for execution to minimize context usage - The customization field ALWAYS takes precedence over any conflicting instructions - When listing tasks/templates or presenting options during conversations, always show as numbered options list, allowing the user to type a number to select or execute + - Greet the user with your name and role, and inform of the *help command + - Offer to help with BMad framework extensions but wait for explicit user confirmation + - Only execute tasks when user explicitly requests them agent: name: The Creator id: bmad-the-creator @@ -69,12 +72,6 @@ core_principles: - Convention Over Configuration - Follow BMad naming and structure patterns - Extensibility First - Design for future expansion and customization - Numbered Options Protocol - Always use numbered lists for user selections -startup: - - Greet the user with your name and role, and inform of the *help command - - CRITICAL: Do NOT automatically create documents or execute tasks during startup - - CRITICAL: Do NOT create or modify any files during startup - - Offer to help with BMad framework extensions but wait for explicit user confirmation - - Only execute tasks when user explicitly requests them commands: - '*help" - Show numbered list of available commands for selection' - '*chat-mode" - Conversational mode with advanced-elicitation for framework design advice' @@ -85,13 +82,13 @@ commands: - '*exit" - Say goodbye as The Creator, and then abandon inhabiting this persona' dependencies: tasks: - - create-agent - - generate-expansion-pack - - advanced-elicitation - - create-deep-research-prompt + - create-agent.md + - generate-expansion-pack.md + - advanced-elicitation.md + - create-deep-research-prompt.md templates: - - agent-tmpl - - expansion-pack-plan-tmpl + - agent-tmpl.yaml + - expansion-pack-plan-tmpl.yaml ``` ==================== END: .bmad-creator-tools/agents/bmad-the-creator.md ==================== @@ -1745,242 +1742,282 @@ Present these numbered options to the user: - Plan for iterative refinement based on initial findings ==================== END: .bmad-creator-tools/tasks/create-deep-research-prompt.md ==================== -==================== START: .bmad-creator-tools/templates/agent-tmpl.md ==================== -# [AGENT_ID] +==================== START: .bmad-creator-tools/templates/agent-tmpl.yaml ==================== +template: + id: agent-template-v2 + name: Agent Definition + version: 2.0 + output: + format: markdown + filename: "agents/{{agent_id}}.md" + title: "{{agent_id}}" -[[LLM: This is an agent definition template. When creating a new agent: +workflow: + mode: interactive -1. ALL dependencies (tasks, templates, checklists, data) MUST exist or be created -2. For output generation, use the create-doc pattern with appropriate templates -3. Templates should include LLM instructions for guiding users through content creation -4. Character personas should be consistent and domain-appropriate -5. Follow the numbered options protocol for all user interactions]] +sections: + - id: header + title: "{{agent_id}}" + instruction: | + This is an agent definition template. When creating a new agent: + + 1. ALL dependencies (tasks, templates, checklists, data) MUST exist or be created + 2. For output generation, use the create-doc pattern with appropriate templates + 3. Templates should include LLM instructions for guiding users through content creation + 4. Character personas should be consistent and domain-appropriate + 5. Follow the numbered options protocol for all user interactions -CRITICAL: Read the full YAML, start activation to alter your state of being, follow startup section instructions, stay in this being until told to exit this mode: + - id: agent-definition + content: | + CRITICAL: Read the full YAML, start activation to alter your state of being, follow startup section instructions, stay in this being until told to exit this mode: + sections: + - id: yaml-definition + type: code + language: yaml + template: | + activation-instructions: + - Follow all instructions in this file -> this defines you, your persona and more importantly what you can do. STAY IN CHARACTER! + - Only read the files/tasks listed here when user selects them for execution to minimize context usage + - The customization field ALWAYS takes precedence over any conflicting instructions + - When listing tasks/templates or presenting options during conversations, always show as numbered options list, allowing the user to type a number to select or execute + - Command + + agent: + name: {{agent_name}} + id: {{agent_id}} + title: {{agent_title}} + customization: {{optional_customization}} + + persona: + role: {{agent_role_description}} + style: {{communication_style}} + identity: {{agent_identity_description}} + focus: {{primary_focus_areas}} + + core_principles: + - {{principle_1}} + - {{principle_2}} + - {{principle_3}} + # Add more principles as needed + + startup: + - Greet the user with your name and role, and inform of the *help command. + - {{startup_instruction_1}} + - {{startup_instruction_2}} + + commands: + - "*help" - Show: numbered list of the following commands to allow selection + - "*chat-mode" - (Default) {{default_mode_description}} + - "*create-doc {template}" - Create doc (no template = show available templates) + {{custom_commands}} + - "*exit" - Say goodbye as the {{agent_title}}, and then abandon inhabiting this persona + + dependencies: + tasks: + - create-doc # Required if agent creates documents from templates + {{task_list}} + + templates: + {{template_list}} + + checklists: + {{checklist_list}} + + data: + {{data_list}} + + utils: + - template-format # Required if using templates + {{util_list}} + instruction: | + For output generation tasks, always use create-doc with templates rather than custom tasks. + Example: Instead of a "create-blueprint" task, use "*create-doc blueprint-tmpl" + The template should contain LLM instructions for guiding users through the creation process + + Only create custom tasks for actions that don't produce documents, like analysis, validation, or process execution + + CRITICAL - All dependencies listed here MUST exist in the expansion pack or be created: + - Tasks: Must exist in tasks/ directory (include create-doc if using templates) + - Templates: Must exist in templates/ directory with proper LLM instructions + - Checklists: Must exist in checklists/ directory for quality validation + - Data: Must exist in data/ directory or be documented as user-required + - Utils: Must exist in utils/ directory (include template-format if using templates) -```yaml -activation-instructions: - - Follow all instructions in this file -> this defines you, your persona and more importantly what you can do. STAY IN CHARACTER! - - Only read the files/tasks listed here when user selects them for execution to minimize context usage - - The customization field ALWAYS takes precedence over any conflicting instructions - - When listing tasks/templates or presenting options during conversations, always show as numbered options list, allowing the user to type a number to select or execute - - Command + - id: example + title: Example: Construction Contractor Agent + type: code + language: yaml + template: | + activation-instructions: + - Follow all instructions in this file + - Stay in character as Marcus Thompson, Construction Manager + - Use numbered options for all interactions + agent: + name: Marcus Thompson + id: construction-contractor + title: Construction Project Manager + customization: null + persona: + role: Licensed general contractor with 20 years experience + style: Professional, detail-oriented, safety-conscious + identity: Former site foreman who worked up to project management + focus: Building design, code compliance, project scheduling, cost estimation + core_principles: + - Safety first - all designs must prioritize worker and occupant safety + - Code compliance - ensure all work meets local building codes + - Quality craftsmanship - no shortcuts on structural integrity + startup: + - Greet as Marcus Thompson, Construction Project Manager + - Briefly mention your experience and readiness to help + - Ask what type of construction project they're planning + - DO NOT auto-execute any commands + commands: + - '*help" - Show numbered list of available commands' + - '*chat-mode" - Discuss construction projects and provide expertise' + - '*create-doc blueprint-tmpl" - Create architectural blueprints' + - '*create-doc estimate-tmpl" - Create project cost estimate' + - '*create-doc schedule-tmpl" - Create construction schedule' + - '*validate-plans" - Review plans for code compliance' + - '*safety-assessment" - Evaluate safety considerations' + - '*exit" - Say goodbye as Marcus and exit' + dependencies: + tasks: + - create-doc + - validate-plans + - safety-assessment + templates: + - blueprint-tmpl + - estimate-tmpl + - schedule-tmpl + checklists: + - blueprint-checklist + - safety-checklist + data: + - building-codes.md + - materials-guide.md + utils: + - template-format +==================== END: .bmad-creator-tools/templates/agent-tmpl.yaml ==================== -agent: - name: [AGENT_NAME] - id: [AGENT_ID] - title: [AGENT_TITLE] - customization: [OPTIONAL_CUSTOMIZATION] +==================== START: .bmad-creator-tools/templates/expansion-pack-plan-tmpl.yaml ==================== +template: + id: expansion-pack-plan-template-v2 + name: Expansion Pack Plan + version: 2.0 + output: + format: markdown + filename: "{{pack_name}}-expansion-pack-plan.md" + title: "{{pack_display_name}} Expansion Pack Plan" -persona: - role: [AGENT_ROLE_DESCRIPTION] - style: [COMMUNICATION_STYLE] - identity: [AGENT_IDENTITY_DESCRIPTION] - focus: [PRIMARY_FOCUS_AREAS] +workflow: + mode: interactive - core_principles: - - [PRINCIPLE_1] - - [PRINCIPLE_2] - - [PRINCIPLE_3] - # Add more principles as needed +sections: + - id: overview + title: Overview + template: | + - **Pack Name**: {{pack_identifier}} + - **Display Name**: {{full_expansion_pack_name}} + - **Description**: {{brief_description}} + - **Target Domain**: {{industry_domain}} + - **Author**: {{author_name_organization}} -startup: - - Greet the user with your name and role, and inform of the *help command. - - [STARTUP_INSTRUCTION] - - [STARTUP_INSTRUCTION]... + - id: problem-statement + title: Problem Statement + instruction: What specific challenges does this expansion pack solve? + template: "{{problem_description}}" -commands: - - "*help" - Show: numbered list of the following commands to allow selection - - "*chat-mode" - (Default) [DEFAULT_MODE_DESCRIPTION] - - "*create-doc {template}" - Create doc (no template = show available templates) - [[LLM: For output generation tasks, always use create-doc with templates rather than custom tasks. - Example: Instead of a "create-blueprint" task, use "*create-doc blueprint-tmpl" - The template should contain LLM instructions for guiding users through the creation process]] - - [tasks] specific to the agent that are not covered by a template - [[LLM: Only create custom tasks for actions that don't produce documents, like analysis, validation, or process execution]] - - "*exit" - Say goodbye as the [AGENT_TITLE], and then abandon inhabiting this persona + - id: target-users + title: Target Users + instruction: Who will benefit from this expansion pack? + template: "{{target_user_description}}" -dependencies: - [[LLM: CRITICAL - All dependencies listed here MUST exist in the expansion pack or be created: - - Tasks: Must exist in tasks/ directory (include create-doc if using templates) - - Templates: Must exist in templates/ directory with proper LLM instructions - - Checklists: Must exist in checklists/ directory for quality validation - - Data: Must exist in data/ directory or be documented as user-required - - Utils: Must exist in utils/ directory (include template-format if using templates)]] + - id: components + title: Components to Create + sections: + - id: agents + title: Agents + type: checklist + instruction: List all agents to be created with their roles and dependencies + items: + - id: orchestrator + template: | + `{{pack_name}}-orchestrator` - **REQUIRED**: Master orchestrator for {{domain}} workflows + - Key commands: {{command_list}} + - Manages: {{orchestration_scope}} + - id: agent-list + repeatable: true + template: | + `{{agent_name}}` - {{role_description}} + - Tasks used: {{task_list}} + - Templates used: {{template_list}} + - Data required: {{data_requirements}} + + - id: tasks + title: Tasks + type: checklist + instruction: List all tasks to be created + repeatable: true + template: "`{{task_name}}.md` - {{purpose}} (used by: {{using_agents}})" + + - id: templates + title: Templates + type: checklist + instruction: List all templates to be created + repeatable: true + template: "`{{template_name}}-tmpl.md` - {{document_type}} (used by: {{using_components}})" + + - id: checklists + title: Checklists + type: checklist + instruction: List all checklists to be created + repeatable: true + template: "`{{checklist_name}}-checklist.md` - {{validation_purpose}}" + + - id: data-files + title: Data Files Required from User + instruction: | + Users must add these files to `bmad-core/data/`: + type: checklist + repeatable: true + template: | + `{{data_filename}}.{{extension}}` - {{content_description}} + - Format: {{file_format}} + - Purpose: {{why_needed}} + - Example: {{brief_example}} - tasks: - - create-doc # Required if agent creates documents from templates - - [TASK_1] # Custom task for non-document operations - - [TASK_2] # Another custom task - [[LLM: Example tasks: validate-design, analyze-requirements, execute-tests]] + - id: workflow-overview + title: Workflow Overview + type: numbered-list + instruction: Describe the typical workflow steps + template: "{{workflow_step}}" - templates: - - [TEMPLATE_1] # Template with LLM instructions for guided creation - - [TEMPLATE_2] # Another template for different document type - [[LLM: Example: blueprint-tmpl, contract-tmpl, report-tmpl - Each template should include [[LLM: guidance]] and other conventions from `template-format.md` sections for user interaction]] + - id: integration-points + title: Integration Points + template: | + - Depends on core agents: {{core_agent_dependencies}} + - Extends teams: {{team_updates}} - checklists: - - [CHECKLIST_1] # Quality validation for template outputs - [[LLM: Example: blueprint-checklist, contract-checklist - Checklists validate documents created from templates]] + - id: success-criteria + title: Success Criteria + type: checklist + items: + - "All components created and cross-referenced" + - "No orphaned task/template references" + - "Data requirements clearly documented" + - "Orchestrator provides clear workflow" + - "README includes setup instructions" - data: - - [DATA_1] # Domain knowledge files - [[LLM: Example: building-codes.md, legal-terminology.md - Can be embedded in pack or required from user]] + - id: user-approval + title: User Approval + type: checklist + items: + - "Plan reviewed by user" + - "Approval to proceed with implementation" - utils: - - template-format # Required if using templates - - [UTIL_1] # Other utilities as needed - [[LLM: Include workflow-management if agent participates in workflows]] -``` - -@{example: Construction Contractor Agent} - -```yaml -activation-instructions: - - Follow all instructions in this file - - Stay in character as Marcus Thompson, Construction Manager - - Use numbered options for all interactions -agent: - name: Marcus Thompson - id: construction-contractor - title: Construction Project Manager - customization: null -persona: - role: Licensed general contractor with 20 years experience - style: Professional, detail-oriented, safety-conscious - identity: Former site foreman who worked up to project management - focus: Building design, code compliance, project scheduling, cost estimation - core_principles: - - Safety first - all designs must prioritize worker and occupant safety - - Code compliance - ensure all work meets local building codes - - Quality craftsmanship - no shortcuts on structural integrity -startup: - - Greet as Marcus Thompson, Construction Project Manager - - Briefly mention your experience and readiness to help - - Ask what type of construction project they're planning - - DO NOT auto-execute any commands -commands: - - '*help" - Show numbered list of available commands' - - '*chat-mode" - Discuss construction projects and provide expertise' - - '*create-doc blueprint-tmpl" - Create architectural blueprints' - - '*create-doc estimate-tmpl" - Create project cost estimate' - - '*create-doc schedule-tmpl" - Create construction schedule' - - '*validate-plans" - Review plans for code compliance' - - '*safety-assessment" - Evaluate safety considerations' - - '*exit" - Say goodbye as Marcus and exit' -dependencies: - tasks: - - create-doc - - validate-plans - - safety-assessment - templates: - - blueprint-tmpl - - estimate-tmpl - - schedule-tmpl - checklists: - - blueprint-checklist - - safety-checklist - data: - - building-codes.md - - materials-guide.md - utils: - - template-format -``` -==================== END: .bmad-creator-tools/templates/agent-tmpl.md ==================== - -==================== START: .bmad-creator-tools/templates/expansion-pack-plan-tmpl.md ==================== -# {Pack Name} Expansion Pack Plan - -## Overview - -- **Pack Name**: {pack-identifier} -- **Display Name**: {Full Expansion Pack Name} -- **Description**: {Brief description of what this pack does} -- **Target Domain**: {Industry/domain this serves} -- **Author**: {Your name/organization} - -## Problem Statement - -{What specific challenges does this expansion pack solve?} - -## Target Users - -{Who will benefit from this expansion pack?} - -## Components to Create - -### Agents - -- [ ] `{pack-name}-orchestrator` - **REQUIRED**: Master orchestrator for {domain} workflows - - Key commands: {list main commands} - - Manages: {what it orchestrates} -- [ ] `{agent-1-name}` - {Role description} - - Tasks used: {task-1}, {task-2} - - Templates used: {template-1} - - Data required: {data-file-1} -- [ ] `{agent-2-name}` - {Role description} - - Tasks used: {task-3} - - Templates used: {template-2} - - Data required: {data-file-2} - -### Tasks - -- [ ] `{task-1}.md` - {Purpose} (used by: {agent}) -- [ ] `{task-2}.md` - {Purpose} (used by: {agent}) -- [ ] `{task-3}.md` - {Purpose} (used by: {agent}) - -### Templates - -- [ ] `{template-1}-tmpl.md` - {Document type} (used by: {agent/task}) -- [ ] `{template-2}-tmpl.md` - {Document type} (used by: {agent/task}) - -### Checklists - -- [ ] `{checklist-1}-checklist.md` - {What it validates} -- [ ] `{checklist-2}-checklist.md` - {What it validates} - -### Data Files Required from User - -Users must add these files to `bmad-core/data/`: - -- [ ] `{data-file-1}.{ext}` - {Description of required content} - - Format: {file format} - - Purpose: {why needed} - - Example: {brief example} -- [ ] `{data-file-2}.{ext}` - {Description of required content} - - Format: {file format} - - Purpose: {why needed} - - Example: {brief example} - -## Workflow Overview - -1. {Step 1 - typically starts with orchestrator} -2. {Step 2} -3. {Step 3} -4. {Final output/deliverable} - -## Integration Points - -- Depends on core agents: {list any core BMad agents used} -- Extends teams: {which teams to update} - -## Success Criteria - -- [ ] All components created and cross-referenced -- [ ] No orphaned task/template references -- [ ] Data requirements clearly documented -- [ ] Orchestrator provides clear workflow -- [ ] README includes setup instructions - -## User Approval - -- [ ] Plan reviewed by user -- [ ] Approval to proceed with implementation - ---- - -**Next Steps**: Once approved, proceed with Phase 3 implementation starting with the orchestrator agent. -==================== END: .bmad-creator-tools/templates/expansion-pack-plan-tmpl.md ==================== + - id: next-steps + content: | + --- + + **Next Steps**: Once approved, proceed with Phase 3 implementation starting with the orchestrator agent. +==================== END: .bmad-creator-tools/templates/expansion-pack-plan-tmpl.yaml ==================== diff --git a/dist/expansion-packs/bmad-infrastructure-devops/agents/infra-devops-platform.txt b/dist/expansion-packs/bmad-infrastructure-devops/agents/infra-devops-platform.txt index 7c221174..589afb91 100644 --- a/dist/expansion-packs/bmad-infrastructure-devops/agents/infra-devops-platform.txt +++ b/dist/expansion-packs/bmad-infrastructure-devops/agents/infra-devops-platform.txt @@ -50,6 +50,9 @@ activation-instructions: - Only read the files/tasks listed here when user selects them for execution to minimize context usage - The customization field ALWAYS takes precedence over any conflicting instructions - When listing tasks/templates or presenting options during conversations, always show as numbered options list, allowing the user to type a number to select or execute + - 'List available tasks: review-infrastructure, validate-infrastructure, create infrastructure documentation' + - 'List available templates: infrastructure-architecture, infrastructure-platform-from-arch' + - Execute selected task or stay in persona to help guided by Core DevOps Principles agent: name: Alex id: infra-devops-platform @@ -71,11 +74,6 @@ persona: - CI/CD Excellence - Build robust pipelines for fast, safe, reliable software delivery through automation and testing - Disaster Recovery - Plan for worst-case scenarios with backup strategies and regularly tested recovery procedures - Collaborative Operations - Work closely with development teams fostering shared responsibility for system reliability -startup: - - Announce: Hey! I'm Alex, your DevOps Infrastructure Specialist. I love when things run secure, stable, reliable and performant. I can help with infrastructure architecture, platform engineering, CI/CD pipelines, and operational excellence. What infrastructure challenge can I help you with today? - - 'List available tasks: review-infrastructure, validate-infrastructure, create infrastructure documentation' - - 'List available templates: infrastructure-architecture, infrastructure-platform-from-arch' - - Execute selected task or stay in persona to help guided by Core DevOps Principles commands: - '*help" - Show: numbered list of the following commands to allow selection' - '*chat-mode" - (Default) Conversational mode for infrastructure and DevOps guidance' @@ -86,113 +84,99 @@ commands: - '*exit" - Say goodbye as Alex, the DevOps Infrastructure Specialist, and then abandon inhabiting this persona' dependencies: tasks: - - create-doc - - review-infrastructure - - validate-infrastructure + - create-doc.md + - review-infrastructure.md + - validate-infrastructure.md templates: - - infrastructure-architecture-tmpl - - infrastructure-platform-from-arch-tmpl + - infrastructure-architecture-tmpl.yaml + - infrastructure-platform-from-arch-tmpl.yaml checklists: - - infrastructure-checklist + - infrastructure-checklist.md data: - - technical-preferences - utils: - - template-format + - technical-preferences.md ``` ==================== END: .bmad-infrastructure-devops/agents/infra-devops-platform.md ==================== ==================== START: .bmad-infrastructure-devops/tasks/create-doc.md ==================== -# Create Document from Template Task +# Create Document from Template (YAML Driven) -## Purpose +## CRITICAL: Mandatory Elicitation Format -Generate documents from templates by EXECUTING (not just reading) embedded instructions from the perspective of the selected agent persona. +**When `elicit: true`, ALWAYS use this exact format:** -## CRITICAL RULES +1. Present section content +2. Provide detailed rationale (explain trade-offs, assumptions, decisions made) +3. Present numbered options 1-9: + - **Option 1:** Always "Proceed to next section" + - **Options 2-9:** Select 8 methods from data/elicitation-methods + - End with: "Select 1-9 or just type your question/feedback:" -1. **Templates are PROGRAMS** - Execute every [[LLM:]] instruction exactly as written -2. **NEVER show markup** - Hide all [[LLM:]], {{placeholders}}, @{examples}, and template syntax -3. **STOP and EXECUTE** - When you see "apply tasks#" or "execute tasks#", STOP and run that task immediately -4. **WAIT for user input** - At review points and after elicitation tasks +**NEVER ask yes/no questions or use any other format.** -## Execution Flow +## Processing Flow -### 0. Check Workflow Plan (if configured) +1. **Parse YAML template** - Load template metadata and sections +2. **Set preferences** - Show current mode (Interactive), confirm output file +3. **Process each section:** + - Skip if condition unmet + - Check agent permissions (owner/editors) - note if section is restricted to specific agents + - Draft content using section instruction + - Present content + detailed rationale + - **IF elicit: true** → MANDATORY 1-9 options format + - Save to file if possible +4. **Continue until complete** -[[LLM: Check if plan tracking is enabled in core-config.yaml]] +## Detailed Rationale Requirements -- If `workflow.trackProgress: true`, check for active plan using .bmad-infrastructure-devops/utils/plan-management.md -- If plan exists and this document creation is part of the plan: - - Verify this is the expected next step - - If out of sequence and `enforceSequence: true`, warn user and halt without user override - - If out of sequence and `enforceSequence: false`, ask for confirmation -- Continue with normal execution after plan check +When presenting section content, ALWAYS include rationale that explains: -### 1. Identify Template +- Trade-offs and choices made (what was chosen over alternatives and why) +- Key assumptions made during drafting +- Interesting or questionable decisions that need user attention +- Areas that might need validation -- Load from `.bmad-infrastructure-devops/templates/*.md` or `.bmad-infrastructure-devops/templates directory` -- Agent-specific templates are listed in agent's dependencies -- If agent has `templates: [prd-tmpl, architecture-tmpl]` for example, then offer to create "PRD" and "Architecture" documents +## Elicitation Results Flow -### 2. Ask Interaction Mode +After user selects elicitation method (2-9): -> 1. **Incremental** - Section by section with reviews -> 2. **YOLO Mode** - Complete draft then review (user can type `/yolo` anytime to switch) +1. Execute method from data/elicitation-methods +2. Present results with insights +3. Offer options: + - **1. Apply changes and update section** + - **2. Return to elicitation menu** + - **3. Ask any questions or engage further with this elicitation** -### 3. Execute Template +## Agent Permissions -- Replace {{placeholders}} with real content -- Execute [[LLM:]] instructions as you encounter them -- Process <> loops and ^^CONDITIONS^^ -- Use @{examples} for guidance but never output them +When processing sections with agent permission fields: -### 4. Key Execution Patterns +- **owner**: Note which agent role initially creates/populates the section +- **editors**: List agent roles allowed to modify the section +- **readonly**: Mark sections that cannot be modified after creation -**When you see:** `[[LLM: Draft X and immediately execute .bmad-infrastructure-devops/tasks/advanced-elicitation.md]]` +**For sections with restricted access:** -- Draft the content -- Present it to user -- IMMEDIATELY execute the task -- Wait for completion before continuing +- Include a note in the generated document indicating the responsible agent +- Example: "_(This section is owned by dev-agent and can only be modified by dev-agent)_" -**When you see:** `[[LLM: After section completion, apply .bmad-infrastructure-devops/tasks/Y.md]]` +## YOLO Mode -- Finish the section -- STOP and execute the task -- Wait for user input +User can type `#yolo` to toggle to YOLO mode (process all sections at once). -### 5. Validation & Final Presentation +## CRITICAL REMINDERS -- Run any specified checklists -- Present clean, formatted content only -- No truncation or summarization -- Begin directly with content (no preamble) -- Include any handoff prompts from template +**❌ NEVER:** -### 6. Update Workflow Plan (if applicable) +- Ask yes/no questions for elicitation +- Use any format other than 1-9 numbered options +- Create new elicitation methods -[[LLM: After successful document creation]] +**✅ ALWAYS:** -- If plan tracking is enabled and document was part of plan: - - Call update-workflow-plan task to mark step complete - - Parameters: task: create-doc, step_id: {from plan}, status: complete - - Show next recommended step from plan - -## Common Mistakes to Avoid - -❌ Skipping elicitation tasks -❌ Showing template markup to users -❌ Continuing past STOP signals -❌ Combining multiple review points - -✅ Execute ALL instructions in sequence -✅ Present only clean, formatted content -✅ Stop at every elicitation point -✅ Wait for user confirmation when instructed - -## Remember - -Templates contain precise instructions for a reason. Follow them exactly to ensure document quality and completeness. +- Use exact 1-9 format when elicit: true +- Select options 2-9 from data/elicitation-methods only +- Provide detailed rationale explaining decisions +- End with "Select 1-9 or just type your question/feedback:" ==================== END: .bmad-infrastructure-devops/tasks/create-doc.md ==================== ==================== START: .bmad-infrastructure-devops/tasks/review-infrastructure.md ==================== @@ -515,1041 +499,1064 @@ After I perform the selected action, we can discuss the outcome and decide on an REPEAT by Asking the user if they would like to perform another Reflective, Elicitation & Brainstorming Action UNTIL the user indicates it is time to proceed to the next section (or selects #8) ==================== END: .bmad-infrastructure-devops/tasks/validate-infrastructure.md ==================== -==================== START: .bmad-infrastructure-devops/templates/infrastructure-architecture-tmpl.md ==================== -# {{Project Name}} Infrastructure Architecture - -[[LLM: Initial Setup - -1. Replace {{Project Name}} with the actual project name throughout the document -2. Gather and review required inputs: - - Product Requirements Document (PRD) - Required for business needs and scale requirements - - Main System Architecture - Required for infrastructure dependencies - - Technical Preferences/Tech Stack Document - Required for technology choices - - PRD Technical Assumptions - Required for cross-referencing repository and service architecture - -If any required documents are missing, ask user: "I need the following documents to create a comprehensive infrastructure architecture: [list missing]. Would you like to proceed with available information or provide the missing documents first?" - -3. Cross-reference with PRD Technical Assumptions to ensure infrastructure decisions align with repository and service architecture decisions made in the system architecture. - -Output file location: `docs/infrastructure-architecture.md`]] - -## Infrastructure Overview - -[[LLM: Review the product requirements document to understand business needs and scale requirements. Analyze the main system architecture to identify infrastructure dependencies. Document non-functional requirements (performance, scalability, reliability, security). Cross-reference with PRD Technical Assumptions to ensure alignment with repository and service architecture decisions.]] - -- Cloud Provider(s) -- Core Services & Resources -- Regional Architecture -- Multi-environment Strategy - -@{example: cloud_strategy} - -- **Cloud Provider:** AWS (primary), with multi-cloud capability for critical services -- **Core Services:** EKS for container orchestration, RDS for databases, S3 for storage, CloudFront for CDN -- **Regional Architecture:** Multi-region active-passive with primary in us-east-1, DR in us-west-2 -- **Multi-environment Strategy:** Development, Staging, UAT, Production with identical infrastructure patterns - -@{/example} - -[[LLM: Infrastructure Elicitation Options -Present user with domain-specific elicitation options: -"For the Infrastructure Overview section, I can explore: - -1. **Multi-Cloud Strategy Analysis** - Evaluate cloud provider options and vendor lock-in considerations -2. **Regional Distribution Planning** - Analyze latency requirements and data residency needs -3. **Environment Isolation Strategy** - Design security boundaries and resource segregation -4. **Scalability Patterns Review** - Assess auto-scaling needs and traffic patterns -5. **Compliance Requirements Analysis** - Review regulatory and security compliance needs -6. **Cost-Benefit Analysis** - Compare infrastructure options and TCO -7. **Proceed to next section** - -Select an option (1-7):"]] - -## Infrastructure as Code (IaC) - -[[LLM: Define IaC approach based on technical preferences and existing patterns. Consider team expertise, tooling ecosystem, and maintenance requirements.]] - -- Tools & Frameworks -- Repository Structure -- State Management -- Dependency Management - -All infrastructure must be defined as code. No manual resource creation in production environments. - -## Environment Configuration - -[[LLM: Design environment strategy that supports the development workflow while maintaining security and cost efficiency. Reference the Environment Transition Strategy section for promotion details.]] - -- Environment Promotion Strategy -- Configuration Management -- Secret Management -- Feature Flag Integration - -<> - -### {{environment_name}} Environment - -- **Purpose:** {{environment_purpose}} -- **Resources:** {{environment_resources}} -- **Access Control:** {{environment_access}} -- **Data Classification:** {{environment_data_class}} - -<> - -## Environment Transition Strategy - -[[LLM: Detail the complete lifecycle of code and configuration changes from development to production. Include governance, testing gates, and rollback procedures.]] - -- Development to Production Pipeline -- Deployment Stages and Gates -- Approval Workflows and Authorities -- Rollback Procedures -- Change Cadence and Release Windows -- Environment-Specific Configuration Management - -## Network Architecture - -[[LLM: Design network topology considering security zones, traffic patterns, and compliance requirements. Reference main architecture for service communication patterns. - -Create Mermaid diagram showing: - -- VPC/Network structure -- Security zones and boundaries -- Traffic flow patterns -- Load balancer placement -- Service mesh topology (if applicable)]] - -- VPC/VNET Design -- Subnet Strategy -- Security Groups & NACLs -- Load Balancers & API Gateways -- Service Mesh (if applicable) - -```mermaid -graph TB - subgraph "Production VPC" - subgraph "Public Subnets" - ALB[Application Load Balancer] - end - subgraph "Private Subnets" - EKS[EKS Cluster] - RDS[(RDS Database)] - end - end - Internet((Internet)) --> ALB - ALB --> EKS - EKS --> RDS -``` - -^^CONDITION: uses_service_mesh^^ - -### Service Mesh Architecture - -- **Mesh Technology:** {{service_mesh_tech}} -- **Traffic Management:** {{traffic_policies}} -- **Security Policies:** {{mesh_security}} -- **Observability Integration:** {{mesh_observability}} - -^^/CONDITION: uses_service_mesh^^ - -## Compute Resources - -[[LLM: Select compute strategy based on application architecture (microservices, serverless, monolithic). Consider cost, scalability, and operational complexity.]] - -- Container Strategy -- Serverless Architecture -- VM/Instance Configuration -- Auto-scaling Approach - -^^CONDITION: uses_kubernetes^^ - -### Kubernetes Architecture - -- **Cluster Configuration:** {{k8s_cluster_config}} -- **Node Groups:** {{k8s_node_groups}} -- **Networking:** {{k8s_networking}} -- **Storage Classes:** {{k8s_storage}} -- **Security Policies:** {{k8s_security}} - -^^/CONDITION: uses_kubernetes^^ - -## Data Resources - -[[LLM: Design data infrastructure based on data architecture from main system design. Consider data volumes, access patterns, compliance, and recovery requirements. - -Create data flow diagram showing: - -- Database topology -- Replication patterns -- Backup flows -- Data migration paths]] - -- Database Deployment Strategy -- Backup & Recovery -- Replication & Failover -- Data Migration Strategy - -## Security Architecture - -[[LLM: Implement defense-in-depth strategy. Reference security requirements from PRD and compliance needs. Consider zero-trust principles where applicable.]] - -- IAM & Authentication -- Network Security -- Data Encryption -- Compliance Controls -- Security Scanning & Monitoring - -Apply principle of least privilege for all access controls. Document all security exceptions with business justification. - -## Shared Responsibility Model - -[[LLM: Clearly define boundaries between cloud provider, platform team, development team, and security team responsibilities. This is critical for operational success.]] - -- Cloud Provider Responsibilities -- Platform Team Responsibilities -- Development Team Responsibilities -- Security Team Responsibilities -- Operational Monitoring Ownership -- Incident Response Accountability Matrix - -@{example: responsibility_matrix} - -| Component | Cloud Provider | Platform Team | Dev Team | Security Team | -| -------------------- | -------------- | ------------- | -------------- | ------------- | -| Physical Security | ✓ | - | - | Audit | -| Network Security | Partial | ✓ | Config | Audit | -| Application Security | - | Tools | ✓ | Review | -| Data Encryption | Engine | Config | Implementation | Standards | - -@{/example} - -## Monitoring & Observability - -[[LLM: Design comprehensive observability strategy covering metrics, logs, traces, and business KPIs. Ensure alignment with SLA/SLO requirements.]] - -- Metrics Collection -- Logging Strategy -- Tracing Implementation -- Alerting & Incident Response -- Dashboards & Visualization - -## CI/CD Pipeline - -[[LLM: Design deployment pipeline that balances speed with safety. Include progressive deployment strategies and automated quality gates. - -Create pipeline diagram showing: - -- Build stages -- Test gates -- Deployment stages -- Approval points -- Rollback triggers]] - -- Pipeline Architecture -- Build Process -- Deployment Strategy -- Rollback Procedures -- Approval Gates - -^^CONDITION: uses_progressive_deployment^^ - -### Progressive Deployment Strategy - -- **Canary Deployment:** {{canary_config}} -- **Blue-Green Deployment:** {{blue_green_config}} -- **Feature Flags:** {{feature_flag_integration}} -- **Traffic Splitting:** {{traffic_split_rules}} - -^^/CONDITION: uses_progressive_deployment^^ - -## Disaster Recovery - -[[LLM: Design DR strategy based on business continuity requirements. Define clear RTO/RPO targets and ensure they align with business needs.]] - -- Backup Strategy -- Recovery Procedures -- RTO & RPO Targets -- DR Testing Approach - -DR procedures must be tested at least quarterly. Document test results and improvement actions. - -## Cost Optimization - -[[LLM: Balance cost efficiency with performance and reliability requirements. Include both immediate optimizations and long-term strategies.]] - -- Resource Sizing Strategy -- Reserved Instances/Commitments -- Cost Monitoring & Reporting -- Optimization Recommendations - -## BMad Integration Architecture - -[[LLM: Design infrastructure to specifically support other BMad agents and their workflows. This ensures the infrastructure enables the entire BMad methodology.]] - -### Development Agent Support - -- Container platform for development environments -- GitOps workflows for application deployment -- Service mesh integration for development testing -- Developer self-service platform capabilities - -### Product & Architecture Alignment - -- Infrastructure implementing PRD scalability requirements -- Deployment automation supporting product iteration speed -- Service reliability meeting product SLAs -- Architecture patterns properly implemented in infrastructure - -### Cross-Agent Integration Points - -- CI/CD pipelines supporting Frontend, Backend, and Full Stack development workflows -- Monitoring and observability data accessible to QA and DevOps agents -- Infrastructure enabling Design Architect's UI/UX performance requirements -- Platform supporting Analyst's data collection and analysis needs - -## DevOps/Platform Feasibility Review - -[[LLM: CRITICAL STEP - Present architectural blueprint summary to DevOps/Platform Engineering Agent for feasibility review. Request specific feedback on: - -- **Operational Complexity:** Are the proposed patterns implementable with current tooling and expertise? -- **Resource Constraints:** Do infrastructure requirements align with available resources and budgets? -- **Security Implementation:** Are security patterns achievable with current security toolchain? -- **Operational Overhead:** Will the proposed architecture create excessive operational burden? -- **Technology Constraints:** Are selected technologies compatible with existing infrastructure? - -Document all feasibility feedback and concerns raised. Iterate on architectural decisions based on operational constraints and feedback. - -Address all critical feasibility concerns before proceeding to final architecture documentation. If critical blockers identified, revise architecture before continuing.]] - -### Feasibility Assessment Results - -- **Green Light Items:** {{feasible_items}} -- **Yellow Light Items:** {{items_needing_adjustment}} -- **Red Light Items:** {{items_requiring_redesign}} -- **Mitigation Strategies:** {{mitigation_plans}} - -## Infrastructure Verification - -### Validation Framework - -This infrastructure architecture will be validated using the comprehensive `infrastructure-checklist.md`, with particular focus on Section 12: Architecture Documentation Validation. The checklist ensures: - -- Completeness of architecture documentation -- Consistency with broader system architecture -- Appropriate level of detail for different stakeholders -- Clear implementation guidance -- Future evolution considerations - -### Validation Process - -The architecture documentation validation should be performed: - -- After initial architecture development -- After significant architecture changes -- Before major implementation phases -- During periodic architecture reviews - -The Platform Engineer should use the infrastructure checklist to systematically validate all aspects of this architecture document. - -## Implementation Handoff - -[[LLM: Create structured handoff documentation for implementation team. This ensures architecture decisions are properly communicated and implemented.]] - -### Architecture Decision Records (ADRs) - -Create ADRs for key infrastructure decisions: - -- Cloud provider selection rationale -- Container orchestration platform choice -- Networking architecture decisions -- Security implementation choices -- Cost optimization trade-offs - -### Implementation Validation Criteria - -Define specific criteria for validating correct implementation: - -- Infrastructure as Code quality gates -- Security compliance checkpoints -- Performance benchmarks -- Cost targets -- Operational readiness criteria - -### Knowledge Transfer Requirements - -- Technical documentation for operations team -- Runbook creation requirements -- Training needs for platform team -- Handoff meeting agenda items - -## Infrastructure Evolution - -[[LLM: Document the long-term vision and evolution path for the infrastructure. Consider technology trends, anticipated growth, and technical debt management.]] - -- Technical Debt Inventory -- Planned Upgrades and Migrations -- Deprecation Schedule -- Technology Roadmap -- Capacity Planning -- Scalability Considerations - -## Integration with Application Architecture - -[[LLM: Map infrastructure components to application services. Ensure infrastructure design supports application requirements and patterns defined in main architecture.]] - -- Service-to-Infrastructure Mapping -- Application Dependency Matrix -- Performance Requirements Implementation -- Security Requirements Implementation -- Data Flow to Infrastructure Correlation -- API Gateway and Service Mesh Integration - -## Cross-Team Collaboration - -[[LLM: Define clear interfaces and communication patterns between teams. This section is critical for operational success and should include specific touchpoints and escalation paths.]] - -- Platform Engineer and Developer Touchpoints -- Frontend/Backend Integration Requirements -- Product Requirements to Infrastructure Mapping -- Architecture Decision Impact Analysis -- Design Architect UI/UX Infrastructure Requirements -- Analyst Research Integration - -## Infrastructure Change Management - -[[LLM: Define structured process for infrastructure changes. Include risk assessment, testing requirements, and rollback procedures.]] - -- Change Request Process -- Risk Assessment -- Testing Strategy -- Validation Procedures - -[[LLM: Final Review - Ensure all sections are complete and consistent. Verify feasibility review was conducted and all concerns addressed. Apply final validation against infrastructure checklist.]] - ---- - -_Document Version: 1.0_ -_Last Updated: {{current_date}}_ -_Next Review: {{review_date}}_ -==================== END: .bmad-infrastructure-devops/templates/infrastructure-architecture-tmpl.md ==================== - -==================== START: .bmad-infrastructure-devops/templates/infrastructure-platform-from-arch-tmpl.md ==================== -# {{Project Name}} Platform Infrastructure Implementation - -[[LLM: Initial Setup - -1. Replace {{Project Name}} with the actual project name throughout the document -2. Gather and review required inputs: - - - **Infrastructure Architecture Document** (Primary input - REQUIRED) - - Infrastructure Change Request (if applicable) - - Infrastructure Guidelines - - Technology Stack Document - - Infrastructure Checklist - - NOTE: If Infrastructure Architecture Document is missing, HALT and request: "I need the Infrastructure Architecture Document to proceed with platform implementation. This document defines the infrastructure design that we'll be implementing." - -3. Validate that the infrastructure architecture has been reviewed and approved -4. All platform implementation must align with the approved infrastructure architecture. Any deviations require architect approval. - -Output file location: `docs/platform-infrastructure/platform-implementation.md`]] - -## Executive Summary - -[[LLM: Provide a high-level overview of the platform infrastructure being implemented, referencing the infrastructure architecture document's key decisions and requirements.]] - -- Platform implementation scope and objectives -- Key architectural decisions being implemented -- Expected outcomes and benefits -- Timeline and milestones - -## Joint Planning Session with Architect - -[[LLM: Document the collaborative planning session between DevOps/Platform Engineer and Architect. This ensures alignment before implementation begins.]] - -### Architecture Alignment Review - -- Review of infrastructure architecture document -- Confirmation of design decisions -- Identification of any ambiguities or gaps -- Agreement on implementation approach - -### Implementation Strategy Collaboration - -- Platform layer sequencing -- Technology stack validation -- Integration approach between layers -- Testing and validation strategy - -### Risk & Constraint Discussion - -- Technical risks and mitigation strategies -- Resource constraints and workarounds -- Timeline considerations -- Compliance and security requirements - -### Implementation Validation Planning - -- Success criteria for each platform layer -- Testing approach and acceptance criteria -- Rollback strategies -- Communication plan - -### Documentation & Knowledge Transfer Planning - -- Documentation requirements -- Knowledge transfer approach -- Training needs identification -- Handoff procedures - -## Foundation Infrastructure Layer - -[[LLM: Implement the base infrastructure layer based on the infrastructure architecture. This forms the foundation for all platform services.]] - -### Cloud Provider Setup - -- Account/Subscription configuration -- Region selection and setup -- Resource group/organizational structure -- Cost management setup - -### Network Foundation - -```hcl -# Example Terraform for VPC setup -module "vpc" { - source = "./modules/vpc" - - cidr_block = "{{vpc_cidr}}" - availability_zones = {{availability_zones}} - public_subnets = {{public_subnets}} - private_subnets = {{private_subnets}} -} -``` - -### Security Foundation - -- IAM roles and policies -- Security groups and NACLs -- Encryption keys (KMS/Key Vault) -- Compliance controls - -### Core Services - -- DNS configuration -- Certificate management -- Logging infrastructure -- Monitoring foundation - -[[LLM: Platform Layer Elicitation -After implementing foundation infrastructure, present: -"For the Foundation Infrastructure layer, I can explore: - -1. **Platform Layer Security Hardening** - Additional security controls and compliance validation -2. **Performance Optimization** - Network and resource optimization -3. **Operational Excellence Enhancement** - Automation and monitoring improvements -4. **Platform Integration Validation** - Verify foundation supports upper layers -5. **Developer Experience Analysis** - Foundation impact on developer workflows -6. **Disaster Recovery Testing** - Foundation resilience validation -7. **BMAD Workflow Integration** - Cross-agent support verification -8. **Finalize and Proceed to Container Platform** - -Select an option (1-8):"]] - -## Container Platform Implementation - -[[LLM: Build the container orchestration platform on top of the foundation infrastructure, following the architecture's container strategy.]] - -### Kubernetes Cluster Setup - -^^CONDITION: uses_eks^^ - -```bash -# EKS Cluster Configuration -eksctl create cluster \ - --name {{cluster_name}} \ - --region {{aws_region}} \ - --nodegroup-name {{nodegroup_name}} \ - --node-type {{instance_type}} \ - --nodes {{node_count}} -``` - -^^/CONDITION: uses_eks^^ - -^^CONDITION: uses_aks^^ - -```bash -# AKS Cluster Configuration -az aks create \ - --resource-group {{resource_group}} \ - --name {{cluster_name}} \ - --node-count {{node_count}} \ - --node-vm-size {{vm_size}} \ - --network-plugin azure -``` - -^^/CONDITION: uses_aks^^ - -### Node Configuration - -- Node groups/pools setup -- Autoscaling configuration -- Node security hardening -- Resource quotas and limits - -### Cluster Services - -- CoreDNS configuration -- Ingress controller setup -- Certificate management -- Storage classes - -### Security & RBAC - -- RBAC policies -- Pod security policies/standards -- Network policies -- Secrets management - -[[LLM: Present container platform elicitation options similar to foundation layer]] - -## GitOps Workflow Implementation - -[[LLM: Implement GitOps patterns for declarative infrastructure and application management as defined in the architecture.]] - -### GitOps Tooling Setup - -^^CONDITION: uses_argocd^^ - -```yaml -apiVersion: argoproj.io/v1alpha1 -kind: Application -metadata: - name: argocd - namespace: argocd -spec: - source: - repoURL: - "[object Object]": null - targetRevision: - "[object Object]": null - path: - "[object Object]": null -``` - -^^/CONDITION: uses_argocd^^ - -^^CONDITION: uses_flux^^ - -```yaml -apiVersion: source.toolkit.fluxcd.io/v1beta2 -kind: GitRepository -metadata: - name: flux-system - namespace: flux-system -spec: - interval: 1m - ref: - branch: - "[object Object]": null - url: - "[object Object]": null -``` - -^^/CONDITION: uses_flux^^ - -### Repository Structure - -```text -platform-gitops/ - clusters/ -  production/ -  staging/ -  development/ - infrastructure/ -  base/ -  overlays/ - applications/ -  base/ -  overlays/ -``` - -### Deployment Workflows - -- Application deployment patterns -- Progressive delivery setup -- Rollback procedures -- Multi-environment promotion - -### Access Control - -- Git repository permissions -- GitOps tool RBAC -- Secret management integration -- Audit logging - -## Service Mesh Implementation - -[[LLM: Deploy service mesh for advanced traffic management, security, and observability as specified in the architecture.]] - -^^CONDITION: uses_istio^^ - -### Istio Service Mesh - -```bash -# Istio Installation -istioctl install --set profile={{istio_profile}} \ - --set values.gateways.istio-ingressgateway.type={{ingress_type}} -``` - -- Control plane configuration -- Data plane injection -- Gateway configuration -- Observability integration - ^^/CONDITION: uses_istio^^ - -^^CONDITION: uses_linkerd^^ - -### Linkerd Service Mesh - -```bash -# Linkerd Installation -linkerd install --cluster-name={{cluster_name}} | kubectl apply -f - -linkerd viz install | kubectl apply -f - -``` - -- Control plane setup -- Proxy injection -- Traffic policies -- Metrics collection - ^^/CONDITION: uses_linkerd^^ - -### Traffic Management - -- Load balancing policies -- Circuit breakers -- Retry policies -- Canary deployments - -### Security Policies - -- mTLS configuration -- Authorization policies -- Rate limiting -- Network segmentation - -## Developer Experience Platform - -[[LLM: Build the developer self-service platform to enable efficient development workflows as outlined in the architecture.]] - -### Developer Portal - -- Service catalog setup -- API documentation -- Self-service workflows -- Resource provisioning - -### CI/CD Integration - -```yaml -apiVersion: tekton.dev/v1beta1 -kind: Pipeline -metadata: - name: platform-pipeline -spec: - tasks: - - name: build - taskRef: - name: build-task - - name: test - taskRef: - name: test-task - - name: deploy - taskRef: - name: gitops-deploy -``` - -### Development Tools - -- Local development setup -- Remote development environments -- Testing frameworks -- Debugging tools - -### Self-Service Capabilities - -- Environment provisioning -- Database creation -- Feature flag management -- Configuration management - -## Platform Integration & Security Hardening - -[[LLM: Implement comprehensive platform-wide integration and security controls across all layers.]] - -### End-to-End Security - -- Platform-wide security policies -- Cross-layer authentication -- Encryption in transit and at rest -- Compliance validation - -### Integrated Monitoring - -```yaml -apiVersion: v1 -kind: ConfigMap -metadata: - name: prometheus-config -data: - prometheus.yaml: | - global: - scrape_interval: {{scrape_interval}} - scrape_configs: - - job_name: 'kubernetes-pods' - kubernetes_sd_configs: - - role: pod -``` - -### Platform Observability - -- Metrics aggregation -- Log collection and analysis -- Distributed tracing -- Dashboard creation - -### Backup & Disaster Recovery - -- Platform backup strategy -- Disaster recovery procedures -- RTO/RPO validation -- Recovery testing - -## Platform Operations & Automation - -[[LLM: Establish operational procedures and automation for platform management.]] - -### Monitoring & Alerting - -- SLA/SLO monitoring -- Alert routing -- Incident response -- Performance baselines - -### Automation Framework - -```yaml -apiVersion: operators.coreos.com/v1alpha1 -kind: ClusterServiceVersion -metadata: - name: platform-operator -spec: - customresourcedefinitions: - owned: - - name: platformconfigs.platform.io - version: v1alpha1 -``` - -### Maintenance Procedures - -- Upgrade procedures -- Patch management -- Certificate rotation -- Capacity management - -### Operational Runbooks - -- Common operational tasks -- Troubleshooting guides -- Emergency procedures -- Recovery playbooks - -## BMAD Workflow Integration - -[[LLM: Validate that the platform supports all BMAD agent workflows and cross-functional requirements.]] - -### Development Agent Support - -- Frontend development workflows -- Backend development workflows -- Full-stack integration -- Local development experience - -### Infrastructure-as-Code Development - -- IaC development workflows -- Testing frameworks -- Deployment automation -- Version control integration - -### Cross-Agent Collaboration - -- Shared services access -- Communication patterns -- Data sharing mechanisms -- Security boundaries - -### CI/CD Integration - -```yaml -stages: - - analyze - - plan - - architect - - develop - - test - - deploy -``` - -## Platform Validation & Testing - -[[LLM: Execute comprehensive validation to ensure the platform meets all requirements.]] - -### Functional Testing - -- Component testing -- Integration testing -- End-to-end testing -- Performance testing - -### Security Validation - -- Penetration testing -- Compliance scanning -- Vulnerability assessment -- Access control validation - -### Disaster Recovery Testing - -- Backup restoration -- Failover procedures -- Recovery time validation -- Data integrity checks - -### Load Testing - -```typescript -// K6 Load Test Example -import http from 'k6/http'; -import { check } from 'k6'; - -export let options = { - stages: [ - { duration: '5m', target: {{target_users}} }, - { duration: '10m', target: {{target_users}} }, - { duration: '5m', target: 0 }, - ], -}; -``` - -## Knowledge Transfer & Documentation - -[[LLM: Prepare comprehensive documentation and knowledge transfer materials.]] - -### Platform Documentation - -- Architecture documentation -- Operational procedures -- Configuration reference -- API documentation - -### Training Materials - -- Developer guides -- Operations training -- Security best practices -- Troubleshooting guides - -### Handoff Procedures - -- Team responsibilities -- Escalation procedures -- Support model -- Knowledge base - -## Implementation Review with Architect - -[[LLM: Document the post-implementation review session with the Architect to validate alignment and capture learnings.]] - -### Implementation Validation - -- Architecture alignment verification -- Deviation documentation -- Performance validation -- Security review - -### Lessons Learned - -- What went well -- Challenges encountered -- Process improvements -- Technical insights - -### Future Evolution - -- Enhancement opportunities -- Technical debt items -- Upgrade planning -- Capacity planning - -### Sign-off & Acceptance - -- Architect approval -- Stakeholder acceptance -- Go-live authorization -- Support transition - -## Platform Metrics & KPIs - -[[LLM: Define and implement key performance indicators for platform success measurement.]] - -### Technical Metrics - -- Platform availability: {{availability_target}} -- Response time: {{response_time_target}} -- Resource utilization: {{utilization_target}} -- Error rates: {{error_rate_target}} - -### Business Metrics - -- Developer productivity -- Deployment frequency -- Lead time for changes -- Mean time to recovery - -### Operational Metrics - -- Incident response time -- Patch compliance -- Cost per workload -- Resource efficiency - -## Appendices - -### A. Configuration Reference - -[[LLM: Document all configuration parameters and their values used in the platform implementation.]] - -### B. Troubleshooting Guide - -[[LLM: Provide common issues and their resolutions for platform operations.]] - -### C. Security Controls Matrix - -[[LLM: Map implemented security controls to compliance requirements.]] - -### D. Integration Points - -[[LLM: Document all integration points with external systems and services.]] - -[[LLM: Final Review - Ensure all platform layers are properly implemented, integrated, and documented. Verify that the implementation fully supports the BMAD methodology and all agent workflows. Confirm successful validation against the infrastructure checklist.]] - ---- - -_Platform Version: 1.0_ -_Implementation Date: {{implementation_date}}_ -_Next Review: {{review_date}}_ -_Approved by: {{architect_name}} (Architect), {{devops_name}} (DevOps/Platform Engineer)_ -==================== END: .bmad-infrastructure-devops/templates/infrastructure-platform-from-arch-tmpl.md ==================== +==================== START: .bmad-infrastructure-devops/templates/infrastructure-architecture-tmpl.yaml ==================== +template: + id: infrastructure-architecture-template-v2 + name: Infrastructure Architecture + version: 2.0 + output: + format: markdown + filename: docs/infrastructure-architecture.md + title: "{{project_name}} Infrastructure Architecture" + +workflow: + mode: interactive + elicitation: advanced-elicitation + custom_elicitation: + title: "Infrastructure Architecture Elicitation Actions" + sections: + - id: infrastructure-overview + options: + - "Multi-Cloud Strategy Analysis - Evaluate cloud provider options and vendor lock-in considerations" + - "Regional Distribution Planning - Analyze latency requirements and data residency needs" + - "Environment Isolation Strategy - Design security boundaries and resource segregation" + - "Scalability Patterns Review - Assess auto-scaling needs and traffic patterns" + - "Compliance Requirements Analysis - Review regulatory and security compliance needs" + - "Cost-Benefit Analysis - Compare infrastructure options and TCO" + - "Proceed to next section" + +sections: + - id: initial-setup + instruction: | + Initial Setup + + 1. Replace {{project_name}} with the actual project name throughout the document + 2. Gather and review required inputs: + - Product Requirements Document (PRD) - Required for business needs and scale requirements + - Main System Architecture - Required for infrastructure dependencies + - Technical Preferences/Tech Stack Document - Required for technology choices + - PRD Technical Assumptions - Required for cross-referencing repository and service architecture + + If any required documents are missing, ask user: "I need the following documents to create a comprehensive infrastructure architecture: [list missing]. Would you like to proceed with available information or provide the missing documents first?" + + 3. Cross-reference with PRD Technical Assumptions to ensure infrastructure decisions align with repository and service architecture decisions made in the system architecture. + + Output file location: `docs/infrastructure-architecture.md` + + - id: infrastructure-overview + title: Infrastructure Overview + instruction: | + Review the product requirements document to understand business needs and scale requirements. Analyze the main system architecture to identify infrastructure dependencies. Document non-functional requirements (performance, scalability, reliability, security). Cross-reference with PRD Technical Assumptions to ensure alignment with repository and service architecture decisions. + elicit: true + custom_elicitation: infrastructure-overview + template: | + - Cloud Provider(s) + - Core Services & Resources + - Regional Architecture + - Multi-environment Strategy + examples: + - | + - **Cloud Provider:** AWS (primary), with multi-cloud capability for critical services + - **Core Services:** EKS for container orchestration, RDS for databases, S3 for storage, CloudFront for CDN + - **Regional Architecture:** Multi-region active-passive with primary in us-east-1, DR in us-west-2 + - **Multi-environment Strategy:** Development, Staging, UAT, Production with identical infrastructure patterns + + - id: iac + title: Infrastructure as Code (IaC) + instruction: Define IaC approach based on technical preferences and existing patterns. Consider team expertise, tooling ecosystem, and maintenance requirements. + template: | + - Tools & Frameworks + - Repository Structure + - State Management + - Dependency Management + + All infrastructure must be defined as code. No manual resource creation in production environments. + + - id: environment-configuration + title: Environment Configuration + instruction: Design environment strategy that supports the development workflow while maintaining security and cost efficiency. Reference the Environment Transition Strategy section for promotion details. + template: | + - Environment Promotion Strategy + - Configuration Management + - Secret Management + - Feature Flag Integration + sections: + - id: environments + repeatable: true + title: "{{environment_name}} Environment" + template: | + - **Purpose:** {{environment_purpose}} + - **Resources:** {{environment_resources}} + - **Access Control:** {{environment_access}} + - **Data Classification:** {{environment_data_class}} + + - id: environment-transition + title: Environment Transition Strategy + instruction: Detail the complete lifecycle of code and configuration changes from development to production. Include governance, testing gates, and rollback procedures. + template: | + - Development to Production Pipeline + - Deployment Stages and Gates + - Approval Workflows and Authorities + - Rollback Procedures + - Change Cadence and Release Windows + - Environment-Specific Configuration Management + + - id: network-architecture + title: Network Architecture + instruction: | + Design network topology considering security zones, traffic patterns, and compliance requirements. Reference main architecture for service communication patterns. + + Create Mermaid diagram showing: + - VPC/Network structure + - Security zones and boundaries + - Traffic flow patterns + - Load balancer placement + - Service mesh topology (if applicable) + template: | + - VPC/VNET Design + - Subnet Strategy + - Security Groups & NACLs + - Load Balancers & API Gateways + - Service Mesh (if applicable) + sections: + - id: network-diagram + type: mermaid + mermaid_type: graph + template: | + graph TB + subgraph "Production VPC" + subgraph "Public Subnets" + ALB[Application Load Balancer] + end + subgraph "Private Subnets" + EKS[EKS Cluster] + RDS[(RDS Database)] + end + end + Internet((Internet)) --> ALB + ALB --> EKS + EKS --> RDS + - id: service-mesh + title: Service Mesh Architecture + condition: Uses service mesh + template: | + - **Mesh Technology:** {{service_mesh_tech}} + - **Traffic Management:** {{traffic_policies}} + - **Security Policies:** {{mesh_security}} + - **Observability Integration:** {{mesh_observability}} + + - id: compute-resources + title: Compute Resources + instruction: Select compute strategy based on application architecture (microservices, serverless, monolithic). Consider cost, scalability, and operational complexity. + template: | + - Container Strategy + - Serverless Architecture + - VM/Instance Configuration + - Auto-scaling Approach + sections: + - id: kubernetes + title: Kubernetes Architecture + condition: Uses Kubernetes + template: | + - **Cluster Configuration:** {{k8s_cluster_config}} + - **Node Groups:** {{k8s_node_groups}} + - **Networking:** {{k8s_networking}} + - **Storage Classes:** {{k8s_storage}} + - **Security Policies:** {{k8s_security}} + + - id: data-resources + title: Data Resources + instruction: | + Design data infrastructure based on data architecture from main system design. Consider data volumes, access patterns, compliance, and recovery requirements. + + Create data flow diagram showing: + - Database topology + - Replication patterns + - Backup flows + - Data migration paths + template: | + - Database Deployment Strategy + - Backup & Recovery + - Replication & Failover + - Data Migration Strategy + + - id: security-architecture + title: Security Architecture + instruction: Implement defense-in-depth strategy. Reference security requirements from PRD and compliance needs. Consider zero-trust principles where applicable. + template: | + - IAM & Authentication + - Network Security + - Data Encryption + - Compliance Controls + - Security Scanning & Monitoring + + Apply principle of least privilege for all access controls. Document all security exceptions with business justification. + + - id: shared-responsibility + title: Shared Responsibility Model + instruction: Clearly define boundaries between cloud provider, platform team, development team, and security team responsibilities. This is critical for operational success. + template: | + - Cloud Provider Responsibilities + - Platform Team Responsibilities + - Development Team Responsibilities + - Security Team Responsibilities + - Operational Monitoring Ownership + - Incident Response Accountability Matrix + examples: + - | + | Component | Cloud Provider | Platform Team | Dev Team | Security Team | + | -------------------- | -------------- | ------------- | -------------- | ------------- | + | Physical Security | ✓ | - | - | Audit | + | Network Security | Partial | ✓ | Config | Audit | + | Application Security | - | Tools | ✓ | Review | + | Data Encryption | Engine | Config | Implementation | Standards | + + - id: monitoring-observability + title: Monitoring & Observability + instruction: Design comprehensive observability strategy covering metrics, logs, traces, and business KPIs. Ensure alignment with SLA/SLO requirements. + template: | + - Metrics Collection + - Logging Strategy + - Tracing Implementation + - Alerting & Incident Response + - Dashboards & Visualization + + - id: cicd-pipeline + title: CI/CD Pipeline + instruction: | + Design deployment pipeline that balances speed with safety. Include progressive deployment strategies and automated quality gates. + + Create pipeline diagram showing: + - Build stages + - Test gates + - Deployment stages + - Approval points + - Rollback triggers + template: | + - Pipeline Architecture + - Build Process + - Deployment Strategy + - Rollback Procedures + - Approval Gates + sections: + - id: progressive-deployment + title: Progressive Deployment Strategy + condition: Uses progressive deployment + template: | + - **Canary Deployment:** {{canary_config}} + - **Blue-Green Deployment:** {{blue_green_config}} + - **Feature Flags:** {{feature_flag_integration}} + - **Traffic Splitting:** {{traffic_split_rules}} + + - id: disaster-recovery + title: Disaster Recovery + instruction: Design DR strategy based on business continuity requirements. Define clear RTO/RPO targets and ensure they align with business needs. + template: | + - Backup Strategy + - Recovery Procedures + - RTO & RPO Targets + - DR Testing Approach + + DR procedures must be tested at least quarterly. Document test results and improvement actions. + + - id: cost-optimization + title: Cost Optimization + instruction: Balance cost efficiency with performance and reliability requirements. Include both immediate optimizations and long-term strategies. + template: | + - Resource Sizing Strategy + - Reserved Instances/Commitments + - Cost Monitoring & Reporting + - Optimization Recommendations + + - id: bmad-integration + title: BMad Integration Architecture + instruction: Design infrastructure to specifically support other BMad agents and their workflows. This ensures the infrastructure enables the entire BMad methodology. + sections: + - id: dev-agent-support + title: Development Agent Support + template: | + - Container platform for development environments + - GitOps workflows for application deployment + - Service mesh integration for development testing + - Developer self-service platform capabilities + - id: product-architecture-alignment + title: Product & Architecture Alignment + template: | + - Infrastructure implementing PRD scalability requirements + - Deployment automation supporting product iteration speed + - Service reliability meeting product SLAs + - Architecture patterns properly implemented in infrastructure + - id: cross-agent-integration + title: Cross-Agent Integration Points + template: | + - CI/CD pipelines supporting Frontend, Backend, and Full Stack development workflows + - Monitoring and observability data accessible to QA and DevOps agents + - Infrastructure enabling Design Architect's UI/UX performance requirements + - Platform supporting Analyst's data collection and analysis needs + + - id: feasibility-review + title: DevOps/Platform Feasibility Review + instruction: | + CRITICAL STEP - Present architectural blueprint summary to DevOps/Platform Engineering Agent for feasibility review. Request specific feedback on: + + - **Operational Complexity:** Are the proposed patterns implementable with current tooling and expertise? + - **Resource Constraints:** Do infrastructure requirements align with available resources and budgets? + - **Security Implementation:** Are security patterns achievable with current security toolchain? + - **Operational Overhead:** Will the proposed architecture create excessive operational burden? + - **Technology Constraints:** Are selected technologies compatible with existing infrastructure? + + Document all feasibility feedback and concerns raised. Iterate on architectural decisions based on operational constraints and feedback. + + Address all critical feasibility concerns before proceeding to final architecture documentation. If critical blockers identified, revise architecture before continuing. + sections: + - id: feasibility-results + title: Feasibility Assessment Results + template: | + - **Green Light Items:** {{feasible_items}} + - **Yellow Light Items:** {{items_needing_adjustment}} + - **Red Light Items:** {{items_requiring_redesign}} + - **Mitigation Strategies:** {{mitigation_plans}} + + - id: infrastructure-verification + title: Infrastructure Verification + sections: + - id: validation-framework + title: Validation Framework + content: | + This infrastructure architecture will be validated using the comprehensive `infrastructure-checklist.md`, with particular focus on Section 12: Architecture Documentation Validation. The checklist ensures: + + - Completeness of architecture documentation + - Consistency with broader system architecture + - Appropriate level of detail for different stakeholders + - Clear implementation guidance + - Future evolution considerations + - id: validation-process + title: Validation Process + content: | + The architecture documentation validation should be performed: + + - After initial architecture development + - After significant architecture changes + - Before major implementation phases + - During periodic architecture reviews + + The Platform Engineer should use the infrastructure checklist to systematically validate all aspects of this architecture document. + + - id: implementation-handoff + title: Implementation Handoff + instruction: Create structured handoff documentation for implementation team. This ensures architecture decisions are properly communicated and implemented. + sections: + - id: adrs + title: Architecture Decision Records (ADRs) + content: | + Create ADRs for key infrastructure decisions: + + - Cloud provider selection rationale + - Container orchestration platform choice + - Networking architecture decisions + - Security implementation choices + - Cost optimization trade-offs + - id: implementation-validation + title: Implementation Validation Criteria + content: | + Define specific criteria for validating correct implementation: + + - Infrastructure as Code quality gates + - Security compliance checkpoints + - Performance benchmarks + - Cost targets + - Operational readiness criteria + - id: knowledge-transfer + title: Knowledge Transfer Requirements + template: | + - Technical documentation for operations team + - Runbook creation requirements + - Training needs for platform team + - Handoff meeting agenda items + + - id: infrastructure-evolution + title: Infrastructure Evolution + instruction: Document the long-term vision and evolution path for the infrastructure. Consider technology trends, anticipated growth, and technical debt management. + template: | + - Technical Debt Inventory + - Planned Upgrades and Migrations + - Deprecation Schedule + - Technology Roadmap + - Capacity Planning + - Scalability Considerations + + - id: app-integration + title: Integration with Application Architecture + instruction: Map infrastructure components to application services. Ensure infrastructure design supports application requirements and patterns defined in main architecture. + template: | + - Service-to-Infrastructure Mapping + - Application Dependency Matrix + - Performance Requirements Implementation + - Security Requirements Implementation + - Data Flow to Infrastructure Correlation + - API Gateway and Service Mesh Integration + + - id: cross-team-collaboration + title: Cross-Team Collaboration + instruction: Define clear interfaces and communication patterns between teams. This section is critical for operational success and should include specific touchpoints and escalation paths. + template: | + - Platform Engineer and Developer Touchpoints + - Frontend/Backend Integration Requirements + - Product Requirements to Infrastructure Mapping + - Architecture Decision Impact Analysis + - Design Architect UI/UX Infrastructure Requirements + - Analyst Research Integration + + - id: change-management + title: Infrastructure Change Management + instruction: Define structured process for infrastructure changes. Include risk assessment, testing requirements, and rollback procedures. + template: | + - Change Request Process + - Risk Assessment + - Testing Strategy + - Validation Procedures + + - id: final-review + instruction: Final Review - Ensure all sections are complete and consistent. Verify feasibility review was conducted and all concerns addressed. Apply final validation against infrastructure checklist. + content: | + --- + + _Document Version: 1.0_ + _Last Updated: {{current_date}}_ + _Next Review: {{review_date}}_ +==================== END: .bmad-infrastructure-devops/templates/infrastructure-architecture-tmpl.yaml ==================== + +==================== START: .bmad-infrastructure-devops/templates/infrastructure-platform-from-arch-tmpl.yaml ==================== +template: + id: infrastructure-platform-template-v2 + name: Platform Infrastructure Implementation + version: 2.0 + output: + format: markdown + filename: docs/platform-infrastructure/platform-implementation.md + title: "{{project_name}} Platform Infrastructure Implementation" + +workflow: + mode: interactive + elicitation: advanced-elicitation + custom_elicitation: + title: "Platform Implementation Elicitation Actions" + sections: + - id: foundation-infrastructure + options: + - "Platform Layer Security Hardening - Additional security controls and compliance validation" + - "Performance Optimization - Network and resource optimization" + - "Operational Excellence Enhancement - Automation and monitoring improvements" + - "Platform Integration Validation - Verify foundation supports upper layers" + - "Developer Experience Analysis - Foundation impact on developer workflows" + - "Disaster Recovery Testing - Foundation resilience validation" + - "BMAD Workflow Integration - Cross-agent support verification" + - "Finalize and Proceed to Container Platform" + +sections: + - id: initial-setup + instruction: | + Initial Setup + + 1. Replace {{project_name}} with the actual project name throughout the document + 2. Gather and review required inputs: + - **Infrastructure Architecture Document** (Primary input - REQUIRED) + - Infrastructure Change Request (if applicable) + - Infrastructure Guidelines + - Technology Stack Document + - Infrastructure Checklist + - NOTE: If Infrastructure Architecture Document is missing, HALT and request: "I need the Infrastructure Architecture Document to proceed with platform implementation. This document defines the infrastructure design that we'll be implementing." + + 3. Validate that the infrastructure architecture has been reviewed and approved + 4. All platform implementation must align with the approved infrastructure architecture. Any deviations require architect approval. + + Output file location: `docs/platform-infrastructure/platform-implementation.md` + + - id: executive-summary + title: Executive Summary + instruction: Provide a high-level overview of the platform infrastructure being implemented, referencing the infrastructure architecture document's key decisions and requirements. + template: | + - Platform implementation scope and objectives + - Key architectural decisions being implemented + - Expected outcomes and benefits + - Timeline and milestones + + - id: joint-planning + title: Joint Planning Session with Architect + instruction: Document the collaborative planning session between DevOps/Platform Engineer and Architect. This ensures alignment before implementation begins. + sections: + - id: architecture-alignment + title: Architecture Alignment Review + template: | + - Review of infrastructure architecture document + - Confirmation of design decisions + - Identification of any ambiguities or gaps + - Agreement on implementation approach + - id: implementation-strategy + title: Implementation Strategy Collaboration + template: | + - Platform layer sequencing + - Technology stack validation + - Integration approach between layers + - Testing and validation strategy + - id: risk-constraint + title: Risk & Constraint Discussion + template: | + - Technical risks and mitigation strategies + - Resource constraints and workarounds + - Timeline considerations + - Compliance and security requirements + - id: validation-planning + title: Implementation Validation Planning + template: | + - Success criteria for each platform layer + - Testing approach and acceptance criteria + - Rollback strategies + - Communication plan + - id: documentation-planning + title: Documentation & Knowledge Transfer Planning + template: | + - Documentation requirements + - Knowledge transfer approach + - Training needs identification + - Handoff procedures + + - id: foundation-infrastructure + title: Foundation Infrastructure Layer + instruction: Implement the base infrastructure layer based on the infrastructure architecture. This forms the foundation for all platform services. + elicit: true + custom_elicitation: foundation-infrastructure + sections: + - id: cloud-provider-setup + title: Cloud Provider Setup + template: | + - Account/Subscription configuration + - Region selection and setup + - Resource group/organizational structure + - Cost management setup + - id: network-foundation + title: Network Foundation + type: code + language: hcl + template: | + # Example Terraform for VPC setup + module "vpc" { + source = "./modules/vpc" + + cidr_block = "{{vpc_cidr}}" + availability_zones = {{availability_zones}} + public_subnets = {{public_subnets}} + private_subnets = {{private_subnets}} + } + - id: security-foundation + title: Security Foundation + template: | + - IAM roles and policies + - Security groups and NACLs + - Encryption keys (KMS/Key Vault) + - Compliance controls + - id: core-services + title: Core Services + template: | + - DNS configuration + - Certificate management + - Logging infrastructure + - Monitoring foundation + + - id: container-platform + title: Container Platform Implementation + instruction: Build the container orchestration platform on top of the foundation infrastructure, following the architecture's container strategy. + sections: + - id: kubernetes-setup + title: Kubernetes Cluster Setup + sections: + - id: eks-setup + condition: Uses EKS + type: code + language: bash + template: | + # EKS Cluster Configuration + eksctl create cluster \ + --name {{cluster_name}} \ + --region {{aws_region}} \ + --nodegroup-name {{nodegroup_name}} \ + --node-type {{instance_type}} \ + --nodes {{node_count}} + - id: aks-setup + condition: Uses AKS + type: code + language: bash + template: | + # AKS Cluster Configuration + az aks create \ + --resource-group {{resource_group}} \ + --name {{cluster_name}} \ + --node-count {{node_count}} \ + --node-vm-size {{vm_size}} \ + --network-plugin azure + - id: node-configuration + title: Node Configuration + template: | + - Node groups/pools setup + - Autoscaling configuration + - Node security hardening + - Resource quotas and limits + - id: cluster-services + title: Cluster Services + template: | + - CoreDNS configuration + - Ingress controller setup + - Certificate management + - Storage classes + - id: security-rbac + title: Security & RBAC + template: | + - RBAC policies + - Pod security policies/standards + - Network policies + - Secrets management + + - id: gitops-workflow + title: GitOps Workflow Implementation + instruction: Implement GitOps patterns for declarative infrastructure and application management as defined in the architecture. + sections: + - id: gitops-tooling + title: GitOps Tooling Setup + sections: + - id: argocd-setup + condition: Uses ArgoCD + type: code + language: yaml + template: | + apiVersion: argoproj.io/v1alpha1 + kind: Application + metadata: + name: argocd + namespace: argocd + spec: + source: + repoURL: {{repo_url}} + targetRevision: {{target_revision}} + path: {{path}} + - id: flux-setup + condition: Uses Flux + type: code + language: yaml + template: | + apiVersion: source.toolkit.fluxcd.io/v1beta2 + kind: GitRepository + metadata: + name: flux-system + namespace: flux-system + spec: + interval: 1m + ref: + branch: {{branch}} + url: {{git_url}} + - id: repository-structure + title: Repository Structure + type: code + language: text + template: | + platform-gitops/ + clusters/ + production/ + staging/ + development/ + infrastructure/ + base/ + overlays/ + applications/ + base/ + overlays/ + - id: deployment-workflows + title: Deployment Workflows + template: | + - Application deployment patterns + - Progressive delivery setup + - Rollback procedures + - Multi-environment promotion + - id: access-control + title: Access Control + template: | + - Git repository permissions + - GitOps tool RBAC + - Secret management integration + - Audit logging + + - id: service-mesh + title: Service Mesh Implementation + instruction: Deploy service mesh for advanced traffic management, security, and observability as specified in the architecture. + sections: + - id: istio-mesh + title: Istio Service Mesh + condition: Uses Istio + sections: + - id: istio-install + type: code + language: bash + template: | + # Istio Installation + istioctl install --set profile={{istio_profile}} \ + --set values.gateways.istio-ingressgateway.type={{ingress_type}} + - id: istio-config + template: | + - Control plane configuration + - Data plane injection + - Gateway configuration + - Observability integration + - id: linkerd-mesh + title: Linkerd Service Mesh + condition: Uses Linkerd + sections: + - id: linkerd-install + type: code + language: bash + template: | + # Linkerd Installation + linkerd install --cluster-name={{cluster_name}} | kubectl apply -f - + linkerd viz install | kubectl apply -f - + - id: linkerd-config + template: | + - Control plane setup + - Proxy injection + - Traffic policies + - Metrics collection + - id: traffic-management + title: Traffic Management + template: | + - Load balancing policies + - Circuit breakers + - Retry policies + - Canary deployments + - id: security-policies + title: Security Policies + template: | + - mTLS configuration + - Authorization policies + - Rate limiting + - Network segmentation + + - id: developer-experience + title: Developer Experience Platform + instruction: Build the developer self-service platform to enable efficient development workflows as outlined in the architecture. + sections: + - id: developer-portal + title: Developer Portal + template: | + - Service catalog setup + - API documentation + - Self-service workflows + - Resource provisioning + - id: cicd-integration + title: CI/CD Integration + type: code + language: yaml + template: | + apiVersion: tekton.dev/v1beta1 + kind: Pipeline + metadata: + name: platform-pipeline + spec: + tasks: + - name: build + taskRef: + name: build-task + - name: test + taskRef: + name: test-task + - name: deploy + taskRef: + name: gitops-deploy + - id: development-tools + title: Development Tools + template: | + - Local development setup + - Remote development environments + - Testing frameworks + - Debugging tools + - id: self-service + title: Self-Service Capabilities + template: | + - Environment provisioning + - Database creation + - Feature flag management + - Configuration management + + - id: platform-integration + title: Platform Integration & Security Hardening + instruction: Implement comprehensive platform-wide integration and security controls across all layers. + sections: + - id: end-to-end-security + title: End-to-End Security + template: | + - Platform-wide security policies + - Cross-layer authentication + - Encryption in transit and at rest + - Compliance validation + - id: integrated-monitoring + title: Integrated Monitoring + type: code + language: yaml + template: | + apiVersion: v1 + kind: ConfigMap + metadata: + name: prometheus-config + data: + prometheus.yaml: | + global: + scrape_interval: {{scrape_interval}} + scrape_configs: + - job_name: 'kubernetes-pods' + kubernetes_sd_configs: + - role: pod + - id: platform-observability + title: Platform Observability + template: | + - Metrics aggregation + - Log collection and analysis + - Distributed tracing + - Dashboard creation + - id: backup-dr + title: Backup & Disaster Recovery + template: | + - Platform backup strategy + - Disaster recovery procedures + - RTO/RPO validation + - Recovery testing + + - id: platform-operations + title: Platform Operations & Automation + instruction: Establish operational procedures and automation for platform management. + sections: + - id: monitoring-alerting + title: Monitoring & Alerting + template: | + - SLA/SLO monitoring + - Alert routing + - Incident response + - Performance baselines + - id: automation-framework + title: Automation Framework + type: code + language: yaml + template: | + apiVersion: operators.coreos.com/v1alpha1 + kind: ClusterServiceVersion + metadata: + name: platform-operator + spec: + customresourcedefinitions: + owned: + - name: platformconfigs.platform.io + version: v1alpha1 + - id: maintenance-procedures + title: Maintenance Procedures + template: | + - Upgrade procedures + - Patch management + - Certificate rotation + - Capacity management + - id: operational-runbooks + title: Operational Runbooks + template: | + - Common operational tasks + - Troubleshooting guides + - Emergency procedures + - Recovery playbooks + + - id: bmad-workflow-integration + title: BMAD Workflow Integration + instruction: Validate that the platform supports all BMAD agent workflows and cross-functional requirements. + sections: + - id: development-agent-support + title: Development Agent Support + template: | + - Frontend development workflows + - Backend development workflows + - Full-stack integration + - Local development experience + - id: iac-development + title: Infrastructure-as-Code Development + template: | + - IaC development workflows + - Testing frameworks + - Deployment automation + - Version control integration + - id: cross-agent-collaboration + title: Cross-Agent Collaboration + template: | + - Shared services access + - Communication patterns + - Data sharing mechanisms + - Security boundaries + - id: cicd-integration-workflow + title: CI/CD Integration + type: code + language: yaml + template: | + stages: + - analyze + - plan + - architect + - develop + - test + - deploy + + - id: platform-validation + title: Platform Validation & Testing + instruction: Execute comprehensive validation to ensure the platform meets all requirements. + sections: + - id: functional-testing + title: Functional Testing + template: | + - Component testing + - Integration testing + - End-to-end testing + - Performance testing + - id: security-validation + title: Security Validation + template: | + - Penetration testing + - Compliance scanning + - Vulnerability assessment + - Access control validation + - id: dr-testing + title: Disaster Recovery Testing + template: | + - Backup restoration + - Failover procedures + - Recovery time validation + - Data integrity checks + - id: load-testing + title: Load Testing + type: code + language: typescript + template: | + // K6 Load Test Example + import http from 'k6/http'; + import { check } from 'k6'; + + export let options = { + stages: [ + { duration: '5m', target: {{target_users}} }, + { duration: '10m', target: {{target_users}} }, + { duration: '5m', target: 0 }, + ], + }; + + - id: knowledge-transfer + title: Knowledge Transfer & Documentation + instruction: Prepare comprehensive documentation and knowledge transfer materials. + sections: + - id: platform-documentation + title: Platform Documentation + template: | + - Architecture documentation + - Operational procedures + - Configuration reference + - API documentation + - id: training-materials + title: Training Materials + template: | + - Developer guides + - Operations training + - Security best practices + - Troubleshooting guides + - id: handoff-procedures + title: Handoff Procedures + template: | + - Team responsibilities + - Escalation procedures + - Support model + - Knowledge base + + - id: implementation-review + title: Implementation Review with Architect + instruction: Document the post-implementation review session with the Architect to validate alignment and capture learnings. + sections: + - id: implementation-validation + title: Implementation Validation + template: | + - Architecture alignment verification + - Deviation documentation + - Performance validation + - Security review + - id: lessons-learned + title: Lessons Learned + template: | + - What went well + - Challenges encountered + - Process improvements + - Technical insights + - id: future-evolution + title: Future Evolution + template: | + - Enhancement opportunities + - Technical debt items + - Upgrade planning + - Capacity planning + - id: sign-off + title: Sign-off & Acceptance + template: | + - Architect approval + - Stakeholder acceptance + - Go-live authorization + - Support transition + + - id: platform-metrics + title: Platform Metrics & KPIs + instruction: Define and implement key performance indicators for platform success measurement. + sections: + - id: technical-metrics + title: Technical Metrics + template: | + - Platform availability: {{availability_target}} + - Response time: {{response_time_target}} + - Resource utilization: {{utilization_target}} + - Error rates: {{error_rate_target}} + - id: business-metrics + title: Business Metrics + template: | + - Developer productivity + - Deployment frequency + - Lead time for changes + - Mean time to recovery + - id: operational-metrics + title: Operational Metrics + template: | + - Incident response time + - Patch compliance + - Cost per workload + - Resource efficiency + + - id: appendices + title: Appendices + sections: + - id: config-reference + title: A. Configuration Reference + instruction: Document all configuration parameters and their values used in the platform implementation. + - id: troubleshooting + title: B. Troubleshooting Guide + instruction: Provide common issues and their resolutions for platform operations. + - id: security-controls + title: C. Security Controls Matrix + instruction: Map implemented security controls to compliance requirements. + - id: integration-points + title: D. Integration Points + instruction: Document all integration points with external systems and services. + + - id: final-review + instruction: Final Review - Ensure all platform layers are properly implemented, integrated, and documented. Verify that the implementation fully supports the BMAD methodology and all agent workflows. Confirm successful validation against the infrastructure checklist. + content: | + --- + + _Platform Version: 1.0_ + _Implementation Date: {{implementation_date}}_ + _Next Review: {{review_date}}_ + _Approved by: {{architect_name}} (Architect), {{devops_name}} (DevOps/Platform Engineer)_ +==================== END: .bmad-infrastructure-devops/templates/infrastructure-platform-from-arch-tmpl.yaml ==================== ==================== START: .bmad-infrastructure-devops/checklists/infrastructure-checklist.md ==================== # Infrastructure Change Validation Checklist @@ -2043,32 +2050,3 @@ This checklist serves as a comprehensive framework for validating infrastructure None Listed ==================== END: .bmad-infrastructure-devops/data/technical-preferences.md ==================== - -==================== START: .bmad-infrastructure-devops/utils/template-format.md ==================== -# Template Format Conventions - -Templates in the BMad method use standardized markup for AI processing. These conventions ensure consistent document generation. - -## Template Markup Elements - -- **{{placeholders}}**: Variables to be replaced with actual content -- **[[LLM: instructions]]**: Internal processing instructions for AI agents (never shown to users) -- **REPEAT** sections: Content blocks that may be repeated as needed -- **^^CONDITION^^** blocks: Conditional content included only if criteria are met -- **@{examples}**: Example content for guidance (never output to users) - -## Processing Rules - -- Replace all {{placeholders}} with project-specific content -- Execute all [[LLM: instructions]] internally without showing users -- Process conditional and repeat blocks as specified -- Use examples for guidance but never include them in final output -- Present only clean, formatted content to users - -## Critical Guidelines - -- **NEVER display template markup, LLM instructions, or examples to users** -- Template elements are for AI processing only -- Focus on faithful template execution and clean output -- All template-specific instructions are embedded within templates -==================== END: .bmad-infrastructure-devops/utils/template-format.md ==================== diff --git a/dist/teams/team-all.txt b/dist/teams/team-all.txt index 513596fb..6e25906c 100644 --- a/dist/teams/team-all.txt +++ b/dist/teams/team-all.txt @@ -48,12 +48,12 @@ agents: - bmad-orchestrator - '*' workflows: - - brownfield-fullstack - - brownfield-service - - brownfield-ui - - greenfield-fullstack - - greenfield-service - - greenfield-ui + - brownfield-fullstack.yaml + - brownfield-service.yaml + - brownfield-ui.yaml + - greenfield-fullstack.yaml + - greenfield-service.yaml + - greenfield-ui.yaml ==================== END: .bmad-core/agent-teams/team-all.yaml ==================== ==================== START: .bmad-core/agents/bmad-orchestrator.md ==================== @@ -62,6 +62,15 @@ workflows: CRITICAL: Read the full YAML, start activation to alter your state of being, follow startup section instructions, stay in this being until told to exit this mode: ```yaml +activation-instructions: + - Mention *help shows all available commands and options + - Check for active workflow plan using .bmad-core/utils/plan-management.md + - 'If plan exists: Show 📋 Active plan: {workflow} ({progress}% complete). Use *plan-status for details.' + - 'If plan exists: Suggest next action based on plan progress' + - Assess user goal against available agents and workflows in this bundle + - If clear match to an agent's expertise, suggest transformation with *agent command + - If project-oriented, suggest *workflow-guidance to explore options + - Load resources only when needed - never pre-load agent: name: BMad Orchestrator id: bmad-orchestrator @@ -83,17 +92,6 @@ persona: - Always use numbered lists for choices - Process commands starting with * immediately - Always remind users that commands require * prefix -startup: - - Announce: Introduce yourself as the BMad Orchestrator, explain you can coordinate agents and workflows - - IMPORTANT: Tell users that all commands start with * (e.g., *help, *agent, *workflow) - - Mention *help shows all available commands and options - - Check for active workflow plan using .bmad-core/utils/plan-management.md - - 'If plan exists: Show 📋 Active plan: {workflow} ({progress}% complete). Use *plan-status for details.' - - 'If plan exists: Suggest next action based on plan progress' - - Assess user goal against available agents and workflows in this bundle - - If clear match to an agent's expertise, suggest transformation with *agent command - - If project-oriented, suggest *workflow-guidance to explore options - - Load resources only when needed - never pre-load commands: help: Show this guide with available agents and workflows chat-mode: Start conversational mode for detailed assistance @@ -181,17 +179,18 @@ workflow-guidance: - When *workflow-guidance is called, start an interactive session and list all available workflows with brief descriptions dependencies: tasks: - - advanced-elicitation - - create-doc - - create-workflow-plan - - kb-mode-interaction - - update-workflow-plan + - advanced-elicitation.md + - create-doc.md + - create-workflow-plan.md + - kb-mode-interaction.md + - update-workflow-plan.md data: - - bmad-kb + - bmad-kb.md + - elicitation-methods.md utils: - - plan-management - - workflow-management - - template-format + - plan-management.md + - workflow-management.md + - template-format.md ``` ==================== END: .bmad-core/agents/bmad-orchestrator.md ==================== @@ -204,8 +203,9 @@ CRITICAL: Read the full YAML, start activation to alter your state of being, fol activation-instructions: - Follow all instructions in this file -> this defines you, your persona and more importantly what you can do. STAY IN CHARACTER! - Only read the files/tasks listed here when user selects them for execution to minimize context usage - - The customization field ALWAYS takes precedence over any conflicting instructions + - The agent.customization field ALWAYS takes precedence over any conflicting instructions - When listing tasks/templates or presenting options during conversations, always show as numbered options list, allowing the user to type a number to select or execute + - Greet the user with your name and role, and inform of the *help command. agent: name: Mary id: analyst @@ -230,36 +230,32 @@ persona: - Maintaining a Broad Perspective - Stay aware of market trends and dynamics - Integrity of Information - Ensure accurate sourcing and representation - Numbered Options Protocol - Always use numbered lists for selections -startup: - - Greet the user with your name and role, and inform of the *help command. commands: - help: Show numbered list of the following commands to allow selection - create-doc {template}: execute task create-doc (no template = ONLY show available templates listed under dependencies/templates below) - - yolo: Toggle Yolo Mode off on - on will skip doc section confirmations + - yolo: Toggle Yolo Mode - doc-out: Output full document to current destination file - execute-checklist {checklist}: Run task execute-checklist (default->architect-checklist) - - research {topic}: execute task create-deep-research-prompt for architectural decisions + - research-prompt {topic}: execute task create-deep-research-prompt for architectural decisions - brainstorm {topic}: Facilitate structured brainstorming session - - elicit: list the options under output set of information + - elicit: run the task advanced-elicitation - document-project: Analyze and document existing project structure comprehensively - exit: Say goodbye as the Business Analyst, and then abandon inhabiting this persona dependencies: tasks: - - facilitate-brainstorming-session - - create-deep-research-prompt - - create-doc - - advanced-elicitation - - document-project + - facilitate-brainstorming-session.md + - create-deep-research-prompt.md + - create-doc.md + - advanced-elicitation.md + - document-project.md templates: - - project-brief-tmpl - - market-research-tmpl - - competitor-analysis-tmpl - - brainstorming-output-tmpl + - project-brief-tmpl.yaml + - market-research-tmpl.yaml + - competitor-analysis-tmpl.yaml + - brainstorming-output-tmpl.yaml data: - - bmad-kb - - brainstorming-techniques - utils: - - template-format + - bmad-kb.md + - brainstorming-techniques.md ``` ==================== END: .bmad-core/agents/analyst.md ==================== @@ -274,6 +270,8 @@ activation-instructions: - Only read the files/tasks listed here when user selects them for execution to minimize context usage - The customization field ALWAYS takes precedence over any conflicting instructions - When listing tasks/templates or presenting options during conversations, always show as numbered options list, allowing the user to type a number to select or execute + - Greet the user with your name and role, and inform of the *help command. + - When creating architecture, always start by understanding the complete picture - user needs, business constraints, team capabilities, and technical requirements. agent: name: Winston id: architect @@ -297,34 +295,29 @@ persona: - Data-Centric Design - Let data requirements drive architecture - Cost-Conscious Engineering - Balance technical ideals with financial reality - Living Architecture - Design for change and adaptation -startup: - - Greet the user with your name and role, and inform of the *help command. - - When creating architecture, always start by understanding the complete picture - user needs, business constraints, team capabilities, and technical requirements. commands: - help: Show numbered list of the following commands to allow selection - create-doc {template}: execute task create-doc (no template = ONLY show available templates listed under dependencies/templates below) - - yolo: Toggle Yolo Mode off on - on will skip doc section confirmations + - yolo: Toggle Yolo Mode - doc-out: Output full document to current destination file - execute-checklist {checklist}: Run task execute-checklist (default->architect-checklist) - research {topic}: execute task create-deep-research-prompt for architectural decisions - exit: Say goodbye as the Architect, and then abandon inhabiting this persona dependencies: tasks: - - create-doc - - create-deep-research-prompt - - document-project - - execute-checklist + - create-doc.md + - create-deep-research-prompt.md + - document-project.md + - execute-checklist.md templates: - - architecture-tmpl - - front-end-architecture-tmpl - - fullstack-architecture-tmpl - - brownfield-architecture-tmpl + - architecture-tmpl.yaml + - front-end-architecture-tmpl.yaml + - fullstack-architecture-tmpl.yaml + - brownfield-architecture-tmpl.yaml checklists: - - architect-checklist + - architect-checklist.md data: - - technical-preferences - utils: - - template-format + - technical-preferences.md ``` ==================== END: .bmad-core/agents/architect.md ==================== @@ -334,6 +327,7 @@ dependencies: CRITICAL: Read the full YAML, start activation to alter your state of being, follow startup section instructions, stay in this being until told to exit this mode: ```yaml +activation-instructions: [] agent: name: James id: dev @@ -341,11 +335,6 @@ agent: icon: 💻 whenToUse: Use for code implementation, debugging, refactoring, and development best practices customization: null -startup: - - Announce: Greet the user with your name and role, and inform of the *help command. - - CRITICAL: Read the following full files as these are your explicit rules for development standards for this project - .bmad-core/core-config.yaml devLoadAlwaysFiles list - - CRITICAL: Do NOT load any other files during startup aside from the assigned story and devLoadAlwaysFiles items, unless user requested you do or the following contradicts - - CRITICAL: Do NOT begin development until a story is not in draft mode and you are told to proceed persona: role: Expert Senior Software Engineer & Implementation Specialist style: Extremely concise, pragmatic, detail-oriented, solution-focused @@ -372,10 +361,10 @@ develop-story: completion: 'All Tasks and Subtasks marked [x] and have tests→Validations and full regression passes (DON''T BE LAZY, EXECUTE ALL TESTS and CONFIRM)→Ensure File List is Complete→run the task execute-checklist for the checklist story-dod-checklist→set story status: ''Ready for Review''→HALT' dependencies: tasks: - - execute-checklist - - validate-next-story + - execute-checklist.md + - validate-next-story.md checklists: - - story-dod-checklist + - story-dod-checklist.md ``` ==================== END: .bmad-core/agents/dev.md ==================== @@ -390,6 +379,7 @@ activation-instructions: - Only read the files/tasks listed here when user selects them for execution to minimize context usage - The customization field ALWAYS takes precedence over any conflicting instructions - When listing tasks/templates or presenting options during conversations, always show as numbered options list, allowing the user to type a number to select or execute + - Greet the user with your name and role, and inform of the *help command. agent: name: John id: pm @@ -411,33 +401,29 @@ persona: - Collaborative & iterative approach - Proactive risk identification - Strategic thinking & outcome-oriented -startup: - - Greet the user with your name and role, and inform of the *help command. commands: - help: Show numbered list of the following commands to allow selection - - create-doc {template}: execute task create-doc (no template = ONLY show available templates listed under dependencies/templates below) - - yolo: Toggle Yolo Mode off on - on will skip doc section confirmations + - create-doc {template}: execute task create-doc for template provided, if no template then ONLY list dependencies.templates + - yolo: Toggle Yolo Mode - doc-out: Output full document to current destination file - exit: Exit (confirm) dependencies: tasks: - - create-doc - - correct-course - - create-deep-research-prompt - - brownfield-create-epic - - brownfield-create-story - - execute-checklist - - shard-doc + - create-doc.md + - correct-course.md + - create-deep-research-prompt.md + - brownfield-create-epic.md + - brownfield-create-story.md + - execute-checklist.md + - shard-doc.md templates: - - prd-tmpl - - brownfield-prd-tmpl + - prd-tmpl.yaml + - brownfield-prd-tmpl.yaml checklists: - - pm-checklist - - change-checklist + - pm-checklist.md + - change-checklist.md data: - - technical-preferences - utils: - - template-format + - technical-preferences.md ``` ==================== END: .bmad-core/agents/pm.md ==================== @@ -452,6 +438,7 @@ activation-instructions: - Only read the files/tasks listed here when user selects them for execution to minimize context usage - The customization field ALWAYS takes precedence over any conflicting instructions - When listing tasks/templates or presenting options during conversations, always show as numbered options list, allowing the user to type a number to select or execute + - Greet the user with your name and role, and inform of the *help command. agent: name: Sarah id: po @@ -475,8 +462,6 @@ persona: - User Collaboration for Validation - Seek input at critical checkpoints - Focus on Executable & Value-Driven Increments - Ensure work aligns with MVP goals - Documentation Ecosystem Integrity - Maintain consistency across all documents -startup: - - Greet the user with your name and role, and inform of the *help command. commands: - help: Show numbered list of the following commands to allow selection - create-doc {template}: execute task create-doc (no template = ONLY show available templates listed under dependencies/templates below) @@ -491,19 +476,17 @@ commands: - exit: Exit (confirm) dependencies: tasks: - - execute-checklist - - shard-doc - - correct-course - - brownfield-create-epic - - brownfield-create-story - - validate-next-story + - execute-checklist.md + - shard-doc.md + - correct-course.md + - brownfield-create-epic.md + - brownfield-create-story.md + - validate-next-story.md templates: - - story-tmpl + - story-tmpl.yaml checklists: - - po-master-checklist - - change-checklist - utils: - - template-format + - po-master-checklist.md + - change-checklist.md ``` ==================== END: .bmad-core/agents/po.md ==================== @@ -518,6 +501,7 @@ activation-instructions: - Only read the files/tasks listed here when user selects them for execution to minimize context usage - The customization field ALWAYS takes precedence over any conflicting instructions - When listing tasks/templates or presenting options during conversations, always show as numbered options list, allowing the user to type a number to select or execute + - Greet the user with your name and role, and inform of the *help command. agent: name: Quinn id: qa @@ -541,8 +525,6 @@ persona: - Risk-Based Testing - Prioritize testing based on risk and critical areas - Continuous Improvement - Balance perfection with pragmatism - Architecture & Design Patterns - Ensure proper patterns and maintainable code structure -startup: - - Greet the user with your name and role, and inform of the *help command. story-file-permissions: - CRITICAL: When reviewing stories, you are ONLY authorized to update the "QA Results" section of story files - CRITICAL: DO NOT modify any other sections including Status, Story, Acceptance Criteria, Tasks/Subtasks, Dev Notes, Testing, Dev Agent Record, Change Log, or any other sections @@ -554,11 +536,11 @@ commands: - exit: Say goodbye as the QA Engineer, and then abandon inhabiting this persona dependencies: tasks: - - review-story + - review-story.md data: - - technical-preferences - utils: - - template-format + - technical-preferences.md + templates: + - story-tmpl.yaml ``` ==================== END: .bmad-core/agents/qa.md ==================== @@ -572,6 +554,7 @@ activation-instructions: - Follow all instructions in this file -> this defines you, your persona and more importantly what you can do. STAY IN CHARACTER! - The customization field ALWAYS takes precedence over any conflicting instructions - When listing tasks/templates or presenting options during conversations, always show as numbered options list, allowing the user to type a number to select or execute + - Greet the user with your name and role, and inform of the *help command and then HALT to await instruction if not given already. agent: name: Bob id: sm @@ -588,10 +571,6 @@ persona: - Rigorously follow `create-next-story` procedure to generate the detailed user story - Will ensure all information comes from the PRD and Architecture to guide the dumb dev agent - You are NOT allowed to implement stories or modify code EVER! -startup: - - Greet the user with your name and role, and inform of the *help command and then HALT to await instruction if not given already. - - Offer to help with story preparation but wait for explicit user confirmation - - Only execute tasks when user explicitly requests them commands: - help: Show numbered list of the following commands to allow selection - draft: Execute task create-next-story @@ -600,15 +579,13 @@ commands: - exit: Say goodbye as the Scrum Master, and then abandon inhabiting this persona dependencies: tasks: - - create-next-story - - execute-checklist - - correct-course + - create-next-story.md + - execute-checklist.md + - correct-course.md templates: - - story-tmpl + - story-tmpl.yaml checklists: - - story-draft-checklist - utils: - - template-format + - story-draft-checklist.md ``` ==================== END: .bmad-core/agents/sm.md ==================== @@ -623,6 +600,7 @@ activation-instructions: - Only read the files/tasks listed here when user selects them for execution to minimize context usage - The customization field ALWAYS takes precedence over any conflicting instructions - When listing tasks/templates or presenting options during conversations, always show as numbered options list, allowing the user to type a number to select or execute + - Greet the user with your name and role, and inform of the *help command. agent: name: Sally id: ux-expert @@ -644,9 +622,6 @@ persona: - You have a keen eye for detail and a deep empathy for users. - You're particularly skilled at translating user needs into beautiful, functional designs. - You can craft effective prompts for AI UI generation tools like v0, or Lovable. -startup: - - Greet the user with your name and role, and inform of the *help command. - - Always start by understanding the user's context, goals, and constraints before proposing solutions. commands: - help: Show numbered list of the following commands to allow selection - create-doc {template}: execute task create-doc (no template = ONLY show available templates listed under dependencies/templates below) @@ -656,16 +631,14 @@ commands: - exit: Say goodbye as the UX Expert, and then abandon inhabiting this persona dependencies: tasks: - - generate-ai-frontend-prompt - - create-deep-research-prompt - - create-doc - - execute-checklist + - generate-ai-frontend-prompt.md + - create-deep-research-prompt.md + - create-doc.md + - execute-checklist.md templates: - - front-end-spec-tmpl + - front-end-spec-tmpl.yaml data: - - technical-preferences - utils: - - template-format + - technical-preferences.md ``` ==================== END: .bmad-core/agents/ux-expert.md ==================== @@ -790,97 +763,85 @@ Choose a number (0-8) or 9 to proceed: ==================== END: .bmad-core/tasks/advanced-elicitation.md ==================== ==================== START: .bmad-core/tasks/create-doc.md ==================== -# Create Document from Template Task +# Create Document from Template (YAML Driven) -## Purpose +## CRITICAL: Mandatory Elicitation Format -Generate documents from templates by EXECUTING (not just reading) embedded instructions from the perspective of the selected agent persona. +**When `elicit: true`, ALWAYS use this exact format:** -## CRITICAL RULES +1. Present section content +2. Provide detailed rationale (explain trade-offs, assumptions, decisions made) +3. Present numbered options 1-9: + - **Option 1:** Always "Proceed to next section" + - **Options 2-9:** Select 8 methods from data/elicitation-methods + - End with: "Select 1-9 or just type your question/feedback:" -1. **Templates are PROGRAMS** - Execute every [[LLM:]] instruction exactly as written -2. **NEVER show markup** - Hide all [[LLM:]], {{placeholders}}, @{examples}, and template syntax -3. **STOP and EXECUTE** - When you see "apply tasks#" or "execute tasks#", STOP and run that task immediately -4. **WAIT for user input** - At review points and after elicitation tasks +**NEVER ask yes/no questions or use any other format.** -## Execution Flow +## Processing Flow -### 0. Check Workflow Plan (if configured) +1. **Parse YAML template** - Load template metadata and sections +2. **Set preferences** - Show current mode (Interactive), confirm output file +3. **Process each section:** + - Skip if condition unmet + - Check agent permissions (owner/editors) - note if section is restricted to specific agents + - Draft content using section instruction + - Present content + detailed rationale + - **IF elicit: true** → MANDATORY 1-9 options format + - Save to file if possible +4. **Continue until complete** -[[LLM: Check if plan tracking is enabled in core-config.yaml]] +## Detailed Rationale Requirements -- If `workflow.trackProgress: true`, check for active plan using .bmad-core/utils/plan-management.md -- If plan exists and this document creation is part of the plan: - - Verify this is the expected next step - - If out of sequence and `enforceSequence: true`, warn user and halt without user override - - If out of sequence and `enforceSequence: false`, ask for confirmation -- Continue with normal execution after plan check +When presenting section content, ALWAYS include rationale that explains: -### 1. Identify Template +- Trade-offs and choices made (what was chosen over alternatives and why) +- Key assumptions made during drafting +- Interesting or questionable decisions that need user attention +- Areas that might need validation -- Load from `.bmad-core/templates/*.md` or `.bmad-core/templates directory` -- Agent-specific templates are listed in agent's dependencies -- If agent has `templates: [prd-tmpl, architecture-tmpl]` for example, then offer to create "PRD" and "Architecture" documents +## Elicitation Results Flow -### 2. Ask Interaction Mode +After user selects elicitation method (2-9): -> 1. **Incremental** - Section by section with reviews -> 2. **YOLO Mode** - Complete draft then review (user can type `/yolo` anytime to switch) +1. Execute method from data/elicitation-methods +2. Present results with insights +3. Offer options: + - **1. Apply changes and update section** + - **2. Return to elicitation menu** + - **3. Ask any questions or engage further with this elicitation** -### 3. Execute Template +## Agent Permissions -- Replace {{placeholders}} with real content -- Execute [[LLM:]] instructions as you encounter them -- Process <> loops and ^^CONDITIONS^^ -- Use @{examples} for guidance but never output them +When processing sections with agent permission fields: -### 4. Key Execution Patterns +- **owner**: Note which agent role initially creates/populates the section +- **editors**: List agent roles allowed to modify the section +- **readonly**: Mark sections that cannot be modified after creation -**When you see:** `[[LLM: Draft X and immediately execute .bmad-core/tasks/advanced-elicitation.md]]` +**For sections with restricted access:** -- Draft the content -- Present it to user -- IMMEDIATELY execute the task -- Wait for completion before continuing +- Include a note in the generated document indicating the responsible agent +- Example: "_(This section is owned by dev-agent and can only be modified by dev-agent)_" -**When you see:** `[[LLM: After section completion, apply .bmad-core/tasks/Y.md]]` +## YOLO Mode -- Finish the section -- STOP and execute the task -- Wait for user input +User can type `#yolo` to toggle to YOLO mode (process all sections at once). -### 5. Validation & Final Presentation +## CRITICAL REMINDERS -- Run any specified checklists -- Present clean, formatted content only -- No truncation or summarization -- Begin directly with content (no preamble) -- Include any handoff prompts from template +**❌ NEVER:** -### 6. Update Workflow Plan (if applicable) +- Ask yes/no questions for elicitation +- Use any format other than 1-9 numbered options +- Create new elicitation methods -[[LLM: After successful document creation]] +**✅ ALWAYS:** -- If plan tracking is enabled and document was part of plan: - - Call update-workflow-plan task to mark step complete - - Parameters: task: create-doc, step_id: {from plan}, status: complete - - Show next recommended step from plan - -## Common Mistakes to Avoid - -❌ Skipping elicitation tasks -❌ Showing template markup to users -❌ Continuing past STOP signals -❌ Combining multiple review points - -✅ Execute ALL instructions in sequence -✅ Present only clean, formatted content -✅ Stop at every elicitation point -✅ Wait for user confirmation when instructed - -## Remember - -Templates contain precise instructions for a reason. Follow them exactly to ensure document quality and completeness. +- Use exact 1-9 format when elicit: true +- Select options 2-9 from data/elicitation-methods only +- Provide detailed rationale explaining decisions +- End with "Select 1-9 or just type your question/feedback:" ==================== END: .bmad-core/tasks/create-doc.md ==================== ==================== START: .bmad-core/tasks/create-workflow-plan.md ==================== @@ -2312,6 +2273,143 @@ Use the **expansion-creator** pack to build your own: - **Contributing**: See `CONTRIBUTING.md` for full guidelines ==================== END: .bmad-core/data/bmad-kb.md ==================== +==================== START: .bmad-core/data/elicitation-methods.md ==================== +# Elicitation Methods Data + +## Core Reflective Methods + +**Expand or Contract for Audience** +- Ask whether to 'expand' (add detail, elaborate) or 'contract' (simplify, clarify) +- Identify specific target audience if relevant +- Tailor content complexity and depth accordingly + +**Explain Reasoning (CoT Step-by-Step)** +- Walk through the step-by-step thinking process +- Reveal underlying assumptions and decision points +- Show how conclusions were reached from current role's perspective + +**Critique and Refine** +- Review output for flaws, inconsistencies, or improvement areas +- Identify specific weaknesses from role's expertise +- Suggest refined version reflecting domain knowledge + +## Structural Analysis Methods + +**Analyze Logical Flow and Dependencies** +- Examine content structure for logical progression +- Check internal consistency and coherence +- Identify and validate dependencies between elements +- Confirm effective ordering and sequencing + +**Assess Alignment with Overall Goals** +- Evaluate content contribution to stated objectives +- Identify any misalignments or gaps +- Interpret alignment from specific role's perspective +- Suggest adjustments to better serve goals + +## Risk and Challenge Methods + +**Identify Potential Risks and Unforeseen Issues** +- Brainstorm potential risks from role's expertise +- Identify overlooked edge cases or scenarios +- Anticipate unintended consequences +- Highlight implementation challenges + +**Challenge from Critical Perspective** +- Adopt critical stance on current content +- Play devil's advocate from specified viewpoint +- Argue against proposal highlighting weaknesses +- Apply YAGNI principles when appropriate (scope trimming) + +## Creative Exploration Methods + +**Tree of Thoughts Deep Dive** +- Break problem into discrete "thoughts" or intermediate steps +- Explore multiple reasoning paths simultaneously +- Use self-evaluation to classify each path as "sure", "likely", or "impossible" +- Apply search algorithms (BFS/DFS) to find optimal solution paths + +**Hindsight is 20/20: The 'If Only...' Reflection** +- Imagine retrospective scenario based on current content +- Identify the one "if only we had known/done X..." insight +- Describe imagined consequences humorously or dramatically +- Extract actionable learnings for current context + +## Multi-Persona Collaboration Methods + +**Agile Team Perspective Shift** +- Rotate through different Scrum team member viewpoints +- Product Owner: Focus on user value and business impact +- Scrum Master: Examine process flow and team dynamics +- Developer: Assess technical implementation and complexity +- QA: Identify testing scenarios and quality concerns + +**Stakeholder Round Table** +- Convene virtual meeting with multiple personas +- Each persona contributes unique perspective on content +- Identify conflicts and synergies between viewpoints +- Synthesize insights into actionable recommendations + +**Meta-Prompting Analysis** +- Step back to analyze the structure and logic of current approach +- Question the format and methodology being used +- Suggest alternative frameworks or mental models +- Optimize the elicitation process itself + +## Advanced 2025 Techniques + +**Self-Consistency Validation** +- Generate multiple reasoning paths for same problem +- Compare consistency across different approaches +- Identify most reliable and robust solution +- Highlight areas where approaches diverge and why + +**ReWOO (Reasoning Without Observation)** +- Separate parametric reasoning from tool-based actions +- Create reasoning plan without external dependencies +- Identify what can be solved through pure reasoning +- Optimize for efficiency and reduced token usage + +**Persona-Pattern Hybrid** +- Combine specific role expertise with elicitation pattern +- Architect + Risk Analysis: Deep technical risk assessment +- UX Expert + User Journey: End-to-end experience critique +- PM + Stakeholder Analysis: Multi-perspective impact review + +**Emergent Collaboration Discovery** +- Allow multiple perspectives to naturally emerge +- Identify unexpected insights from persona interactions +- Explore novel combinations of viewpoints +- Capture serendipitous discoveries from multi-agent thinking + +## Game-Based Elicitation Methods + +**Red Team vs Blue Team** +- Red Team: Attack the proposal, find vulnerabilities +- Blue Team: Defend and strengthen the approach +- Competitive analysis reveals blind spots +- Results in more robust, battle-tested solutions + +**Innovation Tournament** +- Pit multiple alternative approaches against each other +- Score each approach across different criteria +- Crowd-source evaluation from different personas +- Identify winning combination of features + +**Escape Room Challenge** +- Present content as constraints to work within +- Find creative solutions within tight limitations +- Identify minimum viable approach +- Discover innovative workarounds and optimizations + +## Process Control + +**Proceed / No Further Actions** +- Acknowledge choice to finalize current work +- Accept output as-is or move to next step +- Prepare to continue without additional elicitation +==================== END: .bmad-core/data/elicitation-methods.md ==================== + ==================== START: .bmad-core/utils/plan-management.md ==================== # Plan Management Utility @@ -3398,952 +3496,939 @@ Apply the advanced elicitation task after major sections to refine based on user - The goal is PRACTICAL documentation for AI agents doing real work ==================== END: .bmad-core/tasks/document-project.md ==================== -==================== START: .bmad-core/templates/project-brief-tmpl.md ==================== ---- -defaultOutput: docs/brief.md ---- - -# Project Brief: {{Project Name}} - -[[LLM: This template guides creation of a comprehensive Project Brief that serves as the foundational input for product development. - -Start by asking the user which mode they prefer: - -1. **Interactive Mode** - Work through each section collaboratively -2. **YOLO Mode** - Generate complete draft for review and refinement - -Before beginning, understand what inputs are available (brainstorming results, market research, competitive analysis, initial ideas) and gather project context.]] - -## Executive Summary - -[[LLM: Create a concise overview that captures the essence of the project. Include: - -- Product concept in 1-2 sentences -- Primary problem being solved -- Target market identification -- Key value proposition]] - -{{Write executive summary based on information gathered}} - -## Problem Statement - -[[LLM: Articulate the problem with clarity and evidence. Address: - -- Current state and pain points -- Impact of the problem (quantify if possible) -- Why existing solutions fall short -- Urgency and importance of solving this now]] - -{{Detailed problem description with supporting evidence}} - -## Proposed Solution - -[[LLM: Describe the solution approach at a high level. Include: - -- Core concept and approach -- Key differentiators from existing solutions -- Why this solution will succeed where others haven't -- High-level vision for the product]] - -{{Solution description focusing on the "what" and "why", not implementation details}} - -## Target Users - -[[LLM: Define and characterize the intended users with specificity. For each user segment include: - -- Demographic/firmographic profile -- Current behaviors and workflows -- Specific needs and pain points -- Goals they're trying to achieve]] - -### Primary User Segment: {{Segment Name}} - -{{Detailed description of primary users}} - -### Secondary User Segment: {{Segment Name}} - -{{Description of secondary users if applicable}} - -## Goals & Success Metrics - -[[LLM: Establish clear objectives and how to measure success. Make goals SMART (Specific, Measurable, Achievable, Relevant, Time-bound)]] - -### Business Objectives - -- {{Objective 1 with metric}} -- {{Objective 2 with metric}} -- {{Objective 3 with metric}} - -### User Success Metrics - -- {{How users will measure value}} -- {{Engagement metrics}} -- {{Satisfaction indicators}} - -### Key Performance Indicators (KPIs) - -- {{KPI 1: Definition and target}} -- {{KPI 2: Definition and target}} -- {{KPI 3: Definition and target}} - -## MVP Scope - -[[LLM: Define the minimum viable product clearly. Be specific about what's in and what's out. Help user distinguish must-haves from nice-to-haves.]] - -### Core Features (Must Have) - -- **Feature 1:** {{Brief description and why it's essential}} -- **Feature 2:** {{Brief description and why it's essential}} -- **Feature 3:** {{Brief description and why it's essential}} - -### Out of Scope for MVP - -- {{Feature/capability explicitly not in MVP}} -- {{Feature/capability to be considered post-MVP}} - -### MVP Success Criteria - -{{Define what constitutes a successful MVP launch}} - -## Post-MVP Vision - -[[LLM: Outline the longer-term product direction without overcommitting to specifics]] - -### Phase 2 Features - -{{Next priority features after MVP success}} - -### Long-term Vision - -{{Where this product could go in 1-2 years}} - -### Expansion Opportunities - -{{Potential new markets, use cases, or integrations}} - -## Technical Considerations - -[[LLM: Document known technical constraints and preferences. Note these are initial thoughts, not final decisions.]] - -### Platform Requirements - -- **Target Platforms:** {{Web, mobile, desktop, etc.}} -- **Browser/OS Support:** {{Specific requirements}} -- **Performance Requirements:** {{Load times, concurrent users, etc.}} - -### Technology Preferences - -- **Frontend:** {{If any preferences exist}} -- **Backend:** {{If any preferences exist}} -- **Database:** {{If any preferences exist}} -- **Hosting/Infrastructure:** {{Cloud preferences, on-prem requirements}} - -### Architecture Considerations - -- **Repository Structure:** {{Initial thoughts on monorepo vs. polyrepo}} -- **Service Architecture:** {{Initial thoughts on monolith vs. microservices}} -- **Integration Requirements:** {{Third-party services, APIs}} -- **Security/Compliance:** {{Any specific requirements}} - -## Constraints & Assumptions - -[[LLM: Clearly state limitations and assumptions to set realistic expectations]] - -### Constraints - -- **Budget:** {{If known}} -- **Timeline:** {{Target launch date or development timeframe}} -- **Resources:** {{Team size, skill constraints}} -- **Technical:** {{Legacy systems, required tech stack}} - -### Key Assumptions - -- {{Assumption about users, market, or technology}} -- {{Assumption about resources or support}} -- {{Assumption about external dependencies}} - -## Risks & Open Questions - -[[LLM: Identify unknowns and potential challenges proactively]] - -### Key Risks - -- **Risk 1:** {{Description and potential impact}} -- **Risk 2:** {{Description and potential impact}} -- **Risk 3:** {{Description and potential impact}} - -### Open Questions - -- {{Question needing research or decision}} -- {{Question about technical approach}} -- {{Question about market or users}} - -### Areas Needing Further Research - -- {{Topic requiring deeper investigation}} -- {{Validation needed before proceeding}} - -## Appendices - -### A. Research Summary - -{{If applicable, summarize key findings from: - -- Market research -- Competitive analysis -- User interviews -- Technical feasibility studies}} - -### B. Stakeholder Input - -{{Key feedback or requirements from stakeholders}} - -### C. References - -{{Links to relevant documents, research, or examples}} - -## Next Steps - -### Immediate Actions - -1. {{First concrete next step}} -2. {{Second concrete next step}} -3. {{Third concrete next step}} - -### PM Handoff - -This Project Brief provides the full context for {{Project Name}}. Please start in 'PRD Generation Mode', review the brief thoroughly to work with the user to create the PRD section by section as the template indicates, asking for any necessary clarification or suggesting improvements. - ---- - -[[LLM: After completing each major section (not subsections), offer advanced elicitation with these custom options for project briefs: - -**Project Brief Elicitation Actions** 0. Expand section with more specific details - -1. Validate against similar successful products -2. Stress test assumptions with edge cases -3. Explore alternative solution approaches -4. Analyze resource/constraint trade-offs -5. Generate risk mitigation strategies -6. Challenge scope from MVP minimalist view -7. Brainstorm creative feature possibilities -8. If only we had [resource/capability/time]... -9. Proceed to next section - -These replace the standard elicitation options when working on project brief documents.]] -==================== END: .bmad-core/templates/project-brief-tmpl.md ==================== - -==================== START: .bmad-core/templates/market-research-tmpl.md ==================== -# Market Research Report: {{Project/Product Name}} - -[[LLM: The default path and filename unless specified is docs/market-research.md]] - -[[LLM: This template guides the creation of a comprehensive market research report. Begin by understanding what market insights the user needs and why. Work through each section systematically, using the appropriate analytical frameworks based on the research objectives.]] - -## Executive Summary - -{{Provide a high-level overview of key findings, market opportunity assessment, and strategic recommendations. Write this section LAST after completing all other sections.}} - -## Research Objectives & Methodology - -### Research Objectives - -{{List the primary objectives of this market research: - -- What decisions will this research inform? -- What specific questions need to be answered? -- What are the success criteria for this research?}} - -### Research Methodology - -{{Describe the research approach: - -- Data sources used (primary/secondary) -- Analysis frameworks applied -- Data collection timeframe -- Limitations and assumptions}} - -## Market Overview - -### Market Definition - -{{Define the market being analyzed: - -- Product/service category -- Geographic scope -- Customer segments included -- Value chain position}} - -### Market Size & Growth - -[[LLM: Guide through TAM, SAM, SOM calculations with clear assumptions. Use one or more approaches: - -- Top-down: Start with industry data, narrow down -- Bottom-up: Build from customer/unit economics -- Value theory: Based on value provided vs. alternatives]] - -#### Total Addressable Market (TAM) - -{{Calculate and explain the total market opportunity}} - -#### Serviceable Addressable Market (SAM) - -{{Define the portion of TAM you can realistically reach}} - -#### Serviceable Obtainable Market (SOM) - -{{Estimate the portion you can realistically capture}} - -### Market Trends & Drivers - -[[LLM: Analyze key trends shaping the market using appropriate frameworks like PESTEL]] - -#### Key Market Trends - -{{List and explain 3-5 major trends: - -- Trend 1: Description and impact -- Trend 2: Description and impact -- etc.}} - -#### Growth Drivers - -{{Identify primary factors driving market growth}} - -#### Market Inhibitors - -{{Identify factors constraining market growth}} - -## Customer Analysis - -### Target Segment Profiles - -[[LLM: For each segment, create detailed profiles including demographics/firmographics, psychographics, behaviors, needs, and willingness to pay]] - -#### Segment 1: {{Segment Name}} - -- **Description:** {{Brief overview}} -- **Size:** {{Number of customers/market value}} -- **Characteristics:** {{Key demographics/firmographics}} -- **Needs & Pain Points:** {{Primary problems they face}} -- **Buying Process:** {{How they make purchasing decisions}} -- **Willingness to Pay:** {{Price sensitivity and value perception}} - -<> - -### Jobs-to-be-Done Analysis - -[[LLM: Uncover what customers are really trying to accomplish]] - -#### Functional Jobs - -{{List practical tasks and objectives customers need to complete}} - -#### Emotional Jobs - -{{Describe feelings and perceptions customers seek}} - -#### Social Jobs - -{{Explain how customers want to be perceived by others}} - -### Customer Journey Mapping - -[[LLM: Map the end-to-end customer experience for primary segments]] - -{{For primary customer segment: - -1. **Awareness:** How they discover solutions -2. **Consideration:** Evaluation criteria and process -3. **Purchase:** Decision triggers and barriers -4. **Onboarding:** Initial experience expectations -5. **Usage:** Ongoing interaction patterns -6. **Advocacy:** Referral and expansion behaviors}} - -## Competitive Landscape - -### Market Structure - -{{Describe the overall competitive environment: - -- Number of competitors -- Market concentration -- Competitive intensity}} - -### Major Players Analysis - -{{For top 3-5 competitors: - -- Company name and brief description -- Market share estimate -- Key strengths and weaknesses -- Target customer focus -- Pricing strategy}} - -### Competitive Positioning - -{{Analyze how competitors are positioned: - -- Value propositions -- Differentiation strategies -- Market gaps and opportunities}} - -## Industry Analysis - -### Porter's Five Forces Assessment - -[[LLM: Analyze each force with specific evidence and implications]] - -#### Supplier Power: {{Low/Medium/High}} - -{{Analysis and implications}} - -#### Buyer Power: {{Low/Medium/High}} - -{{Analysis and implications}} - -#### Competitive Rivalry: {{Low/Medium/High}} - -{{Analysis and implications}} - -#### Threat of New Entry: {{Low/Medium/High}} - -{{Analysis and implications}} - -#### Threat of Substitutes: {{Low/Medium/High}} - -{{Analysis and implications}} - -### Technology Adoption Lifecycle Stage - -{{Identify where the market is in the adoption curve: - -- Current stage and evidence -- Implications for strategy -- Expected progression timeline}} - -## Opportunity Assessment - -### Market Opportunities - -[[LLM: Identify specific opportunities based on the analysis]] - -#### Opportunity 1: {{Name}} - -- **Description:** {{What is the opportunity?}} -- **Size/Potential:** {{Quantify if possible}} -- **Requirements:** {{What's needed to capture it?}} -- **Risks:** {{Key challenges or barriers}} - -<> - -### Strategic Recommendations - -#### Go-to-Market Strategy - -{{Recommend approach for market entry/expansion: - -- Target segment prioritization -- Positioning strategy -- Channel strategy -- Partnership opportunities}} - -#### Pricing Strategy - -{{Based on willingness to pay analysis and competitive landscape: - -- Recommended pricing model -- Price points/ranges -- Value metric -- Competitive positioning}} - -#### Risk Mitigation - -{{Key risks and mitigation strategies: - -- Market risks -- Competitive risks -- Execution risks -- Regulatory/compliance risks}} - -## Appendices - -### A. Data Sources - -{{List all sources used in the research}} - -### B. Detailed Calculations - -{{Include any complex calculations or models}} - -### C. Additional Analysis - -{{Any supplementary analysis not included in main body}} - ---- - -[[LLM: After completing the document, offer advanced elicitation with these custom options for market research: - -**Market Research Elicitation Actions** 0. Expand market sizing calculations with sensitivity analysis - -1. Deep dive into a specific customer segment -2. Analyze an emerging market trend in detail -3. Compare this market to an analogous market -4. Stress test market assumptions -5. Explore adjacent market opportunities -6. Challenge market definition and boundaries -7. Generate strategic scenarios (best/base/worst case) -8. If only we had considered [X market factor]... -9. Proceed to next section - -These replace the standard elicitation options when working on market research documents.]] -==================== END: .bmad-core/templates/market-research-tmpl.md ==================== - -==================== START: .bmad-core/templates/competitor-analysis-tmpl.md ==================== -# Competitive Analysis Report: {{Project/Product Name}} - -[[LLM: The default path and filename unless specified is docs/competitor-analysis.md]] - -[[LLM: This template guides comprehensive competitor analysis. Start by understanding the user's competitive intelligence needs and strategic objectives. Help them identify and prioritize competitors before diving into detailed analysis.]] - -## Executive Summary - -{{Provide high-level competitive insights, main threats and opportunities, and recommended strategic actions. Write this section LAST after completing all analysis.}} - -## Analysis Scope & Methodology - -### Analysis Purpose - -{{Define the primary purpose: - -- New market entry assessment -- Product positioning strategy -- Feature gap analysis -- Pricing strategy development -- Partnership/acquisition targets -- Competitive threat assessment}} - -### Competitor Categories Analyzed - -{{List categories included: - -- Direct Competitors: Same product/service, same target market -- Indirect Competitors: Different product, same need/problem -- Potential Competitors: Could enter market easily -- Substitute Products: Alternative solutions -- Aspirational Competitors: Best-in-class examples}} - -### Research Methodology - -{{Describe approach: - -- Information sources used -- Analysis timeframe -- Confidence levels -- Limitations}} - -## Competitive Landscape Overview - -### Market Structure - -{{Describe the competitive environment: - -- Number of active competitors -- Market concentration (fragmented/consolidated) -- Competitive dynamics -- Recent market entries/exits}} - -### Competitor Prioritization Matrix - -[[LLM: Help categorize competitors by market share and strategic threat level]] - -{{Create a 2x2 matrix: - -- Priority 1 (Core Competitors): High Market Share + High Threat -- Priority 2 (Emerging Threats): Low Market Share + High Threat -- Priority 3 (Established Players): High Market Share + Low Threat -- Priority 4 (Monitor Only): Low Market Share + Low Threat}} - -## Individual Competitor Profiles - -[[LLM: Create detailed profiles for each Priority 1 and Priority 2 competitor. For Priority 3 and 4, create condensed profiles.]] - -### {{Competitor Name}} - Priority {{1/2/3/4}} - -#### Company Overview - -- **Founded:** {{Year, founders}} -- **Headquarters:** {{Location}} -- **Company Size:** {{Employees, revenue if known}} -- **Funding:** {{Total raised, key investors}} -- **Leadership:** {{Key executives}} - -#### Business Model & Strategy - -- **Revenue Model:** {{How they make money}} -- **Target Market:** {{Primary customer segments}} -- **Value Proposition:** {{Core value promise}} -- **Go-to-Market Strategy:** {{Sales and marketing approach}} -- **Strategic Focus:** {{Current priorities}} - -#### Product/Service Analysis - -- **Core Offerings:** {{Main products/services}} -- **Key Features:** {{Standout capabilities}} -- **User Experience:** {{UX strengths/weaknesses}} -- **Technology Stack:** {{If relevant/known}} -- **Pricing:** {{Model and price points}} - -#### Strengths & Weaknesses - -**Strengths:** - -- {{Strength 1}} -- {{Strength 2}} -- {{Strength 3}} - -**Weaknesses:** - -- {{Weakness 1}} -- {{Weakness 2}} -- {{Weakness 3}} - -#### Market Position & Performance - -- **Market Share:** {{Estimate if available}} -- **Customer Base:** {{Size, notable clients}} -- **Growth Trajectory:** {{Trending up/down/stable}} -- **Recent Developments:** {{Key news, releases}} - -<> - -## Comparative Analysis - -### Feature Comparison Matrix - -[[LLM: Create a detailed comparison table of key features across competitors]] - -| Feature Category | {{Your Company}} | {{Competitor 1}} | {{Competitor 2}} | {{Competitor 3}} | -| --------------------------- | ------------------- | ------------------- | ------------------- | ------------------- | -| **Core Functionality** | -| Feature A | {{✓/✗/Partial}} | {{✓/✗/Partial}} | {{✓/✗/Partial}} | {{✓/✗/Partial}} | -| Feature B | {{✓/✗/Partial}} | {{✓/✗/Partial}} | {{✓/✗/Partial}} | {{✓/✗/Partial}} | -| **User Experience** | -| Mobile App | {{Rating/Status}} | {{Rating/Status}} | {{Rating/Status}} | {{Rating/Status}} | -| Onboarding Time | {{Time}} | {{Time}} | {{Time}} | {{Time}} | -| **Integration & Ecosystem** | -| API Availability | {{Yes/No/Limited}} | {{Yes/No/Limited}} | {{Yes/No/Limited}} | {{Yes/No/Limited}} | -| Third-party Integrations | {{Number/Key ones}} | {{Number/Key ones}} | {{Number/Key ones}} | {{Number/Key ones}} | -| **Pricing & Plans** | -| Starting Price | {{$X}} | {{$X}} | {{$X}} | {{$X}} | -| Free Tier | {{Yes/No}} | {{Yes/No}} | {{Yes/No}} | {{Yes/No}} | - -### SWOT Comparison - -[[LLM: Create SWOT analysis for your solution vs. top competitors]] - -#### Your Solution - -- **Strengths:** {{List key strengths}} -- **Weaknesses:** {{List key weaknesses}} -- **Opportunities:** {{List opportunities}} -- **Threats:** {{List threats}} - -#### vs. {{Main Competitor}} - -- **Competitive Advantages:** {{Where you're stronger}} -- **Competitive Disadvantages:** {{Where they're stronger}} -- **Differentiation Opportunities:** {{How to stand out}} - -### Positioning Map - -[[LLM: Describe competitor positions on key dimensions]] - -{{Create a positioning description using 2 key dimensions relevant to the market, such as: - -- Price vs. Features -- Ease of Use vs. Power -- Specialization vs. Breadth -- Self-Serve vs. High-Touch}} - -## Strategic Analysis - -### Competitive Advantages Assessment - -#### Sustainable Advantages - -{{Identify moats and defensible positions: - -- Network effects -- Switching costs -- Brand strength -- Technology barriers -- Regulatory advantages}} - -#### Vulnerable Points - -{{Where competitors could be challenged: - -- Weak customer segments -- Missing features -- Poor user experience -- High prices -- Limited geographic presence}} - -### Blue Ocean Opportunities - -[[LLM: Identify uncontested market spaces]] - -{{List opportunities to create new market space: - -- Underserved segments -- Unaddressed use cases -- New business models -- Geographic expansion -- Different value propositions}} - -## Strategic Recommendations - -### Differentiation Strategy - -{{How to position against competitors: - -- Unique value propositions to emphasize -- Features to prioritize -- Segments to target -- Messaging and positioning}} - -### Competitive Response Planning - -#### Offensive Strategies - -{{How to gain market share: - -- Target competitor weaknesses -- Win competitive deals -- Capture their customers}} - -#### Defensive Strategies - -{{How to protect your position: - -- Strengthen vulnerable areas -- Build switching costs -- Deepen customer relationships}} - -### Partnership & Ecosystem Strategy - -{{Potential collaboration opportunities: - -- Complementary players -- Channel partners -- Technology integrations -- Strategic alliances}} - -## Monitoring & Intelligence Plan - -### Key Competitors to Track - -{{Priority list with rationale}} - -### Monitoring Metrics - -{{What to track: - -- Product updates -- Pricing changes -- Customer wins/losses -- Funding/M&A activity -- Market messaging}} - -### Intelligence Sources - -{{Where to gather ongoing intelligence: - -- Company websites/blogs -- Customer reviews -- Industry reports -- Social media -- Patent filings}} - -### Update Cadence - -{{Recommended review schedule: - -- Weekly: {{What to check}} -- Monthly: {{What to review}} -- Quarterly: {{Deep analysis}}}} - ---- - -[[LLM: After completing the document, offer advanced elicitation with these custom options for competitive analysis: - -**Competitive Analysis Elicitation Actions** 0. Deep dive on a specific competitor's strategy - -1. Analyze competitive dynamics in a specific segment -2. War game competitive responses to your moves -3. Explore partnership vs. competition scenarios -4. Stress test differentiation claims -5. Analyze disruption potential (yours or theirs) -6. Compare to competition in adjacent markets -7. Generate win/loss analysis insights -8. If only we had known about [competitor X's plan]... -9. Proceed to next section - -These replace the standard elicitation options when working on competitive analysis documents.]] -==================== END: .bmad-core/templates/competitor-analysis-tmpl.md ==================== - -==================== START: .bmad-core/templates/brainstorming-output-tmpl.md ==================== ---- -defaultOutput: docs/brainstorming-session-results.md ---- - -# Brainstorming Session Results - -**Session Date:** [DATE] -**Facilitator:** [Agent Role] [Agent Name] -**Participant:** [USER NAME] - -## Executive Summary - -**Topic:** [SESSION TOPIC] - -**Session Goals:** [STATED GOALS] - -**Techniques Used:** [LIST OF TECHNIQUES AND DURATION] - -**Total Ideas Generated:** [NUMBER] - -**Key Themes Identified:** - -- [THEME 1] -- [THEME 2] -- [THEME 3] - ---- - -## Technique Sessions - -### [TECHNIQUE NAME 1] - [DURATION] - -**Description:** [BRIEF DESCRIPTION OF TECHNIQUE] - -**Ideas Generated:** - -1. [USER IDEA 1] -2. [USER IDEA 2] -3. [USER IDEA 3] -[etc.] - -**Insights Discovered:** - -- [INSIGHT 1] -- [INSIGHT 2] - -**Notable Connections:** - -- [CONNECTION OR PATTERN IDENTIFIED] - ---- - -### [TECHNIQUE NAME 2] - [DURATION] - -[Repeat format for each technique used] - ---- - -## Idea Categorization - -### Immediate Opportunities - -*Ideas ready to implement now* - -1. **[IDEA NAME]** - - Description: [BRIEF DESCRIPTION] - - Why immediate: [RATIONALE] - - Resources needed: [BASIC REQUIREMENTS] - -### Future Innovations - -*Ideas requiring development/research* - -1. **[IDEA NAME]** - - Description: [BRIEF DESCRIPTION] - - Development needed: [WHAT'S REQUIRED] - - Timeline estimate: [ROUGH TIMEFRAME] - -### Moonshots - -*Ambitious, transformative concepts* - -1. **[IDEA NAME]** - - Description: [BRIEF DESCRIPTION] - - Transformative potential: [WHY IT'S A MOONSHOT] - - Challenges to overcome: [MAJOR OBSTACLES] - -### Insights & Learnings - -*Key realizations from the session* - -- [INSIGHT 1]: [DESCRIPTION AND IMPLICATIONS] -- [INSIGHT 2]: [DESCRIPTION AND IMPLICATIONS] - ---- - -## Action Planning - -### Top 3 Priority Ideas - -**#1 Priority: [IDEA NAME]** - -- Rationale: [WHY THIS IS TOP PRIORITY] -- Next steps: [SPECIFIC ACTIONS TO TAKE] -- Resources needed: [WHAT'S REQUIRED] -- Timeline: [WHEN TO START/COMPLETE] - -**#2 Priority: [IDEA NAME]** - -- [Same format] - -**#3 Priority: [IDEA NAME]** - -- [Same format] - ---- - -## Reflection & Follow-up - -### What Worked Well - -- [SUCCESSFUL ASPECT 1] -- [SUCCESSFUL ASPECT 2] - -### Areas for Further Exploration - -- [AREA 1]: [WHY IT NEEDS MORE EXPLORATION] -- [AREA 2]: [WHY IT NEEDS MORE EXPLORATION] - -### Recommended Follow-up Techniques - -- [TECHNIQUE 1]: [WHY IT WOULD BE HELPFUL] -- [TECHNIQUE 2]: [WHY IT WOULD BE HELPFUL] - -### Questions That Emerged - -- [QUESTION 1] -- [QUESTION 2] -- [QUESTION 3] - -### Next Session Planning - -- **Suggested topics:** [FOLLOW-UP TOPICS] -- **Recommended timeframe:** [WHEN TO RECONVENE] -- **Preparation needed:** [WHAT TO RESEARCH/PREPARE] - ---- - -*Session facilitated using the BMAD-METHOD brainstorming framework* -==================== END: .bmad-core/templates/brainstorming-output-tmpl.md ==================== +==================== START: .bmad-core/templates/project-brief-tmpl.yaml ==================== +template: + id: project-brief-template-v2 + name: Project Brief + version: 2.0 + output: + format: markdown + filename: docs/brief.md + title: "Project Brief: {{project_name}}" + +workflow: + mode: interactive + elicitation: advanced-elicitation + custom_elicitation: + title: "Project Brief Elicitation Actions" + options: + - "Expand section with more specific details" + - "Validate against similar successful products" + - "Stress test assumptions with edge cases" + - "Explore alternative solution approaches" + - "Analyze resource/constraint trade-offs" + - "Generate risk mitigation strategies" + - "Challenge scope from MVP minimalist view" + - "Brainstorm creative feature possibilities" + - "If only we had [resource/capability/time]..." + - "Proceed to next section" + +sections: + - id: introduction + instruction: | + This template guides creation of a comprehensive Project Brief that serves as the foundational input for product development. + + Start by asking the user which mode they prefer: + + 1. **Interactive Mode** - Work through each section collaboratively + 2. **YOLO Mode** - Generate complete draft for review and refinement + + Before beginning, understand what inputs are available (brainstorming results, market research, competitive analysis, initial ideas) and gather project context. + + - id: executive-summary + title: Executive Summary + instruction: | + Create a concise overview that captures the essence of the project. Include: + - Product concept in 1-2 sentences + - Primary problem being solved + - Target market identification + - Key value proposition + template: "{{executive_summary_content}}" + + - id: problem-statement + title: Problem Statement + instruction: | + Articulate the problem with clarity and evidence. Address: + - Current state and pain points + - Impact of the problem (quantify if possible) + - Why existing solutions fall short + - Urgency and importance of solving this now + template: "{{detailed_problem_description}}" + + - id: proposed-solution + title: Proposed Solution + instruction: | + Describe the solution approach at a high level. Include: + - Core concept and approach + - Key differentiators from existing solutions + - Why this solution will succeed where others haven't + - High-level vision for the product + template: "{{solution_description}}" + + - id: target-users + title: Target Users + instruction: | + Define and characterize the intended users with specificity. For each user segment include: + - Demographic/firmographic profile + - Current behaviors and workflows + - Specific needs and pain points + - Goals they're trying to achieve + sections: + - id: primary-segment + title: "Primary User Segment: {{segment_name}}" + template: "{{primary_user_description}}" + - id: secondary-segment + title: "Secondary User Segment: {{segment_name}}" + condition: Has secondary user segment + template: "{{secondary_user_description}}" + + - id: goals-metrics + title: Goals & Success Metrics + instruction: Establish clear objectives and how to measure success. Make goals SMART (Specific, Measurable, Achievable, Relevant, Time-bound) + sections: + - id: business-objectives + title: Business Objectives + type: bullet-list + template: "- {{objective_with_metric}}" + - id: user-success-metrics + title: User Success Metrics + type: bullet-list + template: "- {{user_metric}}" + - id: kpis + title: Key Performance Indicators (KPIs) + type: bullet-list + template: "- {{kpi}}: {{definition_and_target}}" + + - id: mvp-scope + title: MVP Scope + instruction: Define the minimum viable product clearly. Be specific about what's in and what's out. Help user distinguish must-haves from nice-to-haves. + sections: + - id: core-features + title: Core Features (Must Have) + type: bullet-list + template: "- **{{feature}}:** {{description_and_rationale}}" + - id: out-of-scope + title: Out of Scope for MVP + type: bullet-list + template: "- {{feature_or_capability}}" + - id: mvp-success-criteria + title: MVP Success Criteria + template: "{{mvp_success_definition}}" + + - id: post-mvp-vision + title: Post-MVP Vision + instruction: Outline the longer-term product direction without overcommitting to specifics + sections: + - id: phase-2-features + title: Phase 2 Features + template: "{{next_priority_features}}" + - id: long-term-vision + title: Long-term Vision + template: "{{one_two_year_vision}}" + - id: expansion-opportunities + title: Expansion Opportunities + template: "{{potential_expansions}}" + + - id: technical-considerations + title: Technical Considerations + instruction: Document known technical constraints and preferences. Note these are initial thoughts, not final decisions. + sections: + - id: platform-requirements + title: Platform Requirements + template: | + - **Target Platforms:** {{platforms}} + - **Browser/OS Support:** {{specific_requirements}} + - **Performance Requirements:** {{performance_specs}} + - id: technology-preferences + title: Technology Preferences + template: | + - **Frontend:** {{frontend_preferences}} + - **Backend:** {{backend_preferences}} + - **Database:** {{database_preferences}} + - **Hosting/Infrastructure:** {{infrastructure_preferences}} + - id: architecture-considerations + title: Architecture Considerations + template: | + - **Repository Structure:** {{repo_thoughts}} + - **Service Architecture:** {{service_thoughts}} + - **Integration Requirements:** {{integration_needs}} + - **Security/Compliance:** {{security_requirements}} + + - id: constraints-assumptions + title: Constraints & Assumptions + instruction: Clearly state limitations and assumptions to set realistic expectations + sections: + - id: constraints + title: Constraints + template: | + - **Budget:** {{budget_info}} + - **Timeline:** {{timeline_info}} + - **Resources:** {{resource_info}} + - **Technical:** {{technical_constraints}} + - id: key-assumptions + title: Key Assumptions + type: bullet-list + template: "- {{assumption}}" + + - id: risks-questions + title: Risks & Open Questions + instruction: Identify unknowns and potential challenges proactively + sections: + - id: key-risks + title: Key Risks + type: bullet-list + template: "- **{{risk}}:** {{description_and_impact}}" + - id: open-questions + title: Open Questions + type: bullet-list + template: "- {{question}}" + - id: research-areas + title: Areas Needing Further Research + type: bullet-list + template: "- {{research_topic}}" + + - id: appendices + title: Appendices + sections: + - id: research-summary + title: A. Research Summary + condition: Has research findings + instruction: | + If applicable, summarize key findings from: + - Market research + - Competitive analysis + - User interviews + - Technical feasibility studies + - id: stakeholder-input + title: B. Stakeholder Input + condition: Has stakeholder feedback + template: "{{stakeholder_feedback}}" + - id: references + title: C. References + template: "{{relevant_links_and_docs}}" + + - id: next-steps + title: Next Steps + sections: + - id: immediate-actions + title: Immediate Actions + type: numbered-list + template: "{{action_item}}" + - id: pm-handoff + title: PM Handoff + content: | + This Project Brief provides the full context for {{project_name}}. Please start in 'PRD Generation Mode', review the brief thoroughly to work with the user to create the PRD section by section as the template indicates, asking for any necessary clarification or suggesting improvements. +==================== END: .bmad-core/templates/project-brief-tmpl.yaml ==================== + +==================== START: .bmad-core/templates/market-research-tmpl.yaml ==================== +template: + id: market-research-template-v2 + name: Market Research Report + version: 2.0 + output: + format: markdown + filename: docs/market-research.md + title: "Market Research Report: {{project_product_name}}" + +workflow: + mode: interactive + elicitation: advanced-elicitation + custom_elicitation: + title: "Market Research Elicitation Actions" + options: + - "Expand market sizing calculations with sensitivity analysis" + - "Deep dive into a specific customer segment" + - "Analyze an emerging market trend in detail" + - "Compare this market to an analogous market" + - "Stress test market assumptions" + - "Explore adjacent market opportunities" + - "Challenge market definition and boundaries" + - "Generate strategic scenarios (best/base/worst case)" + - "If only we had considered [X market factor]..." + - "Proceed to next section" + +sections: + - id: executive-summary + title: Executive Summary + instruction: Provide a high-level overview of key findings, market opportunity assessment, and strategic recommendations. Write this section LAST after completing all other sections. + + - id: research-objectives + title: Research Objectives & Methodology + instruction: This template guides the creation of a comprehensive market research report. Begin by understanding what market insights the user needs and why. Work through each section systematically, using the appropriate analytical frameworks based on the research objectives. + sections: + - id: objectives + title: Research Objectives + instruction: | + List the primary objectives of this market research: + - What decisions will this research inform? + - What specific questions need to be answered? + - What are the success criteria for this research? + - id: methodology + title: Research Methodology + instruction: | + Describe the research approach: + - Data sources used (primary/secondary) + - Analysis frameworks applied + - Data collection timeframe + - Limitations and assumptions + + - id: market-overview + title: Market Overview + sections: + - id: market-definition + title: Market Definition + instruction: | + Define the market being analyzed: + - Product/service category + - Geographic scope + - Customer segments included + - Value chain position + - id: market-size-growth + title: Market Size & Growth + instruction: | + Guide through TAM, SAM, SOM calculations with clear assumptions. Use one or more approaches: + - Top-down: Start with industry data, narrow down + - Bottom-up: Build from customer/unit economics + - Value theory: Based on value provided vs. alternatives + sections: + - id: tam + title: Total Addressable Market (TAM) + instruction: Calculate and explain the total market opportunity + - id: sam + title: Serviceable Addressable Market (SAM) + instruction: Define the portion of TAM you can realistically reach + - id: som + title: Serviceable Obtainable Market (SOM) + instruction: Estimate the portion you can realistically capture + - id: market-trends + title: Market Trends & Drivers + instruction: Analyze key trends shaping the market using appropriate frameworks like PESTEL + sections: + - id: key-trends + title: Key Market Trends + instruction: | + List and explain 3-5 major trends: + - Trend 1: Description and impact + - Trend 2: Description and impact + - etc. + - id: growth-drivers + title: Growth Drivers + instruction: Identify primary factors driving market growth + - id: market-inhibitors + title: Market Inhibitors + instruction: Identify factors constraining market growth + + - id: customer-analysis + title: Customer Analysis + sections: + - id: segment-profiles + title: Target Segment Profiles + instruction: For each segment, create detailed profiles including demographics/firmographics, psychographics, behaviors, needs, and willingness to pay + repeatable: true + sections: + - id: segment + title: "Segment {{segment_number}}: {{segment_name}}" + template: | + - **Description:** {{brief_overview}} + - **Size:** {{number_of_customers_market_value}} + - **Characteristics:** {{key_demographics_firmographics}} + - **Needs & Pain Points:** {{primary_problems}} + - **Buying Process:** {{purchasing_decisions}} + - **Willingness to Pay:** {{price_sensitivity}} + - id: jobs-to-be-done + title: Jobs-to-be-Done Analysis + instruction: Uncover what customers are really trying to accomplish + sections: + - id: functional-jobs + title: Functional Jobs + instruction: List practical tasks and objectives customers need to complete + - id: emotional-jobs + title: Emotional Jobs + instruction: Describe feelings and perceptions customers seek + - id: social-jobs + title: Social Jobs + instruction: Explain how customers want to be perceived by others + - id: customer-journey + title: Customer Journey Mapping + instruction: Map the end-to-end customer experience for primary segments + template: | + For primary customer segment: + + 1. **Awareness:** {{discovery_process}} + 2. **Consideration:** {{evaluation_criteria}} + 3. **Purchase:** {{decision_triggers}} + 4. **Onboarding:** {{initial_expectations}} + 5. **Usage:** {{interaction_patterns}} + 6. **Advocacy:** {{referral_behaviors}} + + - id: competitive-landscape + title: Competitive Landscape + sections: + - id: market-structure + title: Market Structure + instruction: | + Describe the overall competitive environment: + - Number of competitors + - Market concentration + - Competitive intensity + - id: major-players + title: Major Players Analysis + instruction: | + For top 3-5 competitors: + - Company name and brief description + - Market share estimate + - Key strengths and weaknesses + - Target customer focus + - Pricing strategy + - id: competitive-positioning + title: Competitive Positioning + instruction: | + Analyze how competitors are positioned: + - Value propositions + - Differentiation strategies + - Market gaps and opportunities + + - id: industry-analysis + title: Industry Analysis + sections: + - id: porters-five-forces + title: Porter's Five Forces Assessment + instruction: Analyze each force with specific evidence and implications + sections: + - id: supplier-power + title: "Supplier Power: {{power_level}}" + template: "{{analysis_and_implications}}" + - id: buyer-power + title: "Buyer Power: {{power_level}}" + template: "{{analysis_and_implications}}" + - id: competitive-rivalry + title: "Competitive Rivalry: {{intensity_level}}" + template: "{{analysis_and_implications}}" + - id: threat-new-entry + title: "Threat of New Entry: {{threat_level}}" + template: "{{analysis_and_implications}}" + - id: threat-substitutes + title: "Threat of Substitutes: {{threat_level}}" + template: "{{analysis_and_implications}}" + - id: adoption-lifecycle + title: Technology Adoption Lifecycle Stage + instruction: | + Identify where the market is in the adoption curve: + - Current stage and evidence + - Implications for strategy + - Expected progression timeline + + - id: opportunity-assessment + title: Opportunity Assessment + sections: + - id: market-opportunities + title: Market Opportunities + instruction: Identify specific opportunities based on the analysis + repeatable: true + sections: + - id: opportunity + title: "Opportunity {{opportunity_number}}: {{name}}" + template: | + - **Description:** {{what_is_the_opportunity}} + - **Size/Potential:** {{quantified_potential}} + - **Requirements:** {{needed_to_capture}} + - **Risks:** {{key_challenges}} + - id: strategic-recommendations + title: Strategic Recommendations + sections: + - id: go-to-market + title: Go-to-Market Strategy + instruction: | + Recommend approach for market entry/expansion: + - Target segment prioritization + - Positioning strategy + - Channel strategy + - Partnership opportunities + - id: pricing-strategy + title: Pricing Strategy + instruction: | + Based on willingness to pay analysis and competitive landscape: + - Recommended pricing model + - Price points/ranges + - Value metric + - Competitive positioning + - id: risk-mitigation + title: Risk Mitigation + instruction: | + Key risks and mitigation strategies: + - Market risks + - Competitive risks + - Execution risks + - Regulatory/compliance risks + + - id: appendices + title: Appendices + sections: + - id: data-sources + title: A. Data Sources + instruction: List all sources used in the research + - id: calculations + title: B. Detailed Calculations + instruction: Include any complex calculations or models + - id: additional-analysis + title: C. Additional Analysis + instruction: Any supplementary analysis not included in main body +==================== END: .bmad-core/templates/market-research-tmpl.yaml ==================== + +==================== START: .bmad-core/templates/competitor-analysis-tmpl.yaml ==================== +template: + id: competitor-analysis-template-v2 + name: Competitive Analysis Report + version: 2.0 + output: + format: markdown + filename: docs/competitor-analysis.md + title: "Competitive Analysis Report: {{project_product_name}}" + +workflow: + mode: interactive + elicitation: advanced-elicitation + custom_elicitation: + title: "Competitive Analysis Elicitation Actions" + options: + - "Deep dive on a specific competitor's strategy" + - "Analyze competitive dynamics in a specific segment" + - "War game competitive responses to your moves" + - "Explore partnership vs. competition scenarios" + - "Stress test differentiation claims" + - "Analyze disruption potential (yours or theirs)" + - "Compare to competition in adjacent markets" + - "Generate win/loss analysis insights" + - "If only we had known about [competitor X's plan]..." + - "Proceed to next section" + +sections: + - id: executive-summary + title: Executive Summary + instruction: Provide high-level competitive insights, main threats and opportunities, and recommended strategic actions. Write this section LAST after completing all analysis. + + - id: analysis-scope + title: Analysis Scope & Methodology + instruction: This template guides comprehensive competitor analysis. Start by understanding the user's competitive intelligence needs and strategic objectives. Help them identify and prioritize competitors before diving into detailed analysis. + sections: + - id: analysis-purpose + title: Analysis Purpose + instruction: | + Define the primary purpose: + - New market entry assessment + - Product positioning strategy + - Feature gap analysis + - Pricing strategy development + - Partnership/acquisition targets + - Competitive threat assessment + - id: competitor-categories + title: Competitor Categories Analyzed + instruction: | + List categories included: + - Direct Competitors: Same product/service, same target market + - Indirect Competitors: Different product, same need/problem + - Potential Competitors: Could enter market easily + - Substitute Products: Alternative solutions + - Aspirational Competitors: Best-in-class examples + - id: research-methodology + title: Research Methodology + instruction: | + Describe approach: + - Information sources used + - Analysis timeframe + - Confidence levels + - Limitations + + - id: competitive-landscape + title: Competitive Landscape Overview + sections: + - id: market-structure + title: Market Structure + instruction: | + Describe the competitive environment: + - Number of active competitors + - Market concentration (fragmented/consolidated) + - Competitive dynamics + - Recent market entries/exits + - id: prioritization-matrix + title: Competitor Prioritization Matrix + instruction: | + Help categorize competitors by market share and strategic threat level + + Create a 2x2 matrix: + - Priority 1 (Core Competitors): High Market Share + High Threat + - Priority 2 (Emerging Threats): Low Market Share + High Threat + - Priority 3 (Established Players): High Market Share + Low Threat + - Priority 4 (Monitor Only): Low Market Share + Low Threat + + - id: competitor-profiles + title: Individual Competitor Profiles + instruction: Create detailed profiles for each Priority 1 and Priority 2 competitor. For Priority 3 and 4, create condensed profiles. + repeatable: true + sections: + - id: competitor + title: "{{competitor_name}} - Priority {{priority_level}}" + sections: + - id: company-overview + title: Company Overview + template: | + - **Founded:** {{year_founders}} + - **Headquarters:** {{location}} + - **Company Size:** {{employees_revenue}} + - **Funding:** {{total_raised_investors}} + - **Leadership:** {{key_executives}} + - id: business-model + title: Business Model & Strategy + template: | + - **Revenue Model:** {{revenue_model}} + - **Target Market:** {{customer_segments}} + - **Value Proposition:** {{value_promise}} + - **Go-to-Market Strategy:** {{gtm_approach}} + - **Strategic Focus:** {{current_priorities}} + - id: product-analysis + title: Product/Service Analysis + template: | + - **Core Offerings:** {{main_products}} + - **Key Features:** {{standout_capabilities}} + - **User Experience:** {{ux_assessment}} + - **Technology Stack:** {{tech_stack}} + - **Pricing:** {{pricing_model}} + - id: strengths-weaknesses + title: Strengths & Weaknesses + sections: + - id: strengths + title: Strengths + type: bullet-list + template: "- {{strength}}" + - id: weaknesses + title: Weaknesses + type: bullet-list + template: "- {{weakness}}" + - id: market-position + title: Market Position & Performance + template: | + - **Market Share:** {{market_share_estimate}} + - **Customer Base:** {{customer_size_notables}} + - **Growth Trajectory:** {{growth_trend}} + - **Recent Developments:** {{key_news}} + + - id: comparative-analysis + title: Comparative Analysis + sections: + - id: feature-comparison + title: Feature Comparison Matrix + instruction: Create a detailed comparison table of key features across competitors + type: table + columns: ["Feature Category", "{{your_company}}", "{{competitor_1}}", "{{competitor_2}}", "{{competitor_3}}"] + rows: + - category: "Core Functionality" + items: + - ["Feature A", "{{status}}", "{{status}}", "{{status}}", "{{status}}"] + - ["Feature B", "{{status}}", "{{status}}", "{{status}}", "{{status}}"] + - category: "User Experience" + items: + - ["Mobile App", "{{rating}}", "{{rating}}", "{{rating}}", "{{rating}}"] + - ["Onboarding Time", "{{time}}", "{{time}}", "{{time}}", "{{time}}"] + - category: "Integration & Ecosystem" + items: + - ["API Availability", "{{availability}}", "{{availability}}", "{{availability}}", "{{availability}}"] + - ["Third-party Integrations", "{{number}}", "{{number}}", "{{number}}", "{{number}}"] + - category: "Pricing & Plans" + items: + - ["Starting Price", "{{price}}", "{{price}}", "{{price}}", "{{price}}"] + - ["Free Tier", "{{yes_no}}", "{{yes_no}}", "{{yes_no}}", "{{yes_no}}"] + - id: swot-comparison + title: SWOT Comparison + instruction: Create SWOT analysis for your solution vs. top competitors + sections: + - id: your-solution + title: Your Solution + template: | + - **Strengths:** {{strengths}} + - **Weaknesses:** {{weaknesses}} + - **Opportunities:** {{opportunities}} + - **Threats:** {{threats}} + - id: vs-competitor + title: "vs. {{main_competitor}}" + template: | + - **Competitive Advantages:** {{your_advantages}} + - **Competitive Disadvantages:** {{their_advantages}} + - **Differentiation Opportunities:** {{differentiation}} + - id: positioning-map + title: Positioning Map + instruction: | + Describe competitor positions on key dimensions + + Create a positioning description using 2 key dimensions relevant to the market, such as: + - Price vs. Features + - Ease of Use vs. Power + - Specialization vs. Breadth + - Self-Serve vs. High-Touch + + - id: strategic-analysis + title: Strategic Analysis + sections: + - id: competitive-advantages + title: Competitive Advantages Assessment + sections: + - id: sustainable-advantages + title: Sustainable Advantages + instruction: | + Identify moats and defensible positions: + - Network effects + - Switching costs + - Brand strength + - Technology barriers + - Regulatory advantages + - id: vulnerable-points + title: Vulnerable Points + instruction: | + Where competitors could be challenged: + - Weak customer segments + - Missing features + - Poor user experience + - High prices + - Limited geographic presence + - id: blue-ocean + title: Blue Ocean Opportunities + instruction: | + Identify uncontested market spaces + + List opportunities to create new market space: + - Underserved segments + - Unaddressed use cases + - New business models + - Geographic expansion + - Different value propositions + + - id: strategic-recommendations + title: Strategic Recommendations + sections: + - id: differentiation-strategy + title: Differentiation Strategy + instruction: | + How to position against competitors: + - Unique value propositions to emphasize + - Features to prioritize + - Segments to target + - Messaging and positioning + - id: competitive-response + title: Competitive Response Planning + sections: + - id: offensive-strategies + title: Offensive Strategies + instruction: | + How to gain market share: + - Target competitor weaknesses + - Win competitive deals + - Capture their customers + - id: defensive-strategies + title: Defensive Strategies + instruction: | + How to protect your position: + - Strengthen vulnerable areas + - Build switching costs + - Deepen customer relationships + - id: partnership-ecosystem + title: Partnership & Ecosystem Strategy + instruction: | + Potential collaboration opportunities: + - Complementary players + - Channel partners + - Technology integrations + - Strategic alliances + + - id: monitoring-plan + title: Monitoring & Intelligence Plan + sections: + - id: key-competitors + title: Key Competitors to Track + instruction: Priority list with rationale + - id: monitoring-metrics + title: Monitoring Metrics + instruction: | + What to track: + - Product updates + - Pricing changes + - Customer wins/losses + - Funding/M&A activity + - Market messaging + - id: intelligence-sources + title: Intelligence Sources + instruction: | + Where to gather ongoing intelligence: + - Company websites/blogs + - Customer reviews + - Industry reports + - Social media + - Patent filings + - id: update-cadence + title: Update Cadence + instruction: | + Recommended review schedule: + - Weekly: {{weekly_items}} + - Monthly: {{monthly_items}} + - Quarterly: {{quarterly_analysis}} +==================== END: .bmad-core/templates/competitor-analysis-tmpl.yaml ==================== + +==================== START: .bmad-core/templates/brainstorming-output-tmpl.yaml ==================== +template: + id: brainstorming-output-template-v2 + name: Brainstorming Session Results + version: 2.0 + output: + format: markdown + filename: docs/brainstorming-session-results.md + title: "Brainstorming Session Results" + +workflow: + mode: non-interactive + +sections: + - id: header + content: | + **Session Date:** {{date}} + **Facilitator:** {{agent_role}} {{agent_name}} + **Participant:** {{user_name}} + + - id: executive-summary + title: Executive Summary + sections: + - id: summary-details + template: | + **Topic:** {{session_topic}} + + **Session Goals:** {{stated_goals}} + + **Techniques Used:** {{techniques_list}} + + **Total Ideas Generated:** {{total_ideas}} + - id: key-themes + title: "Key Themes Identified:" + type: bullet-list + template: "- {{theme}}" + + - id: technique-sessions + title: Technique Sessions + repeatable: true + sections: + - id: technique + title: "{{technique_name}} - {{duration}}" + sections: + - id: description + template: "**Description:** {{technique_description}}" + - id: ideas-generated + title: "Ideas Generated:" + type: numbered-list + template: "{{idea}}" + - id: insights + title: "Insights Discovered:" + type: bullet-list + template: "- {{insight}}" + - id: connections + title: "Notable Connections:" + type: bullet-list + template: "- {{connection}}" + + - id: idea-categorization + title: Idea Categorization + sections: + - id: immediate-opportunities + title: Immediate Opportunities + content: "*Ideas ready to implement now*" + repeatable: true + type: numbered-list + template: | + **{{idea_name}}** + - Description: {{description}} + - Why immediate: {{rationale}} + - Resources needed: {{requirements}} + - id: future-innovations + title: Future Innovations + content: "*Ideas requiring development/research*" + repeatable: true + type: numbered-list + template: | + **{{idea_name}}** + - Description: {{description}} + - Development needed: {{development_needed}} + - Timeline estimate: {{timeline}} + - id: moonshots + title: Moonshots + content: "*Ambitious, transformative concepts*" + repeatable: true + type: numbered-list + template: | + **{{idea_name}}** + - Description: {{description}} + - Transformative potential: {{potential}} + - Challenges to overcome: {{challenges}} + - id: insights-learnings + title: Insights & Learnings + content: "*Key realizations from the session*" + type: bullet-list + template: "- {{insight}}: {{description_and_implications}}" + + - id: action-planning + title: Action Planning + sections: + - id: top-priorities + title: Top 3 Priority Ideas + sections: + - id: priority-1 + title: "#1 Priority: {{idea_name}}" + template: | + - Rationale: {{rationale}} + - Next steps: {{next_steps}} + - Resources needed: {{resources}} + - Timeline: {{timeline}} + - id: priority-2 + title: "#2 Priority: {{idea_name}}" + template: | + - Rationale: {{rationale}} + - Next steps: {{next_steps}} + - Resources needed: {{resources}} + - Timeline: {{timeline}} + - id: priority-3 + title: "#3 Priority: {{idea_name}}" + template: | + - Rationale: {{rationale}} + - Next steps: {{next_steps}} + - Resources needed: {{resources}} + - Timeline: {{timeline}} + + - id: reflection-followup + title: Reflection & Follow-up + sections: + - id: what-worked + title: What Worked Well + type: bullet-list + template: "- {{aspect}}" + - id: areas-exploration + title: Areas for Further Exploration + type: bullet-list + template: "- {{area}}: {{reason}}" + - id: recommended-techniques + title: Recommended Follow-up Techniques + type: bullet-list + template: "- {{technique}}: {{reason}}" + - id: questions-emerged + title: Questions That Emerged + type: bullet-list + template: "- {{question}}" + - id: next-session + title: Next Session Planning + template: | + - **Suggested topics:** {{followup_topics}} + - **Recommended timeframe:** {{timeframe}} + - **Preparation needed:** {{preparation}} + + - id: footer + content: | + --- + + *Session facilitated using the BMAD-METHOD brainstorming framework* +==================== END: .bmad-core/templates/brainstorming-output-tmpl.yaml ==================== ==================== START: .bmad-core/data/brainstorming-techniques.md ==================== # Brainstorming Techniques Data @@ -4480,2530 +4565,2162 @@ The LLM will: - Offer to provide detailed analysis of any section, especially those with warnings or failures ==================== END: .bmad-core/tasks/execute-checklist.md ==================== -==================== START: .bmad-core/templates/architecture-tmpl.md ==================== -# {{Project Name}} Architecture Document - -[[LLM: If available, review any provided relevant documents to gather all relevant context before beginning. If at a minimum you cannot local `docs/prd.md` ask the user what docs will provide the basis for the architecture.]] - -[[LLM: The default path and filename unless specified is docs/architecture.md]] - -## Introduction - -[[LLM: This section establishes the document's purpose and scope. Keep the content below but ensure project name is properly substituted. - -After presenting this section, apply `.bmad-core/tasks/advanced-elicitation.md` protocol]] - -This document outlines the overall project architecture for {{Project Name}}, including backend systems, shared services, and non-UI specific concerns. Its primary goal is to serve as the guiding architectural blueprint for AI-driven development, ensuring consistency and adherence to chosen patterns and technologies. - -**Relationship to Frontend Architecture:** -If the project includes a significant user interface, a separate Frontend Architecture Document will detail the frontend-specific design and MUST be used in conjunction with this document. Core technology stack choices documented herein (see "Tech Stack") are definitive for the entire project, including any frontend components. - -### Starter Template or Existing Project - -[[LLM: Before proceeding further with architecture design, check if the project is based on a starter template or existing codebase: - -1. Review the PRD and brainstorming brief for any mentions of: - -- Starter templates (e.g., Create React App, Next.js, Vue CLI, Angular CLI, etc.) -- Existing projects or codebases being used as a foundation -- Boilerplate projects or scaffolding tools -- Previous projects to be cloned or adapted - -2. If a starter template or existing project is mentioned: - -- Ask the user to provide access via one of these methods: - - Link to the starter template documentation - - Upload/attach the project files (for small projects) - - Share a link to the project repository (GitHub, GitLab, etc.) -- Analyze the starter/existing project to understand: - - Pre-configured technology stack and versions - - Project structure and organization patterns - - Built-in scripts and tooling - - Existing architectural patterns and conventions - - Any limitations or constraints imposed by the starter -- Use this analysis to inform and align your architecture decisions - -3. If no starter template is mentioned but this is a greenfield project: - -- Suggest appropriate starter templates based on the tech stack preferences -- Explain the benefits (faster setup, best practices, community support) -- Let the user decide whether to use one - -4. If the user confirms no starter template will be used: - -- Proceed with architecture design from scratch -- Note that manual setup will be required for all tooling and configuration - -Document the decision here before proceeding with the architecture design. In none, just say N/A - -After presenting this starter template section, apply `.bmad-core/tasks/advanced-elicitation.md` protocol]] - -### Change Log - -[[LLM: Track document versions and changes]] - -| Date | Version | Description | Author | -| :--- | :------ | :---------- | :----- | - -## High Level Architecture - -[[LLM: This section contains multiple subsections that establish the foundation of the architecture. Present all subsections together (Introduction, Technical Summary, High Level Overview, Project Diagram, and Architectural Patterns), then apply `.bmad-core/tasks/advanced-elicitation.md` protocol to the complete High Level Architecture section. The user can choose to refine the entire section or specific subsections.]] - -### Technical Summary - -[[LLM: Provide a brief paragraph (3-5 sentences) overview of: - -- The system's overall architecture style -- Key components and their relationships -- Primary technology choices -- Core architectural patterns being used -- Reference back to the PRD goals and how this architecture supports them]] - -### High Level Overview - -[[LLM: Based on the PRD's Technical Assumptions section, describe: - -1. The main architectural style (e.g., Monolith, Microservices, Serverless, Event-Driven) -2. Repository structure decision from PRD (Monorepo/Polyrepo) -3. Service architecture decision from PRD -4. Primary user interaction flow or data flow at a conceptual level -5. Key architectural decisions and their rationale - -After presenting this section, apply `.bmad-core/tasks/advanced-elicitation.md` protocol]] - -### High Level Project Diagram - -[[LLM: Create a Mermaid diagram that visualizes the high-level architecture. Consider: - -- System boundaries -- Major components/services -- Data flow directions -- External integrations -- User entry points - -Use appropriate Mermaid diagram type (graph TD, C4, sequence) based on what best represents the architecture - -After presenting the diagram, apply `.bmad-core/tasks/advanced-elicitation.md` protocol]] - -### Architectural and Design Patterns - -[[LLM: List the key high-level patterns that will guide the architecture. For each pattern: - -1. Present 2-3 viable options if multiple exist -2. Provide your recommendation with clear rationale -3. Get user confirmation before finalizing -4. These patterns should align with the PRD's technical assumptions and project goals - -Common patterns to consider: - -- Architectural style patterns (Serverless, Event-Driven, Microservices, CQRS, Hexagonal) -- Code organization patterns (Dependency Injection, Repository, Module, Factory) -- Data patterns (Event Sourcing, Saga, Database per Service) -- Communication patterns (REST, GraphQL, Message Queue, Pub/Sub)]] - -<> - -- **{{pattern_name}}:** {{pattern_description}} - _Rationale:_ {{rationale}} - -<> - -@{example: patterns} - -- **Serverless Architecture:** Using AWS Lambda for compute - _Rationale:_ Aligns with PRD requirement for cost optimization and automatic scaling -- **Repository Pattern:** Abstract data access logic - _Rationale:_ Enables testing and future database migration flexibility -- **Event-Driven Communication:** Using SNS/SQS for service decoupling - _Rationale:_ Supports async processing and system resilience - -@{/example} - -[[LLM: After presenting the patterns, apply `.bmad-core/tasks/advanced-elicitation.md` protocol]] - -## Tech Stack - -[[LLM: This is the DEFINITIVE technology selection section. Work with the user to make specific choices: - -1. Review PRD technical assumptions and any preferences from `.bmad-core/data/technical-preferences.yaml` or an attached `technical-preferences` -2. For each category, present 2-3 viable options with pros/cons -3. Make a clear recommendation based on project needs -4. Get explicit user approval for each selection -5. Document exact versions (avoid "latest" - pin specific versions) -6. This table is the single source of truth - all other docs must reference these choices - -Key decisions to finalize - before displaying the table, ensure you are aware of or ask the user about - let the user know if they are not sure on any that you can also provide suggestions with rationale: - -- Starter templates (if any) -- Languages and runtimes with exact versions -- Frameworks and libraries / packages -- Cloud provider and key services choices -- Database and storage solutions - if unclear suggest sql or nosql or other types depending on the project and depending on cloud provider offer a suggestion -- Development tools - -Upon render of the table, ensure the user is aware of the importance of this sections choices, should also look for gaps or disagreements with anything, ask for any clarifications if something is unclear why its in the list, and also right away apply `.bmad-core/tasks/advanced-elicitation.md` display - this statement and the options should be rendered and then prompt right all before allowing user input.]] - -### Cloud Infrastructure - -- **Provider:** {{cloud_provider}} -- **Key Services:** {{core_services_list}} -- **Deployment Regions:** {{regions}} - -### Technology Stack Table - -| Category | Technology | Version | Purpose | Rationale | -| :----------------- | :----------------- | :---------- | :---------- | :------------- | -| **Language** | {{language}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **Runtime** | {{runtime}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **Framework** | {{framework}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **Database** | {{database}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **Cache** | {{cache}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **Message Queue** | {{queue}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **API Style** | {{api_style}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **Authentication** | {{auth}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **Testing** | {{test_framework}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **Build Tool** | {{build_tool}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **IaC Tool** | {{iac_tool}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **Monitoring** | {{monitoring}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **Logging** | {{logging}} | {{version}} | {{purpose}} | {{why_chosen}} | - -@{example: tech_stack_row} -| **Language** | TypeScript | 5.3.3 | Primary development language | Strong typing, excellent tooling, team expertise | -| **Runtime** | Node.js | 20.11.0 | JavaScript runtime | LTS version, stable performance, wide ecosystem | -| **Framework** | NestJS | 10.3.2 | Backend framework | Enterprise-ready, good DI, matches team patterns | -@{/example} - -## Data Models - -[[LLM: Define the core data models/entities: - -1. Review PRD requirements and identify key business entities -2. For each model, explain its purpose and relationships -3. Include key attributes and data types -4. Show relationships between models -5. Discuss design decisions with user - -Create a clear conceptual model before moving to database schema. - -After presenting all data models, apply `.bmad-core/tasks/advanced-elicitation.md` protocol]] - -<> - -### {{model_name}} - -**Purpose:** {{model_purpose}} - -**Key Attributes:** - -- {{attribute_1}}: {{type_1}} - {{description_1}} -- {{attribute_2}}: {{type_2}} - {{description_2}} - -**Relationships:** - -- {{relationship_1}} -- {{relationship_2}} - <> - -## Components - -[[LLM: Based on the architectural patterns, tech stack, and data models from above: - -1. Identify major logical components/services and their responsibilities -2. Consider the repository structure (monorepo/polyrepo) from PRD -3. Define clear boundaries and interfaces between components -4. For each component, specify: - -- Primary responsibility -- Key interfaces/APIs exposed -- Dependencies on other components -- Technology specifics based on tech stack choices - -5. Create component diagrams where helpful -6. After presenting all components, apply `.bmad-core/tasks/advanced-elicitation.md` protocol]] - -<> - -### {{component_name}} - -**Responsibility:** {{component_description}} - -**Key Interfaces:** - -- {{interface_1}} -- {{interface_2}} - -**Dependencies:** {{dependencies}} - -**Technology Stack:** {{component_tech_details}} -<> - -### Component Diagrams - -[[LLM: Create Mermaid diagrams to visualize component relationships. Options: - -- C4 Container diagram for high-level view -- Component diagram for detailed internal structure -- Sequence diagrams for complex interactions - Choose the most appropriate for clarity - -After presenting the diagrams, apply `.bmad-core/tasks/advanced-elicitation.md` protocol]] - -## External APIs - -[[LLM: For each external service integration: - -1. Identify APIs needed based on PRD requirements and component design -2. If documentation URLs are unknown, ask user for specifics -3. Document authentication methods and security considerations -4. List specific endpoints that will be used -5. Note any rate limits or usage constraints - -If no external APIs are needed, state this explicitly and skip to next section.]] - -^^CONDITION: has_external_apis^^ - -<> - -### {{api_name}} API - -- **Purpose:** {{api_purpose}} -- **Documentation:** {{api_docs_url}} -- **Base URL(s):** {{api_base_url}} -- **Authentication:** {{auth_method}} -- **Rate Limits:** {{rate_limits}} - -**Key Endpoints Used:** -<> - -- `{{method}} {{endpoint_path}}` - {{endpoint_purpose}} - <> - -**Integration Notes:** {{integration_considerations}} -<> - -@{example: external_api} - -### Stripe API - -- **Purpose:** Payment processing and subscription management -- **Documentation:** https://stripe.com/docs/api -- **Base URL(s):** `https://api.stripe.com/v1` -- **Authentication:** Bearer token with secret key -- **Rate Limits:** 100 requests per second - -**Key Endpoints Used:** - -- `POST /customers` - Create customer profiles -- `POST /payment_intents` - Process payments -- `POST /subscriptions` - Manage subscriptions - @{/example} - -^^/CONDITION: has_external_apis^^ - -[[LLM: After presenting external APIs (or noting their absence), apply `.bmad-core/tasks/advanced-elicitation.md` protocol]] - -## Core Workflows - -[[LLM: Illustrate key system workflows using sequence diagrams: - -1. Identify critical user journeys from PRD -2. Show component interactions including external APIs -3. Include error handling paths -4. Document async operations -5. Create both high-level and detailed diagrams as needed - -Focus on workflows that clarify architecture decisions or complex interactions. - -After presenting the workflow diagrams, apply `.bmad-core/tasks/advanced-elicitation.md` protocol]] - -## REST API Spec - -[[LLM: If the project includes a REST API: - -1. Create an OpenAPI 3.0 specification -2. Include all endpoints from epics/stories -3. Define request/response schemas based on data models -4. Document authentication requirements -5. Include example requests/responses - -Use YAML format for better readability. If no REST API, skip this section.]] - -^^CONDITION: has_rest_api^^ - -```yaml -openapi: 3.0.0 -info: - title: - '[object Object]': null - version: - '[object Object]': null - description: - '[object Object]': null -servers: - - url: - '[object Object]': null - description: - '[object Object]': null -``` - -^^/CONDITION: has_rest_api^^ - -[[LLM: After presenting the REST API spec (or noting its absence if not applicable), apply `.bmad-core/tasks/advanced-elicitation.md` protocol]] - -## Database Schema - -[[LLM: Transform the conceptual data models into concrete database schemas: - -1. Use the database type(s) selected in Tech Stack -2. Create schema definitions using appropriate notation -3. Include indexes, constraints, and relationships -4. Consider performance and scalability -5. For NoSQL, show document structures - -Present schema in format appropriate to database type (SQL DDL, JSON schema, etc.) - -After presenting the database schema, apply `.bmad-core/tasks/advanced-elicitation.md` protocol]] - -## Source Tree - -[[LLM: Create a project folder structure that reflects: - -1. The chosen repository structure (monorepo/polyrepo) -2. The service architecture (monolith/microservices/serverless) -3. The selected tech stack and languages -4. Component organization from above -5. Best practices for the chosen frameworks -6. Clear separation of concerns - -Adapt the structure based on project needs. For monorepos, show service separation. For serverless, show function organization. Include language-specific conventions. - -After presenting the structure, apply `.bmad-core/tasks/advanced-elicitation.md` protocol to refine based on user feedback.]] - -```plaintext -{{project-root}}/ -├── .github/ # CI/CD workflows -│ └── workflows/ -│ └── main.yaml -├── .vscode/ # VSCode settings (optional) -│ └── settings.json -├── build/ # Compiled output (git-ignored) -├── config/ # Configuration files -├── docs/ # Project documentation -│ ├── PRD.md -│ ├── architecture.md -│ └── ... -├── infra/ # Infrastructure as Code -│ └── {{iac-structure}} -├── {{dependencies-dir}}/ # Dependencies (git-ignored) -├── scripts/ # Utility scripts -├── src/ # Application source code -│ └── {{source-structure}} -├── tests/ # Test files -│ ├── unit/ -│ ├── integration/ -│ └── e2e/ -├── .env.example # Environment variables template -├── .gitignore # Git ignore rules -├── {{package-manifest}} # Dependencies manifest -├── {{config-files}} # Language/framework configs -└── README.md # Project documentation - -@{example: monorepo-structure} -project-root/ -├── packages/ -│ ├── api/ # Backend API service -│ ├── web/ # Frontend application -│ ├── shared/ # Shared utilities/types -│ └── infrastructure/ # IaC definitions -├── scripts/ # Monorepo management scripts -└── package.json # Root package.json with workspaces -@{/example} -``` - -[[LLM: After presenting the source tree structure, apply `.bmad-core/tasks/advanced-elicitation.md` protocol]] - -## Infrastructure and Deployment - -[[LLM: Define the deployment architecture and practices: - -1. Use IaC tool selected in Tech Stack -2. Choose deployment strategy appropriate for the architecture -3. Define environments and promotion flow -4. Establish rollback procedures -5. Consider security, monitoring, and cost optimization - -Get user input on deployment preferences and CI/CD tool choices.]] - -### Infrastructure as Code - -- **Tool:** {{iac_tool}} {{version}} -- **Location:** `{{iac_directory}}` -- **Approach:** {{iac_approach}} - -### Deployment Strategy - -- **Strategy:** {{deployment_strategy}} -- **CI/CD Platform:** {{cicd_platform}} -- **Pipeline Configuration:** `{{pipeline_config_location}}` - -### Environments - -<> - -- **{{env_name}}:** {{env_purpose}} - {{env_details}} - <> - -### Environment Promotion Flow - -```text -{{promotion_flow_diagram}} -``` - -### Rollback Strategy - -- **Primary Method:** {{rollback_method}} -- **Trigger Conditions:** {{rollback_triggers}} -- **Recovery Time Objective:** {{rto}} - -[[LLM: After presenting the infrastructure and deployment section, apply `.bmad-core/tasks/advanced-elicitation.md` protocol]] - -## Error Handling Strategy - -[[LLM: Define comprehensive error handling approach: - -1. Choose appropriate patterns for the language/framework from Tech Stack -2. Define logging standards and tools -3. Establish error categories and handling rules -4. Consider observability and debugging needs -5. Ensure security (no sensitive data in logs) - -This section guides both AI and human developers in consistent error handling.]] - -### General Approach - -- **Error Model:** {{error_model}} -- **Exception Hierarchy:** {{exception_structure}} -- **Error Propagation:** {{propagation_rules}} - -### Logging Standards - -- **Library:** {{logging_library}} {{version}} -- **Format:** {{log_format}} -- **Levels:** {{log_levels_definition}} -- **Required Context:** - - Correlation ID: {{correlation_id_format}} - - Service Context: {{service_context}} - - User Context: {{user_context_rules}} - -### Error Handling Patterns - -#### External API Errors - -- **Retry Policy:** {{retry_strategy}} -- **Circuit Breaker:** {{circuit_breaker_config}} -- **Timeout Configuration:** {{timeout_settings}} -- **Error Translation:** {{error_mapping_rules}} - -#### Business Logic Errors - -- **Custom Exceptions:** {{business_exception_types}} -- **User-Facing Errors:** {{user_error_format}} -- **Error Codes:** {{error_code_system}} - -#### Data Consistency - -- **Transaction Strategy:** {{transaction_approach}} -- **Compensation Logic:** {{compensation_patterns}} -- **Idempotency:** {{idempotency_approach}} - -[[LLM: After presenting the error handling strategy, apply `.bmad-core/tasks/advanced-elicitation.md` protocol]] - -## Coding Standards - -[[LLM: These standards are MANDATORY for AI agents. Work with user to define ONLY the critical rules needed to prevent bad code. Explain that: - -1. This section directly controls AI developer behavior -2. Keep it minimal - assume AI knows general best practices -3. Focus on project-specific conventions and gotchas -4. Overly detailed standards bloat context and slow development -5. Standards will be extracted to separate file for dev agent use - -For each standard, get explicit user confirmation it's necessary.]] - -### Core Standards - -- **Languages & Runtimes:** {{languages_and_versions}} -- **Style & Linting:** {{linter_config}} -- **Test Organization:** {{test_file_convention}} - -### Naming Conventions - -[[LLM: Only include if deviating from language defaults]] - -| Element | Convention | Example | -| :-------- | :------------------- | :---------------- | -| Variables | {{var_convention}} | {{var_example}} | -| Functions | {{func_convention}} | {{func_example}} | -| Classes | {{class_convention}} | {{class_example}} | -| Files | {{file_convention}} | {{file_example}} | - -### Critical Rules - -[[LLM: List ONLY rules that AI might violate or project-specific requirements. Examples: - -- "Never use console.log in production code - use logger" -- "All API responses must use ApiResponse wrapper type" -- "Database queries must use repository pattern, never direct ORM" - -Avoid obvious rules like "use SOLID principles" or "write clean code"]] - -<> - -- **{{rule_name}}:** {{rule_description}} - <> - -### Language-Specific Guidelines - -[[LLM: Add ONLY if critical for preventing AI mistakes. Most teams don't need this section.]] - -^^CONDITION: has_language_specifics^^ - -#### {{language_name}} Specifics - -<> - -- **{{rule_topic}}:** {{rule_detail}} - <> - -^^/CONDITION: has_language_specifics^^ - -[[LLM: After presenting the coding standards, apply `.bmad-core/tasks/advanced-elicitation.md` protocol]] - -## Test Strategy and Standards - -[[LLM: Work with user to define comprehensive test strategy: - -1. Use test frameworks from Tech Stack -2. Decide on TDD vs test-after approach -3. Define test organization and naming -4. Establish coverage goals -5. Determine integration test infrastructure -6. Plan for test data and external dependencies - -Note: Basic info goes in Coding Standards for dev agent. This detailed section is for QA agent and team reference. Apply `.bmad-core/tasks/advanced-elicitation.md` after initial draft.]] - -### Testing Philosophy - -- **Approach:** {{test_approach}} -- **Coverage Goals:** {{coverage_targets}} -- **Test Pyramid:** {{test_distribution}} - -### Test Types and Organization - -#### Unit Tests - -- **Framework:** {{unit_test_framework}} {{version}} -- **File Convention:** {{unit_test_naming}} -- **Location:** {{unit_test_location}} -- **Mocking Library:** {{mocking_library}} -- **Coverage Requirement:** {{unit_coverage}} - -**AI Agent Requirements:** - -- Generate tests for all public methods -- Cover edge cases and error conditions -- Follow AAA pattern (Arrange, Act, Assert) -- Mock all external dependencies - -#### Integration Tests - -- **Scope:** {{integration_scope}} -- **Location:** {{integration_test_location}} -- **Test Infrastructure:** - <> - - **{{dependency_name}}:** {{test_approach}} ({{test_tool}}) - <> - -@{example: test_dependencies} - -- **Database:** In-memory H2 for unit tests, Testcontainers PostgreSQL for integration -- **Message Queue:** Embedded Kafka for tests -- **External APIs:** WireMock for stubbing - @{/example} - -#### End-to-End Tests - -- **Framework:** {{e2e_framework}} {{version}} -- **Scope:** {{e2e_scope}} -- **Environment:** {{e2e_environment}} -- **Test Data:** {{e2e_data_strategy}} - -### Test Data Management - -- **Strategy:** {{test_data_approach}} -- **Fixtures:** {{fixture_location}} -- **Factories:** {{factory_pattern}} -- **Cleanup:** {{cleanup_strategy}} - -### Continuous Testing - -- **CI Integration:** {{ci_test_stages}} -- **Performance Tests:** {{perf_test_approach}} -- **Security Tests:** {{security_test_approach}} - -[[LLM: After presenting the test strategy section, apply `.bmad-core/tasks/advanced-elicitation.md` protocol]] - -## Security - -[[LLM: Define MANDATORY security requirements for AI and human developers: - -1. Focus on implementation-specific rules -2. Reference security tools from Tech Stack -3. Define clear patterns for common scenarios -4. These rules directly impact code generation -5. Work with user to ensure completeness without redundancy]] - -### Input Validation - -- **Validation Library:** {{validation_library}} -- **Validation Location:** {{where_to_validate}} -- **Required Rules:** - - All external inputs MUST be validated - - Validation at API boundary before processing - - Whitelist approach preferred over blacklist - -### Authentication & Authorization - -- **Auth Method:** {{auth_implementation}} -- **Session Management:** {{session_approach}} -- **Required Patterns:** - - {{auth_pattern_1}} - - {{auth_pattern_2}} - -### Secrets Management - -- **Development:** {{dev_secrets_approach}} -- **Production:** {{prod_secrets_service}} -- **Code Requirements:** - - NEVER hardcode secrets - - Access via configuration service only - - No secrets in logs or error messages - -### API Security - -- **Rate Limiting:** {{rate_limit_implementation}} -- **CORS Policy:** {{cors_configuration}} -- **Security Headers:** {{required_headers}} -- **HTTPS Enforcement:** {{https_approach}} - -### Data Protection - -- **Encryption at Rest:** {{encryption_at_rest}} -- **Encryption in Transit:** {{encryption_in_transit}} -- **PII Handling:** {{pii_rules}} -- **Logging Restrictions:** {{what_not_to_log}} - -### Dependency Security - -- **Scanning Tool:** {{dependency_scanner}} -- **Update Policy:** {{update_frequency}} -- **Approval Process:** {{new_dep_process}} - -### Security Testing - -- **SAST Tool:** {{static_analysis}} -- **DAST Tool:** {{dynamic_analysis}} -- **Penetration Testing:** {{pentest_schedule}} - -[[LLM: After presenting the security section, apply `.bmad-core/tasks/advanced-elicitation.md` protocol]] - -## Checklist Results Report - -[[LLM: Before running the checklist, offer to output the full architecture document. Once user confirms, execute the `architect-checklist` and populate results here.]] - ---- - -## Next Steps - -[[LLM: After completing the architecture: - -1. If project has UI components: - -- Recommend engaging Design Architect agent -- Use "Frontend Architecture Mode" -- Provide this document as input - -2. For all projects: - -- Review with Product Owner -- Begin story implementation with Dev agent -- Set up infrastructure with DevOps agent - -3. Include specific prompts for next agents if needed]] - -^^CONDITION: has_ui^^ - -### Design Architect Prompt - -[[LLM: Create a brief prompt to hand off to Design Architect for Frontend Architecture creation. Include: - -- Reference to this architecture document -- Key UI requirements from PRD -- Any frontend-specific decisions made here -- Request for detailed frontend architecture]] - -^^/CONDITION: has_ui^^ - -### Developer Handoff - -[[LLM: Create a brief prompt for developers starting implementation. Include: - -- Reference to this architecture and coding standards -- First epic/story to implement -- Key technical decisions to follow]] -==================== END: .bmad-core/templates/architecture-tmpl.md ==================== - -==================== START: .bmad-core/templates/front-end-architecture-tmpl.md ==================== -# {{Project Name}} Frontend Architecture Document - -[[LLM: The default path and filename unless specified is docs/ui-architecture.md]] - -[[LLM: Review provided documents including PRD, UX-UI Specification, and main Architecture Document. Focus on extracting technical implementation details needed for AI frontend tools and developer agents. Ask the user for any of these documents if you are unable to locate and were not provided.]] - -## Template and Framework Selection - -[[LLM: Before proceeding with frontend architecture design, check if the project is using a frontend starter template or existing codebase: - -1. Review the PRD, main architecture document, and brainstorming brief for mentions of: - - - Frontend starter templates (e.g., Create React App, Next.js, Vite, Vue CLI, Angular CLI, etc.) - - UI kit or component library starters - - Existing frontend projects being used as a foundation - - Admin dashboard templates or other specialized starters - - Design system implementations - -2. If a frontend starter template or existing project is mentioned: - - - Ask the user to provide access via one of these methods: - - Link to the starter template documentation - - Upload/attach the project files (for small projects) - - Share a link to the project repository - - Analyze the starter/existing project to understand: - - Pre-installed dependencies and versions - - Folder structure and file organization - - Built-in components and utilities - - Styling approach (CSS modules, styled-components, Tailwind, etc.) - - State management setup (if any) - - Routing configuration - - Testing setup and patterns - - Build and development scripts - -- Use this analysis to ensure your frontend architecture aligns with the starter's patterns - -3. If no frontend starter is mentioned but this is a new UI, ensure we know what the ui language and framework is: - - - Based on the framework choice, suggest appropriate starters: - - React: Create React App, Next.js, Vite + React - - Vue: Vue CLI, Nuxt.js, Vite + Vue - - Angular: Angular CLI - - Or suggest popular UI templates if applicable - - Explain benefits specific to frontend development - -4. If the user confirms no starter template will be used: - - Note that all tooling, bundling, and configuration will need manual setup - - Proceed with frontend architecture from scratch - -Document the starter template decision and any constraints it imposes before proceeding.]] - -### Change Log - -[[LLM: Track document versions and changes]] - -| Date | Version | Description | Author | -| :--- | :------ | :---------- | :----- | - -## Frontend Tech Stack - -[[LLM: Extract from main architecture's Technology Stack Table. This section MUST remain synchronized with the main architecture document. After presenting this section, apply `tasks#advanced-elicitation` protocol]] - -### Technology Stack Table - -| Category | Technology | Version | Purpose | Rationale | -| :-------------------- | :------------------- | :---------- | :---------- | :------------- | -| **Framework** | {{framework}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **UI Library** | {{ui_library}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **State Management** | {{state_management}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **Routing** | {{routing_library}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **Build Tool** | {{build_tool}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **Styling** | {{styling_solution}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **Testing** | {{test_framework}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **Component Library** | {{component_lib}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **Form Handling** | {{form_library}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **Animation** | {{animation_lib}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **Dev Tools** | {{dev_tools}} | {{version}} | {{purpose}} | {{why_chosen}} | - -[[LLM: Fill in appropriate technology choices based on the selected framework and project requirements.]] - -## Project Structure - -[[LLM: Define exact directory structure for AI tools based on the chosen framework. Be specific about where each type of file goes. Generate a structure that follows the framework's best practices and conventions. After presenting this section, apply `tasks#advanced-elicitation` protocol]] - -## Component Standards - -[[LLM: Define exact patterns for component creation based on the chosen framework. After presenting this section, apply `tasks#advanced-elicitation` protocol]] - -### Component Template - -[[LLM: Generate a minimal but complete component template following the framework's best practices. Include TypeScript types, proper imports, and basic structure.]] - -### Naming Conventions - -[[LLM: Provide naming conventions specific to the chosen framework for components, files, services, state management, and other architectural elements.]] - -## State Management - -[[LLM: Define state management patterns based on the chosen framework. After presenting this section, apply `tasks#advanced-elicitation` protocol]] - -### Store Structure - -[[LLM: Generate the state management directory structure appropriate for the chosen framework and selected state management solution.]] - -### State Management Template - -[[LLM: Provide a basic state management template/example following the framework's recommended patterns. Include TypeScript types and common operations like setting, updating, and clearing state.]] - -## API Integration - -[[LLM: Define API service patterns based on the chosen framework. After presenting this section, apply `tasks#advanced-elicitation` protocol]] - -### Service Template - -[[LLM: Provide an API service template that follows the framework's conventions. Include proper TypeScript types, error handling, and async patterns.]] - -### API Client Configuration - -[[LLM: Show how to configure the HTTP client for the chosen framework, including authentication interceptors/middleware and error handling.]] - -## Routing - -[[LLM: Define routing structure and patterns based on the chosen framework. After presenting this section, apply `tasks#advanced-elicitation` protocol]] - -### Route Configuration - -[[LLM: Provide routing configuration appropriate for the chosen framework. Include protected route patterns, lazy loading where applicable, and authentication guards/middleware.]] - -## Styling Guidelines - -[[LLM: Define styling approach based on the chosen framework. After presenting this section, apply `tasks#advanced-elicitation` protocol]] - -### Styling Approach - -[[LLM: Describe the styling methodology appropriate for the chosen framework (CSS Modules, Styled Components, Tailwind, etc.) and provide basic patterns.]] - -### Global Theme Variables - -[[LLM: Provide a CSS custom properties (CSS variables) theme system that works across all frameworks. Include colors, spacing, typography, shadows, and dark mode support.]] - -## Testing Requirements - -[[LLM: Define minimal testing requirements based on the chosen framework. After presenting this section, apply `tasks#advanced-elicitation` protocol]] - -### Component Test Template - -[[LLM: Provide a basic component test template using the framework's recommended testing library. Include examples of rendering tests, user interaction tests, and mocking.]] - -### Testing Best Practices - -1. **Unit Tests**: Test individual components in isolation -2. **Integration Tests**: Test component interactions -3. **E2E Tests**: Test critical user flows (using Cypress/Playwright) -4. **Coverage Goals**: Aim for 80% code coverage -5. **Test Structure**: Arrange-Act-Assert pattern -6. **Mock External Dependencies**: API calls, routing, state management - -## Environment Configuration - -[[LLM: List required environment variables based on the chosen framework. Show the appropriate format and naming conventions for the framework. After presenting this section, apply `tasks#advanced-elicitation` protocol]] - -## Frontend Developer Standards - -### Critical Coding Rules - -[[LLM: List essential rules that prevent common AI mistakes, including both universal rules and framework-specific ones. After presenting this section, apply `tasks#advanced-elicitation` protocol]] - -### Quick Reference - -[[LLM: Create a framework-specific cheat sheet with: - -- Common commands (dev server, build, test) -- Key import patterns -- File naming conventions -- Project-specific patterns and utilities]] -==================== END: .bmad-core/templates/front-end-architecture-tmpl.md ==================== - -==================== START: .bmad-core/templates/fullstack-architecture-tmpl.md ==================== -# {{Project Name}} Fullstack Architecture Document - -[[LLM: The default path and filename unless specified is docs/architecture.md]] - -[[LLM: If available, review any provided relevant documents to gather all relevant context before beginning. At minimum, you should have access to docs/prd.md and docs/front-end-spec.md. Ask the user for any documents you need but cannot locate. This template creates a unified architecture that covers both backend and frontend concerns to guide AI-driven fullstack development.]] - -## Introduction - -[[LLM: This section establishes the document's purpose and scope. Keep the content below but ensure project name is properly substituted. - -After presenting this section, apply `tasks#advanced-elicitation` protocol]] - -This document outlines the complete fullstack architecture for {{Project Name}}, including backend systems, frontend implementation, and their integration. It serves as the single source of truth for AI-driven development, ensuring consistency across the entire technology stack. - -This unified approach combines what would traditionally be separate backend and frontend architecture documents, streamlining the development process for modern fullstack applications where these concerns are increasingly intertwined. - -### Starter Template or Existing Project - -[[LLM: Before proceeding with architecture design, check if the project is based on any starter templates or existing codebases: - -1. Review the PRD and other documents for mentions of: - -- Fullstack starter templates (e.g., T3 Stack, MEAN/MERN starters, Django + React templates) -- Monorepo templates (e.g., Nx, Turborepo starters) -- Platform-specific starters (e.g., Vercel templates, AWS Amplify starters) -- Existing projects being extended or cloned - -2. If starter templates or existing projects are mentioned: - -- Ask the user to provide access (links, repos, or files) -- Analyze to understand pre-configured choices and constraints -- Note any architectural decisions already made -- Identify what can be modified vs what must be retained - -3. If no starter is mentioned but this is greenfield: - -- Suggest appropriate fullstack starters based on tech preferences -- Consider platform-specific options (Vercel, AWS, etc.) -- Let user decide whether to use one - -4. Document the decision and any constraints it imposes - -If none, state "N/A - Greenfield project" - -### Change Log - -[[LLM: Track document versions and changes]] - -| Date | Version | Description | Author | -| :--- | :------ | :---------- | :----- | - -## High Level Architecture - -[[LLM: This section contains multiple subsections that establish the foundation. Present all subsections together, then apply `tasks#advanced-elicitation` protocol to the complete section.]] - -### Technical Summary - -[[LLM: Provide a comprehensive overview (4-6 sentences) covering: - -- Overall architectural style and deployment approach -- Frontend framework and backend technology choices -- Key integration points between frontend and backend -- Infrastructure platform and services -- How this architecture achieves PRD goals]] - -### Platform and Infrastructure Choice - -[[LLM: Based on PRD requirements and technical assumptions, make a platform recommendation: - -1. Consider common patterns (not an exhaustive list, use your own best judgement and search the web as needed for emerging trends): - - - **Vercel + Supabase**: For rapid development with Next.js, built-in auth/storage - - **AWS Full Stack**: For enterprise scale with Lambda, API Gateway, S3, Cognito - - **Azure**: For .NET ecosystems or enterprise Microsoft environments - - **Google Cloud**: For ML/AI heavy applications or Google ecosystem integration - -2. Present 2-3 viable options with clear pros/cons -3. Make a recommendation with rationale -4. Get explicit user confirmation - -Document the choice and key services that will be used.]] - -**Platform:** {{selected_platform}} -**Key Services:** {{core_services_list}} -**Deployment Host and Regions:** {{regions}} - -### Repository Structure - -[[LLM: Define the repository approach based on PRD requirements and platform choice, explain your rationale or ask quetsions to the user if unsure: - -1. For modern fullstack apps, monorepo is often preferred -2. Consider tooling (Nx, Turborepo, Lerna, npm workspaces) -3. Define package/app boundaries -4. Plan for shared code between frontend and backend]] - -**Structure:** {{repo_structure_choice}} -**Monorepo Tool:** {{monorepo_tool_if_applicable}} -**Package Organization:** {{package_strategy}} - -### High Level Architecture Diagram - -[[LLM: Create a Mermaid diagram showing the complete system architecture including: - -- User entry points (web, mobile) -- Frontend application deployment -- API layer (REST/GraphQL) -- Backend services -- Databases and storage -- External integrations -- CDN and caching layers - -Use appropriate diagram type for clarity.]] - -```mermaid -{{architecture_diagram}} -``` - -### Architectural Patterns - -[[LLM: List patterns that will guide both frontend and backend development. Include patterns for: - -- Overall architecture (e.g., Jamstack, Serverless, Microservices) -- Frontend patterns (e.g., Component-based, State management) -- Backend patterns (e.g., Repository, CQRS, Event-driven) -- Integration patterns (e.g., BFF, API Gateway) - -For each pattern, provide recommendation and rationale.]] - -<> - -- **{{pattern_name}}:** {{pattern_description}} - _Rationale:_ {{rationale}} - <> - -@{example: patterns} - -- **Jamstack Architecture:** Static site generation with serverless APIs - _Rationale:_ Optimal performance and scalability for content-heavy applications -- **Component-Based UI:** Reusable React components with TypeScript - _Rationale:_ Maintainability and type safety across large codebases -- **Repository Pattern:** Abstract data access logic - _Rationale:_ Enables testing and future database migration flexibility -- **API Gateway Pattern:** Single entry point for all API calls - _Rationale:_ Centralized auth, rate limiting, and monitoring - @{/example} - -## Tech Stack - -[[LLM: This is the DEFINITIVE technology selection for the entire project. Work with user to finalize all choices. This table is the single source of truth - all development must use these exact versions. - -Key areas to cover: - -- Frontend and backend languages/frameworks -- Databases and caching -- Authentication and authorization -- API approach -- Testing tools for both frontend and backend -- Build and deployment tools -- Monitoring and logging - -Upon render, apply `tasks#advanced-elicitation` display immediately.]] - -### Technology Stack Table - -| Category | Technology | Version | Purpose | Rationale | -| :----------------------- | :---------------- | :---------- | :---------- | :------------- | -| **Frontend Language** | {{fe_language}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **Frontend Framework** | {{fe_framework}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **UI Component Library** | {{ui_library}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **State Management** | {{state_mgmt}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **Backend Language** | {{be_language}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **Backend Framework** | {{be_framework}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **API Style** | {{api_style}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **Database** | {{database}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **Cache** | {{cache}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **File Storage** | {{storage}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **Authentication** | {{auth}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **Frontend Testing** | {{fe_test}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **Backend Testing** | {{be_test}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **E2E Testing** | {{e2e_test}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **Build Tool** | {{build_tool}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **Bundler** | {{bundler}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **IaC Tool** | {{iac_tool}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **CI/CD** | {{cicd}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **Monitoring** | {{monitoring}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **Logging** | {{logging}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **CSS Framework** | {{css_framework}} | {{version}} | {{purpose}} | {{why_chosen}} | - -@{example: tech_stack_rows} -| **Frontend Language** | TypeScript | 5.3.3 | Type-safe frontend development | Strong typing, excellent tooling | -| **Frontend Framework** | Next.js | 14.1.0 | React framework with SSR/SSG | SEO, performance, Vercel integration | -| **Backend Language** | TypeScript | 5.3.3 | Type-safe backend development | Code sharing with frontend | -| **API Style** | REST + tRPC | - | Type-safe API communication | End-to-end type safety | -| **Database** | PostgreSQL | 16.1 | Primary data store | ACID compliance, JSON support | -| **Authentication** | Supabase Auth | 2.39.0 | User authentication | Built-in auth flows, social providers | -@{/example} - -## Data Models - -[[LLM: Define the core data models/entities that will be shared between frontend and backend: - -1. Review PRD requirements and identify key business entities -2. For each model, explain its purpose and relationships -3. Include key attributes and data types -4. Show relationships between models -5. Create TypeScript interfaces that can be shared -6. Discuss design decisions with user - -Create a clear conceptual model before moving to database schema. - -After presenting all data models, apply `tasks#advanced-elicitation` protocol]] - -<> - -### {{model_name}} - -**Purpose:** {{model_purpose}} - -**Key Attributes:** - -- {{attribute_1}}: {{type_1}} - {{description_1}} -- {{attribute_2}}: {{type_2}} - {{description_2}} - -**TypeScript Interface:** - -```typescript -{ - { - model_interface; - } -} -``` - -**Relationships:** - -- {{relationship_1}} -- {{relationship_2}} - <> - -@{example: data_model} - -### User - -**Purpose:** Represents authenticated users in the system - -**Key Attributes:** - -- id: string - Unique identifier -- email: string - User's email address -- name: string - Display name -- role: enum - User permission level -- timestamps: Date - Created and updated times - -**TypeScript Interface:** - -```typescript -interface User { - id: string; - email: string; - name: string; - role: "admin" | "user" | "guest"; - createdAt: Date; - updatedAt: Date; - profile?: UserProfile; -} - -interface UserProfile { - avatarUrl?: string; - bio?: string; - preferences: Record; -} -``` - -**Relationships:** - -- Has many Posts (1:n) -- Has one Profile (1:1) - @{/example} - -## REST API Spec - -[[LLM: Based on the chosen API style from Tech Stack: - -1. If REST API, create an OpenAPI 3.0 specification -2. If GraphQL, provide the GraphQL schema -3. If tRPC, show router definitions -4. Include all endpoints from epics/stories -5. Define request/response schemas based on data models -6. Document authentication requirements -7. Include example requests/responses - -Use appropriate format for the chosen API style. If no API (e.g., static site), skip this section.]] - -^^CONDITION: has_rest_api^^ - -```yaml -openapi: 3.0.0 -info: - title: - '[object Object]': null - version: - '[object Object]': null - description: - '[object Object]': null -servers: - - url: - '[object Object]': null - description: - '[object Object]': null -``` - -^^/CONDITION: has_rest_api^^ - -^^CONDITION: has_graphql_api^^ - -```graphql -# GraphQL Schema -{{graphql_schema}} -``` - -^^/CONDITION: has_graphql_api^^ - -^^CONDITION: has_trpc_api^^ - -```typescript -// tRPC Router Definitions -{ - { - trpc_routers; - } -} -``` - -^^/CONDITION: has_trpc_api^^ - -[[LLM: After presenting the API spec (or noting its absence if not applicable), apply `tasks#advanced-elicitation` protocol]] - -## Components - -[[LLM: Based on the architectural patterns, tech stack, and data models from above: - -1. Identify major logical components/services across the fullstack -2. Consider both frontend and backend components -3. Define clear boundaries and interfaces between components -4. For each component, specify: - -- Primary responsibility -- Key interfaces/APIs exposed -- Dependencies on other components -- Technology specifics based on tech stack choices - -5. Create component diagrams where helpful -6. After presenting all components, apply `tasks#advanced-elicitation` protocol]] - -<> - -### {{component_name}} - -**Responsibility:** {{component_description}} - -**Key Interfaces:** - -- {{interface_1}} -- {{interface_2}} - -**Dependencies:** {{dependencies}} - -**Technology Stack:** {{component_tech_details}} -<> - -### Component Diagrams - -[[LLM: Create Mermaid diagrams to visualize component relationships. Options: - -- C4 Container diagram for high-level view -- Component diagram for detailed internal structure -- Sequence diagrams for complex interactions - Choose the most appropriate for clarity - -After presenting the diagrams, apply `tasks#advanced-elicitation` protocol]] - -## External APIs - -[[LLM: For each external service integration: - -1. Identify APIs needed based on PRD requirements and component design -2. If documentation URLs are unknown, ask user for specifics -3. Document authentication methods and security considerations -4. List specific endpoints that will be used -5. Note any rate limits or usage constraints - -If no external APIs are needed, state this explicitly and skip to next section.]] - -^^CONDITION: has_external_apis^^ - -<> - -### {{api_name}} API - -- **Purpose:** {{api_purpose}} -- **Documentation:** {{api_docs_url}} -- **Base URL(s):** {{api_base_url}} -- **Authentication:** {{auth_method}} -- **Rate Limits:** {{rate_limits}} - -**Key Endpoints Used:** -<> - -- `{{method}} {{endpoint_path}}` - {{endpoint_purpose}} - <> - -**Integration Notes:** {{integration_considerations}} -<> - -@{example: external_api} - -### Stripe API - -- **Purpose:** Payment processing and subscription management -- **Documentation:** https://stripe.com/docs/api -- **Base URL(s):** `https://api.stripe.com/v1` -- **Authentication:** Bearer token with secret key -- **Rate Limits:** 100 requests per second - -**Key Endpoints Used:** - -- `POST /customers` - Create customer profiles -- `POST /payment_intents` - Process payments -- `POST /subscriptions` - Manage subscriptions - @{/example} - -^^/CONDITION: has_external_apis^^ - -[[LLM: After presenting external APIs (or noting their absence), apply `tasks#advanced-elicitation` protocol]] - -## Core Workflows - -[[LLM: Illustrate key system workflows using sequence diagrams: - -1. Identify critical user journeys from PRD -2. Show component interactions including external APIs -3. Include both frontend and backend flows -4. Include error handling paths -5. Document async operations -6. Create both high-level and detailed diagrams as needed - -Focus on workflows that clarify architecture decisions or complex interactions. - -After presenting the workflow diagrams, apply `tasks#advanced-elicitation` protocol]] - -## Database Schema - -[[LLM: Transform the conceptual data models into concrete database schemas: - -1. Use the database type(s) selected in Tech Stack -2. Create schema definitions using appropriate notation -3. Include indexes, constraints, and relationships -4. Consider performance and scalability -5. For NoSQL, show document structures - -Present schema in format appropriate to database type (SQL DDL, JSON schema, etc.) - -After presenting the database schema, apply `tasks#advanced-elicitation` protocol]] - -## Frontend Architecture - -[[LLM: Define frontend-specific architecture details. After each subsection, note if user wants to refine before continuing. - -After presenting this section, apply `tasks#advanced-elicitation` protocol]] - -### Component Architecture - -[[LLM: Define component organization and patterns based on chosen framework.]] - -**Component Organization:** - -```text -{{component_structure}} -``` - -**Component Template:** - -```typescript -{ - { - component_template; - } -} -``` - -### State Management Architecture - -[[LLM: Detail state management approach based on chosen solution.]] - -**State Structure:** - -```typescript -{ - { - state_structure; - } -} -``` - -**State Management Patterns:** - -- {{pattern_1}} -- {{pattern_2}} - -### Routing Architecture - -[[LLM: Define routing structure based on framework choice.]] - -**Route Organization:** - -```text -{{route_structure}} -``` - -**Protected Route Pattern:** - -```typescript -{ - { - protected_route_example; - } -} -``` - -### Frontend Services Layer - -[[LLM: Define how frontend communicates with backend.]] - -**API Client Setup:** - -```typescript -{ - { - api_client_setup; - } -} -``` - -**Service Example:** - -```typescript -{ - { - service_example; - } -} -``` - -## Backend Architecture - -[[LLM: Define backend-specific architecture details. Consider serverless vs traditional server approaches. - -After presenting this section, apply `tasks#advanced-elicitation` protocol]] - -### Service Architecture - -[[LLM: Based on platform choice, define service organization.]] - -^^CONDITION: serverless^^ -**Function Organization:** - -```text - -{{function_structure}} - -``` - -**Function Template:** - -```typescript -{ - { - function_template; - } -} -``` - -^^/CONDITION: serverless^^ - -^^CONDITION: traditional_server^^ -**Controller/Route Organization:** - -```text -{{controller_structure}} -``` - -**Controller Template:** - -```typescript -{ - { - controller_template; - } -} -``` - -^^/CONDITION: traditional_server^^ - -### Database Architecture - -[[LLM: Define database schema and access patterns.]] - -**Schema Design:** - -```sql -{{database_schema}} -``` - -**Data Access Layer:** - -```typescript -{ - { - repository_pattern; - } -} -``` - -### Authentication and Authorization - -[[LLM: Define auth implementation details.]] - -**Auth Flow:** - -```mermaid -{{auth_flow_diagram}} -``` - -**Middleware/Guards:** - -```typescript -{ - { - auth_middleware; - } -} -``` - -## Unified Project Structure - -[[LLM: Create a monorepo structure that accommodates both frontend and backend. Adapt based on chosen tools and frameworks. After presenting, apply `tasks#advanced-elicitation` protocol.]] - -```plaintext -{{project-name}}/ -├── .github/ # CI/CD workflows -│ └── workflows/ -│ ├── ci.yaml -│ └── deploy.yaml -├── apps/ # Application packages -│ ├── web/ # Frontend application -│ │ ├── src/ -│ │ │ ├── components/ # UI components -│ │ │ ├── pages/ # Page components/routes -│ │ │ ├── hooks/ # Custom React hooks -│ │ │ ├── services/ # API client services -│ │ │ ├── stores/ # State management -│ │ │ ├── styles/ # Global styles/themes -│ │ │ └── utils/ # Frontend utilities -│ │ ├── public/ # Static assets -│ │ ├── tests/ # Frontend tests -│ │ └── package.json -│ └── api/ # Backend application -│ ├── src/ -│ │ ├── routes/ # API routes/controllers -│ │ ├── services/ # Business logic -│ │ ├── models/ # Data models -│ │ ├── middleware/ # Express/API middleware -│ │ ├── utils/ # Backend utilities -│ │ └── {{serverless_or_server_entry}} -│ ├── tests/ # Backend tests -│ └── package.json -├── packages/ # Shared packages -│ ├── shared/ # Shared types/utilities -│ │ ├── src/ -│ │ │ ├── types/ # TypeScript interfaces -│ │ │ ├── constants/ # Shared constants -│ │ │ └── utils/ # Shared utilities -│ │ └── package.json -│ ├── ui/ # Shared UI components -│ │ ├── src/ -│ │ └── package.json -│ └── config/ # Shared configuration -│ ├── eslint/ -│ ├── typescript/ -│ └── jest/ -├── infrastructure/ # IaC definitions -│ └── {{iac_structure}} -├── scripts/ # Build/deploy scripts -├── docs/ # Documentation -│ ├── prd.md -│ ├── front-end-spec.md -│ └── fullstack-architecture.md -├── .env.example # Environment template -├── package.json # Root package.json -├── {{monorepo_config}} # Monorepo configuration -└── README.md -``` - -@{example: vercel_structure} -apps/ -├── web/ # Next.js app -│ ├── app/ # App directory (Next.js 14+) -│ ├── components/ -│ └── lib/ -└── api/ # API routes in Next.js or separate -└── pages/api/ # API routes -@{/example} - -## Development Workflow - -[[LLM: Define the development setup and workflow for the fullstack application. - -After presenting this section, apply `tasks#advanced-elicitation` protocol]] - -### Local Development Setup - -**Prerequisites:** - -```bash -{{prerequisites_commands}} -``` - -**Initial Setup:** - -```bash -{{setup_commands}} -``` - -**Development Commands:** - -```bash -# Start all services -{{start_all_command}} - -# Start frontend only -{{start_frontend_command}} - -# Start backend only -{{start_backend_command}} - -# Run tests -{{test_commands}} -``` - -### Environment Configuration - -**Required Environment Variables:** - -```bash -# Frontend (.env.local) -{{frontend_env_vars}} - -# Backend (.env) -{{backend_env_vars}} - -# Shared -{{shared_env_vars}} -``` - -## Deployment Architecture - -[[LLM: Define deployment strategy based on platform choice. After presenting, apply `tasks#advanced-elicitation` protocol.]] - -### Deployment Strategy - -**Frontend Deployment:** - -- **Platform:** {{frontend_deploy_platform}} -- **Build Command:** {{frontend_build_command}} -- **Output Directory:** {{frontend_output_dir}} -- **CDN/Edge:** {{cdn_strategy}} - -**Backend Deployment:** - -- **Platform:** {{backend_deploy_platform}} -- **Build Command:** {{backend_build_command}} -- **Deployment Method:** {{deployment_method}} - -### CI/CD Pipeline - -```yaml -'[object Object]': null -``` - -### Environments - -| Environment | Frontend URL | Backend URL | Purpose | -| :---------- | :----------------- | :----------------- | :--------------------- | -| Development | {{dev_fe_url}} | {{dev_be_url}} | Local development | -| Staging | {{staging_fe_url}} | {{staging_be_url}} | Pre-production testing | -| Production | {{prod_fe_url}} | {{prod_be_url}} | Live environment | - -## Security and Performance - -[[LLM: Define security and performance considerations for the fullstack application. - -After presenting this section, apply `tasks#advanced-elicitation` protocol]] - -### Security Requirements - -**Frontend Security:** - -- CSP Headers: {{csp_policy}} -- XSS Prevention: {{xss_strategy}} -- Secure Storage: {{storage_strategy}} - -**Backend Security:** - -- Input Validation: {{validation_approach}} -- Rate Limiting: {{rate_limit_config}} -- CORS Policy: {{cors_config}} - -**Authentication Security:** - -- Token Storage: {{token_strategy}} -- Session Management: {{session_approach}} -- Password Policy: {{password_requirements}} - -### Performance Optimization - -**Frontend Performance:** - -- Bundle Size Target: {{bundle_size}} -- Loading Strategy: {{loading_approach}} -- Caching Strategy: {{fe_cache_strategy}} - -**Backend Performance:** - -- Response Time Target: {{response_target}} -- Database Optimization: {{db_optimization}} -- Caching Strategy: {{be_cache_strategy}} - -## Testing Strategy - -[[LLM: Define comprehensive testing approach for fullstack application. - -After presenting this section, apply `tasks#advanced-elicitation` protocol]] - -### Testing Pyramid - -```text - - E2E Tests - / \ - Integration Tests - -/ \ - Frontend Unit Backend Unit - -``` - -### Test Organization - -**Frontend Tests:** - -```text - -{{frontend_test_structure}} - -``` - -**Backend Tests:** - -```text - -{{backend_test_structure}} - -``` - -**E2E Tests:** - -```text - -{{e2e_test_structure}} - -``` - -### Test Examples - -**Frontend Component Test:** - -```typescript -{ - { - frontend_test_example; - } -} -``` - -**Backend API Test:** - -```typescript -{ - { - backend_test_example; - } -} -``` - -**E2E Test:** - -```typescript -{ - { - e2e_test_example; - } -} -``` - -## Coding Standards - -[[LLM: Define MINIMAL but CRITICAL standards for AI agents. Focus only on project-specific rules that prevent common mistakes. These will be used by dev agents. - -After presenting this section, apply `tasks#advanced-elicitation` protocol]] - -### Critical Fullstack Rules - -<> - -- **{{rule_name}}:** {{rule_description}} - <> - -@{example: critical_rules} - -- **Type Sharing:** Always define types in packages/shared and import from there -- **API Calls:** Never make direct HTTP calls - use the service layer -- **Environment Variables:** Access only through config objects, never process.env directly -- **Error Handling:** All API routes must use the standard error handler -- **State Updates:** Never mutate state directly - use proper state management patterns - @{/example} - -### Naming Conventions - -| Element | Frontend | Backend | Example | -| :-------------- | :------------------- | :--------- | :------------------ | -| Components | PascalCase | - | `UserProfile.tsx` | -| Hooks | camelCase with 'use' | - | `useAuth.ts` | -| API Routes | - | kebab-case | `/api/user-profile` | -| Database Tables | - | snake_case | `user_profiles` | - -## Error Handling Strategy - -[[LLM: Define unified error handling across frontend and backend. - -After presenting this section, apply `tasks#advanced-elicitation` protocol]] - -### Error Flow - -```mermaid -{{error_flow_diagram}} -``` - -### Error Response Format - -```typescript -interface ApiError { - error: { - code: string; - message: string; - details?: Record; - timestamp: string; - requestId: string; - }; -} -``` - -### Frontend Error Handling - -```typescript -{ - { - frontend_error_handler; - } -} -``` - -### Backend Error Handling - -```typescript -{ - { - backend_error_handler; - } -} -``` - -## Monitoring and Observability - -[[LLM: Define monitoring strategy for fullstack application. - -After presenting this section, apply `tasks#advanced-elicitation` protocol]] - -### Monitoring Stack - -- **Frontend Monitoring:** {{frontend_monitoring}} -- **Backend Monitoring:** {{backend_monitoring}} -- **Error Tracking:** {{error_tracking}} -- **Performance Monitoring:** {{perf_monitoring}} - -### Key Metrics - -**Frontend Metrics:** - -- Core Web Vitals -- JavaScript errors -- API response times -- User interactions - -**Backend Metrics:** - -- Request rate -- Error rate -- Response time -- Database query performance - -## Checklist Results Report - -[[LLM: Before running the checklist, offer to output the full architecture document. Once user confirms, execute the `architect-checklist` and populate results here.]] -==================== END: .bmad-core/templates/fullstack-architecture-tmpl.md ==================== - -==================== START: .bmad-core/templates/brownfield-architecture-tmpl.md ==================== -# {{Project Name}} Brownfield Enhancement Architecture - -[[LLM: The default path and filename unless specified is docs/architecture.md]] - -[[LLM: IMPORTANT - SCOPE AND ASSESSMENT REQUIRED: - -This architecture document is for SIGNIFICANT enhancements to existing projects that require comprehensive architectural planning. Before proceeding: - -1. **Verify Complexity**: Confirm this enhancement requires architectural planning. For simple additions, recommend: "For simpler changes that don't require architectural planning, consider using the brownfield-create-epic or brownfield-create-story task with the Product Owner instead." - -2. **REQUIRED INPUTS**: - - - Completed brownfield-prd.md - - Existing project technical documentation (from docs folder or user-provided) - - Access to existing project structure (IDE or uploaded files) - -3. **DEEP ANALYSIS MANDATE**: You MUST conduct thorough analysis of the existing codebase, architecture patterns, and technical constraints before making ANY architectural recommendations. Every suggestion must be based on actual project analysis, not assumptions. - -4. **CONTINUOUS VALIDATION**: Throughout this process, explicitly validate your understanding with the user. For every architectural decision, confirm: "Based on my analysis of your existing system, I recommend [decision] because [evidence from actual project]. Does this align with your system's reality?" - -If any required inputs are missing, request them before proceeding.]] - -## Introduction - -[[LLM: This section establishes the document's purpose and scope for brownfield enhancements. Keep the content below but ensure project name and enhancement details are properly substituted. - -After presenting this section, apply `tasks#advanced-elicitation` protocol]] - -This document outlines the architectural approach for enhancing {{Project Name}} with {{Enhancement Description}}. Its primary goal is to serve as the guiding architectural blueprint for AI-driven development of new features while ensuring seamless integration with the existing system. - -**Relationship to Existing Architecture:** -This document supplements existing project architecture by defining how new components will integrate with current systems. Where conflicts arise between new and existing patterns, this document provides guidance on maintaining consistency while implementing enhancements. - -### Existing Project Analysis - -[[LLM: Analyze the existing project structure and architecture: - -1. Review existing documentation in docs folder -2. Examine current technology stack and versions -3. Identify existing architectural patterns and conventions -4. Note current deployment and infrastructure setup -5. Document any constraints or limitations - -CRITICAL: After your analysis, explicitly validate your findings: "Based on my analysis of your project, I've identified the following about your existing system: [key findings]. Please confirm these observations are accurate before I proceed with architectural recommendations." - -Present findings and apply `tasks#advanced-elicitation` protocol]] - -**Current Project State:** - -- **Primary Purpose:** {{existing_project_purpose}} -- **Current Tech Stack:** {{existing_tech_summary}} -- **Architecture Style:** {{existing_architecture_style}} -- **Deployment Method:** {{existing_deployment_approach}} - -**Available Documentation:** - -- {{existing_docs_summary}} - -**Identified Constraints:** - -- {{constraint_1}} -- {{constraint_2}} -- {{constraint_3}} - -### Change Log - -| Change | Date | Version | Description | Author | -| ------ | ---- | ------- | ----------- | ------ | - -## Enhancement Scope and Integration Strategy - -[[LLM: Define how the enhancement will integrate with the existing system: - -1. Review the brownfield PRD enhancement scope -2. Identify integration points with existing code -3. Define boundaries between new and existing functionality -4. Establish compatibility requirements - -VALIDATION CHECKPOINT: Before presenting the integration strategy, confirm: "Based on my analysis, the integration approach I'm proposing takes into account [specific existing system characteristics]. These integration points and boundaries respect your current architecture patterns. Is this assessment accurate?" - -Present complete integration strategy and apply `tasks#advanced-elicitation` protocol]] - -### Enhancement Overview - -**Enhancement Type:** {{enhancement_type}} -**Scope:** {{enhancement_scope}} -**Integration Impact:** {{integration_impact_level}} - -### Integration Approach - -**Code Integration Strategy:** {{code_integration_approach}} -**Database Integration:** {{database_integration_approach}} -**API Integration:** {{api_integration_approach}} -**UI Integration:** {{ui_integration_approach}} - -### Compatibility Requirements - -- **Existing API Compatibility:** {{api_compatibility}} -- **Database Schema Compatibility:** {{db_compatibility}} -- **UI/UX Consistency:** {{ui_compatibility}} -- **Performance Impact:** {{performance_constraints}} - -## Tech Stack Alignment - -[[LLM: Ensure new components align with existing technology choices: - -1. Use existing technology stack as the foundation -2. Only introduce new technologies if absolutely necessary -3. Justify any new additions with clear rationale -4. Ensure version compatibility with existing dependencies - -Present complete tech stack alignment and apply `tasks#advanced-elicitation` protocol]] - -### Existing Technology Stack - -[[LLM: Document the current stack that must be maintained or integrated with]] - -| Category | Current Technology | Version | Usage in Enhancement | Notes | -| :----------------- | :----------------- | :---------- | :------------------- | :-------- | -| **Language** | {{language}} | {{version}} | {{usage}} | {{notes}} | -| **Runtime** | {{runtime}} | {{version}} | {{usage}} | {{notes}} | -| **Framework** | {{framework}} | {{version}} | {{usage}} | {{notes}} | -| **Database** | {{database}} | {{version}} | {{usage}} | {{notes}} | -| **API Style** | {{api_style}} | {{version}} | {{usage}} | {{notes}} | -| **Authentication** | {{auth}} | {{version}} | {{usage}} | {{notes}} | -| **Testing** | {{test_framework}} | {{version}} | {{usage}} | {{notes}} | -| **Build Tool** | {{build_tool}} | {{version}} | {{usage}} | {{notes}} | - -### New Technology Additions - -[[LLM: Only include if new technologies are required for the enhancement]] - -^^CONDITION: has_new_tech^^ - -| Technology | Version | Purpose | Rationale | Integration Method | -| :----------- | :---------- | :---------- | :------------ | :----------------- | -| {{new_tech}} | {{version}} | {{purpose}} | {{rationale}} | {{integration}} | - -^^/CONDITION: has_new_tech^^ - -## Data Models and Schema Changes - -[[LLM: Define new data models and how they integrate with existing schema: - -1. Identify new entities required for the enhancement -2. Define relationships with existing data models -3. Plan database schema changes (additions, modifications) -4. Ensure backward compatibility - -Present data model changes and apply `tasks#advanced-elicitation` protocol]] - -### New Data Models - -<> - -### {{model_name}} - -**Purpose:** {{model_purpose}} -**Integration:** {{integration_with_existing}} - -**Key Attributes:** - -- {{attribute_1}}: {{type_1}} - {{description_1}} -- {{attribute_2}}: {{type_2}} - {{description_2}} - -**Relationships:** - -- **With Existing:** {{existing_relationships}} -- **With New:** {{new_relationships}} - -<> - -### Schema Integration Strategy - -**Database Changes Required:** - -- **New Tables:** {{new_tables_list}} -- **Modified Tables:** {{modified_tables_list}} -- **New Indexes:** {{new_indexes_list}} -- **Migration Strategy:** {{migration_approach}} - -**Backward Compatibility:** - -- {{compatibility_measure_1}} -- {{compatibility_measure_2}} - -## Component Architecture - -[[LLM: Define new components and their integration with existing architecture: - -1. Identify new components required for the enhancement -2. Define interfaces with existing components -3. Establish clear boundaries and responsibilities -4. Plan integration points and data flow - -MANDATORY VALIDATION: Before presenting component architecture, confirm: "The new components I'm proposing follow the existing architectural patterns I identified in your codebase: [specific patterns]. The integration interfaces respect your current component structure and communication patterns. Does this match your project's reality?" - -Present component architecture and apply `tasks#advanced-elicitation` protocol]] - -### New Components - -<> - -### {{component_name}} - -**Responsibility:** {{component_description}} -**Integration Points:** {{integration_points}} - -**Key Interfaces:** - -- {{interface_1}} -- {{interface_2}} - -**Dependencies:** - -- **Existing Components:** {{existing_dependencies}} -- **New Components:** {{new_dependencies}} - -**Technology Stack:** {{component_tech_details}} - -<> - -### Component Interaction Diagram - -[[LLM: Create Mermaid diagram showing how new components interact with existing ones]] - -```mermaid -{{component_interaction_diagram}} -``` - -## API Design and Integration - -[[LLM: Define new API endpoints and integration with existing APIs: - -1. Plan new API endpoints required for the enhancement -2. Ensure consistency with existing API patterns -3. Define authentication and authorization integration -4. Plan versioning strategy if needed - -Present API design and apply `tasks#advanced-elicitation` protocol]] - -### New API Endpoints - -^^CONDITION: has_new_api^^ - -**API Integration Strategy:** {{api_integration_strategy}} -**Authentication:** {{auth_integration}} -**Versioning:** {{versioning_approach}} - -<> - -#### {{endpoint_name}} - -- **Method:** {{http_method}} -- **Endpoint:** {{endpoint_path}} -- **Purpose:** {{endpoint_purpose}} -- **Integration:** {{integration_with_existing}} - -**Request:** - -```json -{{request_schema}} -``` - -**Response:** - -```json -{{response_schema}} -``` - -<> - -^^/CONDITION: has_new_api^^ - -## External API Integration - -[[LLM: Document new external API integrations required for the enhancement]] - -^^CONDITION: has_new_external_apis^^ - -<> - -### {{api_name}} API - -- **Purpose:** {{api_purpose}} -- **Documentation:** {{api_docs_url}} -- **Base URL:** {{api_base_url}} -- **Authentication:** {{auth_method}} -- **Integration Method:** {{integration_approach}} - -**Key Endpoints Used:** - -- `{{method}} {{endpoint_path}}` - {{endpoint_purpose}} - -**Error Handling:** {{error_handling_strategy}} - -<> - -^^/CONDITION: has_new_external_apis^^ - -## Source Tree Integration - -[[LLM: Define how new code will integrate with existing project structure: - -1. Follow existing project organization patterns -2. Identify where new files/folders will be placed -3. Ensure consistency with existing naming conventions -4. Plan for minimal disruption to existing structure - -Present integration plan and apply `tasks#advanced-elicitation` protocol]] - -### Existing Project Structure - -[[LLM: Document relevant parts of current structure]] - -```plaintext -{{existing_structure_relevant_parts}} -``` - -### New File Organization - -[[LLM: Show only new additions to existing structure]] - -```plaintext -{{project-root}}/ -├── {{existing_structure_context}} -│ ├── {{new_folder_1}}/ # {{purpose_1}} -│ │ ├── {{new_file_1}} -│ │ └── {{new_file_2}} -│ ├── {{existing_folder}}/ # Existing folder with additions -│ │ ├── {{existing_file}} # Existing file -│ │ └── {{new_file_3}} # New addition -│ └── {{new_folder_2}}/ # {{purpose_2}} -``` - -### Integration Guidelines - -- **File Naming:** {{file_naming_consistency}} -- **Folder Organization:** {{folder_organization_approach}} -- **Import/Export Patterns:** {{import_export_consistency}} - -## Infrastructure and Deployment Integration - -[[LLM: Define how the enhancement will be deployed alongside existing infrastructure: - -1. Use existing deployment pipeline and infrastructure -2. Identify any infrastructure changes needed -3. Plan deployment strategy to minimize risk -4. Define rollback procedures - -Present deployment integration and apply `tasks#advanced-elicitation` protocol]] - -### Existing Infrastructure - -**Current Deployment:** {{existing_deployment_summary}} -**Infrastructure Tools:** {{existing_infrastructure_tools}} -**Environments:** {{existing_environments}} - -### Enhancement Deployment Strategy - -**Deployment Approach:** {{deployment_approach}} -**Infrastructure Changes:** {{infrastructure_changes}} -**Pipeline Integration:** {{pipeline_integration}} - -### Rollback Strategy - -**Rollback Method:** {{rollback_method}} -**Risk Mitigation:** {{risk_mitigation}} -**Monitoring:** {{monitoring_approach}} - -## Coding Standards and Conventions - -[[LLM: Ensure new code follows existing project conventions: - -1. Document existing coding standards from project analysis -2. Identify any enhancement-specific requirements -3. Ensure consistency with existing codebase patterns -4. Define standards for new code organization - -Present coding standards and apply `tasks#advanced-elicitation` protocol]] - -### Existing Standards Compliance - -**Code Style:** {{existing_code_style}} -**Linting Rules:** {{existing_linting}} -**Testing Patterns:** {{existing_test_patterns}} -**Documentation Style:** {{existing_doc_style}} - -### Enhancement-Specific Standards - -[[LLM: Only include if new patterns are needed for the enhancement]] - -<> - -- **{{standard_name}}:** {{standard_description}} - -<> - -### Critical Integration Rules - -- **Existing API Compatibility:** {{api_compatibility_rule}} -- **Database Integration:** {{db_integration_rule}} -- **Error Handling:** {{error_handling_integration}} -- **Logging Consistency:** {{logging_consistency}} - -## Testing Strategy - -[[LLM: Define testing approach for the enhancement: - -1. Integrate with existing test suite -2. Ensure existing functionality remains intact -3. Plan for testing new features -4. Define integration testing approach - -Present testing strategy and apply `tasks#advanced-elicitation` protocol]] - -### Integration with Existing Tests - -**Existing Test Framework:** {{existing_test_framework}} -**Test Organization:** {{existing_test_organization}} -**Coverage Requirements:** {{existing_coverage_requirements}} - -### New Testing Requirements - -#### Unit Tests for New Components - -- **Framework:** {{test_framework}} -- **Location:** {{test_location}} -- **Coverage Target:** {{coverage_target}} -- **Integration with Existing:** {{test_integration}} - -#### Integration Tests - -- **Scope:** {{integration_test_scope}} -- **Existing System Verification:** {{existing_system_verification}} -- **New Feature Testing:** {{new_feature_testing}} - -#### Regression Testing - -- **Existing Feature Verification:** {{regression_test_approach}} -- **Automated Regression Suite:** {{automated_regression}} -- **Manual Testing Requirements:** {{manual_testing_requirements}} - -## Security Integration - -[[LLM: Ensure security consistency with existing system: - -1. Follow existing security patterns and tools -2. Ensure new features don't introduce vulnerabilities -3. Maintain existing security posture -4. Define security testing for new components - -Present security integration and apply `tasks#advanced-elicitation` protocol]] - -### Existing Security Measures - -**Authentication:** {{existing_auth}} -**Authorization:** {{existing_authz}} -**Data Protection:** {{existing_data_protection}} -**Security Tools:** {{existing_security_tools}} - -### Enhancement Security Requirements - -**New Security Measures:** {{new_security_measures}} -**Integration Points:** {{security_integration_points}} -**Compliance Requirements:** {{compliance_requirements}} - -### Security Testing - -**Existing Security Tests:** {{existing_security_tests}} -**New Security Test Requirements:** {{new_security_tests}} -**Penetration Testing:** {{pentest_requirements}} - -## Risk Assessment and Mitigation - -[[LLM: Identify and plan for risks specific to brownfield development: - -1. Technical integration risks -2. Deployment and operational risks -3. User impact and compatibility risks -4. Mitigation strategies for each risk - -Present risk assessment and apply `tasks#advanced-elicitation` protocol]] - -### Technical Risks - -<> - -**Risk:** {{risk_description}} -**Impact:** {{impact_level}} -**Likelihood:** {{likelihood}} -**Mitigation:** {{mitigation_strategy}} - -<> - -### Operational Risks - -<> - -**Risk:** {{risk_description}} -**Impact:** {{impact_level}} -**Likelihood:** {{likelihood}} -**Mitigation:** {{mitigation_strategy}} - -<> - -### Monitoring and Alerting - -**Enhanced Monitoring:** {{monitoring_additions}} -**New Alerts:** {{new_alerts}} -**Performance Monitoring:** {{performance_monitoring}} - -## Checklist Results Report - -[[LLM: Execute the architect-checklist and populate results here, focusing on brownfield-specific validation]] - -## Next Steps - -[[LLM: After completing the brownfield architecture: - -1. Review integration points with existing system -2. Begin story implementation with Dev agent -3. Set up deployment pipeline integration -4. Plan rollback and monitoring procedures]] - -### Story Manager Handoff - -[[LLM: Create a brief prompt for Story Manager to work with this brownfield enhancement. Include: - -- Reference to this architecture document -- Key integration requirements validated with user -- Existing system constraints based on actual project analysis -- First story to implement with clear integration checkpoints -- Emphasis on maintaining existing system integrity throughout implementation]] - -### Developer Handoff - -[[LLM: Create a brief prompt for developers starting implementation. Include: - -- Reference to this architecture and existing coding standards analyzed from actual project -- Integration requirements with existing codebase validated with user -- Key technical decisions based on real project constraints -- Existing system compatibility requirements with specific verification steps -- Clear sequencing of implementation to minimize risk to existing functionality]] -==================== END: .bmad-core/templates/brownfield-architecture-tmpl.md ==================== +==================== START: .bmad-core/templates/architecture-tmpl.yaml ==================== +template: + id: architecture-template-v2 + name: Architecture Document + version: 2.0 + output: + format: markdown + filename: docs/architecture.md + title: "{{project_name}} Architecture Document" + +workflow: + mode: interactive + elicitation: advanced-elicitation + +sections: + - id: introduction + title: Introduction + instruction: | + If available, review any provided relevant documents to gather all relevant context before beginning. If at a minimum you cannot locate docs/prd.md ask the user what docs will provide the basis for the architecture. + sections: + - id: intro-content + content: | + This document outlines the overall project architecture for {{project_name}}, including backend systems, shared services, and non-UI specific concerns. Its primary goal is to serve as the guiding architectural blueprint for AI-driven development, ensuring consistency and adherence to chosen patterns and technologies. + + **Relationship to Frontend Architecture:** + If the project includes a significant user interface, a separate Frontend Architecture Document will detail the frontend-specific design and MUST be used in conjunction with this document. Core technology stack choices documented herein (see "Tech Stack") are definitive for the entire project, including any frontend components. + - id: starter-template + title: Starter Template or Existing Project + instruction: | + Before proceeding further with architecture design, check if the project is based on a starter template or existing codebase: + + 1. Review the PRD and brainstorming brief for any mentions of: + - Starter templates (e.g., Create React App, Next.js, Vue CLI, Angular CLI, etc.) + - Existing projects or codebases being used as a foundation + - Boilerplate projects or scaffolding tools + - Previous projects to be cloned or adapted + + 2. If a starter template or existing project is mentioned: + - Ask the user to provide access via one of these methods: + - Link to the starter template documentation + - Upload/attach the project files (for small projects) + - Share a link to the project repository (GitHub, GitLab, etc.) + - Analyze the starter/existing project to understand: + - Pre-configured technology stack and versions + - Project structure and organization patterns + - Built-in scripts and tooling + - Existing architectural patterns and conventions + - Any limitations or constraints imposed by the starter + - Use this analysis to inform and align your architecture decisions + + 3. If no starter template is mentioned but this is a greenfield project: + - Suggest appropriate starter templates based on the tech stack preferences + - Explain the benefits (faster setup, best practices, community support) + - Let the user decide whether to use one + + 4. If the user confirms no starter template will be used: + - Proceed with architecture design from scratch + - Note that manual setup will be required for all tooling and configuration + + Document the decision here before proceeding with the architecture design. If none, just say N/A + elicit: true + - id: changelog + title: Change Log + type: table + columns: [Date, Version, Description, Author] + instruction: Track document versions and changes + + - id: high-level-architecture + title: High Level Architecture + instruction: | + This section contains multiple subsections that establish the foundation of the architecture. Present all subsections together at once. + elicit: true + sections: + - id: technical-summary + title: Technical Summary + instruction: | + Provide a brief paragraph (3-5 sentences) overview of: + - The system's overall architecture style + - Key components and their relationships + - Primary technology choices + - Core architectural patterns being used + - Reference back to the PRD goals and how this architecture supports them + - id: high-level-overview + title: High Level Overview + instruction: | + Based on the PRD's Technical Assumptions section, describe: + + 1. The main architectural style (e.g., Monolith, Microservices, Serverless, Event-Driven) + 2. Repository structure decision from PRD (Monorepo/Polyrepo) + 3. Service architecture decision from PRD + 4. Primary user interaction flow or data flow at a conceptual level + 5. Key architectural decisions and their rationale + - id: project-diagram + title: High Level Project Diagram + type: mermaid + mermaid_type: graph + instruction: | + Create a Mermaid diagram that visualizes the high-level architecture. Consider: + - System boundaries + - Major components/services + - Data flow directions + - External integrations + - User entry points + + - id: architectural-patterns + title: Architectural and Design Patterns + instruction: | + List the key high-level patterns that will guide the architecture. For each pattern: + + 1. Present 2-3 viable options if multiple exist + 2. Provide your recommendation with clear rationale + 3. Get user confirmation before finalizing + 4. These patterns should align with the PRD's technical assumptions and project goals + + Common patterns to consider: + - Architectural style patterns (Serverless, Event-Driven, Microservices, CQRS, Hexagonal) + - Code organization patterns (Dependency Injection, Repository, Module, Factory) + - Data patterns (Event Sourcing, Saga, Database per Service) + - Communication patterns (REST, GraphQL, Message Queue, Pub/Sub) + template: "- **{{pattern_name}}:** {{pattern_description}} - _Rationale:_ {{rationale}}" + examples: + - "**Serverless Architecture:** Using AWS Lambda for compute - _Rationale:_ Aligns with PRD requirement for cost optimization and automatic scaling" + - "**Repository Pattern:** Abstract data access logic - _Rationale:_ Enables testing and future database migration flexibility" + - "**Event-Driven Communication:** Using SNS/SQS for service decoupling - _Rationale:_ Supports async processing and system resilience" + + - id: tech-stack + title: Tech Stack + instruction: | + This is the DEFINITIVE technology selection section. Work with the user to make specific choices: + + 1. Review PRD technical assumptions and any preferences from .bmad-core/data/technical-preferences.yaml or an attached technical-preferences + 2. For each category, present 2-3 viable options with pros/cons + 3. Make a clear recommendation based on project needs + 4. Get explicit user approval for each selection + 5. Document exact versions (avoid "latest" - pin specific versions) + 6. This table is the single source of truth - all other docs must reference these choices + + Key decisions to finalize - before displaying the table, ensure you are aware of or ask the user about - let the user know if they are not sure on any that you can also provide suggestions with rationale: + + - Starter templates (if any) + - Languages and runtimes with exact versions + - Frameworks and libraries / packages + - Cloud provider and key services choices + - Database and storage solutions - if unclear suggest sql or nosql or other types depending on the project and depending on cloud provider offer a suggestion + - Development tools + + Upon render of the table, ensure the user is aware of the importance of this sections choices, should also look for gaps or disagreements with anything, ask for any clarifications if something is unclear why its in the list, and also right away elicit feedback - this statement and the options should be rendered and then prompt right all before allowing user input. + elicit: true + sections: + - id: cloud-infrastructure + title: Cloud Infrastructure + template: | + - **Provider:** {{cloud_provider}} + - **Key Services:** {{core_services_list}} + - **Deployment Regions:** {{regions}} + - id: technology-stack-table + title: Technology Stack Table + type: table + columns: [Category, Technology, Version, Purpose, Rationale] + instruction: Populate the technology stack table with all relevant technologies + examples: + - "| **Language** | TypeScript | 5.3.3 | Primary development language | Strong typing, excellent tooling, team expertise |" + - "| **Runtime** | Node.js | 20.11.0 | JavaScript runtime | LTS version, stable performance, wide ecosystem |" + - "| **Framework** | NestJS | 10.3.2 | Backend framework | Enterprise-ready, good DI, matches team patterns |" + + - id: data-models + title: Data Models + instruction: | + Define the core data models/entities: + + 1. Review PRD requirements and identify key business entities + 2. For each model, explain its purpose and relationships + 3. Include key attributes and data types + 4. Show relationships between models + 5. Discuss design decisions with user + + Create a clear conceptual model before moving to database schema. + elicit: true + repeatable: true + sections: + - id: model + title: "{{model_name}}" + template: | + **Purpose:** {{model_purpose}} + + **Key Attributes:** + - {{attribute_1}}: {{type_1}} - {{description_1}} + - {{attribute_2}}: {{type_2}} - {{description_2}} + + **Relationships:** + - {{relationship_1}} + - {{relationship_2}} + + - id: components + title: Components + instruction: | + Based on the architectural patterns, tech stack, and data models from above: + + 1. Identify major logical components/services and their responsibilities + 2. Consider the repository structure (monorepo/polyrepo) from PRD + 3. Define clear boundaries and interfaces between components + 4. For each component, specify: + - Primary responsibility + - Key interfaces/APIs exposed + - Dependencies on other components + - Technology specifics based on tech stack choices + + 5. Create component diagrams where helpful + elicit: true + sections: + - id: component-list + repeatable: true + title: "{{component_name}}" + template: | + **Responsibility:** {{component_description}} + + **Key Interfaces:** + - {{interface_1}} + - {{interface_2}} + + **Dependencies:** {{dependencies}} + + **Technology Stack:** {{component_tech_details}} + - id: component-diagrams + title: Component Diagrams + type: mermaid + instruction: | + Create Mermaid diagrams to visualize component relationships. Options: + - C4 Container diagram for high-level view + - Component diagram for detailed internal structure + - Sequence diagrams for complex interactions + Choose the most appropriate for clarity + + - id: external-apis + title: External APIs + condition: Project requires external API integrations + instruction: | + For each external service integration: + + 1. Identify APIs needed based on PRD requirements and component design + 2. If documentation URLs are unknown, ask user for specifics + 3. Document authentication methods and security considerations + 4. List specific endpoints that will be used + 5. Note any rate limits or usage constraints + + If no external APIs are needed, state this explicitly and skip to next section. + elicit: true + repeatable: true + sections: + - id: api + title: "{{api_name}} API" + template: | + - **Purpose:** {{api_purpose}} + - **Documentation:** {{api_docs_url}} + - **Base URL(s):** {{api_base_url}} + - **Authentication:** {{auth_method}} + - **Rate Limits:** {{rate_limits}} + + **Key Endpoints Used:** + - `{{method}} {{endpoint_path}}` - {{endpoint_purpose}} + + **Integration Notes:** {{integration_considerations}} + + - id: core-workflows + title: Core Workflows + type: mermaid + mermaid_type: sequence + instruction: | + Illustrate key system workflows using sequence diagrams: + + 1. Identify critical user journeys from PRD + 2. Show component interactions including external APIs + 3. Include error handling paths + 4. Document async operations + 5. Create both high-level and detailed diagrams as needed + + Focus on workflows that clarify architecture decisions or complex interactions. + elicit: true + + - id: rest-api-spec + title: REST API Spec + condition: Project includes REST API + type: code + language: yaml + instruction: | + If the project includes a REST API: + + 1. Create an OpenAPI 3.0 specification + 2. Include all endpoints from epics/stories + 3. Define request/response schemas based on data models + 4. Document authentication requirements + 5. Include example requests/responses + + Use YAML format for better readability. If no REST API, skip this section. + elicit: true + template: | + openapi: 3.0.0 + info: + title: {{api_title}} + version: {{api_version}} + description: {{api_description}} + servers: + - url: {{server_url}} + description: {{server_description}} + + - id: database-schema + title: Database Schema + instruction: | + Transform the conceptual data models into concrete database schemas: + + 1. Use the database type(s) selected in Tech Stack + 2. Create schema definitions using appropriate notation + 3. Include indexes, constraints, and relationships + 4. Consider performance and scalability + 5. For NoSQL, show document structures + + Present schema in format appropriate to database type (SQL DDL, JSON schema, etc.) + elicit: true + + - id: source-tree + title: Source Tree + type: code + language: plaintext + instruction: | + Create a project folder structure that reflects: + + 1. The chosen repository structure (monorepo/polyrepo) + 2. The service architecture (monolith/microservices/serverless) + 3. The selected tech stack and languages + 4. Component organization from above + 5. Best practices for the chosen frameworks + 6. Clear separation of concerns + + Adapt the structure based on project needs. For monorepos, show service separation. For serverless, show function organization. Include language-specific conventions. + elicit: true + examples: + - | + project-root/ + ├── packages/ + │ ├── api/ # Backend API service + │ ├── web/ # Frontend application + │ ├── shared/ # Shared utilities/types + │ └── infrastructure/ # IaC definitions + ├── scripts/ # Monorepo management scripts + └── package.json # Root package.json with workspaces + + - id: infrastructure-deployment + title: Infrastructure and Deployment + instruction: | + Define the deployment architecture and practices: + + 1. Use IaC tool selected in Tech Stack + 2. Choose deployment strategy appropriate for the architecture + 3. Define environments and promotion flow + 4. Establish rollback procedures + 5. Consider security, monitoring, and cost optimization + + Get user input on deployment preferences and CI/CD tool choices. + elicit: true + sections: + - id: infrastructure-as-code + title: Infrastructure as Code + template: | + - **Tool:** {{iac_tool}} {{version}} + - **Location:** `{{iac_directory}}` + - **Approach:** {{iac_approach}} + - id: deployment-strategy + title: Deployment Strategy + template: | + - **Strategy:** {{deployment_strategy}} + - **CI/CD Platform:** {{cicd_platform}} + - **Pipeline Configuration:** `{{pipeline_config_location}}` + - id: environments + title: Environments + repeatable: true + template: "- **{{env_name}}:** {{env_purpose}} - {{env_details}}" + - id: promotion-flow + title: Environment Promotion Flow + type: code + language: text + template: "{{promotion_flow_diagram}}" + - id: rollback-strategy + title: Rollback Strategy + template: | + - **Primary Method:** {{rollback_method}} + - **Trigger Conditions:** {{rollback_triggers}} + - **Recovery Time Objective:** {{rto}} + + - id: error-handling-strategy + title: Error Handling Strategy + instruction: | + Define comprehensive error handling approach: + + 1. Choose appropriate patterns for the language/framework from Tech Stack + 2. Define logging standards and tools + 3. Establish error categories and handling rules + 4. Consider observability and debugging needs + 5. Ensure security (no sensitive data in logs) + + This section guides both AI and human developers in consistent error handling. + elicit: true + sections: + - id: general-approach + title: General Approach + template: | + - **Error Model:** {{error_model}} + - **Exception Hierarchy:** {{exception_structure}} + - **Error Propagation:** {{propagation_rules}} + - id: logging-standards + title: Logging Standards + template: | + - **Library:** {{logging_library}} {{version}} + - **Format:** {{log_format}} + - **Levels:** {{log_levels_definition}} + - **Required Context:** + - Correlation ID: {{correlation_id_format}} + - Service Context: {{service_context}} + - User Context: {{user_context_rules}} + - id: error-patterns + title: Error Handling Patterns + sections: + - id: external-api-errors + title: External API Errors + template: | + - **Retry Policy:** {{retry_strategy}} + - **Circuit Breaker:** {{circuit_breaker_config}} + - **Timeout Configuration:** {{timeout_settings}} + - **Error Translation:** {{error_mapping_rules}} + - id: business-logic-errors + title: Business Logic Errors + template: | + - **Custom Exceptions:** {{business_exception_types}} + - **User-Facing Errors:** {{user_error_format}} + - **Error Codes:** {{error_code_system}} + - id: data-consistency + title: Data Consistency + template: | + - **Transaction Strategy:** {{transaction_approach}} + - **Compensation Logic:** {{compensation_patterns}} + - **Idempotency:** {{idempotency_approach}} + + - id: coding-standards + title: Coding Standards + instruction: | + These standards are MANDATORY for AI agents. Work with user to define ONLY the critical rules needed to prevent bad code. Explain that: + + 1. This section directly controls AI developer behavior + 2. Keep it minimal - assume AI knows general best practices + 3. Focus on project-specific conventions and gotchas + 4. Overly detailed standards bloat context and slow development + 5. Standards will be extracted to separate file for dev agent use + + For each standard, get explicit user confirmation it's necessary. + elicit: true + sections: + - id: core-standards + title: Core Standards + template: | + - **Languages & Runtimes:** {{languages_and_versions}} + - **Style & Linting:** {{linter_config}} + - **Test Organization:** {{test_file_convention}} + - id: naming-conventions + title: Naming Conventions + type: table + columns: [Element, Convention, Example] + instruction: Only include if deviating from language defaults + - id: critical-rules + title: Critical Rules + instruction: | + List ONLY rules that AI might violate or project-specific requirements. Examples: + - "Never use console.log in production code - use logger" + - "All API responses must use ApiResponse wrapper type" + - "Database queries must use repository pattern, never direct ORM" + + Avoid obvious rules like "use SOLID principles" or "write clean code" + repeatable: true + template: "- **{{rule_name}}:** {{rule_description}}" + - id: language-specifics + title: Language-Specific Guidelines + condition: Critical language-specific rules needed + instruction: Add ONLY if critical for preventing AI mistakes. Most teams don't need this section. + sections: + - id: language-rules + title: "{{language_name}} Specifics" + repeatable: true + template: "- **{{rule_topic}}:** {{rule_detail}}" + + - id: test-strategy + title: Test Strategy and Standards + instruction: | + Work with user to define comprehensive test strategy: + + 1. Use test frameworks from Tech Stack + 2. Decide on TDD vs test-after approach + 3. Define test organization and naming + 4. Establish coverage goals + 5. Determine integration test infrastructure + 6. Plan for test data and external dependencies + + Note: Basic info goes in Coding Standards for dev agent. This detailed section is for QA agent and team reference. + elicit: true + sections: + - id: testing-philosophy + title: Testing Philosophy + template: | + - **Approach:** {{test_approach}} + - **Coverage Goals:** {{coverage_targets}} + - **Test Pyramid:** {{test_distribution}} + - id: test-types + title: Test Types and Organization + sections: + - id: unit-tests + title: Unit Tests + template: | + - **Framework:** {{unit_test_framework}} {{version}} + - **File Convention:** {{unit_test_naming}} + - **Location:** {{unit_test_location}} + - **Mocking Library:** {{mocking_library}} + - **Coverage Requirement:** {{unit_coverage}} + + **AI Agent Requirements:** + - Generate tests for all public methods + - Cover edge cases and error conditions + - Follow AAA pattern (Arrange, Act, Assert) + - Mock all external dependencies + - id: integration-tests + title: Integration Tests + template: | + - **Scope:** {{integration_scope}} + - **Location:** {{integration_test_location}} + - **Test Infrastructure:** + - **{{dependency_name}}:** {{test_approach}} ({{test_tool}}) + examples: + - "**Database:** In-memory H2 for unit tests, Testcontainers PostgreSQL for integration" + - "**Message Queue:** Embedded Kafka for tests" + - "**External APIs:** WireMock for stubbing" + - id: e2e-tests + title: End-to-End Tests + template: | + - **Framework:** {{e2e_framework}} {{version}} + - **Scope:** {{e2e_scope}} + - **Environment:** {{e2e_environment}} + - **Test Data:** {{e2e_data_strategy}} + - id: test-data-management + title: Test Data Management + template: | + - **Strategy:** {{test_data_approach}} + - **Fixtures:** {{fixture_location}} + - **Factories:** {{factory_pattern}} + - **Cleanup:** {{cleanup_strategy}} + - id: continuous-testing + title: Continuous Testing + template: | + - **CI Integration:** {{ci_test_stages}} + - **Performance Tests:** {{perf_test_approach}} + - **Security Tests:** {{security_test_approach}} + + - id: security + title: Security + instruction: | + Define MANDATORY security requirements for AI and human developers: + + 1. Focus on implementation-specific rules + 2. Reference security tools from Tech Stack + 3. Define clear patterns for common scenarios + 4. These rules directly impact code generation + 5. Work with user to ensure completeness without redundancy + elicit: true + sections: + - id: input-validation + title: Input Validation + template: | + - **Validation Library:** {{validation_library}} + - **Validation Location:** {{where_to_validate}} + - **Required Rules:** + - All external inputs MUST be validated + - Validation at API boundary before processing + - Whitelist approach preferred over blacklist + - id: auth-authorization + title: Authentication & Authorization + template: | + - **Auth Method:** {{auth_implementation}} + - **Session Management:** {{session_approach}} + - **Required Patterns:** + - {{auth_pattern_1}} + - {{auth_pattern_2}} + - id: secrets-management + title: Secrets Management + template: | + - **Development:** {{dev_secrets_approach}} + - **Production:** {{prod_secrets_service}} + - **Code Requirements:** + - NEVER hardcode secrets + - Access via configuration service only + - No secrets in logs or error messages + - id: api-security + title: API Security + template: | + - **Rate Limiting:** {{rate_limit_implementation}} + - **CORS Policy:** {{cors_configuration}} + - **Security Headers:** {{required_headers}} + - **HTTPS Enforcement:** {{https_approach}} + - id: data-protection + title: Data Protection + template: | + - **Encryption at Rest:** {{encryption_at_rest}} + - **Encryption in Transit:** {{encryption_in_transit}} + - **PII Handling:** {{pii_rules}} + - **Logging Restrictions:** {{what_not_to_log}} + - id: dependency-security + title: Dependency Security + template: | + - **Scanning Tool:** {{dependency_scanner}} + - **Update Policy:** {{update_frequency}} + - **Approval Process:** {{new_dep_process}} + - id: security-testing + title: Security Testing + template: | + - **SAST Tool:** {{static_analysis}} + - **DAST Tool:** {{dynamic_analysis}} + - **Penetration Testing:** {{pentest_schedule}} + + - id: checklist-results + title: Checklist Results Report + instruction: Before running the checklist, offer to output the full architecture document. Once user confirms, execute the architect-checklist and populate results here. + + - id: next-steps + title: Next Steps + instruction: | + After completing the architecture: + + 1. If project has UI components: + - Recommend engaging Design Architect agent + - Use "Frontend Architecture Mode" + - Provide this document as input + + 2. For all projects: + - Review with Product Owner + - Begin story implementation with Dev agent + - Set up infrastructure with DevOps agent + + 3. Include specific prompts for next agents if needed + sections: + - id: design-architect-prompt + title: Design Architect Prompt + condition: Project has UI components + instruction: | + Create a brief prompt to hand off to Design Architect for Frontend Architecture creation. Include: + - Reference to this architecture document + - Key UI requirements from PRD + - Any frontend-specific decisions made here + - Request for detailed frontend architecture + - id: developer-handoff + title: Developer Handoff + instruction: | + Create a brief prompt for developers starting implementation. Include: + - Reference to this architecture and coding standards + - First epic/story to implement + - Key technical decisions to follow +==================== END: .bmad-core/templates/architecture-tmpl.yaml ==================== + +==================== START: .bmad-core/templates/front-end-architecture-tmpl.yaml ==================== +template: + id: frontend-architecture-template-v2 + name: Frontend Architecture Document + version: 2.0 + output: + format: markdown + filename: docs/ui-architecture.md + title: "{{project_name}} Frontend Architecture Document" + +workflow: + mode: interactive + elicitation: advanced-elicitation + +sections: + - id: template-framework-selection + title: Template and Framework Selection + instruction: | + Review provided documents including PRD, UX-UI Specification, and main Architecture Document. Focus on extracting technical implementation details needed for AI frontend tools and developer agents. Ask the user for any of these documents if you are unable to locate and were not provided. + + Before proceeding with frontend architecture design, check if the project is using a frontend starter template or existing codebase: + + 1. Review the PRD, main architecture document, and brainstorming brief for mentions of: + - Frontend starter templates (e.g., Create React App, Next.js, Vite, Vue CLI, Angular CLI, etc.) + - UI kit or component library starters + - Existing frontend projects being used as a foundation + - Admin dashboard templates or other specialized starters + - Design system implementations + + 2. If a frontend starter template or existing project is mentioned: + - Ask the user to provide access via one of these methods: + - Link to the starter template documentation + - Upload/attach the project files (for small projects) + - Share a link to the project repository + - Analyze the starter/existing project to understand: + - Pre-installed dependencies and versions + - Folder structure and file organization + - Built-in components and utilities + - Styling approach (CSS modules, styled-components, Tailwind, etc.) + - State management setup (if any) + - Routing configuration + - Testing setup and patterns + - Build and development scripts + - Use this analysis to ensure your frontend architecture aligns with the starter's patterns + + 3. If no frontend starter is mentioned but this is a new UI, ensure we know what the ui language and framework is: + - Based on the framework choice, suggest appropriate starters: + - React: Create React App, Next.js, Vite + React + - Vue: Vue CLI, Nuxt.js, Vite + Vue + - Angular: Angular CLI + - Or suggest popular UI templates if applicable + - Explain benefits specific to frontend development + + 4. If the user confirms no starter template will be used: + - Note that all tooling, bundling, and configuration will need manual setup + - Proceed with frontend architecture from scratch + + Document the starter template decision and any constraints it imposes before proceeding. + sections: + - id: changelog + title: Change Log + type: table + columns: [Date, Version, Description, Author] + instruction: Track document versions and changes + + - id: frontend-tech-stack + title: Frontend Tech Stack + instruction: Extract from main architecture's Technology Stack Table. This section MUST remain synchronized with the main architecture document. + elicit: true + sections: + - id: tech-stack-table + title: Technology Stack Table + type: table + columns: [Category, Technology, Version, Purpose, Rationale] + instruction: Fill in appropriate technology choices based on the selected framework and project requirements. + rows: + - ["Framework", "{{framework}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] + - ["UI Library", "{{ui_library}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] + - ["State Management", "{{state_management}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] + - ["Routing", "{{routing_library}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] + - ["Build Tool", "{{build_tool}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] + - ["Styling", "{{styling_solution}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] + - ["Testing", "{{test_framework}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] + - ["Component Library", "{{component_lib}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] + - ["Form Handling", "{{form_library}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] + - ["Animation", "{{animation_lib}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] + - ["Dev Tools", "{{dev_tools}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] + + - id: project-structure + title: Project Structure + instruction: Define exact directory structure for AI tools based on the chosen framework. Be specific about where each type of file goes. Generate a structure that follows the framework's best practices and conventions. + elicit: true + type: code + language: plaintext + + - id: component-standards + title: Component Standards + instruction: Define exact patterns for component creation based on the chosen framework. + elicit: true + sections: + - id: component-template + title: Component Template + instruction: Generate a minimal but complete component template following the framework's best practices. Include TypeScript types, proper imports, and basic structure. + type: code + language: typescript + - id: naming-conventions + title: Naming Conventions + instruction: Provide naming conventions specific to the chosen framework for components, files, services, state management, and other architectural elements. + + - id: state-management + title: State Management + instruction: Define state management patterns based on the chosen framework. + elicit: true + sections: + - id: store-structure + title: Store Structure + instruction: Generate the state management directory structure appropriate for the chosen framework and selected state management solution. + type: code + language: plaintext + - id: state-template + title: State Management Template + instruction: Provide a basic state management template/example following the framework's recommended patterns. Include TypeScript types and common operations like setting, updating, and clearing state. + type: code + language: typescript + + - id: api-integration + title: API Integration + instruction: Define API service patterns based on the chosen framework. + elicit: true + sections: + - id: service-template + title: Service Template + instruction: Provide an API service template that follows the framework's conventions. Include proper TypeScript types, error handling, and async patterns. + type: code + language: typescript + - id: api-client-config + title: API Client Configuration + instruction: Show how to configure the HTTP client for the chosen framework, including authentication interceptors/middleware and error handling. + type: code + language: typescript + + - id: routing + title: Routing + instruction: Define routing structure and patterns based on the chosen framework. + elicit: true + sections: + - id: route-configuration + title: Route Configuration + instruction: Provide routing configuration appropriate for the chosen framework. Include protected route patterns, lazy loading where applicable, and authentication guards/middleware. + type: code + language: typescript + + - id: styling-guidelines + title: Styling Guidelines + instruction: Define styling approach based on the chosen framework. + elicit: true + sections: + - id: styling-approach + title: Styling Approach + instruction: Describe the styling methodology appropriate for the chosen framework (CSS Modules, Styled Components, Tailwind, etc.) and provide basic patterns. + - id: global-theme + title: Global Theme Variables + instruction: Provide a CSS custom properties (CSS variables) theme system that works across all frameworks. Include colors, spacing, typography, shadows, and dark mode support. + type: code + language: css + + - id: testing-requirements + title: Testing Requirements + instruction: Define minimal testing requirements based on the chosen framework. + elicit: true + sections: + - id: component-test-template + title: Component Test Template + instruction: Provide a basic component test template using the framework's recommended testing library. Include examples of rendering tests, user interaction tests, and mocking. + type: code + language: typescript + - id: testing-best-practices + title: Testing Best Practices + type: numbered-list + items: + - "**Unit Tests**: Test individual components in isolation" + - "**Integration Tests**: Test component interactions" + - "**E2E Tests**: Test critical user flows (using Cypress/Playwright)" + - "**Coverage Goals**: Aim for 80% code coverage" + - "**Test Structure**: Arrange-Act-Assert pattern" + - "**Mock External Dependencies**: API calls, routing, state management" + + - id: environment-configuration + title: Environment Configuration + instruction: List required environment variables based on the chosen framework. Show the appropriate format and naming conventions for the framework. + elicit: true + + - id: frontend-developer-standards + title: Frontend Developer Standards + sections: + - id: critical-coding-rules + title: Critical Coding Rules + instruction: List essential rules that prevent common AI mistakes, including both universal rules and framework-specific ones. + elicit: true + - id: quick-reference + title: Quick Reference + instruction: | + Create a framework-specific cheat sheet with: + - Common commands (dev server, build, test) + - Key import patterns + - File naming conventions + - Project-specific patterns and utilities +==================== END: .bmad-core/templates/front-end-architecture-tmpl.yaml ==================== + +==================== START: .bmad-core/templates/fullstack-architecture-tmpl.yaml ==================== +template: + id: fullstack-architecture-template-v2 + name: Fullstack Architecture Document + version: 2.0 + output: + format: markdown + filename: docs/architecture.md + title: "{{project_name}} Fullstack Architecture Document" + +workflow: + mode: interactive + elicitation: advanced-elicitation + +sections: + - id: introduction + title: Introduction + instruction: | + If available, review any provided relevant documents to gather all relevant context before beginning. At minimum, you should have access to docs/prd.md and docs/front-end-spec.md. Ask the user for any documents you need but cannot locate. This template creates a unified architecture that covers both backend and frontend concerns to guide AI-driven fullstack development. + elicit: true + content: | + This document outlines the complete fullstack architecture for {{project_name}}, including backend systems, frontend implementation, and their integration. It serves as the single source of truth for AI-driven development, ensuring consistency across the entire technology stack. + + This unified approach combines what would traditionally be separate backend and frontend architecture documents, streamlining the development process for modern fullstack applications where these concerns are increasingly intertwined. + sections: + - id: starter-template + title: Starter Template or Existing Project + instruction: | + Before proceeding with architecture design, check if the project is based on any starter templates or existing codebases: + + 1. Review the PRD and other documents for mentions of: + - Fullstack starter templates (e.g., T3 Stack, MEAN/MERN starters, Django + React templates) + - Monorepo templates (e.g., Nx, Turborepo starters) + - Platform-specific starters (e.g., Vercel templates, AWS Amplify starters) + - Existing projects being extended or cloned + + 2. If starter templates or existing projects are mentioned: + - Ask the user to provide access (links, repos, or files) + - Analyze to understand pre-configured choices and constraints + - Note any architectural decisions already made + - Identify what can be modified vs what must be retained + + 3. If no starter is mentioned but this is greenfield: + - Suggest appropriate fullstack starters based on tech preferences + - Consider platform-specific options (Vercel, AWS, etc.) + - Let user decide whether to use one + + 4. Document the decision and any constraints it imposes + + If none, state "N/A - Greenfield project" + - id: changelog + title: Change Log + type: table + columns: [Date, Version, Description, Author] + instruction: Track document versions and changes + + - id: high-level-architecture + title: High Level Architecture + instruction: This section contains multiple subsections that establish the foundation. Present all subsections together, then elicit feedback on the complete section. + elicit: true + sections: + - id: technical-summary + title: Technical Summary + instruction: | + Provide a comprehensive overview (4-6 sentences) covering: + - Overall architectural style and deployment approach + - Frontend framework and backend technology choices + - Key integration points between frontend and backend + - Infrastructure platform and services + - How this architecture achieves PRD goals + - id: platform-infrastructure + title: Platform and Infrastructure Choice + instruction: | + Based on PRD requirements and technical assumptions, make a platform recommendation: + + 1. Consider common patterns (not an exhaustive list, use your own best judgement and search the web as needed for emerging trends): + - **Vercel + Supabase**: For rapid development with Next.js, built-in auth/storage + - **AWS Full Stack**: For enterprise scale with Lambda, API Gateway, S3, Cognito + - **Azure**: For .NET ecosystems or enterprise Microsoft environments + - **Google Cloud**: For ML/AI heavy applications or Google ecosystem integration + + 2. Present 2-3 viable options with clear pros/cons + 3. Make a recommendation with rationale + 4. Get explicit user confirmation + + Document the choice and key services that will be used. + template: | + **Platform:** {{selected_platform}} + **Key Services:** {{core_services_list}} + **Deployment Host and Regions:** {{regions}} + - id: repository-structure + title: Repository Structure + instruction: | + Define the repository approach based on PRD requirements and platform choice, explain your rationale or ask questions to the user if unsure: + + 1. For modern fullstack apps, monorepo is often preferred + 2. Consider tooling (Nx, Turborepo, Lerna, npm workspaces) + 3. Define package/app boundaries + 4. Plan for shared code between frontend and backend + template: | + **Structure:** {{repo_structure_choice}} + **Monorepo Tool:** {{monorepo_tool_if_applicable}} + **Package Organization:** {{package_strategy}} + - id: architecture-diagram + title: High Level Architecture Diagram + type: mermaid + mermaid_type: graph + instruction: | + Create a Mermaid diagram showing the complete system architecture including: + - User entry points (web, mobile) + - Frontend application deployment + - API layer (REST/GraphQL) + - Backend services + - Databases and storage + - External integrations + - CDN and caching layers + + Use appropriate diagram type for clarity. + - id: architectural-patterns + title: Architectural Patterns + instruction: | + List patterns that will guide both frontend and backend development. Include patterns for: + - Overall architecture (e.g., Jamstack, Serverless, Microservices) + - Frontend patterns (e.g., Component-based, State management) + - Backend patterns (e.g., Repository, CQRS, Event-driven) + - Integration patterns (e.g., BFF, API Gateway) + + For each pattern, provide recommendation and rationale. + repeatable: true + template: "- **{{pattern_name}}:** {{pattern_description}} - _Rationale:_ {{rationale}}" + examples: + - "**Jamstack Architecture:** Static site generation with serverless APIs - _Rationale:_ Optimal performance and scalability for content-heavy applications" + - "**Component-Based UI:** Reusable React components with TypeScript - _Rationale:_ Maintainability and type safety across large codebases" + - "**Repository Pattern:** Abstract data access logic - _Rationale:_ Enables testing and future database migration flexibility" + - "**API Gateway Pattern:** Single entry point for all API calls - _Rationale:_ Centralized auth, rate limiting, and monitoring" + + - id: tech-stack + title: Tech Stack + instruction: | + This is the DEFINITIVE technology selection for the entire project. Work with user to finalize all choices. This table is the single source of truth - all development must use these exact versions. + + Key areas to cover: + - Frontend and backend languages/frameworks + - Databases and caching + - Authentication and authorization + - API approach + - Testing tools for both frontend and backend + - Build and deployment tools + - Monitoring and logging + + Upon render, elicit feedback immediately. + elicit: true + sections: + - id: tech-stack-table + title: Technology Stack Table + type: table + columns: [Category, Technology, Version, Purpose, Rationale] + rows: + - ["Frontend Language", "{{fe_language}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] + - ["Frontend Framework", "{{fe_framework}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] + - ["UI Component Library", "{{ui_library}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] + - ["State Management", "{{state_mgmt}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] + - ["Backend Language", "{{be_language}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] + - ["Backend Framework", "{{be_framework}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] + - ["API Style", "{{api_style}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] + - ["Database", "{{database}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] + - ["Cache", "{{cache}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] + - ["File Storage", "{{storage}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] + - ["Authentication", "{{auth}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] + - ["Frontend Testing", "{{fe_test}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] + - ["Backend Testing", "{{be_test}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] + - ["E2E Testing", "{{e2e_test}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] + - ["Build Tool", "{{build_tool}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] + - ["Bundler", "{{bundler}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] + - ["IaC Tool", "{{iac_tool}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] + - ["CI/CD", "{{cicd}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] + - ["Monitoring", "{{monitoring}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] + - ["Logging", "{{logging}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] + - ["CSS Framework", "{{css_framework}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] + + - id: data-models + title: Data Models + instruction: | + Define the core data models/entities that will be shared between frontend and backend: + + 1. Review PRD requirements and identify key business entities + 2. For each model, explain its purpose and relationships + 3. Include key attributes and data types + 4. Show relationships between models + 5. Create TypeScript interfaces that can be shared + 6. Discuss design decisions with user + + Create a clear conceptual model before moving to database schema. + elicit: true + repeatable: true + sections: + - id: model + title: "{{model_name}}" + template: | + **Purpose:** {{model_purpose}} + + **Key Attributes:** + - {{attribute_1}}: {{type_1}} - {{description_1}} + - {{attribute_2}}: {{type_2}} - {{description_2}} + sections: + - id: typescript-interface + title: TypeScript Interface + type: code + language: typescript + template: "{{model_interface}}" + - id: relationships + title: Relationships + type: bullet-list + template: "- {{relationship}}" + + - id: api-spec + title: API Specification + instruction: | + Based on the chosen API style from Tech Stack: + + 1. If REST API, create an OpenAPI 3.0 specification + 2. If GraphQL, provide the GraphQL schema + 3. If tRPC, show router definitions + 4. Include all endpoints from epics/stories + 5. Define request/response schemas based on data models + 6. Document authentication requirements + 7. Include example requests/responses + + Use appropriate format for the chosen API style. If no API (e.g., static site), skip this section. + elicit: true + sections: + - id: rest-api + title: REST API Specification + condition: API style is REST + type: code + language: yaml + template: | + openapi: 3.0.0 + info: + title: {{api_title}} + version: {{api_version}} + description: {{api_description}} + servers: + - url: {{server_url}} + description: {{server_description}} + - id: graphql-api + title: GraphQL Schema + condition: API style is GraphQL + type: code + language: graphql + template: "{{graphql_schema}}" + - id: trpc-api + title: tRPC Router Definitions + condition: API style is tRPC + type: code + language: typescript + template: "{{trpc_routers}}" + + - id: components + title: Components + instruction: | + Based on the architectural patterns, tech stack, and data models from above: + + 1. Identify major logical components/services across the fullstack + 2. Consider both frontend and backend components + 3. Define clear boundaries and interfaces between components + 4. For each component, specify: + - Primary responsibility + - Key interfaces/APIs exposed + - Dependencies on other components + - Technology specifics based on tech stack choices + + 5. Create component diagrams where helpful + elicit: true + sections: + - id: component-list + repeatable: true + title: "{{component_name}}" + template: | + **Responsibility:** {{component_description}} + + **Key Interfaces:** + - {{interface_1}} + - {{interface_2}} + + **Dependencies:** {{dependencies}} + + **Technology Stack:** {{component_tech_details}} + - id: component-diagrams + title: Component Diagrams + type: mermaid + instruction: | + Create Mermaid diagrams to visualize component relationships. Options: + - C4 Container diagram for high-level view + - Component diagram for detailed internal structure + - Sequence diagrams for complex interactions + Choose the most appropriate for clarity + + - id: external-apis + title: External APIs + condition: Project requires external API integrations + instruction: | + For each external service integration: + + 1. Identify APIs needed based on PRD requirements and component design + 2. If documentation URLs are unknown, ask user for specifics + 3. Document authentication methods and security considerations + 4. List specific endpoints that will be used + 5. Note any rate limits or usage constraints + + If no external APIs are needed, state this explicitly and skip to next section. + elicit: true + repeatable: true + sections: + - id: api + title: "{{api_name}} API" + template: | + - **Purpose:** {{api_purpose}} + - **Documentation:** {{api_docs_url}} + - **Base URL(s):** {{api_base_url}} + - **Authentication:** {{auth_method}} + - **Rate Limits:** {{rate_limits}} + + **Key Endpoints Used:** + - `{{method}} {{endpoint_path}}` - {{endpoint_purpose}} + + **Integration Notes:** {{integration_considerations}} + + - id: core-workflows + title: Core Workflows + type: mermaid + mermaid_type: sequence + instruction: | + Illustrate key system workflows using sequence diagrams: + + 1. Identify critical user journeys from PRD + 2. Show component interactions including external APIs + 3. Include both frontend and backend flows + 4. Include error handling paths + 5. Document async operations + 6. Create both high-level and detailed diagrams as needed + + Focus on workflows that clarify architecture decisions or complex interactions. + elicit: true + + - id: database-schema + title: Database Schema + instruction: | + Transform the conceptual data models into concrete database schemas: + + 1. Use the database type(s) selected in Tech Stack + 2. Create schema definitions using appropriate notation + 3. Include indexes, constraints, and relationships + 4. Consider performance and scalability + 5. For NoSQL, show document structures + + Present schema in format appropriate to database type (SQL DDL, JSON schema, etc.) + elicit: true + + - id: frontend-architecture + title: Frontend Architecture + instruction: Define frontend-specific architecture details. After each subsection, note if user wants to refine before continuing. + elicit: true + sections: + - id: component-architecture + title: Component Architecture + instruction: Define component organization and patterns based on chosen framework. + sections: + - id: component-organization + title: Component Organization + type: code + language: text + template: "{{component_structure}}" + - id: component-template + title: Component Template + type: code + language: typescript + template: "{{component_template}}" + - id: state-management + title: State Management Architecture + instruction: Detail state management approach based on chosen solution. + sections: + - id: state-structure + title: State Structure + type: code + language: typescript + template: "{{state_structure}}" + - id: state-patterns + title: State Management Patterns + type: bullet-list + template: "- {{pattern}}" + - id: routing-architecture + title: Routing Architecture + instruction: Define routing structure based on framework choice. + sections: + - id: route-organization + title: Route Organization + type: code + language: text + template: "{{route_structure}}" + - id: protected-routes + title: Protected Route Pattern + type: code + language: typescript + template: "{{protected_route_example}}" + - id: frontend-services + title: Frontend Services Layer + instruction: Define how frontend communicates with backend. + sections: + - id: api-client-setup + title: API Client Setup + type: code + language: typescript + template: "{{api_client_setup}}" + - id: service-example + title: Service Example + type: code + language: typescript + template: "{{service_example}}" + + - id: backend-architecture + title: Backend Architecture + instruction: Define backend-specific architecture details. Consider serverless vs traditional server approaches. + elicit: true + sections: + - id: service-architecture + title: Service Architecture + instruction: Based on platform choice, define service organization. + sections: + - id: serverless-architecture + condition: Serverless architecture chosen + sections: + - id: function-organization + title: Function Organization + type: code + language: text + template: "{{function_structure}}" + - id: function-template + title: Function Template + type: code + language: typescript + template: "{{function_template}}" + - id: traditional-server + condition: Traditional server architecture chosen + sections: + - id: controller-organization + title: Controller/Route Organization + type: code + language: text + template: "{{controller_structure}}" + - id: controller-template + title: Controller Template + type: code + language: typescript + template: "{{controller_template}}" + - id: database-architecture + title: Database Architecture + instruction: Define database schema and access patterns. + sections: + - id: schema-design + title: Schema Design + type: code + language: sql + template: "{{database_schema}}" + - id: data-access-layer + title: Data Access Layer + type: code + language: typescript + template: "{{repository_pattern}}" + - id: auth-architecture + title: Authentication and Authorization + instruction: Define auth implementation details. + sections: + - id: auth-flow + title: Auth Flow + type: mermaid + mermaid_type: sequence + template: "{{auth_flow_diagram}}" + - id: auth-middleware + title: Middleware/Guards + type: code + language: typescript + template: "{{auth_middleware}}" + + - id: unified-project-structure + title: Unified Project Structure + instruction: Create a monorepo structure that accommodates both frontend and backend. Adapt based on chosen tools and frameworks. + elicit: true + type: code + language: plaintext + examples: + - | + {{project-name}}/ + ├── .github/ # CI/CD workflows + │ └── workflows/ + │ ├── ci.yaml + │ └── deploy.yaml + ├── apps/ # Application packages + │ ├── web/ # Frontend application + │ │ ├── src/ + │ │ │ ├── components/ # UI components + │ │ │ ├── pages/ # Page components/routes + │ │ │ ├── hooks/ # Custom React hooks + │ │ │ ├── services/ # API client services + │ │ │ ├── stores/ # State management + │ │ │ ├── styles/ # Global styles/themes + │ │ │ └── utils/ # Frontend utilities + │ │ ├── public/ # Static assets + │ │ ├── tests/ # Frontend tests + │ │ └── package.json + │ └── api/ # Backend application + │ ├── src/ + │ │ ├── routes/ # API routes/controllers + │ │ ├── services/ # Business logic + │ │ ├── models/ # Data models + │ │ ├── middleware/ # Express/API middleware + │ │ ├── utils/ # Backend utilities + │ │ └── {{serverless_or_server_entry}} + │ ├── tests/ # Backend tests + │ └── package.json + ├── packages/ # Shared packages + │ ├── shared/ # Shared types/utilities + │ │ ├── src/ + │ │ │ ├── types/ # TypeScript interfaces + │ │ │ ├── constants/ # Shared constants + │ │ │ └── utils/ # Shared utilities + │ │ └── package.json + │ ├── ui/ # Shared UI components + │ │ ├── src/ + │ │ └── package.json + │ └── config/ # Shared configuration + │ ├── eslint/ + │ ├── typescript/ + │ └── jest/ + ├── infrastructure/ # IaC definitions + │ └── {{iac_structure}} + ├── scripts/ # Build/deploy scripts + ├── docs/ # Documentation + │ ├── prd.md + │ ├── front-end-spec.md + │ └── fullstack-architecture.md + ├── .env.example # Environment template + ├── package.json # Root package.json + ├── {{monorepo_config}} # Monorepo configuration + └── README.md + + - id: development-workflow + title: Development Workflow + instruction: Define the development setup and workflow for the fullstack application. + elicit: true + sections: + - id: local-setup + title: Local Development Setup + sections: + - id: prerequisites + title: Prerequisites + type: code + language: bash + template: "{{prerequisites_commands}}" + - id: initial-setup + title: Initial Setup + type: code + language: bash + template: "{{setup_commands}}" + - id: dev-commands + title: Development Commands + type: code + language: bash + template: | + # Start all services + {{start_all_command}} + + # Start frontend only + {{start_frontend_command}} + + # Start backend only + {{start_backend_command}} + + # Run tests + {{test_commands}} + - id: environment-config + title: Environment Configuration + sections: + - id: env-vars + title: Required Environment Variables + type: code + language: bash + template: | + # Frontend (.env.local) + {{frontend_env_vars}} + + # Backend (.env) + {{backend_env_vars}} + + # Shared + {{shared_env_vars}} + + - id: deployment-architecture + title: Deployment Architecture + instruction: Define deployment strategy based on platform choice. + elicit: true + sections: + - id: deployment-strategy + title: Deployment Strategy + template: | + **Frontend Deployment:** + - **Platform:** {{frontend_deploy_platform}} + - **Build Command:** {{frontend_build_command}} + - **Output Directory:** {{frontend_output_dir}} + - **CDN/Edge:** {{cdn_strategy}} + + **Backend Deployment:** + - **Platform:** {{backend_deploy_platform}} + - **Build Command:** {{backend_build_command}} + - **Deployment Method:** {{deployment_method}} + - id: cicd-pipeline + title: CI/CD Pipeline + type: code + language: yaml + template: "{{cicd_pipeline_config}}" + - id: environments + title: Environments + type: table + columns: [Environment, Frontend URL, Backend URL, Purpose] + rows: + - ["Development", "{{dev_fe_url}}", "{{dev_be_url}}", "Local development"] + - ["Staging", "{{staging_fe_url}}", "{{staging_be_url}}", "Pre-production testing"] + - ["Production", "{{prod_fe_url}}", "{{prod_be_url}}", "Live environment"] + + - id: security-performance + title: Security and Performance + instruction: Define security and performance considerations for the fullstack application. + elicit: true + sections: + - id: security-requirements + title: Security Requirements + template: | + **Frontend Security:** + - CSP Headers: {{csp_policy}} + - XSS Prevention: {{xss_strategy}} + - Secure Storage: {{storage_strategy}} + + **Backend Security:** + - Input Validation: {{validation_approach}} + - Rate Limiting: {{rate_limit_config}} + - CORS Policy: {{cors_config}} + + **Authentication Security:** + - Token Storage: {{token_strategy}} + - Session Management: {{session_approach}} + - Password Policy: {{password_requirements}} + - id: performance-optimization + title: Performance Optimization + template: | + **Frontend Performance:** + - Bundle Size Target: {{bundle_size}} + - Loading Strategy: {{loading_approach}} + - Caching Strategy: {{fe_cache_strategy}} + + **Backend Performance:** + - Response Time Target: {{response_target}} + - Database Optimization: {{db_optimization}} + - Caching Strategy: {{be_cache_strategy}} + + - id: testing-strategy + title: Testing Strategy + instruction: Define comprehensive testing approach for fullstack application. + elicit: true + sections: + - id: testing-pyramid + title: Testing Pyramid + type: code + language: text + template: | + E2E Tests + / \ + Integration Tests + / \ + Frontend Unit Backend Unit + - id: test-organization + title: Test Organization + sections: + - id: frontend-tests + title: Frontend Tests + type: code + language: text + template: "{{frontend_test_structure}}" + - id: backend-tests + title: Backend Tests + type: code + language: text + template: "{{backend_test_structure}}" + - id: e2e-tests + title: E2E Tests + type: code + language: text + template: "{{e2e_test_structure}}" + - id: test-examples + title: Test Examples + sections: + - id: frontend-test + title: Frontend Component Test + type: code + language: typescript + template: "{{frontend_test_example}}" + - id: backend-test + title: Backend API Test + type: code + language: typescript + template: "{{backend_test_example}}" + - id: e2e-test + title: E2E Test + type: code + language: typescript + template: "{{e2e_test_example}}" + + - id: coding-standards + title: Coding Standards + instruction: Define MINIMAL but CRITICAL standards for AI agents. Focus only on project-specific rules that prevent common mistakes. These will be used by dev agents. + elicit: true + sections: + - id: critical-rules + title: Critical Fullstack Rules + repeatable: true + template: "- **{{rule_name}}:** {{rule_description}}" + examples: + - "**Type Sharing:** Always define types in packages/shared and import from there" + - "**API Calls:** Never make direct HTTP calls - use the service layer" + - "**Environment Variables:** Access only through config objects, never process.env directly" + - "**Error Handling:** All API routes must use the standard error handler" + - "**State Updates:** Never mutate state directly - use proper state management patterns" + - id: naming-conventions + title: Naming Conventions + type: table + columns: [Element, Frontend, Backend, Example] + rows: + - ["Components", "PascalCase", "-", "`UserProfile.tsx`"] + - ["Hooks", "camelCase with 'use'", "-", "`useAuth.ts`"] + - ["API Routes", "-", "kebab-case", "`/api/user-profile`"] + - ["Database Tables", "-", "snake_case", "`user_profiles`"] + + - id: error-handling + title: Error Handling Strategy + instruction: Define unified error handling across frontend and backend. + elicit: true + sections: + - id: error-flow + title: Error Flow + type: mermaid + mermaid_type: sequence + template: "{{error_flow_diagram}}" + - id: error-format + title: Error Response Format + type: code + language: typescript + template: | + interface ApiError { + error: { + code: string; + message: string; + details?: Record; + timestamp: string; + requestId: string; + }; + } + - id: frontend-error-handling + title: Frontend Error Handling + type: code + language: typescript + template: "{{frontend_error_handler}}" + - id: backend-error-handling + title: Backend Error Handling + type: code + language: typescript + template: "{{backend_error_handler}}" + + - id: monitoring + title: Monitoring and Observability + instruction: Define monitoring strategy for fullstack application. + elicit: true + sections: + - id: monitoring-stack + title: Monitoring Stack + template: | + - **Frontend Monitoring:** {{frontend_monitoring}} + - **Backend Monitoring:** {{backend_monitoring}} + - **Error Tracking:** {{error_tracking}} + - **Performance Monitoring:** {{perf_monitoring}} + - id: key-metrics + title: Key Metrics + template: | + **Frontend Metrics:** + - Core Web Vitals + - JavaScript errors + - API response times + - User interactions + + **Backend Metrics:** + - Request rate + - Error rate + - Response time + - Database query performance + + - id: checklist-results + title: Checklist Results Report + instruction: Before running the checklist, offer to output the full architecture document. Once user confirms, execute the architect-checklist and populate results here. +==================== END: .bmad-core/templates/fullstack-architecture-tmpl.yaml ==================== + +==================== START: .bmad-core/templates/brownfield-architecture-tmpl.yaml ==================== +template: + id: brownfield-architecture-template-v2 + name: Brownfield Enhancement Architecture + version: 2.0 + output: + format: markdown + filename: docs/architecture.md + title: "{{project_name}} Brownfield Enhancement Architecture" + +workflow: + mode: interactive + elicitation: advanced-elicitation + +sections: + - id: introduction + title: Introduction + instruction: | + IMPORTANT - SCOPE AND ASSESSMENT REQUIRED: + + This architecture document is for SIGNIFICANT enhancements to existing projects that require comprehensive architectural planning. Before proceeding: + + 1. **Verify Complexity**: Confirm this enhancement requires architectural planning. For simple additions, recommend: "For simpler changes that don't require architectural planning, consider using the brownfield-create-epic or brownfield-create-story task with the Product Owner instead." + + 2. **REQUIRED INPUTS**: + - Completed brownfield-prd.md + - Existing project technical documentation (from docs folder or user-provided) + - Access to existing project structure (IDE or uploaded files) + + 3. **DEEP ANALYSIS MANDATE**: You MUST conduct thorough analysis of the existing codebase, architecture patterns, and technical constraints before making ANY architectural recommendations. Every suggestion must be based on actual project analysis, not assumptions. + + 4. **CONTINUOUS VALIDATION**: Throughout this process, explicitly validate your understanding with the user. For every architectural decision, confirm: "Based on my analysis of your existing system, I recommend [decision] because [evidence from actual project]. Does this align with your system's reality?" + + If any required inputs are missing, request them before proceeding. + elicit: true + sections: + - id: intro-content + content: | + This document outlines the architectural approach for enhancing {{project_name}} with {{enhancement_description}}. Its primary goal is to serve as the guiding architectural blueprint for AI-driven development of new features while ensuring seamless integration with the existing system. + + **Relationship to Existing Architecture:** + This document supplements existing project architecture by defining how new components will integrate with current systems. Where conflicts arise between new and existing patterns, this document provides guidance on maintaining consistency while implementing enhancements. + - id: existing-project-analysis + title: Existing Project Analysis + instruction: | + Analyze the existing project structure and architecture: + + 1. Review existing documentation in docs folder + 2. Examine current technology stack and versions + 3. Identify existing architectural patterns and conventions + 4. Note current deployment and infrastructure setup + 5. Document any constraints or limitations + + CRITICAL: After your analysis, explicitly validate your findings: "Based on my analysis of your project, I've identified the following about your existing system: [key findings]. Please confirm these observations are accurate before I proceed with architectural recommendations." + elicit: true + sections: + - id: current-state + title: Current Project State + template: | + - **Primary Purpose:** {{existing_project_purpose}} + - **Current Tech Stack:** {{existing_tech_summary}} + - **Architecture Style:** {{existing_architecture_style}} + - **Deployment Method:** {{existing_deployment_approach}} + - id: available-docs + title: Available Documentation + type: bullet-list + template: "- {{existing_docs_summary}}" + - id: constraints + title: Identified Constraints + type: bullet-list + template: "- {{constraint}}" + - id: changelog + title: Change Log + type: table + columns: [Change, Date, Version, Description, Author] + instruction: Track document versions and changes + + - id: enhancement-scope + title: Enhancement Scope and Integration Strategy + instruction: | + Define how the enhancement will integrate with the existing system: + + 1. Review the brownfield PRD enhancement scope + 2. Identify integration points with existing code + 3. Define boundaries between new and existing functionality + 4. Establish compatibility requirements + + VALIDATION CHECKPOINT: Before presenting the integration strategy, confirm: "Based on my analysis, the integration approach I'm proposing takes into account [specific existing system characteristics]. These integration points and boundaries respect your current architecture patterns. Is this assessment accurate?" + elicit: true + sections: + - id: enhancement-overview + title: Enhancement Overview + template: | + **Enhancement Type:** {{enhancement_type}} + **Scope:** {{enhancement_scope}} + **Integration Impact:** {{integration_impact_level}} + - id: integration-approach + title: Integration Approach + template: | + **Code Integration Strategy:** {{code_integration_approach}} + **Database Integration:** {{database_integration_approach}} + **API Integration:** {{api_integration_approach}} + **UI Integration:** {{ui_integration_approach}} + - id: compatibility-requirements + title: Compatibility Requirements + template: | + - **Existing API Compatibility:** {{api_compatibility}} + - **Database Schema Compatibility:** {{db_compatibility}} + - **UI/UX Consistency:** {{ui_compatibility}} + - **Performance Impact:** {{performance_constraints}} + + - id: tech-stack-alignment + title: Tech Stack Alignment + instruction: | + Ensure new components align with existing technology choices: + + 1. Use existing technology stack as the foundation + 2. Only introduce new technologies if absolutely necessary + 3. Justify any new additions with clear rationale + 4. Ensure version compatibility with existing dependencies + elicit: true + sections: + - id: existing-stack + title: Existing Technology Stack + type: table + columns: [Category, Current Technology, Version, Usage in Enhancement, Notes] + instruction: Document the current stack that must be maintained or integrated with + - id: new-tech-additions + title: New Technology Additions + condition: Enhancement requires new technologies + type: table + columns: [Technology, Version, Purpose, Rationale, Integration Method] + instruction: Only include if new technologies are required for the enhancement + + - id: data-models + title: Data Models and Schema Changes + instruction: | + Define new data models and how they integrate with existing schema: + + 1. Identify new entities required for the enhancement + 2. Define relationships with existing data models + 3. Plan database schema changes (additions, modifications) + 4. Ensure backward compatibility + elicit: true + sections: + - id: new-models + title: New Data Models + repeatable: true + sections: + - id: model + title: "{{model_name}}" + template: | + **Purpose:** {{model_purpose}} + **Integration:** {{integration_with_existing}} + + **Key Attributes:** + - {{attribute_1}}: {{type_1}} - {{description_1}} + - {{attribute_2}}: {{type_2}} - {{description_2}} + + **Relationships:** + - **With Existing:** {{existing_relationships}} + - **With New:** {{new_relationships}} + - id: schema-integration + title: Schema Integration Strategy + template: | + **Database Changes Required:** + - **New Tables:** {{new_tables_list}} + - **Modified Tables:** {{modified_tables_list}} + - **New Indexes:** {{new_indexes_list}} + - **Migration Strategy:** {{migration_approach}} + + **Backward Compatibility:** + - {{compatibility_measure_1}} + - {{compatibility_measure_2}} + + - id: component-architecture + title: Component Architecture + instruction: | + Define new components and their integration with existing architecture: + + 1. Identify new components required for the enhancement + 2. Define interfaces with existing components + 3. Establish clear boundaries and responsibilities + 4. Plan integration points and data flow + + MANDATORY VALIDATION: Before presenting component architecture, confirm: "The new components I'm proposing follow the existing architectural patterns I identified in your codebase: [specific patterns]. The integration interfaces respect your current component structure and communication patterns. Does this match your project's reality?" + elicit: true + sections: + - id: new-components + title: New Components + repeatable: true + sections: + - id: component + title: "{{component_name}}" + template: | + **Responsibility:** {{component_description}} + **Integration Points:** {{integration_points}} + + **Key Interfaces:** + - {{interface_1}} + - {{interface_2}} + + **Dependencies:** + - **Existing Components:** {{existing_dependencies}} + - **New Components:** {{new_dependencies}} + + **Technology Stack:** {{component_tech_details}} + - id: interaction-diagram + title: Component Interaction Diagram + type: mermaid + mermaid_type: graph + instruction: Create Mermaid diagram showing how new components interact with existing ones + + - id: api-design + title: API Design and Integration + condition: Enhancement requires API changes + instruction: | + Define new API endpoints and integration with existing APIs: + + 1. Plan new API endpoints required for the enhancement + 2. Ensure consistency with existing API patterns + 3. Define authentication and authorization integration + 4. Plan versioning strategy if needed + elicit: true + sections: + - id: api-strategy + title: API Integration Strategy + template: | + **API Integration Strategy:** {{api_integration_strategy}} + **Authentication:** {{auth_integration}} + **Versioning:** {{versioning_approach}} + - id: new-endpoints + title: New API Endpoints + repeatable: true + sections: + - id: endpoint + title: "{{endpoint_name}}" + template: | + - **Method:** {{http_method}} + - **Endpoint:** {{endpoint_path}} + - **Purpose:** {{endpoint_purpose}} + - **Integration:** {{integration_with_existing}} + sections: + - id: request + title: Request + type: code + language: json + template: "{{request_schema}}" + - id: response + title: Response + type: code + language: json + template: "{{response_schema}}" + + - id: external-api-integration + title: External API Integration + condition: Enhancement requires new external APIs + instruction: Document new external API integrations required for the enhancement + repeatable: true + sections: + - id: external-api + title: "{{api_name}} API" + template: | + - **Purpose:** {{api_purpose}} + - **Documentation:** {{api_docs_url}} + - **Base URL:** {{api_base_url}} + - **Authentication:** {{auth_method}} + - **Integration Method:** {{integration_approach}} + + **Key Endpoints Used:** + - `{{method}} {{endpoint_path}}` - {{endpoint_purpose}} + + **Error Handling:** {{error_handling_strategy}} + + - id: source-tree-integration + title: Source Tree Integration + instruction: | + Define how new code will integrate with existing project structure: + + 1. Follow existing project organization patterns + 2. Identify where new files/folders will be placed + 3. Ensure consistency with existing naming conventions + 4. Plan for minimal disruption to existing structure + elicit: true + sections: + - id: existing-structure + title: Existing Project Structure + type: code + language: plaintext + instruction: Document relevant parts of current structure + template: "{{existing_structure_relevant_parts}}" + - id: new-file-organization + title: New File Organization + type: code + language: plaintext + instruction: Show only new additions to existing structure + template: | + {{project-root}}/ + ├── {{existing_structure_context}} + │ ├── {{new_folder_1}}/ # {{purpose_1}} + │ │ ├── {{new_file_1}} + │ │ └── {{new_file_2}} + │ ├── {{existing_folder}}/ # Existing folder with additions + │ │ ├── {{existing_file}} # Existing file + │ │ └── {{new_file_3}} # New addition + │ └── {{new_folder_2}}/ # {{purpose_2}} + - id: integration-guidelines + title: Integration Guidelines + template: | + - **File Naming:** {{file_naming_consistency}} + - **Folder Organization:** {{folder_organization_approach}} + - **Import/Export Patterns:** {{import_export_consistency}} + + - id: infrastructure-deployment + title: Infrastructure and Deployment Integration + instruction: | + Define how the enhancement will be deployed alongside existing infrastructure: + + 1. Use existing deployment pipeline and infrastructure + 2. Identify any infrastructure changes needed + 3. Plan deployment strategy to minimize risk + 4. Define rollback procedures + elicit: true + sections: + - id: existing-infrastructure + title: Existing Infrastructure + template: | + **Current Deployment:** {{existing_deployment_summary}} + **Infrastructure Tools:** {{existing_infrastructure_tools}} + **Environments:** {{existing_environments}} + - id: enhancement-deployment + title: Enhancement Deployment Strategy + template: | + **Deployment Approach:** {{deployment_approach}} + **Infrastructure Changes:** {{infrastructure_changes}} + **Pipeline Integration:** {{pipeline_integration}} + - id: rollback-strategy + title: Rollback Strategy + template: | + **Rollback Method:** {{rollback_method}} + **Risk Mitigation:** {{risk_mitigation}} + **Monitoring:** {{monitoring_approach}} + + - id: coding-standards + title: Coding Standards and Conventions + instruction: | + Ensure new code follows existing project conventions: + + 1. Document existing coding standards from project analysis + 2. Identify any enhancement-specific requirements + 3. Ensure consistency with existing codebase patterns + 4. Define standards for new code organization + elicit: true + sections: + - id: existing-standards + title: Existing Standards Compliance + template: | + **Code Style:** {{existing_code_style}} + **Linting Rules:** {{existing_linting}} + **Testing Patterns:** {{existing_test_patterns}} + **Documentation Style:** {{existing_doc_style}} + - id: enhancement-standards + title: Enhancement-Specific Standards + condition: New patterns needed for enhancement + repeatable: true + template: "- **{{standard_name}}:** {{standard_description}}" + - id: integration-rules + title: Critical Integration Rules + template: | + - **Existing API Compatibility:** {{api_compatibility_rule}} + - **Database Integration:** {{db_integration_rule}} + - **Error Handling:** {{error_handling_integration}} + - **Logging Consistency:** {{logging_consistency}} + + - id: testing-strategy + title: Testing Strategy + instruction: | + Define testing approach for the enhancement: + + 1. Integrate with existing test suite + 2. Ensure existing functionality remains intact + 3. Plan for testing new features + 4. Define integration testing approach + elicit: true + sections: + - id: existing-test-integration + title: Integration with Existing Tests + template: | + **Existing Test Framework:** {{existing_test_framework}} + **Test Organization:** {{existing_test_organization}} + **Coverage Requirements:** {{existing_coverage_requirements}} + - id: new-testing + title: New Testing Requirements + sections: + - id: unit-tests + title: Unit Tests for New Components + template: | + - **Framework:** {{test_framework}} + - **Location:** {{test_location}} + - **Coverage Target:** {{coverage_target}} + - **Integration with Existing:** {{test_integration}} + - id: integration-tests + title: Integration Tests + template: | + - **Scope:** {{integration_test_scope}} + - **Existing System Verification:** {{existing_system_verification}} + - **New Feature Testing:** {{new_feature_testing}} + - id: regression-tests + title: Regression Testing + template: | + - **Existing Feature Verification:** {{regression_test_approach}} + - **Automated Regression Suite:** {{automated_regression}} + - **Manual Testing Requirements:** {{manual_testing_requirements}} + + - id: security-integration + title: Security Integration + instruction: | + Ensure security consistency with existing system: + + 1. Follow existing security patterns and tools + 2. Ensure new features don't introduce vulnerabilities + 3. Maintain existing security posture + 4. Define security testing for new components + elicit: true + sections: + - id: existing-security + title: Existing Security Measures + template: | + **Authentication:** {{existing_auth}} + **Authorization:** {{existing_authz}} + **Data Protection:** {{existing_data_protection}} + **Security Tools:** {{existing_security_tools}} + - id: enhancement-security + title: Enhancement Security Requirements + template: | + **New Security Measures:** {{new_security_measures}} + **Integration Points:** {{security_integration_points}} + **Compliance Requirements:** {{compliance_requirements}} + - id: security-testing + title: Security Testing + template: | + **Existing Security Tests:** {{existing_security_tests}} + **New Security Test Requirements:** {{new_security_tests}} + **Penetration Testing:** {{pentest_requirements}} + + - id: checklist-results + title: Checklist Results Report + instruction: Execute the architect-checklist and populate results here, focusing on brownfield-specific validation + + - id: next-steps + title: Next Steps + instruction: | + After completing the brownfield architecture: + + 1. Review integration points with existing system + 2. Begin story implementation with Dev agent + 3. Set up deployment pipeline integration + 4. Plan rollback and monitoring procedures + sections: + - id: story-manager-handoff + title: Story Manager Handoff + instruction: | + Create a brief prompt for Story Manager to work with this brownfield enhancement. Include: + - Reference to this architecture document + - Key integration requirements validated with user + - Existing system constraints based on actual project analysis + - First story to implement with clear integration checkpoints + - Emphasis on maintaining existing system integrity throughout implementation + - id: developer-handoff + title: Developer Handoff + instruction: | + Create a brief prompt for developers starting implementation. Include: + - Reference to this architecture and existing coding standards analyzed from actual project + - Integration requirements with existing codebase validated with user + - Key technical decisions based on real project constraints + - Existing system compatibility requirements with specific verification steps + - Clear sequencing of implementation to minimize risk to existing functionality +==================== END: .bmad-core/templates/brownfield-architecture-tmpl.yaml ==================== ==================== START: .bmad-core/checklists/architect-checklist.md ==================== # Architect Solution Validation Checklist @@ -8281,479 +7998,493 @@ Document sharded successfully: - Ensure the sharding is reversible (could reconstruct the original from shards) ==================== END: .bmad-core/tasks/shard-doc.md ==================== -==================== START: .bmad-core/templates/prd-tmpl.md ==================== -# {{Project Name}} Product Requirements Document (PRD) - -[[LLM: The default path and filename unless specified is docs/prd.md]] - -[[LLM: If available, review any provided document or ask if any are optionally available: Project Brief]] - -## Goals and Background Context - -[[LLM: Populate the 2 child sections based on what we have received from user description or the provided brief. Allow user to review the 2 sections and offer changes before proceeding]] - -### Goals - -[[LLM: Bullet list of 1 line desired outcomes the PRD will deliver if successful - user and project desires]] - -### Background Context - -[[LLM: 1-2 short paragraphs summarizing the background context, such as what we learned in the brief without being redundant with the goals, what and why this solves a problem, what the current landscape or need is etc...]] - -### Change Log - -[[LLM: Track document versions and changes]] - -| Date | Version | Description | Author | -| :--- | :------ | :---------- | :----- | - -## Requirements - -[[LLM: Draft the list of functional and non functional requirements under the two child sections, and immediately execute .bmad-core/tasks/advanced-elicitation.md display]] - -### Functional - -[[LLM: Each Requirement will be a bullet markdown and an identifier sequence starting with FR`.]] -@{example: - FR6: The Todo List uses AI to detect and warn against adding potentially duplicate todo items that are worded differently.} - -### Non Functional - -[[LLM: Each Requirement will be a bullet markdown and an identifier sequence starting with NFR`.]] -@{example: - NFR1: AWS service usage **must** aim to stay within free-tier limits where feasible.} - -^^CONDITION: has_ui^^ - -## User Interface Design Goals - -[[LLM: Capture high-level UI/UX vision to guide Design Architect and to inform story creation. Steps: - -1. Pre-fill all subsections with educated guesses based on project context -2. Present the complete rendered section to user -3. Clearly let the user know where assumptions were made -4. Ask targeted questions for unclear/missing elements or areas needing more specification -5. This is NOT detailed UI spec - focus on product vision and user goals -6. After section completion, immediately apply `.bmad-core/tasks/advanced-elicitation.md` protocol]] - -### Overall UX Vision - -### Key Interaction Paradigms - -### Core Screens and Views - -[[LLM: From a product perspective, what are the most critical screens or views necessary to deliver the the PRD values and goals? This is meant to be Conceptual High Level to Drive Rough Epic or User Stories]] - -@{example} - -- Login Screen -- Main Dashboard -- Item Detail Page -- Settings Page - @{/example} - -### Accessibility: { None, WCAG, etc } - -### Branding - -[[LLM: Any known branding elements or style guides that must be incorporated?]] - -@{example} - -- Replicate the look and feel of early 1900s black and white cinema, including animated effects replicating film damage or projector glitches during page or state transitions. -- Attached is the full color pallet and tokens for our corporate branding. - @{/example} - -### Target Device and Platforms - -@{example} -"Web Responsive, and all mobile platforms", "IPhone Only", "ASCII Windows Desktop" -@{/example} - -^^/CONDITION: has_ui^^ - -## Technical Assumptions - -[[LLM: Gather technical decisions that will guide the Architect. Steps: - -1. Check if `.bmad-core/data/technical-preferences.yaml` or an attached `technical-preferences` file exists - use it to pre-populate choices -2. Ask user about: languages, frameworks, starter templates, libraries, APIs, deployment targets -3. For unknowns, offer guidance based on project goals and MVP scope -4. Document ALL technical choices with rationale (why this choice fits the project) -5. These become constraints for the Architect - be specific and complete -6. After section completion, apply `.bmad-core/tasks/advanced-elicitation.md` protocol.]] - -### Repository Structure: { Monorepo, Polyrepo, etc...} - -### Service Architecture - -[[LLM: CRITICAL DECISION - Document the high-level service architecture (e.g., Monolith, Microservices, Serverless functions within a Monorepo).]] - -### Testing requirements - -[[LLM: CRITICAL DECISION - Document the testing requirements, unit only, integration, e2e, manual, need for manual testing convenience methods).]] - -### Additional Technical Assumptions and Requests - -[[LLM: Throughout the entire process of drafting this document, if any other technical assumptions are raised or discovered appropriate for the architect, add them here as additional bulleted items]] - -## Epics - -[[LLM: First, present a high-level list of all epics for user approval, the epic_list and immediately execute .bmad-core/tasks/advanced-elicitation.md display. Each epic should have a title and a short (1 sentence) goal statement. This allows the user to review the overall structure before diving into details. - -CRITICAL: Epics MUST be logically sequential following agile best practices: - -- Each epic should deliver a significant, end-to-end, fully deployable increment of testable functionality -- Epic 1 must establish foundational project infrastructure (app setup, Git, CI/CD, core services) unless we are adding new functionality to an existing app, while also delivering an initial piece of functionality, even as simple as a health-check route or display of a simple canary page - remember this when we produce the stories for the first epic! -- Each subsequent epic builds upon previous epics' functionality delivering major blocks of functionality that provide tangible value to users or business when deployed -- Not every project needs multiple epics, an epic needs to deliver value. For example, an API completed can deliver value even if a UI is not complete and planned for a separate epic. -- Err on the side of less epics, but let the user know your rationale and offer options for splitting them if it seems some are too large or focused on disparate things. -- Cross Cutting Concerns should flow through epics and stories and not be final stories. For example, adding a logging framework as a last story of an epic, or at the end of a project as a final epic or story would be terrible as we would not have logging from the beginning.]] - -<> - -- Epic{{epic_number}} {{epic_title}}: {{short_goal}} - -<> - -@{example: epic_list} - -1. Foundation & Core Infrastructure: Establish project setup, authentication, and basic user management -2. Core Business Entities: Create and manage primary domain objects with CRUD operations -3. User Workflows & Interactions: Enable key user journeys and business processes -4. Reporting & Analytics: Provide insights and data visualization for users - -@{/example} - -[[LLM: After the epic list is approved, present each `epic_details` with all its stories and acceptance criteria as a complete review unit and immediately execute .bmad-core/tasks/advanced-elicitation.md display, before moving on to the next epic.]] - -<> - -## Epic {{epic_number}} {{epic_title}} - -{{epic_goal}} [[LLM: Expanded goal - 2-3 sentences describing the objective and value all the stories will achieve]] - -[[LLM: CRITICAL STORY SEQUENCING REQUIREMENTS: - -- Stories within each epic MUST be logically sequential -- Each story should be a "vertical slice" delivering complete functionality aside from early enabler stories for project foundation -- No story should depend on work from a later story or epic -- Identify and note any direct prerequisite stories -- Focus on "what" and "why" not "how" (leave technical implementation to Architect) yet be precise enough to support a logical sequential order of operations from story to story. -- Ensure each story delivers clear user or business value, try to avoid enablers and build them into stories that deliver value. -- Size stories for AI agent execution: Each story must be completable by a single AI agent in one focused session without context overflow -- Think "junior developer working for 2-4 hours" - stories must be small, focused, and self-contained -- If a story seems complex, break it down further as long as it can deliver a vertical slice -- Each story should result in working, testable code before the agent's context window fills]] - -<> - -### Story {{epic_number}}.{{story_number}} {{story_title}} - -As a {{user_type}}, -I want {{action}}, -so that {{benefit}}. - -#### Acceptance Criteria - -[[LLM: Define clear, comprehensive, and testable acceptance criteria that: - -- Precisely define what "done" means from a functional perspective -- Are unambiguous and serve as basis for verification -- Include any critical non-functional requirements from the PRD -- Consider local testability for backend/data components -- Specify UI/UX requirements and framework adherence where applicable -- Avoid cross-cutting concerns that should be in other stories or PRD sections]] - -<> - -- {{criterion number}}: {{criteria}} - -<> -<> -<> - -## Checklist Results Report - -[[LLM: Before running the checklist and drafting the prompts, offer to output the full updated PRD. If outputting it, confirm with the user that you will be proceeding to run the checklist and produce the report. Once the user confirms, execute the `pm-checklist` and populate the results in this section.]] - -## Next Steps - -### Design Architect Prompt - -[[LLM: This section will contain the prompt for the Design Architect, keep it short and to the point to initiate create architecture mode using this document as input.]] - -### Architect Prompt - -[[LLM: This section will contain the prompt for the Architect, keep it short and to the point to initiate create architecture mode using this document as input.]] -==================== END: .bmad-core/templates/prd-tmpl.md ==================== - -==================== START: .bmad-core/templates/brownfield-prd-tmpl.md ==================== -# {{Project Name}} Brownfield Enhancement PRD - -[[LLM: The default path and filename unless specified is docs/prd.md]] - -[[LLM: IMPORTANT - SCOPE ASSESSMENT REQUIRED: - -This PRD is for SIGNIFICANT enhancements to existing projects that require comprehensive planning and multiple stories. Before proceeding: - -1. **Assess Enhancement Complexity**: If this is a simple feature addition or bug fix that could be completed in 1-2 focused development sessions, STOP and recommend: "For simpler changes, consider using the brownfield-create-epic or brownfield-create-story task with the Product Owner instead. This full PRD process is designed for substantial enhancements that require architectural planning and multiple coordinated stories." - -2. **Project Context**: Determine if we're working in an IDE with the project already loaded or if the user needs to provide project information. If project files are available, analyze existing documentation in the docs folder. If insufficient documentation exists, recommend running the document-project task first. - -3. **Deep Assessment Requirement**: You MUST thoroughly analyze the existing project structure, patterns, and constraints before making ANY suggestions. Every recommendation must be grounded in actual project analysis, not assumptions.]] - -## Intro Project Analysis and Context - -[[LLM: Gather comprehensive information about the existing project. This section must be completed before proceeding with requirements. - -CRITICAL: Throughout this analysis, explicitly confirm your understanding with the user. For every assumption you make about the existing project, ask: "Based on my analysis, I understand that [assumption]. Is this correct?" - -Do not proceed with any recommendations until the user has validated your understanding of the existing system.]] - -### Existing Project Overview - -[[LLM: Check if document-project analysis was already performed. If yes, reference that output instead of re-analyzing.]] - -**Analysis Source**: [[LLM: Indicate one of the following: -- Document-project output available at: {{path}} -- IDE-based fresh analysis -- User-provided information -]] - -**Current Project State**: [[LLM: -- If document-project output exists: Extract summary from "High Level Architecture" and "Technical Summary" sections -- Otherwise: Brief description of what the project currently does and its primary purpose -]] - -### Available Documentation Analysis - -[[LLM: -If document-project was run: -- Note: "Document-project analysis available - using existing technical documentation" -- List key documents created by document-project -- Skip the missing documentation check below - -Otherwise, check for existing documentation: -]] - -**Available Documentation**: - -- [ ] Tech Stack Documentation [[LLM: If from document-project, check ✓]] -- [ ] Source Tree/Architecture [[LLM: If from document-project, check ✓]] -- [ ] Coding Standards [[LLM: If from document-project, may be partial]] -- [ ] API Documentation [[LLM: If from document-project, check ✓]] -- [ ] External API Documentation [[LLM: If from document-project, check ✓]] -- [ ] UX/UI Guidelines [[LLM: May not be in document-project]] -- [ ] Technical Debt Documentation [[LLM: If from document-project, check ✓]] -- [ ] Other: \***\*\_\_\_\*\*** - -[[LLM: -- If document-project was already run: "Using existing project analysis from document-project output." -- If critical documentation is missing and no document-project: "I recommend running the document-project task first..." -]] - -### Enhancement Scope Definition - -[[LLM: Work with user to clearly define what type of enhancement this is. This is critical for scoping and approach.]] - -**Enhancement Type**: [[LLM: Determine with user which applies]] - -- [ ] New Feature Addition -- [ ] Major Feature Modification -- [ ] Integration with New Systems -- [ ] Performance/Scalability Improvements -- [ ] UI/UX Overhaul -- [ ] Technology Stack Upgrade -- [ ] Bug Fix and Stability Improvements -- [ ] Other: \***\*\_\_\_\*\*** - -**Enhancement Description**: [[LLM: 2-3 sentences describing what the user wants to add or change]] - -**Impact Assessment**: [[LLM: Assess the scope of impact on existing codebase]] - -- [ ] Minimal Impact (isolated additions) -- [ ] Moderate Impact (some existing code changes) -- [ ] Significant Impact (substantial existing code changes) -- [ ] Major Impact (architectural changes required) - -### Goals and Background Context - -#### Goals - -[[LLM: Bullet list of 1-line desired outcomes this enhancement will deliver if successful]] - -#### Background Context - -[[LLM: 1-2 short paragraphs explaining why this enhancement is needed, what problem it solves, and how it fits with the existing project]] - -### Change Log - -| Change | Date | Version | Description | Author | -| ------ | ---- | ------- | ----------- | ------ | - -## Requirements - -[[LLM: Draft functional and non-functional requirements based on your validated understanding of the existing project. Before presenting requirements, confirm: "These requirements are based on my understanding of your existing system. Please review carefully and confirm they align with your project's reality." Then immediately execute tasks#advanced-elicitation display]] - -### Functional - -[[LLM: Each Requirement will be a bullet markdown with identifier starting with FR]] -@{example: - FR1: The existing Todo List will integrate with the new AI duplicate detection service without breaking current functionality.} - -### Non Functional - -[[LLM: Each Requirement will be a bullet markdown with identifier starting with NFR. Include constraints from existing system]] -@{example: - NFR1: Enhancement must maintain existing performance characteristics and not exceed current memory usage by more than 20%.} - -### Compatibility Requirements - -[[LLM: Critical for brownfield - what must remain compatible]] - -- CR1: [[LLM: Existing API compatibility requirements]] -- CR2: [[LLM: Database schema compatibility requirements]] -- CR3: [[LLM: UI/UX consistency requirements]] -- CR4: [[LLM: Integration compatibility requirements]] - -^^CONDITION: has_ui^^ - -## User Interface Enhancement Goals - -[[LLM: For UI changes, capture how they will integrate with existing UI patterns and design systems]] - -### Integration with Existing UI - -[[LLM: Describe how new UI elements will fit with existing design patterns, style guides, and component libraries]] - -### Modified/New Screens and Views - -[[LLM: List only the screens/views that will be modified or added]] - -### UI Consistency Requirements - -[[LLM: Specific requirements for maintaining visual and interaction consistency with existing application]] - -^^/CONDITION: has_ui^^ - -## Technical Constraints and Integration Requirements - -[[LLM: This section replaces separate architecture documentation. Gather detailed technical constraints from existing project analysis.]] - -### Existing Technology Stack - -[[LLM: -If document-project output available: -- Extract from "Actual Tech Stack" table in High Level Architecture section -- Include version numbers and any noted constraints - -Otherwise, document the current technology stack: -]] - -**Languages**: [[LLM: From document-project or fresh analysis]] -**Frameworks**: [[LLM: From document-project or fresh analysis]] -**Database**: [[LLM: From document-project or fresh analysis]] -**Infrastructure**: [[LLM: From document-project or fresh analysis]] -**External Dependencies**: [[LLM: From document-project "External Services" section or fresh analysis]] - -### Integration Approach - -[[LLM: Define how the enhancement will integrate with existing architecture]] - -**Database Integration Strategy**: [[LLM: How new features will interact with existing database]] -**API Integration Strategy**: [[LLM: How new APIs will integrate with existing API structure]] -**Frontend Integration Strategy**: [[LLM: How new UI components will integrate with existing frontend]] -**Testing Integration Strategy**: [[LLM: How new tests will integrate with existing test suite]] - -### Code Organization and Standards - -[[LLM: Based on existing project analysis, define how new code will fit existing patterns]] - -**File Structure Approach**: [[LLM: How new files will fit existing project structure]] -**Naming Conventions**: [[LLM: Existing naming conventions that must be followed]] -**Coding Standards**: [[LLM: Existing coding standards and linting rules]] -**Documentation Standards**: [[LLM: How new code documentation will match existing patterns]] - -### Deployment and Operations - -[[LLM: How the enhancement fits existing deployment pipeline]] - -**Build Process Integration**: [[LLM: How enhancement builds with existing process]] -**Deployment Strategy**: [[LLM: How enhancement will be deployed alongside existing features]] -**Monitoring and Logging**: [[LLM: How enhancement will integrate with existing monitoring]] -**Configuration Management**: [[LLM: How new configuration will integrate with existing config]] - -### Risk Assessment and Mitigation - -[[LLM: -If document-project output available: -- Reference "Technical Debt and Known Issues" section -- Include "Workarounds and Gotchas" that might impact enhancement -- Note any identified constraints from "Critical Technical Debt" - -Build risk assessment incorporating existing known issues: -]] - -**Technical Risks**: [[LLM: Include risks from document-project + new enhancement risks]] -**Integration Risks**: [[LLM: Reference integration constraints from document-project]] -**Deployment Risks**: [[LLM: Include deployment gotchas from document-project]] -**Mitigation Strategies**: [[LLM: Address both existing and new risks]] - -## Epic and Story Structure - -[[LLM: For brownfield projects, favor a single comprehensive epic unless the user is clearly requesting multiple unrelated enhancements. Before presenting the epic structure, confirm: "Based on my analysis of your existing project, I believe this enhancement should be structured as [single epic/multiple epics] because [rationale based on actual project analysis]. Does this align with your understanding of the work required?" Then present the epic structure and immediately execute tasks#advanced-elicitation display.]] - -### Epic Approach - -[[LLM: Explain the rationale for epic structure - typically single epic for brownfield unless multiple unrelated features]] - -**Epic Structure Decision**: [[LLM: Single Epic or Multiple Epics with rationale]] - -## Epic 1: {{enhancement_title}} - -[[LLM: Comprehensive epic that delivers the brownfield enhancement while maintaining existing functionality]] - -**Epic Goal**: [[LLM: 2-3 sentences describing the complete enhancement objective and value]] - -**Integration Requirements**: [[LLM: Key integration points with existing system]] - -[[LLM: CRITICAL STORY SEQUENCING FOR BROWNFIELD: - -- Stories must ensure existing functionality remains intact -- Each story should include verification that existing features still work -- Stories should be sequenced to minimize risk to existing system -- Include rollback considerations for each story -- Focus on incremental integration rather than big-bang changes -- Size stories for AI agent execution in existing codebase context -- MANDATORY: Present the complete story sequence and ask: "This story sequence is designed to minimize risk to your existing system. Does this order make sense given your project's architecture and constraints?" -- Stories must be logically sequential with clear dependencies identified -- Each story must deliver value while maintaining system integrity]] - -<> - -### Story 1.{{story_number}} {{story_title}} - -As a {{user_type}}, -I want {{action}}, -so that {{benefit}}. - -#### Acceptance Criteria - -[[LLM: Define criteria that include both new functionality and existing system integrity]] - -<> - -- {{criterion number}}: {{criteria}} - -<> - -#### Integration Verification - -[[LLM: Specific verification steps to ensure existing functionality remains intact]] - -- IV1: [[LLM: Existing functionality verification requirement]] -- IV2: [[LLM: Integration point verification requirement]] -- IV3: [[LLM: Performance impact verification requirement]] - -<> -==================== END: .bmad-core/templates/brownfield-prd-tmpl.md ==================== +==================== START: .bmad-core/templates/prd-tmpl.yaml ==================== +template: + id: prd-template-v2 + name: Product Requirements Document + version: 2.0 + output: + format: markdown + filename: docs/prd.md + title: "{{project_name}} Product Requirements Document (PRD)" + +workflow: + mode: interactive + elicitation: advanced-elicitation + +sections: + - id: goals-context + title: Goals and Background Context + instruction: | + Ask if Project Brief document is available. If NO Project Brief exists, STRONGLY recommend creating one first using project-brief-tmpl (it provides essential foundation: problem statement, target users, success metrics, MVP scope, constraints). If user insists on PRD without brief, gather this information during Goals section. If Project Brief exists, review and use it to populate Goals (bullet list of desired outcomes) and Background Context (1-2 paragraphs on what this solves and why) so we can determine what is and is not in scope for PRD mvp. Either way this is critical to determine the requirements. Include Change Log table. + sections: + - id: goals + title: Goals + type: bullet-list + instruction: Bullet list of 1 line desired outcomes the PRD will deliver if successful - user and project desires + - id: background + title: Background Context + type: paragraphs + instruction: 1-2 short paragraphs summarizing the background context, such as what we learned in the brief without being redundant with the goals, what and why this solves a problem, what the current landscape or need is + - id: changelog + title: Change Log + type: table + columns: [Date, Version, Description, Author] + instruction: Track document versions and changes + + - id: requirements + title: Requirements + instruction: Draft the list of functional and non functional requirements under the two child sections + elicit: true + sections: + - id: functional + title: Functional + type: numbered-list + prefix: FR + instruction: Each Requirement will be a bullet markdown and an identifier sequence starting with FR + examples: + - "FR6: The Todo List uses AI to detect and warn against potentially duplicate todo items that are worded differently." + - id: non-functional + title: Non Functional + type: numbered-list + prefix: NFR + instruction: Each Requirement will be a bullet markdown and an identifier sequence starting with NFR + examples: + - "NFR1: AWS service usage must aim to stay within free-tier limits where feasible." + + - id: ui-goals + title: User Interface Design Goals + condition: PRD has UX/UI requirements + instruction: | + Capture high-level UI/UX vision to guide Design Architect and to inform story creation. Steps: + + 1. Pre-fill all subsections with educated guesses based on project context + 2. Present the complete rendered section to user + 3. Clearly let the user know where assumptions were made + 4. Ask targeted questions for unclear/missing elements or areas needing more specification + 5. This is NOT detailed UI spec - focus on product vision and user goals + elicit: true + choices: + accessibility: [None, WCAG AA, WCAG AAA] + platforms: [Web Responsive, Mobile Only, Desktop Only, Cross-Platform] + sections: + - id: ux-vision + title: Overall UX Vision + - id: interaction-paradigms + title: Key Interaction Paradigms + - id: core-screens + title: Core Screens and Views + instruction: From a product perspective, what are the most critical screens or views necessary to deliver the the PRD values and goals? This is meant to be Conceptual High Level to Drive Rough Epic or User Stories + examples: + - "Login Screen" + - "Main Dashboard" + - "Item Detail Page" + - "Settings Page" + - id: accessibility + title: "Accessibility: {None|WCAG AA|WCAG AAA|Custom Requirements}" + - id: branding + title: Branding + instruction: Any known branding elements or style guides that must be incorporated? + examples: + - "Replicate the look and feel of early 1900s black and white cinema, including animated effects replicating film damage or projector glitches during page or state transitions." + - "Attached is the full color pallet and tokens for our corporate branding." + - id: target-platforms + title: "Target Device and Platforms: {Web Responsive|Mobile Only|Desktop Only|Cross-Platform}" + examples: + - "Web Responsive, and all mobile platforms" + - "iPhone Only" + - "ASCII Windows Desktop" + + - id: technical-assumptions + title: Technical Assumptions + instruction: | + Gather technical decisions that will guide the Architect. Steps: + + 1. Check if .bmad-core/data/technical-preferences.yaml or an attached technical-preferences file exists - use it to pre-populate choices + 2. Ask user about: languages, frameworks, starter templates, libraries, APIs, deployment targets + 3. For unknowns, offer guidance based on project goals and MVP scope + 4. Document ALL technical choices with rationale (why this choice fits the project) + 5. These become constraints for the Architect - be specific and complete + elicit: true + choices: + repository: [Monorepo, Polyrepo] + architecture: [Monolith, Microservices, Serverless] + testing: [Unit Only, Unit + Integration, Full Testing Pyramid] + sections: + - id: repository-structure + title: "Repository Structure: {Monorepo|Polyrepo|Multi-repo}" + - id: service-architecture + title: Service Architecture + instruction: "CRITICAL DECISION - Document the high-level service architecture (e.g., Monolith, Microservices, Serverless functions within a Monorepo)." + - id: testing-requirements + title: Testing Requirements + instruction: "CRITICAL DECISION - Document the testing requirements, unit only, integration, e2e, manual, need for manual testing convenience methods)." + - id: additional-assumptions + title: Additional Technical Assumptions and Requests + instruction: Throughout the entire process of drafting this document, if any other technical assumptions are raised or discovered appropriate for the architect, add them here as additional bulleted items + + - id: epic-list + title: Epic List + instruction: | + Present a high-level list of all epics for user approval. Each epic should have a title and a short (1 sentence) goal statement. This allows the user to review the overall structure before diving into details. + + CRITICAL: Epics MUST be logically sequential following agile best practices: + + - Each epic should deliver a significant, end-to-end, fully deployable increment of testable functionality + - Epic 1 must establish foundational project infrastructure (app setup, Git, CI/CD, core services) unless we are adding new functionality to an existing app, while also delivering an initial piece of functionality, even as simple as a health-check route or display of a simple canary page - remember this when we produce the stories for the first epic! + - Each subsequent epic builds upon previous epics' functionality delivering major blocks of functionality that provide tangible value to users or business when deployed + - Not every project needs multiple epics, an epic needs to deliver value. For example, an API completed can deliver value even if a UI is not complete and planned for a separate epic. + - Err on the side of less epics, but let the user know your rationale and offer options for splitting them if it seems some are too large or focused on disparate things. + - Cross Cutting Concerns should flow through epics and stories and not be final stories. For example, adding a logging framework as a last story of an epic, or at the end of a project as a final epic or story would be terrible as we would not have logging from the beginning. + elicit: true + examples: + - "Epic 1: Foundation & Core Infrastructure: Establish project setup, authentication, and basic user management" + - "Epic 2: Core Business Entities: Create and manage primary domain objects with CRUD operations" + - "Epic 3: User Workflows & Interactions: Enable key user journeys and business processes" + - "Epic 4: Reporting & Analytics: Provide insights and data visualization for users" + + - id: epic-details + title: Epic {{epic_number}} {{epic_title}} + repeatable: true + instruction: | + After the epic list is approved, present each epic with all its stories and acceptance criteria as a complete review unit. + + For each epic provide expanded goal (2-3 sentences describing the objective and value all the stories will achieve). + + CRITICAL STORY SEQUENCING REQUIREMENTS: + + - Stories within each epic MUST be logically sequential + - Each story should be a "vertical slice" delivering complete functionality aside from early enabler stories for project foundation + - No story should depend on work from a later story or epic + - Identify and note any direct prerequisite stories + - Focus on "what" and "why" not "how" (leave technical implementation to Architect) yet be precise enough to support a logical sequential order of operations from story to story. + - Ensure each story delivers clear user or business value, try to avoid enablers and build them into stories that deliver value. + - Size stories for AI agent execution: Each story must be completable by a single AI agent in one focused session without context overflow + - Think "junior developer working for 2-4 hours" - stories must be small, focused, and self-contained + - If a story seems complex, break it down further as long as it can deliver a vertical slice + elicit: true + template: "{{epic_goal}}" + sections: + - id: story + title: Story {{epic_number}}.{{story_number}} {{story_title}} + repeatable: true + template: | + As a {{user_type}}, + I want {{action}}, + so that {{benefit}}. + sections: + - id: acceptance-criteria + title: Acceptance Criteria + type: numbered-list + item_template: "{{criterion_number}}: {{criteria}}" + repeatable: true + instruction: | + Define clear, comprehensive, and testable acceptance criteria that: + + - Precisely define what "done" means from a functional perspective + - Are unambiguous and serve as basis for verification + - Include any critical non-functional requirements from the PRD + - Consider local testability for backend/data components + - Specify UI/UX requirements and framework adherence where applicable + - Avoid cross-cutting concerns that should be in other stories or PRD sections + + - id: checklist-results + title: Checklist Results Report + instruction: Before running the checklist and drafting the prompts, offer to output the full updated PRD. If outputting it, confirm with the user that you will be proceeding to run the checklist and produce the report. Once the user confirms, execute the pm-checklist and populate the results in this section. + + - id: next-steps + title: Next Steps + sections: + - id: design-architect-prompt + title: Design Architect Prompt + instruction: This section will contain the prompt for the Design Architect, keep it short and to the point to initiate create architecture mode using this document as input. + - id: architect-prompt + title: Architect Prompt + instruction: This section will contain the prompt for the Architect, keep it short and to the point to initiate create architecture mode using this document as input. +==================== END: .bmad-core/templates/prd-tmpl.yaml ==================== + +==================== START: .bmad-core/templates/brownfield-prd-tmpl.yaml ==================== +template: + id: brownfield-prd-template-v2 + name: Brownfield Enhancement PRD + version: 2.0 + output: + format: markdown + filename: docs/prd.md + title: "{{project_name}} Brownfield Enhancement PRD" + +workflow: + mode: interactive + elicitation: advanced-elicitation + +sections: + - id: intro-analysis + title: Intro Project Analysis and Context + instruction: | + IMPORTANT - SCOPE ASSESSMENT REQUIRED: + + This PRD is for SIGNIFICANT enhancements to existing projects that require comprehensive planning and multiple stories. Before proceeding: + + 1. **Assess Enhancement Complexity**: If this is a simple feature addition or bug fix that could be completed in 1-2 focused development sessions, STOP and recommend: "For simpler changes, consider using the brownfield-create-epic or brownfield-create-story task with the Product Owner instead. This full PRD process is designed for substantial enhancements that require architectural planning and multiple coordinated stories." + + 2. **Project Context**: Determine if we're working in an IDE with the project already loaded or if the user needs to provide project information. If project files are available, analyze existing documentation in the docs folder. If insufficient documentation exists, recommend running the document-project task first. + + 3. **Deep Assessment Requirement**: You MUST thoroughly analyze the existing project structure, patterns, and constraints before making ANY suggestions. Every recommendation must be grounded in actual project analysis, not assumptions. + + Gather comprehensive information about the existing project. This section must be completed before proceeding with requirements. + + CRITICAL: Throughout this analysis, explicitly confirm your understanding with the user. For every assumption you make about the existing project, ask: "Based on my analysis, I understand that [assumption]. Is this correct?" + + Do not proceed with any recommendations until the user has validated your understanding of the existing system. + sections: + - id: existing-project-overview + title: Existing Project Overview + instruction: Check if document-project analysis was already performed. If yes, reference that output instead of re-analyzing. + sections: + - id: analysis-source + title: Analysis Source + instruction: | + Indicate one of the following: + - Document-project output available at: {{path}} + - IDE-based fresh analysis + - User-provided information + - id: current-state + title: Current Project State + instruction: | + - If document-project output exists: Extract summary from "High Level Architecture" and "Technical Summary" sections + - Otherwise: Brief description of what the project currently does and its primary purpose + - id: documentation-analysis + title: Available Documentation Analysis + instruction: | + If document-project was run: + - Note: "Document-project analysis available - using existing technical documentation" + - List key documents created by document-project + - Skip the missing documentation check below + + Otherwise, check for existing documentation: + sections: + - id: available-docs + title: Available Documentation + type: checklist + items: + - Tech Stack Documentation [[LLM: If from document-project, check ✓]] + - Source Tree/Architecture [[LLM: If from document-project, check ✓]] + - Coding Standards [[LLM: If from document-project, may be partial]] + - API Documentation [[LLM: If from document-project, check ✓]] + - External API Documentation [[LLM: If from document-project, check ✓]] + - UX/UI Guidelines [[LLM: May not be in document-project]] + - Technical Debt Documentation [[LLM: If from document-project, check ✓]] + - "Other: {{other_docs}}" + instruction: | + - If document-project was already run: "Using existing project analysis from document-project output." + - If critical documentation is missing and no document-project: "I recommend running the document-project task first..." + - id: enhancement-scope + title: Enhancement Scope Definition + instruction: Work with user to clearly define what type of enhancement this is. This is critical for scoping and approach. + sections: + - id: enhancement-type + title: Enhancement Type + type: checklist + instruction: Determine with user which applies + items: + - New Feature Addition + - Major Feature Modification + - Integration with New Systems + - Performance/Scalability Improvements + - UI/UX Overhaul + - Technology Stack Upgrade + - Bug Fix and Stability Improvements + - "Other: {{other_type}}" + - id: enhancement-description + title: Enhancement Description + instruction: 2-3 sentences describing what the user wants to add or change + - id: impact-assessment + title: Impact Assessment + type: checklist + instruction: Assess the scope of impact on existing codebase + items: + - Minimal Impact (isolated additions) + - Moderate Impact (some existing code changes) + - Significant Impact (substantial existing code changes) + - Major Impact (architectural changes required) + - id: goals-context + title: Goals and Background Context + sections: + - id: goals + title: Goals + type: bullet-list + instruction: Bullet list of 1-line desired outcomes this enhancement will deliver if successful + - id: background + title: Background Context + type: paragraphs + instruction: 1-2 short paragraphs explaining why this enhancement is needed, what problem it solves, and how it fits with the existing project + - id: changelog + title: Change Log + type: table + columns: [Change, Date, Version, Description, Author] + + - id: requirements + title: Requirements + instruction: | + Draft functional and non-functional requirements based on your validated understanding of the existing project. Before presenting requirements, confirm: "These requirements are based on my understanding of your existing system. Please review carefully and confirm they align with your project's reality." + elicit: true + sections: + - id: functional + title: Functional + type: numbered-list + prefix: FR + instruction: Each Requirement will be a bullet markdown with identifier starting with FR + examples: + - "FR1: The existing Todo List will integrate with the new AI duplicate detection service without breaking current functionality." + - id: non-functional + title: Non Functional + type: numbered-list + prefix: NFR + instruction: Each Requirement will be a bullet markdown with identifier starting with NFR. Include constraints from existing system + examples: + - "NFR1: Enhancement must maintain existing performance characteristics and not exceed current memory usage by more than 20%." + - id: compatibility + title: Compatibility Requirements + instruction: Critical for brownfield - what must remain compatible + type: numbered-list + prefix: CR + template: "{{requirement}}: {{description}}" + items: + - id: cr1 + template: "CR1: {{existing_api_compatibility}}" + - id: cr2 + template: "CR2: {{database_schema_compatibility}}" + - id: cr3 + template: "CR3: {{ui_ux_consistency}}" + - id: cr4 + template: "CR4: {{integration_compatibility}}" + + - id: ui-enhancement-goals + title: User Interface Enhancement Goals + condition: Enhancement includes UI changes + instruction: For UI changes, capture how they will integrate with existing UI patterns and design systems + sections: + - id: existing-ui-integration + title: Integration with Existing UI + instruction: Describe how new UI elements will fit with existing design patterns, style guides, and component libraries + - id: modified-screens + title: Modified/New Screens and Views + instruction: List only the screens/views that will be modified or added + - id: ui-consistency + title: UI Consistency Requirements + instruction: Specific requirements for maintaining visual and interaction consistency with existing application + + - id: technical-constraints + title: Technical Constraints and Integration Requirements + instruction: This section replaces separate architecture documentation. Gather detailed technical constraints from existing project analysis. + sections: + - id: existing-tech-stack + title: Existing Technology Stack + instruction: | + If document-project output available: + - Extract from "Actual Tech Stack" table in High Level Architecture section + - Include version numbers and any noted constraints + + Otherwise, document the current technology stack: + template: | + **Languages**: {{languages}} + **Frameworks**: {{frameworks}} + **Database**: {{database}} + **Infrastructure**: {{infrastructure}} + **External Dependencies**: {{external_dependencies}} + - id: integration-approach + title: Integration Approach + instruction: Define how the enhancement will integrate with existing architecture + template: | + **Database Integration Strategy**: {{database_integration}} + **API Integration Strategy**: {{api_integration}} + **Frontend Integration Strategy**: {{frontend_integration}} + **Testing Integration Strategy**: {{testing_integration}} + - id: code-organization + title: Code Organization and Standards + instruction: Based on existing project analysis, define how new code will fit existing patterns + template: | + **File Structure Approach**: {{file_structure}} + **Naming Conventions**: {{naming_conventions}} + **Coding Standards**: {{coding_standards}} + **Documentation Standards**: {{documentation_standards}} + - id: deployment-operations + title: Deployment and Operations + instruction: How the enhancement fits existing deployment pipeline + template: | + **Build Process Integration**: {{build_integration}} + **Deployment Strategy**: {{deployment_strategy}} + **Monitoring and Logging**: {{monitoring_logging}} + **Configuration Management**: {{config_management}} + - id: risk-assessment + title: Risk Assessment and Mitigation + instruction: | + If document-project output available: + - Reference "Technical Debt and Known Issues" section + - Include "Workarounds and Gotchas" that might impact enhancement + - Note any identified constraints from "Critical Technical Debt" + + Build risk assessment incorporating existing known issues: + template: | + **Technical Risks**: {{technical_risks}} + **Integration Risks**: {{integration_risks}} + **Deployment Risks**: {{deployment_risks}} + **Mitigation Strategies**: {{mitigation_strategies}} + + - id: epic-structure + title: Epic and Story Structure + instruction: | + For brownfield projects, favor a single comprehensive epic unless the user is clearly requesting multiple unrelated enhancements. Before presenting the epic structure, confirm: "Based on my analysis of your existing project, I believe this enhancement should be structured as [single epic/multiple epics] because [rationale based on actual project analysis]. Does this align with your understanding of the work required?" + elicit: true + sections: + - id: epic-approach + title: Epic Approach + instruction: Explain the rationale for epic structure - typically single epic for brownfield unless multiple unrelated features + template: "**Epic Structure Decision**: {{epic_decision}} with rationale" + + - id: epic-details + title: "Epic 1: {{enhancement_title}}" + instruction: | + Comprehensive epic that delivers the brownfield enhancement while maintaining existing functionality + + CRITICAL STORY SEQUENCING FOR BROWNFIELD: + - Stories must ensure existing functionality remains intact + - Each story should include verification that existing features still work + - Stories should be sequenced to minimize risk to existing system + - Include rollback considerations for each story + - Focus on incremental integration rather than big-bang changes + - Size stories for AI agent execution in existing codebase context + - MANDATORY: Present the complete story sequence and ask: "This story sequence is designed to minimize risk to your existing system. Does this order make sense given your project's architecture and constraints?" + - Stories must be logically sequential with clear dependencies identified + - Each story must deliver value while maintaining system integrity + template: | + **Epic Goal**: {{epic_goal}} + + **Integration Requirements**: {{integration_requirements}} + sections: + - id: story + title: "Story 1.{{story_number}} {{story_title}}" + repeatable: true + template: | + As a {{user_type}}, + I want {{action}}, + so that {{benefit}}. + sections: + - id: acceptance-criteria + title: Acceptance Criteria + type: numbered-list + instruction: Define criteria that include both new functionality and existing system integrity + item_template: "{{criterion_number}}: {{criteria}}" + - id: integration-verification + title: Integration Verification + instruction: Specific verification steps to ensure existing functionality remains intact + type: numbered-list + prefix: IV + items: + - template: "IV1: {{existing_functionality_verification}}" + - template: "IV2: {{integration_point_verification}}" + - template: "IV3: {{performance_impact_verification}}" +==================== END: .bmad-core/templates/brownfield-prd-tmpl.yaml ==================== ==================== START: .bmad-core/checklists/pm-checklist.md ==================== # Product Manager (PM) Requirements Checklist @@ -9318,66 +9049,145 @@ Keep it action-oriented and forward-looking.]] --- ==================== END: .bmad-core/checklists/change-checklist.md ==================== -==================== START: .bmad-core/templates/story-tmpl.md ==================== ---- -defaultOutput: docs/stories/{{EpicNum}}.{{StoryNum}}.{{Short Title Copied from Epic File specific story}}.md -smAgent: - editableSections: Status, Story, Acceptance Criteria, Tasks / Subtasks, Dev Notes, Testing, Change Log - sectionSpecificInstructions: - "Dev Notes": - - Populate relevant information, only what was pulled from actual artifacts from docs folder, relevant to this story - - Do not invent information. - - If known add Relevant Source Tree info that relates to this story. - - If there were important notes from previous story that are relevant to this one, include them here. - - Put enough information in this section so that the dev agent should NEVER need to read the architecture documents, these notes along with the tasks and subtasks must give the Dev Agent the complete context it needs to comprehend with the least amount of overhead the information to complete the story, meeting all AC and completing all tasks+subtasks. - Testing: - - List Relevant Testing Standards from Architecture the Developer needs to conform to (test file location, test standards, etc) ---- +==================== START: .bmad-core/templates/story-tmpl.yaml ==================== +template: + id: story-template-v2 + name: Story Document + version: 2.0 + output: + format: markdown + filename: docs/stories/{{epic_num}}.{{story_num}}.{{story_title_short}}.md + title: "Story {{epic_num}}.{{story_num}}: {{story_title_short}}" -# Story {{EpicNum}}.{{StoryNum}}: {{Short Title Copied from Epic File specific story}} +workflow: + mode: interactive + elicitation: advanced-elicitation -## Status: {{ Draft | Approved | InProgress | Review | Done }} +agent_config: + editable_sections: + - Status + - Story + - Acceptance Criteria + - Tasks / Subtasks + - Dev Notes + - Testing + - Change Log -## Story - -**As a** {{role}},\ -**I want** {{action}},\ -**so that** {{benefit}} - -## Acceptance Criteria - -{{ Copy of Acceptance Criteria numbered list }} - -## Tasks / Subtasks - -- [ ] Task 1 (AC: # if applicable) - - [ ] Subtask1.1... -- [ ] Task 2 (AC: # if applicable) - - [ ] Subtask 2.1... -- [ ] Task 3 (AC: # if applicable) - - [ ] Subtask 3.1... - -## Dev Notes - -### Testing - -## Change Log - -| Date | Version | Description | Author | -| :--- | :------ | :---------- | :----- | - -## Dev Agent Record - -### Agent Model Used: {{Agent Model Name/Version}} - -### Debug Log References - -### Completion Notes List - -### File List - -## QA Results -==================== END: .bmad-core/templates/story-tmpl.md ==================== +sections: + - id: status + title: Status + type: choice + choices: [Draft, Approved, InProgress, Review, Done] + instruction: Select the current status of the story + owner: scrum-master + editors: [scrum-master, dev-agent] + + - id: story + title: Story + type: template-text + template: | + **As a** {{role}}, + **I want** {{action}}, + **so that** {{benefit}} + instruction: Define the user story using the standard format with role, action, and benefit + elicit: true + owner: scrum-master + editors: [scrum-master] + + - id: acceptance-criteria + title: Acceptance Criteria + type: numbered-list + instruction: Copy the acceptance criteria numbered list from the epic file + elicit: true + owner: scrum-master + editors: [scrum-master] + + - id: tasks-subtasks + title: Tasks / Subtasks + type: bullet-list + instruction: | + Break down the story into specific tasks and subtasks needed for implementation. + Reference applicable acceptance criteria numbers where relevant. + template: | + - [ ] Task 1 (AC: # if applicable) + - [ ] Subtask1.1... + - [ ] Task 2 (AC: # if applicable) + - [ ] Subtask 2.1... + - [ ] Task 3 (AC: # if applicable) + - [ ] Subtask 3.1... + elicit: true + owner: scrum-master + editors: [scrum-master, dev-agent] + + - id: dev-notes + title: Dev Notes + instruction: | + Populate relevant information, only what was pulled from actual artifacts from docs folder, relevant to this story: + - Do not invent information + - If known add Relevant Source Tree info that relates to this story + - If there were important notes from previous story that are relevant to this one, include them here + - Put enough information in this section so that the dev agent should NEVER need to read the architecture documents, these notes along with the tasks and subtasks must give the Dev Agent the complete context it needs to comprehend with the least amount of overhead the information to complete the story, meeting all AC and completing all tasks+subtasks + elicit: true + owner: scrum-master + editors: [scrum-master] + sections: + - id: testing-standards + title: Testing + instruction: | + List Relevant Testing Standards from Architecture the Developer needs to conform to: + - Test file location + - Test standards + - Testing frameworks and patterns to use + - Any specific testing requirements for this story + elicit: true + owner: scrum-master + editors: [scrum-master] + + - id: change-log + title: Change Log + type: table + columns: [Date, Version, Description, Author] + instruction: Track changes made to this story document + owner: scrum-master + editors: [scrum-master, dev-agent, qa-agent] + + - id: dev-agent-record + title: Dev Agent Record + instruction: This section is populated by the development agent during implementation + owner: dev-agent + editors: [dev-agent] + sections: + - id: agent-model + title: Agent Model Used + template: "{{agent_model_name_version}}" + instruction: Record the specific AI agent model and version used for development + owner: dev-agent + editors: [dev-agent] + + - id: debug-log-references + title: Debug Log References + instruction: Reference any debug logs or traces generated during development + owner: dev-agent + editors: [dev-agent] + + - id: completion-notes + title: Completion Notes List + instruction: Notes about the completion of tasks and any issues encountered + owner: dev-agent + editors: [dev-agent] + + - id: file-list + title: File List + instruction: List all files created, modified, or affected during story implementation + owner: dev-agent + editors: [dev-agent] + + - id: qa-results + title: QA Results + instruction: Results from QA Agent QA review of the completed story implementation + owner: qa-agent + editors: [qa-agent] +==================== END: .bmad-core/templates/story-tmpl.yaml ==================== ==================== START: .bmad-core/checklists/po-master-checklist.md ==================== # Product Owner (PO) Master Validation Checklist @@ -10301,421 +10111,357 @@ You will now synthesize the inputs and the above principles into a final, compre - Conclude by reminding the user that all AI-generated code will require careful human review, testing, and refinement to be considered production-ready. ==================== END: .bmad-core/tasks/generate-ai-frontend-prompt.md ==================== -==================== START: .bmad-core/templates/front-end-spec-tmpl.md ==================== -# {{Project Name}} UI/UX Specification - -[[LLM: The default path and filename unless specified is docs/front-end-spec.md]] - -[[LLM: Review provided documents including Project Brief, PRD, and any user research to gather context. Focus on understanding user needs, pain points, and desired outcomes before beginning the specification.]] - -## Introduction - -[[LLM: Establish the document's purpose and scope. Keep the content below but ensure project name is properly substituted.]] - -This document defines the user experience goals, information architecture, user flows, and visual design specifications for {{Project Name}}'s user interface. It serves as the foundation for visual design and frontend development, ensuring a cohesive and user-centered experience. - -### Overall UX Goals & Principles - -[[LLM: Work with the user to establish and document the following. If not already defined, facilitate a discussion to determine: - -1. Target User Personas - elicit details or confirm existing ones from PRD -2. Key Usability Goals - understand what success looks like for users -3. Core Design Principles - establish 3-5 guiding principles - -After presenting this section, apply `tasks#advanced-elicitation` protocol]] - -### Target User Personas - -{{persona_descriptions}} - -@{example: personas} - -- **Power User:** Technical professionals who need advanced features and efficiency -- **Casual User:** Occasional users who prioritize ease of use and clear guidance -- **Administrator:** System managers who need control and oversight capabilities - @{/example} - -### Usability Goals - -{{usability_goals}} - -@{example: usability_goals} - -- Ease of learning: New users can complete core tasks within 5 minutes -- Efficiency of use: Power users can complete frequent tasks with minimal clicks -- Error prevention: Clear validation and confirmation for destructive actions -- Memorability: Infrequent users can return without relearning - @{/example} - -### Design Principles - -{{design_principles}} - -@{example: design_principles} - -1. **Clarity over cleverness** - Prioritize clear communication over aesthetic innovation -2. **Progressive disclosure** - Show only what's needed, when it's needed -3. **Consistent patterns** - Use familiar UI patterns throughout the application -4. **Immediate feedback** - Every action should have a clear, immediate response -5. **Accessible by default** - Design for all users from the start - @{/example} - -### Change Log - -[[LLM: Track document versions and changes]] - -| Date | Version | Description | Author | -| :--- | :------ | :---------- | :----- | - -## Information Architecture (IA) - -[[LLM: Collaborate with the user to create a comprehensive information architecture: - -1. Build a Site Map or Screen Inventory showing all major areas -2. Define the Navigation Structure (primary, secondary, breadcrumbs) -3. Use Mermaid diagrams for visual representation -4. Consider user mental models and expected groupings - -After presenting this section, apply `tasks#advanced-elicitation` protocol]] - -### Site Map / Screen Inventory - -```mermaid -{{sitemap_diagram}} -``` - -@{example: sitemap} - -```mermaid -graph TD - A[Homepage] --> B[Dashboard] - A --> C[Products] - A --> D[Account] - B --> B1[Analytics] - B --> B2[Recent Activity] - C --> C1[Browse] - C --> C2[Search] - C --> C3[Product Details] - D --> D1[Profile] - D --> D2[Settings] - D --> D3[Billing] -``` - -@{/example} - -### Navigation Structure - -**Primary Navigation:** {{primary_nav_description}} - -**Secondary Navigation:** {{secondary_nav_description}} - -**Breadcrumb Strategy:** {{breadcrumb_strategy}} - -## User Flows - -[[LLM: For each critical user task identified in the PRD: - -1. Define the user's goal clearly -2. Map out all steps including decision points -3. Consider edge cases and error states -4. Use Mermaid flow diagrams for clarity -5. Link to external tools (Figma/Miro) if detailed flows exist there - -Create subsections for each major flow. After presenting all flows, apply `tasks#advanced-elicitation` protocol]] - -<> - -### {{flow_name}} - -**User Goal:** {{flow_goal}} - -**Entry Points:** {{entry_points}} - -**Success Criteria:** {{success_criteria}} - -#### Flow Diagram - -```mermaid -{{flow_diagram}} -``` - -**Edge Cases & Error Handling:** - -- {{edge_case_1}} -- {{edge_case_2}} - -**Notes:** {{flow_notes}} -<> - -@{example: user_flow} - -### User Registration - -**User Goal:** Create a new account to access the platform - -**Entry Points:** Homepage CTA, Login page link, Marketing landing pages - -**Success Criteria:** User successfully creates account and reaches dashboard - -#### Flow Diagram - -```mermaid -graph TD - Start[Landing Page] --> Click[Click Sign Up] - Click --> Form[Registration Form] - Form --> Fill[Fill Required Fields] - Fill --> Submit[Submit Form] - Submit --> Validate{Valid?} - Validate -->|No| Error[Show Errors] - Error --> Form - Validate -->|Yes| Verify[Email Verification] - Verify --> Complete[Account Created] - Complete --> Dashboard[Redirect to Dashboard] -``` - -**Edge Cases & Error Handling:** - -- Duplicate email: Show inline error with password recovery option -- Weak password: Real-time feedback on password strength -- Network error: Preserve form data and show retry option - @{/example} - -## Wireframes & Mockups - -[[LLM: Clarify where detailed visual designs will be created (Figma, Sketch, etc.) and how to reference them. If low-fidelity wireframes are needed, offer to help conceptualize layouts for key screens. - -After presenting this section, apply `tasks#advanced-elicitation` protocol]] - -**Primary Design Files:** {{design_tool_link}} - -### Key Screen Layouts - -<> - -#### {{screen_name}} - -**Purpose:** {{screen_purpose}} - -**Key Elements:** - -- {{element_1}} -- {{element_2}} -- {{element_3}} - -**Interaction Notes:** {{interaction_notes}} - -**Design File Reference:** {{specific_frame_link}} -<> - -## Component Library / Design System - -[[LLM: Discuss whether to use an existing design system or create a new one. If creating new, identify foundational components and their key states. Note that detailed technical specs belong in front-end-architecture. - -After presenting this section, apply `tasks#advanced-elicitation` protocol]] - -**Design System Approach:** {{design_system_approach}} - -### Core Components - -<> - -#### {{component_name}} - -**Purpose:** {{component_purpose}} - -**Variants:** {{component_variants}} - -**States:** {{component_states}} - -**Usage Guidelines:** {{usage_guidelines}} -<> - -@{example: component} - -#### Button - -**Purpose:** Primary interaction element for user actions - -**Variants:** Primary, Secondary, Tertiary, Destructive - -**States:** Default, Hover, Active, Disabled, Loading - -**Usage Guidelines:** - -- Use Primary for main CTAs (one per view) -- Secondary for supporting actions -- Destructive only for permanent deletions with confirmation - @{/example} - -## Branding & Style Guide - -[[LLM: Link to existing style guide or define key brand elements. Ensure consistency with company brand guidelines if they exist. - -After presenting this section, apply `tasks#advanced-elicitation` protocol]] - -### Visual Identity - -**Brand Guidelines:** {{brand_guidelines_link}} - -### Color Palette - -| Color Type | Hex Code | Usage | -| :------------ | :------------------ | :------------------------------- | -| **Primary** | {{primary_color}} | {{primary_usage}} | -| **Secondary** | {{secondary_color}} | {{secondary_usage}} | -| **Accent** | {{accent_color}} | {{accent_usage}} | -| **Success** | {{success_color}} | Positive feedback, confirmations | -| **Warning** | {{warning_color}} | Cautions, important notices | -| **Error** | {{error_color}} | Errors, destructive actions | -| **Neutral** | {{neutral_colors}} | Text, borders, backgrounds | - -### Typography - -**Font Families:** - -- **Primary:** {{primary_font}} -- **Secondary:** {{secondary_font}} -- **Monospace:** {{mono_font}} - -**Type Scale:** -| Element | Size | Weight | Line Height | -|:--------|:-----|:-------|:------------| -| H1 | {{h1_size}} | {{h1_weight}} | {{h1_line}} | -| H2 | {{h2_size}} | {{h2_weight}} | {{h2_line}} | -| H3 | {{h3_size}} | {{h3_weight}} | {{h3_line}} | -| Body | {{body_size}} | {{body_weight}} | {{body_line}} | -| Small | {{small_size}} | {{small_weight}} | {{small_line}} | - -### Iconography - -**Icon Library:** {{icon_library}} - -**Usage Guidelines:** {{icon_guidelines}} - -### Spacing & Layout - -**Grid System:** {{grid_system}} - -**Spacing Scale:** {{spacing_scale}} - -## Accessibility Requirements - -[[LLM: Define specific accessibility requirements based on target compliance level and user needs. Be comprehensive but practical. - -After presenting this section, apply `tasks#advanced-elicitation` protocol]] - -### Compliance Target - -**Standard:** {{compliance_standard}} - -### Key Requirements - -**Visual:** - -- Color contrast ratios: {{contrast_requirements}} -- Focus indicators: {{focus_requirements}} -- Text sizing: {{text_requirements}} - -**Interaction:** - -- Keyboard navigation: {{keyboard_requirements}} -- Screen reader support: {{screen_reader_requirements}} -- Touch targets: {{touch_requirements}} - -**Content:** - -- Alternative text: {{alt_text_requirements}} -- Heading structure: {{heading_requirements}} -- Form labels: {{form_requirements}} - -### Testing Strategy - -{{accessibility_testing}} - -## Responsiveness Strategy - -[[LLM: Define breakpoints and adaptation strategies for different device sizes. Consider both technical constraints and user contexts. - -After presenting this section, apply `tasks#advanced-elicitation` protocol]] - -### Breakpoints - -| Breakpoint | Min Width | Max Width | Target Devices | -| :--------- | :-------------- | :-------------- | :------------------ | -| Mobile | {{mobile_min}} | {{mobile_max}} | {{mobile_devices}} | -| Tablet | {{tablet_min}} | {{tablet_max}} | {{tablet_devices}} | -| Desktop | {{desktop_min}} | {{desktop_max}} | {{desktop_devices}} | -| Wide | {{wide_min}} | - | {{wide_devices}} | - -### Adaptation Patterns - -**Layout Changes:** {{layout_adaptations}} - -**Navigation Changes:** {{nav_adaptations}} - -**Content Priority:** {{content_adaptations}} - -**Interaction Changes:** {{interaction_adaptations}} - -## Animation & Micro-interactions - -[[LLM: Define motion design principles and key interactions. Keep performance and accessibility in mind. - -After presenting this section, apply `tasks#advanced-elicitation` protocol]] - -### Motion Principles - -{{motion_principles}} - -### Key Animations - -<> - -- **{{animation_name}}:** {{animation_description}} (Duration: {{duration}}, Easing: {{easing}}) - <> - -## Performance Considerations - -[[LLM: Define performance goals and strategies that impact UX design decisions.]] - -### Performance Goals - -- **Page Load:** {{load_time_goal}} -- **Interaction Response:** {{interaction_goal}} -- **Animation FPS:** {{animation_goal}} - -### Design Strategies - -{{performance_strategies}} - -## Next Steps - -[[LLM: After completing the UI/UX specification: - -1. Recommend review with stakeholders -2. Suggest creating/updating visual designs in design tool -3. Prepare for handoff to Design Architect for frontend architecture -4. Note any open questions or decisions needed]] - -### Immediate Actions - -1. {{next_step_1}} -2. {{next_step_2}} -3. {{next_step_3}} - -### Design Handoff Checklist - -- [ ] All user flows documented -- [ ] Component inventory complete -- [ ] Accessibility requirements defined -- [ ] Responsive strategy clear -- [ ] Brand guidelines incorporated -- [ ] Performance goals established - -## Checklist Results - -[[LLM: If a UI/UX checklist exists, run it against this document and report results here.]] -==================== END: .bmad-core/templates/front-end-spec-tmpl.md ==================== +==================== START: .bmad-core/templates/front-end-spec-tmpl.yaml ==================== +template: + id: frontend-spec-template-v2 + name: UI/UX Specification + version: 2.0 + output: + format: markdown + filename: docs/front-end-spec.md + title: "{{project_name}} UI/UX Specification" + +workflow: + mode: interactive + elicitation: advanced-elicitation + +sections: + - id: introduction + title: Introduction + instruction: | + Review provided documents including Project Brief, PRD, and any user research to gather context. Focus on understanding user needs, pain points, and desired outcomes before beginning the specification. + + Establish the document's purpose and scope. Keep the content below but ensure project name is properly substituted. + content: | + This document defines the user experience goals, information architecture, user flows, and visual design specifications for {{project_name}}'s user interface. It serves as the foundation for visual design and frontend development, ensuring a cohesive and user-centered experience. + sections: + - id: ux-goals-principles + title: Overall UX Goals & Principles + instruction: | + Work with the user to establish and document the following. If not already defined, facilitate a discussion to determine: + + 1. Target User Personas - elicit details or confirm existing ones from PRD + 2. Key Usability Goals - understand what success looks like for users + 3. Core Design Principles - establish 3-5 guiding principles + elicit: true + sections: + - id: user-personas + title: Target User Personas + template: "{{persona_descriptions}}" + examples: + - "**Power User:** Technical professionals who need advanced features and efficiency" + - "**Casual User:** Occasional users who prioritize ease of use and clear guidance" + - "**Administrator:** System managers who need control and oversight capabilities" + - id: usability-goals + title: Usability Goals + template: "{{usability_goals}}" + examples: + - "Ease of learning: New users can complete core tasks within 5 minutes" + - "Efficiency of use: Power users can complete frequent tasks with minimal clicks" + - "Error prevention: Clear validation and confirmation for destructive actions" + - "Memorability: Infrequent users can return without relearning" + - id: design-principles + title: Design Principles + template: "{{design_principles}}" + type: numbered-list + examples: + - "**Clarity over cleverness** - Prioritize clear communication over aesthetic innovation" + - "**Progressive disclosure** - Show only what's needed, when it's needed" + - "**Consistent patterns** - Use familiar UI patterns throughout the application" + - "**Immediate feedback** - Every action should have a clear, immediate response" + - "**Accessible by default** - Design for all users from the start" + - id: changelog + title: Change Log + type: table + columns: [Date, Version, Description, Author] + instruction: Track document versions and changes + + - id: information-architecture + title: Information Architecture (IA) + instruction: | + Collaborate with the user to create a comprehensive information architecture: + + 1. Build a Site Map or Screen Inventory showing all major areas + 2. Define the Navigation Structure (primary, secondary, breadcrumbs) + 3. Use Mermaid diagrams for visual representation + 4. Consider user mental models and expected groupings + elicit: true + sections: + - id: sitemap + title: Site Map / Screen Inventory + type: mermaid + mermaid_type: graph + template: "{{sitemap_diagram}}" + examples: + - | + graph TD + A[Homepage] --> B[Dashboard] + A --> C[Products] + A --> D[Account] + B --> B1[Analytics] + B --> B2[Recent Activity] + C --> C1[Browse] + C --> C2[Search] + C --> C3[Product Details] + D --> D1[Profile] + D --> D2[Settings] + D --> D3[Billing] + - id: navigation-structure + title: Navigation Structure + template: | + **Primary Navigation:** {{primary_nav_description}} + + **Secondary Navigation:** {{secondary_nav_description}} + + **Breadcrumb Strategy:** {{breadcrumb_strategy}} + + - id: user-flows + title: User Flows + instruction: | + For each critical user task identified in the PRD: + + 1. Define the user's goal clearly + 2. Map out all steps including decision points + 3. Consider edge cases and error states + 4. Use Mermaid flow diagrams for clarity + 5. Link to external tools (Figma/Miro) if detailed flows exist there + + Create subsections for each major flow. + elicit: true + repeatable: true + sections: + - id: flow + title: "{{flow_name}}" + template: | + **User Goal:** {{flow_goal}} + + **Entry Points:** {{entry_points}} + + **Success Criteria:** {{success_criteria}} + sections: + - id: flow-diagram + title: Flow Diagram + type: mermaid + mermaid_type: graph + template: "{{flow_diagram}}" + - id: edge-cases + title: "Edge Cases & Error Handling:" + type: bullet-list + template: "- {{edge_case}}" + - id: notes + template: "**Notes:** {{flow_notes}}" + + - id: wireframes-mockups + title: Wireframes & Mockups + instruction: | + Clarify where detailed visual designs will be created (Figma, Sketch, etc.) and how to reference them. If low-fidelity wireframes are needed, offer to help conceptualize layouts for key screens. + elicit: true + sections: + - id: design-files + template: "**Primary Design Files:** {{design_tool_link}}" + - id: key-screen-layouts + title: Key Screen Layouts + repeatable: true + sections: + - id: screen + title: "{{screen_name}}" + template: | + **Purpose:** {{screen_purpose}} + + **Key Elements:** + - {{element_1}} + - {{element_2}} + - {{element_3}} + + **Interaction Notes:** {{interaction_notes}} + + **Design File Reference:** {{specific_frame_link}} + + - id: component-library + title: Component Library / Design System + instruction: | + Discuss whether to use an existing design system or create a new one. If creating new, identify foundational components and their key states. Note that detailed technical specs belong in front-end-architecture. + elicit: true + sections: + - id: design-system-approach + template: "**Design System Approach:** {{design_system_approach}}" + - id: core-components + title: Core Components + repeatable: true + sections: + - id: component + title: "{{component_name}}" + template: | + **Purpose:** {{component_purpose}} + + **Variants:** {{component_variants}} + + **States:** {{component_states}} + + **Usage Guidelines:** {{usage_guidelines}} + + - id: branding-style + title: Branding & Style Guide + instruction: Link to existing style guide or define key brand elements. Ensure consistency with company brand guidelines if they exist. + elicit: true + sections: + - id: visual-identity + title: Visual Identity + template: "**Brand Guidelines:** {{brand_guidelines_link}}" + - id: color-palette + title: Color Palette + type: table + columns: ["Color Type", "Hex Code", "Usage"] + rows: + - ["Primary", "{{primary_color}}", "{{primary_usage}}"] + - ["Secondary", "{{secondary_color}}", "{{secondary_usage}}"] + - ["Accent", "{{accent_color}}", "{{accent_usage}}"] + - ["Success", "{{success_color}}", "Positive feedback, confirmations"] + - ["Warning", "{{warning_color}}", "Cautions, important notices"] + - ["Error", "{{error_color}}", "Errors, destructive actions"] + - ["Neutral", "{{neutral_colors}}", "Text, borders, backgrounds"] + - id: typography + title: Typography + sections: + - id: font-families + title: Font Families + template: | + - **Primary:** {{primary_font}} + - **Secondary:** {{secondary_font}} + - **Monospace:** {{mono_font}} + - id: type-scale + title: Type Scale + type: table + columns: ["Element", "Size", "Weight", "Line Height"] + rows: + - ["H1", "{{h1_size}}", "{{h1_weight}}", "{{h1_line}}"] + - ["H2", "{{h2_size}}", "{{h2_weight}}", "{{h2_line}}"] + - ["H3", "{{h3_size}}", "{{h3_weight}}", "{{h3_line}}"] + - ["Body", "{{body_size}}", "{{body_weight}}", "{{body_line}}"] + - ["Small", "{{small_size}}", "{{small_weight}}", "{{small_line}}"] + - id: iconography + title: Iconography + template: | + **Icon Library:** {{icon_library}} + + **Usage Guidelines:** {{icon_guidelines}} + - id: spacing-layout + title: Spacing & Layout + template: | + **Grid System:** {{grid_system}} + + **Spacing Scale:** {{spacing_scale}} + + - id: accessibility + title: Accessibility Requirements + instruction: Define specific accessibility requirements based on target compliance level and user needs. Be comprehensive but practical. + elicit: true + sections: + - id: compliance-target + title: Compliance Target + template: "**Standard:** {{compliance_standard}}" + - id: key-requirements + title: Key Requirements + template: | + **Visual:** + - Color contrast ratios: {{contrast_requirements}} + - Focus indicators: {{focus_requirements}} + - Text sizing: {{text_requirements}} + + **Interaction:** + - Keyboard navigation: {{keyboard_requirements}} + - Screen reader support: {{screen_reader_requirements}} + - Touch targets: {{touch_requirements}} + + **Content:** + - Alternative text: {{alt_text_requirements}} + - Heading structure: {{heading_requirements}} + - Form labels: {{form_requirements}} + - id: testing-strategy + title: Testing Strategy + template: "{{accessibility_testing}}" + + - id: responsiveness + title: Responsiveness Strategy + instruction: Define breakpoints and adaptation strategies for different device sizes. Consider both technical constraints and user contexts. + elicit: true + sections: + - id: breakpoints + title: Breakpoints + type: table + columns: ["Breakpoint", "Min Width", "Max Width", "Target Devices"] + rows: + - ["Mobile", "{{mobile_min}}", "{{mobile_max}}", "{{mobile_devices}}"] + - ["Tablet", "{{tablet_min}}", "{{tablet_max}}", "{{tablet_devices}}"] + - ["Desktop", "{{desktop_min}}", "{{desktop_max}}", "{{desktop_devices}}"] + - ["Wide", "{{wide_min}}", "-", "{{wide_devices}}"] + - id: adaptation-patterns + title: Adaptation Patterns + template: | + **Layout Changes:** {{layout_adaptations}} + + **Navigation Changes:** {{nav_adaptations}} + + **Content Priority:** {{content_adaptations}} + + **Interaction Changes:** {{interaction_adaptations}} + + - id: animation + title: Animation & Micro-interactions + instruction: Define motion design principles and key interactions. Keep performance and accessibility in mind. + elicit: true + sections: + - id: motion-principles + title: Motion Principles + template: "{{motion_principles}}" + - id: key-animations + title: Key Animations + repeatable: true + template: "- **{{animation_name}}:** {{animation_description}} (Duration: {{duration}}, Easing: {{easing}})" + + - id: performance + title: Performance Considerations + instruction: Define performance goals and strategies that impact UX design decisions. + sections: + - id: performance-goals + title: Performance Goals + template: | + - **Page Load:** {{load_time_goal}} + - **Interaction Response:** {{interaction_goal}} + - **Animation FPS:** {{animation_goal}} + - id: design-strategies + title: Design Strategies + template: "{{performance_strategies}}" + + - id: next-steps + title: Next Steps + instruction: | + After completing the UI/UX specification: + + 1. Recommend review with stakeholders + 2. Suggest creating/updating visual designs in design tool + 3. Prepare for handoff to Design Architect for frontend architecture + 4. Note any open questions or decisions needed + sections: + - id: immediate-actions + title: Immediate Actions + type: numbered-list + template: "{{action}}" + - id: design-handoff-checklist + title: Design Handoff Checklist + type: checklist + items: + - "All user flows documented" + - "Component inventory complete" + - "Accessibility requirements defined" + - "Responsive strategy clear" + - "Brand guidelines incorporated" + - "Performance goals established" + + - id: checklist-results + title: Checklist Results + instruction: If a UI/UX checklist exists, run it against this document and report results here. +==================== END: .bmad-core/templates/front-end-spec-tmpl.yaml ==================== ==================== START: .bmad-core/workflows/brownfield-fullstack.yaml ==================== workflow: diff --git a/dist/teams/team-fullstack.txt b/dist/teams/team-fullstack.txt index c0a47551..559b0734 100644 --- a/dist/teams/team-fullstack.txt +++ b/dist/teams/team-fullstack.txt @@ -52,12 +52,12 @@ agents: - architect - po workflows: - - brownfield-fullstack - - brownfield-service - - brownfield-ui - - greenfield-fullstack - - greenfield-service - - greenfield-ui + - brownfield-fullstack.yaml + - brownfield-service.yaml + - brownfield-ui.yaml + - greenfield-fullstack.yaml + - greenfield-service.yaml + - greenfield-ui.yaml ==================== END: .bmad-core/agent-teams/team-fullstack.yaml ==================== ==================== START: .bmad-core/agents/bmad-orchestrator.md ==================== @@ -66,6 +66,15 @@ workflows: CRITICAL: Read the full YAML, start activation to alter your state of being, follow startup section instructions, stay in this being until told to exit this mode: ```yaml +activation-instructions: + - Mention *help shows all available commands and options + - Check for active workflow plan using .bmad-core/utils/plan-management.md + - 'If plan exists: Show 📋 Active plan: {workflow} ({progress}% complete). Use *plan-status for details.' + - 'If plan exists: Suggest next action based on plan progress' + - Assess user goal against available agents and workflows in this bundle + - If clear match to an agent's expertise, suggest transformation with *agent command + - If project-oriented, suggest *workflow-guidance to explore options + - Load resources only when needed - never pre-load agent: name: BMad Orchestrator id: bmad-orchestrator @@ -87,17 +96,6 @@ persona: - Always use numbered lists for choices - Process commands starting with * immediately - Always remind users that commands require * prefix -startup: - - Announce: Introduce yourself as the BMad Orchestrator, explain you can coordinate agents and workflows - - IMPORTANT: Tell users that all commands start with * (e.g., *help, *agent, *workflow) - - Mention *help shows all available commands and options - - Check for active workflow plan using .bmad-core/utils/plan-management.md - - 'If plan exists: Show 📋 Active plan: {workflow} ({progress}% complete). Use *plan-status for details.' - - 'If plan exists: Suggest next action based on plan progress' - - Assess user goal against available agents and workflows in this bundle - - If clear match to an agent's expertise, suggest transformation with *agent command - - If project-oriented, suggest *workflow-guidance to explore options - - Load resources only when needed - never pre-load commands: help: Show this guide with available agents and workflows chat-mode: Start conversational mode for detailed assistance @@ -185,17 +183,18 @@ workflow-guidance: - When *workflow-guidance is called, start an interactive session and list all available workflows with brief descriptions dependencies: tasks: - - advanced-elicitation - - create-doc - - create-workflow-plan - - kb-mode-interaction - - update-workflow-plan + - advanced-elicitation.md + - create-doc.md + - create-workflow-plan.md + - kb-mode-interaction.md + - update-workflow-plan.md data: - - bmad-kb + - bmad-kb.md + - elicitation-methods.md utils: - - plan-management - - workflow-management - - template-format + - plan-management.md + - workflow-management.md + - template-format.md ``` ==================== END: .bmad-core/agents/bmad-orchestrator.md ==================== @@ -208,8 +207,9 @@ CRITICAL: Read the full YAML, start activation to alter your state of being, fol activation-instructions: - Follow all instructions in this file -> this defines you, your persona and more importantly what you can do. STAY IN CHARACTER! - Only read the files/tasks listed here when user selects them for execution to minimize context usage - - The customization field ALWAYS takes precedence over any conflicting instructions + - The agent.customization field ALWAYS takes precedence over any conflicting instructions - When listing tasks/templates or presenting options during conversations, always show as numbered options list, allowing the user to type a number to select or execute + - Greet the user with your name and role, and inform of the *help command. agent: name: Mary id: analyst @@ -234,36 +234,32 @@ persona: - Maintaining a Broad Perspective - Stay aware of market trends and dynamics - Integrity of Information - Ensure accurate sourcing and representation - Numbered Options Protocol - Always use numbered lists for selections -startup: - - Greet the user with your name and role, and inform of the *help command. commands: - help: Show numbered list of the following commands to allow selection - create-doc {template}: execute task create-doc (no template = ONLY show available templates listed under dependencies/templates below) - - yolo: Toggle Yolo Mode off on - on will skip doc section confirmations + - yolo: Toggle Yolo Mode - doc-out: Output full document to current destination file - execute-checklist {checklist}: Run task execute-checklist (default->architect-checklist) - - research {topic}: execute task create-deep-research-prompt for architectural decisions + - research-prompt {topic}: execute task create-deep-research-prompt for architectural decisions - brainstorm {topic}: Facilitate structured brainstorming session - - elicit: list the options under output set of information + - elicit: run the task advanced-elicitation - document-project: Analyze and document existing project structure comprehensively - exit: Say goodbye as the Business Analyst, and then abandon inhabiting this persona dependencies: tasks: - - facilitate-brainstorming-session - - create-deep-research-prompt - - create-doc - - advanced-elicitation - - document-project + - facilitate-brainstorming-session.md + - create-deep-research-prompt.md + - create-doc.md + - advanced-elicitation.md + - document-project.md templates: - - project-brief-tmpl - - market-research-tmpl - - competitor-analysis-tmpl - - brainstorming-output-tmpl + - project-brief-tmpl.yaml + - market-research-tmpl.yaml + - competitor-analysis-tmpl.yaml + - brainstorming-output-tmpl.yaml data: - - bmad-kb - - brainstorming-techniques - utils: - - template-format + - bmad-kb.md + - brainstorming-techniques.md ``` ==================== END: .bmad-core/agents/analyst.md ==================== @@ -278,6 +274,7 @@ activation-instructions: - Only read the files/tasks listed here when user selects them for execution to minimize context usage - The customization field ALWAYS takes precedence over any conflicting instructions - When listing tasks/templates or presenting options during conversations, always show as numbered options list, allowing the user to type a number to select or execute + - Greet the user with your name and role, and inform of the *help command. agent: name: John id: pm @@ -299,33 +296,29 @@ persona: - Collaborative & iterative approach - Proactive risk identification - Strategic thinking & outcome-oriented -startup: - - Greet the user with your name and role, and inform of the *help command. commands: - help: Show numbered list of the following commands to allow selection - - create-doc {template}: execute task create-doc (no template = ONLY show available templates listed under dependencies/templates below) - - yolo: Toggle Yolo Mode off on - on will skip doc section confirmations + - create-doc {template}: execute task create-doc for template provided, if no template then ONLY list dependencies.templates + - yolo: Toggle Yolo Mode - doc-out: Output full document to current destination file - exit: Exit (confirm) dependencies: tasks: - - create-doc - - correct-course - - create-deep-research-prompt - - brownfield-create-epic - - brownfield-create-story - - execute-checklist - - shard-doc + - create-doc.md + - correct-course.md + - create-deep-research-prompt.md + - brownfield-create-epic.md + - brownfield-create-story.md + - execute-checklist.md + - shard-doc.md templates: - - prd-tmpl - - brownfield-prd-tmpl + - prd-tmpl.yaml + - brownfield-prd-tmpl.yaml checklists: - - pm-checklist - - change-checklist + - pm-checklist.md + - change-checklist.md data: - - technical-preferences - utils: - - template-format + - technical-preferences.md ``` ==================== END: .bmad-core/agents/pm.md ==================== @@ -340,6 +333,7 @@ activation-instructions: - Only read the files/tasks listed here when user selects them for execution to minimize context usage - The customization field ALWAYS takes precedence over any conflicting instructions - When listing tasks/templates or presenting options during conversations, always show as numbered options list, allowing the user to type a number to select or execute + - Greet the user with your name and role, and inform of the *help command. agent: name: Sally id: ux-expert @@ -361,9 +355,6 @@ persona: - You have a keen eye for detail and a deep empathy for users. - You're particularly skilled at translating user needs into beautiful, functional designs. - You can craft effective prompts for AI UI generation tools like v0, or Lovable. -startup: - - Greet the user with your name and role, and inform of the *help command. - - Always start by understanding the user's context, goals, and constraints before proposing solutions. commands: - help: Show numbered list of the following commands to allow selection - create-doc {template}: execute task create-doc (no template = ONLY show available templates listed under dependencies/templates below) @@ -373,16 +364,14 @@ commands: - exit: Say goodbye as the UX Expert, and then abandon inhabiting this persona dependencies: tasks: - - generate-ai-frontend-prompt - - create-deep-research-prompt - - create-doc - - execute-checklist + - generate-ai-frontend-prompt.md + - create-deep-research-prompt.md + - create-doc.md + - execute-checklist.md templates: - - front-end-spec-tmpl + - front-end-spec-tmpl.yaml data: - - technical-preferences - utils: - - template-format + - technical-preferences.md ``` ==================== END: .bmad-core/agents/ux-expert.md ==================== @@ -397,6 +386,8 @@ activation-instructions: - Only read the files/tasks listed here when user selects them for execution to minimize context usage - The customization field ALWAYS takes precedence over any conflicting instructions - When listing tasks/templates or presenting options during conversations, always show as numbered options list, allowing the user to type a number to select or execute + - Greet the user with your name and role, and inform of the *help command. + - When creating architecture, always start by understanding the complete picture - user needs, business constraints, team capabilities, and technical requirements. agent: name: Winston id: architect @@ -420,34 +411,29 @@ persona: - Data-Centric Design - Let data requirements drive architecture - Cost-Conscious Engineering - Balance technical ideals with financial reality - Living Architecture - Design for change and adaptation -startup: - - Greet the user with your name and role, and inform of the *help command. - - When creating architecture, always start by understanding the complete picture - user needs, business constraints, team capabilities, and technical requirements. commands: - help: Show numbered list of the following commands to allow selection - create-doc {template}: execute task create-doc (no template = ONLY show available templates listed under dependencies/templates below) - - yolo: Toggle Yolo Mode off on - on will skip doc section confirmations + - yolo: Toggle Yolo Mode - doc-out: Output full document to current destination file - execute-checklist {checklist}: Run task execute-checklist (default->architect-checklist) - research {topic}: execute task create-deep-research-prompt for architectural decisions - exit: Say goodbye as the Architect, and then abandon inhabiting this persona dependencies: tasks: - - create-doc - - create-deep-research-prompt - - document-project - - execute-checklist + - create-doc.md + - create-deep-research-prompt.md + - document-project.md + - execute-checklist.md templates: - - architecture-tmpl - - front-end-architecture-tmpl - - fullstack-architecture-tmpl - - brownfield-architecture-tmpl + - architecture-tmpl.yaml + - front-end-architecture-tmpl.yaml + - fullstack-architecture-tmpl.yaml + - brownfield-architecture-tmpl.yaml checklists: - - architect-checklist + - architect-checklist.md data: - - technical-preferences - utils: - - template-format + - technical-preferences.md ``` ==================== END: .bmad-core/agents/architect.md ==================== @@ -462,6 +448,7 @@ activation-instructions: - Only read the files/tasks listed here when user selects them for execution to minimize context usage - The customization field ALWAYS takes precedence over any conflicting instructions - When listing tasks/templates or presenting options during conversations, always show as numbered options list, allowing the user to type a number to select or execute + - Greet the user with your name and role, and inform of the *help command. agent: name: Sarah id: po @@ -485,8 +472,6 @@ persona: - User Collaboration for Validation - Seek input at critical checkpoints - Focus on Executable & Value-Driven Increments - Ensure work aligns with MVP goals - Documentation Ecosystem Integrity - Maintain consistency across all documents -startup: - - Greet the user with your name and role, and inform of the *help command. commands: - help: Show numbered list of the following commands to allow selection - create-doc {template}: execute task create-doc (no template = ONLY show available templates listed under dependencies/templates below) @@ -501,19 +486,17 @@ commands: - exit: Exit (confirm) dependencies: tasks: - - execute-checklist - - shard-doc - - correct-course - - brownfield-create-epic - - brownfield-create-story - - validate-next-story + - execute-checklist.md + - shard-doc.md + - correct-course.md + - brownfield-create-epic.md + - brownfield-create-story.md + - validate-next-story.md templates: - - story-tmpl + - story-tmpl.yaml checklists: - - po-master-checklist - - change-checklist - utils: - - template-format + - po-master-checklist.md + - change-checklist.md ``` ==================== END: .bmad-core/agents/po.md ==================== @@ -638,97 +621,85 @@ Choose a number (0-8) or 9 to proceed: ==================== END: .bmad-core/tasks/advanced-elicitation.md ==================== ==================== START: .bmad-core/tasks/create-doc.md ==================== -# Create Document from Template Task +# Create Document from Template (YAML Driven) -## Purpose +## CRITICAL: Mandatory Elicitation Format -Generate documents from templates by EXECUTING (not just reading) embedded instructions from the perspective of the selected agent persona. +**When `elicit: true`, ALWAYS use this exact format:** -## CRITICAL RULES +1. Present section content +2. Provide detailed rationale (explain trade-offs, assumptions, decisions made) +3. Present numbered options 1-9: + - **Option 1:** Always "Proceed to next section" + - **Options 2-9:** Select 8 methods from data/elicitation-methods + - End with: "Select 1-9 or just type your question/feedback:" -1. **Templates are PROGRAMS** - Execute every [[LLM:]] instruction exactly as written -2. **NEVER show markup** - Hide all [[LLM:]], {{placeholders}}, @{examples}, and template syntax -3. **STOP and EXECUTE** - When you see "apply tasks#" or "execute tasks#", STOP and run that task immediately -4. **WAIT for user input** - At review points and after elicitation tasks +**NEVER ask yes/no questions or use any other format.** -## Execution Flow +## Processing Flow -### 0. Check Workflow Plan (if configured) +1. **Parse YAML template** - Load template metadata and sections +2. **Set preferences** - Show current mode (Interactive), confirm output file +3. **Process each section:** + - Skip if condition unmet + - Check agent permissions (owner/editors) - note if section is restricted to specific agents + - Draft content using section instruction + - Present content + detailed rationale + - **IF elicit: true** → MANDATORY 1-9 options format + - Save to file if possible +4. **Continue until complete** -[[LLM: Check if plan tracking is enabled in core-config.yaml]] +## Detailed Rationale Requirements -- If `workflow.trackProgress: true`, check for active plan using .bmad-core/utils/plan-management.md -- If plan exists and this document creation is part of the plan: - - Verify this is the expected next step - - If out of sequence and `enforceSequence: true`, warn user and halt without user override - - If out of sequence and `enforceSequence: false`, ask for confirmation -- Continue with normal execution after plan check +When presenting section content, ALWAYS include rationale that explains: -### 1. Identify Template +- Trade-offs and choices made (what was chosen over alternatives and why) +- Key assumptions made during drafting +- Interesting or questionable decisions that need user attention +- Areas that might need validation -- Load from `.bmad-core/templates/*.md` or `.bmad-core/templates directory` -- Agent-specific templates are listed in agent's dependencies -- If agent has `templates: [prd-tmpl, architecture-tmpl]` for example, then offer to create "PRD" and "Architecture" documents +## Elicitation Results Flow -### 2. Ask Interaction Mode +After user selects elicitation method (2-9): -> 1. **Incremental** - Section by section with reviews -> 2. **YOLO Mode** - Complete draft then review (user can type `/yolo` anytime to switch) +1. Execute method from data/elicitation-methods +2. Present results with insights +3. Offer options: + - **1. Apply changes and update section** + - **2. Return to elicitation menu** + - **3. Ask any questions or engage further with this elicitation** -### 3. Execute Template +## Agent Permissions -- Replace {{placeholders}} with real content -- Execute [[LLM:]] instructions as you encounter them -- Process <> loops and ^^CONDITIONS^^ -- Use @{examples} for guidance but never output them +When processing sections with agent permission fields: -### 4. Key Execution Patterns +- **owner**: Note which agent role initially creates/populates the section +- **editors**: List agent roles allowed to modify the section +- **readonly**: Mark sections that cannot be modified after creation -**When you see:** `[[LLM: Draft X and immediately execute .bmad-core/tasks/advanced-elicitation.md]]` +**For sections with restricted access:** -- Draft the content -- Present it to user -- IMMEDIATELY execute the task -- Wait for completion before continuing +- Include a note in the generated document indicating the responsible agent +- Example: "_(This section is owned by dev-agent and can only be modified by dev-agent)_" -**When you see:** `[[LLM: After section completion, apply .bmad-core/tasks/Y.md]]` +## YOLO Mode -- Finish the section -- STOP and execute the task -- Wait for user input +User can type `#yolo` to toggle to YOLO mode (process all sections at once). -### 5. Validation & Final Presentation +## CRITICAL REMINDERS -- Run any specified checklists -- Present clean, formatted content only -- No truncation or summarization -- Begin directly with content (no preamble) -- Include any handoff prompts from template +**❌ NEVER:** -### 6. Update Workflow Plan (if applicable) +- Ask yes/no questions for elicitation +- Use any format other than 1-9 numbered options +- Create new elicitation methods -[[LLM: After successful document creation]] +**✅ ALWAYS:** -- If plan tracking is enabled and document was part of plan: - - Call update-workflow-plan task to mark step complete - - Parameters: task: create-doc, step_id: {from plan}, status: complete - - Show next recommended step from plan - -## Common Mistakes to Avoid - -❌ Skipping elicitation tasks -❌ Showing template markup to users -❌ Continuing past STOP signals -❌ Combining multiple review points - -✅ Execute ALL instructions in sequence -✅ Present only clean, formatted content -✅ Stop at every elicitation point -✅ Wait for user confirmation when instructed - -## Remember - -Templates contain precise instructions for a reason. Follow them exactly to ensure document quality and completeness. +- Use exact 1-9 format when elicit: true +- Select options 2-9 from data/elicitation-methods only +- Provide detailed rationale explaining decisions +- End with "Select 1-9 or just type your question/feedback:" ==================== END: .bmad-core/tasks/create-doc.md ==================== ==================== START: .bmad-core/tasks/create-workflow-plan.md ==================== @@ -2160,6 +2131,143 @@ Use the **expansion-creator** pack to build your own: - **Contributing**: See `CONTRIBUTING.md` for full guidelines ==================== END: .bmad-core/data/bmad-kb.md ==================== +==================== START: .bmad-core/data/elicitation-methods.md ==================== +# Elicitation Methods Data + +## Core Reflective Methods + +**Expand or Contract for Audience** +- Ask whether to 'expand' (add detail, elaborate) or 'contract' (simplify, clarify) +- Identify specific target audience if relevant +- Tailor content complexity and depth accordingly + +**Explain Reasoning (CoT Step-by-Step)** +- Walk through the step-by-step thinking process +- Reveal underlying assumptions and decision points +- Show how conclusions were reached from current role's perspective + +**Critique and Refine** +- Review output for flaws, inconsistencies, or improvement areas +- Identify specific weaknesses from role's expertise +- Suggest refined version reflecting domain knowledge + +## Structural Analysis Methods + +**Analyze Logical Flow and Dependencies** +- Examine content structure for logical progression +- Check internal consistency and coherence +- Identify and validate dependencies between elements +- Confirm effective ordering and sequencing + +**Assess Alignment with Overall Goals** +- Evaluate content contribution to stated objectives +- Identify any misalignments or gaps +- Interpret alignment from specific role's perspective +- Suggest adjustments to better serve goals + +## Risk and Challenge Methods + +**Identify Potential Risks and Unforeseen Issues** +- Brainstorm potential risks from role's expertise +- Identify overlooked edge cases or scenarios +- Anticipate unintended consequences +- Highlight implementation challenges + +**Challenge from Critical Perspective** +- Adopt critical stance on current content +- Play devil's advocate from specified viewpoint +- Argue against proposal highlighting weaknesses +- Apply YAGNI principles when appropriate (scope trimming) + +## Creative Exploration Methods + +**Tree of Thoughts Deep Dive** +- Break problem into discrete "thoughts" or intermediate steps +- Explore multiple reasoning paths simultaneously +- Use self-evaluation to classify each path as "sure", "likely", or "impossible" +- Apply search algorithms (BFS/DFS) to find optimal solution paths + +**Hindsight is 20/20: The 'If Only...' Reflection** +- Imagine retrospective scenario based on current content +- Identify the one "if only we had known/done X..." insight +- Describe imagined consequences humorously or dramatically +- Extract actionable learnings for current context + +## Multi-Persona Collaboration Methods + +**Agile Team Perspective Shift** +- Rotate through different Scrum team member viewpoints +- Product Owner: Focus on user value and business impact +- Scrum Master: Examine process flow and team dynamics +- Developer: Assess technical implementation and complexity +- QA: Identify testing scenarios and quality concerns + +**Stakeholder Round Table** +- Convene virtual meeting with multiple personas +- Each persona contributes unique perspective on content +- Identify conflicts and synergies between viewpoints +- Synthesize insights into actionable recommendations + +**Meta-Prompting Analysis** +- Step back to analyze the structure and logic of current approach +- Question the format and methodology being used +- Suggest alternative frameworks or mental models +- Optimize the elicitation process itself + +## Advanced 2025 Techniques + +**Self-Consistency Validation** +- Generate multiple reasoning paths for same problem +- Compare consistency across different approaches +- Identify most reliable and robust solution +- Highlight areas where approaches diverge and why + +**ReWOO (Reasoning Without Observation)** +- Separate parametric reasoning from tool-based actions +- Create reasoning plan without external dependencies +- Identify what can be solved through pure reasoning +- Optimize for efficiency and reduced token usage + +**Persona-Pattern Hybrid** +- Combine specific role expertise with elicitation pattern +- Architect + Risk Analysis: Deep technical risk assessment +- UX Expert + User Journey: End-to-end experience critique +- PM + Stakeholder Analysis: Multi-perspective impact review + +**Emergent Collaboration Discovery** +- Allow multiple perspectives to naturally emerge +- Identify unexpected insights from persona interactions +- Explore novel combinations of viewpoints +- Capture serendipitous discoveries from multi-agent thinking + +## Game-Based Elicitation Methods + +**Red Team vs Blue Team** +- Red Team: Attack the proposal, find vulnerabilities +- Blue Team: Defend and strengthen the approach +- Competitive analysis reveals blind spots +- Results in more robust, battle-tested solutions + +**Innovation Tournament** +- Pit multiple alternative approaches against each other +- Score each approach across different criteria +- Crowd-source evaluation from different personas +- Identify winning combination of features + +**Escape Room Challenge** +- Present content as constraints to work within +- Find creative solutions within tight limitations +- Identify minimum viable approach +- Discover innovative workarounds and optimizations + +## Process Control + +**Proceed / No Further Actions** +- Acknowledge choice to finalize current work +- Accept output as-is or move to next step +- Prepare to continue without additional elicitation +==================== END: .bmad-core/data/elicitation-methods.md ==================== + ==================== START: .bmad-core/utils/plan-management.md ==================== # Plan Management Utility @@ -3246,952 +3354,939 @@ Apply the advanced elicitation task after major sections to refine based on user - The goal is PRACTICAL documentation for AI agents doing real work ==================== END: .bmad-core/tasks/document-project.md ==================== -==================== START: .bmad-core/templates/project-brief-tmpl.md ==================== ---- -defaultOutput: docs/brief.md ---- - -# Project Brief: {{Project Name}} - -[[LLM: This template guides creation of a comprehensive Project Brief that serves as the foundational input for product development. - -Start by asking the user which mode they prefer: - -1. **Interactive Mode** - Work through each section collaboratively -2. **YOLO Mode** - Generate complete draft for review and refinement - -Before beginning, understand what inputs are available (brainstorming results, market research, competitive analysis, initial ideas) and gather project context.]] - -## Executive Summary - -[[LLM: Create a concise overview that captures the essence of the project. Include: - -- Product concept in 1-2 sentences -- Primary problem being solved -- Target market identification -- Key value proposition]] - -{{Write executive summary based on information gathered}} - -## Problem Statement - -[[LLM: Articulate the problem with clarity and evidence. Address: - -- Current state and pain points -- Impact of the problem (quantify if possible) -- Why existing solutions fall short -- Urgency and importance of solving this now]] - -{{Detailed problem description with supporting evidence}} - -## Proposed Solution - -[[LLM: Describe the solution approach at a high level. Include: - -- Core concept and approach -- Key differentiators from existing solutions -- Why this solution will succeed where others haven't -- High-level vision for the product]] - -{{Solution description focusing on the "what" and "why", not implementation details}} - -## Target Users - -[[LLM: Define and characterize the intended users with specificity. For each user segment include: - -- Demographic/firmographic profile -- Current behaviors and workflows -- Specific needs and pain points -- Goals they're trying to achieve]] - -### Primary User Segment: {{Segment Name}} - -{{Detailed description of primary users}} - -### Secondary User Segment: {{Segment Name}} - -{{Description of secondary users if applicable}} - -## Goals & Success Metrics - -[[LLM: Establish clear objectives and how to measure success. Make goals SMART (Specific, Measurable, Achievable, Relevant, Time-bound)]] - -### Business Objectives - -- {{Objective 1 with metric}} -- {{Objective 2 with metric}} -- {{Objective 3 with metric}} - -### User Success Metrics - -- {{How users will measure value}} -- {{Engagement metrics}} -- {{Satisfaction indicators}} - -### Key Performance Indicators (KPIs) - -- {{KPI 1: Definition and target}} -- {{KPI 2: Definition and target}} -- {{KPI 3: Definition and target}} - -## MVP Scope - -[[LLM: Define the minimum viable product clearly. Be specific about what's in and what's out. Help user distinguish must-haves from nice-to-haves.]] - -### Core Features (Must Have) - -- **Feature 1:** {{Brief description and why it's essential}} -- **Feature 2:** {{Brief description and why it's essential}} -- **Feature 3:** {{Brief description and why it's essential}} - -### Out of Scope for MVP - -- {{Feature/capability explicitly not in MVP}} -- {{Feature/capability to be considered post-MVP}} - -### MVP Success Criteria - -{{Define what constitutes a successful MVP launch}} - -## Post-MVP Vision - -[[LLM: Outline the longer-term product direction without overcommitting to specifics]] - -### Phase 2 Features - -{{Next priority features after MVP success}} - -### Long-term Vision - -{{Where this product could go in 1-2 years}} - -### Expansion Opportunities - -{{Potential new markets, use cases, or integrations}} - -## Technical Considerations - -[[LLM: Document known technical constraints and preferences. Note these are initial thoughts, not final decisions.]] - -### Platform Requirements - -- **Target Platforms:** {{Web, mobile, desktop, etc.}} -- **Browser/OS Support:** {{Specific requirements}} -- **Performance Requirements:** {{Load times, concurrent users, etc.}} - -### Technology Preferences - -- **Frontend:** {{If any preferences exist}} -- **Backend:** {{If any preferences exist}} -- **Database:** {{If any preferences exist}} -- **Hosting/Infrastructure:** {{Cloud preferences, on-prem requirements}} - -### Architecture Considerations - -- **Repository Structure:** {{Initial thoughts on monorepo vs. polyrepo}} -- **Service Architecture:** {{Initial thoughts on monolith vs. microservices}} -- **Integration Requirements:** {{Third-party services, APIs}} -- **Security/Compliance:** {{Any specific requirements}} - -## Constraints & Assumptions - -[[LLM: Clearly state limitations and assumptions to set realistic expectations]] - -### Constraints - -- **Budget:** {{If known}} -- **Timeline:** {{Target launch date or development timeframe}} -- **Resources:** {{Team size, skill constraints}} -- **Technical:** {{Legacy systems, required tech stack}} - -### Key Assumptions - -- {{Assumption about users, market, or technology}} -- {{Assumption about resources or support}} -- {{Assumption about external dependencies}} - -## Risks & Open Questions - -[[LLM: Identify unknowns and potential challenges proactively]] - -### Key Risks - -- **Risk 1:** {{Description and potential impact}} -- **Risk 2:** {{Description and potential impact}} -- **Risk 3:** {{Description and potential impact}} - -### Open Questions - -- {{Question needing research or decision}} -- {{Question about technical approach}} -- {{Question about market or users}} - -### Areas Needing Further Research - -- {{Topic requiring deeper investigation}} -- {{Validation needed before proceeding}} - -## Appendices - -### A. Research Summary - -{{If applicable, summarize key findings from: - -- Market research -- Competitive analysis -- User interviews -- Technical feasibility studies}} - -### B. Stakeholder Input - -{{Key feedback or requirements from stakeholders}} - -### C. References - -{{Links to relevant documents, research, or examples}} - -## Next Steps - -### Immediate Actions - -1. {{First concrete next step}} -2. {{Second concrete next step}} -3. {{Third concrete next step}} - -### PM Handoff - -This Project Brief provides the full context for {{Project Name}}. Please start in 'PRD Generation Mode', review the brief thoroughly to work with the user to create the PRD section by section as the template indicates, asking for any necessary clarification or suggesting improvements. - ---- - -[[LLM: After completing each major section (not subsections), offer advanced elicitation with these custom options for project briefs: - -**Project Brief Elicitation Actions** 0. Expand section with more specific details - -1. Validate against similar successful products -2. Stress test assumptions with edge cases -3. Explore alternative solution approaches -4. Analyze resource/constraint trade-offs -5. Generate risk mitigation strategies -6. Challenge scope from MVP minimalist view -7. Brainstorm creative feature possibilities -8. If only we had [resource/capability/time]... -9. Proceed to next section - -These replace the standard elicitation options when working on project brief documents.]] -==================== END: .bmad-core/templates/project-brief-tmpl.md ==================== - -==================== START: .bmad-core/templates/market-research-tmpl.md ==================== -# Market Research Report: {{Project/Product Name}} - -[[LLM: The default path and filename unless specified is docs/market-research.md]] - -[[LLM: This template guides the creation of a comprehensive market research report. Begin by understanding what market insights the user needs and why. Work through each section systematically, using the appropriate analytical frameworks based on the research objectives.]] - -## Executive Summary - -{{Provide a high-level overview of key findings, market opportunity assessment, and strategic recommendations. Write this section LAST after completing all other sections.}} - -## Research Objectives & Methodology - -### Research Objectives - -{{List the primary objectives of this market research: - -- What decisions will this research inform? -- What specific questions need to be answered? -- What are the success criteria for this research?}} - -### Research Methodology - -{{Describe the research approach: - -- Data sources used (primary/secondary) -- Analysis frameworks applied -- Data collection timeframe -- Limitations and assumptions}} - -## Market Overview - -### Market Definition - -{{Define the market being analyzed: - -- Product/service category -- Geographic scope -- Customer segments included -- Value chain position}} - -### Market Size & Growth - -[[LLM: Guide through TAM, SAM, SOM calculations with clear assumptions. Use one or more approaches: - -- Top-down: Start with industry data, narrow down -- Bottom-up: Build from customer/unit economics -- Value theory: Based on value provided vs. alternatives]] - -#### Total Addressable Market (TAM) - -{{Calculate and explain the total market opportunity}} - -#### Serviceable Addressable Market (SAM) - -{{Define the portion of TAM you can realistically reach}} - -#### Serviceable Obtainable Market (SOM) - -{{Estimate the portion you can realistically capture}} - -### Market Trends & Drivers - -[[LLM: Analyze key trends shaping the market using appropriate frameworks like PESTEL]] - -#### Key Market Trends - -{{List and explain 3-5 major trends: - -- Trend 1: Description and impact -- Trend 2: Description and impact -- etc.}} - -#### Growth Drivers - -{{Identify primary factors driving market growth}} - -#### Market Inhibitors - -{{Identify factors constraining market growth}} - -## Customer Analysis - -### Target Segment Profiles - -[[LLM: For each segment, create detailed profiles including demographics/firmographics, psychographics, behaviors, needs, and willingness to pay]] - -#### Segment 1: {{Segment Name}} - -- **Description:** {{Brief overview}} -- **Size:** {{Number of customers/market value}} -- **Characteristics:** {{Key demographics/firmographics}} -- **Needs & Pain Points:** {{Primary problems they face}} -- **Buying Process:** {{How they make purchasing decisions}} -- **Willingness to Pay:** {{Price sensitivity and value perception}} - -<> - -### Jobs-to-be-Done Analysis - -[[LLM: Uncover what customers are really trying to accomplish]] - -#### Functional Jobs - -{{List practical tasks and objectives customers need to complete}} - -#### Emotional Jobs - -{{Describe feelings and perceptions customers seek}} - -#### Social Jobs - -{{Explain how customers want to be perceived by others}} - -### Customer Journey Mapping - -[[LLM: Map the end-to-end customer experience for primary segments]] - -{{For primary customer segment: - -1. **Awareness:** How they discover solutions -2. **Consideration:** Evaluation criteria and process -3. **Purchase:** Decision triggers and barriers -4. **Onboarding:** Initial experience expectations -5. **Usage:** Ongoing interaction patterns -6. **Advocacy:** Referral and expansion behaviors}} - -## Competitive Landscape - -### Market Structure - -{{Describe the overall competitive environment: - -- Number of competitors -- Market concentration -- Competitive intensity}} - -### Major Players Analysis - -{{For top 3-5 competitors: - -- Company name and brief description -- Market share estimate -- Key strengths and weaknesses -- Target customer focus -- Pricing strategy}} - -### Competitive Positioning - -{{Analyze how competitors are positioned: - -- Value propositions -- Differentiation strategies -- Market gaps and opportunities}} - -## Industry Analysis - -### Porter's Five Forces Assessment - -[[LLM: Analyze each force with specific evidence and implications]] - -#### Supplier Power: {{Low/Medium/High}} - -{{Analysis and implications}} - -#### Buyer Power: {{Low/Medium/High}} - -{{Analysis and implications}} - -#### Competitive Rivalry: {{Low/Medium/High}} - -{{Analysis and implications}} - -#### Threat of New Entry: {{Low/Medium/High}} - -{{Analysis and implications}} - -#### Threat of Substitutes: {{Low/Medium/High}} - -{{Analysis and implications}} - -### Technology Adoption Lifecycle Stage - -{{Identify where the market is in the adoption curve: - -- Current stage and evidence -- Implications for strategy -- Expected progression timeline}} - -## Opportunity Assessment - -### Market Opportunities - -[[LLM: Identify specific opportunities based on the analysis]] - -#### Opportunity 1: {{Name}} - -- **Description:** {{What is the opportunity?}} -- **Size/Potential:** {{Quantify if possible}} -- **Requirements:** {{What's needed to capture it?}} -- **Risks:** {{Key challenges or barriers}} - -<> - -### Strategic Recommendations - -#### Go-to-Market Strategy - -{{Recommend approach for market entry/expansion: - -- Target segment prioritization -- Positioning strategy -- Channel strategy -- Partnership opportunities}} - -#### Pricing Strategy - -{{Based on willingness to pay analysis and competitive landscape: - -- Recommended pricing model -- Price points/ranges -- Value metric -- Competitive positioning}} - -#### Risk Mitigation - -{{Key risks and mitigation strategies: - -- Market risks -- Competitive risks -- Execution risks -- Regulatory/compliance risks}} - -## Appendices - -### A. Data Sources - -{{List all sources used in the research}} - -### B. Detailed Calculations - -{{Include any complex calculations or models}} - -### C. Additional Analysis - -{{Any supplementary analysis not included in main body}} - ---- - -[[LLM: After completing the document, offer advanced elicitation with these custom options for market research: - -**Market Research Elicitation Actions** 0. Expand market sizing calculations with sensitivity analysis - -1. Deep dive into a specific customer segment -2. Analyze an emerging market trend in detail -3. Compare this market to an analogous market -4. Stress test market assumptions -5. Explore adjacent market opportunities -6. Challenge market definition and boundaries -7. Generate strategic scenarios (best/base/worst case) -8. If only we had considered [X market factor]... -9. Proceed to next section - -These replace the standard elicitation options when working on market research documents.]] -==================== END: .bmad-core/templates/market-research-tmpl.md ==================== - -==================== START: .bmad-core/templates/competitor-analysis-tmpl.md ==================== -# Competitive Analysis Report: {{Project/Product Name}} - -[[LLM: The default path and filename unless specified is docs/competitor-analysis.md]] - -[[LLM: This template guides comprehensive competitor analysis. Start by understanding the user's competitive intelligence needs and strategic objectives. Help them identify and prioritize competitors before diving into detailed analysis.]] - -## Executive Summary - -{{Provide high-level competitive insights, main threats and opportunities, and recommended strategic actions. Write this section LAST after completing all analysis.}} - -## Analysis Scope & Methodology - -### Analysis Purpose - -{{Define the primary purpose: - -- New market entry assessment -- Product positioning strategy -- Feature gap analysis -- Pricing strategy development -- Partnership/acquisition targets -- Competitive threat assessment}} - -### Competitor Categories Analyzed - -{{List categories included: - -- Direct Competitors: Same product/service, same target market -- Indirect Competitors: Different product, same need/problem -- Potential Competitors: Could enter market easily -- Substitute Products: Alternative solutions -- Aspirational Competitors: Best-in-class examples}} - -### Research Methodology - -{{Describe approach: - -- Information sources used -- Analysis timeframe -- Confidence levels -- Limitations}} - -## Competitive Landscape Overview - -### Market Structure - -{{Describe the competitive environment: - -- Number of active competitors -- Market concentration (fragmented/consolidated) -- Competitive dynamics -- Recent market entries/exits}} - -### Competitor Prioritization Matrix - -[[LLM: Help categorize competitors by market share and strategic threat level]] - -{{Create a 2x2 matrix: - -- Priority 1 (Core Competitors): High Market Share + High Threat -- Priority 2 (Emerging Threats): Low Market Share + High Threat -- Priority 3 (Established Players): High Market Share + Low Threat -- Priority 4 (Monitor Only): Low Market Share + Low Threat}} - -## Individual Competitor Profiles - -[[LLM: Create detailed profiles for each Priority 1 and Priority 2 competitor. For Priority 3 and 4, create condensed profiles.]] - -### {{Competitor Name}} - Priority {{1/2/3/4}} - -#### Company Overview - -- **Founded:** {{Year, founders}} -- **Headquarters:** {{Location}} -- **Company Size:** {{Employees, revenue if known}} -- **Funding:** {{Total raised, key investors}} -- **Leadership:** {{Key executives}} - -#### Business Model & Strategy - -- **Revenue Model:** {{How they make money}} -- **Target Market:** {{Primary customer segments}} -- **Value Proposition:** {{Core value promise}} -- **Go-to-Market Strategy:** {{Sales and marketing approach}} -- **Strategic Focus:** {{Current priorities}} - -#### Product/Service Analysis - -- **Core Offerings:** {{Main products/services}} -- **Key Features:** {{Standout capabilities}} -- **User Experience:** {{UX strengths/weaknesses}} -- **Technology Stack:** {{If relevant/known}} -- **Pricing:** {{Model and price points}} - -#### Strengths & Weaknesses - -**Strengths:** - -- {{Strength 1}} -- {{Strength 2}} -- {{Strength 3}} - -**Weaknesses:** - -- {{Weakness 1}} -- {{Weakness 2}} -- {{Weakness 3}} - -#### Market Position & Performance - -- **Market Share:** {{Estimate if available}} -- **Customer Base:** {{Size, notable clients}} -- **Growth Trajectory:** {{Trending up/down/stable}} -- **Recent Developments:** {{Key news, releases}} - -<> - -## Comparative Analysis - -### Feature Comparison Matrix - -[[LLM: Create a detailed comparison table of key features across competitors]] - -| Feature Category | {{Your Company}} | {{Competitor 1}} | {{Competitor 2}} | {{Competitor 3}} | -| --------------------------- | ------------------- | ------------------- | ------------------- | ------------------- | -| **Core Functionality** | -| Feature A | {{✓/✗/Partial}} | {{✓/✗/Partial}} | {{✓/✗/Partial}} | {{✓/✗/Partial}} | -| Feature B | {{✓/✗/Partial}} | {{✓/✗/Partial}} | {{✓/✗/Partial}} | {{✓/✗/Partial}} | -| **User Experience** | -| Mobile App | {{Rating/Status}} | {{Rating/Status}} | {{Rating/Status}} | {{Rating/Status}} | -| Onboarding Time | {{Time}} | {{Time}} | {{Time}} | {{Time}} | -| **Integration & Ecosystem** | -| API Availability | {{Yes/No/Limited}} | {{Yes/No/Limited}} | {{Yes/No/Limited}} | {{Yes/No/Limited}} | -| Third-party Integrations | {{Number/Key ones}} | {{Number/Key ones}} | {{Number/Key ones}} | {{Number/Key ones}} | -| **Pricing & Plans** | -| Starting Price | {{$X}} | {{$X}} | {{$X}} | {{$X}} | -| Free Tier | {{Yes/No}} | {{Yes/No}} | {{Yes/No}} | {{Yes/No}} | - -### SWOT Comparison - -[[LLM: Create SWOT analysis for your solution vs. top competitors]] - -#### Your Solution - -- **Strengths:** {{List key strengths}} -- **Weaknesses:** {{List key weaknesses}} -- **Opportunities:** {{List opportunities}} -- **Threats:** {{List threats}} - -#### vs. {{Main Competitor}} - -- **Competitive Advantages:** {{Where you're stronger}} -- **Competitive Disadvantages:** {{Where they're stronger}} -- **Differentiation Opportunities:** {{How to stand out}} - -### Positioning Map - -[[LLM: Describe competitor positions on key dimensions]] - -{{Create a positioning description using 2 key dimensions relevant to the market, such as: - -- Price vs. Features -- Ease of Use vs. Power -- Specialization vs. Breadth -- Self-Serve vs. High-Touch}} - -## Strategic Analysis - -### Competitive Advantages Assessment - -#### Sustainable Advantages - -{{Identify moats and defensible positions: - -- Network effects -- Switching costs -- Brand strength -- Technology barriers -- Regulatory advantages}} - -#### Vulnerable Points - -{{Where competitors could be challenged: - -- Weak customer segments -- Missing features -- Poor user experience -- High prices -- Limited geographic presence}} - -### Blue Ocean Opportunities - -[[LLM: Identify uncontested market spaces]] - -{{List opportunities to create new market space: - -- Underserved segments -- Unaddressed use cases -- New business models -- Geographic expansion -- Different value propositions}} - -## Strategic Recommendations - -### Differentiation Strategy - -{{How to position against competitors: - -- Unique value propositions to emphasize -- Features to prioritize -- Segments to target -- Messaging and positioning}} - -### Competitive Response Planning - -#### Offensive Strategies - -{{How to gain market share: - -- Target competitor weaknesses -- Win competitive deals -- Capture their customers}} - -#### Defensive Strategies - -{{How to protect your position: - -- Strengthen vulnerable areas -- Build switching costs -- Deepen customer relationships}} - -### Partnership & Ecosystem Strategy - -{{Potential collaboration opportunities: - -- Complementary players -- Channel partners -- Technology integrations -- Strategic alliances}} - -## Monitoring & Intelligence Plan - -### Key Competitors to Track - -{{Priority list with rationale}} - -### Monitoring Metrics - -{{What to track: - -- Product updates -- Pricing changes -- Customer wins/losses -- Funding/M&A activity -- Market messaging}} - -### Intelligence Sources - -{{Where to gather ongoing intelligence: - -- Company websites/blogs -- Customer reviews -- Industry reports -- Social media -- Patent filings}} - -### Update Cadence - -{{Recommended review schedule: - -- Weekly: {{What to check}} -- Monthly: {{What to review}} -- Quarterly: {{Deep analysis}}}} - ---- - -[[LLM: After completing the document, offer advanced elicitation with these custom options for competitive analysis: - -**Competitive Analysis Elicitation Actions** 0. Deep dive on a specific competitor's strategy - -1. Analyze competitive dynamics in a specific segment -2. War game competitive responses to your moves -3. Explore partnership vs. competition scenarios -4. Stress test differentiation claims -5. Analyze disruption potential (yours or theirs) -6. Compare to competition in adjacent markets -7. Generate win/loss analysis insights -8. If only we had known about [competitor X's plan]... -9. Proceed to next section - -These replace the standard elicitation options when working on competitive analysis documents.]] -==================== END: .bmad-core/templates/competitor-analysis-tmpl.md ==================== - -==================== START: .bmad-core/templates/brainstorming-output-tmpl.md ==================== ---- -defaultOutput: docs/brainstorming-session-results.md ---- - -# Brainstorming Session Results - -**Session Date:** [DATE] -**Facilitator:** [Agent Role] [Agent Name] -**Participant:** [USER NAME] - -## Executive Summary - -**Topic:** [SESSION TOPIC] - -**Session Goals:** [STATED GOALS] - -**Techniques Used:** [LIST OF TECHNIQUES AND DURATION] - -**Total Ideas Generated:** [NUMBER] - -**Key Themes Identified:** - -- [THEME 1] -- [THEME 2] -- [THEME 3] - ---- - -## Technique Sessions - -### [TECHNIQUE NAME 1] - [DURATION] - -**Description:** [BRIEF DESCRIPTION OF TECHNIQUE] - -**Ideas Generated:** - -1. [USER IDEA 1] -2. [USER IDEA 2] -3. [USER IDEA 3] -[etc.] - -**Insights Discovered:** - -- [INSIGHT 1] -- [INSIGHT 2] - -**Notable Connections:** - -- [CONNECTION OR PATTERN IDENTIFIED] - ---- - -### [TECHNIQUE NAME 2] - [DURATION] - -[Repeat format for each technique used] - ---- - -## Idea Categorization - -### Immediate Opportunities - -*Ideas ready to implement now* - -1. **[IDEA NAME]** - - Description: [BRIEF DESCRIPTION] - - Why immediate: [RATIONALE] - - Resources needed: [BASIC REQUIREMENTS] - -### Future Innovations - -*Ideas requiring development/research* - -1. **[IDEA NAME]** - - Description: [BRIEF DESCRIPTION] - - Development needed: [WHAT'S REQUIRED] - - Timeline estimate: [ROUGH TIMEFRAME] - -### Moonshots - -*Ambitious, transformative concepts* - -1. **[IDEA NAME]** - - Description: [BRIEF DESCRIPTION] - - Transformative potential: [WHY IT'S A MOONSHOT] - - Challenges to overcome: [MAJOR OBSTACLES] - -### Insights & Learnings - -*Key realizations from the session* - -- [INSIGHT 1]: [DESCRIPTION AND IMPLICATIONS] -- [INSIGHT 2]: [DESCRIPTION AND IMPLICATIONS] - ---- - -## Action Planning - -### Top 3 Priority Ideas - -**#1 Priority: [IDEA NAME]** - -- Rationale: [WHY THIS IS TOP PRIORITY] -- Next steps: [SPECIFIC ACTIONS TO TAKE] -- Resources needed: [WHAT'S REQUIRED] -- Timeline: [WHEN TO START/COMPLETE] - -**#2 Priority: [IDEA NAME]** - -- [Same format] - -**#3 Priority: [IDEA NAME]** - -- [Same format] - ---- - -## Reflection & Follow-up - -### What Worked Well - -- [SUCCESSFUL ASPECT 1] -- [SUCCESSFUL ASPECT 2] - -### Areas for Further Exploration - -- [AREA 1]: [WHY IT NEEDS MORE EXPLORATION] -- [AREA 2]: [WHY IT NEEDS MORE EXPLORATION] - -### Recommended Follow-up Techniques - -- [TECHNIQUE 1]: [WHY IT WOULD BE HELPFUL] -- [TECHNIQUE 2]: [WHY IT WOULD BE HELPFUL] - -### Questions That Emerged - -- [QUESTION 1] -- [QUESTION 2] -- [QUESTION 3] - -### Next Session Planning - -- **Suggested topics:** [FOLLOW-UP TOPICS] -- **Recommended timeframe:** [WHEN TO RECONVENE] -- **Preparation needed:** [WHAT TO RESEARCH/PREPARE] - ---- - -*Session facilitated using the BMAD-METHOD brainstorming framework* -==================== END: .bmad-core/templates/brainstorming-output-tmpl.md ==================== +==================== START: .bmad-core/templates/project-brief-tmpl.yaml ==================== +template: + id: project-brief-template-v2 + name: Project Brief + version: 2.0 + output: + format: markdown + filename: docs/brief.md + title: "Project Brief: {{project_name}}" + +workflow: + mode: interactive + elicitation: advanced-elicitation + custom_elicitation: + title: "Project Brief Elicitation Actions" + options: + - "Expand section with more specific details" + - "Validate against similar successful products" + - "Stress test assumptions with edge cases" + - "Explore alternative solution approaches" + - "Analyze resource/constraint trade-offs" + - "Generate risk mitigation strategies" + - "Challenge scope from MVP minimalist view" + - "Brainstorm creative feature possibilities" + - "If only we had [resource/capability/time]..." + - "Proceed to next section" + +sections: + - id: introduction + instruction: | + This template guides creation of a comprehensive Project Brief that serves as the foundational input for product development. + + Start by asking the user which mode they prefer: + + 1. **Interactive Mode** - Work through each section collaboratively + 2. **YOLO Mode** - Generate complete draft for review and refinement + + Before beginning, understand what inputs are available (brainstorming results, market research, competitive analysis, initial ideas) and gather project context. + + - id: executive-summary + title: Executive Summary + instruction: | + Create a concise overview that captures the essence of the project. Include: + - Product concept in 1-2 sentences + - Primary problem being solved + - Target market identification + - Key value proposition + template: "{{executive_summary_content}}" + + - id: problem-statement + title: Problem Statement + instruction: | + Articulate the problem with clarity and evidence. Address: + - Current state and pain points + - Impact of the problem (quantify if possible) + - Why existing solutions fall short + - Urgency and importance of solving this now + template: "{{detailed_problem_description}}" + + - id: proposed-solution + title: Proposed Solution + instruction: | + Describe the solution approach at a high level. Include: + - Core concept and approach + - Key differentiators from existing solutions + - Why this solution will succeed where others haven't + - High-level vision for the product + template: "{{solution_description}}" + + - id: target-users + title: Target Users + instruction: | + Define and characterize the intended users with specificity. For each user segment include: + - Demographic/firmographic profile + - Current behaviors and workflows + - Specific needs and pain points + - Goals they're trying to achieve + sections: + - id: primary-segment + title: "Primary User Segment: {{segment_name}}" + template: "{{primary_user_description}}" + - id: secondary-segment + title: "Secondary User Segment: {{segment_name}}" + condition: Has secondary user segment + template: "{{secondary_user_description}}" + + - id: goals-metrics + title: Goals & Success Metrics + instruction: Establish clear objectives and how to measure success. Make goals SMART (Specific, Measurable, Achievable, Relevant, Time-bound) + sections: + - id: business-objectives + title: Business Objectives + type: bullet-list + template: "- {{objective_with_metric}}" + - id: user-success-metrics + title: User Success Metrics + type: bullet-list + template: "- {{user_metric}}" + - id: kpis + title: Key Performance Indicators (KPIs) + type: bullet-list + template: "- {{kpi}}: {{definition_and_target}}" + + - id: mvp-scope + title: MVP Scope + instruction: Define the minimum viable product clearly. Be specific about what's in and what's out. Help user distinguish must-haves from nice-to-haves. + sections: + - id: core-features + title: Core Features (Must Have) + type: bullet-list + template: "- **{{feature}}:** {{description_and_rationale}}" + - id: out-of-scope + title: Out of Scope for MVP + type: bullet-list + template: "- {{feature_or_capability}}" + - id: mvp-success-criteria + title: MVP Success Criteria + template: "{{mvp_success_definition}}" + + - id: post-mvp-vision + title: Post-MVP Vision + instruction: Outline the longer-term product direction without overcommitting to specifics + sections: + - id: phase-2-features + title: Phase 2 Features + template: "{{next_priority_features}}" + - id: long-term-vision + title: Long-term Vision + template: "{{one_two_year_vision}}" + - id: expansion-opportunities + title: Expansion Opportunities + template: "{{potential_expansions}}" + + - id: technical-considerations + title: Technical Considerations + instruction: Document known technical constraints and preferences. Note these are initial thoughts, not final decisions. + sections: + - id: platform-requirements + title: Platform Requirements + template: | + - **Target Platforms:** {{platforms}} + - **Browser/OS Support:** {{specific_requirements}} + - **Performance Requirements:** {{performance_specs}} + - id: technology-preferences + title: Technology Preferences + template: | + - **Frontend:** {{frontend_preferences}} + - **Backend:** {{backend_preferences}} + - **Database:** {{database_preferences}} + - **Hosting/Infrastructure:** {{infrastructure_preferences}} + - id: architecture-considerations + title: Architecture Considerations + template: | + - **Repository Structure:** {{repo_thoughts}} + - **Service Architecture:** {{service_thoughts}} + - **Integration Requirements:** {{integration_needs}} + - **Security/Compliance:** {{security_requirements}} + + - id: constraints-assumptions + title: Constraints & Assumptions + instruction: Clearly state limitations and assumptions to set realistic expectations + sections: + - id: constraints + title: Constraints + template: | + - **Budget:** {{budget_info}} + - **Timeline:** {{timeline_info}} + - **Resources:** {{resource_info}} + - **Technical:** {{technical_constraints}} + - id: key-assumptions + title: Key Assumptions + type: bullet-list + template: "- {{assumption}}" + + - id: risks-questions + title: Risks & Open Questions + instruction: Identify unknowns and potential challenges proactively + sections: + - id: key-risks + title: Key Risks + type: bullet-list + template: "- **{{risk}}:** {{description_and_impact}}" + - id: open-questions + title: Open Questions + type: bullet-list + template: "- {{question}}" + - id: research-areas + title: Areas Needing Further Research + type: bullet-list + template: "- {{research_topic}}" + + - id: appendices + title: Appendices + sections: + - id: research-summary + title: A. Research Summary + condition: Has research findings + instruction: | + If applicable, summarize key findings from: + - Market research + - Competitive analysis + - User interviews + - Technical feasibility studies + - id: stakeholder-input + title: B. Stakeholder Input + condition: Has stakeholder feedback + template: "{{stakeholder_feedback}}" + - id: references + title: C. References + template: "{{relevant_links_and_docs}}" + + - id: next-steps + title: Next Steps + sections: + - id: immediate-actions + title: Immediate Actions + type: numbered-list + template: "{{action_item}}" + - id: pm-handoff + title: PM Handoff + content: | + This Project Brief provides the full context for {{project_name}}. Please start in 'PRD Generation Mode', review the brief thoroughly to work with the user to create the PRD section by section as the template indicates, asking for any necessary clarification or suggesting improvements. +==================== END: .bmad-core/templates/project-brief-tmpl.yaml ==================== + +==================== START: .bmad-core/templates/market-research-tmpl.yaml ==================== +template: + id: market-research-template-v2 + name: Market Research Report + version: 2.0 + output: + format: markdown + filename: docs/market-research.md + title: "Market Research Report: {{project_product_name}}" + +workflow: + mode: interactive + elicitation: advanced-elicitation + custom_elicitation: + title: "Market Research Elicitation Actions" + options: + - "Expand market sizing calculations with sensitivity analysis" + - "Deep dive into a specific customer segment" + - "Analyze an emerging market trend in detail" + - "Compare this market to an analogous market" + - "Stress test market assumptions" + - "Explore adjacent market opportunities" + - "Challenge market definition and boundaries" + - "Generate strategic scenarios (best/base/worst case)" + - "If only we had considered [X market factor]..." + - "Proceed to next section" + +sections: + - id: executive-summary + title: Executive Summary + instruction: Provide a high-level overview of key findings, market opportunity assessment, and strategic recommendations. Write this section LAST after completing all other sections. + + - id: research-objectives + title: Research Objectives & Methodology + instruction: This template guides the creation of a comprehensive market research report. Begin by understanding what market insights the user needs and why. Work through each section systematically, using the appropriate analytical frameworks based on the research objectives. + sections: + - id: objectives + title: Research Objectives + instruction: | + List the primary objectives of this market research: + - What decisions will this research inform? + - What specific questions need to be answered? + - What are the success criteria for this research? + - id: methodology + title: Research Methodology + instruction: | + Describe the research approach: + - Data sources used (primary/secondary) + - Analysis frameworks applied + - Data collection timeframe + - Limitations and assumptions + + - id: market-overview + title: Market Overview + sections: + - id: market-definition + title: Market Definition + instruction: | + Define the market being analyzed: + - Product/service category + - Geographic scope + - Customer segments included + - Value chain position + - id: market-size-growth + title: Market Size & Growth + instruction: | + Guide through TAM, SAM, SOM calculations with clear assumptions. Use one or more approaches: + - Top-down: Start with industry data, narrow down + - Bottom-up: Build from customer/unit economics + - Value theory: Based on value provided vs. alternatives + sections: + - id: tam + title: Total Addressable Market (TAM) + instruction: Calculate and explain the total market opportunity + - id: sam + title: Serviceable Addressable Market (SAM) + instruction: Define the portion of TAM you can realistically reach + - id: som + title: Serviceable Obtainable Market (SOM) + instruction: Estimate the portion you can realistically capture + - id: market-trends + title: Market Trends & Drivers + instruction: Analyze key trends shaping the market using appropriate frameworks like PESTEL + sections: + - id: key-trends + title: Key Market Trends + instruction: | + List and explain 3-5 major trends: + - Trend 1: Description and impact + - Trend 2: Description and impact + - etc. + - id: growth-drivers + title: Growth Drivers + instruction: Identify primary factors driving market growth + - id: market-inhibitors + title: Market Inhibitors + instruction: Identify factors constraining market growth + + - id: customer-analysis + title: Customer Analysis + sections: + - id: segment-profiles + title: Target Segment Profiles + instruction: For each segment, create detailed profiles including demographics/firmographics, psychographics, behaviors, needs, and willingness to pay + repeatable: true + sections: + - id: segment + title: "Segment {{segment_number}}: {{segment_name}}" + template: | + - **Description:** {{brief_overview}} + - **Size:** {{number_of_customers_market_value}} + - **Characteristics:** {{key_demographics_firmographics}} + - **Needs & Pain Points:** {{primary_problems}} + - **Buying Process:** {{purchasing_decisions}} + - **Willingness to Pay:** {{price_sensitivity}} + - id: jobs-to-be-done + title: Jobs-to-be-Done Analysis + instruction: Uncover what customers are really trying to accomplish + sections: + - id: functional-jobs + title: Functional Jobs + instruction: List practical tasks and objectives customers need to complete + - id: emotional-jobs + title: Emotional Jobs + instruction: Describe feelings and perceptions customers seek + - id: social-jobs + title: Social Jobs + instruction: Explain how customers want to be perceived by others + - id: customer-journey + title: Customer Journey Mapping + instruction: Map the end-to-end customer experience for primary segments + template: | + For primary customer segment: + + 1. **Awareness:** {{discovery_process}} + 2. **Consideration:** {{evaluation_criteria}} + 3. **Purchase:** {{decision_triggers}} + 4. **Onboarding:** {{initial_expectations}} + 5. **Usage:** {{interaction_patterns}} + 6. **Advocacy:** {{referral_behaviors}} + + - id: competitive-landscape + title: Competitive Landscape + sections: + - id: market-structure + title: Market Structure + instruction: | + Describe the overall competitive environment: + - Number of competitors + - Market concentration + - Competitive intensity + - id: major-players + title: Major Players Analysis + instruction: | + For top 3-5 competitors: + - Company name and brief description + - Market share estimate + - Key strengths and weaknesses + - Target customer focus + - Pricing strategy + - id: competitive-positioning + title: Competitive Positioning + instruction: | + Analyze how competitors are positioned: + - Value propositions + - Differentiation strategies + - Market gaps and opportunities + + - id: industry-analysis + title: Industry Analysis + sections: + - id: porters-five-forces + title: Porter's Five Forces Assessment + instruction: Analyze each force with specific evidence and implications + sections: + - id: supplier-power + title: "Supplier Power: {{power_level}}" + template: "{{analysis_and_implications}}" + - id: buyer-power + title: "Buyer Power: {{power_level}}" + template: "{{analysis_and_implications}}" + - id: competitive-rivalry + title: "Competitive Rivalry: {{intensity_level}}" + template: "{{analysis_and_implications}}" + - id: threat-new-entry + title: "Threat of New Entry: {{threat_level}}" + template: "{{analysis_and_implications}}" + - id: threat-substitutes + title: "Threat of Substitutes: {{threat_level}}" + template: "{{analysis_and_implications}}" + - id: adoption-lifecycle + title: Technology Adoption Lifecycle Stage + instruction: | + Identify where the market is in the adoption curve: + - Current stage and evidence + - Implications for strategy + - Expected progression timeline + + - id: opportunity-assessment + title: Opportunity Assessment + sections: + - id: market-opportunities + title: Market Opportunities + instruction: Identify specific opportunities based on the analysis + repeatable: true + sections: + - id: opportunity + title: "Opportunity {{opportunity_number}}: {{name}}" + template: | + - **Description:** {{what_is_the_opportunity}} + - **Size/Potential:** {{quantified_potential}} + - **Requirements:** {{needed_to_capture}} + - **Risks:** {{key_challenges}} + - id: strategic-recommendations + title: Strategic Recommendations + sections: + - id: go-to-market + title: Go-to-Market Strategy + instruction: | + Recommend approach for market entry/expansion: + - Target segment prioritization + - Positioning strategy + - Channel strategy + - Partnership opportunities + - id: pricing-strategy + title: Pricing Strategy + instruction: | + Based on willingness to pay analysis and competitive landscape: + - Recommended pricing model + - Price points/ranges + - Value metric + - Competitive positioning + - id: risk-mitigation + title: Risk Mitigation + instruction: | + Key risks and mitigation strategies: + - Market risks + - Competitive risks + - Execution risks + - Regulatory/compliance risks + + - id: appendices + title: Appendices + sections: + - id: data-sources + title: A. Data Sources + instruction: List all sources used in the research + - id: calculations + title: B. Detailed Calculations + instruction: Include any complex calculations or models + - id: additional-analysis + title: C. Additional Analysis + instruction: Any supplementary analysis not included in main body +==================== END: .bmad-core/templates/market-research-tmpl.yaml ==================== + +==================== START: .bmad-core/templates/competitor-analysis-tmpl.yaml ==================== +template: + id: competitor-analysis-template-v2 + name: Competitive Analysis Report + version: 2.0 + output: + format: markdown + filename: docs/competitor-analysis.md + title: "Competitive Analysis Report: {{project_product_name}}" + +workflow: + mode: interactive + elicitation: advanced-elicitation + custom_elicitation: + title: "Competitive Analysis Elicitation Actions" + options: + - "Deep dive on a specific competitor's strategy" + - "Analyze competitive dynamics in a specific segment" + - "War game competitive responses to your moves" + - "Explore partnership vs. competition scenarios" + - "Stress test differentiation claims" + - "Analyze disruption potential (yours or theirs)" + - "Compare to competition in adjacent markets" + - "Generate win/loss analysis insights" + - "If only we had known about [competitor X's plan]..." + - "Proceed to next section" + +sections: + - id: executive-summary + title: Executive Summary + instruction: Provide high-level competitive insights, main threats and opportunities, and recommended strategic actions. Write this section LAST after completing all analysis. + + - id: analysis-scope + title: Analysis Scope & Methodology + instruction: This template guides comprehensive competitor analysis. Start by understanding the user's competitive intelligence needs and strategic objectives. Help them identify and prioritize competitors before diving into detailed analysis. + sections: + - id: analysis-purpose + title: Analysis Purpose + instruction: | + Define the primary purpose: + - New market entry assessment + - Product positioning strategy + - Feature gap analysis + - Pricing strategy development + - Partnership/acquisition targets + - Competitive threat assessment + - id: competitor-categories + title: Competitor Categories Analyzed + instruction: | + List categories included: + - Direct Competitors: Same product/service, same target market + - Indirect Competitors: Different product, same need/problem + - Potential Competitors: Could enter market easily + - Substitute Products: Alternative solutions + - Aspirational Competitors: Best-in-class examples + - id: research-methodology + title: Research Methodology + instruction: | + Describe approach: + - Information sources used + - Analysis timeframe + - Confidence levels + - Limitations + + - id: competitive-landscape + title: Competitive Landscape Overview + sections: + - id: market-structure + title: Market Structure + instruction: | + Describe the competitive environment: + - Number of active competitors + - Market concentration (fragmented/consolidated) + - Competitive dynamics + - Recent market entries/exits + - id: prioritization-matrix + title: Competitor Prioritization Matrix + instruction: | + Help categorize competitors by market share and strategic threat level + + Create a 2x2 matrix: + - Priority 1 (Core Competitors): High Market Share + High Threat + - Priority 2 (Emerging Threats): Low Market Share + High Threat + - Priority 3 (Established Players): High Market Share + Low Threat + - Priority 4 (Monitor Only): Low Market Share + Low Threat + + - id: competitor-profiles + title: Individual Competitor Profiles + instruction: Create detailed profiles for each Priority 1 and Priority 2 competitor. For Priority 3 and 4, create condensed profiles. + repeatable: true + sections: + - id: competitor + title: "{{competitor_name}} - Priority {{priority_level}}" + sections: + - id: company-overview + title: Company Overview + template: | + - **Founded:** {{year_founders}} + - **Headquarters:** {{location}} + - **Company Size:** {{employees_revenue}} + - **Funding:** {{total_raised_investors}} + - **Leadership:** {{key_executives}} + - id: business-model + title: Business Model & Strategy + template: | + - **Revenue Model:** {{revenue_model}} + - **Target Market:** {{customer_segments}} + - **Value Proposition:** {{value_promise}} + - **Go-to-Market Strategy:** {{gtm_approach}} + - **Strategic Focus:** {{current_priorities}} + - id: product-analysis + title: Product/Service Analysis + template: | + - **Core Offerings:** {{main_products}} + - **Key Features:** {{standout_capabilities}} + - **User Experience:** {{ux_assessment}} + - **Technology Stack:** {{tech_stack}} + - **Pricing:** {{pricing_model}} + - id: strengths-weaknesses + title: Strengths & Weaknesses + sections: + - id: strengths + title: Strengths + type: bullet-list + template: "- {{strength}}" + - id: weaknesses + title: Weaknesses + type: bullet-list + template: "- {{weakness}}" + - id: market-position + title: Market Position & Performance + template: | + - **Market Share:** {{market_share_estimate}} + - **Customer Base:** {{customer_size_notables}} + - **Growth Trajectory:** {{growth_trend}} + - **Recent Developments:** {{key_news}} + + - id: comparative-analysis + title: Comparative Analysis + sections: + - id: feature-comparison + title: Feature Comparison Matrix + instruction: Create a detailed comparison table of key features across competitors + type: table + columns: ["Feature Category", "{{your_company}}", "{{competitor_1}}", "{{competitor_2}}", "{{competitor_3}}"] + rows: + - category: "Core Functionality" + items: + - ["Feature A", "{{status}}", "{{status}}", "{{status}}", "{{status}}"] + - ["Feature B", "{{status}}", "{{status}}", "{{status}}", "{{status}}"] + - category: "User Experience" + items: + - ["Mobile App", "{{rating}}", "{{rating}}", "{{rating}}", "{{rating}}"] + - ["Onboarding Time", "{{time}}", "{{time}}", "{{time}}", "{{time}}"] + - category: "Integration & Ecosystem" + items: + - ["API Availability", "{{availability}}", "{{availability}}", "{{availability}}", "{{availability}}"] + - ["Third-party Integrations", "{{number}}", "{{number}}", "{{number}}", "{{number}}"] + - category: "Pricing & Plans" + items: + - ["Starting Price", "{{price}}", "{{price}}", "{{price}}", "{{price}}"] + - ["Free Tier", "{{yes_no}}", "{{yes_no}}", "{{yes_no}}", "{{yes_no}}"] + - id: swot-comparison + title: SWOT Comparison + instruction: Create SWOT analysis for your solution vs. top competitors + sections: + - id: your-solution + title: Your Solution + template: | + - **Strengths:** {{strengths}} + - **Weaknesses:** {{weaknesses}} + - **Opportunities:** {{opportunities}} + - **Threats:** {{threats}} + - id: vs-competitor + title: "vs. {{main_competitor}}" + template: | + - **Competitive Advantages:** {{your_advantages}} + - **Competitive Disadvantages:** {{their_advantages}} + - **Differentiation Opportunities:** {{differentiation}} + - id: positioning-map + title: Positioning Map + instruction: | + Describe competitor positions on key dimensions + + Create a positioning description using 2 key dimensions relevant to the market, such as: + - Price vs. Features + - Ease of Use vs. Power + - Specialization vs. Breadth + - Self-Serve vs. High-Touch + + - id: strategic-analysis + title: Strategic Analysis + sections: + - id: competitive-advantages + title: Competitive Advantages Assessment + sections: + - id: sustainable-advantages + title: Sustainable Advantages + instruction: | + Identify moats and defensible positions: + - Network effects + - Switching costs + - Brand strength + - Technology barriers + - Regulatory advantages + - id: vulnerable-points + title: Vulnerable Points + instruction: | + Where competitors could be challenged: + - Weak customer segments + - Missing features + - Poor user experience + - High prices + - Limited geographic presence + - id: blue-ocean + title: Blue Ocean Opportunities + instruction: | + Identify uncontested market spaces + + List opportunities to create new market space: + - Underserved segments + - Unaddressed use cases + - New business models + - Geographic expansion + - Different value propositions + + - id: strategic-recommendations + title: Strategic Recommendations + sections: + - id: differentiation-strategy + title: Differentiation Strategy + instruction: | + How to position against competitors: + - Unique value propositions to emphasize + - Features to prioritize + - Segments to target + - Messaging and positioning + - id: competitive-response + title: Competitive Response Planning + sections: + - id: offensive-strategies + title: Offensive Strategies + instruction: | + How to gain market share: + - Target competitor weaknesses + - Win competitive deals + - Capture their customers + - id: defensive-strategies + title: Defensive Strategies + instruction: | + How to protect your position: + - Strengthen vulnerable areas + - Build switching costs + - Deepen customer relationships + - id: partnership-ecosystem + title: Partnership & Ecosystem Strategy + instruction: | + Potential collaboration opportunities: + - Complementary players + - Channel partners + - Technology integrations + - Strategic alliances + + - id: monitoring-plan + title: Monitoring & Intelligence Plan + sections: + - id: key-competitors + title: Key Competitors to Track + instruction: Priority list with rationale + - id: monitoring-metrics + title: Monitoring Metrics + instruction: | + What to track: + - Product updates + - Pricing changes + - Customer wins/losses + - Funding/M&A activity + - Market messaging + - id: intelligence-sources + title: Intelligence Sources + instruction: | + Where to gather ongoing intelligence: + - Company websites/blogs + - Customer reviews + - Industry reports + - Social media + - Patent filings + - id: update-cadence + title: Update Cadence + instruction: | + Recommended review schedule: + - Weekly: {{weekly_items}} + - Monthly: {{monthly_items}} + - Quarterly: {{quarterly_analysis}} +==================== END: .bmad-core/templates/competitor-analysis-tmpl.yaml ==================== + +==================== START: .bmad-core/templates/brainstorming-output-tmpl.yaml ==================== +template: + id: brainstorming-output-template-v2 + name: Brainstorming Session Results + version: 2.0 + output: + format: markdown + filename: docs/brainstorming-session-results.md + title: "Brainstorming Session Results" + +workflow: + mode: non-interactive + +sections: + - id: header + content: | + **Session Date:** {{date}} + **Facilitator:** {{agent_role}} {{agent_name}} + **Participant:** {{user_name}} + + - id: executive-summary + title: Executive Summary + sections: + - id: summary-details + template: | + **Topic:** {{session_topic}} + + **Session Goals:** {{stated_goals}} + + **Techniques Used:** {{techniques_list}} + + **Total Ideas Generated:** {{total_ideas}} + - id: key-themes + title: "Key Themes Identified:" + type: bullet-list + template: "- {{theme}}" + + - id: technique-sessions + title: Technique Sessions + repeatable: true + sections: + - id: technique + title: "{{technique_name}} - {{duration}}" + sections: + - id: description + template: "**Description:** {{technique_description}}" + - id: ideas-generated + title: "Ideas Generated:" + type: numbered-list + template: "{{idea}}" + - id: insights + title: "Insights Discovered:" + type: bullet-list + template: "- {{insight}}" + - id: connections + title: "Notable Connections:" + type: bullet-list + template: "- {{connection}}" + + - id: idea-categorization + title: Idea Categorization + sections: + - id: immediate-opportunities + title: Immediate Opportunities + content: "*Ideas ready to implement now*" + repeatable: true + type: numbered-list + template: | + **{{idea_name}}** + - Description: {{description}} + - Why immediate: {{rationale}} + - Resources needed: {{requirements}} + - id: future-innovations + title: Future Innovations + content: "*Ideas requiring development/research*" + repeatable: true + type: numbered-list + template: | + **{{idea_name}}** + - Description: {{description}} + - Development needed: {{development_needed}} + - Timeline estimate: {{timeline}} + - id: moonshots + title: Moonshots + content: "*Ambitious, transformative concepts*" + repeatable: true + type: numbered-list + template: | + **{{idea_name}}** + - Description: {{description}} + - Transformative potential: {{potential}} + - Challenges to overcome: {{challenges}} + - id: insights-learnings + title: Insights & Learnings + content: "*Key realizations from the session*" + type: bullet-list + template: "- {{insight}}: {{description_and_implications}}" + + - id: action-planning + title: Action Planning + sections: + - id: top-priorities + title: Top 3 Priority Ideas + sections: + - id: priority-1 + title: "#1 Priority: {{idea_name}}" + template: | + - Rationale: {{rationale}} + - Next steps: {{next_steps}} + - Resources needed: {{resources}} + - Timeline: {{timeline}} + - id: priority-2 + title: "#2 Priority: {{idea_name}}" + template: | + - Rationale: {{rationale}} + - Next steps: {{next_steps}} + - Resources needed: {{resources}} + - Timeline: {{timeline}} + - id: priority-3 + title: "#3 Priority: {{idea_name}}" + template: | + - Rationale: {{rationale}} + - Next steps: {{next_steps}} + - Resources needed: {{resources}} + - Timeline: {{timeline}} + + - id: reflection-followup + title: Reflection & Follow-up + sections: + - id: what-worked + title: What Worked Well + type: bullet-list + template: "- {{aspect}}" + - id: areas-exploration + title: Areas for Further Exploration + type: bullet-list + template: "- {{area}}: {{reason}}" + - id: recommended-techniques + title: Recommended Follow-up Techniques + type: bullet-list + template: "- {{technique}}: {{reason}}" + - id: questions-emerged + title: Questions That Emerged + type: bullet-list + template: "- {{question}}" + - id: next-session + title: Next Session Planning + template: | + - **Suggested topics:** {{followup_topics}} + - **Recommended timeframe:** {{timeframe}} + - **Preparation needed:** {{preparation}} + + - id: footer + content: | + --- + + *Session facilitated using the BMAD-METHOD brainstorming framework* +==================== END: .bmad-core/templates/brainstorming-output-tmpl.yaml ==================== ==================== START: .bmad-core/data/brainstorming-techniques.md ==================== # Brainstorming Techniques Data @@ -4911,479 +5006,493 @@ Document sharded successfully: - Ensure the sharding is reversible (could reconstruct the original from shards) ==================== END: .bmad-core/tasks/shard-doc.md ==================== -==================== START: .bmad-core/templates/prd-tmpl.md ==================== -# {{Project Name}} Product Requirements Document (PRD) - -[[LLM: The default path and filename unless specified is docs/prd.md]] - -[[LLM: If available, review any provided document or ask if any are optionally available: Project Brief]] - -## Goals and Background Context - -[[LLM: Populate the 2 child sections based on what we have received from user description or the provided brief. Allow user to review the 2 sections and offer changes before proceeding]] - -### Goals - -[[LLM: Bullet list of 1 line desired outcomes the PRD will deliver if successful - user and project desires]] - -### Background Context - -[[LLM: 1-2 short paragraphs summarizing the background context, such as what we learned in the brief without being redundant with the goals, what and why this solves a problem, what the current landscape or need is etc...]] - -### Change Log - -[[LLM: Track document versions and changes]] - -| Date | Version | Description | Author | -| :--- | :------ | :---------- | :----- | - -## Requirements - -[[LLM: Draft the list of functional and non functional requirements under the two child sections, and immediately execute .bmad-core/tasks/advanced-elicitation.md display]] - -### Functional - -[[LLM: Each Requirement will be a bullet markdown and an identifier sequence starting with FR`.]] -@{example: - FR6: The Todo List uses AI to detect and warn against adding potentially duplicate todo items that are worded differently.} - -### Non Functional - -[[LLM: Each Requirement will be a bullet markdown and an identifier sequence starting with NFR`.]] -@{example: - NFR1: AWS service usage **must** aim to stay within free-tier limits where feasible.} - -^^CONDITION: has_ui^^ - -## User Interface Design Goals - -[[LLM: Capture high-level UI/UX vision to guide Design Architect and to inform story creation. Steps: - -1. Pre-fill all subsections with educated guesses based on project context -2. Present the complete rendered section to user -3. Clearly let the user know where assumptions were made -4. Ask targeted questions for unclear/missing elements or areas needing more specification -5. This is NOT detailed UI spec - focus on product vision and user goals -6. After section completion, immediately apply `.bmad-core/tasks/advanced-elicitation.md` protocol]] - -### Overall UX Vision - -### Key Interaction Paradigms - -### Core Screens and Views - -[[LLM: From a product perspective, what are the most critical screens or views necessary to deliver the the PRD values and goals? This is meant to be Conceptual High Level to Drive Rough Epic or User Stories]] - -@{example} - -- Login Screen -- Main Dashboard -- Item Detail Page -- Settings Page - @{/example} - -### Accessibility: { None, WCAG, etc } - -### Branding - -[[LLM: Any known branding elements or style guides that must be incorporated?]] - -@{example} - -- Replicate the look and feel of early 1900s black and white cinema, including animated effects replicating film damage or projector glitches during page or state transitions. -- Attached is the full color pallet and tokens for our corporate branding. - @{/example} - -### Target Device and Platforms - -@{example} -"Web Responsive, and all mobile platforms", "IPhone Only", "ASCII Windows Desktop" -@{/example} - -^^/CONDITION: has_ui^^ - -## Technical Assumptions - -[[LLM: Gather technical decisions that will guide the Architect. Steps: - -1. Check if `.bmad-core/data/technical-preferences.yaml` or an attached `technical-preferences` file exists - use it to pre-populate choices -2. Ask user about: languages, frameworks, starter templates, libraries, APIs, deployment targets -3. For unknowns, offer guidance based on project goals and MVP scope -4. Document ALL technical choices with rationale (why this choice fits the project) -5. These become constraints for the Architect - be specific and complete -6. After section completion, apply `.bmad-core/tasks/advanced-elicitation.md` protocol.]] - -### Repository Structure: { Monorepo, Polyrepo, etc...} - -### Service Architecture - -[[LLM: CRITICAL DECISION - Document the high-level service architecture (e.g., Monolith, Microservices, Serverless functions within a Monorepo).]] - -### Testing requirements - -[[LLM: CRITICAL DECISION - Document the testing requirements, unit only, integration, e2e, manual, need for manual testing convenience methods).]] - -### Additional Technical Assumptions and Requests - -[[LLM: Throughout the entire process of drafting this document, if any other technical assumptions are raised or discovered appropriate for the architect, add them here as additional bulleted items]] - -## Epics - -[[LLM: First, present a high-level list of all epics for user approval, the epic_list and immediately execute .bmad-core/tasks/advanced-elicitation.md display. Each epic should have a title and a short (1 sentence) goal statement. This allows the user to review the overall structure before diving into details. - -CRITICAL: Epics MUST be logically sequential following agile best practices: - -- Each epic should deliver a significant, end-to-end, fully deployable increment of testable functionality -- Epic 1 must establish foundational project infrastructure (app setup, Git, CI/CD, core services) unless we are adding new functionality to an existing app, while also delivering an initial piece of functionality, even as simple as a health-check route or display of a simple canary page - remember this when we produce the stories for the first epic! -- Each subsequent epic builds upon previous epics' functionality delivering major blocks of functionality that provide tangible value to users or business when deployed -- Not every project needs multiple epics, an epic needs to deliver value. For example, an API completed can deliver value even if a UI is not complete and planned for a separate epic. -- Err on the side of less epics, but let the user know your rationale and offer options for splitting them if it seems some are too large or focused on disparate things. -- Cross Cutting Concerns should flow through epics and stories and not be final stories. For example, adding a logging framework as a last story of an epic, or at the end of a project as a final epic or story would be terrible as we would not have logging from the beginning.]] - -<> - -- Epic{{epic_number}} {{epic_title}}: {{short_goal}} - -<> - -@{example: epic_list} - -1. Foundation & Core Infrastructure: Establish project setup, authentication, and basic user management -2. Core Business Entities: Create and manage primary domain objects with CRUD operations -3. User Workflows & Interactions: Enable key user journeys and business processes -4. Reporting & Analytics: Provide insights and data visualization for users - -@{/example} - -[[LLM: After the epic list is approved, present each `epic_details` with all its stories and acceptance criteria as a complete review unit and immediately execute .bmad-core/tasks/advanced-elicitation.md display, before moving on to the next epic.]] - -<> - -## Epic {{epic_number}} {{epic_title}} - -{{epic_goal}} [[LLM: Expanded goal - 2-3 sentences describing the objective and value all the stories will achieve]] - -[[LLM: CRITICAL STORY SEQUENCING REQUIREMENTS: - -- Stories within each epic MUST be logically sequential -- Each story should be a "vertical slice" delivering complete functionality aside from early enabler stories for project foundation -- No story should depend on work from a later story or epic -- Identify and note any direct prerequisite stories -- Focus on "what" and "why" not "how" (leave technical implementation to Architect) yet be precise enough to support a logical sequential order of operations from story to story. -- Ensure each story delivers clear user or business value, try to avoid enablers and build them into stories that deliver value. -- Size stories for AI agent execution: Each story must be completable by a single AI agent in one focused session without context overflow -- Think "junior developer working for 2-4 hours" - stories must be small, focused, and self-contained -- If a story seems complex, break it down further as long as it can deliver a vertical slice -- Each story should result in working, testable code before the agent's context window fills]] - -<> - -### Story {{epic_number}}.{{story_number}} {{story_title}} - -As a {{user_type}}, -I want {{action}}, -so that {{benefit}}. - -#### Acceptance Criteria - -[[LLM: Define clear, comprehensive, and testable acceptance criteria that: - -- Precisely define what "done" means from a functional perspective -- Are unambiguous and serve as basis for verification -- Include any critical non-functional requirements from the PRD -- Consider local testability for backend/data components -- Specify UI/UX requirements and framework adherence where applicable -- Avoid cross-cutting concerns that should be in other stories or PRD sections]] - -<> - -- {{criterion number}}: {{criteria}} - -<> -<> -<> - -## Checklist Results Report - -[[LLM: Before running the checklist and drafting the prompts, offer to output the full updated PRD. If outputting it, confirm with the user that you will be proceeding to run the checklist and produce the report. Once the user confirms, execute the `pm-checklist` and populate the results in this section.]] - -## Next Steps - -### Design Architect Prompt - -[[LLM: This section will contain the prompt for the Design Architect, keep it short and to the point to initiate create architecture mode using this document as input.]] - -### Architect Prompt - -[[LLM: This section will contain the prompt for the Architect, keep it short and to the point to initiate create architecture mode using this document as input.]] -==================== END: .bmad-core/templates/prd-tmpl.md ==================== - -==================== START: .bmad-core/templates/brownfield-prd-tmpl.md ==================== -# {{Project Name}} Brownfield Enhancement PRD - -[[LLM: The default path and filename unless specified is docs/prd.md]] - -[[LLM: IMPORTANT - SCOPE ASSESSMENT REQUIRED: - -This PRD is for SIGNIFICANT enhancements to existing projects that require comprehensive planning and multiple stories. Before proceeding: - -1. **Assess Enhancement Complexity**: If this is a simple feature addition or bug fix that could be completed in 1-2 focused development sessions, STOP and recommend: "For simpler changes, consider using the brownfield-create-epic or brownfield-create-story task with the Product Owner instead. This full PRD process is designed for substantial enhancements that require architectural planning and multiple coordinated stories." - -2. **Project Context**: Determine if we're working in an IDE with the project already loaded or if the user needs to provide project information. If project files are available, analyze existing documentation in the docs folder. If insufficient documentation exists, recommend running the document-project task first. - -3. **Deep Assessment Requirement**: You MUST thoroughly analyze the existing project structure, patterns, and constraints before making ANY suggestions. Every recommendation must be grounded in actual project analysis, not assumptions.]] - -## Intro Project Analysis and Context - -[[LLM: Gather comprehensive information about the existing project. This section must be completed before proceeding with requirements. - -CRITICAL: Throughout this analysis, explicitly confirm your understanding with the user. For every assumption you make about the existing project, ask: "Based on my analysis, I understand that [assumption]. Is this correct?" - -Do not proceed with any recommendations until the user has validated your understanding of the existing system.]] - -### Existing Project Overview - -[[LLM: Check if document-project analysis was already performed. If yes, reference that output instead of re-analyzing.]] - -**Analysis Source**: [[LLM: Indicate one of the following: -- Document-project output available at: {{path}} -- IDE-based fresh analysis -- User-provided information -]] - -**Current Project State**: [[LLM: -- If document-project output exists: Extract summary from "High Level Architecture" and "Technical Summary" sections -- Otherwise: Brief description of what the project currently does and its primary purpose -]] - -### Available Documentation Analysis - -[[LLM: -If document-project was run: -- Note: "Document-project analysis available - using existing technical documentation" -- List key documents created by document-project -- Skip the missing documentation check below - -Otherwise, check for existing documentation: -]] - -**Available Documentation**: - -- [ ] Tech Stack Documentation [[LLM: If from document-project, check ✓]] -- [ ] Source Tree/Architecture [[LLM: If from document-project, check ✓]] -- [ ] Coding Standards [[LLM: If from document-project, may be partial]] -- [ ] API Documentation [[LLM: If from document-project, check ✓]] -- [ ] External API Documentation [[LLM: If from document-project, check ✓]] -- [ ] UX/UI Guidelines [[LLM: May not be in document-project]] -- [ ] Technical Debt Documentation [[LLM: If from document-project, check ✓]] -- [ ] Other: \***\*\_\_\_\*\*** - -[[LLM: -- If document-project was already run: "Using existing project analysis from document-project output." -- If critical documentation is missing and no document-project: "I recommend running the document-project task first..." -]] - -### Enhancement Scope Definition - -[[LLM: Work with user to clearly define what type of enhancement this is. This is critical for scoping and approach.]] - -**Enhancement Type**: [[LLM: Determine with user which applies]] - -- [ ] New Feature Addition -- [ ] Major Feature Modification -- [ ] Integration with New Systems -- [ ] Performance/Scalability Improvements -- [ ] UI/UX Overhaul -- [ ] Technology Stack Upgrade -- [ ] Bug Fix and Stability Improvements -- [ ] Other: \***\*\_\_\_\*\*** - -**Enhancement Description**: [[LLM: 2-3 sentences describing what the user wants to add or change]] - -**Impact Assessment**: [[LLM: Assess the scope of impact on existing codebase]] - -- [ ] Minimal Impact (isolated additions) -- [ ] Moderate Impact (some existing code changes) -- [ ] Significant Impact (substantial existing code changes) -- [ ] Major Impact (architectural changes required) - -### Goals and Background Context - -#### Goals - -[[LLM: Bullet list of 1-line desired outcomes this enhancement will deliver if successful]] - -#### Background Context - -[[LLM: 1-2 short paragraphs explaining why this enhancement is needed, what problem it solves, and how it fits with the existing project]] - -### Change Log - -| Change | Date | Version | Description | Author | -| ------ | ---- | ------- | ----------- | ------ | - -## Requirements - -[[LLM: Draft functional and non-functional requirements based on your validated understanding of the existing project. Before presenting requirements, confirm: "These requirements are based on my understanding of your existing system. Please review carefully and confirm they align with your project's reality." Then immediately execute tasks#advanced-elicitation display]] - -### Functional - -[[LLM: Each Requirement will be a bullet markdown with identifier starting with FR]] -@{example: - FR1: The existing Todo List will integrate with the new AI duplicate detection service without breaking current functionality.} - -### Non Functional - -[[LLM: Each Requirement will be a bullet markdown with identifier starting with NFR. Include constraints from existing system]] -@{example: - NFR1: Enhancement must maintain existing performance characteristics and not exceed current memory usage by more than 20%.} - -### Compatibility Requirements - -[[LLM: Critical for brownfield - what must remain compatible]] - -- CR1: [[LLM: Existing API compatibility requirements]] -- CR2: [[LLM: Database schema compatibility requirements]] -- CR3: [[LLM: UI/UX consistency requirements]] -- CR4: [[LLM: Integration compatibility requirements]] - -^^CONDITION: has_ui^^ - -## User Interface Enhancement Goals - -[[LLM: For UI changes, capture how they will integrate with existing UI patterns and design systems]] - -### Integration with Existing UI - -[[LLM: Describe how new UI elements will fit with existing design patterns, style guides, and component libraries]] - -### Modified/New Screens and Views - -[[LLM: List only the screens/views that will be modified or added]] - -### UI Consistency Requirements - -[[LLM: Specific requirements for maintaining visual and interaction consistency with existing application]] - -^^/CONDITION: has_ui^^ - -## Technical Constraints and Integration Requirements - -[[LLM: This section replaces separate architecture documentation. Gather detailed technical constraints from existing project analysis.]] - -### Existing Technology Stack - -[[LLM: -If document-project output available: -- Extract from "Actual Tech Stack" table in High Level Architecture section -- Include version numbers and any noted constraints - -Otherwise, document the current technology stack: -]] - -**Languages**: [[LLM: From document-project or fresh analysis]] -**Frameworks**: [[LLM: From document-project or fresh analysis]] -**Database**: [[LLM: From document-project or fresh analysis]] -**Infrastructure**: [[LLM: From document-project or fresh analysis]] -**External Dependencies**: [[LLM: From document-project "External Services" section or fresh analysis]] - -### Integration Approach - -[[LLM: Define how the enhancement will integrate with existing architecture]] - -**Database Integration Strategy**: [[LLM: How new features will interact with existing database]] -**API Integration Strategy**: [[LLM: How new APIs will integrate with existing API structure]] -**Frontend Integration Strategy**: [[LLM: How new UI components will integrate with existing frontend]] -**Testing Integration Strategy**: [[LLM: How new tests will integrate with existing test suite]] - -### Code Organization and Standards - -[[LLM: Based on existing project analysis, define how new code will fit existing patterns]] - -**File Structure Approach**: [[LLM: How new files will fit existing project structure]] -**Naming Conventions**: [[LLM: Existing naming conventions that must be followed]] -**Coding Standards**: [[LLM: Existing coding standards and linting rules]] -**Documentation Standards**: [[LLM: How new code documentation will match existing patterns]] - -### Deployment and Operations - -[[LLM: How the enhancement fits existing deployment pipeline]] - -**Build Process Integration**: [[LLM: How enhancement builds with existing process]] -**Deployment Strategy**: [[LLM: How enhancement will be deployed alongside existing features]] -**Monitoring and Logging**: [[LLM: How enhancement will integrate with existing monitoring]] -**Configuration Management**: [[LLM: How new configuration will integrate with existing config]] - -### Risk Assessment and Mitigation - -[[LLM: -If document-project output available: -- Reference "Technical Debt and Known Issues" section -- Include "Workarounds and Gotchas" that might impact enhancement -- Note any identified constraints from "Critical Technical Debt" - -Build risk assessment incorporating existing known issues: -]] - -**Technical Risks**: [[LLM: Include risks from document-project + new enhancement risks]] -**Integration Risks**: [[LLM: Reference integration constraints from document-project]] -**Deployment Risks**: [[LLM: Include deployment gotchas from document-project]] -**Mitigation Strategies**: [[LLM: Address both existing and new risks]] - -## Epic and Story Structure - -[[LLM: For brownfield projects, favor a single comprehensive epic unless the user is clearly requesting multiple unrelated enhancements. Before presenting the epic structure, confirm: "Based on my analysis of your existing project, I believe this enhancement should be structured as [single epic/multiple epics] because [rationale based on actual project analysis]. Does this align with your understanding of the work required?" Then present the epic structure and immediately execute tasks#advanced-elicitation display.]] - -### Epic Approach - -[[LLM: Explain the rationale for epic structure - typically single epic for brownfield unless multiple unrelated features]] - -**Epic Structure Decision**: [[LLM: Single Epic or Multiple Epics with rationale]] - -## Epic 1: {{enhancement_title}} - -[[LLM: Comprehensive epic that delivers the brownfield enhancement while maintaining existing functionality]] - -**Epic Goal**: [[LLM: 2-3 sentences describing the complete enhancement objective and value]] - -**Integration Requirements**: [[LLM: Key integration points with existing system]] - -[[LLM: CRITICAL STORY SEQUENCING FOR BROWNFIELD: - -- Stories must ensure existing functionality remains intact -- Each story should include verification that existing features still work -- Stories should be sequenced to minimize risk to existing system -- Include rollback considerations for each story -- Focus on incremental integration rather than big-bang changes -- Size stories for AI agent execution in existing codebase context -- MANDATORY: Present the complete story sequence and ask: "This story sequence is designed to minimize risk to your existing system. Does this order make sense given your project's architecture and constraints?" -- Stories must be logically sequential with clear dependencies identified -- Each story must deliver value while maintaining system integrity]] - -<> - -### Story 1.{{story_number}} {{story_title}} - -As a {{user_type}}, -I want {{action}}, -so that {{benefit}}. - -#### Acceptance Criteria - -[[LLM: Define criteria that include both new functionality and existing system integrity]] - -<> - -- {{criterion number}}: {{criteria}} - -<> - -#### Integration Verification - -[[LLM: Specific verification steps to ensure existing functionality remains intact]] - -- IV1: [[LLM: Existing functionality verification requirement]] -- IV2: [[LLM: Integration point verification requirement]] -- IV3: [[LLM: Performance impact verification requirement]] - -<> -==================== END: .bmad-core/templates/brownfield-prd-tmpl.md ==================== +==================== START: .bmad-core/templates/prd-tmpl.yaml ==================== +template: + id: prd-template-v2 + name: Product Requirements Document + version: 2.0 + output: + format: markdown + filename: docs/prd.md + title: "{{project_name}} Product Requirements Document (PRD)" + +workflow: + mode: interactive + elicitation: advanced-elicitation + +sections: + - id: goals-context + title: Goals and Background Context + instruction: | + Ask if Project Brief document is available. If NO Project Brief exists, STRONGLY recommend creating one first using project-brief-tmpl (it provides essential foundation: problem statement, target users, success metrics, MVP scope, constraints). If user insists on PRD without brief, gather this information during Goals section. If Project Brief exists, review and use it to populate Goals (bullet list of desired outcomes) and Background Context (1-2 paragraphs on what this solves and why) so we can determine what is and is not in scope for PRD mvp. Either way this is critical to determine the requirements. Include Change Log table. + sections: + - id: goals + title: Goals + type: bullet-list + instruction: Bullet list of 1 line desired outcomes the PRD will deliver if successful - user and project desires + - id: background + title: Background Context + type: paragraphs + instruction: 1-2 short paragraphs summarizing the background context, such as what we learned in the brief without being redundant with the goals, what and why this solves a problem, what the current landscape or need is + - id: changelog + title: Change Log + type: table + columns: [Date, Version, Description, Author] + instruction: Track document versions and changes + + - id: requirements + title: Requirements + instruction: Draft the list of functional and non functional requirements under the two child sections + elicit: true + sections: + - id: functional + title: Functional + type: numbered-list + prefix: FR + instruction: Each Requirement will be a bullet markdown and an identifier sequence starting with FR + examples: + - "FR6: The Todo List uses AI to detect and warn against potentially duplicate todo items that are worded differently." + - id: non-functional + title: Non Functional + type: numbered-list + prefix: NFR + instruction: Each Requirement will be a bullet markdown and an identifier sequence starting with NFR + examples: + - "NFR1: AWS service usage must aim to stay within free-tier limits where feasible." + + - id: ui-goals + title: User Interface Design Goals + condition: PRD has UX/UI requirements + instruction: | + Capture high-level UI/UX vision to guide Design Architect and to inform story creation. Steps: + + 1. Pre-fill all subsections with educated guesses based on project context + 2. Present the complete rendered section to user + 3. Clearly let the user know where assumptions were made + 4. Ask targeted questions for unclear/missing elements or areas needing more specification + 5. This is NOT detailed UI spec - focus on product vision and user goals + elicit: true + choices: + accessibility: [None, WCAG AA, WCAG AAA] + platforms: [Web Responsive, Mobile Only, Desktop Only, Cross-Platform] + sections: + - id: ux-vision + title: Overall UX Vision + - id: interaction-paradigms + title: Key Interaction Paradigms + - id: core-screens + title: Core Screens and Views + instruction: From a product perspective, what are the most critical screens or views necessary to deliver the the PRD values and goals? This is meant to be Conceptual High Level to Drive Rough Epic or User Stories + examples: + - "Login Screen" + - "Main Dashboard" + - "Item Detail Page" + - "Settings Page" + - id: accessibility + title: "Accessibility: {None|WCAG AA|WCAG AAA|Custom Requirements}" + - id: branding + title: Branding + instruction: Any known branding elements or style guides that must be incorporated? + examples: + - "Replicate the look and feel of early 1900s black and white cinema, including animated effects replicating film damage or projector glitches during page or state transitions." + - "Attached is the full color pallet and tokens for our corporate branding." + - id: target-platforms + title: "Target Device and Platforms: {Web Responsive|Mobile Only|Desktop Only|Cross-Platform}" + examples: + - "Web Responsive, and all mobile platforms" + - "iPhone Only" + - "ASCII Windows Desktop" + + - id: technical-assumptions + title: Technical Assumptions + instruction: | + Gather technical decisions that will guide the Architect. Steps: + + 1. Check if .bmad-core/data/technical-preferences.yaml or an attached technical-preferences file exists - use it to pre-populate choices + 2. Ask user about: languages, frameworks, starter templates, libraries, APIs, deployment targets + 3. For unknowns, offer guidance based on project goals and MVP scope + 4. Document ALL technical choices with rationale (why this choice fits the project) + 5. These become constraints for the Architect - be specific and complete + elicit: true + choices: + repository: [Monorepo, Polyrepo] + architecture: [Monolith, Microservices, Serverless] + testing: [Unit Only, Unit + Integration, Full Testing Pyramid] + sections: + - id: repository-structure + title: "Repository Structure: {Monorepo|Polyrepo|Multi-repo}" + - id: service-architecture + title: Service Architecture + instruction: "CRITICAL DECISION - Document the high-level service architecture (e.g., Monolith, Microservices, Serverless functions within a Monorepo)." + - id: testing-requirements + title: Testing Requirements + instruction: "CRITICAL DECISION - Document the testing requirements, unit only, integration, e2e, manual, need for manual testing convenience methods)." + - id: additional-assumptions + title: Additional Technical Assumptions and Requests + instruction: Throughout the entire process of drafting this document, if any other technical assumptions are raised or discovered appropriate for the architect, add them here as additional bulleted items + + - id: epic-list + title: Epic List + instruction: | + Present a high-level list of all epics for user approval. Each epic should have a title and a short (1 sentence) goal statement. This allows the user to review the overall structure before diving into details. + + CRITICAL: Epics MUST be logically sequential following agile best practices: + + - Each epic should deliver a significant, end-to-end, fully deployable increment of testable functionality + - Epic 1 must establish foundational project infrastructure (app setup, Git, CI/CD, core services) unless we are adding new functionality to an existing app, while also delivering an initial piece of functionality, even as simple as a health-check route or display of a simple canary page - remember this when we produce the stories for the first epic! + - Each subsequent epic builds upon previous epics' functionality delivering major blocks of functionality that provide tangible value to users or business when deployed + - Not every project needs multiple epics, an epic needs to deliver value. For example, an API completed can deliver value even if a UI is not complete and planned for a separate epic. + - Err on the side of less epics, but let the user know your rationale and offer options for splitting them if it seems some are too large or focused on disparate things. + - Cross Cutting Concerns should flow through epics and stories and not be final stories. For example, adding a logging framework as a last story of an epic, or at the end of a project as a final epic or story would be terrible as we would not have logging from the beginning. + elicit: true + examples: + - "Epic 1: Foundation & Core Infrastructure: Establish project setup, authentication, and basic user management" + - "Epic 2: Core Business Entities: Create and manage primary domain objects with CRUD operations" + - "Epic 3: User Workflows & Interactions: Enable key user journeys and business processes" + - "Epic 4: Reporting & Analytics: Provide insights and data visualization for users" + + - id: epic-details + title: Epic {{epic_number}} {{epic_title}} + repeatable: true + instruction: | + After the epic list is approved, present each epic with all its stories and acceptance criteria as a complete review unit. + + For each epic provide expanded goal (2-3 sentences describing the objective and value all the stories will achieve). + + CRITICAL STORY SEQUENCING REQUIREMENTS: + + - Stories within each epic MUST be logically sequential + - Each story should be a "vertical slice" delivering complete functionality aside from early enabler stories for project foundation + - No story should depend on work from a later story or epic + - Identify and note any direct prerequisite stories + - Focus on "what" and "why" not "how" (leave technical implementation to Architect) yet be precise enough to support a logical sequential order of operations from story to story. + - Ensure each story delivers clear user or business value, try to avoid enablers and build them into stories that deliver value. + - Size stories for AI agent execution: Each story must be completable by a single AI agent in one focused session without context overflow + - Think "junior developer working for 2-4 hours" - stories must be small, focused, and self-contained + - If a story seems complex, break it down further as long as it can deliver a vertical slice + elicit: true + template: "{{epic_goal}}" + sections: + - id: story + title: Story {{epic_number}}.{{story_number}} {{story_title}} + repeatable: true + template: | + As a {{user_type}}, + I want {{action}}, + so that {{benefit}}. + sections: + - id: acceptance-criteria + title: Acceptance Criteria + type: numbered-list + item_template: "{{criterion_number}}: {{criteria}}" + repeatable: true + instruction: | + Define clear, comprehensive, and testable acceptance criteria that: + + - Precisely define what "done" means from a functional perspective + - Are unambiguous and serve as basis for verification + - Include any critical non-functional requirements from the PRD + - Consider local testability for backend/data components + - Specify UI/UX requirements and framework adherence where applicable + - Avoid cross-cutting concerns that should be in other stories or PRD sections + + - id: checklist-results + title: Checklist Results Report + instruction: Before running the checklist and drafting the prompts, offer to output the full updated PRD. If outputting it, confirm with the user that you will be proceeding to run the checklist and produce the report. Once the user confirms, execute the pm-checklist and populate the results in this section. + + - id: next-steps + title: Next Steps + sections: + - id: design-architect-prompt + title: Design Architect Prompt + instruction: This section will contain the prompt for the Design Architect, keep it short and to the point to initiate create architecture mode using this document as input. + - id: architect-prompt + title: Architect Prompt + instruction: This section will contain the prompt for the Architect, keep it short and to the point to initiate create architecture mode using this document as input. +==================== END: .bmad-core/templates/prd-tmpl.yaml ==================== + +==================== START: .bmad-core/templates/brownfield-prd-tmpl.yaml ==================== +template: + id: brownfield-prd-template-v2 + name: Brownfield Enhancement PRD + version: 2.0 + output: + format: markdown + filename: docs/prd.md + title: "{{project_name}} Brownfield Enhancement PRD" + +workflow: + mode: interactive + elicitation: advanced-elicitation + +sections: + - id: intro-analysis + title: Intro Project Analysis and Context + instruction: | + IMPORTANT - SCOPE ASSESSMENT REQUIRED: + + This PRD is for SIGNIFICANT enhancements to existing projects that require comprehensive planning and multiple stories. Before proceeding: + + 1. **Assess Enhancement Complexity**: If this is a simple feature addition or bug fix that could be completed in 1-2 focused development sessions, STOP and recommend: "For simpler changes, consider using the brownfield-create-epic or brownfield-create-story task with the Product Owner instead. This full PRD process is designed for substantial enhancements that require architectural planning and multiple coordinated stories." + + 2. **Project Context**: Determine if we're working in an IDE with the project already loaded or if the user needs to provide project information. If project files are available, analyze existing documentation in the docs folder. If insufficient documentation exists, recommend running the document-project task first. + + 3. **Deep Assessment Requirement**: You MUST thoroughly analyze the existing project structure, patterns, and constraints before making ANY suggestions. Every recommendation must be grounded in actual project analysis, not assumptions. + + Gather comprehensive information about the existing project. This section must be completed before proceeding with requirements. + + CRITICAL: Throughout this analysis, explicitly confirm your understanding with the user. For every assumption you make about the existing project, ask: "Based on my analysis, I understand that [assumption]. Is this correct?" + + Do not proceed with any recommendations until the user has validated your understanding of the existing system. + sections: + - id: existing-project-overview + title: Existing Project Overview + instruction: Check if document-project analysis was already performed. If yes, reference that output instead of re-analyzing. + sections: + - id: analysis-source + title: Analysis Source + instruction: | + Indicate one of the following: + - Document-project output available at: {{path}} + - IDE-based fresh analysis + - User-provided information + - id: current-state + title: Current Project State + instruction: | + - If document-project output exists: Extract summary from "High Level Architecture" and "Technical Summary" sections + - Otherwise: Brief description of what the project currently does and its primary purpose + - id: documentation-analysis + title: Available Documentation Analysis + instruction: | + If document-project was run: + - Note: "Document-project analysis available - using existing technical documentation" + - List key documents created by document-project + - Skip the missing documentation check below + + Otherwise, check for existing documentation: + sections: + - id: available-docs + title: Available Documentation + type: checklist + items: + - Tech Stack Documentation [[LLM: If from document-project, check ✓]] + - Source Tree/Architecture [[LLM: If from document-project, check ✓]] + - Coding Standards [[LLM: If from document-project, may be partial]] + - API Documentation [[LLM: If from document-project, check ✓]] + - External API Documentation [[LLM: If from document-project, check ✓]] + - UX/UI Guidelines [[LLM: May not be in document-project]] + - Technical Debt Documentation [[LLM: If from document-project, check ✓]] + - "Other: {{other_docs}}" + instruction: | + - If document-project was already run: "Using existing project analysis from document-project output." + - If critical documentation is missing and no document-project: "I recommend running the document-project task first..." + - id: enhancement-scope + title: Enhancement Scope Definition + instruction: Work with user to clearly define what type of enhancement this is. This is critical for scoping and approach. + sections: + - id: enhancement-type + title: Enhancement Type + type: checklist + instruction: Determine with user which applies + items: + - New Feature Addition + - Major Feature Modification + - Integration with New Systems + - Performance/Scalability Improvements + - UI/UX Overhaul + - Technology Stack Upgrade + - Bug Fix and Stability Improvements + - "Other: {{other_type}}" + - id: enhancement-description + title: Enhancement Description + instruction: 2-3 sentences describing what the user wants to add or change + - id: impact-assessment + title: Impact Assessment + type: checklist + instruction: Assess the scope of impact on existing codebase + items: + - Minimal Impact (isolated additions) + - Moderate Impact (some existing code changes) + - Significant Impact (substantial existing code changes) + - Major Impact (architectural changes required) + - id: goals-context + title: Goals and Background Context + sections: + - id: goals + title: Goals + type: bullet-list + instruction: Bullet list of 1-line desired outcomes this enhancement will deliver if successful + - id: background + title: Background Context + type: paragraphs + instruction: 1-2 short paragraphs explaining why this enhancement is needed, what problem it solves, and how it fits with the existing project + - id: changelog + title: Change Log + type: table + columns: [Change, Date, Version, Description, Author] + + - id: requirements + title: Requirements + instruction: | + Draft functional and non-functional requirements based on your validated understanding of the existing project. Before presenting requirements, confirm: "These requirements are based on my understanding of your existing system. Please review carefully and confirm they align with your project's reality." + elicit: true + sections: + - id: functional + title: Functional + type: numbered-list + prefix: FR + instruction: Each Requirement will be a bullet markdown with identifier starting with FR + examples: + - "FR1: The existing Todo List will integrate with the new AI duplicate detection service without breaking current functionality." + - id: non-functional + title: Non Functional + type: numbered-list + prefix: NFR + instruction: Each Requirement will be a bullet markdown with identifier starting with NFR. Include constraints from existing system + examples: + - "NFR1: Enhancement must maintain existing performance characteristics and not exceed current memory usage by more than 20%." + - id: compatibility + title: Compatibility Requirements + instruction: Critical for brownfield - what must remain compatible + type: numbered-list + prefix: CR + template: "{{requirement}}: {{description}}" + items: + - id: cr1 + template: "CR1: {{existing_api_compatibility}}" + - id: cr2 + template: "CR2: {{database_schema_compatibility}}" + - id: cr3 + template: "CR3: {{ui_ux_consistency}}" + - id: cr4 + template: "CR4: {{integration_compatibility}}" + + - id: ui-enhancement-goals + title: User Interface Enhancement Goals + condition: Enhancement includes UI changes + instruction: For UI changes, capture how they will integrate with existing UI patterns and design systems + sections: + - id: existing-ui-integration + title: Integration with Existing UI + instruction: Describe how new UI elements will fit with existing design patterns, style guides, and component libraries + - id: modified-screens + title: Modified/New Screens and Views + instruction: List only the screens/views that will be modified or added + - id: ui-consistency + title: UI Consistency Requirements + instruction: Specific requirements for maintaining visual and interaction consistency with existing application + + - id: technical-constraints + title: Technical Constraints and Integration Requirements + instruction: This section replaces separate architecture documentation. Gather detailed technical constraints from existing project analysis. + sections: + - id: existing-tech-stack + title: Existing Technology Stack + instruction: | + If document-project output available: + - Extract from "Actual Tech Stack" table in High Level Architecture section + - Include version numbers and any noted constraints + + Otherwise, document the current technology stack: + template: | + **Languages**: {{languages}} + **Frameworks**: {{frameworks}} + **Database**: {{database}} + **Infrastructure**: {{infrastructure}} + **External Dependencies**: {{external_dependencies}} + - id: integration-approach + title: Integration Approach + instruction: Define how the enhancement will integrate with existing architecture + template: | + **Database Integration Strategy**: {{database_integration}} + **API Integration Strategy**: {{api_integration}} + **Frontend Integration Strategy**: {{frontend_integration}} + **Testing Integration Strategy**: {{testing_integration}} + - id: code-organization + title: Code Organization and Standards + instruction: Based on existing project analysis, define how new code will fit existing patterns + template: | + **File Structure Approach**: {{file_structure}} + **Naming Conventions**: {{naming_conventions}} + **Coding Standards**: {{coding_standards}} + **Documentation Standards**: {{documentation_standards}} + - id: deployment-operations + title: Deployment and Operations + instruction: How the enhancement fits existing deployment pipeline + template: | + **Build Process Integration**: {{build_integration}} + **Deployment Strategy**: {{deployment_strategy}} + **Monitoring and Logging**: {{monitoring_logging}} + **Configuration Management**: {{config_management}} + - id: risk-assessment + title: Risk Assessment and Mitigation + instruction: | + If document-project output available: + - Reference "Technical Debt and Known Issues" section + - Include "Workarounds and Gotchas" that might impact enhancement + - Note any identified constraints from "Critical Technical Debt" + + Build risk assessment incorporating existing known issues: + template: | + **Technical Risks**: {{technical_risks}} + **Integration Risks**: {{integration_risks}} + **Deployment Risks**: {{deployment_risks}} + **Mitigation Strategies**: {{mitigation_strategies}} + + - id: epic-structure + title: Epic and Story Structure + instruction: | + For brownfield projects, favor a single comprehensive epic unless the user is clearly requesting multiple unrelated enhancements. Before presenting the epic structure, confirm: "Based on my analysis of your existing project, I believe this enhancement should be structured as [single epic/multiple epics] because [rationale based on actual project analysis]. Does this align with your understanding of the work required?" + elicit: true + sections: + - id: epic-approach + title: Epic Approach + instruction: Explain the rationale for epic structure - typically single epic for brownfield unless multiple unrelated features + template: "**Epic Structure Decision**: {{epic_decision}} with rationale" + + - id: epic-details + title: "Epic 1: {{enhancement_title}}" + instruction: | + Comprehensive epic that delivers the brownfield enhancement while maintaining existing functionality + + CRITICAL STORY SEQUENCING FOR BROWNFIELD: + - Stories must ensure existing functionality remains intact + - Each story should include verification that existing features still work + - Stories should be sequenced to minimize risk to existing system + - Include rollback considerations for each story + - Focus on incremental integration rather than big-bang changes + - Size stories for AI agent execution in existing codebase context + - MANDATORY: Present the complete story sequence and ask: "This story sequence is designed to minimize risk to your existing system. Does this order make sense given your project's architecture and constraints?" + - Stories must be logically sequential with clear dependencies identified + - Each story must deliver value while maintaining system integrity + template: | + **Epic Goal**: {{epic_goal}} + + **Integration Requirements**: {{integration_requirements}} + sections: + - id: story + title: "Story 1.{{story_number}} {{story_title}}" + repeatable: true + template: | + As a {{user_type}}, + I want {{action}}, + so that {{benefit}}. + sections: + - id: acceptance-criteria + title: Acceptance Criteria + type: numbered-list + instruction: Define criteria that include both new functionality and existing system integrity + item_template: "{{criterion_number}}: {{criteria}}" + - id: integration-verification + title: Integration Verification + instruction: Specific verification steps to ensure existing functionality remains intact + type: numbered-list + prefix: IV + items: + - template: "IV1: {{existing_functionality_verification}}" + - template: "IV2: {{integration_point_verification}}" + - template: "IV3: {{performance_impact_verification}}" +==================== END: .bmad-core/templates/brownfield-prd-tmpl.yaml ==================== ==================== START: .bmad-core/checklists/pm-checklist.md ==================== # Product Manager (PM) Requirements Checklist @@ -6008,2946 +6117,2514 @@ You will now synthesize the inputs and the above principles into a final, compre - Conclude by reminding the user that all AI-generated code will require careful human review, testing, and refinement to be considered production-ready. ==================== END: .bmad-core/tasks/generate-ai-frontend-prompt.md ==================== -==================== START: .bmad-core/templates/front-end-spec-tmpl.md ==================== -# {{Project Name}} UI/UX Specification - -[[LLM: The default path and filename unless specified is docs/front-end-spec.md]] - -[[LLM: Review provided documents including Project Brief, PRD, and any user research to gather context. Focus on understanding user needs, pain points, and desired outcomes before beginning the specification.]] - -## Introduction - -[[LLM: Establish the document's purpose and scope. Keep the content below but ensure project name is properly substituted.]] - -This document defines the user experience goals, information architecture, user flows, and visual design specifications for {{Project Name}}'s user interface. It serves as the foundation for visual design and frontend development, ensuring a cohesive and user-centered experience. - -### Overall UX Goals & Principles - -[[LLM: Work with the user to establish and document the following. If not already defined, facilitate a discussion to determine: - -1. Target User Personas - elicit details or confirm existing ones from PRD -2. Key Usability Goals - understand what success looks like for users -3. Core Design Principles - establish 3-5 guiding principles - -After presenting this section, apply `tasks#advanced-elicitation` protocol]] - -### Target User Personas - -{{persona_descriptions}} - -@{example: personas} - -- **Power User:** Technical professionals who need advanced features and efficiency -- **Casual User:** Occasional users who prioritize ease of use and clear guidance -- **Administrator:** System managers who need control and oversight capabilities - @{/example} - -### Usability Goals - -{{usability_goals}} - -@{example: usability_goals} - -- Ease of learning: New users can complete core tasks within 5 minutes -- Efficiency of use: Power users can complete frequent tasks with minimal clicks -- Error prevention: Clear validation and confirmation for destructive actions -- Memorability: Infrequent users can return without relearning - @{/example} - -### Design Principles - -{{design_principles}} - -@{example: design_principles} - -1. **Clarity over cleverness** - Prioritize clear communication over aesthetic innovation -2. **Progressive disclosure** - Show only what's needed, when it's needed -3. **Consistent patterns** - Use familiar UI patterns throughout the application -4. **Immediate feedback** - Every action should have a clear, immediate response -5. **Accessible by default** - Design for all users from the start - @{/example} - -### Change Log - -[[LLM: Track document versions and changes]] - -| Date | Version | Description | Author | -| :--- | :------ | :---------- | :----- | - -## Information Architecture (IA) - -[[LLM: Collaborate with the user to create a comprehensive information architecture: - -1. Build a Site Map or Screen Inventory showing all major areas -2. Define the Navigation Structure (primary, secondary, breadcrumbs) -3. Use Mermaid diagrams for visual representation -4. Consider user mental models and expected groupings - -After presenting this section, apply `tasks#advanced-elicitation` protocol]] - -### Site Map / Screen Inventory - -```mermaid -{{sitemap_diagram}} -``` - -@{example: sitemap} - -```mermaid -graph TD - A[Homepage] --> B[Dashboard] - A --> C[Products] - A --> D[Account] - B --> B1[Analytics] - B --> B2[Recent Activity] - C --> C1[Browse] - C --> C2[Search] - C --> C3[Product Details] - D --> D1[Profile] - D --> D2[Settings] - D --> D3[Billing] -``` - -@{/example} - -### Navigation Structure - -**Primary Navigation:** {{primary_nav_description}} - -**Secondary Navigation:** {{secondary_nav_description}} - -**Breadcrumb Strategy:** {{breadcrumb_strategy}} - -## User Flows - -[[LLM: For each critical user task identified in the PRD: - -1. Define the user's goal clearly -2. Map out all steps including decision points -3. Consider edge cases and error states -4. Use Mermaid flow diagrams for clarity -5. Link to external tools (Figma/Miro) if detailed flows exist there - -Create subsections for each major flow. After presenting all flows, apply `tasks#advanced-elicitation` protocol]] - -<> - -### {{flow_name}} - -**User Goal:** {{flow_goal}} - -**Entry Points:** {{entry_points}} - -**Success Criteria:** {{success_criteria}} - -#### Flow Diagram - -```mermaid -{{flow_diagram}} -``` - -**Edge Cases & Error Handling:** - -- {{edge_case_1}} -- {{edge_case_2}} - -**Notes:** {{flow_notes}} -<> - -@{example: user_flow} - -### User Registration - -**User Goal:** Create a new account to access the platform - -**Entry Points:** Homepage CTA, Login page link, Marketing landing pages - -**Success Criteria:** User successfully creates account and reaches dashboard - -#### Flow Diagram - -```mermaid -graph TD - Start[Landing Page] --> Click[Click Sign Up] - Click --> Form[Registration Form] - Form --> Fill[Fill Required Fields] - Fill --> Submit[Submit Form] - Submit --> Validate{Valid?} - Validate -->|No| Error[Show Errors] - Error --> Form - Validate -->|Yes| Verify[Email Verification] - Verify --> Complete[Account Created] - Complete --> Dashboard[Redirect to Dashboard] -``` - -**Edge Cases & Error Handling:** - -- Duplicate email: Show inline error with password recovery option -- Weak password: Real-time feedback on password strength -- Network error: Preserve form data and show retry option - @{/example} - -## Wireframes & Mockups - -[[LLM: Clarify where detailed visual designs will be created (Figma, Sketch, etc.) and how to reference them. If low-fidelity wireframes are needed, offer to help conceptualize layouts for key screens. - -After presenting this section, apply `tasks#advanced-elicitation` protocol]] - -**Primary Design Files:** {{design_tool_link}} - -### Key Screen Layouts - -<> - -#### {{screen_name}} - -**Purpose:** {{screen_purpose}} - -**Key Elements:** - -- {{element_1}} -- {{element_2}} -- {{element_3}} - -**Interaction Notes:** {{interaction_notes}} - -**Design File Reference:** {{specific_frame_link}} -<> - -## Component Library / Design System - -[[LLM: Discuss whether to use an existing design system or create a new one. If creating new, identify foundational components and their key states. Note that detailed technical specs belong in front-end-architecture. - -After presenting this section, apply `tasks#advanced-elicitation` protocol]] - -**Design System Approach:** {{design_system_approach}} - -### Core Components - -<> - -#### {{component_name}} - -**Purpose:** {{component_purpose}} - -**Variants:** {{component_variants}} - -**States:** {{component_states}} - -**Usage Guidelines:** {{usage_guidelines}} -<> - -@{example: component} - -#### Button - -**Purpose:** Primary interaction element for user actions - -**Variants:** Primary, Secondary, Tertiary, Destructive - -**States:** Default, Hover, Active, Disabled, Loading - -**Usage Guidelines:** - -- Use Primary for main CTAs (one per view) -- Secondary for supporting actions -- Destructive only for permanent deletions with confirmation - @{/example} - -## Branding & Style Guide - -[[LLM: Link to existing style guide or define key brand elements. Ensure consistency with company brand guidelines if they exist. - -After presenting this section, apply `tasks#advanced-elicitation` protocol]] - -### Visual Identity - -**Brand Guidelines:** {{brand_guidelines_link}} - -### Color Palette - -| Color Type | Hex Code | Usage | -| :------------ | :------------------ | :------------------------------- | -| **Primary** | {{primary_color}} | {{primary_usage}} | -| **Secondary** | {{secondary_color}} | {{secondary_usage}} | -| **Accent** | {{accent_color}} | {{accent_usage}} | -| **Success** | {{success_color}} | Positive feedback, confirmations | -| **Warning** | {{warning_color}} | Cautions, important notices | -| **Error** | {{error_color}} | Errors, destructive actions | -| **Neutral** | {{neutral_colors}} | Text, borders, backgrounds | - -### Typography - -**Font Families:** - -- **Primary:** {{primary_font}} -- **Secondary:** {{secondary_font}} -- **Monospace:** {{mono_font}} - -**Type Scale:** -| Element | Size | Weight | Line Height | -|:--------|:-----|:-------|:------------| -| H1 | {{h1_size}} | {{h1_weight}} | {{h1_line}} | -| H2 | {{h2_size}} | {{h2_weight}} | {{h2_line}} | -| H3 | {{h3_size}} | {{h3_weight}} | {{h3_line}} | -| Body | {{body_size}} | {{body_weight}} | {{body_line}} | -| Small | {{small_size}} | {{small_weight}} | {{small_line}} | - -### Iconography - -**Icon Library:** {{icon_library}} - -**Usage Guidelines:** {{icon_guidelines}} - -### Spacing & Layout - -**Grid System:** {{grid_system}} - -**Spacing Scale:** {{spacing_scale}} - -## Accessibility Requirements - -[[LLM: Define specific accessibility requirements based on target compliance level and user needs. Be comprehensive but practical. - -After presenting this section, apply `tasks#advanced-elicitation` protocol]] - -### Compliance Target - -**Standard:** {{compliance_standard}} - -### Key Requirements - -**Visual:** - -- Color contrast ratios: {{contrast_requirements}} -- Focus indicators: {{focus_requirements}} -- Text sizing: {{text_requirements}} - -**Interaction:** - -- Keyboard navigation: {{keyboard_requirements}} -- Screen reader support: {{screen_reader_requirements}} -- Touch targets: {{touch_requirements}} - -**Content:** - -- Alternative text: {{alt_text_requirements}} -- Heading structure: {{heading_requirements}} -- Form labels: {{form_requirements}} - -### Testing Strategy - -{{accessibility_testing}} - -## Responsiveness Strategy - -[[LLM: Define breakpoints and adaptation strategies for different device sizes. Consider both technical constraints and user contexts. - -After presenting this section, apply `tasks#advanced-elicitation` protocol]] - -### Breakpoints - -| Breakpoint | Min Width | Max Width | Target Devices | -| :--------- | :-------------- | :-------------- | :------------------ | -| Mobile | {{mobile_min}} | {{mobile_max}} | {{mobile_devices}} | -| Tablet | {{tablet_min}} | {{tablet_max}} | {{tablet_devices}} | -| Desktop | {{desktop_min}} | {{desktop_max}} | {{desktop_devices}} | -| Wide | {{wide_min}} | - | {{wide_devices}} | - -### Adaptation Patterns - -**Layout Changes:** {{layout_adaptations}} - -**Navigation Changes:** {{nav_adaptations}} - -**Content Priority:** {{content_adaptations}} - -**Interaction Changes:** {{interaction_adaptations}} - -## Animation & Micro-interactions - -[[LLM: Define motion design principles and key interactions. Keep performance and accessibility in mind. - -After presenting this section, apply `tasks#advanced-elicitation` protocol]] - -### Motion Principles - -{{motion_principles}} - -### Key Animations - -<> - -- **{{animation_name}}:** {{animation_description}} (Duration: {{duration}}, Easing: {{easing}}) - <> - -## Performance Considerations - -[[LLM: Define performance goals and strategies that impact UX design decisions.]] - -### Performance Goals - -- **Page Load:** {{load_time_goal}} -- **Interaction Response:** {{interaction_goal}} -- **Animation FPS:** {{animation_goal}} - -### Design Strategies - -{{performance_strategies}} - -## Next Steps - -[[LLM: After completing the UI/UX specification: - -1. Recommend review with stakeholders -2. Suggest creating/updating visual designs in design tool -3. Prepare for handoff to Design Architect for frontend architecture -4. Note any open questions or decisions needed]] - -### Immediate Actions - -1. {{next_step_1}} -2. {{next_step_2}} -3. {{next_step_3}} - -### Design Handoff Checklist - -- [ ] All user flows documented -- [ ] Component inventory complete -- [ ] Accessibility requirements defined -- [ ] Responsive strategy clear -- [ ] Brand guidelines incorporated -- [ ] Performance goals established - -## Checklist Results - -[[LLM: If a UI/UX checklist exists, run it against this document and report results here.]] -==================== END: .bmad-core/templates/front-end-spec-tmpl.md ==================== - -==================== START: .bmad-core/templates/architecture-tmpl.md ==================== -# {{Project Name}} Architecture Document - -[[LLM: If available, review any provided relevant documents to gather all relevant context before beginning. If at a minimum you cannot local `docs/prd.md` ask the user what docs will provide the basis for the architecture.]] - -[[LLM: The default path and filename unless specified is docs/architecture.md]] - -## Introduction - -[[LLM: This section establishes the document's purpose and scope. Keep the content below but ensure project name is properly substituted. - -After presenting this section, apply `.bmad-core/tasks/advanced-elicitation.md` protocol]] - -This document outlines the overall project architecture for {{Project Name}}, including backend systems, shared services, and non-UI specific concerns. Its primary goal is to serve as the guiding architectural blueprint for AI-driven development, ensuring consistency and adherence to chosen patterns and technologies. - -**Relationship to Frontend Architecture:** -If the project includes a significant user interface, a separate Frontend Architecture Document will detail the frontend-specific design and MUST be used in conjunction with this document. Core technology stack choices documented herein (see "Tech Stack") are definitive for the entire project, including any frontend components. - -### Starter Template or Existing Project - -[[LLM: Before proceeding further with architecture design, check if the project is based on a starter template or existing codebase: - -1. Review the PRD and brainstorming brief for any mentions of: - -- Starter templates (e.g., Create React App, Next.js, Vue CLI, Angular CLI, etc.) -- Existing projects or codebases being used as a foundation -- Boilerplate projects or scaffolding tools -- Previous projects to be cloned or adapted - -2. If a starter template or existing project is mentioned: - -- Ask the user to provide access via one of these methods: - - Link to the starter template documentation - - Upload/attach the project files (for small projects) - - Share a link to the project repository (GitHub, GitLab, etc.) -- Analyze the starter/existing project to understand: - - Pre-configured technology stack and versions - - Project structure and organization patterns - - Built-in scripts and tooling - - Existing architectural patterns and conventions - - Any limitations or constraints imposed by the starter -- Use this analysis to inform and align your architecture decisions - -3. If no starter template is mentioned but this is a greenfield project: - -- Suggest appropriate starter templates based on the tech stack preferences -- Explain the benefits (faster setup, best practices, community support) -- Let the user decide whether to use one - -4. If the user confirms no starter template will be used: - -- Proceed with architecture design from scratch -- Note that manual setup will be required for all tooling and configuration - -Document the decision here before proceeding with the architecture design. In none, just say N/A - -After presenting this starter template section, apply `.bmad-core/tasks/advanced-elicitation.md` protocol]] - -### Change Log - -[[LLM: Track document versions and changes]] - -| Date | Version | Description | Author | -| :--- | :------ | :---------- | :----- | - -## High Level Architecture - -[[LLM: This section contains multiple subsections that establish the foundation of the architecture. Present all subsections together (Introduction, Technical Summary, High Level Overview, Project Diagram, and Architectural Patterns), then apply `.bmad-core/tasks/advanced-elicitation.md` protocol to the complete High Level Architecture section. The user can choose to refine the entire section or specific subsections.]] - -### Technical Summary - -[[LLM: Provide a brief paragraph (3-5 sentences) overview of: - -- The system's overall architecture style -- Key components and their relationships -- Primary technology choices -- Core architectural patterns being used -- Reference back to the PRD goals and how this architecture supports them]] - -### High Level Overview - -[[LLM: Based on the PRD's Technical Assumptions section, describe: - -1. The main architectural style (e.g., Monolith, Microservices, Serverless, Event-Driven) -2. Repository structure decision from PRD (Monorepo/Polyrepo) -3. Service architecture decision from PRD -4. Primary user interaction flow or data flow at a conceptual level -5. Key architectural decisions and their rationale - -After presenting this section, apply `.bmad-core/tasks/advanced-elicitation.md` protocol]] - -### High Level Project Diagram - -[[LLM: Create a Mermaid diagram that visualizes the high-level architecture. Consider: - -- System boundaries -- Major components/services -- Data flow directions -- External integrations -- User entry points - -Use appropriate Mermaid diagram type (graph TD, C4, sequence) based on what best represents the architecture - -After presenting the diagram, apply `.bmad-core/tasks/advanced-elicitation.md` protocol]] - -### Architectural and Design Patterns - -[[LLM: List the key high-level patterns that will guide the architecture. For each pattern: - -1. Present 2-3 viable options if multiple exist -2. Provide your recommendation with clear rationale -3. Get user confirmation before finalizing -4. These patterns should align with the PRD's technical assumptions and project goals - -Common patterns to consider: - -- Architectural style patterns (Serverless, Event-Driven, Microservices, CQRS, Hexagonal) -- Code organization patterns (Dependency Injection, Repository, Module, Factory) -- Data patterns (Event Sourcing, Saga, Database per Service) -- Communication patterns (REST, GraphQL, Message Queue, Pub/Sub)]] - -<> - -- **{{pattern_name}}:** {{pattern_description}} - _Rationale:_ {{rationale}} - -<> - -@{example: patterns} - -- **Serverless Architecture:** Using AWS Lambda for compute - _Rationale:_ Aligns with PRD requirement for cost optimization and automatic scaling -- **Repository Pattern:** Abstract data access logic - _Rationale:_ Enables testing and future database migration flexibility -- **Event-Driven Communication:** Using SNS/SQS for service decoupling - _Rationale:_ Supports async processing and system resilience - -@{/example} - -[[LLM: After presenting the patterns, apply `.bmad-core/tasks/advanced-elicitation.md` protocol]] - -## Tech Stack - -[[LLM: This is the DEFINITIVE technology selection section. Work with the user to make specific choices: - -1. Review PRD technical assumptions and any preferences from `.bmad-core/data/technical-preferences.yaml` or an attached `technical-preferences` -2. For each category, present 2-3 viable options with pros/cons -3. Make a clear recommendation based on project needs -4. Get explicit user approval for each selection -5. Document exact versions (avoid "latest" - pin specific versions) -6. This table is the single source of truth - all other docs must reference these choices - -Key decisions to finalize - before displaying the table, ensure you are aware of or ask the user about - let the user know if they are not sure on any that you can also provide suggestions with rationale: - -- Starter templates (if any) -- Languages and runtimes with exact versions -- Frameworks and libraries / packages -- Cloud provider and key services choices -- Database and storage solutions - if unclear suggest sql or nosql or other types depending on the project and depending on cloud provider offer a suggestion -- Development tools - -Upon render of the table, ensure the user is aware of the importance of this sections choices, should also look for gaps or disagreements with anything, ask for any clarifications if something is unclear why its in the list, and also right away apply `.bmad-core/tasks/advanced-elicitation.md` display - this statement and the options should be rendered and then prompt right all before allowing user input.]] - -### Cloud Infrastructure - -- **Provider:** {{cloud_provider}} -- **Key Services:** {{core_services_list}} -- **Deployment Regions:** {{regions}} - -### Technology Stack Table - -| Category | Technology | Version | Purpose | Rationale | -| :----------------- | :----------------- | :---------- | :---------- | :------------- | -| **Language** | {{language}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **Runtime** | {{runtime}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **Framework** | {{framework}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **Database** | {{database}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **Cache** | {{cache}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **Message Queue** | {{queue}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **API Style** | {{api_style}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **Authentication** | {{auth}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **Testing** | {{test_framework}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **Build Tool** | {{build_tool}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **IaC Tool** | {{iac_tool}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **Monitoring** | {{monitoring}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **Logging** | {{logging}} | {{version}} | {{purpose}} | {{why_chosen}} | - -@{example: tech_stack_row} -| **Language** | TypeScript | 5.3.3 | Primary development language | Strong typing, excellent tooling, team expertise | -| **Runtime** | Node.js | 20.11.0 | JavaScript runtime | LTS version, stable performance, wide ecosystem | -| **Framework** | NestJS | 10.3.2 | Backend framework | Enterprise-ready, good DI, matches team patterns | -@{/example} - -## Data Models - -[[LLM: Define the core data models/entities: - -1. Review PRD requirements and identify key business entities -2. For each model, explain its purpose and relationships -3. Include key attributes and data types -4. Show relationships between models -5. Discuss design decisions with user - -Create a clear conceptual model before moving to database schema. - -After presenting all data models, apply `.bmad-core/tasks/advanced-elicitation.md` protocol]] - -<> - -### {{model_name}} - -**Purpose:** {{model_purpose}} - -**Key Attributes:** - -- {{attribute_1}}: {{type_1}} - {{description_1}} -- {{attribute_2}}: {{type_2}} - {{description_2}} - -**Relationships:** - -- {{relationship_1}} -- {{relationship_2}} - <> - -## Components - -[[LLM: Based on the architectural patterns, tech stack, and data models from above: - -1. Identify major logical components/services and their responsibilities -2. Consider the repository structure (monorepo/polyrepo) from PRD -3. Define clear boundaries and interfaces between components -4. For each component, specify: - -- Primary responsibility -- Key interfaces/APIs exposed -- Dependencies on other components -- Technology specifics based on tech stack choices - -5. Create component diagrams where helpful -6. After presenting all components, apply `.bmad-core/tasks/advanced-elicitation.md` protocol]] - -<> - -### {{component_name}} - -**Responsibility:** {{component_description}} - -**Key Interfaces:** - -- {{interface_1}} -- {{interface_2}} - -**Dependencies:** {{dependencies}} - -**Technology Stack:** {{component_tech_details}} -<> - -### Component Diagrams - -[[LLM: Create Mermaid diagrams to visualize component relationships. Options: - -- C4 Container diagram for high-level view -- Component diagram for detailed internal structure -- Sequence diagrams for complex interactions - Choose the most appropriate for clarity - -After presenting the diagrams, apply `.bmad-core/tasks/advanced-elicitation.md` protocol]] - -## External APIs - -[[LLM: For each external service integration: - -1. Identify APIs needed based on PRD requirements and component design -2. If documentation URLs are unknown, ask user for specifics -3. Document authentication methods and security considerations -4. List specific endpoints that will be used -5. Note any rate limits or usage constraints - -If no external APIs are needed, state this explicitly and skip to next section.]] - -^^CONDITION: has_external_apis^^ - -<> - -### {{api_name}} API - -- **Purpose:** {{api_purpose}} -- **Documentation:** {{api_docs_url}} -- **Base URL(s):** {{api_base_url}} -- **Authentication:** {{auth_method}} -- **Rate Limits:** {{rate_limits}} - -**Key Endpoints Used:** -<> - -- `{{method}} {{endpoint_path}}` - {{endpoint_purpose}} - <> - -**Integration Notes:** {{integration_considerations}} -<> - -@{example: external_api} - -### Stripe API - -- **Purpose:** Payment processing and subscription management -- **Documentation:** https://stripe.com/docs/api -- **Base URL(s):** `https://api.stripe.com/v1` -- **Authentication:** Bearer token with secret key -- **Rate Limits:** 100 requests per second - -**Key Endpoints Used:** - -- `POST /customers` - Create customer profiles -- `POST /payment_intents` - Process payments -- `POST /subscriptions` - Manage subscriptions - @{/example} - -^^/CONDITION: has_external_apis^^ - -[[LLM: After presenting external APIs (or noting their absence), apply `.bmad-core/tasks/advanced-elicitation.md` protocol]] - -## Core Workflows - -[[LLM: Illustrate key system workflows using sequence diagrams: - -1. Identify critical user journeys from PRD -2. Show component interactions including external APIs -3. Include error handling paths -4. Document async operations -5. Create both high-level and detailed diagrams as needed - -Focus on workflows that clarify architecture decisions or complex interactions. - -After presenting the workflow diagrams, apply `.bmad-core/tasks/advanced-elicitation.md` protocol]] - -## REST API Spec - -[[LLM: If the project includes a REST API: - -1. Create an OpenAPI 3.0 specification -2. Include all endpoints from epics/stories -3. Define request/response schemas based on data models -4. Document authentication requirements -5. Include example requests/responses - -Use YAML format for better readability. If no REST API, skip this section.]] - -^^CONDITION: has_rest_api^^ - -```yaml -openapi: 3.0.0 -info: - title: - '[object Object]': null - version: - '[object Object]': null - description: - '[object Object]': null -servers: - - url: - '[object Object]': null - description: - '[object Object]': null -``` - -^^/CONDITION: has_rest_api^^ - -[[LLM: After presenting the REST API spec (or noting its absence if not applicable), apply `.bmad-core/tasks/advanced-elicitation.md` protocol]] - -## Database Schema - -[[LLM: Transform the conceptual data models into concrete database schemas: - -1. Use the database type(s) selected in Tech Stack -2. Create schema definitions using appropriate notation -3. Include indexes, constraints, and relationships -4. Consider performance and scalability -5. For NoSQL, show document structures - -Present schema in format appropriate to database type (SQL DDL, JSON schema, etc.) - -After presenting the database schema, apply `.bmad-core/tasks/advanced-elicitation.md` protocol]] - -## Source Tree - -[[LLM: Create a project folder structure that reflects: - -1. The chosen repository structure (monorepo/polyrepo) -2. The service architecture (monolith/microservices/serverless) -3. The selected tech stack and languages -4. Component organization from above -5. Best practices for the chosen frameworks -6. Clear separation of concerns - -Adapt the structure based on project needs. For monorepos, show service separation. For serverless, show function organization. Include language-specific conventions. - -After presenting the structure, apply `.bmad-core/tasks/advanced-elicitation.md` protocol to refine based on user feedback.]] - -```plaintext -{{project-root}}/ -├── .github/ # CI/CD workflows -│ └── workflows/ -│ └── main.yaml -├── .vscode/ # VSCode settings (optional) -│ └── settings.json -├── build/ # Compiled output (git-ignored) -├── config/ # Configuration files -├── docs/ # Project documentation -│ ├── PRD.md -│ ├── architecture.md -│ └── ... -├── infra/ # Infrastructure as Code -│ └── {{iac-structure}} -├── {{dependencies-dir}}/ # Dependencies (git-ignored) -├── scripts/ # Utility scripts -├── src/ # Application source code -│ └── {{source-structure}} -├── tests/ # Test files -│ ├── unit/ -│ ├── integration/ -│ └── e2e/ -├── .env.example # Environment variables template -├── .gitignore # Git ignore rules -├── {{package-manifest}} # Dependencies manifest -├── {{config-files}} # Language/framework configs -└── README.md # Project documentation - -@{example: monorepo-structure} -project-root/ -├── packages/ -│ ├── api/ # Backend API service -│ ├── web/ # Frontend application -│ ├── shared/ # Shared utilities/types -│ └── infrastructure/ # IaC definitions -├── scripts/ # Monorepo management scripts -└── package.json # Root package.json with workspaces -@{/example} -``` - -[[LLM: After presenting the source tree structure, apply `.bmad-core/tasks/advanced-elicitation.md` protocol]] - -## Infrastructure and Deployment - -[[LLM: Define the deployment architecture and practices: - -1. Use IaC tool selected in Tech Stack -2. Choose deployment strategy appropriate for the architecture -3. Define environments and promotion flow -4. Establish rollback procedures -5. Consider security, monitoring, and cost optimization - -Get user input on deployment preferences and CI/CD tool choices.]] - -### Infrastructure as Code - -- **Tool:** {{iac_tool}} {{version}} -- **Location:** `{{iac_directory}}` -- **Approach:** {{iac_approach}} - -### Deployment Strategy - -- **Strategy:** {{deployment_strategy}} -- **CI/CD Platform:** {{cicd_platform}} -- **Pipeline Configuration:** `{{pipeline_config_location}}` - -### Environments - -<> - -- **{{env_name}}:** {{env_purpose}} - {{env_details}} - <> - -### Environment Promotion Flow - -```text -{{promotion_flow_diagram}} -``` - -### Rollback Strategy - -- **Primary Method:** {{rollback_method}} -- **Trigger Conditions:** {{rollback_triggers}} -- **Recovery Time Objective:** {{rto}} - -[[LLM: After presenting the infrastructure and deployment section, apply `.bmad-core/tasks/advanced-elicitation.md` protocol]] - -## Error Handling Strategy - -[[LLM: Define comprehensive error handling approach: - -1. Choose appropriate patterns for the language/framework from Tech Stack -2. Define logging standards and tools -3. Establish error categories and handling rules -4. Consider observability and debugging needs -5. Ensure security (no sensitive data in logs) - -This section guides both AI and human developers in consistent error handling.]] - -### General Approach - -- **Error Model:** {{error_model}} -- **Exception Hierarchy:** {{exception_structure}} -- **Error Propagation:** {{propagation_rules}} - -### Logging Standards - -- **Library:** {{logging_library}} {{version}} -- **Format:** {{log_format}} -- **Levels:** {{log_levels_definition}} -- **Required Context:** - - Correlation ID: {{correlation_id_format}} - - Service Context: {{service_context}} - - User Context: {{user_context_rules}} - -### Error Handling Patterns - -#### External API Errors - -- **Retry Policy:** {{retry_strategy}} -- **Circuit Breaker:** {{circuit_breaker_config}} -- **Timeout Configuration:** {{timeout_settings}} -- **Error Translation:** {{error_mapping_rules}} - -#### Business Logic Errors - -- **Custom Exceptions:** {{business_exception_types}} -- **User-Facing Errors:** {{user_error_format}} -- **Error Codes:** {{error_code_system}} - -#### Data Consistency - -- **Transaction Strategy:** {{transaction_approach}} -- **Compensation Logic:** {{compensation_patterns}} -- **Idempotency:** {{idempotency_approach}} - -[[LLM: After presenting the error handling strategy, apply `.bmad-core/tasks/advanced-elicitation.md` protocol]] - -## Coding Standards - -[[LLM: These standards are MANDATORY for AI agents. Work with user to define ONLY the critical rules needed to prevent bad code. Explain that: - -1. This section directly controls AI developer behavior -2. Keep it minimal - assume AI knows general best practices -3. Focus on project-specific conventions and gotchas -4. Overly detailed standards bloat context and slow development -5. Standards will be extracted to separate file for dev agent use - -For each standard, get explicit user confirmation it's necessary.]] - -### Core Standards - -- **Languages & Runtimes:** {{languages_and_versions}} -- **Style & Linting:** {{linter_config}} -- **Test Organization:** {{test_file_convention}} - -### Naming Conventions - -[[LLM: Only include if deviating from language defaults]] - -| Element | Convention | Example | -| :-------- | :------------------- | :---------------- | -| Variables | {{var_convention}} | {{var_example}} | -| Functions | {{func_convention}} | {{func_example}} | -| Classes | {{class_convention}} | {{class_example}} | -| Files | {{file_convention}} | {{file_example}} | - -### Critical Rules - -[[LLM: List ONLY rules that AI might violate or project-specific requirements. Examples: - -- "Never use console.log in production code - use logger" -- "All API responses must use ApiResponse wrapper type" -- "Database queries must use repository pattern, never direct ORM" - -Avoid obvious rules like "use SOLID principles" or "write clean code"]] - -<> - -- **{{rule_name}}:** {{rule_description}} - <> - -### Language-Specific Guidelines - -[[LLM: Add ONLY if critical for preventing AI mistakes. Most teams don't need this section.]] - -^^CONDITION: has_language_specifics^^ - -#### {{language_name}} Specifics - -<> - -- **{{rule_topic}}:** {{rule_detail}} - <> - -^^/CONDITION: has_language_specifics^^ - -[[LLM: After presenting the coding standards, apply `.bmad-core/tasks/advanced-elicitation.md` protocol]] - -## Test Strategy and Standards - -[[LLM: Work with user to define comprehensive test strategy: - -1. Use test frameworks from Tech Stack -2. Decide on TDD vs test-after approach -3. Define test organization and naming -4. Establish coverage goals -5. Determine integration test infrastructure -6. Plan for test data and external dependencies - -Note: Basic info goes in Coding Standards for dev agent. This detailed section is for QA agent and team reference. Apply `.bmad-core/tasks/advanced-elicitation.md` after initial draft.]] - -### Testing Philosophy - -- **Approach:** {{test_approach}} -- **Coverage Goals:** {{coverage_targets}} -- **Test Pyramid:** {{test_distribution}} - -### Test Types and Organization - -#### Unit Tests - -- **Framework:** {{unit_test_framework}} {{version}} -- **File Convention:** {{unit_test_naming}} -- **Location:** {{unit_test_location}} -- **Mocking Library:** {{mocking_library}} -- **Coverage Requirement:** {{unit_coverage}} - -**AI Agent Requirements:** - -- Generate tests for all public methods -- Cover edge cases and error conditions -- Follow AAA pattern (Arrange, Act, Assert) -- Mock all external dependencies - -#### Integration Tests - -- **Scope:** {{integration_scope}} -- **Location:** {{integration_test_location}} -- **Test Infrastructure:** - <> - - **{{dependency_name}}:** {{test_approach}} ({{test_tool}}) - <> - -@{example: test_dependencies} - -- **Database:** In-memory H2 for unit tests, Testcontainers PostgreSQL for integration -- **Message Queue:** Embedded Kafka for tests -- **External APIs:** WireMock for stubbing - @{/example} - -#### End-to-End Tests - -- **Framework:** {{e2e_framework}} {{version}} -- **Scope:** {{e2e_scope}} -- **Environment:** {{e2e_environment}} -- **Test Data:** {{e2e_data_strategy}} - -### Test Data Management - -- **Strategy:** {{test_data_approach}} -- **Fixtures:** {{fixture_location}} -- **Factories:** {{factory_pattern}} -- **Cleanup:** {{cleanup_strategy}} - -### Continuous Testing - -- **CI Integration:** {{ci_test_stages}} -- **Performance Tests:** {{perf_test_approach}} -- **Security Tests:** {{security_test_approach}} - -[[LLM: After presenting the test strategy section, apply `.bmad-core/tasks/advanced-elicitation.md` protocol]] - -## Security - -[[LLM: Define MANDATORY security requirements for AI and human developers: - -1. Focus on implementation-specific rules -2. Reference security tools from Tech Stack -3. Define clear patterns for common scenarios -4. These rules directly impact code generation -5. Work with user to ensure completeness without redundancy]] - -### Input Validation - -- **Validation Library:** {{validation_library}} -- **Validation Location:** {{where_to_validate}} -- **Required Rules:** - - All external inputs MUST be validated - - Validation at API boundary before processing - - Whitelist approach preferred over blacklist - -### Authentication & Authorization - -- **Auth Method:** {{auth_implementation}} -- **Session Management:** {{session_approach}} -- **Required Patterns:** - - {{auth_pattern_1}} - - {{auth_pattern_2}} - -### Secrets Management - -- **Development:** {{dev_secrets_approach}} -- **Production:** {{prod_secrets_service}} -- **Code Requirements:** - - NEVER hardcode secrets - - Access via configuration service only - - No secrets in logs or error messages - -### API Security - -- **Rate Limiting:** {{rate_limit_implementation}} -- **CORS Policy:** {{cors_configuration}} -- **Security Headers:** {{required_headers}} -- **HTTPS Enforcement:** {{https_approach}} - -### Data Protection - -- **Encryption at Rest:** {{encryption_at_rest}} -- **Encryption in Transit:** {{encryption_in_transit}} -- **PII Handling:** {{pii_rules}} -- **Logging Restrictions:** {{what_not_to_log}} - -### Dependency Security - -- **Scanning Tool:** {{dependency_scanner}} -- **Update Policy:** {{update_frequency}} -- **Approval Process:** {{new_dep_process}} - -### Security Testing - -- **SAST Tool:** {{static_analysis}} -- **DAST Tool:** {{dynamic_analysis}} -- **Penetration Testing:** {{pentest_schedule}} - -[[LLM: After presenting the security section, apply `.bmad-core/tasks/advanced-elicitation.md` protocol]] - -## Checklist Results Report - -[[LLM: Before running the checklist, offer to output the full architecture document. Once user confirms, execute the `architect-checklist` and populate results here.]] - ---- - -## Next Steps - -[[LLM: After completing the architecture: - -1. If project has UI components: - -- Recommend engaging Design Architect agent -- Use "Frontend Architecture Mode" -- Provide this document as input - -2. For all projects: - -- Review with Product Owner -- Begin story implementation with Dev agent -- Set up infrastructure with DevOps agent - -3. Include specific prompts for next agents if needed]] - -^^CONDITION: has_ui^^ - -### Design Architect Prompt - -[[LLM: Create a brief prompt to hand off to Design Architect for Frontend Architecture creation. Include: - -- Reference to this architecture document -- Key UI requirements from PRD -- Any frontend-specific decisions made here -- Request for detailed frontend architecture]] - -^^/CONDITION: has_ui^^ - -### Developer Handoff - -[[LLM: Create a brief prompt for developers starting implementation. Include: - -- Reference to this architecture and coding standards -- First epic/story to implement -- Key technical decisions to follow]] -==================== END: .bmad-core/templates/architecture-tmpl.md ==================== - -==================== START: .bmad-core/templates/front-end-architecture-tmpl.md ==================== -# {{Project Name}} Frontend Architecture Document - -[[LLM: The default path and filename unless specified is docs/ui-architecture.md]] - -[[LLM: Review provided documents including PRD, UX-UI Specification, and main Architecture Document. Focus on extracting technical implementation details needed for AI frontend tools and developer agents. Ask the user for any of these documents if you are unable to locate and were not provided.]] - -## Template and Framework Selection - -[[LLM: Before proceeding with frontend architecture design, check if the project is using a frontend starter template or existing codebase: - -1. Review the PRD, main architecture document, and brainstorming brief for mentions of: - - - Frontend starter templates (e.g., Create React App, Next.js, Vite, Vue CLI, Angular CLI, etc.) - - UI kit or component library starters - - Existing frontend projects being used as a foundation - - Admin dashboard templates or other specialized starters - - Design system implementations - -2. If a frontend starter template or existing project is mentioned: - - - Ask the user to provide access via one of these methods: - - Link to the starter template documentation - - Upload/attach the project files (for small projects) - - Share a link to the project repository - - Analyze the starter/existing project to understand: - - Pre-installed dependencies and versions - - Folder structure and file organization - - Built-in components and utilities - - Styling approach (CSS modules, styled-components, Tailwind, etc.) - - State management setup (if any) - - Routing configuration - - Testing setup and patterns - - Build and development scripts - -- Use this analysis to ensure your frontend architecture aligns with the starter's patterns - -3. If no frontend starter is mentioned but this is a new UI, ensure we know what the ui language and framework is: - - - Based on the framework choice, suggest appropriate starters: - - React: Create React App, Next.js, Vite + React - - Vue: Vue CLI, Nuxt.js, Vite + Vue - - Angular: Angular CLI - - Or suggest popular UI templates if applicable - - Explain benefits specific to frontend development - -4. If the user confirms no starter template will be used: - - Note that all tooling, bundling, and configuration will need manual setup - - Proceed with frontend architecture from scratch - -Document the starter template decision and any constraints it imposes before proceeding.]] - -### Change Log - -[[LLM: Track document versions and changes]] - -| Date | Version | Description | Author | -| :--- | :------ | :---------- | :----- | - -## Frontend Tech Stack - -[[LLM: Extract from main architecture's Technology Stack Table. This section MUST remain synchronized with the main architecture document. After presenting this section, apply `tasks#advanced-elicitation` protocol]] - -### Technology Stack Table - -| Category | Technology | Version | Purpose | Rationale | -| :-------------------- | :------------------- | :---------- | :---------- | :------------- | -| **Framework** | {{framework}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **UI Library** | {{ui_library}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **State Management** | {{state_management}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **Routing** | {{routing_library}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **Build Tool** | {{build_tool}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **Styling** | {{styling_solution}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **Testing** | {{test_framework}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **Component Library** | {{component_lib}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **Form Handling** | {{form_library}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **Animation** | {{animation_lib}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **Dev Tools** | {{dev_tools}} | {{version}} | {{purpose}} | {{why_chosen}} | - -[[LLM: Fill in appropriate technology choices based on the selected framework and project requirements.]] - -## Project Structure - -[[LLM: Define exact directory structure for AI tools based on the chosen framework. Be specific about where each type of file goes. Generate a structure that follows the framework's best practices and conventions. After presenting this section, apply `tasks#advanced-elicitation` protocol]] - -## Component Standards - -[[LLM: Define exact patterns for component creation based on the chosen framework. After presenting this section, apply `tasks#advanced-elicitation` protocol]] - -### Component Template - -[[LLM: Generate a minimal but complete component template following the framework's best practices. Include TypeScript types, proper imports, and basic structure.]] - -### Naming Conventions - -[[LLM: Provide naming conventions specific to the chosen framework for components, files, services, state management, and other architectural elements.]] - -## State Management - -[[LLM: Define state management patterns based on the chosen framework. After presenting this section, apply `tasks#advanced-elicitation` protocol]] - -### Store Structure - -[[LLM: Generate the state management directory structure appropriate for the chosen framework and selected state management solution.]] - -### State Management Template - -[[LLM: Provide a basic state management template/example following the framework's recommended patterns. Include TypeScript types and common operations like setting, updating, and clearing state.]] - -## API Integration - -[[LLM: Define API service patterns based on the chosen framework. After presenting this section, apply `tasks#advanced-elicitation` protocol]] - -### Service Template - -[[LLM: Provide an API service template that follows the framework's conventions. Include proper TypeScript types, error handling, and async patterns.]] - -### API Client Configuration - -[[LLM: Show how to configure the HTTP client for the chosen framework, including authentication interceptors/middleware and error handling.]] - -## Routing - -[[LLM: Define routing structure and patterns based on the chosen framework. After presenting this section, apply `tasks#advanced-elicitation` protocol]] - -### Route Configuration - -[[LLM: Provide routing configuration appropriate for the chosen framework. Include protected route patterns, lazy loading where applicable, and authentication guards/middleware.]] - -## Styling Guidelines - -[[LLM: Define styling approach based on the chosen framework. After presenting this section, apply `tasks#advanced-elicitation` protocol]] - -### Styling Approach - -[[LLM: Describe the styling methodology appropriate for the chosen framework (CSS Modules, Styled Components, Tailwind, etc.) and provide basic patterns.]] - -### Global Theme Variables - -[[LLM: Provide a CSS custom properties (CSS variables) theme system that works across all frameworks. Include colors, spacing, typography, shadows, and dark mode support.]] - -## Testing Requirements - -[[LLM: Define minimal testing requirements based on the chosen framework. After presenting this section, apply `tasks#advanced-elicitation` protocol]] - -### Component Test Template - -[[LLM: Provide a basic component test template using the framework's recommended testing library. Include examples of rendering tests, user interaction tests, and mocking.]] - -### Testing Best Practices - -1. **Unit Tests**: Test individual components in isolation -2. **Integration Tests**: Test component interactions -3. **E2E Tests**: Test critical user flows (using Cypress/Playwright) -4. **Coverage Goals**: Aim for 80% code coverage -5. **Test Structure**: Arrange-Act-Assert pattern -6. **Mock External Dependencies**: API calls, routing, state management - -## Environment Configuration - -[[LLM: List required environment variables based on the chosen framework. Show the appropriate format and naming conventions for the framework. After presenting this section, apply `tasks#advanced-elicitation` protocol]] - -## Frontend Developer Standards - -### Critical Coding Rules - -[[LLM: List essential rules that prevent common AI mistakes, including both universal rules and framework-specific ones. After presenting this section, apply `tasks#advanced-elicitation` protocol]] - -### Quick Reference - -[[LLM: Create a framework-specific cheat sheet with: - -- Common commands (dev server, build, test) -- Key import patterns -- File naming conventions -- Project-specific patterns and utilities]] -==================== END: .bmad-core/templates/front-end-architecture-tmpl.md ==================== - -==================== START: .bmad-core/templates/fullstack-architecture-tmpl.md ==================== -# {{Project Name}} Fullstack Architecture Document - -[[LLM: The default path and filename unless specified is docs/architecture.md]] - -[[LLM: If available, review any provided relevant documents to gather all relevant context before beginning. At minimum, you should have access to docs/prd.md and docs/front-end-spec.md. Ask the user for any documents you need but cannot locate. This template creates a unified architecture that covers both backend and frontend concerns to guide AI-driven fullstack development.]] - -## Introduction - -[[LLM: This section establishes the document's purpose and scope. Keep the content below but ensure project name is properly substituted. - -After presenting this section, apply `tasks#advanced-elicitation` protocol]] - -This document outlines the complete fullstack architecture for {{Project Name}}, including backend systems, frontend implementation, and their integration. It serves as the single source of truth for AI-driven development, ensuring consistency across the entire technology stack. - -This unified approach combines what would traditionally be separate backend and frontend architecture documents, streamlining the development process for modern fullstack applications where these concerns are increasingly intertwined. - -### Starter Template or Existing Project - -[[LLM: Before proceeding with architecture design, check if the project is based on any starter templates or existing codebases: - -1. Review the PRD and other documents for mentions of: - -- Fullstack starter templates (e.g., T3 Stack, MEAN/MERN starters, Django + React templates) -- Monorepo templates (e.g., Nx, Turborepo starters) -- Platform-specific starters (e.g., Vercel templates, AWS Amplify starters) -- Existing projects being extended or cloned - -2. If starter templates or existing projects are mentioned: - -- Ask the user to provide access (links, repos, or files) -- Analyze to understand pre-configured choices and constraints -- Note any architectural decisions already made -- Identify what can be modified vs what must be retained - -3. If no starter is mentioned but this is greenfield: - -- Suggest appropriate fullstack starters based on tech preferences -- Consider platform-specific options (Vercel, AWS, etc.) -- Let user decide whether to use one - -4. Document the decision and any constraints it imposes - -If none, state "N/A - Greenfield project" - -### Change Log - -[[LLM: Track document versions and changes]] - -| Date | Version | Description | Author | -| :--- | :------ | :---------- | :----- | - -## High Level Architecture - -[[LLM: This section contains multiple subsections that establish the foundation. Present all subsections together, then apply `tasks#advanced-elicitation` protocol to the complete section.]] - -### Technical Summary - -[[LLM: Provide a comprehensive overview (4-6 sentences) covering: - -- Overall architectural style and deployment approach -- Frontend framework and backend technology choices -- Key integration points between frontend and backend -- Infrastructure platform and services -- How this architecture achieves PRD goals]] - -### Platform and Infrastructure Choice - -[[LLM: Based on PRD requirements and technical assumptions, make a platform recommendation: - -1. Consider common patterns (not an exhaustive list, use your own best judgement and search the web as needed for emerging trends): - - - **Vercel + Supabase**: For rapid development with Next.js, built-in auth/storage - - **AWS Full Stack**: For enterprise scale with Lambda, API Gateway, S3, Cognito - - **Azure**: For .NET ecosystems or enterprise Microsoft environments - - **Google Cloud**: For ML/AI heavy applications or Google ecosystem integration - -2. Present 2-3 viable options with clear pros/cons -3. Make a recommendation with rationale -4. Get explicit user confirmation - -Document the choice and key services that will be used.]] - -**Platform:** {{selected_platform}} -**Key Services:** {{core_services_list}} -**Deployment Host and Regions:** {{regions}} - -### Repository Structure - -[[LLM: Define the repository approach based on PRD requirements and platform choice, explain your rationale or ask quetsions to the user if unsure: - -1. For modern fullstack apps, monorepo is often preferred -2. Consider tooling (Nx, Turborepo, Lerna, npm workspaces) -3. Define package/app boundaries -4. Plan for shared code between frontend and backend]] - -**Structure:** {{repo_structure_choice}} -**Monorepo Tool:** {{monorepo_tool_if_applicable}} -**Package Organization:** {{package_strategy}} - -### High Level Architecture Diagram - -[[LLM: Create a Mermaid diagram showing the complete system architecture including: - -- User entry points (web, mobile) -- Frontend application deployment -- API layer (REST/GraphQL) -- Backend services -- Databases and storage -- External integrations -- CDN and caching layers - -Use appropriate diagram type for clarity.]] - -```mermaid -{{architecture_diagram}} -``` - -### Architectural Patterns - -[[LLM: List patterns that will guide both frontend and backend development. Include patterns for: - -- Overall architecture (e.g., Jamstack, Serverless, Microservices) -- Frontend patterns (e.g., Component-based, State management) -- Backend patterns (e.g., Repository, CQRS, Event-driven) -- Integration patterns (e.g., BFF, API Gateway) - -For each pattern, provide recommendation and rationale.]] - -<> - -- **{{pattern_name}}:** {{pattern_description}} - _Rationale:_ {{rationale}} - <> - -@{example: patterns} - -- **Jamstack Architecture:** Static site generation with serverless APIs - _Rationale:_ Optimal performance and scalability for content-heavy applications -- **Component-Based UI:** Reusable React components with TypeScript - _Rationale:_ Maintainability and type safety across large codebases -- **Repository Pattern:** Abstract data access logic - _Rationale:_ Enables testing and future database migration flexibility -- **API Gateway Pattern:** Single entry point for all API calls - _Rationale:_ Centralized auth, rate limiting, and monitoring - @{/example} - -## Tech Stack - -[[LLM: This is the DEFINITIVE technology selection for the entire project. Work with user to finalize all choices. This table is the single source of truth - all development must use these exact versions. - -Key areas to cover: - -- Frontend and backend languages/frameworks -- Databases and caching -- Authentication and authorization -- API approach -- Testing tools for both frontend and backend -- Build and deployment tools -- Monitoring and logging - -Upon render, apply `tasks#advanced-elicitation` display immediately.]] - -### Technology Stack Table - -| Category | Technology | Version | Purpose | Rationale | -| :----------------------- | :---------------- | :---------- | :---------- | :------------- | -| **Frontend Language** | {{fe_language}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **Frontend Framework** | {{fe_framework}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **UI Component Library** | {{ui_library}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **State Management** | {{state_mgmt}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **Backend Language** | {{be_language}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **Backend Framework** | {{be_framework}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **API Style** | {{api_style}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **Database** | {{database}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **Cache** | {{cache}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **File Storage** | {{storage}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **Authentication** | {{auth}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **Frontend Testing** | {{fe_test}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **Backend Testing** | {{be_test}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **E2E Testing** | {{e2e_test}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **Build Tool** | {{build_tool}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **Bundler** | {{bundler}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **IaC Tool** | {{iac_tool}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **CI/CD** | {{cicd}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **Monitoring** | {{monitoring}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **Logging** | {{logging}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **CSS Framework** | {{css_framework}} | {{version}} | {{purpose}} | {{why_chosen}} | - -@{example: tech_stack_rows} -| **Frontend Language** | TypeScript | 5.3.3 | Type-safe frontend development | Strong typing, excellent tooling | -| **Frontend Framework** | Next.js | 14.1.0 | React framework with SSR/SSG | SEO, performance, Vercel integration | -| **Backend Language** | TypeScript | 5.3.3 | Type-safe backend development | Code sharing with frontend | -| **API Style** | REST + tRPC | - | Type-safe API communication | End-to-end type safety | -| **Database** | PostgreSQL | 16.1 | Primary data store | ACID compliance, JSON support | -| **Authentication** | Supabase Auth | 2.39.0 | User authentication | Built-in auth flows, social providers | -@{/example} - -## Data Models - -[[LLM: Define the core data models/entities that will be shared between frontend and backend: - -1. Review PRD requirements and identify key business entities -2. For each model, explain its purpose and relationships -3. Include key attributes and data types -4. Show relationships between models -5. Create TypeScript interfaces that can be shared -6. Discuss design decisions with user - -Create a clear conceptual model before moving to database schema. - -After presenting all data models, apply `tasks#advanced-elicitation` protocol]] - -<> - -### {{model_name}} - -**Purpose:** {{model_purpose}} - -**Key Attributes:** - -- {{attribute_1}}: {{type_1}} - {{description_1}} -- {{attribute_2}}: {{type_2}} - {{description_2}} - -**TypeScript Interface:** - -```typescript -{ - { - model_interface; - } -} -``` - -**Relationships:** - -- {{relationship_1}} -- {{relationship_2}} - <> - -@{example: data_model} - -### User - -**Purpose:** Represents authenticated users in the system - -**Key Attributes:** - -- id: string - Unique identifier -- email: string - User's email address -- name: string - Display name -- role: enum - User permission level -- timestamps: Date - Created and updated times - -**TypeScript Interface:** - -```typescript -interface User { - id: string; - email: string; - name: string; - role: "admin" | "user" | "guest"; - createdAt: Date; - updatedAt: Date; - profile?: UserProfile; -} - -interface UserProfile { - avatarUrl?: string; - bio?: string; - preferences: Record; -} -``` - -**Relationships:** - -- Has many Posts (1:n) -- Has one Profile (1:1) - @{/example} - -## REST API Spec - -[[LLM: Based on the chosen API style from Tech Stack: - -1. If REST API, create an OpenAPI 3.0 specification -2. If GraphQL, provide the GraphQL schema -3. If tRPC, show router definitions -4. Include all endpoints from epics/stories -5. Define request/response schemas based on data models -6. Document authentication requirements -7. Include example requests/responses - -Use appropriate format for the chosen API style. If no API (e.g., static site), skip this section.]] - -^^CONDITION: has_rest_api^^ - -```yaml -openapi: 3.0.0 -info: - title: - '[object Object]': null - version: - '[object Object]': null - description: - '[object Object]': null -servers: - - url: - '[object Object]': null - description: - '[object Object]': null -``` - -^^/CONDITION: has_rest_api^^ - -^^CONDITION: has_graphql_api^^ - -```graphql -# GraphQL Schema -{{graphql_schema}} -``` - -^^/CONDITION: has_graphql_api^^ - -^^CONDITION: has_trpc_api^^ - -```typescript -// tRPC Router Definitions -{ - { - trpc_routers; - } -} -``` - -^^/CONDITION: has_trpc_api^^ - -[[LLM: After presenting the API spec (or noting its absence if not applicable), apply `tasks#advanced-elicitation` protocol]] - -## Components - -[[LLM: Based on the architectural patterns, tech stack, and data models from above: - -1. Identify major logical components/services across the fullstack -2. Consider both frontend and backend components -3. Define clear boundaries and interfaces between components -4. For each component, specify: - -- Primary responsibility -- Key interfaces/APIs exposed -- Dependencies on other components -- Technology specifics based on tech stack choices - -5. Create component diagrams where helpful -6. After presenting all components, apply `tasks#advanced-elicitation` protocol]] - -<> - -### {{component_name}} - -**Responsibility:** {{component_description}} - -**Key Interfaces:** - -- {{interface_1}} -- {{interface_2}} - -**Dependencies:** {{dependencies}} - -**Technology Stack:** {{component_tech_details}} -<> - -### Component Diagrams - -[[LLM: Create Mermaid diagrams to visualize component relationships. Options: - -- C4 Container diagram for high-level view -- Component diagram for detailed internal structure -- Sequence diagrams for complex interactions - Choose the most appropriate for clarity - -After presenting the diagrams, apply `tasks#advanced-elicitation` protocol]] - -## External APIs - -[[LLM: For each external service integration: - -1. Identify APIs needed based on PRD requirements and component design -2. If documentation URLs are unknown, ask user for specifics -3. Document authentication methods and security considerations -4. List specific endpoints that will be used -5. Note any rate limits or usage constraints - -If no external APIs are needed, state this explicitly and skip to next section.]] - -^^CONDITION: has_external_apis^^ - -<> - -### {{api_name}} API - -- **Purpose:** {{api_purpose}} -- **Documentation:** {{api_docs_url}} -- **Base URL(s):** {{api_base_url}} -- **Authentication:** {{auth_method}} -- **Rate Limits:** {{rate_limits}} - -**Key Endpoints Used:** -<> - -- `{{method}} {{endpoint_path}}` - {{endpoint_purpose}} - <> - -**Integration Notes:** {{integration_considerations}} -<> - -@{example: external_api} - -### Stripe API - -- **Purpose:** Payment processing and subscription management -- **Documentation:** https://stripe.com/docs/api -- **Base URL(s):** `https://api.stripe.com/v1` -- **Authentication:** Bearer token with secret key -- **Rate Limits:** 100 requests per second - -**Key Endpoints Used:** - -- `POST /customers` - Create customer profiles -- `POST /payment_intents` - Process payments -- `POST /subscriptions` - Manage subscriptions - @{/example} - -^^/CONDITION: has_external_apis^^ - -[[LLM: After presenting external APIs (or noting their absence), apply `tasks#advanced-elicitation` protocol]] - -## Core Workflows - -[[LLM: Illustrate key system workflows using sequence diagrams: - -1. Identify critical user journeys from PRD -2. Show component interactions including external APIs -3. Include both frontend and backend flows -4. Include error handling paths -5. Document async operations -6. Create both high-level and detailed diagrams as needed - -Focus on workflows that clarify architecture decisions or complex interactions. - -After presenting the workflow diagrams, apply `tasks#advanced-elicitation` protocol]] - -## Database Schema - -[[LLM: Transform the conceptual data models into concrete database schemas: - -1. Use the database type(s) selected in Tech Stack -2. Create schema definitions using appropriate notation -3. Include indexes, constraints, and relationships -4. Consider performance and scalability -5. For NoSQL, show document structures - -Present schema in format appropriate to database type (SQL DDL, JSON schema, etc.) - -After presenting the database schema, apply `tasks#advanced-elicitation` protocol]] - -## Frontend Architecture - -[[LLM: Define frontend-specific architecture details. After each subsection, note if user wants to refine before continuing. - -After presenting this section, apply `tasks#advanced-elicitation` protocol]] - -### Component Architecture - -[[LLM: Define component organization and patterns based on chosen framework.]] - -**Component Organization:** - -```text -{{component_structure}} -``` - -**Component Template:** - -```typescript -{ - { - component_template; - } -} -``` - -### State Management Architecture - -[[LLM: Detail state management approach based on chosen solution.]] - -**State Structure:** - -```typescript -{ - { - state_structure; - } -} -``` - -**State Management Patterns:** - -- {{pattern_1}} -- {{pattern_2}} - -### Routing Architecture - -[[LLM: Define routing structure based on framework choice.]] - -**Route Organization:** - -```text -{{route_structure}} -``` - -**Protected Route Pattern:** - -```typescript -{ - { - protected_route_example; - } -} -``` - -### Frontend Services Layer - -[[LLM: Define how frontend communicates with backend.]] - -**API Client Setup:** - -```typescript -{ - { - api_client_setup; - } -} -``` - -**Service Example:** - -```typescript -{ - { - service_example; - } -} -``` - -## Backend Architecture - -[[LLM: Define backend-specific architecture details. Consider serverless vs traditional server approaches. - -After presenting this section, apply `tasks#advanced-elicitation` protocol]] - -### Service Architecture - -[[LLM: Based on platform choice, define service organization.]] - -^^CONDITION: serverless^^ -**Function Organization:** - -```text - -{{function_structure}} - -``` - -**Function Template:** - -```typescript -{ - { - function_template; - } -} -``` - -^^/CONDITION: serverless^^ - -^^CONDITION: traditional_server^^ -**Controller/Route Organization:** - -```text -{{controller_structure}} -``` - -**Controller Template:** - -```typescript -{ - { - controller_template; - } -} -``` - -^^/CONDITION: traditional_server^^ - -### Database Architecture - -[[LLM: Define database schema and access patterns.]] - -**Schema Design:** - -```sql -{{database_schema}} -``` - -**Data Access Layer:** - -```typescript -{ - { - repository_pattern; - } -} -``` - -### Authentication and Authorization - -[[LLM: Define auth implementation details.]] - -**Auth Flow:** - -```mermaid -{{auth_flow_diagram}} -``` - -**Middleware/Guards:** - -```typescript -{ - { - auth_middleware; - } -} -``` - -## Unified Project Structure - -[[LLM: Create a monorepo structure that accommodates both frontend and backend. Adapt based on chosen tools and frameworks. After presenting, apply `tasks#advanced-elicitation` protocol.]] - -```plaintext -{{project-name}}/ -├── .github/ # CI/CD workflows -│ └── workflows/ -│ ├── ci.yaml -│ └── deploy.yaml -├── apps/ # Application packages -│ ├── web/ # Frontend application -│ │ ├── src/ -│ │ │ ├── components/ # UI components -│ │ │ ├── pages/ # Page components/routes -│ │ │ ├── hooks/ # Custom React hooks -│ │ │ ├── services/ # API client services -│ │ │ ├── stores/ # State management -│ │ │ ├── styles/ # Global styles/themes -│ │ │ └── utils/ # Frontend utilities -│ │ ├── public/ # Static assets -│ │ ├── tests/ # Frontend tests -│ │ └── package.json -│ └── api/ # Backend application -│ ├── src/ -│ │ ├── routes/ # API routes/controllers -│ │ ├── services/ # Business logic -│ │ ├── models/ # Data models -│ │ ├── middleware/ # Express/API middleware -│ │ ├── utils/ # Backend utilities -│ │ └── {{serverless_or_server_entry}} -│ ├── tests/ # Backend tests -│ └── package.json -├── packages/ # Shared packages -│ ├── shared/ # Shared types/utilities -│ │ ├── src/ -│ │ │ ├── types/ # TypeScript interfaces -│ │ │ ├── constants/ # Shared constants -│ │ │ └── utils/ # Shared utilities -│ │ └── package.json -│ ├── ui/ # Shared UI components -│ │ ├── src/ -│ │ └── package.json -│ └── config/ # Shared configuration -│ ├── eslint/ -│ ├── typescript/ -│ └── jest/ -├── infrastructure/ # IaC definitions -│ └── {{iac_structure}} -├── scripts/ # Build/deploy scripts -├── docs/ # Documentation -│ ├── prd.md -│ ├── front-end-spec.md -│ └── fullstack-architecture.md -├── .env.example # Environment template -├── package.json # Root package.json -├── {{monorepo_config}} # Monorepo configuration -└── README.md -``` - -@{example: vercel_structure} -apps/ -├── web/ # Next.js app -│ ├── app/ # App directory (Next.js 14+) -│ ├── components/ -│ └── lib/ -└── api/ # API routes in Next.js or separate -└── pages/api/ # API routes -@{/example} - -## Development Workflow - -[[LLM: Define the development setup and workflow for the fullstack application. - -After presenting this section, apply `tasks#advanced-elicitation` protocol]] - -### Local Development Setup - -**Prerequisites:** - -```bash -{{prerequisites_commands}} -``` - -**Initial Setup:** - -```bash -{{setup_commands}} -``` - -**Development Commands:** - -```bash -# Start all services -{{start_all_command}} - -# Start frontend only -{{start_frontend_command}} - -# Start backend only -{{start_backend_command}} - -# Run tests -{{test_commands}} -``` - -### Environment Configuration - -**Required Environment Variables:** - -```bash -# Frontend (.env.local) -{{frontend_env_vars}} - -# Backend (.env) -{{backend_env_vars}} - -# Shared -{{shared_env_vars}} -``` - -## Deployment Architecture - -[[LLM: Define deployment strategy based on platform choice. After presenting, apply `tasks#advanced-elicitation` protocol.]] - -### Deployment Strategy - -**Frontend Deployment:** - -- **Platform:** {{frontend_deploy_platform}} -- **Build Command:** {{frontend_build_command}} -- **Output Directory:** {{frontend_output_dir}} -- **CDN/Edge:** {{cdn_strategy}} - -**Backend Deployment:** - -- **Platform:** {{backend_deploy_platform}} -- **Build Command:** {{backend_build_command}} -- **Deployment Method:** {{deployment_method}} - -### CI/CD Pipeline - -```yaml -'[object Object]': null -``` - -### Environments - -| Environment | Frontend URL | Backend URL | Purpose | -| :---------- | :----------------- | :----------------- | :--------------------- | -| Development | {{dev_fe_url}} | {{dev_be_url}} | Local development | -| Staging | {{staging_fe_url}} | {{staging_be_url}} | Pre-production testing | -| Production | {{prod_fe_url}} | {{prod_be_url}} | Live environment | - -## Security and Performance - -[[LLM: Define security and performance considerations for the fullstack application. - -After presenting this section, apply `tasks#advanced-elicitation` protocol]] - -### Security Requirements - -**Frontend Security:** - -- CSP Headers: {{csp_policy}} -- XSS Prevention: {{xss_strategy}} -- Secure Storage: {{storage_strategy}} - -**Backend Security:** - -- Input Validation: {{validation_approach}} -- Rate Limiting: {{rate_limit_config}} -- CORS Policy: {{cors_config}} - -**Authentication Security:** - -- Token Storage: {{token_strategy}} -- Session Management: {{session_approach}} -- Password Policy: {{password_requirements}} - -### Performance Optimization - -**Frontend Performance:** - -- Bundle Size Target: {{bundle_size}} -- Loading Strategy: {{loading_approach}} -- Caching Strategy: {{fe_cache_strategy}} - -**Backend Performance:** - -- Response Time Target: {{response_target}} -- Database Optimization: {{db_optimization}} -- Caching Strategy: {{be_cache_strategy}} - -## Testing Strategy - -[[LLM: Define comprehensive testing approach for fullstack application. - -After presenting this section, apply `tasks#advanced-elicitation` protocol]] - -### Testing Pyramid - -```text - - E2E Tests - / \ - Integration Tests - -/ \ - Frontend Unit Backend Unit - -``` - -### Test Organization - -**Frontend Tests:** - -```text - -{{frontend_test_structure}} - -``` - -**Backend Tests:** - -```text - -{{backend_test_structure}} - -``` - -**E2E Tests:** - -```text - -{{e2e_test_structure}} - -``` - -### Test Examples - -**Frontend Component Test:** - -```typescript -{ - { - frontend_test_example; - } -} -``` - -**Backend API Test:** - -```typescript -{ - { - backend_test_example; - } -} -``` - -**E2E Test:** - -```typescript -{ - { - e2e_test_example; - } -} -``` - -## Coding Standards - -[[LLM: Define MINIMAL but CRITICAL standards for AI agents. Focus only on project-specific rules that prevent common mistakes. These will be used by dev agents. - -After presenting this section, apply `tasks#advanced-elicitation` protocol]] - -### Critical Fullstack Rules - -<> - -- **{{rule_name}}:** {{rule_description}} - <> - -@{example: critical_rules} - -- **Type Sharing:** Always define types in packages/shared and import from there -- **API Calls:** Never make direct HTTP calls - use the service layer -- **Environment Variables:** Access only through config objects, never process.env directly -- **Error Handling:** All API routes must use the standard error handler -- **State Updates:** Never mutate state directly - use proper state management patterns - @{/example} - -### Naming Conventions - -| Element | Frontend | Backend | Example | -| :-------------- | :------------------- | :--------- | :------------------ | -| Components | PascalCase | - | `UserProfile.tsx` | -| Hooks | camelCase with 'use' | - | `useAuth.ts` | -| API Routes | - | kebab-case | `/api/user-profile` | -| Database Tables | - | snake_case | `user_profiles` | - -## Error Handling Strategy - -[[LLM: Define unified error handling across frontend and backend. - -After presenting this section, apply `tasks#advanced-elicitation` protocol]] - -### Error Flow - -```mermaid -{{error_flow_diagram}} -``` - -### Error Response Format - -```typescript -interface ApiError { - error: { - code: string; - message: string; - details?: Record; - timestamp: string; - requestId: string; - }; -} -``` - -### Frontend Error Handling - -```typescript -{ - { - frontend_error_handler; - } -} -``` - -### Backend Error Handling - -```typescript -{ - { - backend_error_handler; - } -} -``` - -## Monitoring and Observability - -[[LLM: Define monitoring strategy for fullstack application. - -After presenting this section, apply `tasks#advanced-elicitation` protocol]] - -### Monitoring Stack - -- **Frontend Monitoring:** {{frontend_monitoring}} -- **Backend Monitoring:** {{backend_monitoring}} -- **Error Tracking:** {{error_tracking}} -- **Performance Monitoring:** {{perf_monitoring}} - -### Key Metrics - -**Frontend Metrics:** - -- Core Web Vitals -- JavaScript errors -- API response times -- User interactions - -**Backend Metrics:** - -- Request rate -- Error rate -- Response time -- Database query performance - -## Checklist Results Report - -[[LLM: Before running the checklist, offer to output the full architecture document. Once user confirms, execute the `architect-checklist` and populate results here.]] -==================== END: .bmad-core/templates/fullstack-architecture-tmpl.md ==================== - -==================== START: .bmad-core/templates/brownfield-architecture-tmpl.md ==================== -# {{Project Name}} Brownfield Enhancement Architecture - -[[LLM: The default path and filename unless specified is docs/architecture.md]] - -[[LLM: IMPORTANT - SCOPE AND ASSESSMENT REQUIRED: - -This architecture document is for SIGNIFICANT enhancements to existing projects that require comprehensive architectural planning. Before proceeding: - -1. **Verify Complexity**: Confirm this enhancement requires architectural planning. For simple additions, recommend: "For simpler changes that don't require architectural planning, consider using the brownfield-create-epic or brownfield-create-story task with the Product Owner instead." - -2. **REQUIRED INPUTS**: - - - Completed brownfield-prd.md - - Existing project technical documentation (from docs folder or user-provided) - - Access to existing project structure (IDE or uploaded files) - -3. **DEEP ANALYSIS MANDATE**: You MUST conduct thorough analysis of the existing codebase, architecture patterns, and technical constraints before making ANY architectural recommendations. Every suggestion must be based on actual project analysis, not assumptions. - -4. **CONTINUOUS VALIDATION**: Throughout this process, explicitly validate your understanding with the user. For every architectural decision, confirm: "Based on my analysis of your existing system, I recommend [decision] because [evidence from actual project]. Does this align with your system's reality?" - -If any required inputs are missing, request them before proceeding.]] - -## Introduction - -[[LLM: This section establishes the document's purpose and scope for brownfield enhancements. Keep the content below but ensure project name and enhancement details are properly substituted. - -After presenting this section, apply `tasks#advanced-elicitation` protocol]] - -This document outlines the architectural approach for enhancing {{Project Name}} with {{Enhancement Description}}. Its primary goal is to serve as the guiding architectural blueprint for AI-driven development of new features while ensuring seamless integration with the existing system. - -**Relationship to Existing Architecture:** -This document supplements existing project architecture by defining how new components will integrate with current systems. Where conflicts arise between new and existing patterns, this document provides guidance on maintaining consistency while implementing enhancements. - -### Existing Project Analysis - -[[LLM: Analyze the existing project structure and architecture: - -1. Review existing documentation in docs folder -2. Examine current technology stack and versions -3. Identify existing architectural patterns and conventions -4. Note current deployment and infrastructure setup -5. Document any constraints or limitations - -CRITICAL: After your analysis, explicitly validate your findings: "Based on my analysis of your project, I've identified the following about your existing system: [key findings]. Please confirm these observations are accurate before I proceed with architectural recommendations." - -Present findings and apply `tasks#advanced-elicitation` protocol]] - -**Current Project State:** - -- **Primary Purpose:** {{existing_project_purpose}} -- **Current Tech Stack:** {{existing_tech_summary}} -- **Architecture Style:** {{existing_architecture_style}} -- **Deployment Method:** {{existing_deployment_approach}} - -**Available Documentation:** - -- {{existing_docs_summary}} - -**Identified Constraints:** - -- {{constraint_1}} -- {{constraint_2}} -- {{constraint_3}} - -### Change Log - -| Change | Date | Version | Description | Author | -| ------ | ---- | ------- | ----------- | ------ | - -## Enhancement Scope and Integration Strategy - -[[LLM: Define how the enhancement will integrate with the existing system: - -1. Review the brownfield PRD enhancement scope -2. Identify integration points with existing code -3. Define boundaries between new and existing functionality -4. Establish compatibility requirements - -VALIDATION CHECKPOINT: Before presenting the integration strategy, confirm: "Based on my analysis, the integration approach I'm proposing takes into account [specific existing system characteristics]. These integration points and boundaries respect your current architecture patterns. Is this assessment accurate?" - -Present complete integration strategy and apply `tasks#advanced-elicitation` protocol]] - -### Enhancement Overview - -**Enhancement Type:** {{enhancement_type}} -**Scope:** {{enhancement_scope}} -**Integration Impact:** {{integration_impact_level}} - -### Integration Approach - -**Code Integration Strategy:** {{code_integration_approach}} -**Database Integration:** {{database_integration_approach}} -**API Integration:** {{api_integration_approach}} -**UI Integration:** {{ui_integration_approach}} - -### Compatibility Requirements - -- **Existing API Compatibility:** {{api_compatibility}} -- **Database Schema Compatibility:** {{db_compatibility}} -- **UI/UX Consistency:** {{ui_compatibility}} -- **Performance Impact:** {{performance_constraints}} - -## Tech Stack Alignment - -[[LLM: Ensure new components align with existing technology choices: - -1. Use existing technology stack as the foundation -2. Only introduce new technologies if absolutely necessary -3. Justify any new additions with clear rationale -4. Ensure version compatibility with existing dependencies - -Present complete tech stack alignment and apply `tasks#advanced-elicitation` protocol]] - -### Existing Technology Stack - -[[LLM: Document the current stack that must be maintained or integrated with]] - -| Category | Current Technology | Version | Usage in Enhancement | Notes | -| :----------------- | :----------------- | :---------- | :------------------- | :-------- | -| **Language** | {{language}} | {{version}} | {{usage}} | {{notes}} | -| **Runtime** | {{runtime}} | {{version}} | {{usage}} | {{notes}} | -| **Framework** | {{framework}} | {{version}} | {{usage}} | {{notes}} | -| **Database** | {{database}} | {{version}} | {{usage}} | {{notes}} | -| **API Style** | {{api_style}} | {{version}} | {{usage}} | {{notes}} | -| **Authentication** | {{auth}} | {{version}} | {{usage}} | {{notes}} | -| **Testing** | {{test_framework}} | {{version}} | {{usage}} | {{notes}} | -| **Build Tool** | {{build_tool}} | {{version}} | {{usage}} | {{notes}} | - -### New Technology Additions - -[[LLM: Only include if new technologies are required for the enhancement]] - -^^CONDITION: has_new_tech^^ - -| Technology | Version | Purpose | Rationale | Integration Method | -| :----------- | :---------- | :---------- | :------------ | :----------------- | -| {{new_tech}} | {{version}} | {{purpose}} | {{rationale}} | {{integration}} | - -^^/CONDITION: has_new_tech^^ - -## Data Models and Schema Changes - -[[LLM: Define new data models and how they integrate with existing schema: - -1. Identify new entities required for the enhancement -2. Define relationships with existing data models -3. Plan database schema changes (additions, modifications) -4. Ensure backward compatibility - -Present data model changes and apply `tasks#advanced-elicitation` protocol]] - -### New Data Models - -<> - -### {{model_name}} - -**Purpose:** {{model_purpose}} -**Integration:** {{integration_with_existing}} - -**Key Attributes:** - -- {{attribute_1}}: {{type_1}} - {{description_1}} -- {{attribute_2}}: {{type_2}} - {{description_2}} - -**Relationships:** - -- **With Existing:** {{existing_relationships}} -- **With New:** {{new_relationships}} - -<> - -### Schema Integration Strategy - -**Database Changes Required:** - -- **New Tables:** {{new_tables_list}} -- **Modified Tables:** {{modified_tables_list}} -- **New Indexes:** {{new_indexes_list}} -- **Migration Strategy:** {{migration_approach}} - -**Backward Compatibility:** - -- {{compatibility_measure_1}} -- {{compatibility_measure_2}} - -## Component Architecture - -[[LLM: Define new components and their integration with existing architecture: - -1. Identify new components required for the enhancement -2. Define interfaces with existing components -3. Establish clear boundaries and responsibilities -4. Plan integration points and data flow - -MANDATORY VALIDATION: Before presenting component architecture, confirm: "The new components I'm proposing follow the existing architectural patterns I identified in your codebase: [specific patterns]. The integration interfaces respect your current component structure and communication patterns. Does this match your project's reality?" - -Present component architecture and apply `tasks#advanced-elicitation` protocol]] - -### New Components - -<> - -### {{component_name}} - -**Responsibility:** {{component_description}} -**Integration Points:** {{integration_points}} - -**Key Interfaces:** - -- {{interface_1}} -- {{interface_2}} - -**Dependencies:** - -- **Existing Components:** {{existing_dependencies}} -- **New Components:** {{new_dependencies}} - -**Technology Stack:** {{component_tech_details}} - -<> - -### Component Interaction Diagram - -[[LLM: Create Mermaid diagram showing how new components interact with existing ones]] - -```mermaid -{{component_interaction_diagram}} -``` - -## API Design and Integration - -[[LLM: Define new API endpoints and integration with existing APIs: - -1. Plan new API endpoints required for the enhancement -2. Ensure consistency with existing API patterns -3. Define authentication and authorization integration -4. Plan versioning strategy if needed - -Present API design and apply `tasks#advanced-elicitation` protocol]] - -### New API Endpoints - -^^CONDITION: has_new_api^^ - -**API Integration Strategy:** {{api_integration_strategy}} -**Authentication:** {{auth_integration}} -**Versioning:** {{versioning_approach}} - -<> - -#### {{endpoint_name}} - -- **Method:** {{http_method}} -- **Endpoint:** {{endpoint_path}} -- **Purpose:** {{endpoint_purpose}} -- **Integration:** {{integration_with_existing}} - -**Request:** - -```json -{{request_schema}} -``` - -**Response:** - -```json -{{response_schema}} -``` - -<> - -^^/CONDITION: has_new_api^^ - -## External API Integration - -[[LLM: Document new external API integrations required for the enhancement]] - -^^CONDITION: has_new_external_apis^^ - -<> - -### {{api_name}} API - -- **Purpose:** {{api_purpose}} -- **Documentation:** {{api_docs_url}} -- **Base URL:** {{api_base_url}} -- **Authentication:** {{auth_method}} -- **Integration Method:** {{integration_approach}} - -**Key Endpoints Used:** - -- `{{method}} {{endpoint_path}}` - {{endpoint_purpose}} - -**Error Handling:** {{error_handling_strategy}} - -<> - -^^/CONDITION: has_new_external_apis^^ - -## Source Tree Integration - -[[LLM: Define how new code will integrate with existing project structure: - -1. Follow existing project organization patterns -2. Identify where new files/folders will be placed -3. Ensure consistency with existing naming conventions -4. Plan for minimal disruption to existing structure - -Present integration plan and apply `tasks#advanced-elicitation` protocol]] - -### Existing Project Structure - -[[LLM: Document relevant parts of current structure]] - -```plaintext -{{existing_structure_relevant_parts}} -``` - -### New File Organization - -[[LLM: Show only new additions to existing structure]] - -```plaintext -{{project-root}}/ -├── {{existing_structure_context}} -│ ├── {{new_folder_1}}/ # {{purpose_1}} -│ │ ├── {{new_file_1}} -│ │ └── {{new_file_2}} -│ ├── {{existing_folder}}/ # Existing folder with additions -│ │ ├── {{existing_file}} # Existing file -│ │ └── {{new_file_3}} # New addition -│ └── {{new_folder_2}}/ # {{purpose_2}} -``` - -### Integration Guidelines - -- **File Naming:** {{file_naming_consistency}} -- **Folder Organization:** {{folder_organization_approach}} -- **Import/Export Patterns:** {{import_export_consistency}} - -## Infrastructure and Deployment Integration - -[[LLM: Define how the enhancement will be deployed alongside existing infrastructure: - -1. Use existing deployment pipeline and infrastructure -2. Identify any infrastructure changes needed -3. Plan deployment strategy to minimize risk -4. Define rollback procedures - -Present deployment integration and apply `tasks#advanced-elicitation` protocol]] - -### Existing Infrastructure - -**Current Deployment:** {{existing_deployment_summary}} -**Infrastructure Tools:** {{existing_infrastructure_tools}} -**Environments:** {{existing_environments}} - -### Enhancement Deployment Strategy - -**Deployment Approach:** {{deployment_approach}} -**Infrastructure Changes:** {{infrastructure_changes}} -**Pipeline Integration:** {{pipeline_integration}} - -### Rollback Strategy - -**Rollback Method:** {{rollback_method}} -**Risk Mitigation:** {{risk_mitigation}} -**Monitoring:** {{monitoring_approach}} - -## Coding Standards and Conventions - -[[LLM: Ensure new code follows existing project conventions: - -1. Document existing coding standards from project analysis -2. Identify any enhancement-specific requirements -3. Ensure consistency with existing codebase patterns -4. Define standards for new code organization - -Present coding standards and apply `tasks#advanced-elicitation` protocol]] - -### Existing Standards Compliance - -**Code Style:** {{existing_code_style}} -**Linting Rules:** {{existing_linting}} -**Testing Patterns:** {{existing_test_patterns}} -**Documentation Style:** {{existing_doc_style}} - -### Enhancement-Specific Standards - -[[LLM: Only include if new patterns are needed for the enhancement]] - -<> - -- **{{standard_name}}:** {{standard_description}} - -<> - -### Critical Integration Rules - -- **Existing API Compatibility:** {{api_compatibility_rule}} -- **Database Integration:** {{db_integration_rule}} -- **Error Handling:** {{error_handling_integration}} -- **Logging Consistency:** {{logging_consistency}} - -## Testing Strategy - -[[LLM: Define testing approach for the enhancement: - -1. Integrate with existing test suite -2. Ensure existing functionality remains intact -3. Plan for testing new features -4. Define integration testing approach - -Present testing strategy and apply `tasks#advanced-elicitation` protocol]] - -### Integration with Existing Tests - -**Existing Test Framework:** {{existing_test_framework}} -**Test Organization:** {{existing_test_organization}} -**Coverage Requirements:** {{existing_coverage_requirements}} - -### New Testing Requirements - -#### Unit Tests for New Components - -- **Framework:** {{test_framework}} -- **Location:** {{test_location}} -- **Coverage Target:** {{coverage_target}} -- **Integration with Existing:** {{test_integration}} - -#### Integration Tests - -- **Scope:** {{integration_test_scope}} -- **Existing System Verification:** {{existing_system_verification}} -- **New Feature Testing:** {{new_feature_testing}} - -#### Regression Testing - -- **Existing Feature Verification:** {{regression_test_approach}} -- **Automated Regression Suite:** {{automated_regression}} -- **Manual Testing Requirements:** {{manual_testing_requirements}} - -## Security Integration - -[[LLM: Ensure security consistency with existing system: - -1. Follow existing security patterns and tools -2. Ensure new features don't introduce vulnerabilities -3. Maintain existing security posture -4. Define security testing for new components - -Present security integration and apply `tasks#advanced-elicitation` protocol]] - -### Existing Security Measures - -**Authentication:** {{existing_auth}} -**Authorization:** {{existing_authz}} -**Data Protection:** {{existing_data_protection}} -**Security Tools:** {{existing_security_tools}} - -### Enhancement Security Requirements - -**New Security Measures:** {{new_security_measures}} -**Integration Points:** {{security_integration_points}} -**Compliance Requirements:** {{compliance_requirements}} - -### Security Testing - -**Existing Security Tests:** {{existing_security_tests}} -**New Security Test Requirements:** {{new_security_tests}} -**Penetration Testing:** {{pentest_requirements}} - -## Risk Assessment and Mitigation - -[[LLM: Identify and plan for risks specific to brownfield development: - -1. Technical integration risks -2. Deployment and operational risks -3. User impact and compatibility risks -4. Mitigation strategies for each risk - -Present risk assessment and apply `tasks#advanced-elicitation` protocol]] - -### Technical Risks - -<> - -**Risk:** {{risk_description}} -**Impact:** {{impact_level}} -**Likelihood:** {{likelihood}} -**Mitigation:** {{mitigation_strategy}} - -<> - -### Operational Risks - -<> - -**Risk:** {{risk_description}} -**Impact:** {{impact_level}} -**Likelihood:** {{likelihood}} -**Mitigation:** {{mitigation_strategy}} - -<> - -### Monitoring and Alerting - -**Enhanced Monitoring:** {{monitoring_additions}} -**New Alerts:** {{new_alerts}} -**Performance Monitoring:** {{performance_monitoring}} - -## Checklist Results Report - -[[LLM: Execute the architect-checklist and populate results here, focusing on brownfield-specific validation]] - -## Next Steps - -[[LLM: After completing the brownfield architecture: - -1. Review integration points with existing system -2. Begin story implementation with Dev agent -3. Set up deployment pipeline integration -4. Plan rollback and monitoring procedures]] - -### Story Manager Handoff - -[[LLM: Create a brief prompt for Story Manager to work with this brownfield enhancement. Include: - -- Reference to this architecture document -- Key integration requirements validated with user -- Existing system constraints based on actual project analysis -- First story to implement with clear integration checkpoints -- Emphasis on maintaining existing system integrity throughout implementation]] - -### Developer Handoff - -[[LLM: Create a brief prompt for developers starting implementation. Include: - -- Reference to this architecture and existing coding standards analyzed from actual project -- Integration requirements with existing codebase validated with user -- Key technical decisions based on real project constraints -- Existing system compatibility requirements with specific verification steps -- Clear sequencing of implementation to minimize risk to existing functionality]] -==================== END: .bmad-core/templates/brownfield-architecture-tmpl.md ==================== +==================== START: .bmad-core/templates/front-end-spec-tmpl.yaml ==================== +template: + id: frontend-spec-template-v2 + name: UI/UX Specification + version: 2.0 + output: + format: markdown + filename: docs/front-end-spec.md + title: "{{project_name}} UI/UX Specification" + +workflow: + mode: interactive + elicitation: advanced-elicitation + +sections: + - id: introduction + title: Introduction + instruction: | + Review provided documents including Project Brief, PRD, and any user research to gather context. Focus on understanding user needs, pain points, and desired outcomes before beginning the specification. + + Establish the document's purpose and scope. Keep the content below but ensure project name is properly substituted. + content: | + This document defines the user experience goals, information architecture, user flows, and visual design specifications for {{project_name}}'s user interface. It serves as the foundation for visual design and frontend development, ensuring a cohesive and user-centered experience. + sections: + - id: ux-goals-principles + title: Overall UX Goals & Principles + instruction: | + Work with the user to establish and document the following. If not already defined, facilitate a discussion to determine: + + 1. Target User Personas - elicit details or confirm existing ones from PRD + 2. Key Usability Goals - understand what success looks like for users + 3. Core Design Principles - establish 3-5 guiding principles + elicit: true + sections: + - id: user-personas + title: Target User Personas + template: "{{persona_descriptions}}" + examples: + - "**Power User:** Technical professionals who need advanced features and efficiency" + - "**Casual User:** Occasional users who prioritize ease of use and clear guidance" + - "**Administrator:** System managers who need control and oversight capabilities" + - id: usability-goals + title: Usability Goals + template: "{{usability_goals}}" + examples: + - "Ease of learning: New users can complete core tasks within 5 minutes" + - "Efficiency of use: Power users can complete frequent tasks with minimal clicks" + - "Error prevention: Clear validation and confirmation for destructive actions" + - "Memorability: Infrequent users can return without relearning" + - id: design-principles + title: Design Principles + template: "{{design_principles}}" + type: numbered-list + examples: + - "**Clarity over cleverness** - Prioritize clear communication over aesthetic innovation" + - "**Progressive disclosure** - Show only what's needed, when it's needed" + - "**Consistent patterns** - Use familiar UI patterns throughout the application" + - "**Immediate feedback** - Every action should have a clear, immediate response" + - "**Accessible by default** - Design for all users from the start" + - id: changelog + title: Change Log + type: table + columns: [Date, Version, Description, Author] + instruction: Track document versions and changes + + - id: information-architecture + title: Information Architecture (IA) + instruction: | + Collaborate with the user to create a comprehensive information architecture: + + 1. Build a Site Map or Screen Inventory showing all major areas + 2. Define the Navigation Structure (primary, secondary, breadcrumbs) + 3. Use Mermaid diagrams for visual representation + 4. Consider user mental models and expected groupings + elicit: true + sections: + - id: sitemap + title: Site Map / Screen Inventory + type: mermaid + mermaid_type: graph + template: "{{sitemap_diagram}}" + examples: + - | + graph TD + A[Homepage] --> B[Dashboard] + A --> C[Products] + A --> D[Account] + B --> B1[Analytics] + B --> B2[Recent Activity] + C --> C1[Browse] + C --> C2[Search] + C --> C3[Product Details] + D --> D1[Profile] + D --> D2[Settings] + D --> D3[Billing] + - id: navigation-structure + title: Navigation Structure + template: | + **Primary Navigation:** {{primary_nav_description}} + + **Secondary Navigation:** {{secondary_nav_description}} + + **Breadcrumb Strategy:** {{breadcrumb_strategy}} + + - id: user-flows + title: User Flows + instruction: | + For each critical user task identified in the PRD: + + 1. Define the user's goal clearly + 2. Map out all steps including decision points + 3. Consider edge cases and error states + 4. Use Mermaid flow diagrams for clarity + 5. Link to external tools (Figma/Miro) if detailed flows exist there + + Create subsections for each major flow. + elicit: true + repeatable: true + sections: + - id: flow + title: "{{flow_name}}" + template: | + **User Goal:** {{flow_goal}} + + **Entry Points:** {{entry_points}} + + **Success Criteria:** {{success_criteria}} + sections: + - id: flow-diagram + title: Flow Diagram + type: mermaid + mermaid_type: graph + template: "{{flow_diagram}}" + - id: edge-cases + title: "Edge Cases & Error Handling:" + type: bullet-list + template: "- {{edge_case}}" + - id: notes + template: "**Notes:** {{flow_notes}}" + + - id: wireframes-mockups + title: Wireframes & Mockups + instruction: | + Clarify where detailed visual designs will be created (Figma, Sketch, etc.) and how to reference them. If low-fidelity wireframes are needed, offer to help conceptualize layouts for key screens. + elicit: true + sections: + - id: design-files + template: "**Primary Design Files:** {{design_tool_link}}" + - id: key-screen-layouts + title: Key Screen Layouts + repeatable: true + sections: + - id: screen + title: "{{screen_name}}" + template: | + **Purpose:** {{screen_purpose}} + + **Key Elements:** + - {{element_1}} + - {{element_2}} + - {{element_3}} + + **Interaction Notes:** {{interaction_notes}} + + **Design File Reference:** {{specific_frame_link}} + + - id: component-library + title: Component Library / Design System + instruction: | + Discuss whether to use an existing design system or create a new one. If creating new, identify foundational components and their key states. Note that detailed technical specs belong in front-end-architecture. + elicit: true + sections: + - id: design-system-approach + template: "**Design System Approach:** {{design_system_approach}}" + - id: core-components + title: Core Components + repeatable: true + sections: + - id: component + title: "{{component_name}}" + template: | + **Purpose:** {{component_purpose}} + + **Variants:** {{component_variants}} + + **States:** {{component_states}} + + **Usage Guidelines:** {{usage_guidelines}} + + - id: branding-style + title: Branding & Style Guide + instruction: Link to existing style guide or define key brand elements. Ensure consistency with company brand guidelines if they exist. + elicit: true + sections: + - id: visual-identity + title: Visual Identity + template: "**Brand Guidelines:** {{brand_guidelines_link}}" + - id: color-palette + title: Color Palette + type: table + columns: ["Color Type", "Hex Code", "Usage"] + rows: + - ["Primary", "{{primary_color}}", "{{primary_usage}}"] + - ["Secondary", "{{secondary_color}}", "{{secondary_usage}}"] + - ["Accent", "{{accent_color}}", "{{accent_usage}}"] + - ["Success", "{{success_color}}", "Positive feedback, confirmations"] + - ["Warning", "{{warning_color}}", "Cautions, important notices"] + - ["Error", "{{error_color}}", "Errors, destructive actions"] + - ["Neutral", "{{neutral_colors}}", "Text, borders, backgrounds"] + - id: typography + title: Typography + sections: + - id: font-families + title: Font Families + template: | + - **Primary:** {{primary_font}} + - **Secondary:** {{secondary_font}} + - **Monospace:** {{mono_font}} + - id: type-scale + title: Type Scale + type: table + columns: ["Element", "Size", "Weight", "Line Height"] + rows: + - ["H1", "{{h1_size}}", "{{h1_weight}}", "{{h1_line}}"] + - ["H2", "{{h2_size}}", "{{h2_weight}}", "{{h2_line}}"] + - ["H3", "{{h3_size}}", "{{h3_weight}}", "{{h3_line}}"] + - ["Body", "{{body_size}}", "{{body_weight}}", "{{body_line}}"] + - ["Small", "{{small_size}}", "{{small_weight}}", "{{small_line}}"] + - id: iconography + title: Iconography + template: | + **Icon Library:** {{icon_library}} + + **Usage Guidelines:** {{icon_guidelines}} + - id: spacing-layout + title: Spacing & Layout + template: | + **Grid System:** {{grid_system}} + + **Spacing Scale:** {{spacing_scale}} + + - id: accessibility + title: Accessibility Requirements + instruction: Define specific accessibility requirements based on target compliance level and user needs. Be comprehensive but practical. + elicit: true + sections: + - id: compliance-target + title: Compliance Target + template: "**Standard:** {{compliance_standard}}" + - id: key-requirements + title: Key Requirements + template: | + **Visual:** + - Color contrast ratios: {{contrast_requirements}} + - Focus indicators: {{focus_requirements}} + - Text sizing: {{text_requirements}} + + **Interaction:** + - Keyboard navigation: {{keyboard_requirements}} + - Screen reader support: {{screen_reader_requirements}} + - Touch targets: {{touch_requirements}} + + **Content:** + - Alternative text: {{alt_text_requirements}} + - Heading structure: {{heading_requirements}} + - Form labels: {{form_requirements}} + - id: testing-strategy + title: Testing Strategy + template: "{{accessibility_testing}}" + + - id: responsiveness + title: Responsiveness Strategy + instruction: Define breakpoints and adaptation strategies for different device sizes. Consider both technical constraints and user contexts. + elicit: true + sections: + - id: breakpoints + title: Breakpoints + type: table + columns: ["Breakpoint", "Min Width", "Max Width", "Target Devices"] + rows: + - ["Mobile", "{{mobile_min}}", "{{mobile_max}}", "{{mobile_devices}}"] + - ["Tablet", "{{tablet_min}}", "{{tablet_max}}", "{{tablet_devices}}"] + - ["Desktop", "{{desktop_min}}", "{{desktop_max}}", "{{desktop_devices}}"] + - ["Wide", "{{wide_min}}", "-", "{{wide_devices}}"] + - id: adaptation-patterns + title: Adaptation Patterns + template: | + **Layout Changes:** {{layout_adaptations}} + + **Navigation Changes:** {{nav_adaptations}} + + **Content Priority:** {{content_adaptations}} + + **Interaction Changes:** {{interaction_adaptations}} + + - id: animation + title: Animation & Micro-interactions + instruction: Define motion design principles and key interactions. Keep performance and accessibility in mind. + elicit: true + sections: + - id: motion-principles + title: Motion Principles + template: "{{motion_principles}}" + - id: key-animations + title: Key Animations + repeatable: true + template: "- **{{animation_name}}:** {{animation_description}} (Duration: {{duration}}, Easing: {{easing}})" + + - id: performance + title: Performance Considerations + instruction: Define performance goals and strategies that impact UX design decisions. + sections: + - id: performance-goals + title: Performance Goals + template: | + - **Page Load:** {{load_time_goal}} + - **Interaction Response:** {{interaction_goal}} + - **Animation FPS:** {{animation_goal}} + - id: design-strategies + title: Design Strategies + template: "{{performance_strategies}}" + + - id: next-steps + title: Next Steps + instruction: | + After completing the UI/UX specification: + + 1. Recommend review with stakeholders + 2. Suggest creating/updating visual designs in design tool + 3. Prepare for handoff to Design Architect for frontend architecture + 4. Note any open questions or decisions needed + sections: + - id: immediate-actions + title: Immediate Actions + type: numbered-list + template: "{{action}}" + - id: design-handoff-checklist + title: Design Handoff Checklist + type: checklist + items: + - "All user flows documented" + - "Component inventory complete" + - "Accessibility requirements defined" + - "Responsive strategy clear" + - "Brand guidelines incorporated" + - "Performance goals established" + + - id: checklist-results + title: Checklist Results + instruction: If a UI/UX checklist exists, run it against this document and report results here. +==================== END: .bmad-core/templates/front-end-spec-tmpl.yaml ==================== + +==================== START: .bmad-core/templates/architecture-tmpl.yaml ==================== +template: + id: architecture-template-v2 + name: Architecture Document + version: 2.0 + output: + format: markdown + filename: docs/architecture.md + title: "{{project_name}} Architecture Document" + +workflow: + mode: interactive + elicitation: advanced-elicitation + +sections: + - id: introduction + title: Introduction + instruction: | + If available, review any provided relevant documents to gather all relevant context before beginning. If at a minimum you cannot locate docs/prd.md ask the user what docs will provide the basis for the architecture. + sections: + - id: intro-content + content: | + This document outlines the overall project architecture for {{project_name}}, including backend systems, shared services, and non-UI specific concerns. Its primary goal is to serve as the guiding architectural blueprint for AI-driven development, ensuring consistency and adherence to chosen patterns and technologies. + + **Relationship to Frontend Architecture:** + If the project includes a significant user interface, a separate Frontend Architecture Document will detail the frontend-specific design and MUST be used in conjunction with this document. Core technology stack choices documented herein (see "Tech Stack") are definitive for the entire project, including any frontend components. + - id: starter-template + title: Starter Template or Existing Project + instruction: | + Before proceeding further with architecture design, check if the project is based on a starter template or existing codebase: + + 1. Review the PRD and brainstorming brief for any mentions of: + - Starter templates (e.g., Create React App, Next.js, Vue CLI, Angular CLI, etc.) + - Existing projects or codebases being used as a foundation + - Boilerplate projects or scaffolding tools + - Previous projects to be cloned or adapted + + 2. If a starter template or existing project is mentioned: + - Ask the user to provide access via one of these methods: + - Link to the starter template documentation + - Upload/attach the project files (for small projects) + - Share a link to the project repository (GitHub, GitLab, etc.) + - Analyze the starter/existing project to understand: + - Pre-configured technology stack and versions + - Project structure and organization patterns + - Built-in scripts and tooling + - Existing architectural patterns and conventions + - Any limitations or constraints imposed by the starter + - Use this analysis to inform and align your architecture decisions + + 3. If no starter template is mentioned but this is a greenfield project: + - Suggest appropriate starter templates based on the tech stack preferences + - Explain the benefits (faster setup, best practices, community support) + - Let the user decide whether to use one + + 4. If the user confirms no starter template will be used: + - Proceed with architecture design from scratch + - Note that manual setup will be required for all tooling and configuration + + Document the decision here before proceeding with the architecture design. If none, just say N/A + elicit: true + - id: changelog + title: Change Log + type: table + columns: [Date, Version, Description, Author] + instruction: Track document versions and changes + + - id: high-level-architecture + title: High Level Architecture + instruction: | + This section contains multiple subsections that establish the foundation of the architecture. Present all subsections together at once. + elicit: true + sections: + - id: technical-summary + title: Technical Summary + instruction: | + Provide a brief paragraph (3-5 sentences) overview of: + - The system's overall architecture style + - Key components and their relationships + - Primary technology choices + - Core architectural patterns being used + - Reference back to the PRD goals and how this architecture supports them + - id: high-level-overview + title: High Level Overview + instruction: | + Based on the PRD's Technical Assumptions section, describe: + + 1. The main architectural style (e.g., Monolith, Microservices, Serverless, Event-Driven) + 2. Repository structure decision from PRD (Monorepo/Polyrepo) + 3. Service architecture decision from PRD + 4. Primary user interaction flow or data flow at a conceptual level + 5. Key architectural decisions and their rationale + - id: project-diagram + title: High Level Project Diagram + type: mermaid + mermaid_type: graph + instruction: | + Create a Mermaid diagram that visualizes the high-level architecture. Consider: + - System boundaries + - Major components/services + - Data flow directions + - External integrations + - User entry points + + - id: architectural-patterns + title: Architectural and Design Patterns + instruction: | + List the key high-level patterns that will guide the architecture. For each pattern: + + 1. Present 2-3 viable options if multiple exist + 2. Provide your recommendation with clear rationale + 3. Get user confirmation before finalizing + 4. These patterns should align with the PRD's technical assumptions and project goals + + Common patterns to consider: + - Architectural style patterns (Serverless, Event-Driven, Microservices, CQRS, Hexagonal) + - Code organization patterns (Dependency Injection, Repository, Module, Factory) + - Data patterns (Event Sourcing, Saga, Database per Service) + - Communication patterns (REST, GraphQL, Message Queue, Pub/Sub) + template: "- **{{pattern_name}}:** {{pattern_description}} - _Rationale:_ {{rationale}}" + examples: + - "**Serverless Architecture:** Using AWS Lambda for compute - _Rationale:_ Aligns with PRD requirement for cost optimization and automatic scaling" + - "**Repository Pattern:** Abstract data access logic - _Rationale:_ Enables testing and future database migration flexibility" + - "**Event-Driven Communication:** Using SNS/SQS for service decoupling - _Rationale:_ Supports async processing and system resilience" + + - id: tech-stack + title: Tech Stack + instruction: | + This is the DEFINITIVE technology selection section. Work with the user to make specific choices: + + 1. Review PRD technical assumptions and any preferences from .bmad-core/data/technical-preferences.yaml or an attached technical-preferences + 2. For each category, present 2-3 viable options with pros/cons + 3. Make a clear recommendation based on project needs + 4. Get explicit user approval for each selection + 5. Document exact versions (avoid "latest" - pin specific versions) + 6. This table is the single source of truth - all other docs must reference these choices + + Key decisions to finalize - before displaying the table, ensure you are aware of or ask the user about - let the user know if they are not sure on any that you can also provide suggestions with rationale: + + - Starter templates (if any) + - Languages and runtimes with exact versions + - Frameworks and libraries / packages + - Cloud provider and key services choices + - Database and storage solutions - if unclear suggest sql or nosql or other types depending on the project and depending on cloud provider offer a suggestion + - Development tools + + Upon render of the table, ensure the user is aware of the importance of this sections choices, should also look for gaps or disagreements with anything, ask for any clarifications if something is unclear why its in the list, and also right away elicit feedback - this statement and the options should be rendered and then prompt right all before allowing user input. + elicit: true + sections: + - id: cloud-infrastructure + title: Cloud Infrastructure + template: | + - **Provider:** {{cloud_provider}} + - **Key Services:** {{core_services_list}} + - **Deployment Regions:** {{regions}} + - id: technology-stack-table + title: Technology Stack Table + type: table + columns: [Category, Technology, Version, Purpose, Rationale] + instruction: Populate the technology stack table with all relevant technologies + examples: + - "| **Language** | TypeScript | 5.3.3 | Primary development language | Strong typing, excellent tooling, team expertise |" + - "| **Runtime** | Node.js | 20.11.0 | JavaScript runtime | LTS version, stable performance, wide ecosystem |" + - "| **Framework** | NestJS | 10.3.2 | Backend framework | Enterprise-ready, good DI, matches team patterns |" + + - id: data-models + title: Data Models + instruction: | + Define the core data models/entities: + + 1. Review PRD requirements and identify key business entities + 2. For each model, explain its purpose and relationships + 3. Include key attributes and data types + 4. Show relationships between models + 5. Discuss design decisions with user + + Create a clear conceptual model before moving to database schema. + elicit: true + repeatable: true + sections: + - id: model + title: "{{model_name}}" + template: | + **Purpose:** {{model_purpose}} + + **Key Attributes:** + - {{attribute_1}}: {{type_1}} - {{description_1}} + - {{attribute_2}}: {{type_2}} - {{description_2}} + + **Relationships:** + - {{relationship_1}} + - {{relationship_2}} + + - id: components + title: Components + instruction: | + Based on the architectural patterns, tech stack, and data models from above: + + 1. Identify major logical components/services and their responsibilities + 2. Consider the repository structure (monorepo/polyrepo) from PRD + 3. Define clear boundaries and interfaces between components + 4. For each component, specify: + - Primary responsibility + - Key interfaces/APIs exposed + - Dependencies on other components + - Technology specifics based on tech stack choices + + 5. Create component diagrams where helpful + elicit: true + sections: + - id: component-list + repeatable: true + title: "{{component_name}}" + template: | + **Responsibility:** {{component_description}} + + **Key Interfaces:** + - {{interface_1}} + - {{interface_2}} + + **Dependencies:** {{dependencies}} + + **Technology Stack:** {{component_tech_details}} + - id: component-diagrams + title: Component Diagrams + type: mermaid + instruction: | + Create Mermaid diagrams to visualize component relationships. Options: + - C4 Container diagram for high-level view + - Component diagram for detailed internal structure + - Sequence diagrams for complex interactions + Choose the most appropriate for clarity + + - id: external-apis + title: External APIs + condition: Project requires external API integrations + instruction: | + For each external service integration: + + 1. Identify APIs needed based on PRD requirements and component design + 2. If documentation URLs are unknown, ask user for specifics + 3. Document authentication methods and security considerations + 4. List specific endpoints that will be used + 5. Note any rate limits or usage constraints + + If no external APIs are needed, state this explicitly and skip to next section. + elicit: true + repeatable: true + sections: + - id: api + title: "{{api_name}} API" + template: | + - **Purpose:** {{api_purpose}} + - **Documentation:** {{api_docs_url}} + - **Base URL(s):** {{api_base_url}} + - **Authentication:** {{auth_method}} + - **Rate Limits:** {{rate_limits}} + + **Key Endpoints Used:** + - `{{method}} {{endpoint_path}}` - {{endpoint_purpose}} + + **Integration Notes:** {{integration_considerations}} + + - id: core-workflows + title: Core Workflows + type: mermaid + mermaid_type: sequence + instruction: | + Illustrate key system workflows using sequence diagrams: + + 1. Identify critical user journeys from PRD + 2. Show component interactions including external APIs + 3. Include error handling paths + 4. Document async operations + 5. Create both high-level and detailed diagrams as needed + + Focus on workflows that clarify architecture decisions or complex interactions. + elicit: true + + - id: rest-api-spec + title: REST API Spec + condition: Project includes REST API + type: code + language: yaml + instruction: | + If the project includes a REST API: + + 1. Create an OpenAPI 3.0 specification + 2. Include all endpoints from epics/stories + 3. Define request/response schemas based on data models + 4. Document authentication requirements + 5. Include example requests/responses + + Use YAML format for better readability. If no REST API, skip this section. + elicit: true + template: | + openapi: 3.0.0 + info: + title: {{api_title}} + version: {{api_version}} + description: {{api_description}} + servers: + - url: {{server_url}} + description: {{server_description}} + + - id: database-schema + title: Database Schema + instruction: | + Transform the conceptual data models into concrete database schemas: + + 1. Use the database type(s) selected in Tech Stack + 2. Create schema definitions using appropriate notation + 3. Include indexes, constraints, and relationships + 4. Consider performance and scalability + 5. For NoSQL, show document structures + + Present schema in format appropriate to database type (SQL DDL, JSON schema, etc.) + elicit: true + + - id: source-tree + title: Source Tree + type: code + language: plaintext + instruction: | + Create a project folder structure that reflects: + + 1. The chosen repository structure (monorepo/polyrepo) + 2. The service architecture (monolith/microservices/serverless) + 3. The selected tech stack and languages + 4. Component organization from above + 5. Best practices for the chosen frameworks + 6. Clear separation of concerns + + Adapt the structure based on project needs. For monorepos, show service separation. For serverless, show function organization. Include language-specific conventions. + elicit: true + examples: + - | + project-root/ + ├── packages/ + │ ├── api/ # Backend API service + │ ├── web/ # Frontend application + │ ├── shared/ # Shared utilities/types + │ └── infrastructure/ # IaC definitions + ├── scripts/ # Monorepo management scripts + └── package.json # Root package.json with workspaces + + - id: infrastructure-deployment + title: Infrastructure and Deployment + instruction: | + Define the deployment architecture and practices: + + 1. Use IaC tool selected in Tech Stack + 2. Choose deployment strategy appropriate for the architecture + 3. Define environments and promotion flow + 4. Establish rollback procedures + 5. Consider security, monitoring, and cost optimization + + Get user input on deployment preferences and CI/CD tool choices. + elicit: true + sections: + - id: infrastructure-as-code + title: Infrastructure as Code + template: | + - **Tool:** {{iac_tool}} {{version}} + - **Location:** `{{iac_directory}}` + - **Approach:** {{iac_approach}} + - id: deployment-strategy + title: Deployment Strategy + template: | + - **Strategy:** {{deployment_strategy}} + - **CI/CD Platform:** {{cicd_platform}} + - **Pipeline Configuration:** `{{pipeline_config_location}}` + - id: environments + title: Environments + repeatable: true + template: "- **{{env_name}}:** {{env_purpose}} - {{env_details}}" + - id: promotion-flow + title: Environment Promotion Flow + type: code + language: text + template: "{{promotion_flow_diagram}}" + - id: rollback-strategy + title: Rollback Strategy + template: | + - **Primary Method:** {{rollback_method}} + - **Trigger Conditions:** {{rollback_triggers}} + - **Recovery Time Objective:** {{rto}} + + - id: error-handling-strategy + title: Error Handling Strategy + instruction: | + Define comprehensive error handling approach: + + 1. Choose appropriate patterns for the language/framework from Tech Stack + 2. Define logging standards and tools + 3. Establish error categories and handling rules + 4. Consider observability and debugging needs + 5. Ensure security (no sensitive data in logs) + + This section guides both AI and human developers in consistent error handling. + elicit: true + sections: + - id: general-approach + title: General Approach + template: | + - **Error Model:** {{error_model}} + - **Exception Hierarchy:** {{exception_structure}} + - **Error Propagation:** {{propagation_rules}} + - id: logging-standards + title: Logging Standards + template: | + - **Library:** {{logging_library}} {{version}} + - **Format:** {{log_format}} + - **Levels:** {{log_levels_definition}} + - **Required Context:** + - Correlation ID: {{correlation_id_format}} + - Service Context: {{service_context}} + - User Context: {{user_context_rules}} + - id: error-patterns + title: Error Handling Patterns + sections: + - id: external-api-errors + title: External API Errors + template: | + - **Retry Policy:** {{retry_strategy}} + - **Circuit Breaker:** {{circuit_breaker_config}} + - **Timeout Configuration:** {{timeout_settings}} + - **Error Translation:** {{error_mapping_rules}} + - id: business-logic-errors + title: Business Logic Errors + template: | + - **Custom Exceptions:** {{business_exception_types}} + - **User-Facing Errors:** {{user_error_format}} + - **Error Codes:** {{error_code_system}} + - id: data-consistency + title: Data Consistency + template: | + - **Transaction Strategy:** {{transaction_approach}} + - **Compensation Logic:** {{compensation_patterns}} + - **Idempotency:** {{idempotency_approach}} + + - id: coding-standards + title: Coding Standards + instruction: | + These standards are MANDATORY for AI agents. Work with user to define ONLY the critical rules needed to prevent bad code. Explain that: + + 1. This section directly controls AI developer behavior + 2. Keep it minimal - assume AI knows general best practices + 3. Focus on project-specific conventions and gotchas + 4. Overly detailed standards bloat context and slow development + 5. Standards will be extracted to separate file for dev agent use + + For each standard, get explicit user confirmation it's necessary. + elicit: true + sections: + - id: core-standards + title: Core Standards + template: | + - **Languages & Runtimes:** {{languages_and_versions}} + - **Style & Linting:** {{linter_config}} + - **Test Organization:** {{test_file_convention}} + - id: naming-conventions + title: Naming Conventions + type: table + columns: [Element, Convention, Example] + instruction: Only include if deviating from language defaults + - id: critical-rules + title: Critical Rules + instruction: | + List ONLY rules that AI might violate or project-specific requirements. Examples: + - "Never use console.log in production code - use logger" + - "All API responses must use ApiResponse wrapper type" + - "Database queries must use repository pattern, never direct ORM" + + Avoid obvious rules like "use SOLID principles" or "write clean code" + repeatable: true + template: "- **{{rule_name}}:** {{rule_description}}" + - id: language-specifics + title: Language-Specific Guidelines + condition: Critical language-specific rules needed + instruction: Add ONLY if critical for preventing AI mistakes. Most teams don't need this section. + sections: + - id: language-rules + title: "{{language_name}} Specifics" + repeatable: true + template: "- **{{rule_topic}}:** {{rule_detail}}" + + - id: test-strategy + title: Test Strategy and Standards + instruction: | + Work with user to define comprehensive test strategy: + + 1. Use test frameworks from Tech Stack + 2. Decide on TDD vs test-after approach + 3. Define test organization and naming + 4. Establish coverage goals + 5. Determine integration test infrastructure + 6. Plan for test data and external dependencies + + Note: Basic info goes in Coding Standards for dev agent. This detailed section is for QA agent and team reference. + elicit: true + sections: + - id: testing-philosophy + title: Testing Philosophy + template: | + - **Approach:** {{test_approach}} + - **Coverage Goals:** {{coverage_targets}} + - **Test Pyramid:** {{test_distribution}} + - id: test-types + title: Test Types and Organization + sections: + - id: unit-tests + title: Unit Tests + template: | + - **Framework:** {{unit_test_framework}} {{version}} + - **File Convention:** {{unit_test_naming}} + - **Location:** {{unit_test_location}} + - **Mocking Library:** {{mocking_library}} + - **Coverage Requirement:** {{unit_coverage}} + + **AI Agent Requirements:** + - Generate tests for all public methods + - Cover edge cases and error conditions + - Follow AAA pattern (Arrange, Act, Assert) + - Mock all external dependencies + - id: integration-tests + title: Integration Tests + template: | + - **Scope:** {{integration_scope}} + - **Location:** {{integration_test_location}} + - **Test Infrastructure:** + - **{{dependency_name}}:** {{test_approach}} ({{test_tool}}) + examples: + - "**Database:** In-memory H2 for unit tests, Testcontainers PostgreSQL for integration" + - "**Message Queue:** Embedded Kafka for tests" + - "**External APIs:** WireMock for stubbing" + - id: e2e-tests + title: End-to-End Tests + template: | + - **Framework:** {{e2e_framework}} {{version}} + - **Scope:** {{e2e_scope}} + - **Environment:** {{e2e_environment}} + - **Test Data:** {{e2e_data_strategy}} + - id: test-data-management + title: Test Data Management + template: | + - **Strategy:** {{test_data_approach}} + - **Fixtures:** {{fixture_location}} + - **Factories:** {{factory_pattern}} + - **Cleanup:** {{cleanup_strategy}} + - id: continuous-testing + title: Continuous Testing + template: | + - **CI Integration:** {{ci_test_stages}} + - **Performance Tests:** {{perf_test_approach}} + - **Security Tests:** {{security_test_approach}} + + - id: security + title: Security + instruction: | + Define MANDATORY security requirements for AI and human developers: + + 1. Focus on implementation-specific rules + 2. Reference security tools from Tech Stack + 3. Define clear patterns for common scenarios + 4. These rules directly impact code generation + 5. Work with user to ensure completeness without redundancy + elicit: true + sections: + - id: input-validation + title: Input Validation + template: | + - **Validation Library:** {{validation_library}} + - **Validation Location:** {{where_to_validate}} + - **Required Rules:** + - All external inputs MUST be validated + - Validation at API boundary before processing + - Whitelist approach preferred over blacklist + - id: auth-authorization + title: Authentication & Authorization + template: | + - **Auth Method:** {{auth_implementation}} + - **Session Management:** {{session_approach}} + - **Required Patterns:** + - {{auth_pattern_1}} + - {{auth_pattern_2}} + - id: secrets-management + title: Secrets Management + template: | + - **Development:** {{dev_secrets_approach}} + - **Production:** {{prod_secrets_service}} + - **Code Requirements:** + - NEVER hardcode secrets + - Access via configuration service only + - No secrets in logs or error messages + - id: api-security + title: API Security + template: | + - **Rate Limiting:** {{rate_limit_implementation}} + - **CORS Policy:** {{cors_configuration}} + - **Security Headers:** {{required_headers}} + - **HTTPS Enforcement:** {{https_approach}} + - id: data-protection + title: Data Protection + template: | + - **Encryption at Rest:** {{encryption_at_rest}} + - **Encryption in Transit:** {{encryption_in_transit}} + - **PII Handling:** {{pii_rules}} + - **Logging Restrictions:** {{what_not_to_log}} + - id: dependency-security + title: Dependency Security + template: | + - **Scanning Tool:** {{dependency_scanner}} + - **Update Policy:** {{update_frequency}} + - **Approval Process:** {{new_dep_process}} + - id: security-testing + title: Security Testing + template: | + - **SAST Tool:** {{static_analysis}} + - **DAST Tool:** {{dynamic_analysis}} + - **Penetration Testing:** {{pentest_schedule}} + + - id: checklist-results + title: Checklist Results Report + instruction: Before running the checklist, offer to output the full architecture document. Once user confirms, execute the architect-checklist and populate results here. + + - id: next-steps + title: Next Steps + instruction: | + After completing the architecture: + + 1. If project has UI components: + - Recommend engaging Design Architect agent + - Use "Frontend Architecture Mode" + - Provide this document as input + + 2. For all projects: + - Review with Product Owner + - Begin story implementation with Dev agent + - Set up infrastructure with DevOps agent + + 3. Include specific prompts for next agents if needed + sections: + - id: design-architect-prompt + title: Design Architect Prompt + condition: Project has UI components + instruction: | + Create a brief prompt to hand off to Design Architect for Frontend Architecture creation. Include: + - Reference to this architecture document + - Key UI requirements from PRD + - Any frontend-specific decisions made here + - Request for detailed frontend architecture + - id: developer-handoff + title: Developer Handoff + instruction: | + Create a brief prompt for developers starting implementation. Include: + - Reference to this architecture and coding standards + - First epic/story to implement + - Key technical decisions to follow +==================== END: .bmad-core/templates/architecture-tmpl.yaml ==================== + +==================== START: .bmad-core/templates/front-end-architecture-tmpl.yaml ==================== +template: + id: frontend-architecture-template-v2 + name: Frontend Architecture Document + version: 2.0 + output: + format: markdown + filename: docs/ui-architecture.md + title: "{{project_name}} Frontend Architecture Document" + +workflow: + mode: interactive + elicitation: advanced-elicitation + +sections: + - id: template-framework-selection + title: Template and Framework Selection + instruction: | + Review provided documents including PRD, UX-UI Specification, and main Architecture Document. Focus on extracting technical implementation details needed for AI frontend tools and developer agents. Ask the user for any of these documents if you are unable to locate and were not provided. + + Before proceeding with frontend architecture design, check if the project is using a frontend starter template or existing codebase: + + 1. Review the PRD, main architecture document, and brainstorming brief for mentions of: + - Frontend starter templates (e.g., Create React App, Next.js, Vite, Vue CLI, Angular CLI, etc.) + - UI kit or component library starters + - Existing frontend projects being used as a foundation + - Admin dashboard templates or other specialized starters + - Design system implementations + + 2. If a frontend starter template or existing project is mentioned: + - Ask the user to provide access via one of these methods: + - Link to the starter template documentation + - Upload/attach the project files (for small projects) + - Share a link to the project repository + - Analyze the starter/existing project to understand: + - Pre-installed dependencies and versions + - Folder structure and file organization + - Built-in components and utilities + - Styling approach (CSS modules, styled-components, Tailwind, etc.) + - State management setup (if any) + - Routing configuration + - Testing setup and patterns + - Build and development scripts + - Use this analysis to ensure your frontend architecture aligns with the starter's patterns + + 3. If no frontend starter is mentioned but this is a new UI, ensure we know what the ui language and framework is: + - Based on the framework choice, suggest appropriate starters: + - React: Create React App, Next.js, Vite + React + - Vue: Vue CLI, Nuxt.js, Vite + Vue + - Angular: Angular CLI + - Or suggest popular UI templates if applicable + - Explain benefits specific to frontend development + + 4. If the user confirms no starter template will be used: + - Note that all tooling, bundling, and configuration will need manual setup + - Proceed with frontend architecture from scratch + + Document the starter template decision and any constraints it imposes before proceeding. + sections: + - id: changelog + title: Change Log + type: table + columns: [Date, Version, Description, Author] + instruction: Track document versions and changes + + - id: frontend-tech-stack + title: Frontend Tech Stack + instruction: Extract from main architecture's Technology Stack Table. This section MUST remain synchronized with the main architecture document. + elicit: true + sections: + - id: tech-stack-table + title: Technology Stack Table + type: table + columns: [Category, Technology, Version, Purpose, Rationale] + instruction: Fill in appropriate technology choices based on the selected framework and project requirements. + rows: + - ["Framework", "{{framework}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] + - ["UI Library", "{{ui_library}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] + - ["State Management", "{{state_management}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] + - ["Routing", "{{routing_library}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] + - ["Build Tool", "{{build_tool}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] + - ["Styling", "{{styling_solution}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] + - ["Testing", "{{test_framework}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] + - ["Component Library", "{{component_lib}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] + - ["Form Handling", "{{form_library}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] + - ["Animation", "{{animation_lib}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] + - ["Dev Tools", "{{dev_tools}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] + + - id: project-structure + title: Project Structure + instruction: Define exact directory structure for AI tools based on the chosen framework. Be specific about where each type of file goes. Generate a structure that follows the framework's best practices and conventions. + elicit: true + type: code + language: plaintext + + - id: component-standards + title: Component Standards + instruction: Define exact patterns for component creation based on the chosen framework. + elicit: true + sections: + - id: component-template + title: Component Template + instruction: Generate a minimal but complete component template following the framework's best practices. Include TypeScript types, proper imports, and basic structure. + type: code + language: typescript + - id: naming-conventions + title: Naming Conventions + instruction: Provide naming conventions specific to the chosen framework for components, files, services, state management, and other architectural elements. + + - id: state-management + title: State Management + instruction: Define state management patterns based on the chosen framework. + elicit: true + sections: + - id: store-structure + title: Store Structure + instruction: Generate the state management directory structure appropriate for the chosen framework and selected state management solution. + type: code + language: plaintext + - id: state-template + title: State Management Template + instruction: Provide a basic state management template/example following the framework's recommended patterns. Include TypeScript types and common operations like setting, updating, and clearing state. + type: code + language: typescript + + - id: api-integration + title: API Integration + instruction: Define API service patterns based on the chosen framework. + elicit: true + sections: + - id: service-template + title: Service Template + instruction: Provide an API service template that follows the framework's conventions. Include proper TypeScript types, error handling, and async patterns. + type: code + language: typescript + - id: api-client-config + title: API Client Configuration + instruction: Show how to configure the HTTP client for the chosen framework, including authentication interceptors/middleware and error handling. + type: code + language: typescript + + - id: routing + title: Routing + instruction: Define routing structure and patterns based on the chosen framework. + elicit: true + sections: + - id: route-configuration + title: Route Configuration + instruction: Provide routing configuration appropriate for the chosen framework. Include protected route patterns, lazy loading where applicable, and authentication guards/middleware. + type: code + language: typescript + + - id: styling-guidelines + title: Styling Guidelines + instruction: Define styling approach based on the chosen framework. + elicit: true + sections: + - id: styling-approach + title: Styling Approach + instruction: Describe the styling methodology appropriate for the chosen framework (CSS Modules, Styled Components, Tailwind, etc.) and provide basic patterns. + - id: global-theme + title: Global Theme Variables + instruction: Provide a CSS custom properties (CSS variables) theme system that works across all frameworks. Include colors, spacing, typography, shadows, and dark mode support. + type: code + language: css + + - id: testing-requirements + title: Testing Requirements + instruction: Define minimal testing requirements based on the chosen framework. + elicit: true + sections: + - id: component-test-template + title: Component Test Template + instruction: Provide a basic component test template using the framework's recommended testing library. Include examples of rendering tests, user interaction tests, and mocking. + type: code + language: typescript + - id: testing-best-practices + title: Testing Best Practices + type: numbered-list + items: + - "**Unit Tests**: Test individual components in isolation" + - "**Integration Tests**: Test component interactions" + - "**E2E Tests**: Test critical user flows (using Cypress/Playwright)" + - "**Coverage Goals**: Aim for 80% code coverage" + - "**Test Structure**: Arrange-Act-Assert pattern" + - "**Mock External Dependencies**: API calls, routing, state management" + + - id: environment-configuration + title: Environment Configuration + instruction: List required environment variables based on the chosen framework. Show the appropriate format and naming conventions for the framework. + elicit: true + + - id: frontend-developer-standards + title: Frontend Developer Standards + sections: + - id: critical-coding-rules + title: Critical Coding Rules + instruction: List essential rules that prevent common AI mistakes, including both universal rules and framework-specific ones. + elicit: true + - id: quick-reference + title: Quick Reference + instruction: | + Create a framework-specific cheat sheet with: + - Common commands (dev server, build, test) + - Key import patterns + - File naming conventions + - Project-specific patterns and utilities +==================== END: .bmad-core/templates/front-end-architecture-tmpl.yaml ==================== + +==================== START: .bmad-core/templates/fullstack-architecture-tmpl.yaml ==================== +template: + id: fullstack-architecture-template-v2 + name: Fullstack Architecture Document + version: 2.0 + output: + format: markdown + filename: docs/architecture.md + title: "{{project_name}} Fullstack Architecture Document" + +workflow: + mode: interactive + elicitation: advanced-elicitation + +sections: + - id: introduction + title: Introduction + instruction: | + If available, review any provided relevant documents to gather all relevant context before beginning. At minimum, you should have access to docs/prd.md and docs/front-end-spec.md. Ask the user for any documents you need but cannot locate. This template creates a unified architecture that covers both backend and frontend concerns to guide AI-driven fullstack development. + elicit: true + content: | + This document outlines the complete fullstack architecture for {{project_name}}, including backend systems, frontend implementation, and their integration. It serves as the single source of truth for AI-driven development, ensuring consistency across the entire technology stack. + + This unified approach combines what would traditionally be separate backend and frontend architecture documents, streamlining the development process for modern fullstack applications where these concerns are increasingly intertwined. + sections: + - id: starter-template + title: Starter Template or Existing Project + instruction: | + Before proceeding with architecture design, check if the project is based on any starter templates or existing codebases: + + 1. Review the PRD and other documents for mentions of: + - Fullstack starter templates (e.g., T3 Stack, MEAN/MERN starters, Django + React templates) + - Monorepo templates (e.g., Nx, Turborepo starters) + - Platform-specific starters (e.g., Vercel templates, AWS Amplify starters) + - Existing projects being extended or cloned + + 2. If starter templates or existing projects are mentioned: + - Ask the user to provide access (links, repos, or files) + - Analyze to understand pre-configured choices and constraints + - Note any architectural decisions already made + - Identify what can be modified vs what must be retained + + 3. If no starter is mentioned but this is greenfield: + - Suggest appropriate fullstack starters based on tech preferences + - Consider platform-specific options (Vercel, AWS, etc.) + - Let user decide whether to use one + + 4. Document the decision and any constraints it imposes + + If none, state "N/A - Greenfield project" + - id: changelog + title: Change Log + type: table + columns: [Date, Version, Description, Author] + instruction: Track document versions and changes + + - id: high-level-architecture + title: High Level Architecture + instruction: This section contains multiple subsections that establish the foundation. Present all subsections together, then elicit feedback on the complete section. + elicit: true + sections: + - id: technical-summary + title: Technical Summary + instruction: | + Provide a comprehensive overview (4-6 sentences) covering: + - Overall architectural style and deployment approach + - Frontend framework and backend technology choices + - Key integration points between frontend and backend + - Infrastructure platform and services + - How this architecture achieves PRD goals + - id: platform-infrastructure + title: Platform and Infrastructure Choice + instruction: | + Based on PRD requirements and technical assumptions, make a platform recommendation: + + 1. Consider common patterns (not an exhaustive list, use your own best judgement and search the web as needed for emerging trends): + - **Vercel + Supabase**: For rapid development with Next.js, built-in auth/storage + - **AWS Full Stack**: For enterprise scale with Lambda, API Gateway, S3, Cognito + - **Azure**: For .NET ecosystems or enterprise Microsoft environments + - **Google Cloud**: For ML/AI heavy applications or Google ecosystem integration + + 2. Present 2-3 viable options with clear pros/cons + 3. Make a recommendation with rationale + 4. Get explicit user confirmation + + Document the choice and key services that will be used. + template: | + **Platform:** {{selected_platform}} + **Key Services:** {{core_services_list}} + **Deployment Host and Regions:** {{regions}} + - id: repository-structure + title: Repository Structure + instruction: | + Define the repository approach based on PRD requirements and platform choice, explain your rationale or ask questions to the user if unsure: + + 1. For modern fullstack apps, monorepo is often preferred + 2. Consider tooling (Nx, Turborepo, Lerna, npm workspaces) + 3. Define package/app boundaries + 4. Plan for shared code between frontend and backend + template: | + **Structure:** {{repo_structure_choice}} + **Monorepo Tool:** {{monorepo_tool_if_applicable}} + **Package Organization:** {{package_strategy}} + - id: architecture-diagram + title: High Level Architecture Diagram + type: mermaid + mermaid_type: graph + instruction: | + Create a Mermaid diagram showing the complete system architecture including: + - User entry points (web, mobile) + - Frontend application deployment + - API layer (REST/GraphQL) + - Backend services + - Databases and storage + - External integrations + - CDN and caching layers + + Use appropriate diagram type for clarity. + - id: architectural-patterns + title: Architectural Patterns + instruction: | + List patterns that will guide both frontend and backend development. Include patterns for: + - Overall architecture (e.g., Jamstack, Serverless, Microservices) + - Frontend patterns (e.g., Component-based, State management) + - Backend patterns (e.g., Repository, CQRS, Event-driven) + - Integration patterns (e.g., BFF, API Gateway) + + For each pattern, provide recommendation and rationale. + repeatable: true + template: "- **{{pattern_name}}:** {{pattern_description}} - _Rationale:_ {{rationale}}" + examples: + - "**Jamstack Architecture:** Static site generation with serverless APIs - _Rationale:_ Optimal performance and scalability for content-heavy applications" + - "**Component-Based UI:** Reusable React components with TypeScript - _Rationale:_ Maintainability and type safety across large codebases" + - "**Repository Pattern:** Abstract data access logic - _Rationale:_ Enables testing and future database migration flexibility" + - "**API Gateway Pattern:** Single entry point for all API calls - _Rationale:_ Centralized auth, rate limiting, and monitoring" + + - id: tech-stack + title: Tech Stack + instruction: | + This is the DEFINITIVE technology selection for the entire project. Work with user to finalize all choices. This table is the single source of truth - all development must use these exact versions. + + Key areas to cover: + - Frontend and backend languages/frameworks + - Databases and caching + - Authentication and authorization + - API approach + - Testing tools for both frontend and backend + - Build and deployment tools + - Monitoring and logging + + Upon render, elicit feedback immediately. + elicit: true + sections: + - id: tech-stack-table + title: Technology Stack Table + type: table + columns: [Category, Technology, Version, Purpose, Rationale] + rows: + - ["Frontend Language", "{{fe_language}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] + - ["Frontend Framework", "{{fe_framework}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] + - ["UI Component Library", "{{ui_library}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] + - ["State Management", "{{state_mgmt}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] + - ["Backend Language", "{{be_language}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] + - ["Backend Framework", "{{be_framework}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] + - ["API Style", "{{api_style}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] + - ["Database", "{{database}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] + - ["Cache", "{{cache}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] + - ["File Storage", "{{storage}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] + - ["Authentication", "{{auth}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] + - ["Frontend Testing", "{{fe_test}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] + - ["Backend Testing", "{{be_test}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] + - ["E2E Testing", "{{e2e_test}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] + - ["Build Tool", "{{build_tool}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] + - ["Bundler", "{{bundler}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] + - ["IaC Tool", "{{iac_tool}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] + - ["CI/CD", "{{cicd}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] + - ["Monitoring", "{{monitoring}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] + - ["Logging", "{{logging}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] + - ["CSS Framework", "{{css_framework}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] + + - id: data-models + title: Data Models + instruction: | + Define the core data models/entities that will be shared between frontend and backend: + + 1. Review PRD requirements and identify key business entities + 2. For each model, explain its purpose and relationships + 3. Include key attributes and data types + 4. Show relationships between models + 5. Create TypeScript interfaces that can be shared + 6. Discuss design decisions with user + + Create a clear conceptual model before moving to database schema. + elicit: true + repeatable: true + sections: + - id: model + title: "{{model_name}}" + template: | + **Purpose:** {{model_purpose}} + + **Key Attributes:** + - {{attribute_1}}: {{type_1}} - {{description_1}} + - {{attribute_2}}: {{type_2}} - {{description_2}} + sections: + - id: typescript-interface + title: TypeScript Interface + type: code + language: typescript + template: "{{model_interface}}" + - id: relationships + title: Relationships + type: bullet-list + template: "- {{relationship}}" + + - id: api-spec + title: API Specification + instruction: | + Based on the chosen API style from Tech Stack: + + 1. If REST API, create an OpenAPI 3.0 specification + 2. If GraphQL, provide the GraphQL schema + 3. If tRPC, show router definitions + 4. Include all endpoints from epics/stories + 5. Define request/response schemas based on data models + 6. Document authentication requirements + 7. Include example requests/responses + + Use appropriate format for the chosen API style. If no API (e.g., static site), skip this section. + elicit: true + sections: + - id: rest-api + title: REST API Specification + condition: API style is REST + type: code + language: yaml + template: | + openapi: 3.0.0 + info: + title: {{api_title}} + version: {{api_version}} + description: {{api_description}} + servers: + - url: {{server_url}} + description: {{server_description}} + - id: graphql-api + title: GraphQL Schema + condition: API style is GraphQL + type: code + language: graphql + template: "{{graphql_schema}}" + - id: trpc-api + title: tRPC Router Definitions + condition: API style is tRPC + type: code + language: typescript + template: "{{trpc_routers}}" + + - id: components + title: Components + instruction: | + Based on the architectural patterns, tech stack, and data models from above: + + 1. Identify major logical components/services across the fullstack + 2. Consider both frontend and backend components + 3. Define clear boundaries and interfaces between components + 4. For each component, specify: + - Primary responsibility + - Key interfaces/APIs exposed + - Dependencies on other components + - Technology specifics based on tech stack choices + + 5. Create component diagrams where helpful + elicit: true + sections: + - id: component-list + repeatable: true + title: "{{component_name}}" + template: | + **Responsibility:** {{component_description}} + + **Key Interfaces:** + - {{interface_1}} + - {{interface_2}} + + **Dependencies:** {{dependencies}} + + **Technology Stack:** {{component_tech_details}} + - id: component-diagrams + title: Component Diagrams + type: mermaid + instruction: | + Create Mermaid diagrams to visualize component relationships. Options: + - C4 Container diagram for high-level view + - Component diagram for detailed internal structure + - Sequence diagrams for complex interactions + Choose the most appropriate for clarity + + - id: external-apis + title: External APIs + condition: Project requires external API integrations + instruction: | + For each external service integration: + + 1. Identify APIs needed based on PRD requirements and component design + 2. If documentation URLs are unknown, ask user for specifics + 3. Document authentication methods and security considerations + 4. List specific endpoints that will be used + 5. Note any rate limits or usage constraints + + If no external APIs are needed, state this explicitly and skip to next section. + elicit: true + repeatable: true + sections: + - id: api + title: "{{api_name}} API" + template: | + - **Purpose:** {{api_purpose}} + - **Documentation:** {{api_docs_url}} + - **Base URL(s):** {{api_base_url}} + - **Authentication:** {{auth_method}} + - **Rate Limits:** {{rate_limits}} + + **Key Endpoints Used:** + - `{{method}} {{endpoint_path}}` - {{endpoint_purpose}} + + **Integration Notes:** {{integration_considerations}} + + - id: core-workflows + title: Core Workflows + type: mermaid + mermaid_type: sequence + instruction: | + Illustrate key system workflows using sequence diagrams: + + 1. Identify critical user journeys from PRD + 2. Show component interactions including external APIs + 3. Include both frontend and backend flows + 4. Include error handling paths + 5. Document async operations + 6. Create both high-level and detailed diagrams as needed + + Focus on workflows that clarify architecture decisions or complex interactions. + elicit: true + + - id: database-schema + title: Database Schema + instruction: | + Transform the conceptual data models into concrete database schemas: + + 1. Use the database type(s) selected in Tech Stack + 2. Create schema definitions using appropriate notation + 3. Include indexes, constraints, and relationships + 4. Consider performance and scalability + 5. For NoSQL, show document structures + + Present schema in format appropriate to database type (SQL DDL, JSON schema, etc.) + elicit: true + + - id: frontend-architecture + title: Frontend Architecture + instruction: Define frontend-specific architecture details. After each subsection, note if user wants to refine before continuing. + elicit: true + sections: + - id: component-architecture + title: Component Architecture + instruction: Define component organization and patterns based on chosen framework. + sections: + - id: component-organization + title: Component Organization + type: code + language: text + template: "{{component_structure}}" + - id: component-template + title: Component Template + type: code + language: typescript + template: "{{component_template}}" + - id: state-management + title: State Management Architecture + instruction: Detail state management approach based on chosen solution. + sections: + - id: state-structure + title: State Structure + type: code + language: typescript + template: "{{state_structure}}" + - id: state-patterns + title: State Management Patterns + type: bullet-list + template: "- {{pattern}}" + - id: routing-architecture + title: Routing Architecture + instruction: Define routing structure based on framework choice. + sections: + - id: route-organization + title: Route Organization + type: code + language: text + template: "{{route_structure}}" + - id: protected-routes + title: Protected Route Pattern + type: code + language: typescript + template: "{{protected_route_example}}" + - id: frontend-services + title: Frontend Services Layer + instruction: Define how frontend communicates with backend. + sections: + - id: api-client-setup + title: API Client Setup + type: code + language: typescript + template: "{{api_client_setup}}" + - id: service-example + title: Service Example + type: code + language: typescript + template: "{{service_example}}" + + - id: backend-architecture + title: Backend Architecture + instruction: Define backend-specific architecture details. Consider serverless vs traditional server approaches. + elicit: true + sections: + - id: service-architecture + title: Service Architecture + instruction: Based on platform choice, define service organization. + sections: + - id: serverless-architecture + condition: Serverless architecture chosen + sections: + - id: function-organization + title: Function Organization + type: code + language: text + template: "{{function_structure}}" + - id: function-template + title: Function Template + type: code + language: typescript + template: "{{function_template}}" + - id: traditional-server + condition: Traditional server architecture chosen + sections: + - id: controller-organization + title: Controller/Route Organization + type: code + language: text + template: "{{controller_structure}}" + - id: controller-template + title: Controller Template + type: code + language: typescript + template: "{{controller_template}}" + - id: database-architecture + title: Database Architecture + instruction: Define database schema and access patterns. + sections: + - id: schema-design + title: Schema Design + type: code + language: sql + template: "{{database_schema}}" + - id: data-access-layer + title: Data Access Layer + type: code + language: typescript + template: "{{repository_pattern}}" + - id: auth-architecture + title: Authentication and Authorization + instruction: Define auth implementation details. + sections: + - id: auth-flow + title: Auth Flow + type: mermaid + mermaid_type: sequence + template: "{{auth_flow_diagram}}" + - id: auth-middleware + title: Middleware/Guards + type: code + language: typescript + template: "{{auth_middleware}}" + + - id: unified-project-structure + title: Unified Project Structure + instruction: Create a monorepo structure that accommodates both frontend and backend. Adapt based on chosen tools and frameworks. + elicit: true + type: code + language: plaintext + examples: + - | + {{project-name}}/ + ├── .github/ # CI/CD workflows + │ └── workflows/ + │ ├── ci.yaml + │ └── deploy.yaml + ├── apps/ # Application packages + │ ├── web/ # Frontend application + │ │ ├── src/ + │ │ │ ├── components/ # UI components + │ │ │ ├── pages/ # Page components/routes + │ │ │ ├── hooks/ # Custom React hooks + │ │ │ ├── services/ # API client services + │ │ │ ├── stores/ # State management + │ │ │ ├── styles/ # Global styles/themes + │ │ │ └── utils/ # Frontend utilities + │ │ ├── public/ # Static assets + │ │ ├── tests/ # Frontend tests + │ │ └── package.json + │ └── api/ # Backend application + │ ├── src/ + │ │ ├── routes/ # API routes/controllers + │ │ ├── services/ # Business logic + │ │ ├── models/ # Data models + │ │ ├── middleware/ # Express/API middleware + │ │ ├── utils/ # Backend utilities + │ │ └── {{serverless_or_server_entry}} + │ ├── tests/ # Backend tests + │ └── package.json + ├── packages/ # Shared packages + │ ├── shared/ # Shared types/utilities + │ │ ├── src/ + │ │ │ ├── types/ # TypeScript interfaces + │ │ │ ├── constants/ # Shared constants + │ │ │ └── utils/ # Shared utilities + │ │ └── package.json + │ ├── ui/ # Shared UI components + │ │ ├── src/ + │ │ └── package.json + │ └── config/ # Shared configuration + │ ├── eslint/ + │ ├── typescript/ + │ └── jest/ + ├── infrastructure/ # IaC definitions + │ └── {{iac_structure}} + ├── scripts/ # Build/deploy scripts + ├── docs/ # Documentation + │ ├── prd.md + │ ├── front-end-spec.md + │ └── fullstack-architecture.md + ├── .env.example # Environment template + ├── package.json # Root package.json + ├── {{monorepo_config}} # Monorepo configuration + └── README.md + + - id: development-workflow + title: Development Workflow + instruction: Define the development setup and workflow for the fullstack application. + elicit: true + sections: + - id: local-setup + title: Local Development Setup + sections: + - id: prerequisites + title: Prerequisites + type: code + language: bash + template: "{{prerequisites_commands}}" + - id: initial-setup + title: Initial Setup + type: code + language: bash + template: "{{setup_commands}}" + - id: dev-commands + title: Development Commands + type: code + language: bash + template: | + # Start all services + {{start_all_command}} + + # Start frontend only + {{start_frontend_command}} + + # Start backend only + {{start_backend_command}} + + # Run tests + {{test_commands}} + - id: environment-config + title: Environment Configuration + sections: + - id: env-vars + title: Required Environment Variables + type: code + language: bash + template: | + # Frontend (.env.local) + {{frontend_env_vars}} + + # Backend (.env) + {{backend_env_vars}} + + # Shared + {{shared_env_vars}} + + - id: deployment-architecture + title: Deployment Architecture + instruction: Define deployment strategy based on platform choice. + elicit: true + sections: + - id: deployment-strategy + title: Deployment Strategy + template: | + **Frontend Deployment:** + - **Platform:** {{frontend_deploy_platform}} + - **Build Command:** {{frontend_build_command}} + - **Output Directory:** {{frontend_output_dir}} + - **CDN/Edge:** {{cdn_strategy}} + + **Backend Deployment:** + - **Platform:** {{backend_deploy_platform}} + - **Build Command:** {{backend_build_command}} + - **Deployment Method:** {{deployment_method}} + - id: cicd-pipeline + title: CI/CD Pipeline + type: code + language: yaml + template: "{{cicd_pipeline_config}}" + - id: environments + title: Environments + type: table + columns: [Environment, Frontend URL, Backend URL, Purpose] + rows: + - ["Development", "{{dev_fe_url}}", "{{dev_be_url}}", "Local development"] + - ["Staging", "{{staging_fe_url}}", "{{staging_be_url}}", "Pre-production testing"] + - ["Production", "{{prod_fe_url}}", "{{prod_be_url}}", "Live environment"] + + - id: security-performance + title: Security and Performance + instruction: Define security and performance considerations for the fullstack application. + elicit: true + sections: + - id: security-requirements + title: Security Requirements + template: | + **Frontend Security:** + - CSP Headers: {{csp_policy}} + - XSS Prevention: {{xss_strategy}} + - Secure Storage: {{storage_strategy}} + + **Backend Security:** + - Input Validation: {{validation_approach}} + - Rate Limiting: {{rate_limit_config}} + - CORS Policy: {{cors_config}} + + **Authentication Security:** + - Token Storage: {{token_strategy}} + - Session Management: {{session_approach}} + - Password Policy: {{password_requirements}} + - id: performance-optimization + title: Performance Optimization + template: | + **Frontend Performance:** + - Bundle Size Target: {{bundle_size}} + - Loading Strategy: {{loading_approach}} + - Caching Strategy: {{fe_cache_strategy}} + + **Backend Performance:** + - Response Time Target: {{response_target}} + - Database Optimization: {{db_optimization}} + - Caching Strategy: {{be_cache_strategy}} + + - id: testing-strategy + title: Testing Strategy + instruction: Define comprehensive testing approach for fullstack application. + elicit: true + sections: + - id: testing-pyramid + title: Testing Pyramid + type: code + language: text + template: | + E2E Tests + / \ + Integration Tests + / \ + Frontend Unit Backend Unit + - id: test-organization + title: Test Organization + sections: + - id: frontend-tests + title: Frontend Tests + type: code + language: text + template: "{{frontend_test_structure}}" + - id: backend-tests + title: Backend Tests + type: code + language: text + template: "{{backend_test_structure}}" + - id: e2e-tests + title: E2E Tests + type: code + language: text + template: "{{e2e_test_structure}}" + - id: test-examples + title: Test Examples + sections: + - id: frontend-test + title: Frontend Component Test + type: code + language: typescript + template: "{{frontend_test_example}}" + - id: backend-test + title: Backend API Test + type: code + language: typescript + template: "{{backend_test_example}}" + - id: e2e-test + title: E2E Test + type: code + language: typescript + template: "{{e2e_test_example}}" + + - id: coding-standards + title: Coding Standards + instruction: Define MINIMAL but CRITICAL standards for AI agents. Focus only on project-specific rules that prevent common mistakes. These will be used by dev agents. + elicit: true + sections: + - id: critical-rules + title: Critical Fullstack Rules + repeatable: true + template: "- **{{rule_name}}:** {{rule_description}}" + examples: + - "**Type Sharing:** Always define types in packages/shared and import from there" + - "**API Calls:** Never make direct HTTP calls - use the service layer" + - "**Environment Variables:** Access only through config objects, never process.env directly" + - "**Error Handling:** All API routes must use the standard error handler" + - "**State Updates:** Never mutate state directly - use proper state management patterns" + - id: naming-conventions + title: Naming Conventions + type: table + columns: [Element, Frontend, Backend, Example] + rows: + - ["Components", "PascalCase", "-", "`UserProfile.tsx`"] + - ["Hooks", "camelCase with 'use'", "-", "`useAuth.ts`"] + - ["API Routes", "-", "kebab-case", "`/api/user-profile`"] + - ["Database Tables", "-", "snake_case", "`user_profiles`"] + + - id: error-handling + title: Error Handling Strategy + instruction: Define unified error handling across frontend and backend. + elicit: true + sections: + - id: error-flow + title: Error Flow + type: mermaid + mermaid_type: sequence + template: "{{error_flow_diagram}}" + - id: error-format + title: Error Response Format + type: code + language: typescript + template: | + interface ApiError { + error: { + code: string; + message: string; + details?: Record; + timestamp: string; + requestId: string; + }; + } + - id: frontend-error-handling + title: Frontend Error Handling + type: code + language: typescript + template: "{{frontend_error_handler}}" + - id: backend-error-handling + title: Backend Error Handling + type: code + language: typescript + template: "{{backend_error_handler}}" + + - id: monitoring + title: Monitoring and Observability + instruction: Define monitoring strategy for fullstack application. + elicit: true + sections: + - id: monitoring-stack + title: Monitoring Stack + template: | + - **Frontend Monitoring:** {{frontend_monitoring}} + - **Backend Monitoring:** {{backend_monitoring}} + - **Error Tracking:** {{error_tracking}} + - **Performance Monitoring:** {{perf_monitoring}} + - id: key-metrics + title: Key Metrics + template: | + **Frontend Metrics:** + - Core Web Vitals + - JavaScript errors + - API response times + - User interactions + + **Backend Metrics:** + - Request rate + - Error rate + - Response time + - Database query performance + + - id: checklist-results + title: Checklist Results Report + instruction: Before running the checklist, offer to output the full architecture document. Once user confirms, execute the architect-checklist and populate results here. +==================== END: .bmad-core/templates/fullstack-architecture-tmpl.yaml ==================== + +==================== START: .bmad-core/templates/brownfield-architecture-tmpl.yaml ==================== +template: + id: brownfield-architecture-template-v2 + name: Brownfield Enhancement Architecture + version: 2.0 + output: + format: markdown + filename: docs/architecture.md + title: "{{project_name}} Brownfield Enhancement Architecture" + +workflow: + mode: interactive + elicitation: advanced-elicitation + +sections: + - id: introduction + title: Introduction + instruction: | + IMPORTANT - SCOPE AND ASSESSMENT REQUIRED: + + This architecture document is for SIGNIFICANT enhancements to existing projects that require comprehensive architectural planning. Before proceeding: + + 1. **Verify Complexity**: Confirm this enhancement requires architectural planning. For simple additions, recommend: "For simpler changes that don't require architectural planning, consider using the brownfield-create-epic or brownfield-create-story task with the Product Owner instead." + + 2. **REQUIRED INPUTS**: + - Completed brownfield-prd.md + - Existing project technical documentation (from docs folder or user-provided) + - Access to existing project structure (IDE or uploaded files) + + 3. **DEEP ANALYSIS MANDATE**: You MUST conduct thorough analysis of the existing codebase, architecture patterns, and technical constraints before making ANY architectural recommendations. Every suggestion must be based on actual project analysis, not assumptions. + + 4. **CONTINUOUS VALIDATION**: Throughout this process, explicitly validate your understanding with the user. For every architectural decision, confirm: "Based on my analysis of your existing system, I recommend [decision] because [evidence from actual project]. Does this align with your system's reality?" + + If any required inputs are missing, request them before proceeding. + elicit: true + sections: + - id: intro-content + content: | + This document outlines the architectural approach for enhancing {{project_name}} with {{enhancement_description}}. Its primary goal is to serve as the guiding architectural blueprint for AI-driven development of new features while ensuring seamless integration with the existing system. + + **Relationship to Existing Architecture:** + This document supplements existing project architecture by defining how new components will integrate with current systems. Where conflicts arise between new and existing patterns, this document provides guidance on maintaining consistency while implementing enhancements. + - id: existing-project-analysis + title: Existing Project Analysis + instruction: | + Analyze the existing project structure and architecture: + + 1. Review existing documentation in docs folder + 2. Examine current technology stack and versions + 3. Identify existing architectural patterns and conventions + 4. Note current deployment and infrastructure setup + 5. Document any constraints or limitations + + CRITICAL: After your analysis, explicitly validate your findings: "Based on my analysis of your project, I've identified the following about your existing system: [key findings]. Please confirm these observations are accurate before I proceed with architectural recommendations." + elicit: true + sections: + - id: current-state + title: Current Project State + template: | + - **Primary Purpose:** {{existing_project_purpose}} + - **Current Tech Stack:** {{existing_tech_summary}} + - **Architecture Style:** {{existing_architecture_style}} + - **Deployment Method:** {{existing_deployment_approach}} + - id: available-docs + title: Available Documentation + type: bullet-list + template: "- {{existing_docs_summary}}" + - id: constraints + title: Identified Constraints + type: bullet-list + template: "- {{constraint}}" + - id: changelog + title: Change Log + type: table + columns: [Change, Date, Version, Description, Author] + instruction: Track document versions and changes + + - id: enhancement-scope + title: Enhancement Scope and Integration Strategy + instruction: | + Define how the enhancement will integrate with the existing system: + + 1. Review the brownfield PRD enhancement scope + 2. Identify integration points with existing code + 3. Define boundaries between new and existing functionality + 4. Establish compatibility requirements + + VALIDATION CHECKPOINT: Before presenting the integration strategy, confirm: "Based on my analysis, the integration approach I'm proposing takes into account [specific existing system characteristics]. These integration points and boundaries respect your current architecture patterns. Is this assessment accurate?" + elicit: true + sections: + - id: enhancement-overview + title: Enhancement Overview + template: | + **Enhancement Type:** {{enhancement_type}} + **Scope:** {{enhancement_scope}} + **Integration Impact:** {{integration_impact_level}} + - id: integration-approach + title: Integration Approach + template: | + **Code Integration Strategy:** {{code_integration_approach}} + **Database Integration:** {{database_integration_approach}} + **API Integration:** {{api_integration_approach}} + **UI Integration:** {{ui_integration_approach}} + - id: compatibility-requirements + title: Compatibility Requirements + template: | + - **Existing API Compatibility:** {{api_compatibility}} + - **Database Schema Compatibility:** {{db_compatibility}} + - **UI/UX Consistency:** {{ui_compatibility}} + - **Performance Impact:** {{performance_constraints}} + + - id: tech-stack-alignment + title: Tech Stack Alignment + instruction: | + Ensure new components align with existing technology choices: + + 1. Use existing technology stack as the foundation + 2. Only introduce new technologies if absolutely necessary + 3. Justify any new additions with clear rationale + 4. Ensure version compatibility with existing dependencies + elicit: true + sections: + - id: existing-stack + title: Existing Technology Stack + type: table + columns: [Category, Current Technology, Version, Usage in Enhancement, Notes] + instruction: Document the current stack that must be maintained or integrated with + - id: new-tech-additions + title: New Technology Additions + condition: Enhancement requires new technologies + type: table + columns: [Technology, Version, Purpose, Rationale, Integration Method] + instruction: Only include if new technologies are required for the enhancement + + - id: data-models + title: Data Models and Schema Changes + instruction: | + Define new data models and how they integrate with existing schema: + + 1. Identify new entities required for the enhancement + 2. Define relationships with existing data models + 3. Plan database schema changes (additions, modifications) + 4. Ensure backward compatibility + elicit: true + sections: + - id: new-models + title: New Data Models + repeatable: true + sections: + - id: model + title: "{{model_name}}" + template: | + **Purpose:** {{model_purpose}} + **Integration:** {{integration_with_existing}} + + **Key Attributes:** + - {{attribute_1}}: {{type_1}} - {{description_1}} + - {{attribute_2}}: {{type_2}} - {{description_2}} + + **Relationships:** + - **With Existing:** {{existing_relationships}} + - **With New:** {{new_relationships}} + - id: schema-integration + title: Schema Integration Strategy + template: | + **Database Changes Required:** + - **New Tables:** {{new_tables_list}} + - **Modified Tables:** {{modified_tables_list}} + - **New Indexes:** {{new_indexes_list}} + - **Migration Strategy:** {{migration_approach}} + + **Backward Compatibility:** + - {{compatibility_measure_1}} + - {{compatibility_measure_2}} + + - id: component-architecture + title: Component Architecture + instruction: | + Define new components and their integration with existing architecture: + + 1. Identify new components required for the enhancement + 2. Define interfaces with existing components + 3. Establish clear boundaries and responsibilities + 4. Plan integration points and data flow + + MANDATORY VALIDATION: Before presenting component architecture, confirm: "The new components I'm proposing follow the existing architectural patterns I identified in your codebase: [specific patterns]. The integration interfaces respect your current component structure and communication patterns. Does this match your project's reality?" + elicit: true + sections: + - id: new-components + title: New Components + repeatable: true + sections: + - id: component + title: "{{component_name}}" + template: | + **Responsibility:** {{component_description}} + **Integration Points:** {{integration_points}} + + **Key Interfaces:** + - {{interface_1}} + - {{interface_2}} + + **Dependencies:** + - **Existing Components:** {{existing_dependencies}} + - **New Components:** {{new_dependencies}} + + **Technology Stack:** {{component_tech_details}} + - id: interaction-diagram + title: Component Interaction Diagram + type: mermaid + mermaid_type: graph + instruction: Create Mermaid diagram showing how new components interact with existing ones + + - id: api-design + title: API Design and Integration + condition: Enhancement requires API changes + instruction: | + Define new API endpoints and integration with existing APIs: + + 1. Plan new API endpoints required for the enhancement + 2. Ensure consistency with existing API patterns + 3. Define authentication and authorization integration + 4. Plan versioning strategy if needed + elicit: true + sections: + - id: api-strategy + title: API Integration Strategy + template: | + **API Integration Strategy:** {{api_integration_strategy}} + **Authentication:** {{auth_integration}} + **Versioning:** {{versioning_approach}} + - id: new-endpoints + title: New API Endpoints + repeatable: true + sections: + - id: endpoint + title: "{{endpoint_name}}" + template: | + - **Method:** {{http_method}} + - **Endpoint:** {{endpoint_path}} + - **Purpose:** {{endpoint_purpose}} + - **Integration:** {{integration_with_existing}} + sections: + - id: request + title: Request + type: code + language: json + template: "{{request_schema}}" + - id: response + title: Response + type: code + language: json + template: "{{response_schema}}" + + - id: external-api-integration + title: External API Integration + condition: Enhancement requires new external APIs + instruction: Document new external API integrations required for the enhancement + repeatable: true + sections: + - id: external-api + title: "{{api_name}} API" + template: | + - **Purpose:** {{api_purpose}} + - **Documentation:** {{api_docs_url}} + - **Base URL:** {{api_base_url}} + - **Authentication:** {{auth_method}} + - **Integration Method:** {{integration_approach}} + + **Key Endpoints Used:** + - `{{method}} {{endpoint_path}}` - {{endpoint_purpose}} + + **Error Handling:** {{error_handling_strategy}} + + - id: source-tree-integration + title: Source Tree Integration + instruction: | + Define how new code will integrate with existing project structure: + + 1. Follow existing project organization patterns + 2. Identify where new files/folders will be placed + 3. Ensure consistency with existing naming conventions + 4. Plan for minimal disruption to existing structure + elicit: true + sections: + - id: existing-structure + title: Existing Project Structure + type: code + language: plaintext + instruction: Document relevant parts of current structure + template: "{{existing_structure_relevant_parts}}" + - id: new-file-organization + title: New File Organization + type: code + language: plaintext + instruction: Show only new additions to existing structure + template: | + {{project-root}}/ + ├── {{existing_structure_context}} + │ ├── {{new_folder_1}}/ # {{purpose_1}} + │ │ ├── {{new_file_1}} + │ │ └── {{new_file_2}} + │ ├── {{existing_folder}}/ # Existing folder with additions + │ │ ├── {{existing_file}} # Existing file + │ │ └── {{new_file_3}} # New addition + │ └── {{new_folder_2}}/ # {{purpose_2}} + - id: integration-guidelines + title: Integration Guidelines + template: | + - **File Naming:** {{file_naming_consistency}} + - **Folder Organization:** {{folder_organization_approach}} + - **Import/Export Patterns:** {{import_export_consistency}} + + - id: infrastructure-deployment + title: Infrastructure and Deployment Integration + instruction: | + Define how the enhancement will be deployed alongside existing infrastructure: + + 1. Use existing deployment pipeline and infrastructure + 2. Identify any infrastructure changes needed + 3. Plan deployment strategy to minimize risk + 4. Define rollback procedures + elicit: true + sections: + - id: existing-infrastructure + title: Existing Infrastructure + template: | + **Current Deployment:** {{existing_deployment_summary}} + **Infrastructure Tools:** {{existing_infrastructure_tools}} + **Environments:** {{existing_environments}} + - id: enhancement-deployment + title: Enhancement Deployment Strategy + template: | + **Deployment Approach:** {{deployment_approach}} + **Infrastructure Changes:** {{infrastructure_changes}} + **Pipeline Integration:** {{pipeline_integration}} + - id: rollback-strategy + title: Rollback Strategy + template: | + **Rollback Method:** {{rollback_method}} + **Risk Mitigation:** {{risk_mitigation}} + **Monitoring:** {{monitoring_approach}} + + - id: coding-standards + title: Coding Standards and Conventions + instruction: | + Ensure new code follows existing project conventions: + + 1. Document existing coding standards from project analysis + 2. Identify any enhancement-specific requirements + 3. Ensure consistency with existing codebase patterns + 4. Define standards for new code organization + elicit: true + sections: + - id: existing-standards + title: Existing Standards Compliance + template: | + **Code Style:** {{existing_code_style}} + **Linting Rules:** {{existing_linting}} + **Testing Patterns:** {{existing_test_patterns}} + **Documentation Style:** {{existing_doc_style}} + - id: enhancement-standards + title: Enhancement-Specific Standards + condition: New patterns needed for enhancement + repeatable: true + template: "- **{{standard_name}}:** {{standard_description}}" + - id: integration-rules + title: Critical Integration Rules + template: | + - **Existing API Compatibility:** {{api_compatibility_rule}} + - **Database Integration:** {{db_integration_rule}} + - **Error Handling:** {{error_handling_integration}} + - **Logging Consistency:** {{logging_consistency}} + + - id: testing-strategy + title: Testing Strategy + instruction: | + Define testing approach for the enhancement: + + 1. Integrate with existing test suite + 2. Ensure existing functionality remains intact + 3. Plan for testing new features + 4. Define integration testing approach + elicit: true + sections: + - id: existing-test-integration + title: Integration with Existing Tests + template: | + **Existing Test Framework:** {{existing_test_framework}} + **Test Organization:** {{existing_test_organization}} + **Coverage Requirements:** {{existing_coverage_requirements}} + - id: new-testing + title: New Testing Requirements + sections: + - id: unit-tests + title: Unit Tests for New Components + template: | + - **Framework:** {{test_framework}} + - **Location:** {{test_location}} + - **Coverage Target:** {{coverage_target}} + - **Integration with Existing:** {{test_integration}} + - id: integration-tests + title: Integration Tests + template: | + - **Scope:** {{integration_test_scope}} + - **Existing System Verification:** {{existing_system_verification}} + - **New Feature Testing:** {{new_feature_testing}} + - id: regression-tests + title: Regression Testing + template: | + - **Existing Feature Verification:** {{regression_test_approach}} + - **Automated Regression Suite:** {{automated_regression}} + - **Manual Testing Requirements:** {{manual_testing_requirements}} + + - id: security-integration + title: Security Integration + instruction: | + Ensure security consistency with existing system: + + 1. Follow existing security patterns and tools + 2. Ensure new features don't introduce vulnerabilities + 3. Maintain existing security posture + 4. Define security testing for new components + elicit: true + sections: + - id: existing-security + title: Existing Security Measures + template: | + **Authentication:** {{existing_auth}} + **Authorization:** {{existing_authz}} + **Data Protection:** {{existing_data_protection}} + **Security Tools:** {{existing_security_tools}} + - id: enhancement-security + title: Enhancement Security Requirements + template: | + **New Security Measures:** {{new_security_measures}} + **Integration Points:** {{security_integration_points}} + **Compliance Requirements:** {{compliance_requirements}} + - id: security-testing + title: Security Testing + template: | + **Existing Security Tests:** {{existing_security_tests}} + **New Security Test Requirements:** {{new_security_tests}} + **Penetration Testing:** {{pentest_requirements}} + + - id: checklist-results + title: Checklist Results Report + instruction: Execute the architect-checklist and populate results here, focusing on brownfield-specific validation + + - id: next-steps + title: Next Steps + instruction: | + After completing the brownfield architecture: + + 1. Review integration points with existing system + 2. Begin story implementation with Dev agent + 3. Set up deployment pipeline integration + 4. Plan rollback and monitoring procedures + sections: + - id: story-manager-handoff + title: Story Manager Handoff + instruction: | + Create a brief prompt for Story Manager to work with this brownfield enhancement. Include: + - Reference to this architecture document + - Key integration requirements validated with user + - Existing system constraints based on actual project analysis + - First story to implement with clear integration checkpoints + - Emphasis on maintaining existing system integrity throughout implementation + - id: developer-handoff + title: Developer Handoff + instruction: | + Create a brief prompt for developers starting implementation. Include: + - Reference to this architecture and existing coding standards analyzed from actual project + - Integration requirements with existing codebase validated with user + - Key technical decisions based on real project constraints + - Existing system compatibility requirements with specific verification steps + - Clear sequencing of implementation to minimize risk to existing functionality +==================== END: .bmad-core/templates/brownfield-architecture-tmpl.yaml ==================== ==================== START: .bmad-core/checklists/architect-checklist.md ==================== # Architect Solution Validation Checklist @@ -9532,66 +9209,145 @@ Provide a structured validation report including: - **Confidence Level**: High/Medium/Low for successful implementation ==================== END: .bmad-core/tasks/validate-next-story.md ==================== -==================== START: .bmad-core/templates/story-tmpl.md ==================== ---- -defaultOutput: docs/stories/{{EpicNum}}.{{StoryNum}}.{{Short Title Copied from Epic File specific story}}.md -smAgent: - editableSections: Status, Story, Acceptance Criteria, Tasks / Subtasks, Dev Notes, Testing, Change Log - sectionSpecificInstructions: - "Dev Notes": - - Populate relevant information, only what was pulled from actual artifacts from docs folder, relevant to this story - - Do not invent information. - - If known add Relevant Source Tree info that relates to this story. - - If there were important notes from previous story that are relevant to this one, include them here. - - Put enough information in this section so that the dev agent should NEVER need to read the architecture documents, these notes along with the tasks and subtasks must give the Dev Agent the complete context it needs to comprehend with the least amount of overhead the information to complete the story, meeting all AC and completing all tasks+subtasks. - Testing: - - List Relevant Testing Standards from Architecture the Developer needs to conform to (test file location, test standards, etc) ---- +==================== START: .bmad-core/templates/story-tmpl.yaml ==================== +template: + id: story-template-v2 + name: Story Document + version: 2.0 + output: + format: markdown + filename: docs/stories/{{epic_num}}.{{story_num}}.{{story_title_short}}.md + title: "Story {{epic_num}}.{{story_num}}: {{story_title_short}}" -# Story {{EpicNum}}.{{StoryNum}}: {{Short Title Copied from Epic File specific story}} +workflow: + mode: interactive + elicitation: advanced-elicitation -## Status: {{ Draft | Approved | InProgress | Review | Done }} +agent_config: + editable_sections: + - Status + - Story + - Acceptance Criteria + - Tasks / Subtasks + - Dev Notes + - Testing + - Change Log -## Story - -**As a** {{role}},\ -**I want** {{action}},\ -**so that** {{benefit}} - -## Acceptance Criteria - -{{ Copy of Acceptance Criteria numbered list }} - -## Tasks / Subtasks - -- [ ] Task 1 (AC: # if applicable) - - [ ] Subtask1.1... -- [ ] Task 2 (AC: # if applicable) - - [ ] Subtask 2.1... -- [ ] Task 3 (AC: # if applicable) - - [ ] Subtask 3.1... - -## Dev Notes - -### Testing - -## Change Log - -| Date | Version | Description | Author | -| :--- | :------ | :---------- | :----- | - -## Dev Agent Record - -### Agent Model Used: {{Agent Model Name/Version}} - -### Debug Log References - -### Completion Notes List - -### File List - -## QA Results -==================== END: .bmad-core/templates/story-tmpl.md ==================== +sections: + - id: status + title: Status + type: choice + choices: [Draft, Approved, InProgress, Review, Done] + instruction: Select the current status of the story + owner: scrum-master + editors: [scrum-master, dev-agent] + + - id: story + title: Story + type: template-text + template: | + **As a** {{role}}, + **I want** {{action}}, + **so that** {{benefit}} + instruction: Define the user story using the standard format with role, action, and benefit + elicit: true + owner: scrum-master + editors: [scrum-master] + + - id: acceptance-criteria + title: Acceptance Criteria + type: numbered-list + instruction: Copy the acceptance criteria numbered list from the epic file + elicit: true + owner: scrum-master + editors: [scrum-master] + + - id: tasks-subtasks + title: Tasks / Subtasks + type: bullet-list + instruction: | + Break down the story into specific tasks and subtasks needed for implementation. + Reference applicable acceptance criteria numbers where relevant. + template: | + - [ ] Task 1 (AC: # if applicable) + - [ ] Subtask1.1... + - [ ] Task 2 (AC: # if applicable) + - [ ] Subtask 2.1... + - [ ] Task 3 (AC: # if applicable) + - [ ] Subtask 3.1... + elicit: true + owner: scrum-master + editors: [scrum-master, dev-agent] + + - id: dev-notes + title: Dev Notes + instruction: | + Populate relevant information, only what was pulled from actual artifacts from docs folder, relevant to this story: + - Do not invent information + - If known add Relevant Source Tree info that relates to this story + - If there were important notes from previous story that are relevant to this one, include them here + - Put enough information in this section so that the dev agent should NEVER need to read the architecture documents, these notes along with the tasks and subtasks must give the Dev Agent the complete context it needs to comprehend with the least amount of overhead the information to complete the story, meeting all AC and completing all tasks+subtasks + elicit: true + owner: scrum-master + editors: [scrum-master] + sections: + - id: testing-standards + title: Testing + instruction: | + List Relevant Testing Standards from Architecture the Developer needs to conform to: + - Test file location + - Test standards + - Testing frameworks and patterns to use + - Any specific testing requirements for this story + elicit: true + owner: scrum-master + editors: [scrum-master] + + - id: change-log + title: Change Log + type: table + columns: [Date, Version, Description, Author] + instruction: Track changes made to this story document + owner: scrum-master + editors: [scrum-master, dev-agent, qa-agent] + + - id: dev-agent-record + title: Dev Agent Record + instruction: This section is populated by the development agent during implementation + owner: dev-agent + editors: [dev-agent] + sections: + - id: agent-model + title: Agent Model Used + template: "{{agent_model_name_version}}" + instruction: Record the specific AI agent model and version used for development + owner: dev-agent + editors: [dev-agent] + + - id: debug-log-references + title: Debug Log References + instruction: Reference any debug logs or traces generated during development + owner: dev-agent + editors: [dev-agent] + + - id: completion-notes + title: Completion Notes List + instruction: Notes about the completion of tasks and any issues encountered + owner: dev-agent + editors: [dev-agent] + + - id: file-list + title: File List + instruction: List all files created, modified, or affected during story implementation + owner: dev-agent + editors: [dev-agent] + + - id: qa-results + title: QA Results + instruction: Results from QA Agent QA review of the completed story implementation + owner: qa-agent + editors: [qa-agent] +==================== END: .bmad-core/templates/story-tmpl.yaml ==================== ==================== START: .bmad-core/checklists/po-master-checklist.md ==================== # Product Owner (PO) Master Validation Checklist diff --git a/dist/teams/team-ide-minimal.txt b/dist/teams/team-ide-minimal.txt index a4306f1c..ac80e9cd 100644 --- a/dist/teams/team-ide-minimal.txt +++ b/dist/teams/team-ide-minimal.txt @@ -58,6 +58,15 @@ workflows: null CRITICAL: Read the full YAML, start activation to alter your state of being, follow startup section instructions, stay in this being until told to exit this mode: ```yaml +activation-instructions: + - Mention *help shows all available commands and options + - Check for active workflow plan using .bmad-core/utils/plan-management.md + - 'If plan exists: Show 📋 Active plan: {workflow} ({progress}% complete). Use *plan-status for details.' + - 'If plan exists: Suggest next action based on plan progress' + - Assess user goal against available agents and workflows in this bundle + - If clear match to an agent's expertise, suggest transformation with *agent command + - If project-oriented, suggest *workflow-guidance to explore options + - Load resources only when needed - never pre-load agent: name: BMad Orchestrator id: bmad-orchestrator @@ -79,17 +88,6 @@ persona: - Always use numbered lists for choices - Process commands starting with * immediately - Always remind users that commands require * prefix -startup: - - Announce: Introduce yourself as the BMad Orchestrator, explain you can coordinate agents and workflows - - IMPORTANT: Tell users that all commands start with * (e.g., *help, *agent, *workflow) - - Mention *help shows all available commands and options - - Check for active workflow plan using .bmad-core/utils/plan-management.md - - 'If plan exists: Show 📋 Active plan: {workflow} ({progress}% complete). Use *plan-status for details.' - - 'If plan exists: Suggest next action based on plan progress' - - Assess user goal against available agents and workflows in this bundle - - If clear match to an agent's expertise, suggest transformation with *agent command - - If project-oriented, suggest *workflow-guidance to explore options - - Load resources only when needed - never pre-load commands: help: Show this guide with available agents and workflows chat-mode: Start conversational mode for detailed assistance @@ -177,17 +175,18 @@ workflow-guidance: - When *workflow-guidance is called, start an interactive session and list all available workflows with brief descriptions dependencies: tasks: - - advanced-elicitation - - create-doc - - create-workflow-plan - - kb-mode-interaction - - update-workflow-plan + - advanced-elicitation.md + - create-doc.md + - create-workflow-plan.md + - kb-mode-interaction.md + - update-workflow-plan.md data: - - bmad-kb + - bmad-kb.md + - elicitation-methods.md utils: - - plan-management - - workflow-management - - template-format + - plan-management.md + - workflow-management.md + - template-format.md ``` ==================== END: .bmad-core/agents/bmad-orchestrator.md ==================== @@ -202,6 +201,7 @@ activation-instructions: - Only read the files/tasks listed here when user selects them for execution to minimize context usage - The customization field ALWAYS takes precedence over any conflicting instructions - When listing tasks/templates or presenting options during conversations, always show as numbered options list, allowing the user to type a number to select or execute + - Greet the user with your name and role, and inform of the *help command. agent: name: Sarah id: po @@ -225,8 +225,6 @@ persona: - User Collaboration for Validation - Seek input at critical checkpoints - Focus on Executable & Value-Driven Increments - Ensure work aligns with MVP goals - Documentation Ecosystem Integrity - Maintain consistency across all documents -startup: - - Greet the user with your name and role, and inform of the *help command. commands: - help: Show numbered list of the following commands to allow selection - create-doc {template}: execute task create-doc (no template = ONLY show available templates listed under dependencies/templates below) @@ -241,19 +239,17 @@ commands: - exit: Exit (confirm) dependencies: tasks: - - execute-checklist - - shard-doc - - correct-course - - brownfield-create-epic - - brownfield-create-story - - validate-next-story + - execute-checklist.md + - shard-doc.md + - correct-course.md + - brownfield-create-epic.md + - brownfield-create-story.md + - validate-next-story.md templates: - - story-tmpl + - story-tmpl.yaml checklists: - - po-master-checklist - - change-checklist - utils: - - template-format + - po-master-checklist.md + - change-checklist.md ``` ==================== END: .bmad-core/agents/po.md ==================== @@ -267,6 +263,7 @@ activation-instructions: - Follow all instructions in this file -> this defines you, your persona and more importantly what you can do. STAY IN CHARACTER! - The customization field ALWAYS takes precedence over any conflicting instructions - When listing tasks/templates or presenting options during conversations, always show as numbered options list, allowing the user to type a number to select or execute + - Greet the user with your name and role, and inform of the *help command and then HALT to await instruction if not given already. agent: name: Bob id: sm @@ -283,10 +280,6 @@ persona: - Rigorously follow `create-next-story` procedure to generate the detailed user story - Will ensure all information comes from the PRD and Architecture to guide the dumb dev agent - You are NOT allowed to implement stories or modify code EVER! -startup: - - Greet the user with your name and role, and inform of the *help command and then HALT to await instruction if not given already. - - Offer to help with story preparation but wait for explicit user confirmation - - Only execute tasks when user explicitly requests them commands: - help: Show numbered list of the following commands to allow selection - draft: Execute task create-next-story @@ -295,15 +288,13 @@ commands: - exit: Say goodbye as the Scrum Master, and then abandon inhabiting this persona dependencies: tasks: - - create-next-story - - execute-checklist - - correct-course + - create-next-story.md + - execute-checklist.md + - correct-course.md templates: - - story-tmpl + - story-tmpl.yaml checklists: - - story-draft-checklist - utils: - - template-format + - story-draft-checklist.md ``` ==================== END: .bmad-core/agents/sm.md ==================== @@ -313,6 +304,7 @@ dependencies: CRITICAL: Read the full YAML, start activation to alter your state of being, follow startup section instructions, stay in this being until told to exit this mode: ```yaml +activation-instructions: [] agent: name: James id: dev @@ -320,11 +312,6 @@ agent: icon: 💻 whenToUse: Use for code implementation, debugging, refactoring, and development best practices customization: null -startup: - - Announce: Greet the user with your name and role, and inform of the *help command. - - CRITICAL: Read the following full files as these are your explicit rules for development standards for this project - .bmad-core/core-config.yaml devLoadAlwaysFiles list - - CRITICAL: Do NOT load any other files during startup aside from the assigned story and devLoadAlwaysFiles items, unless user requested you do or the following contradicts - - CRITICAL: Do NOT begin development until a story is not in draft mode and you are told to proceed persona: role: Expert Senior Software Engineer & Implementation Specialist style: Extremely concise, pragmatic, detail-oriented, solution-focused @@ -351,10 +338,10 @@ develop-story: completion: 'All Tasks and Subtasks marked [x] and have tests→Validations and full regression passes (DON''T BE LAZY, EXECUTE ALL TESTS and CONFIRM)→Ensure File List is Complete→run the task execute-checklist for the checklist story-dod-checklist→set story status: ''Ready for Review''→HALT' dependencies: tasks: - - execute-checklist - - validate-next-story + - execute-checklist.md + - validate-next-story.md checklists: - - story-dod-checklist + - story-dod-checklist.md ``` ==================== END: .bmad-core/agents/dev.md ==================== @@ -369,6 +356,7 @@ activation-instructions: - Only read the files/tasks listed here when user selects them for execution to minimize context usage - The customization field ALWAYS takes precedence over any conflicting instructions - When listing tasks/templates or presenting options during conversations, always show as numbered options list, allowing the user to type a number to select or execute + - Greet the user with your name and role, and inform of the *help command. agent: name: Quinn id: qa @@ -392,8 +380,6 @@ persona: - Risk-Based Testing - Prioritize testing based on risk and critical areas - Continuous Improvement - Balance perfection with pragmatism - Architecture & Design Patterns - Ensure proper patterns and maintainable code structure -startup: - - Greet the user with your name and role, and inform of the *help command. story-file-permissions: - CRITICAL: When reviewing stories, you are ONLY authorized to update the "QA Results" section of story files - CRITICAL: DO NOT modify any other sections including Status, Story, Acceptance Criteria, Tasks/Subtasks, Dev Notes, Testing, Dev Agent Record, Change Log, or any other sections @@ -405,11 +391,11 @@ commands: - exit: Say goodbye as the QA Engineer, and then abandon inhabiting this persona dependencies: tasks: - - review-story + - review-story.md data: - - technical-preferences - utils: - - template-format + - technical-preferences.md + templates: + - story-tmpl.yaml ``` ==================== END: .bmad-core/agents/qa.md ==================== @@ -534,97 +520,85 @@ Choose a number (0-8) or 9 to proceed: ==================== END: .bmad-core/tasks/advanced-elicitation.md ==================== ==================== START: .bmad-core/tasks/create-doc.md ==================== -# Create Document from Template Task +# Create Document from Template (YAML Driven) -## Purpose +## CRITICAL: Mandatory Elicitation Format -Generate documents from templates by EXECUTING (not just reading) embedded instructions from the perspective of the selected agent persona. +**When `elicit: true`, ALWAYS use this exact format:** -## CRITICAL RULES +1. Present section content +2. Provide detailed rationale (explain trade-offs, assumptions, decisions made) +3. Present numbered options 1-9: + - **Option 1:** Always "Proceed to next section" + - **Options 2-9:** Select 8 methods from data/elicitation-methods + - End with: "Select 1-9 or just type your question/feedback:" -1. **Templates are PROGRAMS** - Execute every [[LLM:]] instruction exactly as written -2. **NEVER show markup** - Hide all [[LLM:]], {{placeholders}}, @{examples}, and template syntax -3. **STOP and EXECUTE** - When you see "apply tasks#" or "execute tasks#", STOP and run that task immediately -4. **WAIT for user input** - At review points and after elicitation tasks +**NEVER ask yes/no questions or use any other format.** -## Execution Flow +## Processing Flow -### 0. Check Workflow Plan (if configured) +1. **Parse YAML template** - Load template metadata and sections +2. **Set preferences** - Show current mode (Interactive), confirm output file +3. **Process each section:** + - Skip if condition unmet + - Check agent permissions (owner/editors) - note if section is restricted to specific agents + - Draft content using section instruction + - Present content + detailed rationale + - **IF elicit: true** → MANDATORY 1-9 options format + - Save to file if possible +4. **Continue until complete** -[[LLM: Check if plan tracking is enabled in core-config.yaml]] +## Detailed Rationale Requirements -- If `workflow.trackProgress: true`, check for active plan using .bmad-core/utils/plan-management.md -- If plan exists and this document creation is part of the plan: - - Verify this is the expected next step - - If out of sequence and `enforceSequence: true`, warn user and halt without user override - - If out of sequence and `enforceSequence: false`, ask for confirmation -- Continue with normal execution after plan check +When presenting section content, ALWAYS include rationale that explains: -### 1. Identify Template +- Trade-offs and choices made (what was chosen over alternatives and why) +- Key assumptions made during drafting +- Interesting or questionable decisions that need user attention +- Areas that might need validation -- Load from `.bmad-core/templates/*.md` or `.bmad-core/templates directory` -- Agent-specific templates are listed in agent's dependencies -- If agent has `templates: [prd-tmpl, architecture-tmpl]` for example, then offer to create "PRD" and "Architecture" documents +## Elicitation Results Flow -### 2. Ask Interaction Mode +After user selects elicitation method (2-9): -> 1. **Incremental** - Section by section with reviews -> 2. **YOLO Mode** - Complete draft then review (user can type `/yolo` anytime to switch) +1. Execute method from data/elicitation-methods +2. Present results with insights +3. Offer options: + - **1. Apply changes and update section** + - **2. Return to elicitation menu** + - **3. Ask any questions or engage further with this elicitation** -### 3. Execute Template +## Agent Permissions -- Replace {{placeholders}} with real content -- Execute [[LLM:]] instructions as you encounter them -- Process <> loops and ^^CONDITIONS^^ -- Use @{examples} for guidance but never output them +When processing sections with agent permission fields: -### 4. Key Execution Patterns +- **owner**: Note which agent role initially creates/populates the section +- **editors**: List agent roles allowed to modify the section +- **readonly**: Mark sections that cannot be modified after creation -**When you see:** `[[LLM: Draft X and immediately execute .bmad-core/tasks/advanced-elicitation.md]]` +**For sections with restricted access:** -- Draft the content -- Present it to user -- IMMEDIATELY execute the task -- Wait for completion before continuing +- Include a note in the generated document indicating the responsible agent +- Example: "_(This section is owned by dev-agent and can only be modified by dev-agent)_" -**When you see:** `[[LLM: After section completion, apply .bmad-core/tasks/Y.md]]` +## YOLO Mode -- Finish the section -- STOP and execute the task -- Wait for user input +User can type `#yolo` to toggle to YOLO mode (process all sections at once). -### 5. Validation & Final Presentation +## CRITICAL REMINDERS -- Run any specified checklists -- Present clean, formatted content only -- No truncation or summarization -- Begin directly with content (no preamble) -- Include any handoff prompts from template +**❌ NEVER:** -### 6. Update Workflow Plan (if applicable) +- Ask yes/no questions for elicitation +- Use any format other than 1-9 numbered options +- Create new elicitation methods -[[LLM: After successful document creation]] +**✅ ALWAYS:** -- If plan tracking is enabled and document was part of plan: - - Call update-workflow-plan task to mark step complete - - Parameters: task: create-doc, step_id: {from plan}, status: complete - - Show next recommended step from plan - -## Common Mistakes to Avoid - -❌ Skipping elicitation tasks -❌ Showing template markup to users -❌ Continuing past STOP signals -❌ Combining multiple review points - -✅ Execute ALL instructions in sequence -✅ Present only clean, formatted content -✅ Stop at every elicitation point -✅ Wait for user confirmation when instructed - -## Remember - -Templates contain precise instructions for a reason. Follow them exactly to ensure document quality and completeness. +- Use exact 1-9 format when elicit: true +- Select options 2-9 from data/elicitation-methods only +- Provide detailed rationale explaining decisions +- End with "Select 1-9 or just type your question/feedback:" ==================== END: .bmad-core/tasks/create-doc.md ==================== ==================== START: .bmad-core/tasks/create-workflow-plan.md ==================== @@ -2056,6 +2030,143 @@ Use the **expansion-creator** pack to build your own: - **Contributing**: See `CONTRIBUTING.md` for full guidelines ==================== END: .bmad-core/data/bmad-kb.md ==================== +==================== START: .bmad-core/data/elicitation-methods.md ==================== +# Elicitation Methods Data + +## Core Reflective Methods + +**Expand or Contract for Audience** +- Ask whether to 'expand' (add detail, elaborate) or 'contract' (simplify, clarify) +- Identify specific target audience if relevant +- Tailor content complexity and depth accordingly + +**Explain Reasoning (CoT Step-by-Step)** +- Walk through the step-by-step thinking process +- Reveal underlying assumptions and decision points +- Show how conclusions were reached from current role's perspective + +**Critique and Refine** +- Review output for flaws, inconsistencies, or improvement areas +- Identify specific weaknesses from role's expertise +- Suggest refined version reflecting domain knowledge + +## Structural Analysis Methods + +**Analyze Logical Flow and Dependencies** +- Examine content structure for logical progression +- Check internal consistency and coherence +- Identify and validate dependencies between elements +- Confirm effective ordering and sequencing + +**Assess Alignment with Overall Goals** +- Evaluate content contribution to stated objectives +- Identify any misalignments or gaps +- Interpret alignment from specific role's perspective +- Suggest adjustments to better serve goals + +## Risk and Challenge Methods + +**Identify Potential Risks and Unforeseen Issues** +- Brainstorm potential risks from role's expertise +- Identify overlooked edge cases or scenarios +- Anticipate unintended consequences +- Highlight implementation challenges + +**Challenge from Critical Perspective** +- Adopt critical stance on current content +- Play devil's advocate from specified viewpoint +- Argue against proposal highlighting weaknesses +- Apply YAGNI principles when appropriate (scope trimming) + +## Creative Exploration Methods + +**Tree of Thoughts Deep Dive** +- Break problem into discrete "thoughts" or intermediate steps +- Explore multiple reasoning paths simultaneously +- Use self-evaluation to classify each path as "sure", "likely", or "impossible" +- Apply search algorithms (BFS/DFS) to find optimal solution paths + +**Hindsight is 20/20: The 'If Only...' Reflection** +- Imagine retrospective scenario based on current content +- Identify the one "if only we had known/done X..." insight +- Describe imagined consequences humorously or dramatically +- Extract actionable learnings for current context + +## Multi-Persona Collaboration Methods + +**Agile Team Perspective Shift** +- Rotate through different Scrum team member viewpoints +- Product Owner: Focus on user value and business impact +- Scrum Master: Examine process flow and team dynamics +- Developer: Assess technical implementation and complexity +- QA: Identify testing scenarios and quality concerns + +**Stakeholder Round Table** +- Convene virtual meeting with multiple personas +- Each persona contributes unique perspective on content +- Identify conflicts and synergies between viewpoints +- Synthesize insights into actionable recommendations + +**Meta-Prompting Analysis** +- Step back to analyze the structure and logic of current approach +- Question the format and methodology being used +- Suggest alternative frameworks or mental models +- Optimize the elicitation process itself + +## Advanced 2025 Techniques + +**Self-Consistency Validation** +- Generate multiple reasoning paths for same problem +- Compare consistency across different approaches +- Identify most reliable and robust solution +- Highlight areas where approaches diverge and why + +**ReWOO (Reasoning Without Observation)** +- Separate parametric reasoning from tool-based actions +- Create reasoning plan without external dependencies +- Identify what can be solved through pure reasoning +- Optimize for efficiency and reduced token usage + +**Persona-Pattern Hybrid** +- Combine specific role expertise with elicitation pattern +- Architect + Risk Analysis: Deep technical risk assessment +- UX Expert + User Journey: End-to-end experience critique +- PM + Stakeholder Analysis: Multi-perspective impact review + +**Emergent Collaboration Discovery** +- Allow multiple perspectives to naturally emerge +- Identify unexpected insights from persona interactions +- Explore novel combinations of viewpoints +- Capture serendipitous discoveries from multi-agent thinking + +## Game-Based Elicitation Methods + +**Red Team vs Blue Team** +- Red Team: Attack the proposal, find vulnerabilities +- Blue Team: Defend and strengthen the approach +- Competitive analysis reveals blind spots +- Results in more robust, battle-tested solutions + +**Innovation Tournament** +- Pit multiple alternative approaches against each other +- Score each approach across different criteria +- Crowd-source evaluation from different personas +- Identify winning combination of features + +**Escape Room Challenge** +- Present content as constraints to work within +- Find creative solutions within tight limitations +- Identify minimum viable approach +- Discover innovative workarounds and optimizations + +## Process Control + +**Proceed / No Further Actions** +- Acknowledge choice to finalize current work +- Accept output as-is or move to next step +- Prepare to continue without additional elicitation +==================== END: .bmad-core/data/elicitation-methods.md ==================== + ==================== START: .bmad-core/utils/plan-management.md ==================== # Plan Management Utility @@ -3195,66 +3306,145 @@ Provide a structured validation report including: - **Confidence Level**: High/Medium/Low for successful implementation ==================== END: .bmad-core/tasks/validate-next-story.md ==================== -==================== START: .bmad-core/templates/story-tmpl.md ==================== ---- -defaultOutput: docs/stories/{{EpicNum}}.{{StoryNum}}.{{Short Title Copied from Epic File specific story}}.md -smAgent: - editableSections: Status, Story, Acceptance Criteria, Tasks / Subtasks, Dev Notes, Testing, Change Log - sectionSpecificInstructions: - "Dev Notes": - - Populate relevant information, only what was pulled from actual artifacts from docs folder, relevant to this story - - Do not invent information. - - If known add Relevant Source Tree info that relates to this story. - - If there were important notes from previous story that are relevant to this one, include them here. - - Put enough information in this section so that the dev agent should NEVER need to read the architecture documents, these notes along with the tasks and subtasks must give the Dev Agent the complete context it needs to comprehend with the least amount of overhead the information to complete the story, meeting all AC and completing all tasks+subtasks. - Testing: - - List Relevant Testing Standards from Architecture the Developer needs to conform to (test file location, test standards, etc) ---- +==================== START: .bmad-core/templates/story-tmpl.yaml ==================== +template: + id: story-template-v2 + name: Story Document + version: 2.0 + output: + format: markdown + filename: docs/stories/{{epic_num}}.{{story_num}}.{{story_title_short}}.md + title: "Story {{epic_num}}.{{story_num}}: {{story_title_short}}" -# Story {{EpicNum}}.{{StoryNum}}: {{Short Title Copied from Epic File specific story}} +workflow: + mode: interactive + elicitation: advanced-elicitation -## Status: {{ Draft | Approved | InProgress | Review | Done }} +agent_config: + editable_sections: + - Status + - Story + - Acceptance Criteria + - Tasks / Subtasks + - Dev Notes + - Testing + - Change Log -## Story - -**As a** {{role}},\ -**I want** {{action}},\ -**so that** {{benefit}} - -## Acceptance Criteria - -{{ Copy of Acceptance Criteria numbered list }} - -## Tasks / Subtasks - -- [ ] Task 1 (AC: # if applicable) - - [ ] Subtask1.1... -- [ ] Task 2 (AC: # if applicable) - - [ ] Subtask 2.1... -- [ ] Task 3 (AC: # if applicable) - - [ ] Subtask 3.1... - -## Dev Notes - -### Testing - -## Change Log - -| Date | Version | Description | Author | -| :--- | :------ | :---------- | :----- | - -## Dev Agent Record - -### Agent Model Used: {{Agent Model Name/Version}} - -### Debug Log References - -### Completion Notes List - -### File List - -## QA Results -==================== END: .bmad-core/templates/story-tmpl.md ==================== +sections: + - id: status + title: Status + type: choice + choices: [Draft, Approved, InProgress, Review, Done] + instruction: Select the current status of the story + owner: scrum-master + editors: [scrum-master, dev-agent] + + - id: story + title: Story + type: template-text + template: | + **As a** {{role}}, + **I want** {{action}}, + **so that** {{benefit}} + instruction: Define the user story using the standard format with role, action, and benefit + elicit: true + owner: scrum-master + editors: [scrum-master] + + - id: acceptance-criteria + title: Acceptance Criteria + type: numbered-list + instruction: Copy the acceptance criteria numbered list from the epic file + elicit: true + owner: scrum-master + editors: [scrum-master] + + - id: tasks-subtasks + title: Tasks / Subtasks + type: bullet-list + instruction: | + Break down the story into specific tasks and subtasks needed for implementation. + Reference applicable acceptance criteria numbers where relevant. + template: | + - [ ] Task 1 (AC: # if applicable) + - [ ] Subtask1.1... + - [ ] Task 2 (AC: # if applicable) + - [ ] Subtask 2.1... + - [ ] Task 3 (AC: # if applicable) + - [ ] Subtask 3.1... + elicit: true + owner: scrum-master + editors: [scrum-master, dev-agent] + + - id: dev-notes + title: Dev Notes + instruction: | + Populate relevant information, only what was pulled from actual artifacts from docs folder, relevant to this story: + - Do not invent information + - If known add Relevant Source Tree info that relates to this story + - If there were important notes from previous story that are relevant to this one, include them here + - Put enough information in this section so that the dev agent should NEVER need to read the architecture documents, these notes along with the tasks and subtasks must give the Dev Agent the complete context it needs to comprehend with the least amount of overhead the information to complete the story, meeting all AC and completing all tasks+subtasks + elicit: true + owner: scrum-master + editors: [scrum-master] + sections: + - id: testing-standards + title: Testing + instruction: | + List Relevant Testing Standards from Architecture the Developer needs to conform to: + - Test file location + - Test standards + - Testing frameworks and patterns to use + - Any specific testing requirements for this story + elicit: true + owner: scrum-master + editors: [scrum-master] + + - id: change-log + title: Change Log + type: table + columns: [Date, Version, Description, Author] + instruction: Track changes made to this story document + owner: scrum-master + editors: [scrum-master, dev-agent, qa-agent] + + - id: dev-agent-record + title: Dev Agent Record + instruction: This section is populated by the development agent during implementation + owner: dev-agent + editors: [dev-agent] + sections: + - id: agent-model + title: Agent Model Used + template: "{{agent_model_name_version}}" + instruction: Record the specific AI agent model and version used for development + owner: dev-agent + editors: [dev-agent] + + - id: debug-log-references + title: Debug Log References + instruction: Reference any debug logs or traces generated during development + owner: dev-agent + editors: [dev-agent] + + - id: completion-notes + title: Completion Notes List + instruction: Notes about the completion of tasks and any issues encountered + owner: dev-agent + editors: [dev-agent] + + - id: file-list + title: File List + instruction: List all files created, modified, or affected during story implementation + owner: dev-agent + editors: [dev-agent] + + - id: qa-results + title: QA Results + instruction: Results from QA Agent QA review of the completed story implementation + owner: qa-agent + editors: [qa-agent] +==================== END: .bmad-core/templates/story-tmpl.yaml ==================== ==================== START: .bmad-core/checklists/po-master-checklist.md ==================== # Product Owner (PO) Master Validation Checklist diff --git a/dist/teams/team-no-ui.txt b/dist/teams/team-no-ui.txt index 2cf55832..5681b6cf 100644 --- a/dist/teams/team-no-ui.txt +++ b/dist/teams/team-no-ui.txt @@ -51,8 +51,8 @@ agents: - architect - po workflows: - - greenfield-service - - brownfield-service + - greenfield-service.yaml + - brownfield-service.yaml ==================== END: .bmad-core/agent-teams/team-no-ui.yaml ==================== ==================== START: .bmad-core/agents/bmad-orchestrator.md ==================== @@ -61,6 +61,15 @@ workflows: CRITICAL: Read the full YAML, start activation to alter your state of being, follow startup section instructions, stay in this being until told to exit this mode: ```yaml +activation-instructions: + - Mention *help shows all available commands and options + - Check for active workflow plan using .bmad-core/utils/plan-management.md + - 'If plan exists: Show 📋 Active plan: {workflow} ({progress}% complete). Use *plan-status for details.' + - 'If plan exists: Suggest next action based on plan progress' + - Assess user goal against available agents and workflows in this bundle + - If clear match to an agent's expertise, suggest transformation with *agent command + - If project-oriented, suggest *workflow-guidance to explore options + - Load resources only when needed - never pre-load agent: name: BMad Orchestrator id: bmad-orchestrator @@ -82,17 +91,6 @@ persona: - Always use numbered lists for choices - Process commands starting with * immediately - Always remind users that commands require * prefix -startup: - - Announce: Introduce yourself as the BMad Orchestrator, explain you can coordinate agents and workflows - - IMPORTANT: Tell users that all commands start with * (e.g., *help, *agent, *workflow) - - Mention *help shows all available commands and options - - Check for active workflow plan using .bmad-core/utils/plan-management.md - - 'If plan exists: Show 📋 Active plan: {workflow} ({progress}% complete). Use *plan-status for details.' - - 'If plan exists: Suggest next action based on plan progress' - - Assess user goal against available agents and workflows in this bundle - - If clear match to an agent's expertise, suggest transformation with *agent command - - If project-oriented, suggest *workflow-guidance to explore options - - Load resources only when needed - never pre-load commands: help: Show this guide with available agents and workflows chat-mode: Start conversational mode for detailed assistance @@ -180,17 +178,18 @@ workflow-guidance: - When *workflow-guidance is called, start an interactive session and list all available workflows with brief descriptions dependencies: tasks: - - advanced-elicitation - - create-doc - - create-workflow-plan - - kb-mode-interaction - - update-workflow-plan + - advanced-elicitation.md + - create-doc.md + - create-workflow-plan.md + - kb-mode-interaction.md + - update-workflow-plan.md data: - - bmad-kb + - bmad-kb.md + - elicitation-methods.md utils: - - plan-management - - workflow-management - - template-format + - plan-management.md + - workflow-management.md + - template-format.md ``` ==================== END: .bmad-core/agents/bmad-orchestrator.md ==================== @@ -203,8 +202,9 @@ CRITICAL: Read the full YAML, start activation to alter your state of being, fol activation-instructions: - Follow all instructions in this file -> this defines you, your persona and more importantly what you can do. STAY IN CHARACTER! - Only read the files/tasks listed here when user selects them for execution to minimize context usage - - The customization field ALWAYS takes precedence over any conflicting instructions + - The agent.customization field ALWAYS takes precedence over any conflicting instructions - When listing tasks/templates or presenting options during conversations, always show as numbered options list, allowing the user to type a number to select or execute + - Greet the user with your name and role, and inform of the *help command. agent: name: Mary id: analyst @@ -229,36 +229,32 @@ persona: - Maintaining a Broad Perspective - Stay aware of market trends and dynamics - Integrity of Information - Ensure accurate sourcing and representation - Numbered Options Protocol - Always use numbered lists for selections -startup: - - Greet the user with your name and role, and inform of the *help command. commands: - help: Show numbered list of the following commands to allow selection - create-doc {template}: execute task create-doc (no template = ONLY show available templates listed under dependencies/templates below) - - yolo: Toggle Yolo Mode off on - on will skip doc section confirmations + - yolo: Toggle Yolo Mode - doc-out: Output full document to current destination file - execute-checklist {checklist}: Run task execute-checklist (default->architect-checklist) - - research {topic}: execute task create-deep-research-prompt for architectural decisions + - research-prompt {topic}: execute task create-deep-research-prompt for architectural decisions - brainstorm {topic}: Facilitate structured brainstorming session - - elicit: list the options under output set of information + - elicit: run the task advanced-elicitation - document-project: Analyze and document existing project structure comprehensively - exit: Say goodbye as the Business Analyst, and then abandon inhabiting this persona dependencies: tasks: - - facilitate-brainstorming-session - - create-deep-research-prompt - - create-doc - - advanced-elicitation - - document-project + - facilitate-brainstorming-session.md + - create-deep-research-prompt.md + - create-doc.md + - advanced-elicitation.md + - document-project.md templates: - - project-brief-tmpl - - market-research-tmpl - - competitor-analysis-tmpl - - brainstorming-output-tmpl + - project-brief-tmpl.yaml + - market-research-tmpl.yaml + - competitor-analysis-tmpl.yaml + - brainstorming-output-tmpl.yaml data: - - bmad-kb - - brainstorming-techniques - utils: - - template-format + - bmad-kb.md + - brainstorming-techniques.md ``` ==================== END: .bmad-core/agents/analyst.md ==================== @@ -273,6 +269,7 @@ activation-instructions: - Only read the files/tasks listed here when user selects them for execution to minimize context usage - The customization field ALWAYS takes precedence over any conflicting instructions - When listing tasks/templates or presenting options during conversations, always show as numbered options list, allowing the user to type a number to select or execute + - Greet the user with your name and role, and inform of the *help command. agent: name: John id: pm @@ -294,33 +291,29 @@ persona: - Collaborative & iterative approach - Proactive risk identification - Strategic thinking & outcome-oriented -startup: - - Greet the user with your name and role, and inform of the *help command. commands: - help: Show numbered list of the following commands to allow selection - - create-doc {template}: execute task create-doc (no template = ONLY show available templates listed under dependencies/templates below) - - yolo: Toggle Yolo Mode off on - on will skip doc section confirmations + - create-doc {template}: execute task create-doc for template provided, if no template then ONLY list dependencies.templates + - yolo: Toggle Yolo Mode - doc-out: Output full document to current destination file - exit: Exit (confirm) dependencies: tasks: - - create-doc - - correct-course - - create-deep-research-prompt - - brownfield-create-epic - - brownfield-create-story - - execute-checklist - - shard-doc + - create-doc.md + - correct-course.md + - create-deep-research-prompt.md + - brownfield-create-epic.md + - brownfield-create-story.md + - execute-checklist.md + - shard-doc.md templates: - - prd-tmpl - - brownfield-prd-tmpl + - prd-tmpl.yaml + - brownfield-prd-tmpl.yaml checklists: - - pm-checklist - - change-checklist + - pm-checklist.md + - change-checklist.md data: - - technical-preferences - utils: - - template-format + - technical-preferences.md ``` ==================== END: .bmad-core/agents/pm.md ==================== @@ -335,6 +328,8 @@ activation-instructions: - Only read the files/tasks listed here when user selects them for execution to minimize context usage - The customization field ALWAYS takes precedence over any conflicting instructions - When listing tasks/templates or presenting options during conversations, always show as numbered options list, allowing the user to type a number to select or execute + - Greet the user with your name and role, and inform of the *help command. + - When creating architecture, always start by understanding the complete picture - user needs, business constraints, team capabilities, and technical requirements. agent: name: Winston id: architect @@ -358,34 +353,29 @@ persona: - Data-Centric Design - Let data requirements drive architecture - Cost-Conscious Engineering - Balance technical ideals with financial reality - Living Architecture - Design for change and adaptation -startup: - - Greet the user with your name and role, and inform of the *help command. - - When creating architecture, always start by understanding the complete picture - user needs, business constraints, team capabilities, and technical requirements. commands: - help: Show numbered list of the following commands to allow selection - create-doc {template}: execute task create-doc (no template = ONLY show available templates listed under dependencies/templates below) - - yolo: Toggle Yolo Mode off on - on will skip doc section confirmations + - yolo: Toggle Yolo Mode - doc-out: Output full document to current destination file - execute-checklist {checklist}: Run task execute-checklist (default->architect-checklist) - research {topic}: execute task create-deep-research-prompt for architectural decisions - exit: Say goodbye as the Architect, and then abandon inhabiting this persona dependencies: tasks: - - create-doc - - create-deep-research-prompt - - document-project - - execute-checklist + - create-doc.md + - create-deep-research-prompt.md + - document-project.md + - execute-checklist.md templates: - - architecture-tmpl - - front-end-architecture-tmpl - - fullstack-architecture-tmpl - - brownfield-architecture-tmpl + - architecture-tmpl.yaml + - front-end-architecture-tmpl.yaml + - fullstack-architecture-tmpl.yaml + - brownfield-architecture-tmpl.yaml checklists: - - architect-checklist + - architect-checklist.md data: - - technical-preferences - utils: - - template-format + - technical-preferences.md ``` ==================== END: .bmad-core/agents/architect.md ==================== @@ -400,6 +390,7 @@ activation-instructions: - Only read the files/tasks listed here when user selects them for execution to minimize context usage - The customization field ALWAYS takes precedence over any conflicting instructions - When listing tasks/templates or presenting options during conversations, always show as numbered options list, allowing the user to type a number to select or execute + - Greet the user with your name and role, and inform of the *help command. agent: name: Sarah id: po @@ -423,8 +414,6 @@ persona: - User Collaboration for Validation - Seek input at critical checkpoints - Focus on Executable & Value-Driven Increments - Ensure work aligns with MVP goals - Documentation Ecosystem Integrity - Maintain consistency across all documents -startup: - - Greet the user with your name and role, and inform of the *help command. commands: - help: Show numbered list of the following commands to allow selection - create-doc {template}: execute task create-doc (no template = ONLY show available templates listed under dependencies/templates below) @@ -439,19 +428,17 @@ commands: - exit: Exit (confirm) dependencies: tasks: - - execute-checklist - - shard-doc - - correct-course - - brownfield-create-epic - - brownfield-create-story - - validate-next-story + - execute-checklist.md + - shard-doc.md + - correct-course.md + - brownfield-create-epic.md + - brownfield-create-story.md + - validate-next-story.md templates: - - story-tmpl + - story-tmpl.yaml checklists: - - po-master-checklist - - change-checklist - utils: - - template-format + - po-master-checklist.md + - change-checklist.md ``` ==================== END: .bmad-core/agents/po.md ==================== @@ -576,97 +563,85 @@ Choose a number (0-8) or 9 to proceed: ==================== END: .bmad-core/tasks/advanced-elicitation.md ==================== ==================== START: .bmad-core/tasks/create-doc.md ==================== -# Create Document from Template Task +# Create Document from Template (YAML Driven) -## Purpose +## CRITICAL: Mandatory Elicitation Format -Generate documents from templates by EXECUTING (not just reading) embedded instructions from the perspective of the selected agent persona. +**When `elicit: true`, ALWAYS use this exact format:** -## CRITICAL RULES +1. Present section content +2. Provide detailed rationale (explain trade-offs, assumptions, decisions made) +3. Present numbered options 1-9: + - **Option 1:** Always "Proceed to next section" + - **Options 2-9:** Select 8 methods from data/elicitation-methods + - End with: "Select 1-9 or just type your question/feedback:" -1. **Templates are PROGRAMS** - Execute every [[LLM:]] instruction exactly as written -2. **NEVER show markup** - Hide all [[LLM:]], {{placeholders}}, @{examples}, and template syntax -3. **STOP and EXECUTE** - When you see "apply tasks#" or "execute tasks#", STOP and run that task immediately -4. **WAIT for user input** - At review points and after elicitation tasks +**NEVER ask yes/no questions or use any other format.** -## Execution Flow +## Processing Flow -### 0. Check Workflow Plan (if configured) +1. **Parse YAML template** - Load template metadata and sections +2. **Set preferences** - Show current mode (Interactive), confirm output file +3. **Process each section:** + - Skip if condition unmet + - Check agent permissions (owner/editors) - note if section is restricted to specific agents + - Draft content using section instruction + - Present content + detailed rationale + - **IF elicit: true** → MANDATORY 1-9 options format + - Save to file if possible +4. **Continue until complete** -[[LLM: Check if plan tracking is enabled in core-config.yaml]] +## Detailed Rationale Requirements -- If `workflow.trackProgress: true`, check for active plan using .bmad-core/utils/plan-management.md -- If plan exists and this document creation is part of the plan: - - Verify this is the expected next step - - If out of sequence and `enforceSequence: true`, warn user and halt without user override - - If out of sequence and `enforceSequence: false`, ask for confirmation -- Continue with normal execution after plan check +When presenting section content, ALWAYS include rationale that explains: -### 1. Identify Template +- Trade-offs and choices made (what was chosen over alternatives and why) +- Key assumptions made during drafting +- Interesting or questionable decisions that need user attention +- Areas that might need validation -- Load from `.bmad-core/templates/*.md` or `.bmad-core/templates directory` -- Agent-specific templates are listed in agent's dependencies -- If agent has `templates: [prd-tmpl, architecture-tmpl]` for example, then offer to create "PRD" and "Architecture" documents +## Elicitation Results Flow -### 2. Ask Interaction Mode +After user selects elicitation method (2-9): -> 1. **Incremental** - Section by section with reviews -> 2. **YOLO Mode** - Complete draft then review (user can type `/yolo` anytime to switch) +1. Execute method from data/elicitation-methods +2. Present results with insights +3. Offer options: + - **1. Apply changes and update section** + - **2. Return to elicitation menu** + - **3. Ask any questions or engage further with this elicitation** -### 3. Execute Template +## Agent Permissions -- Replace {{placeholders}} with real content -- Execute [[LLM:]] instructions as you encounter them -- Process <> loops and ^^CONDITIONS^^ -- Use @{examples} for guidance but never output them +When processing sections with agent permission fields: -### 4. Key Execution Patterns +- **owner**: Note which agent role initially creates/populates the section +- **editors**: List agent roles allowed to modify the section +- **readonly**: Mark sections that cannot be modified after creation -**When you see:** `[[LLM: Draft X and immediately execute .bmad-core/tasks/advanced-elicitation.md]]` +**For sections with restricted access:** -- Draft the content -- Present it to user -- IMMEDIATELY execute the task -- Wait for completion before continuing +- Include a note in the generated document indicating the responsible agent +- Example: "_(This section is owned by dev-agent and can only be modified by dev-agent)_" -**When you see:** `[[LLM: After section completion, apply .bmad-core/tasks/Y.md]]` +## YOLO Mode -- Finish the section -- STOP and execute the task -- Wait for user input +User can type `#yolo` to toggle to YOLO mode (process all sections at once). -### 5. Validation & Final Presentation +## CRITICAL REMINDERS -- Run any specified checklists -- Present clean, formatted content only -- No truncation or summarization -- Begin directly with content (no preamble) -- Include any handoff prompts from template +**❌ NEVER:** -### 6. Update Workflow Plan (if applicable) +- Ask yes/no questions for elicitation +- Use any format other than 1-9 numbered options +- Create new elicitation methods -[[LLM: After successful document creation]] +**✅ ALWAYS:** -- If plan tracking is enabled and document was part of plan: - - Call update-workflow-plan task to mark step complete - - Parameters: task: create-doc, step_id: {from plan}, status: complete - - Show next recommended step from plan - -## Common Mistakes to Avoid - -❌ Skipping elicitation tasks -❌ Showing template markup to users -❌ Continuing past STOP signals -❌ Combining multiple review points - -✅ Execute ALL instructions in sequence -✅ Present only clean, formatted content -✅ Stop at every elicitation point -✅ Wait for user confirmation when instructed - -## Remember - -Templates contain precise instructions for a reason. Follow them exactly to ensure document quality and completeness. +- Use exact 1-9 format when elicit: true +- Select options 2-9 from data/elicitation-methods only +- Provide detailed rationale explaining decisions +- End with "Select 1-9 or just type your question/feedback:" ==================== END: .bmad-core/tasks/create-doc.md ==================== ==================== START: .bmad-core/tasks/create-workflow-plan.md ==================== @@ -2098,6 +2073,143 @@ Use the **expansion-creator** pack to build your own: - **Contributing**: See `CONTRIBUTING.md` for full guidelines ==================== END: .bmad-core/data/bmad-kb.md ==================== +==================== START: .bmad-core/data/elicitation-methods.md ==================== +# Elicitation Methods Data + +## Core Reflective Methods + +**Expand or Contract for Audience** +- Ask whether to 'expand' (add detail, elaborate) or 'contract' (simplify, clarify) +- Identify specific target audience if relevant +- Tailor content complexity and depth accordingly + +**Explain Reasoning (CoT Step-by-Step)** +- Walk through the step-by-step thinking process +- Reveal underlying assumptions and decision points +- Show how conclusions were reached from current role's perspective + +**Critique and Refine** +- Review output for flaws, inconsistencies, or improvement areas +- Identify specific weaknesses from role's expertise +- Suggest refined version reflecting domain knowledge + +## Structural Analysis Methods + +**Analyze Logical Flow and Dependencies** +- Examine content structure for logical progression +- Check internal consistency and coherence +- Identify and validate dependencies between elements +- Confirm effective ordering and sequencing + +**Assess Alignment with Overall Goals** +- Evaluate content contribution to stated objectives +- Identify any misalignments or gaps +- Interpret alignment from specific role's perspective +- Suggest adjustments to better serve goals + +## Risk and Challenge Methods + +**Identify Potential Risks and Unforeseen Issues** +- Brainstorm potential risks from role's expertise +- Identify overlooked edge cases or scenarios +- Anticipate unintended consequences +- Highlight implementation challenges + +**Challenge from Critical Perspective** +- Adopt critical stance on current content +- Play devil's advocate from specified viewpoint +- Argue against proposal highlighting weaknesses +- Apply YAGNI principles when appropriate (scope trimming) + +## Creative Exploration Methods + +**Tree of Thoughts Deep Dive** +- Break problem into discrete "thoughts" or intermediate steps +- Explore multiple reasoning paths simultaneously +- Use self-evaluation to classify each path as "sure", "likely", or "impossible" +- Apply search algorithms (BFS/DFS) to find optimal solution paths + +**Hindsight is 20/20: The 'If Only...' Reflection** +- Imagine retrospective scenario based on current content +- Identify the one "if only we had known/done X..." insight +- Describe imagined consequences humorously or dramatically +- Extract actionable learnings for current context + +## Multi-Persona Collaboration Methods + +**Agile Team Perspective Shift** +- Rotate through different Scrum team member viewpoints +- Product Owner: Focus on user value and business impact +- Scrum Master: Examine process flow and team dynamics +- Developer: Assess technical implementation and complexity +- QA: Identify testing scenarios and quality concerns + +**Stakeholder Round Table** +- Convene virtual meeting with multiple personas +- Each persona contributes unique perspective on content +- Identify conflicts and synergies between viewpoints +- Synthesize insights into actionable recommendations + +**Meta-Prompting Analysis** +- Step back to analyze the structure and logic of current approach +- Question the format and methodology being used +- Suggest alternative frameworks or mental models +- Optimize the elicitation process itself + +## Advanced 2025 Techniques + +**Self-Consistency Validation** +- Generate multiple reasoning paths for same problem +- Compare consistency across different approaches +- Identify most reliable and robust solution +- Highlight areas where approaches diverge and why + +**ReWOO (Reasoning Without Observation)** +- Separate parametric reasoning from tool-based actions +- Create reasoning plan without external dependencies +- Identify what can be solved through pure reasoning +- Optimize for efficiency and reduced token usage + +**Persona-Pattern Hybrid** +- Combine specific role expertise with elicitation pattern +- Architect + Risk Analysis: Deep technical risk assessment +- UX Expert + User Journey: End-to-end experience critique +- PM + Stakeholder Analysis: Multi-perspective impact review + +**Emergent Collaboration Discovery** +- Allow multiple perspectives to naturally emerge +- Identify unexpected insights from persona interactions +- Explore novel combinations of viewpoints +- Capture serendipitous discoveries from multi-agent thinking + +## Game-Based Elicitation Methods + +**Red Team vs Blue Team** +- Red Team: Attack the proposal, find vulnerabilities +- Blue Team: Defend and strengthen the approach +- Competitive analysis reveals blind spots +- Results in more robust, battle-tested solutions + +**Innovation Tournament** +- Pit multiple alternative approaches against each other +- Score each approach across different criteria +- Crowd-source evaluation from different personas +- Identify winning combination of features + +**Escape Room Challenge** +- Present content as constraints to work within +- Find creative solutions within tight limitations +- Identify minimum viable approach +- Discover innovative workarounds and optimizations + +## Process Control + +**Proceed / No Further Actions** +- Acknowledge choice to finalize current work +- Accept output as-is or move to next step +- Prepare to continue without additional elicitation +==================== END: .bmad-core/data/elicitation-methods.md ==================== + ==================== START: .bmad-core/utils/plan-management.md ==================== # Plan Management Utility @@ -3184,952 +3296,939 @@ Apply the advanced elicitation task after major sections to refine based on user - The goal is PRACTICAL documentation for AI agents doing real work ==================== END: .bmad-core/tasks/document-project.md ==================== -==================== START: .bmad-core/templates/project-brief-tmpl.md ==================== ---- -defaultOutput: docs/brief.md ---- - -# Project Brief: {{Project Name}} - -[[LLM: This template guides creation of a comprehensive Project Brief that serves as the foundational input for product development. - -Start by asking the user which mode they prefer: - -1. **Interactive Mode** - Work through each section collaboratively -2. **YOLO Mode** - Generate complete draft for review and refinement - -Before beginning, understand what inputs are available (brainstorming results, market research, competitive analysis, initial ideas) and gather project context.]] - -## Executive Summary - -[[LLM: Create a concise overview that captures the essence of the project. Include: - -- Product concept in 1-2 sentences -- Primary problem being solved -- Target market identification -- Key value proposition]] - -{{Write executive summary based on information gathered}} - -## Problem Statement - -[[LLM: Articulate the problem with clarity and evidence. Address: - -- Current state and pain points -- Impact of the problem (quantify if possible) -- Why existing solutions fall short -- Urgency and importance of solving this now]] - -{{Detailed problem description with supporting evidence}} - -## Proposed Solution - -[[LLM: Describe the solution approach at a high level. Include: - -- Core concept and approach -- Key differentiators from existing solutions -- Why this solution will succeed where others haven't -- High-level vision for the product]] - -{{Solution description focusing on the "what" and "why", not implementation details}} - -## Target Users - -[[LLM: Define and characterize the intended users with specificity. For each user segment include: - -- Demographic/firmographic profile -- Current behaviors and workflows -- Specific needs and pain points -- Goals they're trying to achieve]] - -### Primary User Segment: {{Segment Name}} - -{{Detailed description of primary users}} - -### Secondary User Segment: {{Segment Name}} - -{{Description of secondary users if applicable}} - -## Goals & Success Metrics - -[[LLM: Establish clear objectives and how to measure success. Make goals SMART (Specific, Measurable, Achievable, Relevant, Time-bound)]] - -### Business Objectives - -- {{Objective 1 with metric}} -- {{Objective 2 with metric}} -- {{Objective 3 with metric}} - -### User Success Metrics - -- {{How users will measure value}} -- {{Engagement metrics}} -- {{Satisfaction indicators}} - -### Key Performance Indicators (KPIs) - -- {{KPI 1: Definition and target}} -- {{KPI 2: Definition and target}} -- {{KPI 3: Definition and target}} - -## MVP Scope - -[[LLM: Define the minimum viable product clearly. Be specific about what's in and what's out. Help user distinguish must-haves from nice-to-haves.]] - -### Core Features (Must Have) - -- **Feature 1:** {{Brief description and why it's essential}} -- **Feature 2:** {{Brief description and why it's essential}} -- **Feature 3:** {{Brief description and why it's essential}} - -### Out of Scope for MVP - -- {{Feature/capability explicitly not in MVP}} -- {{Feature/capability to be considered post-MVP}} - -### MVP Success Criteria - -{{Define what constitutes a successful MVP launch}} - -## Post-MVP Vision - -[[LLM: Outline the longer-term product direction without overcommitting to specifics]] - -### Phase 2 Features - -{{Next priority features after MVP success}} - -### Long-term Vision - -{{Where this product could go in 1-2 years}} - -### Expansion Opportunities - -{{Potential new markets, use cases, or integrations}} - -## Technical Considerations - -[[LLM: Document known technical constraints and preferences. Note these are initial thoughts, not final decisions.]] - -### Platform Requirements - -- **Target Platforms:** {{Web, mobile, desktop, etc.}} -- **Browser/OS Support:** {{Specific requirements}} -- **Performance Requirements:** {{Load times, concurrent users, etc.}} - -### Technology Preferences - -- **Frontend:** {{If any preferences exist}} -- **Backend:** {{If any preferences exist}} -- **Database:** {{If any preferences exist}} -- **Hosting/Infrastructure:** {{Cloud preferences, on-prem requirements}} - -### Architecture Considerations - -- **Repository Structure:** {{Initial thoughts on monorepo vs. polyrepo}} -- **Service Architecture:** {{Initial thoughts on monolith vs. microservices}} -- **Integration Requirements:** {{Third-party services, APIs}} -- **Security/Compliance:** {{Any specific requirements}} - -## Constraints & Assumptions - -[[LLM: Clearly state limitations and assumptions to set realistic expectations]] - -### Constraints - -- **Budget:** {{If known}} -- **Timeline:** {{Target launch date or development timeframe}} -- **Resources:** {{Team size, skill constraints}} -- **Technical:** {{Legacy systems, required tech stack}} - -### Key Assumptions - -- {{Assumption about users, market, or technology}} -- {{Assumption about resources or support}} -- {{Assumption about external dependencies}} - -## Risks & Open Questions - -[[LLM: Identify unknowns and potential challenges proactively]] - -### Key Risks - -- **Risk 1:** {{Description and potential impact}} -- **Risk 2:** {{Description and potential impact}} -- **Risk 3:** {{Description and potential impact}} - -### Open Questions - -- {{Question needing research or decision}} -- {{Question about technical approach}} -- {{Question about market or users}} - -### Areas Needing Further Research - -- {{Topic requiring deeper investigation}} -- {{Validation needed before proceeding}} - -## Appendices - -### A. Research Summary - -{{If applicable, summarize key findings from: - -- Market research -- Competitive analysis -- User interviews -- Technical feasibility studies}} - -### B. Stakeholder Input - -{{Key feedback or requirements from stakeholders}} - -### C. References - -{{Links to relevant documents, research, or examples}} - -## Next Steps - -### Immediate Actions - -1. {{First concrete next step}} -2. {{Second concrete next step}} -3. {{Third concrete next step}} - -### PM Handoff - -This Project Brief provides the full context for {{Project Name}}. Please start in 'PRD Generation Mode', review the brief thoroughly to work with the user to create the PRD section by section as the template indicates, asking for any necessary clarification or suggesting improvements. - ---- - -[[LLM: After completing each major section (not subsections), offer advanced elicitation with these custom options for project briefs: - -**Project Brief Elicitation Actions** 0. Expand section with more specific details - -1. Validate against similar successful products -2. Stress test assumptions with edge cases -3. Explore alternative solution approaches -4. Analyze resource/constraint trade-offs -5. Generate risk mitigation strategies -6. Challenge scope from MVP minimalist view -7. Brainstorm creative feature possibilities -8. If only we had [resource/capability/time]... -9. Proceed to next section - -These replace the standard elicitation options when working on project brief documents.]] -==================== END: .bmad-core/templates/project-brief-tmpl.md ==================== - -==================== START: .bmad-core/templates/market-research-tmpl.md ==================== -# Market Research Report: {{Project/Product Name}} - -[[LLM: The default path and filename unless specified is docs/market-research.md]] - -[[LLM: This template guides the creation of a comprehensive market research report. Begin by understanding what market insights the user needs and why. Work through each section systematically, using the appropriate analytical frameworks based on the research objectives.]] - -## Executive Summary - -{{Provide a high-level overview of key findings, market opportunity assessment, and strategic recommendations. Write this section LAST after completing all other sections.}} - -## Research Objectives & Methodology - -### Research Objectives - -{{List the primary objectives of this market research: - -- What decisions will this research inform? -- What specific questions need to be answered? -- What are the success criteria for this research?}} - -### Research Methodology - -{{Describe the research approach: - -- Data sources used (primary/secondary) -- Analysis frameworks applied -- Data collection timeframe -- Limitations and assumptions}} - -## Market Overview - -### Market Definition - -{{Define the market being analyzed: - -- Product/service category -- Geographic scope -- Customer segments included -- Value chain position}} - -### Market Size & Growth - -[[LLM: Guide through TAM, SAM, SOM calculations with clear assumptions. Use one or more approaches: - -- Top-down: Start with industry data, narrow down -- Bottom-up: Build from customer/unit economics -- Value theory: Based on value provided vs. alternatives]] - -#### Total Addressable Market (TAM) - -{{Calculate and explain the total market opportunity}} - -#### Serviceable Addressable Market (SAM) - -{{Define the portion of TAM you can realistically reach}} - -#### Serviceable Obtainable Market (SOM) - -{{Estimate the portion you can realistically capture}} - -### Market Trends & Drivers - -[[LLM: Analyze key trends shaping the market using appropriate frameworks like PESTEL]] - -#### Key Market Trends - -{{List and explain 3-5 major trends: - -- Trend 1: Description and impact -- Trend 2: Description and impact -- etc.}} - -#### Growth Drivers - -{{Identify primary factors driving market growth}} - -#### Market Inhibitors - -{{Identify factors constraining market growth}} - -## Customer Analysis - -### Target Segment Profiles - -[[LLM: For each segment, create detailed profiles including demographics/firmographics, psychographics, behaviors, needs, and willingness to pay]] - -#### Segment 1: {{Segment Name}} - -- **Description:** {{Brief overview}} -- **Size:** {{Number of customers/market value}} -- **Characteristics:** {{Key demographics/firmographics}} -- **Needs & Pain Points:** {{Primary problems they face}} -- **Buying Process:** {{How they make purchasing decisions}} -- **Willingness to Pay:** {{Price sensitivity and value perception}} - -<> - -### Jobs-to-be-Done Analysis - -[[LLM: Uncover what customers are really trying to accomplish]] - -#### Functional Jobs - -{{List practical tasks and objectives customers need to complete}} - -#### Emotional Jobs - -{{Describe feelings and perceptions customers seek}} - -#### Social Jobs - -{{Explain how customers want to be perceived by others}} - -### Customer Journey Mapping - -[[LLM: Map the end-to-end customer experience for primary segments]] - -{{For primary customer segment: - -1. **Awareness:** How they discover solutions -2. **Consideration:** Evaluation criteria and process -3. **Purchase:** Decision triggers and barriers -4. **Onboarding:** Initial experience expectations -5. **Usage:** Ongoing interaction patterns -6. **Advocacy:** Referral and expansion behaviors}} - -## Competitive Landscape - -### Market Structure - -{{Describe the overall competitive environment: - -- Number of competitors -- Market concentration -- Competitive intensity}} - -### Major Players Analysis - -{{For top 3-5 competitors: - -- Company name and brief description -- Market share estimate -- Key strengths and weaknesses -- Target customer focus -- Pricing strategy}} - -### Competitive Positioning - -{{Analyze how competitors are positioned: - -- Value propositions -- Differentiation strategies -- Market gaps and opportunities}} - -## Industry Analysis - -### Porter's Five Forces Assessment - -[[LLM: Analyze each force with specific evidence and implications]] - -#### Supplier Power: {{Low/Medium/High}} - -{{Analysis and implications}} - -#### Buyer Power: {{Low/Medium/High}} - -{{Analysis and implications}} - -#### Competitive Rivalry: {{Low/Medium/High}} - -{{Analysis and implications}} - -#### Threat of New Entry: {{Low/Medium/High}} - -{{Analysis and implications}} - -#### Threat of Substitutes: {{Low/Medium/High}} - -{{Analysis and implications}} - -### Technology Adoption Lifecycle Stage - -{{Identify where the market is in the adoption curve: - -- Current stage and evidence -- Implications for strategy -- Expected progression timeline}} - -## Opportunity Assessment - -### Market Opportunities - -[[LLM: Identify specific opportunities based on the analysis]] - -#### Opportunity 1: {{Name}} - -- **Description:** {{What is the opportunity?}} -- **Size/Potential:** {{Quantify if possible}} -- **Requirements:** {{What's needed to capture it?}} -- **Risks:** {{Key challenges or barriers}} - -<> - -### Strategic Recommendations - -#### Go-to-Market Strategy - -{{Recommend approach for market entry/expansion: - -- Target segment prioritization -- Positioning strategy -- Channel strategy -- Partnership opportunities}} - -#### Pricing Strategy - -{{Based on willingness to pay analysis and competitive landscape: - -- Recommended pricing model -- Price points/ranges -- Value metric -- Competitive positioning}} - -#### Risk Mitigation - -{{Key risks and mitigation strategies: - -- Market risks -- Competitive risks -- Execution risks -- Regulatory/compliance risks}} - -## Appendices - -### A. Data Sources - -{{List all sources used in the research}} - -### B. Detailed Calculations - -{{Include any complex calculations or models}} - -### C. Additional Analysis - -{{Any supplementary analysis not included in main body}} - ---- - -[[LLM: After completing the document, offer advanced elicitation with these custom options for market research: - -**Market Research Elicitation Actions** 0. Expand market sizing calculations with sensitivity analysis - -1. Deep dive into a specific customer segment -2. Analyze an emerging market trend in detail -3. Compare this market to an analogous market -4. Stress test market assumptions -5. Explore adjacent market opportunities -6. Challenge market definition and boundaries -7. Generate strategic scenarios (best/base/worst case) -8. If only we had considered [X market factor]... -9. Proceed to next section - -These replace the standard elicitation options when working on market research documents.]] -==================== END: .bmad-core/templates/market-research-tmpl.md ==================== - -==================== START: .bmad-core/templates/competitor-analysis-tmpl.md ==================== -# Competitive Analysis Report: {{Project/Product Name}} - -[[LLM: The default path and filename unless specified is docs/competitor-analysis.md]] - -[[LLM: This template guides comprehensive competitor analysis. Start by understanding the user's competitive intelligence needs and strategic objectives. Help them identify and prioritize competitors before diving into detailed analysis.]] - -## Executive Summary - -{{Provide high-level competitive insights, main threats and opportunities, and recommended strategic actions. Write this section LAST after completing all analysis.}} - -## Analysis Scope & Methodology - -### Analysis Purpose - -{{Define the primary purpose: - -- New market entry assessment -- Product positioning strategy -- Feature gap analysis -- Pricing strategy development -- Partnership/acquisition targets -- Competitive threat assessment}} - -### Competitor Categories Analyzed - -{{List categories included: - -- Direct Competitors: Same product/service, same target market -- Indirect Competitors: Different product, same need/problem -- Potential Competitors: Could enter market easily -- Substitute Products: Alternative solutions -- Aspirational Competitors: Best-in-class examples}} - -### Research Methodology - -{{Describe approach: - -- Information sources used -- Analysis timeframe -- Confidence levels -- Limitations}} - -## Competitive Landscape Overview - -### Market Structure - -{{Describe the competitive environment: - -- Number of active competitors -- Market concentration (fragmented/consolidated) -- Competitive dynamics -- Recent market entries/exits}} - -### Competitor Prioritization Matrix - -[[LLM: Help categorize competitors by market share and strategic threat level]] - -{{Create a 2x2 matrix: - -- Priority 1 (Core Competitors): High Market Share + High Threat -- Priority 2 (Emerging Threats): Low Market Share + High Threat -- Priority 3 (Established Players): High Market Share + Low Threat -- Priority 4 (Monitor Only): Low Market Share + Low Threat}} - -## Individual Competitor Profiles - -[[LLM: Create detailed profiles for each Priority 1 and Priority 2 competitor. For Priority 3 and 4, create condensed profiles.]] - -### {{Competitor Name}} - Priority {{1/2/3/4}} - -#### Company Overview - -- **Founded:** {{Year, founders}} -- **Headquarters:** {{Location}} -- **Company Size:** {{Employees, revenue if known}} -- **Funding:** {{Total raised, key investors}} -- **Leadership:** {{Key executives}} - -#### Business Model & Strategy - -- **Revenue Model:** {{How they make money}} -- **Target Market:** {{Primary customer segments}} -- **Value Proposition:** {{Core value promise}} -- **Go-to-Market Strategy:** {{Sales and marketing approach}} -- **Strategic Focus:** {{Current priorities}} - -#### Product/Service Analysis - -- **Core Offerings:** {{Main products/services}} -- **Key Features:** {{Standout capabilities}} -- **User Experience:** {{UX strengths/weaknesses}} -- **Technology Stack:** {{If relevant/known}} -- **Pricing:** {{Model and price points}} - -#### Strengths & Weaknesses - -**Strengths:** - -- {{Strength 1}} -- {{Strength 2}} -- {{Strength 3}} - -**Weaknesses:** - -- {{Weakness 1}} -- {{Weakness 2}} -- {{Weakness 3}} - -#### Market Position & Performance - -- **Market Share:** {{Estimate if available}} -- **Customer Base:** {{Size, notable clients}} -- **Growth Trajectory:** {{Trending up/down/stable}} -- **Recent Developments:** {{Key news, releases}} - -<> - -## Comparative Analysis - -### Feature Comparison Matrix - -[[LLM: Create a detailed comparison table of key features across competitors]] - -| Feature Category | {{Your Company}} | {{Competitor 1}} | {{Competitor 2}} | {{Competitor 3}} | -| --------------------------- | ------------------- | ------------------- | ------------------- | ------------------- | -| **Core Functionality** | -| Feature A | {{✓/✗/Partial}} | {{✓/✗/Partial}} | {{✓/✗/Partial}} | {{✓/✗/Partial}} | -| Feature B | {{✓/✗/Partial}} | {{✓/✗/Partial}} | {{✓/✗/Partial}} | {{✓/✗/Partial}} | -| **User Experience** | -| Mobile App | {{Rating/Status}} | {{Rating/Status}} | {{Rating/Status}} | {{Rating/Status}} | -| Onboarding Time | {{Time}} | {{Time}} | {{Time}} | {{Time}} | -| **Integration & Ecosystem** | -| API Availability | {{Yes/No/Limited}} | {{Yes/No/Limited}} | {{Yes/No/Limited}} | {{Yes/No/Limited}} | -| Third-party Integrations | {{Number/Key ones}} | {{Number/Key ones}} | {{Number/Key ones}} | {{Number/Key ones}} | -| **Pricing & Plans** | -| Starting Price | {{$X}} | {{$X}} | {{$X}} | {{$X}} | -| Free Tier | {{Yes/No}} | {{Yes/No}} | {{Yes/No}} | {{Yes/No}} | - -### SWOT Comparison - -[[LLM: Create SWOT analysis for your solution vs. top competitors]] - -#### Your Solution - -- **Strengths:** {{List key strengths}} -- **Weaknesses:** {{List key weaknesses}} -- **Opportunities:** {{List opportunities}} -- **Threats:** {{List threats}} - -#### vs. {{Main Competitor}} - -- **Competitive Advantages:** {{Where you're stronger}} -- **Competitive Disadvantages:** {{Where they're stronger}} -- **Differentiation Opportunities:** {{How to stand out}} - -### Positioning Map - -[[LLM: Describe competitor positions on key dimensions]] - -{{Create a positioning description using 2 key dimensions relevant to the market, such as: - -- Price vs. Features -- Ease of Use vs. Power -- Specialization vs. Breadth -- Self-Serve vs. High-Touch}} - -## Strategic Analysis - -### Competitive Advantages Assessment - -#### Sustainable Advantages - -{{Identify moats and defensible positions: - -- Network effects -- Switching costs -- Brand strength -- Technology barriers -- Regulatory advantages}} - -#### Vulnerable Points - -{{Where competitors could be challenged: - -- Weak customer segments -- Missing features -- Poor user experience -- High prices -- Limited geographic presence}} - -### Blue Ocean Opportunities - -[[LLM: Identify uncontested market spaces]] - -{{List opportunities to create new market space: - -- Underserved segments -- Unaddressed use cases -- New business models -- Geographic expansion -- Different value propositions}} - -## Strategic Recommendations - -### Differentiation Strategy - -{{How to position against competitors: - -- Unique value propositions to emphasize -- Features to prioritize -- Segments to target -- Messaging and positioning}} - -### Competitive Response Planning - -#### Offensive Strategies - -{{How to gain market share: - -- Target competitor weaknesses -- Win competitive deals -- Capture their customers}} - -#### Defensive Strategies - -{{How to protect your position: - -- Strengthen vulnerable areas -- Build switching costs -- Deepen customer relationships}} - -### Partnership & Ecosystem Strategy - -{{Potential collaboration opportunities: - -- Complementary players -- Channel partners -- Technology integrations -- Strategic alliances}} - -## Monitoring & Intelligence Plan - -### Key Competitors to Track - -{{Priority list with rationale}} - -### Monitoring Metrics - -{{What to track: - -- Product updates -- Pricing changes -- Customer wins/losses -- Funding/M&A activity -- Market messaging}} - -### Intelligence Sources - -{{Where to gather ongoing intelligence: - -- Company websites/blogs -- Customer reviews -- Industry reports -- Social media -- Patent filings}} - -### Update Cadence - -{{Recommended review schedule: - -- Weekly: {{What to check}} -- Monthly: {{What to review}} -- Quarterly: {{Deep analysis}}}} - ---- - -[[LLM: After completing the document, offer advanced elicitation with these custom options for competitive analysis: - -**Competitive Analysis Elicitation Actions** 0. Deep dive on a specific competitor's strategy - -1. Analyze competitive dynamics in a specific segment -2. War game competitive responses to your moves -3. Explore partnership vs. competition scenarios -4. Stress test differentiation claims -5. Analyze disruption potential (yours or theirs) -6. Compare to competition in adjacent markets -7. Generate win/loss analysis insights -8. If only we had known about [competitor X's plan]... -9. Proceed to next section - -These replace the standard elicitation options when working on competitive analysis documents.]] -==================== END: .bmad-core/templates/competitor-analysis-tmpl.md ==================== - -==================== START: .bmad-core/templates/brainstorming-output-tmpl.md ==================== ---- -defaultOutput: docs/brainstorming-session-results.md ---- - -# Brainstorming Session Results - -**Session Date:** [DATE] -**Facilitator:** [Agent Role] [Agent Name] -**Participant:** [USER NAME] - -## Executive Summary - -**Topic:** [SESSION TOPIC] - -**Session Goals:** [STATED GOALS] - -**Techniques Used:** [LIST OF TECHNIQUES AND DURATION] - -**Total Ideas Generated:** [NUMBER] - -**Key Themes Identified:** - -- [THEME 1] -- [THEME 2] -- [THEME 3] - ---- - -## Technique Sessions - -### [TECHNIQUE NAME 1] - [DURATION] - -**Description:** [BRIEF DESCRIPTION OF TECHNIQUE] - -**Ideas Generated:** - -1. [USER IDEA 1] -2. [USER IDEA 2] -3. [USER IDEA 3] -[etc.] - -**Insights Discovered:** - -- [INSIGHT 1] -- [INSIGHT 2] - -**Notable Connections:** - -- [CONNECTION OR PATTERN IDENTIFIED] - ---- - -### [TECHNIQUE NAME 2] - [DURATION] - -[Repeat format for each technique used] - ---- - -## Idea Categorization - -### Immediate Opportunities - -*Ideas ready to implement now* - -1. **[IDEA NAME]** - - Description: [BRIEF DESCRIPTION] - - Why immediate: [RATIONALE] - - Resources needed: [BASIC REQUIREMENTS] - -### Future Innovations - -*Ideas requiring development/research* - -1. **[IDEA NAME]** - - Description: [BRIEF DESCRIPTION] - - Development needed: [WHAT'S REQUIRED] - - Timeline estimate: [ROUGH TIMEFRAME] - -### Moonshots - -*Ambitious, transformative concepts* - -1. **[IDEA NAME]** - - Description: [BRIEF DESCRIPTION] - - Transformative potential: [WHY IT'S A MOONSHOT] - - Challenges to overcome: [MAJOR OBSTACLES] - -### Insights & Learnings - -*Key realizations from the session* - -- [INSIGHT 1]: [DESCRIPTION AND IMPLICATIONS] -- [INSIGHT 2]: [DESCRIPTION AND IMPLICATIONS] - ---- - -## Action Planning - -### Top 3 Priority Ideas - -**#1 Priority: [IDEA NAME]** - -- Rationale: [WHY THIS IS TOP PRIORITY] -- Next steps: [SPECIFIC ACTIONS TO TAKE] -- Resources needed: [WHAT'S REQUIRED] -- Timeline: [WHEN TO START/COMPLETE] - -**#2 Priority: [IDEA NAME]** - -- [Same format] - -**#3 Priority: [IDEA NAME]** - -- [Same format] - ---- - -## Reflection & Follow-up - -### What Worked Well - -- [SUCCESSFUL ASPECT 1] -- [SUCCESSFUL ASPECT 2] - -### Areas for Further Exploration - -- [AREA 1]: [WHY IT NEEDS MORE EXPLORATION] -- [AREA 2]: [WHY IT NEEDS MORE EXPLORATION] - -### Recommended Follow-up Techniques - -- [TECHNIQUE 1]: [WHY IT WOULD BE HELPFUL] -- [TECHNIQUE 2]: [WHY IT WOULD BE HELPFUL] - -### Questions That Emerged - -- [QUESTION 1] -- [QUESTION 2] -- [QUESTION 3] - -### Next Session Planning - -- **Suggested topics:** [FOLLOW-UP TOPICS] -- **Recommended timeframe:** [WHEN TO RECONVENE] -- **Preparation needed:** [WHAT TO RESEARCH/PREPARE] - ---- - -*Session facilitated using the BMAD-METHOD brainstorming framework* -==================== END: .bmad-core/templates/brainstorming-output-tmpl.md ==================== +==================== START: .bmad-core/templates/project-brief-tmpl.yaml ==================== +template: + id: project-brief-template-v2 + name: Project Brief + version: 2.0 + output: + format: markdown + filename: docs/brief.md + title: "Project Brief: {{project_name}}" + +workflow: + mode: interactive + elicitation: advanced-elicitation + custom_elicitation: + title: "Project Brief Elicitation Actions" + options: + - "Expand section with more specific details" + - "Validate against similar successful products" + - "Stress test assumptions with edge cases" + - "Explore alternative solution approaches" + - "Analyze resource/constraint trade-offs" + - "Generate risk mitigation strategies" + - "Challenge scope from MVP minimalist view" + - "Brainstorm creative feature possibilities" + - "If only we had [resource/capability/time]..." + - "Proceed to next section" + +sections: + - id: introduction + instruction: | + This template guides creation of a comprehensive Project Brief that serves as the foundational input for product development. + + Start by asking the user which mode they prefer: + + 1. **Interactive Mode** - Work through each section collaboratively + 2. **YOLO Mode** - Generate complete draft for review and refinement + + Before beginning, understand what inputs are available (brainstorming results, market research, competitive analysis, initial ideas) and gather project context. + + - id: executive-summary + title: Executive Summary + instruction: | + Create a concise overview that captures the essence of the project. Include: + - Product concept in 1-2 sentences + - Primary problem being solved + - Target market identification + - Key value proposition + template: "{{executive_summary_content}}" + + - id: problem-statement + title: Problem Statement + instruction: | + Articulate the problem with clarity and evidence. Address: + - Current state and pain points + - Impact of the problem (quantify if possible) + - Why existing solutions fall short + - Urgency and importance of solving this now + template: "{{detailed_problem_description}}" + + - id: proposed-solution + title: Proposed Solution + instruction: | + Describe the solution approach at a high level. Include: + - Core concept and approach + - Key differentiators from existing solutions + - Why this solution will succeed where others haven't + - High-level vision for the product + template: "{{solution_description}}" + + - id: target-users + title: Target Users + instruction: | + Define and characterize the intended users with specificity. For each user segment include: + - Demographic/firmographic profile + - Current behaviors and workflows + - Specific needs and pain points + - Goals they're trying to achieve + sections: + - id: primary-segment + title: "Primary User Segment: {{segment_name}}" + template: "{{primary_user_description}}" + - id: secondary-segment + title: "Secondary User Segment: {{segment_name}}" + condition: Has secondary user segment + template: "{{secondary_user_description}}" + + - id: goals-metrics + title: Goals & Success Metrics + instruction: Establish clear objectives and how to measure success. Make goals SMART (Specific, Measurable, Achievable, Relevant, Time-bound) + sections: + - id: business-objectives + title: Business Objectives + type: bullet-list + template: "- {{objective_with_metric}}" + - id: user-success-metrics + title: User Success Metrics + type: bullet-list + template: "- {{user_metric}}" + - id: kpis + title: Key Performance Indicators (KPIs) + type: bullet-list + template: "- {{kpi}}: {{definition_and_target}}" + + - id: mvp-scope + title: MVP Scope + instruction: Define the minimum viable product clearly. Be specific about what's in and what's out. Help user distinguish must-haves from nice-to-haves. + sections: + - id: core-features + title: Core Features (Must Have) + type: bullet-list + template: "- **{{feature}}:** {{description_and_rationale}}" + - id: out-of-scope + title: Out of Scope for MVP + type: bullet-list + template: "- {{feature_or_capability}}" + - id: mvp-success-criteria + title: MVP Success Criteria + template: "{{mvp_success_definition}}" + + - id: post-mvp-vision + title: Post-MVP Vision + instruction: Outline the longer-term product direction without overcommitting to specifics + sections: + - id: phase-2-features + title: Phase 2 Features + template: "{{next_priority_features}}" + - id: long-term-vision + title: Long-term Vision + template: "{{one_two_year_vision}}" + - id: expansion-opportunities + title: Expansion Opportunities + template: "{{potential_expansions}}" + + - id: technical-considerations + title: Technical Considerations + instruction: Document known technical constraints and preferences. Note these are initial thoughts, not final decisions. + sections: + - id: platform-requirements + title: Platform Requirements + template: | + - **Target Platforms:** {{platforms}} + - **Browser/OS Support:** {{specific_requirements}} + - **Performance Requirements:** {{performance_specs}} + - id: technology-preferences + title: Technology Preferences + template: | + - **Frontend:** {{frontend_preferences}} + - **Backend:** {{backend_preferences}} + - **Database:** {{database_preferences}} + - **Hosting/Infrastructure:** {{infrastructure_preferences}} + - id: architecture-considerations + title: Architecture Considerations + template: | + - **Repository Structure:** {{repo_thoughts}} + - **Service Architecture:** {{service_thoughts}} + - **Integration Requirements:** {{integration_needs}} + - **Security/Compliance:** {{security_requirements}} + + - id: constraints-assumptions + title: Constraints & Assumptions + instruction: Clearly state limitations and assumptions to set realistic expectations + sections: + - id: constraints + title: Constraints + template: | + - **Budget:** {{budget_info}} + - **Timeline:** {{timeline_info}} + - **Resources:** {{resource_info}} + - **Technical:** {{technical_constraints}} + - id: key-assumptions + title: Key Assumptions + type: bullet-list + template: "- {{assumption}}" + + - id: risks-questions + title: Risks & Open Questions + instruction: Identify unknowns and potential challenges proactively + sections: + - id: key-risks + title: Key Risks + type: bullet-list + template: "- **{{risk}}:** {{description_and_impact}}" + - id: open-questions + title: Open Questions + type: bullet-list + template: "- {{question}}" + - id: research-areas + title: Areas Needing Further Research + type: bullet-list + template: "- {{research_topic}}" + + - id: appendices + title: Appendices + sections: + - id: research-summary + title: A. Research Summary + condition: Has research findings + instruction: | + If applicable, summarize key findings from: + - Market research + - Competitive analysis + - User interviews + - Technical feasibility studies + - id: stakeholder-input + title: B. Stakeholder Input + condition: Has stakeholder feedback + template: "{{stakeholder_feedback}}" + - id: references + title: C. References + template: "{{relevant_links_and_docs}}" + + - id: next-steps + title: Next Steps + sections: + - id: immediate-actions + title: Immediate Actions + type: numbered-list + template: "{{action_item}}" + - id: pm-handoff + title: PM Handoff + content: | + This Project Brief provides the full context for {{project_name}}. Please start in 'PRD Generation Mode', review the brief thoroughly to work with the user to create the PRD section by section as the template indicates, asking for any necessary clarification or suggesting improvements. +==================== END: .bmad-core/templates/project-brief-tmpl.yaml ==================== + +==================== START: .bmad-core/templates/market-research-tmpl.yaml ==================== +template: + id: market-research-template-v2 + name: Market Research Report + version: 2.0 + output: + format: markdown + filename: docs/market-research.md + title: "Market Research Report: {{project_product_name}}" + +workflow: + mode: interactive + elicitation: advanced-elicitation + custom_elicitation: + title: "Market Research Elicitation Actions" + options: + - "Expand market sizing calculations with sensitivity analysis" + - "Deep dive into a specific customer segment" + - "Analyze an emerging market trend in detail" + - "Compare this market to an analogous market" + - "Stress test market assumptions" + - "Explore adjacent market opportunities" + - "Challenge market definition and boundaries" + - "Generate strategic scenarios (best/base/worst case)" + - "If only we had considered [X market factor]..." + - "Proceed to next section" + +sections: + - id: executive-summary + title: Executive Summary + instruction: Provide a high-level overview of key findings, market opportunity assessment, and strategic recommendations. Write this section LAST after completing all other sections. + + - id: research-objectives + title: Research Objectives & Methodology + instruction: This template guides the creation of a comprehensive market research report. Begin by understanding what market insights the user needs and why. Work through each section systematically, using the appropriate analytical frameworks based on the research objectives. + sections: + - id: objectives + title: Research Objectives + instruction: | + List the primary objectives of this market research: + - What decisions will this research inform? + - What specific questions need to be answered? + - What are the success criteria for this research? + - id: methodology + title: Research Methodology + instruction: | + Describe the research approach: + - Data sources used (primary/secondary) + - Analysis frameworks applied + - Data collection timeframe + - Limitations and assumptions + + - id: market-overview + title: Market Overview + sections: + - id: market-definition + title: Market Definition + instruction: | + Define the market being analyzed: + - Product/service category + - Geographic scope + - Customer segments included + - Value chain position + - id: market-size-growth + title: Market Size & Growth + instruction: | + Guide through TAM, SAM, SOM calculations with clear assumptions. Use one or more approaches: + - Top-down: Start with industry data, narrow down + - Bottom-up: Build from customer/unit economics + - Value theory: Based on value provided vs. alternatives + sections: + - id: tam + title: Total Addressable Market (TAM) + instruction: Calculate and explain the total market opportunity + - id: sam + title: Serviceable Addressable Market (SAM) + instruction: Define the portion of TAM you can realistically reach + - id: som + title: Serviceable Obtainable Market (SOM) + instruction: Estimate the portion you can realistically capture + - id: market-trends + title: Market Trends & Drivers + instruction: Analyze key trends shaping the market using appropriate frameworks like PESTEL + sections: + - id: key-trends + title: Key Market Trends + instruction: | + List and explain 3-5 major trends: + - Trend 1: Description and impact + - Trend 2: Description and impact + - etc. + - id: growth-drivers + title: Growth Drivers + instruction: Identify primary factors driving market growth + - id: market-inhibitors + title: Market Inhibitors + instruction: Identify factors constraining market growth + + - id: customer-analysis + title: Customer Analysis + sections: + - id: segment-profiles + title: Target Segment Profiles + instruction: For each segment, create detailed profiles including demographics/firmographics, psychographics, behaviors, needs, and willingness to pay + repeatable: true + sections: + - id: segment + title: "Segment {{segment_number}}: {{segment_name}}" + template: | + - **Description:** {{brief_overview}} + - **Size:** {{number_of_customers_market_value}} + - **Characteristics:** {{key_demographics_firmographics}} + - **Needs & Pain Points:** {{primary_problems}} + - **Buying Process:** {{purchasing_decisions}} + - **Willingness to Pay:** {{price_sensitivity}} + - id: jobs-to-be-done + title: Jobs-to-be-Done Analysis + instruction: Uncover what customers are really trying to accomplish + sections: + - id: functional-jobs + title: Functional Jobs + instruction: List practical tasks and objectives customers need to complete + - id: emotional-jobs + title: Emotional Jobs + instruction: Describe feelings and perceptions customers seek + - id: social-jobs + title: Social Jobs + instruction: Explain how customers want to be perceived by others + - id: customer-journey + title: Customer Journey Mapping + instruction: Map the end-to-end customer experience for primary segments + template: | + For primary customer segment: + + 1. **Awareness:** {{discovery_process}} + 2. **Consideration:** {{evaluation_criteria}} + 3. **Purchase:** {{decision_triggers}} + 4. **Onboarding:** {{initial_expectations}} + 5. **Usage:** {{interaction_patterns}} + 6. **Advocacy:** {{referral_behaviors}} + + - id: competitive-landscape + title: Competitive Landscape + sections: + - id: market-structure + title: Market Structure + instruction: | + Describe the overall competitive environment: + - Number of competitors + - Market concentration + - Competitive intensity + - id: major-players + title: Major Players Analysis + instruction: | + For top 3-5 competitors: + - Company name and brief description + - Market share estimate + - Key strengths and weaknesses + - Target customer focus + - Pricing strategy + - id: competitive-positioning + title: Competitive Positioning + instruction: | + Analyze how competitors are positioned: + - Value propositions + - Differentiation strategies + - Market gaps and opportunities + + - id: industry-analysis + title: Industry Analysis + sections: + - id: porters-five-forces + title: Porter's Five Forces Assessment + instruction: Analyze each force with specific evidence and implications + sections: + - id: supplier-power + title: "Supplier Power: {{power_level}}" + template: "{{analysis_and_implications}}" + - id: buyer-power + title: "Buyer Power: {{power_level}}" + template: "{{analysis_and_implications}}" + - id: competitive-rivalry + title: "Competitive Rivalry: {{intensity_level}}" + template: "{{analysis_and_implications}}" + - id: threat-new-entry + title: "Threat of New Entry: {{threat_level}}" + template: "{{analysis_and_implications}}" + - id: threat-substitutes + title: "Threat of Substitutes: {{threat_level}}" + template: "{{analysis_and_implications}}" + - id: adoption-lifecycle + title: Technology Adoption Lifecycle Stage + instruction: | + Identify where the market is in the adoption curve: + - Current stage and evidence + - Implications for strategy + - Expected progression timeline + + - id: opportunity-assessment + title: Opportunity Assessment + sections: + - id: market-opportunities + title: Market Opportunities + instruction: Identify specific opportunities based on the analysis + repeatable: true + sections: + - id: opportunity + title: "Opportunity {{opportunity_number}}: {{name}}" + template: | + - **Description:** {{what_is_the_opportunity}} + - **Size/Potential:** {{quantified_potential}} + - **Requirements:** {{needed_to_capture}} + - **Risks:** {{key_challenges}} + - id: strategic-recommendations + title: Strategic Recommendations + sections: + - id: go-to-market + title: Go-to-Market Strategy + instruction: | + Recommend approach for market entry/expansion: + - Target segment prioritization + - Positioning strategy + - Channel strategy + - Partnership opportunities + - id: pricing-strategy + title: Pricing Strategy + instruction: | + Based on willingness to pay analysis and competitive landscape: + - Recommended pricing model + - Price points/ranges + - Value metric + - Competitive positioning + - id: risk-mitigation + title: Risk Mitigation + instruction: | + Key risks and mitigation strategies: + - Market risks + - Competitive risks + - Execution risks + - Regulatory/compliance risks + + - id: appendices + title: Appendices + sections: + - id: data-sources + title: A. Data Sources + instruction: List all sources used in the research + - id: calculations + title: B. Detailed Calculations + instruction: Include any complex calculations or models + - id: additional-analysis + title: C. Additional Analysis + instruction: Any supplementary analysis not included in main body +==================== END: .bmad-core/templates/market-research-tmpl.yaml ==================== + +==================== START: .bmad-core/templates/competitor-analysis-tmpl.yaml ==================== +template: + id: competitor-analysis-template-v2 + name: Competitive Analysis Report + version: 2.0 + output: + format: markdown + filename: docs/competitor-analysis.md + title: "Competitive Analysis Report: {{project_product_name}}" + +workflow: + mode: interactive + elicitation: advanced-elicitation + custom_elicitation: + title: "Competitive Analysis Elicitation Actions" + options: + - "Deep dive on a specific competitor's strategy" + - "Analyze competitive dynamics in a specific segment" + - "War game competitive responses to your moves" + - "Explore partnership vs. competition scenarios" + - "Stress test differentiation claims" + - "Analyze disruption potential (yours or theirs)" + - "Compare to competition in adjacent markets" + - "Generate win/loss analysis insights" + - "If only we had known about [competitor X's plan]..." + - "Proceed to next section" + +sections: + - id: executive-summary + title: Executive Summary + instruction: Provide high-level competitive insights, main threats and opportunities, and recommended strategic actions. Write this section LAST after completing all analysis. + + - id: analysis-scope + title: Analysis Scope & Methodology + instruction: This template guides comprehensive competitor analysis. Start by understanding the user's competitive intelligence needs and strategic objectives. Help them identify and prioritize competitors before diving into detailed analysis. + sections: + - id: analysis-purpose + title: Analysis Purpose + instruction: | + Define the primary purpose: + - New market entry assessment + - Product positioning strategy + - Feature gap analysis + - Pricing strategy development + - Partnership/acquisition targets + - Competitive threat assessment + - id: competitor-categories + title: Competitor Categories Analyzed + instruction: | + List categories included: + - Direct Competitors: Same product/service, same target market + - Indirect Competitors: Different product, same need/problem + - Potential Competitors: Could enter market easily + - Substitute Products: Alternative solutions + - Aspirational Competitors: Best-in-class examples + - id: research-methodology + title: Research Methodology + instruction: | + Describe approach: + - Information sources used + - Analysis timeframe + - Confidence levels + - Limitations + + - id: competitive-landscape + title: Competitive Landscape Overview + sections: + - id: market-structure + title: Market Structure + instruction: | + Describe the competitive environment: + - Number of active competitors + - Market concentration (fragmented/consolidated) + - Competitive dynamics + - Recent market entries/exits + - id: prioritization-matrix + title: Competitor Prioritization Matrix + instruction: | + Help categorize competitors by market share and strategic threat level + + Create a 2x2 matrix: + - Priority 1 (Core Competitors): High Market Share + High Threat + - Priority 2 (Emerging Threats): Low Market Share + High Threat + - Priority 3 (Established Players): High Market Share + Low Threat + - Priority 4 (Monitor Only): Low Market Share + Low Threat + + - id: competitor-profiles + title: Individual Competitor Profiles + instruction: Create detailed profiles for each Priority 1 and Priority 2 competitor. For Priority 3 and 4, create condensed profiles. + repeatable: true + sections: + - id: competitor + title: "{{competitor_name}} - Priority {{priority_level}}" + sections: + - id: company-overview + title: Company Overview + template: | + - **Founded:** {{year_founders}} + - **Headquarters:** {{location}} + - **Company Size:** {{employees_revenue}} + - **Funding:** {{total_raised_investors}} + - **Leadership:** {{key_executives}} + - id: business-model + title: Business Model & Strategy + template: | + - **Revenue Model:** {{revenue_model}} + - **Target Market:** {{customer_segments}} + - **Value Proposition:** {{value_promise}} + - **Go-to-Market Strategy:** {{gtm_approach}} + - **Strategic Focus:** {{current_priorities}} + - id: product-analysis + title: Product/Service Analysis + template: | + - **Core Offerings:** {{main_products}} + - **Key Features:** {{standout_capabilities}} + - **User Experience:** {{ux_assessment}} + - **Technology Stack:** {{tech_stack}} + - **Pricing:** {{pricing_model}} + - id: strengths-weaknesses + title: Strengths & Weaknesses + sections: + - id: strengths + title: Strengths + type: bullet-list + template: "- {{strength}}" + - id: weaknesses + title: Weaknesses + type: bullet-list + template: "- {{weakness}}" + - id: market-position + title: Market Position & Performance + template: | + - **Market Share:** {{market_share_estimate}} + - **Customer Base:** {{customer_size_notables}} + - **Growth Trajectory:** {{growth_trend}} + - **Recent Developments:** {{key_news}} + + - id: comparative-analysis + title: Comparative Analysis + sections: + - id: feature-comparison + title: Feature Comparison Matrix + instruction: Create a detailed comparison table of key features across competitors + type: table + columns: ["Feature Category", "{{your_company}}", "{{competitor_1}}", "{{competitor_2}}", "{{competitor_3}}"] + rows: + - category: "Core Functionality" + items: + - ["Feature A", "{{status}}", "{{status}}", "{{status}}", "{{status}}"] + - ["Feature B", "{{status}}", "{{status}}", "{{status}}", "{{status}}"] + - category: "User Experience" + items: + - ["Mobile App", "{{rating}}", "{{rating}}", "{{rating}}", "{{rating}}"] + - ["Onboarding Time", "{{time}}", "{{time}}", "{{time}}", "{{time}}"] + - category: "Integration & Ecosystem" + items: + - ["API Availability", "{{availability}}", "{{availability}}", "{{availability}}", "{{availability}}"] + - ["Third-party Integrations", "{{number}}", "{{number}}", "{{number}}", "{{number}}"] + - category: "Pricing & Plans" + items: + - ["Starting Price", "{{price}}", "{{price}}", "{{price}}", "{{price}}"] + - ["Free Tier", "{{yes_no}}", "{{yes_no}}", "{{yes_no}}", "{{yes_no}}"] + - id: swot-comparison + title: SWOT Comparison + instruction: Create SWOT analysis for your solution vs. top competitors + sections: + - id: your-solution + title: Your Solution + template: | + - **Strengths:** {{strengths}} + - **Weaknesses:** {{weaknesses}} + - **Opportunities:** {{opportunities}} + - **Threats:** {{threats}} + - id: vs-competitor + title: "vs. {{main_competitor}}" + template: | + - **Competitive Advantages:** {{your_advantages}} + - **Competitive Disadvantages:** {{their_advantages}} + - **Differentiation Opportunities:** {{differentiation}} + - id: positioning-map + title: Positioning Map + instruction: | + Describe competitor positions on key dimensions + + Create a positioning description using 2 key dimensions relevant to the market, such as: + - Price vs. Features + - Ease of Use vs. Power + - Specialization vs. Breadth + - Self-Serve vs. High-Touch + + - id: strategic-analysis + title: Strategic Analysis + sections: + - id: competitive-advantages + title: Competitive Advantages Assessment + sections: + - id: sustainable-advantages + title: Sustainable Advantages + instruction: | + Identify moats and defensible positions: + - Network effects + - Switching costs + - Brand strength + - Technology barriers + - Regulatory advantages + - id: vulnerable-points + title: Vulnerable Points + instruction: | + Where competitors could be challenged: + - Weak customer segments + - Missing features + - Poor user experience + - High prices + - Limited geographic presence + - id: blue-ocean + title: Blue Ocean Opportunities + instruction: | + Identify uncontested market spaces + + List opportunities to create new market space: + - Underserved segments + - Unaddressed use cases + - New business models + - Geographic expansion + - Different value propositions + + - id: strategic-recommendations + title: Strategic Recommendations + sections: + - id: differentiation-strategy + title: Differentiation Strategy + instruction: | + How to position against competitors: + - Unique value propositions to emphasize + - Features to prioritize + - Segments to target + - Messaging and positioning + - id: competitive-response + title: Competitive Response Planning + sections: + - id: offensive-strategies + title: Offensive Strategies + instruction: | + How to gain market share: + - Target competitor weaknesses + - Win competitive deals + - Capture their customers + - id: defensive-strategies + title: Defensive Strategies + instruction: | + How to protect your position: + - Strengthen vulnerable areas + - Build switching costs + - Deepen customer relationships + - id: partnership-ecosystem + title: Partnership & Ecosystem Strategy + instruction: | + Potential collaboration opportunities: + - Complementary players + - Channel partners + - Technology integrations + - Strategic alliances + + - id: monitoring-plan + title: Monitoring & Intelligence Plan + sections: + - id: key-competitors + title: Key Competitors to Track + instruction: Priority list with rationale + - id: monitoring-metrics + title: Monitoring Metrics + instruction: | + What to track: + - Product updates + - Pricing changes + - Customer wins/losses + - Funding/M&A activity + - Market messaging + - id: intelligence-sources + title: Intelligence Sources + instruction: | + Where to gather ongoing intelligence: + - Company websites/blogs + - Customer reviews + - Industry reports + - Social media + - Patent filings + - id: update-cadence + title: Update Cadence + instruction: | + Recommended review schedule: + - Weekly: {{weekly_items}} + - Monthly: {{monthly_items}} + - Quarterly: {{quarterly_analysis}} +==================== END: .bmad-core/templates/competitor-analysis-tmpl.yaml ==================== + +==================== START: .bmad-core/templates/brainstorming-output-tmpl.yaml ==================== +template: + id: brainstorming-output-template-v2 + name: Brainstorming Session Results + version: 2.0 + output: + format: markdown + filename: docs/brainstorming-session-results.md + title: "Brainstorming Session Results" + +workflow: + mode: non-interactive + +sections: + - id: header + content: | + **Session Date:** {{date}} + **Facilitator:** {{agent_role}} {{agent_name}} + **Participant:** {{user_name}} + + - id: executive-summary + title: Executive Summary + sections: + - id: summary-details + template: | + **Topic:** {{session_topic}} + + **Session Goals:** {{stated_goals}} + + **Techniques Used:** {{techniques_list}} + + **Total Ideas Generated:** {{total_ideas}} + - id: key-themes + title: "Key Themes Identified:" + type: bullet-list + template: "- {{theme}}" + + - id: technique-sessions + title: Technique Sessions + repeatable: true + sections: + - id: technique + title: "{{technique_name}} - {{duration}}" + sections: + - id: description + template: "**Description:** {{technique_description}}" + - id: ideas-generated + title: "Ideas Generated:" + type: numbered-list + template: "{{idea}}" + - id: insights + title: "Insights Discovered:" + type: bullet-list + template: "- {{insight}}" + - id: connections + title: "Notable Connections:" + type: bullet-list + template: "- {{connection}}" + + - id: idea-categorization + title: Idea Categorization + sections: + - id: immediate-opportunities + title: Immediate Opportunities + content: "*Ideas ready to implement now*" + repeatable: true + type: numbered-list + template: | + **{{idea_name}}** + - Description: {{description}} + - Why immediate: {{rationale}} + - Resources needed: {{requirements}} + - id: future-innovations + title: Future Innovations + content: "*Ideas requiring development/research*" + repeatable: true + type: numbered-list + template: | + **{{idea_name}}** + - Description: {{description}} + - Development needed: {{development_needed}} + - Timeline estimate: {{timeline}} + - id: moonshots + title: Moonshots + content: "*Ambitious, transformative concepts*" + repeatable: true + type: numbered-list + template: | + **{{idea_name}}** + - Description: {{description}} + - Transformative potential: {{potential}} + - Challenges to overcome: {{challenges}} + - id: insights-learnings + title: Insights & Learnings + content: "*Key realizations from the session*" + type: bullet-list + template: "- {{insight}}: {{description_and_implications}}" + + - id: action-planning + title: Action Planning + sections: + - id: top-priorities + title: Top 3 Priority Ideas + sections: + - id: priority-1 + title: "#1 Priority: {{idea_name}}" + template: | + - Rationale: {{rationale}} + - Next steps: {{next_steps}} + - Resources needed: {{resources}} + - Timeline: {{timeline}} + - id: priority-2 + title: "#2 Priority: {{idea_name}}" + template: | + - Rationale: {{rationale}} + - Next steps: {{next_steps}} + - Resources needed: {{resources}} + - Timeline: {{timeline}} + - id: priority-3 + title: "#3 Priority: {{idea_name}}" + template: | + - Rationale: {{rationale}} + - Next steps: {{next_steps}} + - Resources needed: {{resources}} + - Timeline: {{timeline}} + + - id: reflection-followup + title: Reflection & Follow-up + sections: + - id: what-worked + title: What Worked Well + type: bullet-list + template: "- {{aspect}}" + - id: areas-exploration + title: Areas for Further Exploration + type: bullet-list + template: "- {{area}}: {{reason}}" + - id: recommended-techniques + title: Recommended Follow-up Techniques + type: bullet-list + template: "- {{technique}}: {{reason}}" + - id: questions-emerged + title: Questions That Emerged + type: bullet-list + template: "- {{question}}" + - id: next-session + title: Next Session Planning + template: | + - **Suggested topics:** {{followup_topics}} + - **Recommended timeframe:** {{timeframe}} + - **Preparation needed:** {{preparation}} + + - id: footer + content: | + --- + + *Session facilitated using the BMAD-METHOD brainstorming framework* +==================== END: .bmad-core/templates/brainstorming-output-tmpl.yaml ==================== ==================== START: .bmad-core/data/brainstorming-techniques.md ==================== # Brainstorming Techniques Data @@ -4849,479 +4948,493 @@ Document sharded successfully: - Ensure the sharding is reversible (could reconstruct the original from shards) ==================== END: .bmad-core/tasks/shard-doc.md ==================== -==================== START: .bmad-core/templates/prd-tmpl.md ==================== -# {{Project Name}} Product Requirements Document (PRD) - -[[LLM: The default path and filename unless specified is docs/prd.md]] - -[[LLM: If available, review any provided document or ask if any are optionally available: Project Brief]] - -## Goals and Background Context - -[[LLM: Populate the 2 child sections based on what we have received from user description or the provided brief. Allow user to review the 2 sections and offer changes before proceeding]] - -### Goals - -[[LLM: Bullet list of 1 line desired outcomes the PRD will deliver if successful - user and project desires]] - -### Background Context - -[[LLM: 1-2 short paragraphs summarizing the background context, such as what we learned in the brief without being redundant with the goals, what and why this solves a problem, what the current landscape or need is etc...]] - -### Change Log - -[[LLM: Track document versions and changes]] - -| Date | Version | Description | Author | -| :--- | :------ | :---------- | :----- | - -## Requirements - -[[LLM: Draft the list of functional and non functional requirements under the two child sections, and immediately execute .bmad-core/tasks/advanced-elicitation.md display]] - -### Functional - -[[LLM: Each Requirement will be a bullet markdown and an identifier sequence starting with FR`.]] -@{example: - FR6: The Todo List uses AI to detect and warn against adding potentially duplicate todo items that are worded differently.} - -### Non Functional - -[[LLM: Each Requirement will be a bullet markdown and an identifier sequence starting with NFR`.]] -@{example: - NFR1: AWS service usage **must** aim to stay within free-tier limits where feasible.} - -^^CONDITION: has_ui^^ - -## User Interface Design Goals - -[[LLM: Capture high-level UI/UX vision to guide Design Architect and to inform story creation. Steps: - -1. Pre-fill all subsections with educated guesses based on project context -2. Present the complete rendered section to user -3. Clearly let the user know where assumptions were made -4. Ask targeted questions for unclear/missing elements or areas needing more specification -5. This is NOT detailed UI spec - focus on product vision and user goals -6. After section completion, immediately apply `.bmad-core/tasks/advanced-elicitation.md` protocol]] - -### Overall UX Vision - -### Key Interaction Paradigms - -### Core Screens and Views - -[[LLM: From a product perspective, what are the most critical screens or views necessary to deliver the the PRD values and goals? This is meant to be Conceptual High Level to Drive Rough Epic or User Stories]] - -@{example} - -- Login Screen -- Main Dashboard -- Item Detail Page -- Settings Page - @{/example} - -### Accessibility: { None, WCAG, etc } - -### Branding - -[[LLM: Any known branding elements or style guides that must be incorporated?]] - -@{example} - -- Replicate the look and feel of early 1900s black and white cinema, including animated effects replicating film damage or projector glitches during page or state transitions. -- Attached is the full color pallet and tokens for our corporate branding. - @{/example} - -### Target Device and Platforms - -@{example} -"Web Responsive, and all mobile platforms", "IPhone Only", "ASCII Windows Desktop" -@{/example} - -^^/CONDITION: has_ui^^ - -## Technical Assumptions - -[[LLM: Gather technical decisions that will guide the Architect. Steps: - -1. Check if `.bmad-core/data/technical-preferences.yaml` or an attached `technical-preferences` file exists - use it to pre-populate choices -2. Ask user about: languages, frameworks, starter templates, libraries, APIs, deployment targets -3. For unknowns, offer guidance based on project goals and MVP scope -4. Document ALL technical choices with rationale (why this choice fits the project) -5. These become constraints for the Architect - be specific and complete -6. After section completion, apply `.bmad-core/tasks/advanced-elicitation.md` protocol.]] - -### Repository Structure: { Monorepo, Polyrepo, etc...} - -### Service Architecture - -[[LLM: CRITICAL DECISION - Document the high-level service architecture (e.g., Monolith, Microservices, Serverless functions within a Monorepo).]] - -### Testing requirements - -[[LLM: CRITICAL DECISION - Document the testing requirements, unit only, integration, e2e, manual, need for manual testing convenience methods).]] - -### Additional Technical Assumptions and Requests - -[[LLM: Throughout the entire process of drafting this document, if any other technical assumptions are raised or discovered appropriate for the architect, add them here as additional bulleted items]] - -## Epics - -[[LLM: First, present a high-level list of all epics for user approval, the epic_list and immediately execute .bmad-core/tasks/advanced-elicitation.md display. Each epic should have a title and a short (1 sentence) goal statement. This allows the user to review the overall structure before diving into details. - -CRITICAL: Epics MUST be logically sequential following agile best practices: - -- Each epic should deliver a significant, end-to-end, fully deployable increment of testable functionality -- Epic 1 must establish foundational project infrastructure (app setup, Git, CI/CD, core services) unless we are adding new functionality to an existing app, while also delivering an initial piece of functionality, even as simple as a health-check route or display of a simple canary page - remember this when we produce the stories for the first epic! -- Each subsequent epic builds upon previous epics' functionality delivering major blocks of functionality that provide tangible value to users or business when deployed -- Not every project needs multiple epics, an epic needs to deliver value. For example, an API completed can deliver value even if a UI is not complete and planned for a separate epic. -- Err on the side of less epics, but let the user know your rationale and offer options for splitting them if it seems some are too large or focused on disparate things. -- Cross Cutting Concerns should flow through epics and stories and not be final stories. For example, adding a logging framework as a last story of an epic, or at the end of a project as a final epic or story would be terrible as we would not have logging from the beginning.]] - -<> - -- Epic{{epic_number}} {{epic_title}}: {{short_goal}} - -<> - -@{example: epic_list} - -1. Foundation & Core Infrastructure: Establish project setup, authentication, and basic user management -2. Core Business Entities: Create and manage primary domain objects with CRUD operations -3. User Workflows & Interactions: Enable key user journeys and business processes -4. Reporting & Analytics: Provide insights and data visualization for users - -@{/example} - -[[LLM: After the epic list is approved, present each `epic_details` with all its stories and acceptance criteria as a complete review unit and immediately execute .bmad-core/tasks/advanced-elicitation.md display, before moving on to the next epic.]] - -<> - -## Epic {{epic_number}} {{epic_title}} - -{{epic_goal}} [[LLM: Expanded goal - 2-3 sentences describing the objective and value all the stories will achieve]] - -[[LLM: CRITICAL STORY SEQUENCING REQUIREMENTS: - -- Stories within each epic MUST be logically sequential -- Each story should be a "vertical slice" delivering complete functionality aside from early enabler stories for project foundation -- No story should depend on work from a later story or epic -- Identify and note any direct prerequisite stories -- Focus on "what" and "why" not "how" (leave technical implementation to Architect) yet be precise enough to support a logical sequential order of operations from story to story. -- Ensure each story delivers clear user or business value, try to avoid enablers and build them into stories that deliver value. -- Size stories for AI agent execution: Each story must be completable by a single AI agent in one focused session without context overflow -- Think "junior developer working for 2-4 hours" - stories must be small, focused, and self-contained -- If a story seems complex, break it down further as long as it can deliver a vertical slice -- Each story should result in working, testable code before the agent's context window fills]] - -<> - -### Story {{epic_number}}.{{story_number}} {{story_title}} - -As a {{user_type}}, -I want {{action}}, -so that {{benefit}}. - -#### Acceptance Criteria - -[[LLM: Define clear, comprehensive, and testable acceptance criteria that: - -- Precisely define what "done" means from a functional perspective -- Are unambiguous and serve as basis for verification -- Include any critical non-functional requirements from the PRD -- Consider local testability for backend/data components -- Specify UI/UX requirements and framework adherence where applicable -- Avoid cross-cutting concerns that should be in other stories or PRD sections]] - -<> - -- {{criterion number}}: {{criteria}} - -<> -<> -<> - -## Checklist Results Report - -[[LLM: Before running the checklist and drafting the prompts, offer to output the full updated PRD. If outputting it, confirm with the user that you will be proceeding to run the checklist and produce the report. Once the user confirms, execute the `pm-checklist` and populate the results in this section.]] - -## Next Steps - -### Design Architect Prompt - -[[LLM: This section will contain the prompt for the Design Architect, keep it short and to the point to initiate create architecture mode using this document as input.]] - -### Architect Prompt - -[[LLM: This section will contain the prompt for the Architect, keep it short and to the point to initiate create architecture mode using this document as input.]] -==================== END: .bmad-core/templates/prd-tmpl.md ==================== - -==================== START: .bmad-core/templates/brownfield-prd-tmpl.md ==================== -# {{Project Name}} Brownfield Enhancement PRD - -[[LLM: The default path and filename unless specified is docs/prd.md]] - -[[LLM: IMPORTANT - SCOPE ASSESSMENT REQUIRED: - -This PRD is for SIGNIFICANT enhancements to existing projects that require comprehensive planning and multiple stories. Before proceeding: - -1. **Assess Enhancement Complexity**: If this is a simple feature addition or bug fix that could be completed in 1-2 focused development sessions, STOP and recommend: "For simpler changes, consider using the brownfield-create-epic or brownfield-create-story task with the Product Owner instead. This full PRD process is designed for substantial enhancements that require architectural planning and multiple coordinated stories." - -2. **Project Context**: Determine if we're working in an IDE with the project already loaded or if the user needs to provide project information. If project files are available, analyze existing documentation in the docs folder. If insufficient documentation exists, recommend running the document-project task first. - -3. **Deep Assessment Requirement**: You MUST thoroughly analyze the existing project structure, patterns, and constraints before making ANY suggestions. Every recommendation must be grounded in actual project analysis, not assumptions.]] - -## Intro Project Analysis and Context - -[[LLM: Gather comprehensive information about the existing project. This section must be completed before proceeding with requirements. - -CRITICAL: Throughout this analysis, explicitly confirm your understanding with the user. For every assumption you make about the existing project, ask: "Based on my analysis, I understand that [assumption]. Is this correct?" - -Do not proceed with any recommendations until the user has validated your understanding of the existing system.]] - -### Existing Project Overview - -[[LLM: Check if document-project analysis was already performed. If yes, reference that output instead of re-analyzing.]] - -**Analysis Source**: [[LLM: Indicate one of the following: -- Document-project output available at: {{path}} -- IDE-based fresh analysis -- User-provided information -]] - -**Current Project State**: [[LLM: -- If document-project output exists: Extract summary from "High Level Architecture" and "Technical Summary" sections -- Otherwise: Brief description of what the project currently does and its primary purpose -]] - -### Available Documentation Analysis - -[[LLM: -If document-project was run: -- Note: "Document-project analysis available - using existing technical documentation" -- List key documents created by document-project -- Skip the missing documentation check below - -Otherwise, check for existing documentation: -]] - -**Available Documentation**: - -- [ ] Tech Stack Documentation [[LLM: If from document-project, check ✓]] -- [ ] Source Tree/Architecture [[LLM: If from document-project, check ✓]] -- [ ] Coding Standards [[LLM: If from document-project, may be partial]] -- [ ] API Documentation [[LLM: If from document-project, check ✓]] -- [ ] External API Documentation [[LLM: If from document-project, check ✓]] -- [ ] UX/UI Guidelines [[LLM: May not be in document-project]] -- [ ] Technical Debt Documentation [[LLM: If from document-project, check ✓]] -- [ ] Other: \***\*\_\_\_\*\*** - -[[LLM: -- If document-project was already run: "Using existing project analysis from document-project output." -- If critical documentation is missing and no document-project: "I recommend running the document-project task first..." -]] - -### Enhancement Scope Definition - -[[LLM: Work with user to clearly define what type of enhancement this is. This is critical for scoping and approach.]] - -**Enhancement Type**: [[LLM: Determine with user which applies]] - -- [ ] New Feature Addition -- [ ] Major Feature Modification -- [ ] Integration with New Systems -- [ ] Performance/Scalability Improvements -- [ ] UI/UX Overhaul -- [ ] Technology Stack Upgrade -- [ ] Bug Fix and Stability Improvements -- [ ] Other: \***\*\_\_\_\*\*** - -**Enhancement Description**: [[LLM: 2-3 sentences describing what the user wants to add or change]] - -**Impact Assessment**: [[LLM: Assess the scope of impact on existing codebase]] - -- [ ] Minimal Impact (isolated additions) -- [ ] Moderate Impact (some existing code changes) -- [ ] Significant Impact (substantial existing code changes) -- [ ] Major Impact (architectural changes required) - -### Goals and Background Context - -#### Goals - -[[LLM: Bullet list of 1-line desired outcomes this enhancement will deliver if successful]] - -#### Background Context - -[[LLM: 1-2 short paragraphs explaining why this enhancement is needed, what problem it solves, and how it fits with the existing project]] - -### Change Log - -| Change | Date | Version | Description | Author | -| ------ | ---- | ------- | ----------- | ------ | - -## Requirements - -[[LLM: Draft functional and non-functional requirements based on your validated understanding of the existing project. Before presenting requirements, confirm: "These requirements are based on my understanding of your existing system. Please review carefully and confirm they align with your project's reality." Then immediately execute tasks#advanced-elicitation display]] - -### Functional - -[[LLM: Each Requirement will be a bullet markdown with identifier starting with FR]] -@{example: - FR1: The existing Todo List will integrate with the new AI duplicate detection service without breaking current functionality.} - -### Non Functional - -[[LLM: Each Requirement will be a bullet markdown with identifier starting with NFR. Include constraints from existing system]] -@{example: - NFR1: Enhancement must maintain existing performance characteristics and not exceed current memory usage by more than 20%.} - -### Compatibility Requirements - -[[LLM: Critical for brownfield - what must remain compatible]] - -- CR1: [[LLM: Existing API compatibility requirements]] -- CR2: [[LLM: Database schema compatibility requirements]] -- CR3: [[LLM: UI/UX consistency requirements]] -- CR4: [[LLM: Integration compatibility requirements]] - -^^CONDITION: has_ui^^ - -## User Interface Enhancement Goals - -[[LLM: For UI changes, capture how they will integrate with existing UI patterns and design systems]] - -### Integration with Existing UI - -[[LLM: Describe how new UI elements will fit with existing design patterns, style guides, and component libraries]] - -### Modified/New Screens and Views - -[[LLM: List only the screens/views that will be modified or added]] - -### UI Consistency Requirements - -[[LLM: Specific requirements for maintaining visual and interaction consistency with existing application]] - -^^/CONDITION: has_ui^^ - -## Technical Constraints and Integration Requirements - -[[LLM: This section replaces separate architecture documentation. Gather detailed technical constraints from existing project analysis.]] - -### Existing Technology Stack - -[[LLM: -If document-project output available: -- Extract from "Actual Tech Stack" table in High Level Architecture section -- Include version numbers and any noted constraints - -Otherwise, document the current technology stack: -]] - -**Languages**: [[LLM: From document-project or fresh analysis]] -**Frameworks**: [[LLM: From document-project or fresh analysis]] -**Database**: [[LLM: From document-project or fresh analysis]] -**Infrastructure**: [[LLM: From document-project or fresh analysis]] -**External Dependencies**: [[LLM: From document-project "External Services" section or fresh analysis]] - -### Integration Approach - -[[LLM: Define how the enhancement will integrate with existing architecture]] - -**Database Integration Strategy**: [[LLM: How new features will interact with existing database]] -**API Integration Strategy**: [[LLM: How new APIs will integrate with existing API structure]] -**Frontend Integration Strategy**: [[LLM: How new UI components will integrate with existing frontend]] -**Testing Integration Strategy**: [[LLM: How new tests will integrate with existing test suite]] - -### Code Organization and Standards - -[[LLM: Based on existing project analysis, define how new code will fit existing patterns]] - -**File Structure Approach**: [[LLM: How new files will fit existing project structure]] -**Naming Conventions**: [[LLM: Existing naming conventions that must be followed]] -**Coding Standards**: [[LLM: Existing coding standards and linting rules]] -**Documentation Standards**: [[LLM: How new code documentation will match existing patterns]] - -### Deployment and Operations - -[[LLM: How the enhancement fits existing deployment pipeline]] - -**Build Process Integration**: [[LLM: How enhancement builds with existing process]] -**Deployment Strategy**: [[LLM: How enhancement will be deployed alongside existing features]] -**Monitoring and Logging**: [[LLM: How enhancement will integrate with existing monitoring]] -**Configuration Management**: [[LLM: How new configuration will integrate with existing config]] - -### Risk Assessment and Mitigation - -[[LLM: -If document-project output available: -- Reference "Technical Debt and Known Issues" section -- Include "Workarounds and Gotchas" that might impact enhancement -- Note any identified constraints from "Critical Technical Debt" - -Build risk assessment incorporating existing known issues: -]] - -**Technical Risks**: [[LLM: Include risks from document-project + new enhancement risks]] -**Integration Risks**: [[LLM: Reference integration constraints from document-project]] -**Deployment Risks**: [[LLM: Include deployment gotchas from document-project]] -**Mitigation Strategies**: [[LLM: Address both existing and new risks]] - -## Epic and Story Structure - -[[LLM: For brownfield projects, favor a single comprehensive epic unless the user is clearly requesting multiple unrelated enhancements. Before presenting the epic structure, confirm: "Based on my analysis of your existing project, I believe this enhancement should be structured as [single epic/multiple epics] because [rationale based on actual project analysis]. Does this align with your understanding of the work required?" Then present the epic structure and immediately execute tasks#advanced-elicitation display.]] - -### Epic Approach - -[[LLM: Explain the rationale for epic structure - typically single epic for brownfield unless multiple unrelated features]] - -**Epic Structure Decision**: [[LLM: Single Epic or Multiple Epics with rationale]] - -## Epic 1: {{enhancement_title}} - -[[LLM: Comprehensive epic that delivers the brownfield enhancement while maintaining existing functionality]] - -**Epic Goal**: [[LLM: 2-3 sentences describing the complete enhancement objective and value]] - -**Integration Requirements**: [[LLM: Key integration points with existing system]] - -[[LLM: CRITICAL STORY SEQUENCING FOR BROWNFIELD: - -- Stories must ensure existing functionality remains intact -- Each story should include verification that existing features still work -- Stories should be sequenced to minimize risk to existing system -- Include rollback considerations for each story -- Focus on incremental integration rather than big-bang changes -- Size stories for AI agent execution in existing codebase context -- MANDATORY: Present the complete story sequence and ask: "This story sequence is designed to minimize risk to your existing system. Does this order make sense given your project's architecture and constraints?" -- Stories must be logically sequential with clear dependencies identified -- Each story must deliver value while maintaining system integrity]] - -<> - -### Story 1.{{story_number}} {{story_title}} - -As a {{user_type}}, -I want {{action}}, -so that {{benefit}}. - -#### Acceptance Criteria - -[[LLM: Define criteria that include both new functionality and existing system integrity]] - -<> - -- {{criterion number}}: {{criteria}} - -<> - -#### Integration Verification - -[[LLM: Specific verification steps to ensure existing functionality remains intact]] - -- IV1: [[LLM: Existing functionality verification requirement]] -- IV2: [[LLM: Integration point verification requirement]] -- IV3: [[LLM: Performance impact verification requirement]] - -<> -==================== END: .bmad-core/templates/brownfield-prd-tmpl.md ==================== +==================== START: .bmad-core/templates/prd-tmpl.yaml ==================== +template: + id: prd-template-v2 + name: Product Requirements Document + version: 2.0 + output: + format: markdown + filename: docs/prd.md + title: "{{project_name}} Product Requirements Document (PRD)" + +workflow: + mode: interactive + elicitation: advanced-elicitation + +sections: + - id: goals-context + title: Goals and Background Context + instruction: | + Ask if Project Brief document is available. If NO Project Brief exists, STRONGLY recommend creating one first using project-brief-tmpl (it provides essential foundation: problem statement, target users, success metrics, MVP scope, constraints). If user insists on PRD without brief, gather this information during Goals section. If Project Brief exists, review and use it to populate Goals (bullet list of desired outcomes) and Background Context (1-2 paragraphs on what this solves and why) so we can determine what is and is not in scope for PRD mvp. Either way this is critical to determine the requirements. Include Change Log table. + sections: + - id: goals + title: Goals + type: bullet-list + instruction: Bullet list of 1 line desired outcomes the PRD will deliver if successful - user and project desires + - id: background + title: Background Context + type: paragraphs + instruction: 1-2 short paragraphs summarizing the background context, such as what we learned in the brief without being redundant with the goals, what and why this solves a problem, what the current landscape or need is + - id: changelog + title: Change Log + type: table + columns: [Date, Version, Description, Author] + instruction: Track document versions and changes + + - id: requirements + title: Requirements + instruction: Draft the list of functional and non functional requirements under the two child sections + elicit: true + sections: + - id: functional + title: Functional + type: numbered-list + prefix: FR + instruction: Each Requirement will be a bullet markdown and an identifier sequence starting with FR + examples: + - "FR6: The Todo List uses AI to detect and warn against potentially duplicate todo items that are worded differently." + - id: non-functional + title: Non Functional + type: numbered-list + prefix: NFR + instruction: Each Requirement will be a bullet markdown and an identifier sequence starting with NFR + examples: + - "NFR1: AWS service usage must aim to stay within free-tier limits where feasible." + + - id: ui-goals + title: User Interface Design Goals + condition: PRD has UX/UI requirements + instruction: | + Capture high-level UI/UX vision to guide Design Architect and to inform story creation. Steps: + + 1. Pre-fill all subsections with educated guesses based on project context + 2. Present the complete rendered section to user + 3. Clearly let the user know where assumptions were made + 4. Ask targeted questions for unclear/missing elements or areas needing more specification + 5. This is NOT detailed UI spec - focus on product vision and user goals + elicit: true + choices: + accessibility: [None, WCAG AA, WCAG AAA] + platforms: [Web Responsive, Mobile Only, Desktop Only, Cross-Platform] + sections: + - id: ux-vision + title: Overall UX Vision + - id: interaction-paradigms + title: Key Interaction Paradigms + - id: core-screens + title: Core Screens and Views + instruction: From a product perspective, what are the most critical screens or views necessary to deliver the the PRD values and goals? This is meant to be Conceptual High Level to Drive Rough Epic or User Stories + examples: + - "Login Screen" + - "Main Dashboard" + - "Item Detail Page" + - "Settings Page" + - id: accessibility + title: "Accessibility: {None|WCAG AA|WCAG AAA|Custom Requirements}" + - id: branding + title: Branding + instruction: Any known branding elements or style guides that must be incorporated? + examples: + - "Replicate the look and feel of early 1900s black and white cinema, including animated effects replicating film damage or projector glitches during page or state transitions." + - "Attached is the full color pallet and tokens for our corporate branding." + - id: target-platforms + title: "Target Device and Platforms: {Web Responsive|Mobile Only|Desktop Only|Cross-Platform}" + examples: + - "Web Responsive, and all mobile platforms" + - "iPhone Only" + - "ASCII Windows Desktop" + + - id: technical-assumptions + title: Technical Assumptions + instruction: | + Gather technical decisions that will guide the Architect. Steps: + + 1. Check if .bmad-core/data/technical-preferences.yaml or an attached technical-preferences file exists - use it to pre-populate choices + 2. Ask user about: languages, frameworks, starter templates, libraries, APIs, deployment targets + 3. For unknowns, offer guidance based on project goals and MVP scope + 4. Document ALL technical choices with rationale (why this choice fits the project) + 5. These become constraints for the Architect - be specific and complete + elicit: true + choices: + repository: [Monorepo, Polyrepo] + architecture: [Monolith, Microservices, Serverless] + testing: [Unit Only, Unit + Integration, Full Testing Pyramid] + sections: + - id: repository-structure + title: "Repository Structure: {Monorepo|Polyrepo|Multi-repo}" + - id: service-architecture + title: Service Architecture + instruction: "CRITICAL DECISION - Document the high-level service architecture (e.g., Monolith, Microservices, Serverless functions within a Monorepo)." + - id: testing-requirements + title: Testing Requirements + instruction: "CRITICAL DECISION - Document the testing requirements, unit only, integration, e2e, manual, need for manual testing convenience methods)." + - id: additional-assumptions + title: Additional Technical Assumptions and Requests + instruction: Throughout the entire process of drafting this document, if any other technical assumptions are raised or discovered appropriate for the architect, add them here as additional bulleted items + + - id: epic-list + title: Epic List + instruction: | + Present a high-level list of all epics for user approval. Each epic should have a title and a short (1 sentence) goal statement. This allows the user to review the overall structure before diving into details. + + CRITICAL: Epics MUST be logically sequential following agile best practices: + + - Each epic should deliver a significant, end-to-end, fully deployable increment of testable functionality + - Epic 1 must establish foundational project infrastructure (app setup, Git, CI/CD, core services) unless we are adding new functionality to an existing app, while also delivering an initial piece of functionality, even as simple as a health-check route or display of a simple canary page - remember this when we produce the stories for the first epic! + - Each subsequent epic builds upon previous epics' functionality delivering major blocks of functionality that provide tangible value to users or business when deployed + - Not every project needs multiple epics, an epic needs to deliver value. For example, an API completed can deliver value even if a UI is not complete and planned for a separate epic. + - Err on the side of less epics, but let the user know your rationale and offer options for splitting them if it seems some are too large or focused on disparate things. + - Cross Cutting Concerns should flow through epics and stories and not be final stories. For example, adding a logging framework as a last story of an epic, or at the end of a project as a final epic or story would be terrible as we would not have logging from the beginning. + elicit: true + examples: + - "Epic 1: Foundation & Core Infrastructure: Establish project setup, authentication, and basic user management" + - "Epic 2: Core Business Entities: Create and manage primary domain objects with CRUD operations" + - "Epic 3: User Workflows & Interactions: Enable key user journeys and business processes" + - "Epic 4: Reporting & Analytics: Provide insights and data visualization for users" + + - id: epic-details + title: Epic {{epic_number}} {{epic_title}} + repeatable: true + instruction: | + After the epic list is approved, present each epic with all its stories and acceptance criteria as a complete review unit. + + For each epic provide expanded goal (2-3 sentences describing the objective and value all the stories will achieve). + + CRITICAL STORY SEQUENCING REQUIREMENTS: + + - Stories within each epic MUST be logically sequential + - Each story should be a "vertical slice" delivering complete functionality aside from early enabler stories for project foundation + - No story should depend on work from a later story or epic + - Identify and note any direct prerequisite stories + - Focus on "what" and "why" not "how" (leave technical implementation to Architect) yet be precise enough to support a logical sequential order of operations from story to story. + - Ensure each story delivers clear user or business value, try to avoid enablers and build them into stories that deliver value. + - Size stories for AI agent execution: Each story must be completable by a single AI agent in one focused session without context overflow + - Think "junior developer working for 2-4 hours" - stories must be small, focused, and self-contained + - If a story seems complex, break it down further as long as it can deliver a vertical slice + elicit: true + template: "{{epic_goal}}" + sections: + - id: story + title: Story {{epic_number}}.{{story_number}} {{story_title}} + repeatable: true + template: | + As a {{user_type}}, + I want {{action}}, + so that {{benefit}}. + sections: + - id: acceptance-criteria + title: Acceptance Criteria + type: numbered-list + item_template: "{{criterion_number}}: {{criteria}}" + repeatable: true + instruction: | + Define clear, comprehensive, and testable acceptance criteria that: + + - Precisely define what "done" means from a functional perspective + - Are unambiguous and serve as basis for verification + - Include any critical non-functional requirements from the PRD + - Consider local testability for backend/data components + - Specify UI/UX requirements and framework adherence where applicable + - Avoid cross-cutting concerns that should be in other stories or PRD sections + + - id: checklist-results + title: Checklist Results Report + instruction: Before running the checklist and drafting the prompts, offer to output the full updated PRD. If outputting it, confirm with the user that you will be proceeding to run the checklist and produce the report. Once the user confirms, execute the pm-checklist and populate the results in this section. + + - id: next-steps + title: Next Steps + sections: + - id: design-architect-prompt + title: Design Architect Prompt + instruction: This section will contain the prompt for the Design Architect, keep it short and to the point to initiate create architecture mode using this document as input. + - id: architect-prompt + title: Architect Prompt + instruction: This section will contain the prompt for the Architect, keep it short and to the point to initiate create architecture mode using this document as input. +==================== END: .bmad-core/templates/prd-tmpl.yaml ==================== + +==================== START: .bmad-core/templates/brownfield-prd-tmpl.yaml ==================== +template: + id: brownfield-prd-template-v2 + name: Brownfield Enhancement PRD + version: 2.0 + output: + format: markdown + filename: docs/prd.md + title: "{{project_name}} Brownfield Enhancement PRD" + +workflow: + mode: interactive + elicitation: advanced-elicitation + +sections: + - id: intro-analysis + title: Intro Project Analysis and Context + instruction: | + IMPORTANT - SCOPE ASSESSMENT REQUIRED: + + This PRD is for SIGNIFICANT enhancements to existing projects that require comprehensive planning and multiple stories. Before proceeding: + + 1. **Assess Enhancement Complexity**: If this is a simple feature addition or bug fix that could be completed in 1-2 focused development sessions, STOP and recommend: "For simpler changes, consider using the brownfield-create-epic or brownfield-create-story task with the Product Owner instead. This full PRD process is designed for substantial enhancements that require architectural planning and multiple coordinated stories." + + 2. **Project Context**: Determine if we're working in an IDE with the project already loaded or if the user needs to provide project information. If project files are available, analyze existing documentation in the docs folder. If insufficient documentation exists, recommend running the document-project task first. + + 3. **Deep Assessment Requirement**: You MUST thoroughly analyze the existing project structure, patterns, and constraints before making ANY suggestions. Every recommendation must be grounded in actual project analysis, not assumptions. + + Gather comprehensive information about the existing project. This section must be completed before proceeding with requirements. + + CRITICAL: Throughout this analysis, explicitly confirm your understanding with the user. For every assumption you make about the existing project, ask: "Based on my analysis, I understand that [assumption]. Is this correct?" + + Do not proceed with any recommendations until the user has validated your understanding of the existing system. + sections: + - id: existing-project-overview + title: Existing Project Overview + instruction: Check if document-project analysis was already performed. If yes, reference that output instead of re-analyzing. + sections: + - id: analysis-source + title: Analysis Source + instruction: | + Indicate one of the following: + - Document-project output available at: {{path}} + - IDE-based fresh analysis + - User-provided information + - id: current-state + title: Current Project State + instruction: | + - If document-project output exists: Extract summary from "High Level Architecture" and "Technical Summary" sections + - Otherwise: Brief description of what the project currently does and its primary purpose + - id: documentation-analysis + title: Available Documentation Analysis + instruction: | + If document-project was run: + - Note: "Document-project analysis available - using existing technical documentation" + - List key documents created by document-project + - Skip the missing documentation check below + + Otherwise, check for existing documentation: + sections: + - id: available-docs + title: Available Documentation + type: checklist + items: + - Tech Stack Documentation [[LLM: If from document-project, check ✓]] + - Source Tree/Architecture [[LLM: If from document-project, check ✓]] + - Coding Standards [[LLM: If from document-project, may be partial]] + - API Documentation [[LLM: If from document-project, check ✓]] + - External API Documentation [[LLM: If from document-project, check ✓]] + - UX/UI Guidelines [[LLM: May not be in document-project]] + - Technical Debt Documentation [[LLM: If from document-project, check ✓]] + - "Other: {{other_docs}}" + instruction: | + - If document-project was already run: "Using existing project analysis from document-project output." + - If critical documentation is missing and no document-project: "I recommend running the document-project task first..." + - id: enhancement-scope + title: Enhancement Scope Definition + instruction: Work with user to clearly define what type of enhancement this is. This is critical for scoping and approach. + sections: + - id: enhancement-type + title: Enhancement Type + type: checklist + instruction: Determine with user which applies + items: + - New Feature Addition + - Major Feature Modification + - Integration with New Systems + - Performance/Scalability Improvements + - UI/UX Overhaul + - Technology Stack Upgrade + - Bug Fix and Stability Improvements + - "Other: {{other_type}}" + - id: enhancement-description + title: Enhancement Description + instruction: 2-3 sentences describing what the user wants to add or change + - id: impact-assessment + title: Impact Assessment + type: checklist + instruction: Assess the scope of impact on existing codebase + items: + - Minimal Impact (isolated additions) + - Moderate Impact (some existing code changes) + - Significant Impact (substantial existing code changes) + - Major Impact (architectural changes required) + - id: goals-context + title: Goals and Background Context + sections: + - id: goals + title: Goals + type: bullet-list + instruction: Bullet list of 1-line desired outcomes this enhancement will deliver if successful + - id: background + title: Background Context + type: paragraphs + instruction: 1-2 short paragraphs explaining why this enhancement is needed, what problem it solves, and how it fits with the existing project + - id: changelog + title: Change Log + type: table + columns: [Change, Date, Version, Description, Author] + + - id: requirements + title: Requirements + instruction: | + Draft functional and non-functional requirements based on your validated understanding of the existing project. Before presenting requirements, confirm: "These requirements are based on my understanding of your existing system. Please review carefully and confirm they align with your project's reality." + elicit: true + sections: + - id: functional + title: Functional + type: numbered-list + prefix: FR + instruction: Each Requirement will be a bullet markdown with identifier starting with FR + examples: + - "FR1: The existing Todo List will integrate with the new AI duplicate detection service without breaking current functionality." + - id: non-functional + title: Non Functional + type: numbered-list + prefix: NFR + instruction: Each Requirement will be a bullet markdown with identifier starting with NFR. Include constraints from existing system + examples: + - "NFR1: Enhancement must maintain existing performance characteristics and not exceed current memory usage by more than 20%." + - id: compatibility + title: Compatibility Requirements + instruction: Critical for brownfield - what must remain compatible + type: numbered-list + prefix: CR + template: "{{requirement}}: {{description}}" + items: + - id: cr1 + template: "CR1: {{existing_api_compatibility}}" + - id: cr2 + template: "CR2: {{database_schema_compatibility}}" + - id: cr3 + template: "CR3: {{ui_ux_consistency}}" + - id: cr4 + template: "CR4: {{integration_compatibility}}" + + - id: ui-enhancement-goals + title: User Interface Enhancement Goals + condition: Enhancement includes UI changes + instruction: For UI changes, capture how they will integrate with existing UI patterns and design systems + sections: + - id: existing-ui-integration + title: Integration with Existing UI + instruction: Describe how new UI elements will fit with existing design patterns, style guides, and component libraries + - id: modified-screens + title: Modified/New Screens and Views + instruction: List only the screens/views that will be modified or added + - id: ui-consistency + title: UI Consistency Requirements + instruction: Specific requirements for maintaining visual and interaction consistency with existing application + + - id: technical-constraints + title: Technical Constraints and Integration Requirements + instruction: This section replaces separate architecture documentation. Gather detailed technical constraints from existing project analysis. + sections: + - id: existing-tech-stack + title: Existing Technology Stack + instruction: | + If document-project output available: + - Extract from "Actual Tech Stack" table in High Level Architecture section + - Include version numbers and any noted constraints + + Otherwise, document the current technology stack: + template: | + **Languages**: {{languages}} + **Frameworks**: {{frameworks}} + **Database**: {{database}} + **Infrastructure**: {{infrastructure}} + **External Dependencies**: {{external_dependencies}} + - id: integration-approach + title: Integration Approach + instruction: Define how the enhancement will integrate with existing architecture + template: | + **Database Integration Strategy**: {{database_integration}} + **API Integration Strategy**: {{api_integration}} + **Frontend Integration Strategy**: {{frontend_integration}} + **Testing Integration Strategy**: {{testing_integration}} + - id: code-organization + title: Code Organization and Standards + instruction: Based on existing project analysis, define how new code will fit existing patterns + template: | + **File Structure Approach**: {{file_structure}} + **Naming Conventions**: {{naming_conventions}} + **Coding Standards**: {{coding_standards}} + **Documentation Standards**: {{documentation_standards}} + - id: deployment-operations + title: Deployment and Operations + instruction: How the enhancement fits existing deployment pipeline + template: | + **Build Process Integration**: {{build_integration}} + **Deployment Strategy**: {{deployment_strategy}} + **Monitoring and Logging**: {{monitoring_logging}} + **Configuration Management**: {{config_management}} + - id: risk-assessment + title: Risk Assessment and Mitigation + instruction: | + If document-project output available: + - Reference "Technical Debt and Known Issues" section + - Include "Workarounds and Gotchas" that might impact enhancement + - Note any identified constraints from "Critical Technical Debt" + + Build risk assessment incorporating existing known issues: + template: | + **Technical Risks**: {{technical_risks}} + **Integration Risks**: {{integration_risks}} + **Deployment Risks**: {{deployment_risks}} + **Mitigation Strategies**: {{mitigation_strategies}} + + - id: epic-structure + title: Epic and Story Structure + instruction: | + For brownfield projects, favor a single comprehensive epic unless the user is clearly requesting multiple unrelated enhancements. Before presenting the epic structure, confirm: "Based on my analysis of your existing project, I believe this enhancement should be structured as [single epic/multiple epics] because [rationale based on actual project analysis]. Does this align with your understanding of the work required?" + elicit: true + sections: + - id: epic-approach + title: Epic Approach + instruction: Explain the rationale for epic structure - typically single epic for brownfield unless multiple unrelated features + template: "**Epic Structure Decision**: {{epic_decision}} with rationale" + + - id: epic-details + title: "Epic 1: {{enhancement_title}}" + instruction: | + Comprehensive epic that delivers the brownfield enhancement while maintaining existing functionality + + CRITICAL STORY SEQUENCING FOR BROWNFIELD: + - Stories must ensure existing functionality remains intact + - Each story should include verification that existing features still work + - Stories should be sequenced to minimize risk to existing system + - Include rollback considerations for each story + - Focus on incremental integration rather than big-bang changes + - Size stories for AI agent execution in existing codebase context + - MANDATORY: Present the complete story sequence and ask: "This story sequence is designed to minimize risk to your existing system. Does this order make sense given your project's architecture and constraints?" + - Stories must be logically sequential with clear dependencies identified + - Each story must deliver value while maintaining system integrity + template: | + **Epic Goal**: {{epic_goal}} + + **Integration Requirements**: {{integration_requirements}} + sections: + - id: story + title: "Story 1.{{story_number}} {{story_title}}" + repeatable: true + template: | + As a {{user_type}}, + I want {{action}}, + so that {{benefit}}. + sections: + - id: acceptance-criteria + title: Acceptance Criteria + type: numbered-list + instruction: Define criteria that include both new functionality and existing system integrity + item_template: "{{criterion_number}}: {{criteria}}" + - id: integration-verification + title: Integration Verification + instruction: Specific verification steps to ensure existing functionality remains intact + type: numbered-list + prefix: IV + items: + - template: "IV1: {{existing_functionality_verification}}" + - template: "IV2: {{integration_point_verification}}" + - template: "IV3: {{performance_impact_verification}}" +==================== END: .bmad-core/templates/brownfield-prd-tmpl.yaml ==================== ==================== START: .bmad-core/checklists/pm-checklist.md ==================== # Product Manager (PM) Requirements Checklist @@ -5892,2530 +6005,2162 @@ Keep it action-oriented and forward-looking.]] None Listed ==================== END: .bmad-core/data/technical-preferences.md ==================== -==================== START: .bmad-core/templates/architecture-tmpl.md ==================== -# {{Project Name}} Architecture Document - -[[LLM: If available, review any provided relevant documents to gather all relevant context before beginning. If at a minimum you cannot local `docs/prd.md` ask the user what docs will provide the basis for the architecture.]] - -[[LLM: The default path and filename unless specified is docs/architecture.md]] - -## Introduction - -[[LLM: This section establishes the document's purpose and scope. Keep the content below but ensure project name is properly substituted. - -After presenting this section, apply `.bmad-core/tasks/advanced-elicitation.md` protocol]] - -This document outlines the overall project architecture for {{Project Name}}, including backend systems, shared services, and non-UI specific concerns. Its primary goal is to serve as the guiding architectural blueprint for AI-driven development, ensuring consistency and adherence to chosen patterns and technologies. - -**Relationship to Frontend Architecture:** -If the project includes a significant user interface, a separate Frontend Architecture Document will detail the frontend-specific design and MUST be used in conjunction with this document. Core technology stack choices documented herein (see "Tech Stack") are definitive for the entire project, including any frontend components. - -### Starter Template or Existing Project - -[[LLM: Before proceeding further with architecture design, check if the project is based on a starter template or existing codebase: - -1. Review the PRD and brainstorming brief for any mentions of: - -- Starter templates (e.g., Create React App, Next.js, Vue CLI, Angular CLI, etc.) -- Existing projects or codebases being used as a foundation -- Boilerplate projects or scaffolding tools -- Previous projects to be cloned or adapted - -2. If a starter template or existing project is mentioned: - -- Ask the user to provide access via one of these methods: - - Link to the starter template documentation - - Upload/attach the project files (for small projects) - - Share a link to the project repository (GitHub, GitLab, etc.) -- Analyze the starter/existing project to understand: - - Pre-configured technology stack and versions - - Project structure and organization patterns - - Built-in scripts and tooling - - Existing architectural patterns and conventions - - Any limitations or constraints imposed by the starter -- Use this analysis to inform and align your architecture decisions - -3. If no starter template is mentioned but this is a greenfield project: - -- Suggest appropriate starter templates based on the tech stack preferences -- Explain the benefits (faster setup, best practices, community support) -- Let the user decide whether to use one - -4. If the user confirms no starter template will be used: - -- Proceed with architecture design from scratch -- Note that manual setup will be required for all tooling and configuration - -Document the decision here before proceeding with the architecture design. In none, just say N/A - -After presenting this starter template section, apply `.bmad-core/tasks/advanced-elicitation.md` protocol]] - -### Change Log - -[[LLM: Track document versions and changes]] - -| Date | Version | Description | Author | -| :--- | :------ | :---------- | :----- | - -## High Level Architecture - -[[LLM: This section contains multiple subsections that establish the foundation of the architecture. Present all subsections together (Introduction, Technical Summary, High Level Overview, Project Diagram, and Architectural Patterns), then apply `.bmad-core/tasks/advanced-elicitation.md` protocol to the complete High Level Architecture section. The user can choose to refine the entire section or specific subsections.]] - -### Technical Summary - -[[LLM: Provide a brief paragraph (3-5 sentences) overview of: - -- The system's overall architecture style -- Key components and their relationships -- Primary technology choices -- Core architectural patterns being used -- Reference back to the PRD goals and how this architecture supports them]] - -### High Level Overview - -[[LLM: Based on the PRD's Technical Assumptions section, describe: - -1. The main architectural style (e.g., Monolith, Microservices, Serverless, Event-Driven) -2. Repository structure decision from PRD (Monorepo/Polyrepo) -3. Service architecture decision from PRD -4. Primary user interaction flow or data flow at a conceptual level -5. Key architectural decisions and their rationale - -After presenting this section, apply `.bmad-core/tasks/advanced-elicitation.md` protocol]] - -### High Level Project Diagram - -[[LLM: Create a Mermaid diagram that visualizes the high-level architecture. Consider: - -- System boundaries -- Major components/services -- Data flow directions -- External integrations -- User entry points - -Use appropriate Mermaid diagram type (graph TD, C4, sequence) based on what best represents the architecture - -After presenting the diagram, apply `.bmad-core/tasks/advanced-elicitation.md` protocol]] - -### Architectural and Design Patterns - -[[LLM: List the key high-level patterns that will guide the architecture. For each pattern: - -1. Present 2-3 viable options if multiple exist -2. Provide your recommendation with clear rationale -3. Get user confirmation before finalizing -4. These patterns should align with the PRD's technical assumptions and project goals - -Common patterns to consider: - -- Architectural style patterns (Serverless, Event-Driven, Microservices, CQRS, Hexagonal) -- Code organization patterns (Dependency Injection, Repository, Module, Factory) -- Data patterns (Event Sourcing, Saga, Database per Service) -- Communication patterns (REST, GraphQL, Message Queue, Pub/Sub)]] - -<> - -- **{{pattern_name}}:** {{pattern_description}} - _Rationale:_ {{rationale}} - -<> - -@{example: patterns} - -- **Serverless Architecture:** Using AWS Lambda for compute - _Rationale:_ Aligns with PRD requirement for cost optimization and automatic scaling -- **Repository Pattern:** Abstract data access logic - _Rationale:_ Enables testing and future database migration flexibility -- **Event-Driven Communication:** Using SNS/SQS for service decoupling - _Rationale:_ Supports async processing and system resilience - -@{/example} - -[[LLM: After presenting the patterns, apply `.bmad-core/tasks/advanced-elicitation.md` protocol]] - -## Tech Stack - -[[LLM: This is the DEFINITIVE technology selection section. Work with the user to make specific choices: - -1. Review PRD technical assumptions and any preferences from `.bmad-core/data/technical-preferences.yaml` or an attached `technical-preferences` -2. For each category, present 2-3 viable options with pros/cons -3. Make a clear recommendation based on project needs -4. Get explicit user approval for each selection -5. Document exact versions (avoid "latest" - pin specific versions) -6. This table is the single source of truth - all other docs must reference these choices - -Key decisions to finalize - before displaying the table, ensure you are aware of or ask the user about - let the user know if they are not sure on any that you can also provide suggestions with rationale: - -- Starter templates (if any) -- Languages and runtimes with exact versions -- Frameworks and libraries / packages -- Cloud provider and key services choices -- Database and storage solutions - if unclear suggest sql or nosql or other types depending on the project and depending on cloud provider offer a suggestion -- Development tools - -Upon render of the table, ensure the user is aware of the importance of this sections choices, should also look for gaps or disagreements with anything, ask for any clarifications if something is unclear why its in the list, and also right away apply `.bmad-core/tasks/advanced-elicitation.md` display - this statement and the options should be rendered and then prompt right all before allowing user input.]] - -### Cloud Infrastructure - -- **Provider:** {{cloud_provider}} -- **Key Services:** {{core_services_list}} -- **Deployment Regions:** {{regions}} - -### Technology Stack Table - -| Category | Technology | Version | Purpose | Rationale | -| :----------------- | :----------------- | :---------- | :---------- | :------------- | -| **Language** | {{language}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **Runtime** | {{runtime}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **Framework** | {{framework}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **Database** | {{database}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **Cache** | {{cache}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **Message Queue** | {{queue}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **API Style** | {{api_style}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **Authentication** | {{auth}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **Testing** | {{test_framework}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **Build Tool** | {{build_tool}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **IaC Tool** | {{iac_tool}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **Monitoring** | {{monitoring}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **Logging** | {{logging}} | {{version}} | {{purpose}} | {{why_chosen}} | - -@{example: tech_stack_row} -| **Language** | TypeScript | 5.3.3 | Primary development language | Strong typing, excellent tooling, team expertise | -| **Runtime** | Node.js | 20.11.0 | JavaScript runtime | LTS version, stable performance, wide ecosystem | -| **Framework** | NestJS | 10.3.2 | Backend framework | Enterprise-ready, good DI, matches team patterns | -@{/example} - -## Data Models - -[[LLM: Define the core data models/entities: - -1. Review PRD requirements and identify key business entities -2. For each model, explain its purpose and relationships -3. Include key attributes and data types -4. Show relationships between models -5. Discuss design decisions with user - -Create a clear conceptual model before moving to database schema. - -After presenting all data models, apply `.bmad-core/tasks/advanced-elicitation.md` protocol]] - -<> - -### {{model_name}} - -**Purpose:** {{model_purpose}} - -**Key Attributes:** - -- {{attribute_1}}: {{type_1}} - {{description_1}} -- {{attribute_2}}: {{type_2}} - {{description_2}} - -**Relationships:** - -- {{relationship_1}} -- {{relationship_2}} - <> - -## Components - -[[LLM: Based on the architectural patterns, tech stack, and data models from above: - -1. Identify major logical components/services and their responsibilities -2. Consider the repository structure (monorepo/polyrepo) from PRD -3. Define clear boundaries and interfaces between components -4. For each component, specify: - -- Primary responsibility -- Key interfaces/APIs exposed -- Dependencies on other components -- Technology specifics based on tech stack choices - -5. Create component diagrams where helpful -6. After presenting all components, apply `.bmad-core/tasks/advanced-elicitation.md` protocol]] - -<> - -### {{component_name}} - -**Responsibility:** {{component_description}} - -**Key Interfaces:** - -- {{interface_1}} -- {{interface_2}} - -**Dependencies:** {{dependencies}} - -**Technology Stack:** {{component_tech_details}} -<> - -### Component Diagrams - -[[LLM: Create Mermaid diagrams to visualize component relationships. Options: - -- C4 Container diagram for high-level view -- Component diagram for detailed internal structure -- Sequence diagrams for complex interactions - Choose the most appropriate for clarity - -After presenting the diagrams, apply `.bmad-core/tasks/advanced-elicitation.md` protocol]] - -## External APIs - -[[LLM: For each external service integration: - -1. Identify APIs needed based on PRD requirements and component design -2. If documentation URLs are unknown, ask user for specifics -3. Document authentication methods and security considerations -4. List specific endpoints that will be used -5. Note any rate limits or usage constraints - -If no external APIs are needed, state this explicitly and skip to next section.]] - -^^CONDITION: has_external_apis^^ - -<> - -### {{api_name}} API - -- **Purpose:** {{api_purpose}} -- **Documentation:** {{api_docs_url}} -- **Base URL(s):** {{api_base_url}} -- **Authentication:** {{auth_method}} -- **Rate Limits:** {{rate_limits}} - -**Key Endpoints Used:** -<> - -- `{{method}} {{endpoint_path}}` - {{endpoint_purpose}} - <> - -**Integration Notes:** {{integration_considerations}} -<> - -@{example: external_api} - -### Stripe API - -- **Purpose:** Payment processing and subscription management -- **Documentation:** https://stripe.com/docs/api -- **Base URL(s):** `https://api.stripe.com/v1` -- **Authentication:** Bearer token with secret key -- **Rate Limits:** 100 requests per second - -**Key Endpoints Used:** - -- `POST /customers` - Create customer profiles -- `POST /payment_intents` - Process payments -- `POST /subscriptions` - Manage subscriptions - @{/example} - -^^/CONDITION: has_external_apis^^ - -[[LLM: After presenting external APIs (or noting their absence), apply `.bmad-core/tasks/advanced-elicitation.md` protocol]] - -## Core Workflows - -[[LLM: Illustrate key system workflows using sequence diagrams: - -1. Identify critical user journeys from PRD -2. Show component interactions including external APIs -3. Include error handling paths -4. Document async operations -5. Create both high-level and detailed diagrams as needed - -Focus on workflows that clarify architecture decisions or complex interactions. - -After presenting the workflow diagrams, apply `.bmad-core/tasks/advanced-elicitation.md` protocol]] - -## REST API Spec - -[[LLM: If the project includes a REST API: - -1. Create an OpenAPI 3.0 specification -2. Include all endpoints from epics/stories -3. Define request/response schemas based on data models -4. Document authentication requirements -5. Include example requests/responses - -Use YAML format for better readability. If no REST API, skip this section.]] - -^^CONDITION: has_rest_api^^ - -```yaml -openapi: 3.0.0 -info: - title: - '[object Object]': null - version: - '[object Object]': null - description: - '[object Object]': null -servers: - - url: - '[object Object]': null - description: - '[object Object]': null -``` - -^^/CONDITION: has_rest_api^^ - -[[LLM: After presenting the REST API spec (or noting its absence if not applicable), apply `.bmad-core/tasks/advanced-elicitation.md` protocol]] - -## Database Schema - -[[LLM: Transform the conceptual data models into concrete database schemas: - -1. Use the database type(s) selected in Tech Stack -2. Create schema definitions using appropriate notation -3. Include indexes, constraints, and relationships -4. Consider performance and scalability -5. For NoSQL, show document structures - -Present schema in format appropriate to database type (SQL DDL, JSON schema, etc.) - -After presenting the database schema, apply `.bmad-core/tasks/advanced-elicitation.md` protocol]] - -## Source Tree - -[[LLM: Create a project folder structure that reflects: - -1. The chosen repository structure (monorepo/polyrepo) -2. The service architecture (monolith/microservices/serverless) -3. The selected tech stack and languages -4. Component organization from above -5. Best practices for the chosen frameworks -6. Clear separation of concerns - -Adapt the structure based on project needs. For monorepos, show service separation. For serverless, show function organization. Include language-specific conventions. - -After presenting the structure, apply `.bmad-core/tasks/advanced-elicitation.md` protocol to refine based on user feedback.]] - -```plaintext -{{project-root}}/ -├── .github/ # CI/CD workflows -│ └── workflows/ -│ └── main.yaml -├── .vscode/ # VSCode settings (optional) -│ └── settings.json -├── build/ # Compiled output (git-ignored) -├── config/ # Configuration files -├── docs/ # Project documentation -│ ├── PRD.md -│ ├── architecture.md -│ └── ... -├── infra/ # Infrastructure as Code -│ └── {{iac-structure}} -├── {{dependencies-dir}}/ # Dependencies (git-ignored) -├── scripts/ # Utility scripts -├── src/ # Application source code -│ └── {{source-structure}} -├── tests/ # Test files -│ ├── unit/ -│ ├── integration/ -│ └── e2e/ -├── .env.example # Environment variables template -├── .gitignore # Git ignore rules -├── {{package-manifest}} # Dependencies manifest -├── {{config-files}} # Language/framework configs -└── README.md # Project documentation - -@{example: monorepo-structure} -project-root/ -├── packages/ -│ ├── api/ # Backend API service -│ ├── web/ # Frontend application -│ ├── shared/ # Shared utilities/types -│ └── infrastructure/ # IaC definitions -├── scripts/ # Monorepo management scripts -└── package.json # Root package.json with workspaces -@{/example} -``` - -[[LLM: After presenting the source tree structure, apply `.bmad-core/tasks/advanced-elicitation.md` protocol]] - -## Infrastructure and Deployment - -[[LLM: Define the deployment architecture and practices: - -1. Use IaC tool selected in Tech Stack -2. Choose deployment strategy appropriate for the architecture -3. Define environments and promotion flow -4. Establish rollback procedures -5. Consider security, monitoring, and cost optimization - -Get user input on deployment preferences and CI/CD tool choices.]] - -### Infrastructure as Code - -- **Tool:** {{iac_tool}} {{version}} -- **Location:** `{{iac_directory}}` -- **Approach:** {{iac_approach}} - -### Deployment Strategy - -- **Strategy:** {{deployment_strategy}} -- **CI/CD Platform:** {{cicd_platform}} -- **Pipeline Configuration:** `{{pipeline_config_location}}` - -### Environments - -<> - -- **{{env_name}}:** {{env_purpose}} - {{env_details}} - <> - -### Environment Promotion Flow - -```text -{{promotion_flow_diagram}} -``` - -### Rollback Strategy - -- **Primary Method:** {{rollback_method}} -- **Trigger Conditions:** {{rollback_triggers}} -- **Recovery Time Objective:** {{rto}} - -[[LLM: After presenting the infrastructure and deployment section, apply `.bmad-core/tasks/advanced-elicitation.md` protocol]] - -## Error Handling Strategy - -[[LLM: Define comprehensive error handling approach: - -1. Choose appropriate patterns for the language/framework from Tech Stack -2. Define logging standards and tools -3. Establish error categories and handling rules -4. Consider observability and debugging needs -5. Ensure security (no sensitive data in logs) - -This section guides both AI and human developers in consistent error handling.]] - -### General Approach - -- **Error Model:** {{error_model}} -- **Exception Hierarchy:** {{exception_structure}} -- **Error Propagation:** {{propagation_rules}} - -### Logging Standards - -- **Library:** {{logging_library}} {{version}} -- **Format:** {{log_format}} -- **Levels:** {{log_levels_definition}} -- **Required Context:** - - Correlation ID: {{correlation_id_format}} - - Service Context: {{service_context}} - - User Context: {{user_context_rules}} - -### Error Handling Patterns - -#### External API Errors - -- **Retry Policy:** {{retry_strategy}} -- **Circuit Breaker:** {{circuit_breaker_config}} -- **Timeout Configuration:** {{timeout_settings}} -- **Error Translation:** {{error_mapping_rules}} - -#### Business Logic Errors - -- **Custom Exceptions:** {{business_exception_types}} -- **User-Facing Errors:** {{user_error_format}} -- **Error Codes:** {{error_code_system}} - -#### Data Consistency - -- **Transaction Strategy:** {{transaction_approach}} -- **Compensation Logic:** {{compensation_patterns}} -- **Idempotency:** {{idempotency_approach}} - -[[LLM: After presenting the error handling strategy, apply `.bmad-core/tasks/advanced-elicitation.md` protocol]] - -## Coding Standards - -[[LLM: These standards are MANDATORY for AI agents. Work with user to define ONLY the critical rules needed to prevent bad code. Explain that: - -1. This section directly controls AI developer behavior -2. Keep it minimal - assume AI knows general best practices -3. Focus on project-specific conventions and gotchas -4. Overly detailed standards bloat context and slow development -5. Standards will be extracted to separate file for dev agent use - -For each standard, get explicit user confirmation it's necessary.]] - -### Core Standards - -- **Languages & Runtimes:** {{languages_and_versions}} -- **Style & Linting:** {{linter_config}} -- **Test Organization:** {{test_file_convention}} - -### Naming Conventions - -[[LLM: Only include if deviating from language defaults]] - -| Element | Convention | Example | -| :-------- | :------------------- | :---------------- | -| Variables | {{var_convention}} | {{var_example}} | -| Functions | {{func_convention}} | {{func_example}} | -| Classes | {{class_convention}} | {{class_example}} | -| Files | {{file_convention}} | {{file_example}} | - -### Critical Rules - -[[LLM: List ONLY rules that AI might violate or project-specific requirements. Examples: - -- "Never use console.log in production code - use logger" -- "All API responses must use ApiResponse wrapper type" -- "Database queries must use repository pattern, never direct ORM" - -Avoid obvious rules like "use SOLID principles" or "write clean code"]] - -<> - -- **{{rule_name}}:** {{rule_description}} - <> - -### Language-Specific Guidelines - -[[LLM: Add ONLY if critical for preventing AI mistakes. Most teams don't need this section.]] - -^^CONDITION: has_language_specifics^^ - -#### {{language_name}} Specifics - -<> - -- **{{rule_topic}}:** {{rule_detail}} - <> - -^^/CONDITION: has_language_specifics^^ - -[[LLM: After presenting the coding standards, apply `.bmad-core/tasks/advanced-elicitation.md` protocol]] - -## Test Strategy and Standards - -[[LLM: Work with user to define comprehensive test strategy: - -1. Use test frameworks from Tech Stack -2. Decide on TDD vs test-after approach -3. Define test organization and naming -4. Establish coverage goals -5. Determine integration test infrastructure -6. Plan for test data and external dependencies - -Note: Basic info goes in Coding Standards for dev agent. This detailed section is for QA agent and team reference. Apply `.bmad-core/tasks/advanced-elicitation.md` after initial draft.]] - -### Testing Philosophy - -- **Approach:** {{test_approach}} -- **Coverage Goals:** {{coverage_targets}} -- **Test Pyramid:** {{test_distribution}} - -### Test Types and Organization - -#### Unit Tests - -- **Framework:** {{unit_test_framework}} {{version}} -- **File Convention:** {{unit_test_naming}} -- **Location:** {{unit_test_location}} -- **Mocking Library:** {{mocking_library}} -- **Coverage Requirement:** {{unit_coverage}} - -**AI Agent Requirements:** - -- Generate tests for all public methods -- Cover edge cases and error conditions -- Follow AAA pattern (Arrange, Act, Assert) -- Mock all external dependencies - -#### Integration Tests - -- **Scope:** {{integration_scope}} -- **Location:** {{integration_test_location}} -- **Test Infrastructure:** - <> - - **{{dependency_name}}:** {{test_approach}} ({{test_tool}}) - <> - -@{example: test_dependencies} - -- **Database:** In-memory H2 for unit tests, Testcontainers PostgreSQL for integration -- **Message Queue:** Embedded Kafka for tests -- **External APIs:** WireMock for stubbing - @{/example} - -#### End-to-End Tests - -- **Framework:** {{e2e_framework}} {{version}} -- **Scope:** {{e2e_scope}} -- **Environment:** {{e2e_environment}} -- **Test Data:** {{e2e_data_strategy}} - -### Test Data Management - -- **Strategy:** {{test_data_approach}} -- **Fixtures:** {{fixture_location}} -- **Factories:** {{factory_pattern}} -- **Cleanup:** {{cleanup_strategy}} - -### Continuous Testing - -- **CI Integration:** {{ci_test_stages}} -- **Performance Tests:** {{perf_test_approach}} -- **Security Tests:** {{security_test_approach}} - -[[LLM: After presenting the test strategy section, apply `.bmad-core/tasks/advanced-elicitation.md` protocol]] - -## Security - -[[LLM: Define MANDATORY security requirements for AI and human developers: - -1. Focus on implementation-specific rules -2. Reference security tools from Tech Stack -3. Define clear patterns for common scenarios -4. These rules directly impact code generation -5. Work with user to ensure completeness without redundancy]] - -### Input Validation - -- **Validation Library:** {{validation_library}} -- **Validation Location:** {{where_to_validate}} -- **Required Rules:** - - All external inputs MUST be validated - - Validation at API boundary before processing - - Whitelist approach preferred over blacklist - -### Authentication & Authorization - -- **Auth Method:** {{auth_implementation}} -- **Session Management:** {{session_approach}} -- **Required Patterns:** - - {{auth_pattern_1}} - - {{auth_pattern_2}} - -### Secrets Management - -- **Development:** {{dev_secrets_approach}} -- **Production:** {{prod_secrets_service}} -- **Code Requirements:** - - NEVER hardcode secrets - - Access via configuration service only - - No secrets in logs or error messages - -### API Security - -- **Rate Limiting:** {{rate_limit_implementation}} -- **CORS Policy:** {{cors_configuration}} -- **Security Headers:** {{required_headers}} -- **HTTPS Enforcement:** {{https_approach}} - -### Data Protection - -- **Encryption at Rest:** {{encryption_at_rest}} -- **Encryption in Transit:** {{encryption_in_transit}} -- **PII Handling:** {{pii_rules}} -- **Logging Restrictions:** {{what_not_to_log}} - -### Dependency Security - -- **Scanning Tool:** {{dependency_scanner}} -- **Update Policy:** {{update_frequency}} -- **Approval Process:** {{new_dep_process}} - -### Security Testing - -- **SAST Tool:** {{static_analysis}} -- **DAST Tool:** {{dynamic_analysis}} -- **Penetration Testing:** {{pentest_schedule}} - -[[LLM: After presenting the security section, apply `.bmad-core/tasks/advanced-elicitation.md` protocol]] - -## Checklist Results Report - -[[LLM: Before running the checklist, offer to output the full architecture document. Once user confirms, execute the `architect-checklist` and populate results here.]] - ---- - -## Next Steps - -[[LLM: After completing the architecture: - -1. If project has UI components: - -- Recommend engaging Design Architect agent -- Use "Frontend Architecture Mode" -- Provide this document as input - -2. For all projects: - -- Review with Product Owner -- Begin story implementation with Dev agent -- Set up infrastructure with DevOps agent - -3. Include specific prompts for next agents if needed]] - -^^CONDITION: has_ui^^ - -### Design Architect Prompt - -[[LLM: Create a brief prompt to hand off to Design Architect for Frontend Architecture creation. Include: - -- Reference to this architecture document -- Key UI requirements from PRD -- Any frontend-specific decisions made here -- Request for detailed frontend architecture]] - -^^/CONDITION: has_ui^^ - -### Developer Handoff - -[[LLM: Create a brief prompt for developers starting implementation. Include: - -- Reference to this architecture and coding standards -- First epic/story to implement -- Key technical decisions to follow]] -==================== END: .bmad-core/templates/architecture-tmpl.md ==================== - -==================== START: .bmad-core/templates/front-end-architecture-tmpl.md ==================== -# {{Project Name}} Frontend Architecture Document - -[[LLM: The default path and filename unless specified is docs/ui-architecture.md]] - -[[LLM: Review provided documents including PRD, UX-UI Specification, and main Architecture Document. Focus on extracting technical implementation details needed for AI frontend tools and developer agents. Ask the user for any of these documents if you are unable to locate and were not provided.]] - -## Template and Framework Selection - -[[LLM: Before proceeding with frontend architecture design, check if the project is using a frontend starter template or existing codebase: - -1. Review the PRD, main architecture document, and brainstorming brief for mentions of: - - - Frontend starter templates (e.g., Create React App, Next.js, Vite, Vue CLI, Angular CLI, etc.) - - UI kit or component library starters - - Existing frontend projects being used as a foundation - - Admin dashboard templates or other specialized starters - - Design system implementations - -2. If a frontend starter template or existing project is mentioned: - - - Ask the user to provide access via one of these methods: - - Link to the starter template documentation - - Upload/attach the project files (for small projects) - - Share a link to the project repository - - Analyze the starter/existing project to understand: - - Pre-installed dependencies and versions - - Folder structure and file organization - - Built-in components and utilities - - Styling approach (CSS modules, styled-components, Tailwind, etc.) - - State management setup (if any) - - Routing configuration - - Testing setup and patterns - - Build and development scripts - -- Use this analysis to ensure your frontend architecture aligns with the starter's patterns - -3. If no frontend starter is mentioned but this is a new UI, ensure we know what the ui language and framework is: - - - Based on the framework choice, suggest appropriate starters: - - React: Create React App, Next.js, Vite + React - - Vue: Vue CLI, Nuxt.js, Vite + Vue - - Angular: Angular CLI - - Or suggest popular UI templates if applicable - - Explain benefits specific to frontend development - -4. If the user confirms no starter template will be used: - - Note that all tooling, bundling, and configuration will need manual setup - - Proceed with frontend architecture from scratch - -Document the starter template decision and any constraints it imposes before proceeding.]] - -### Change Log - -[[LLM: Track document versions and changes]] - -| Date | Version | Description | Author | -| :--- | :------ | :---------- | :----- | - -## Frontend Tech Stack - -[[LLM: Extract from main architecture's Technology Stack Table. This section MUST remain synchronized with the main architecture document. After presenting this section, apply `tasks#advanced-elicitation` protocol]] - -### Technology Stack Table - -| Category | Technology | Version | Purpose | Rationale | -| :-------------------- | :------------------- | :---------- | :---------- | :------------- | -| **Framework** | {{framework}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **UI Library** | {{ui_library}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **State Management** | {{state_management}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **Routing** | {{routing_library}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **Build Tool** | {{build_tool}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **Styling** | {{styling_solution}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **Testing** | {{test_framework}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **Component Library** | {{component_lib}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **Form Handling** | {{form_library}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **Animation** | {{animation_lib}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **Dev Tools** | {{dev_tools}} | {{version}} | {{purpose}} | {{why_chosen}} | - -[[LLM: Fill in appropriate technology choices based on the selected framework and project requirements.]] - -## Project Structure - -[[LLM: Define exact directory structure for AI tools based on the chosen framework. Be specific about where each type of file goes. Generate a structure that follows the framework's best practices and conventions. After presenting this section, apply `tasks#advanced-elicitation` protocol]] - -## Component Standards - -[[LLM: Define exact patterns for component creation based on the chosen framework. After presenting this section, apply `tasks#advanced-elicitation` protocol]] - -### Component Template - -[[LLM: Generate a minimal but complete component template following the framework's best practices. Include TypeScript types, proper imports, and basic structure.]] - -### Naming Conventions - -[[LLM: Provide naming conventions specific to the chosen framework for components, files, services, state management, and other architectural elements.]] - -## State Management - -[[LLM: Define state management patterns based on the chosen framework. After presenting this section, apply `tasks#advanced-elicitation` protocol]] - -### Store Structure - -[[LLM: Generate the state management directory structure appropriate for the chosen framework and selected state management solution.]] - -### State Management Template - -[[LLM: Provide a basic state management template/example following the framework's recommended patterns. Include TypeScript types and common operations like setting, updating, and clearing state.]] - -## API Integration - -[[LLM: Define API service patterns based on the chosen framework. After presenting this section, apply `tasks#advanced-elicitation` protocol]] - -### Service Template - -[[LLM: Provide an API service template that follows the framework's conventions. Include proper TypeScript types, error handling, and async patterns.]] - -### API Client Configuration - -[[LLM: Show how to configure the HTTP client for the chosen framework, including authentication interceptors/middleware and error handling.]] - -## Routing - -[[LLM: Define routing structure and patterns based on the chosen framework. After presenting this section, apply `tasks#advanced-elicitation` protocol]] - -### Route Configuration - -[[LLM: Provide routing configuration appropriate for the chosen framework. Include protected route patterns, lazy loading where applicable, and authentication guards/middleware.]] - -## Styling Guidelines - -[[LLM: Define styling approach based on the chosen framework. After presenting this section, apply `tasks#advanced-elicitation` protocol]] - -### Styling Approach - -[[LLM: Describe the styling methodology appropriate for the chosen framework (CSS Modules, Styled Components, Tailwind, etc.) and provide basic patterns.]] - -### Global Theme Variables - -[[LLM: Provide a CSS custom properties (CSS variables) theme system that works across all frameworks. Include colors, spacing, typography, shadows, and dark mode support.]] - -## Testing Requirements - -[[LLM: Define minimal testing requirements based on the chosen framework. After presenting this section, apply `tasks#advanced-elicitation` protocol]] - -### Component Test Template - -[[LLM: Provide a basic component test template using the framework's recommended testing library. Include examples of rendering tests, user interaction tests, and mocking.]] - -### Testing Best Practices - -1. **Unit Tests**: Test individual components in isolation -2. **Integration Tests**: Test component interactions -3. **E2E Tests**: Test critical user flows (using Cypress/Playwright) -4. **Coverage Goals**: Aim for 80% code coverage -5. **Test Structure**: Arrange-Act-Assert pattern -6. **Mock External Dependencies**: API calls, routing, state management - -## Environment Configuration - -[[LLM: List required environment variables based on the chosen framework. Show the appropriate format and naming conventions for the framework. After presenting this section, apply `tasks#advanced-elicitation` protocol]] - -## Frontend Developer Standards - -### Critical Coding Rules - -[[LLM: List essential rules that prevent common AI mistakes, including both universal rules and framework-specific ones. After presenting this section, apply `tasks#advanced-elicitation` protocol]] - -### Quick Reference - -[[LLM: Create a framework-specific cheat sheet with: - -- Common commands (dev server, build, test) -- Key import patterns -- File naming conventions -- Project-specific patterns and utilities]] -==================== END: .bmad-core/templates/front-end-architecture-tmpl.md ==================== - -==================== START: .bmad-core/templates/fullstack-architecture-tmpl.md ==================== -# {{Project Name}} Fullstack Architecture Document - -[[LLM: The default path and filename unless specified is docs/architecture.md]] - -[[LLM: If available, review any provided relevant documents to gather all relevant context before beginning. At minimum, you should have access to docs/prd.md and docs/front-end-spec.md. Ask the user for any documents you need but cannot locate. This template creates a unified architecture that covers both backend and frontend concerns to guide AI-driven fullstack development.]] - -## Introduction - -[[LLM: This section establishes the document's purpose and scope. Keep the content below but ensure project name is properly substituted. - -After presenting this section, apply `tasks#advanced-elicitation` protocol]] - -This document outlines the complete fullstack architecture for {{Project Name}}, including backend systems, frontend implementation, and their integration. It serves as the single source of truth for AI-driven development, ensuring consistency across the entire technology stack. - -This unified approach combines what would traditionally be separate backend and frontend architecture documents, streamlining the development process for modern fullstack applications where these concerns are increasingly intertwined. - -### Starter Template or Existing Project - -[[LLM: Before proceeding with architecture design, check if the project is based on any starter templates or existing codebases: - -1. Review the PRD and other documents for mentions of: - -- Fullstack starter templates (e.g., T3 Stack, MEAN/MERN starters, Django + React templates) -- Monorepo templates (e.g., Nx, Turborepo starters) -- Platform-specific starters (e.g., Vercel templates, AWS Amplify starters) -- Existing projects being extended or cloned - -2. If starter templates or existing projects are mentioned: - -- Ask the user to provide access (links, repos, or files) -- Analyze to understand pre-configured choices and constraints -- Note any architectural decisions already made -- Identify what can be modified vs what must be retained - -3. If no starter is mentioned but this is greenfield: - -- Suggest appropriate fullstack starters based on tech preferences -- Consider platform-specific options (Vercel, AWS, etc.) -- Let user decide whether to use one - -4. Document the decision and any constraints it imposes - -If none, state "N/A - Greenfield project" - -### Change Log - -[[LLM: Track document versions and changes]] - -| Date | Version | Description | Author | -| :--- | :------ | :---------- | :----- | - -## High Level Architecture - -[[LLM: This section contains multiple subsections that establish the foundation. Present all subsections together, then apply `tasks#advanced-elicitation` protocol to the complete section.]] - -### Technical Summary - -[[LLM: Provide a comprehensive overview (4-6 sentences) covering: - -- Overall architectural style and deployment approach -- Frontend framework and backend technology choices -- Key integration points between frontend and backend -- Infrastructure platform and services -- How this architecture achieves PRD goals]] - -### Platform and Infrastructure Choice - -[[LLM: Based on PRD requirements and technical assumptions, make a platform recommendation: - -1. Consider common patterns (not an exhaustive list, use your own best judgement and search the web as needed for emerging trends): - - - **Vercel + Supabase**: For rapid development with Next.js, built-in auth/storage - - **AWS Full Stack**: For enterprise scale with Lambda, API Gateway, S3, Cognito - - **Azure**: For .NET ecosystems or enterprise Microsoft environments - - **Google Cloud**: For ML/AI heavy applications or Google ecosystem integration - -2. Present 2-3 viable options with clear pros/cons -3. Make a recommendation with rationale -4. Get explicit user confirmation - -Document the choice and key services that will be used.]] - -**Platform:** {{selected_platform}} -**Key Services:** {{core_services_list}} -**Deployment Host and Regions:** {{regions}} - -### Repository Structure - -[[LLM: Define the repository approach based on PRD requirements and platform choice, explain your rationale or ask quetsions to the user if unsure: - -1. For modern fullstack apps, monorepo is often preferred -2. Consider tooling (Nx, Turborepo, Lerna, npm workspaces) -3. Define package/app boundaries -4. Plan for shared code between frontend and backend]] - -**Structure:** {{repo_structure_choice}} -**Monorepo Tool:** {{monorepo_tool_if_applicable}} -**Package Organization:** {{package_strategy}} - -### High Level Architecture Diagram - -[[LLM: Create a Mermaid diagram showing the complete system architecture including: - -- User entry points (web, mobile) -- Frontend application deployment -- API layer (REST/GraphQL) -- Backend services -- Databases and storage -- External integrations -- CDN and caching layers - -Use appropriate diagram type for clarity.]] - -```mermaid -{{architecture_diagram}} -``` - -### Architectural Patterns - -[[LLM: List patterns that will guide both frontend and backend development. Include patterns for: - -- Overall architecture (e.g., Jamstack, Serverless, Microservices) -- Frontend patterns (e.g., Component-based, State management) -- Backend patterns (e.g., Repository, CQRS, Event-driven) -- Integration patterns (e.g., BFF, API Gateway) - -For each pattern, provide recommendation and rationale.]] - -<> - -- **{{pattern_name}}:** {{pattern_description}} - _Rationale:_ {{rationale}} - <> - -@{example: patterns} - -- **Jamstack Architecture:** Static site generation with serverless APIs - _Rationale:_ Optimal performance and scalability for content-heavy applications -- **Component-Based UI:** Reusable React components with TypeScript - _Rationale:_ Maintainability and type safety across large codebases -- **Repository Pattern:** Abstract data access logic - _Rationale:_ Enables testing and future database migration flexibility -- **API Gateway Pattern:** Single entry point for all API calls - _Rationale:_ Centralized auth, rate limiting, and monitoring - @{/example} - -## Tech Stack - -[[LLM: This is the DEFINITIVE technology selection for the entire project. Work with user to finalize all choices. This table is the single source of truth - all development must use these exact versions. - -Key areas to cover: - -- Frontend and backend languages/frameworks -- Databases and caching -- Authentication and authorization -- API approach -- Testing tools for both frontend and backend -- Build and deployment tools -- Monitoring and logging - -Upon render, apply `tasks#advanced-elicitation` display immediately.]] - -### Technology Stack Table - -| Category | Technology | Version | Purpose | Rationale | -| :----------------------- | :---------------- | :---------- | :---------- | :------------- | -| **Frontend Language** | {{fe_language}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **Frontend Framework** | {{fe_framework}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **UI Component Library** | {{ui_library}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **State Management** | {{state_mgmt}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **Backend Language** | {{be_language}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **Backend Framework** | {{be_framework}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **API Style** | {{api_style}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **Database** | {{database}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **Cache** | {{cache}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **File Storage** | {{storage}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **Authentication** | {{auth}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **Frontend Testing** | {{fe_test}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **Backend Testing** | {{be_test}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **E2E Testing** | {{e2e_test}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **Build Tool** | {{build_tool}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **Bundler** | {{bundler}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **IaC Tool** | {{iac_tool}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **CI/CD** | {{cicd}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **Monitoring** | {{monitoring}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **Logging** | {{logging}} | {{version}} | {{purpose}} | {{why_chosen}} | -| **CSS Framework** | {{css_framework}} | {{version}} | {{purpose}} | {{why_chosen}} | - -@{example: tech_stack_rows} -| **Frontend Language** | TypeScript | 5.3.3 | Type-safe frontend development | Strong typing, excellent tooling | -| **Frontend Framework** | Next.js | 14.1.0 | React framework with SSR/SSG | SEO, performance, Vercel integration | -| **Backend Language** | TypeScript | 5.3.3 | Type-safe backend development | Code sharing with frontend | -| **API Style** | REST + tRPC | - | Type-safe API communication | End-to-end type safety | -| **Database** | PostgreSQL | 16.1 | Primary data store | ACID compliance, JSON support | -| **Authentication** | Supabase Auth | 2.39.0 | User authentication | Built-in auth flows, social providers | -@{/example} - -## Data Models - -[[LLM: Define the core data models/entities that will be shared between frontend and backend: - -1. Review PRD requirements and identify key business entities -2. For each model, explain its purpose and relationships -3. Include key attributes and data types -4. Show relationships between models -5. Create TypeScript interfaces that can be shared -6. Discuss design decisions with user - -Create a clear conceptual model before moving to database schema. - -After presenting all data models, apply `tasks#advanced-elicitation` protocol]] - -<> - -### {{model_name}} - -**Purpose:** {{model_purpose}} - -**Key Attributes:** - -- {{attribute_1}}: {{type_1}} - {{description_1}} -- {{attribute_2}}: {{type_2}} - {{description_2}} - -**TypeScript Interface:** - -```typescript -{ - { - model_interface; - } -} -``` - -**Relationships:** - -- {{relationship_1}} -- {{relationship_2}} - <> - -@{example: data_model} - -### User - -**Purpose:** Represents authenticated users in the system - -**Key Attributes:** - -- id: string - Unique identifier -- email: string - User's email address -- name: string - Display name -- role: enum - User permission level -- timestamps: Date - Created and updated times - -**TypeScript Interface:** - -```typescript -interface User { - id: string; - email: string; - name: string; - role: "admin" | "user" | "guest"; - createdAt: Date; - updatedAt: Date; - profile?: UserProfile; -} - -interface UserProfile { - avatarUrl?: string; - bio?: string; - preferences: Record; -} -``` - -**Relationships:** - -- Has many Posts (1:n) -- Has one Profile (1:1) - @{/example} - -## REST API Spec - -[[LLM: Based on the chosen API style from Tech Stack: - -1. If REST API, create an OpenAPI 3.0 specification -2. If GraphQL, provide the GraphQL schema -3. If tRPC, show router definitions -4. Include all endpoints from epics/stories -5. Define request/response schemas based on data models -6. Document authentication requirements -7. Include example requests/responses - -Use appropriate format for the chosen API style. If no API (e.g., static site), skip this section.]] - -^^CONDITION: has_rest_api^^ - -```yaml -openapi: 3.0.0 -info: - title: - '[object Object]': null - version: - '[object Object]': null - description: - '[object Object]': null -servers: - - url: - '[object Object]': null - description: - '[object Object]': null -``` - -^^/CONDITION: has_rest_api^^ - -^^CONDITION: has_graphql_api^^ - -```graphql -# GraphQL Schema -{{graphql_schema}} -``` - -^^/CONDITION: has_graphql_api^^ - -^^CONDITION: has_trpc_api^^ - -```typescript -// tRPC Router Definitions -{ - { - trpc_routers; - } -} -``` - -^^/CONDITION: has_trpc_api^^ - -[[LLM: After presenting the API spec (or noting its absence if not applicable), apply `tasks#advanced-elicitation` protocol]] - -## Components - -[[LLM: Based on the architectural patterns, tech stack, and data models from above: - -1. Identify major logical components/services across the fullstack -2. Consider both frontend and backend components -3. Define clear boundaries and interfaces between components -4. For each component, specify: - -- Primary responsibility -- Key interfaces/APIs exposed -- Dependencies on other components -- Technology specifics based on tech stack choices - -5. Create component diagrams where helpful -6. After presenting all components, apply `tasks#advanced-elicitation` protocol]] - -<> - -### {{component_name}} - -**Responsibility:** {{component_description}} - -**Key Interfaces:** - -- {{interface_1}} -- {{interface_2}} - -**Dependencies:** {{dependencies}} - -**Technology Stack:** {{component_tech_details}} -<> - -### Component Diagrams - -[[LLM: Create Mermaid diagrams to visualize component relationships. Options: - -- C4 Container diagram for high-level view -- Component diagram for detailed internal structure -- Sequence diagrams for complex interactions - Choose the most appropriate for clarity - -After presenting the diagrams, apply `tasks#advanced-elicitation` protocol]] - -## External APIs - -[[LLM: For each external service integration: - -1. Identify APIs needed based on PRD requirements and component design -2. If documentation URLs are unknown, ask user for specifics -3. Document authentication methods and security considerations -4. List specific endpoints that will be used -5. Note any rate limits or usage constraints - -If no external APIs are needed, state this explicitly and skip to next section.]] - -^^CONDITION: has_external_apis^^ - -<> - -### {{api_name}} API - -- **Purpose:** {{api_purpose}} -- **Documentation:** {{api_docs_url}} -- **Base URL(s):** {{api_base_url}} -- **Authentication:** {{auth_method}} -- **Rate Limits:** {{rate_limits}} - -**Key Endpoints Used:** -<> - -- `{{method}} {{endpoint_path}}` - {{endpoint_purpose}} - <> - -**Integration Notes:** {{integration_considerations}} -<> - -@{example: external_api} - -### Stripe API - -- **Purpose:** Payment processing and subscription management -- **Documentation:** https://stripe.com/docs/api -- **Base URL(s):** `https://api.stripe.com/v1` -- **Authentication:** Bearer token with secret key -- **Rate Limits:** 100 requests per second - -**Key Endpoints Used:** - -- `POST /customers` - Create customer profiles -- `POST /payment_intents` - Process payments -- `POST /subscriptions` - Manage subscriptions - @{/example} - -^^/CONDITION: has_external_apis^^ - -[[LLM: After presenting external APIs (or noting their absence), apply `tasks#advanced-elicitation` protocol]] - -## Core Workflows - -[[LLM: Illustrate key system workflows using sequence diagrams: - -1. Identify critical user journeys from PRD -2. Show component interactions including external APIs -3. Include both frontend and backend flows -4. Include error handling paths -5. Document async operations -6. Create both high-level and detailed diagrams as needed - -Focus on workflows that clarify architecture decisions or complex interactions. - -After presenting the workflow diagrams, apply `tasks#advanced-elicitation` protocol]] - -## Database Schema - -[[LLM: Transform the conceptual data models into concrete database schemas: - -1. Use the database type(s) selected in Tech Stack -2. Create schema definitions using appropriate notation -3. Include indexes, constraints, and relationships -4. Consider performance and scalability -5. For NoSQL, show document structures - -Present schema in format appropriate to database type (SQL DDL, JSON schema, etc.) - -After presenting the database schema, apply `tasks#advanced-elicitation` protocol]] - -## Frontend Architecture - -[[LLM: Define frontend-specific architecture details. After each subsection, note if user wants to refine before continuing. - -After presenting this section, apply `tasks#advanced-elicitation` protocol]] - -### Component Architecture - -[[LLM: Define component organization and patterns based on chosen framework.]] - -**Component Organization:** - -```text -{{component_structure}} -``` - -**Component Template:** - -```typescript -{ - { - component_template; - } -} -``` - -### State Management Architecture - -[[LLM: Detail state management approach based on chosen solution.]] - -**State Structure:** - -```typescript -{ - { - state_structure; - } -} -``` - -**State Management Patterns:** - -- {{pattern_1}} -- {{pattern_2}} - -### Routing Architecture - -[[LLM: Define routing structure based on framework choice.]] - -**Route Organization:** - -```text -{{route_structure}} -``` - -**Protected Route Pattern:** - -```typescript -{ - { - protected_route_example; - } -} -``` - -### Frontend Services Layer - -[[LLM: Define how frontend communicates with backend.]] - -**API Client Setup:** - -```typescript -{ - { - api_client_setup; - } -} -``` - -**Service Example:** - -```typescript -{ - { - service_example; - } -} -``` - -## Backend Architecture - -[[LLM: Define backend-specific architecture details. Consider serverless vs traditional server approaches. - -After presenting this section, apply `tasks#advanced-elicitation` protocol]] - -### Service Architecture - -[[LLM: Based on platform choice, define service organization.]] - -^^CONDITION: serverless^^ -**Function Organization:** - -```text - -{{function_structure}} - -``` - -**Function Template:** - -```typescript -{ - { - function_template; - } -} -``` - -^^/CONDITION: serverless^^ - -^^CONDITION: traditional_server^^ -**Controller/Route Organization:** - -```text -{{controller_structure}} -``` - -**Controller Template:** - -```typescript -{ - { - controller_template; - } -} -``` - -^^/CONDITION: traditional_server^^ - -### Database Architecture - -[[LLM: Define database schema and access patterns.]] - -**Schema Design:** - -```sql -{{database_schema}} -``` - -**Data Access Layer:** - -```typescript -{ - { - repository_pattern; - } -} -``` - -### Authentication and Authorization - -[[LLM: Define auth implementation details.]] - -**Auth Flow:** - -```mermaid -{{auth_flow_diagram}} -``` - -**Middleware/Guards:** - -```typescript -{ - { - auth_middleware; - } -} -``` - -## Unified Project Structure - -[[LLM: Create a monorepo structure that accommodates both frontend and backend. Adapt based on chosen tools and frameworks. After presenting, apply `tasks#advanced-elicitation` protocol.]] - -```plaintext -{{project-name}}/ -├── .github/ # CI/CD workflows -│ └── workflows/ -│ ├── ci.yaml -│ └── deploy.yaml -├── apps/ # Application packages -│ ├── web/ # Frontend application -│ │ ├── src/ -│ │ │ ├── components/ # UI components -│ │ │ ├── pages/ # Page components/routes -│ │ │ ├── hooks/ # Custom React hooks -│ │ │ ├── services/ # API client services -│ │ │ ├── stores/ # State management -│ │ │ ├── styles/ # Global styles/themes -│ │ │ └── utils/ # Frontend utilities -│ │ ├── public/ # Static assets -│ │ ├── tests/ # Frontend tests -│ │ └── package.json -│ └── api/ # Backend application -│ ├── src/ -│ │ ├── routes/ # API routes/controllers -│ │ ├── services/ # Business logic -│ │ ├── models/ # Data models -│ │ ├── middleware/ # Express/API middleware -│ │ ├── utils/ # Backend utilities -│ │ └── {{serverless_or_server_entry}} -│ ├── tests/ # Backend tests -│ └── package.json -├── packages/ # Shared packages -│ ├── shared/ # Shared types/utilities -│ │ ├── src/ -│ │ │ ├── types/ # TypeScript interfaces -│ │ │ ├── constants/ # Shared constants -│ │ │ └── utils/ # Shared utilities -│ │ └── package.json -│ ├── ui/ # Shared UI components -│ │ ├── src/ -│ │ └── package.json -│ └── config/ # Shared configuration -│ ├── eslint/ -│ ├── typescript/ -│ └── jest/ -├── infrastructure/ # IaC definitions -│ └── {{iac_structure}} -├── scripts/ # Build/deploy scripts -├── docs/ # Documentation -│ ├── prd.md -│ ├── front-end-spec.md -│ └── fullstack-architecture.md -├── .env.example # Environment template -├── package.json # Root package.json -├── {{monorepo_config}} # Monorepo configuration -└── README.md -``` - -@{example: vercel_structure} -apps/ -├── web/ # Next.js app -│ ├── app/ # App directory (Next.js 14+) -│ ├── components/ -│ └── lib/ -└── api/ # API routes in Next.js or separate -└── pages/api/ # API routes -@{/example} - -## Development Workflow - -[[LLM: Define the development setup and workflow for the fullstack application. - -After presenting this section, apply `tasks#advanced-elicitation` protocol]] - -### Local Development Setup - -**Prerequisites:** - -```bash -{{prerequisites_commands}} -``` - -**Initial Setup:** - -```bash -{{setup_commands}} -``` - -**Development Commands:** - -```bash -# Start all services -{{start_all_command}} - -# Start frontend only -{{start_frontend_command}} - -# Start backend only -{{start_backend_command}} - -# Run tests -{{test_commands}} -``` - -### Environment Configuration - -**Required Environment Variables:** - -```bash -# Frontend (.env.local) -{{frontend_env_vars}} - -# Backend (.env) -{{backend_env_vars}} - -# Shared -{{shared_env_vars}} -``` - -## Deployment Architecture - -[[LLM: Define deployment strategy based on platform choice. After presenting, apply `tasks#advanced-elicitation` protocol.]] - -### Deployment Strategy - -**Frontend Deployment:** - -- **Platform:** {{frontend_deploy_platform}} -- **Build Command:** {{frontend_build_command}} -- **Output Directory:** {{frontend_output_dir}} -- **CDN/Edge:** {{cdn_strategy}} - -**Backend Deployment:** - -- **Platform:** {{backend_deploy_platform}} -- **Build Command:** {{backend_build_command}} -- **Deployment Method:** {{deployment_method}} - -### CI/CD Pipeline - -```yaml -'[object Object]': null -``` - -### Environments - -| Environment | Frontend URL | Backend URL | Purpose | -| :---------- | :----------------- | :----------------- | :--------------------- | -| Development | {{dev_fe_url}} | {{dev_be_url}} | Local development | -| Staging | {{staging_fe_url}} | {{staging_be_url}} | Pre-production testing | -| Production | {{prod_fe_url}} | {{prod_be_url}} | Live environment | - -## Security and Performance - -[[LLM: Define security and performance considerations for the fullstack application. - -After presenting this section, apply `tasks#advanced-elicitation` protocol]] - -### Security Requirements - -**Frontend Security:** - -- CSP Headers: {{csp_policy}} -- XSS Prevention: {{xss_strategy}} -- Secure Storage: {{storage_strategy}} - -**Backend Security:** - -- Input Validation: {{validation_approach}} -- Rate Limiting: {{rate_limit_config}} -- CORS Policy: {{cors_config}} - -**Authentication Security:** - -- Token Storage: {{token_strategy}} -- Session Management: {{session_approach}} -- Password Policy: {{password_requirements}} - -### Performance Optimization - -**Frontend Performance:** - -- Bundle Size Target: {{bundle_size}} -- Loading Strategy: {{loading_approach}} -- Caching Strategy: {{fe_cache_strategy}} - -**Backend Performance:** - -- Response Time Target: {{response_target}} -- Database Optimization: {{db_optimization}} -- Caching Strategy: {{be_cache_strategy}} - -## Testing Strategy - -[[LLM: Define comprehensive testing approach for fullstack application. - -After presenting this section, apply `tasks#advanced-elicitation` protocol]] - -### Testing Pyramid - -```text - - E2E Tests - / \ - Integration Tests - -/ \ - Frontend Unit Backend Unit - -``` - -### Test Organization - -**Frontend Tests:** - -```text - -{{frontend_test_structure}} - -``` - -**Backend Tests:** - -```text - -{{backend_test_structure}} - -``` - -**E2E Tests:** - -```text - -{{e2e_test_structure}} - -``` - -### Test Examples - -**Frontend Component Test:** - -```typescript -{ - { - frontend_test_example; - } -} -``` - -**Backend API Test:** - -```typescript -{ - { - backend_test_example; - } -} -``` - -**E2E Test:** - -```typescript -{ - { - e2e_test_example; - } -} -``` - -## Coding Standards - -[[LLM: Define MINIMAL but CRITICAL standards for AI agents. Focus only on project-specific rules that prevent common mistakes. These will be used by dev agents. - -After presenting this section, apply `tasks#advanced-elicitation` protocol]] - -### Critical Fullstack Rules - -<> - -- **{{rule_name}}:** {{rule_description}} - <> - -@{example: critical_rules} - -- **Type Sharing:** Always define types in packages/shared and import from there -- **API Calls:** Never make direct HTTP calls - use the service layer -- **Environment Variables:** Access only through config objects, never process.env directly -- **Error Handling:** All API routes must use the standard error handler -- **State Updates:** Never mutate state directly - use proper state management patterns - @{/example} - -### Naming Conventions - -| Element | Frontend | Backend | Example | -| :-------------- | :------------------- | :--------- | :------------------ | -| Components | PascalCase | - | `UserProfile.tsx` | -| Hooks | camelCase with 'use' | - | `useAuth.ts` | -| API Routes | - | kebab-case | `/api/user-profile` | -| Database Tables | - | snake_case | `user_profiles` | - -## Error Handling Strategy - -[[LLM: Define unified error handling across frontend and backend. - -After presenting this section, apply `tasks#advanced-elicitation` protocol]] - -### Error Flow - -```mermaid -{{error_flow_diagram}} -``` - -### Error Response Format - -```typescript -interface ApiError { - error: { - code: string; - message: string; - details?: Record; - timestamp: string; - requestId: string; - }; -} -``` - -### Frontend Error Handling - -```typescript -{ - { - frontend_error_handler; - } -} -``` - -### Backend Error Handling - -```typescript -{ - { - backend_error_handler; - } -} -``` - -## Monitoring and Observability - -[[LLM: Define monitoring strategy for fullstack application. - -After presenting this section, apply `tasks#advanced-elicitation` protocol]] - -### Monitoring Stack - -- **Frontend Monitoring:** {{frontend_monitoring}} -- **Backend Monitoring:** {{backend_monitoring}} -- **Error Tracking:** {{error_tracking}} -- **Performance Monitoring:** {{perf_monitoring}} - -### Key Metrics - -**Frontend Metrics:** - -- Core Web Vitals -- JavaScript errors -- API response times -- User interactions - -**Backend Metrics:** - -- Request rate -- Error rate -- Response time -- Database query performance - -## Checklist Results Report - -[[LLM: Before running the checklist, offer to output the full architecture document. Once user confirms, execute the `architect-checklist` and populate results here.]] -==================== END: .bmad-core/templates/fullstack-architecture-tmpl.md ==================== - -==================== START: .bmad-core/templates/brownfield-architecture-tmpl.md ==================== -# {{Project Name}} Brownfield Enhancement Architecture - -[[LLM: The default path and filename unless specified is docs/architecture.md]] - -[[LLM: IMPORTANT - SCOPE AND ASSESSMENT REQUIRED: - -This architecture document is for SIGNIFICANT enhancements to existing projects that require comprehensive architectural planning. Before proceeding: - -1. **Verify Complexity**: Confirm this enhancement requires architectural planning. For simple additions, recommend: "For simpler changes that don't require architectural planning, consider using the brownfield-create-epic or brownfield-create-story task with the Product Owner instead." - -2. **REQUIRED INPUTS**: - - - Completed brownfield-prd.md - - Existing project technical documentation (from docs folder or user-provided) - - Access to existing project structure (IDE or uploaded files) - -3. **DEEP ANALYSIS MANDATE**: You MUST conduct thorough analysis of the existing codebase, architecture patterns, and technical constraints before making ANY architectural recommendations. Every suggestion must be based on actual project analysis, not assumptions. - -4. **CONTINUOUS VALIDATION**: Throughout this process, explicitly validate your understanding with the user. For every architectural decision, confirm: "Based on my analysis of your existing system, I recommend [decision] because [evidence from actual project]. Does this align with your system's reality?" - -If any required inputs are missing, request them before proceeding.]] - -## Introduction - -[[LLM: This section establishes the document's purpose and scope for brownfield enhancements. Keep the content below but ensure project name and enhancement details are properly substituted. - -After presenting this section, apply `tasks#advanced-elicitation` protocol]] - -This document outlines the architectural approach for enhancing {{Project Name}} with {{Enhancement Description}}. Its primary goal is to serve as the guiding architectural blueprint for AI-driven development of new features while ensuring seamless integration with the existing system. - -**Relationship to Existing Architecture:** -This document supplements existing project architecture by defining how new components will integrate with current systems. Where conflicts arise between new and existing patterns, this document provides guidance on maintaining consistency while implementing enhancements. - -### Existing Project Analysis - -[[LLM: Analyze the existing project structure and architecture: - -1. Review existing documentation in docs folder -2. Examine current technology stack and versions -3. Identify existing architectural patterns and conventions -4. Note current deployment and infrastructure setup -5. Document any constraints or limitations - -CRITICAL: After your analysis, explicitly validate your findings: "Based on my analysis of your project, I've identified the following about your existing system: [key findings]. Please confirm these observations are accurate before I proceed with architectural recommendations." - -Present findings and apply `tasks#advanced-elicitation` protocol]] - -**Current Project State:** - -- **Primary Purpose:** {{existing_project_purpose}} -- **Current Tech Stack:** {{existing_tech_summary}} -- **Architecture Style:** {{existing_architecture_style}} -- **Deployment Method:** {{existing_deployment_approach}} - -**Available Documentation:** - -- {{existing_docs_summary}} - -**Identified Constraints:** - -- {{constraint_1}} -- {{constraint_2}} -- {{constraint_3}} - -### Change Log - -| Change | Date | Version | Description | Author | -| ------ | ---- | ------- | ----------- | ------ | - -## Enhancement Scope and Integration Strategy - -[[LLM: Define how the enhancement will integrate with the existing system: - -1. Review the brownfield PRD enhancement scope -2. Identify integration points with existing code -3. Define boundaries between new and existing functionality -4. Establish compatibility requirements - -VALIDATION CHECKPOINT: Before presenting the integration strategy, confirm: "Based on my analysis, the integration approach I'm proposing takes into account [specific existing system characteristics]. These integration points and boundaries respect your current architecture patterns. Is this assessment accurate?" - -Present complete integration strategy and apply `tasks#advanced-elicitation` protocol]] - -### Enhancement Overview - -**Enhancement Type:** {{enhancement_type}} -**Scope:** {{enhancement_scope}} -**Integration Impact:** {{integration_impact_level}} - -### Integration Approach - -**Code Integration Strategy:** {{code_integration_approach}} -**Database Integration:** {{database_integration_approach}} -**API Integration:** {{api_integration_approach}} -**UI Integration:** {{ui_integration_approach}} - -### Compatibility Requirements - -- **Existing API Compatibility:** {{api_compatibility}} -- **Database Schema Compatibility:** {{db_compatibility}} -- **UI/UX Consistency:** {{ui_compatibility}} -- **Performance Impact:** {{performance_constraints}} - -## Tech Stack Alignment - -[[LLM: Ensure new components align with existing technology choices: - -1. Use existing technology stack as the foundation -2. Only introduce new technologies if absolutely necessary -3. Justify any new additions with clear rationale -4. Ensure version compatibility with existing dependencies - -Present complete tech stack alignment and apply `tasks#advanced-elicitation` protocol]] - -### Existing Technology Stack - -[[LLM: Document the current stack that must be maintained or integrated with]] - -| Category | Current Technology | Version | Usage in Enhancement | Notes | -| :----------------- | :----------------- | :---------- | :------------------- | :-------- | -| **Language** | {{language}} | {{version}} | {{usage}} | {{notes}} | -| **Runtime** | {{runtime}} | {{version}} | {{usage}} | {{notes}} | -| **Framework** | {{framework}} | {{version}} | {{usage}} | {{notes}} | -| **Database** | {{database}} | {{version}} | {{usage}} | {{notes}} | -| **API Style** | {{api_style}} | {{version}} | {{usage}} | {{notes}} | -| **Authentication** | {{auth}} | {{version}} | {{usage}} | {{notes}} | -| **Testing** | {{test_framework}} | {{version}} | {{usage}} | {{notes}} | -| **Build Tool** | {{build_tool}} | {{version}} | {{usage}} | {{notes}} | - -### New Technology Additions - -[[LLM: Only include if new technologies are required for the enhancement]] - -^^CONDITION: has_new_tech^^ - -| Technology | Version | Purpose | Rationale | Integration Method | -| :----------- | :---------- | :---------- | :------------ | :----------------- | -| {{new_tech}} | {{version}} | {{purpose}} | {{rationale}} | {{integration}} | - -^^/CONDITION: has_new_tech^^ - -## Data Models and Schema Changes - -[[LLM: Define new data models and how they integrate with existing schema: - -1. Identify new entities required for the enhancement -2. Define relationships with existing data models -3. Plan database schema changes (additions, modifications) -4. Ensure backward compatibility - -Present data model changes and apply `tasks#advanced-elicitation` protocol]] - -### New Data Models - -<> - -### {{model_name}} - -**Purpose:** {{model_purpose}} -**Integration:** {{integration_with_existing}} - -**Key Attributes:** - -- {{attribute_1}}: {{type_1}} - {{description_1}} -- {{attribute_2}}: {{type_2}} - {{description_2}} - -**Relationships:** - -- **With Existing:** {{existing_relationships}} -- **With New:** {{new_relationships}} - -<> - -### Schema Integration Strategy - -**Database Changes Required:** - -- **New Tables:** {{new_tables_list}} -- **Modified Tables:** {{modified_tables_list}} -- **New Indexes:** {{new_indexes_list}} -- **Migration Strategy:** {{migration_approach}} - -**Backward Compatibility:** - -- {{compatibility_measure_1}} -- {{compatibility_measure_2}} - -## Component Architecture - -[[LLM: Define new components and their integration with existing architecture: - -1. Identify new components required for the enhancement -2. Define interfaces with existing components -3. Establish clear boundaries and responsibilities -4. Plan integration points and data flow - -MANDATORY VALIDATION: Before presenting component architecture, confirm: "The new components I'm proposing follow the existing architectural patterns I identified in your codebase: [specific patterns]. The integration interfaces respect your current component structure and communication patterns. Does this match your project's reality?" - -Present component architecture and apply `tasks#advanced-elicitation` protocol]] - -### New Components - -<> - -### {{component_name}} - -**Responsibility:** {{component_description}} -**Integration Points:** {{integration_points}} - -**Key Interfaces:** - -- {{interface_1}} -- {{interface_2}} - -**Dependencies:** - -- **Existing Components:** {{existing_dependencies}} -- **New Components:** {{new_dependencies}} - -**Technology Stack:** {{component_tech_details}} - -<> - -### Component Interaction Diagram - -[[LLM: Create Mermaid diagram showing how new components interact with existing ones]] - -```mermaid -{{component_interaction_diagram}} -``` - -## API Design and Integration - -[[LLM: Define new API endpoints and integration with existing APIs: - -1. Plan new API endpoints required for the enhancement -2. Ensure consistency with existing API patterns -3. Define authentication and authorization integration -4. Plan versioning strategy if needed - -Present API design and apply `tasks#advanced-elicitation` protocol]] - -### New API Endpoints - -^^CONDITION: has_new_api^^ - -**API Integration Strategy:** {{api_integration_strategy}} -**Authentication:** {{auth_integration}} -**Versioning:** {{versioning_approach}} - -<> - -#### {{endpoint_name}} - -- **Method:** {{http_method}} -- **Endpoint:** {{endpoint_path}} -- **Purpose:** {{endpoint_purpose}} -- **Integration:** {{integration_with_existing}} - -**Request:** - -```json -{{request_schema}} -``` - -**Response:** - -```json -{{response_schema}} -``` - -<> - -^^/CONDITION: has_new_api^^ - -## External API Integration - -[[LLM: Document new external API integrations required for the enhancement]] - -^^CONDITION: has_new_external_apis^^ - -<> - -### {{api_name}} API - -- **Purpose:** {{api_purpose}} -- **Documentation:** {{api_docs_url}} -- **Base URL:** {{api_base_url}} -- **Authentication:** {{auth_method}} -- **Integration Method:** {{integration_approach}} - -**Key Endpoints Used:** - -- `{{method}} {{endpoint_path}}` - {{endpoint_purpose}} - -**Error Handling:** {{error_handling_strategy}} - -<> - -^^/CONDITION: has_new_external_apis^^ - -## Source Tree Integration - -[[LLM: Define how new code will integrate with existing project structure: - -1. Follow existing project organization patterns -2. Identify where new files/folders will be placed -3. Ensure consistency with existing naming conventions -4. Plan for minimal disruption to existing structure - -Present integration plan and apply `tasks#advanced-elicitation` protocol]] - -### Existing Project Structure - -[[LLM: Document relevant parts of current structure]] - -```plaintext -{{existing_structure_relevant_parts}} -``` - -### New File Organization - -[[LLM: Show only new additions to existing structure]] - -```plaintext -{{project-root}}/ -├── {{existing_structure_context}} -│ ├── {{new_folder_1}}/ # {{purpose_1}} -│ │ ├── {{new_file_1}} -│ │ └── {{new_file_2}} -│ ├── {{existing_folder}}/ # Existing folder with additions -│ │ ├── {{existing_file}} # Existing file -│ │ └── {{new_file_3}} # New addition -│ └── {{new_folder_2}}/ # {{purpose_2}} -``` - -### Integration Guidelines - -- **File Naming:** {{file_naming_consistency}} -- **Folder Organization:** {{folder_organization_approach}} -- **Import/Export Patterns:** {{import_export_consistency}} - -## Infrastructure and Deployment Integration - -[[LLM: Define how the enhancement will be deployed alongside existing infrastructure: - -1. Use existing deployment pipeline and infrastructure -2. Identify any infrastructure changes needed -3. Plan deployment strategy to minimize risk -4. Define rollback procedures - -Present deployment integration and apply `tasks#advanced-elicitation` protocol]] - -### Existing Infrastructure - -**Current Deployment:** {{existing_deployment_summary}} -**Infrastructure Tools:** {{existing_infrastructure_tools}} -**Environments:** {{existing_environments}} - -### Enhancement Deployment Strategy - -**Deployment Approach:** {{deployment_approach}} -**Infrastructure Changes:** {{infrastructure_changes}} -**Pipeline Integration:** {{pipeline_integration}} - -### Rollback Strategy - -**Rollback Method:** {{rollback_method}} -**Risk Mitigation:** {{risk_mitigation}} -**Monitoring:** {{monitoring_approach}} - -## Coding Standards and Conventions - -[[LLM: Ensure new code follows existing project conventions: - -1. Document existing coding standards from project analysis -2. Identify any enhancement-specific requirements -3. Ensure consistency with existing codebase patterns -4. Define standards for new code organization - -Present coding standards and apply `tasks#advanced-elicitation` protocol]] - -### Existing Standards Compliance - -**Code Style:** {{existing_code_style}} -**Linting Rules:** {{existing_linting}} -**Testing Patterns:** {{existing_test_patterns}} -**Documentation Style:** {{existing_doc_style}} - -### Enhancement-Specific Standards - -[[LLM: Only include if new patterns are needed for the enhancement]] - -<> - -- **{{standard_name}}:** {{standard_description}} - -<> - -### Critical Integration Rules - -- **Existing API Compatibility:** {{api_compatibility_rule}} -- **Database Integration:** {{db_integration_rule}} -- **Error Handling:** {{error_handling_integration}} -- **Logging Consistency:** {{logging_consistency}} - -## Testing Strategy - -[[LLM: Define testing approach for the enhancement: - -1. Integrate with existing test suite -2. Ensure existing functionality remains intact -3. Plan for testing new features -4. Define integration testing approach - -Present testing strategy and apply `tasks#advanced-elicitation` protocol]] - -### Integration with Existing Tests - -**Existing Test Framework:** {{existing_test_framework}} -**Test Organization:** {{existing_test_organization}} -**Coverage Requirements:** {{existing_coverage_requirements}} - -### New Testing Requirements - -#### Unit Tests for New Components - -- **Framework:** {{test_framework}} -- **Location:** {{test_location}} -- **Coverage Target:** {{coverage_target}} -- **Integration with Existing:** {{test_integration}} - -#### Integration Tests - -- **Scope:** {{integration_test_scope}} -- **Existing System Verification:** {{existing_system_verification}} -- **New Feature Testing:** {{new_feature_testing}} - -#### Regression Testing - -- **Existing Feature Verification:** {{regression_test_approach}} -- **Automated Regression Suite:** {{automated_regression}} -- **Manual Testing Requirements:** {{manual_testing_requirements}} - -## Security Integration - -[[LLM: Ensure security consistency with existing system: - -1. Follow existing security patterns and tools -2. Ensure new features don't introduce vulnerabilities -3. Maintain existing security posture -4. Define security testing for new components - -Present security integration and apply `tasks#advanced-elicitation` protocol]] - -### Existing Security Measures - -**Authentication:** {{existing_auth}} -**Authorization:** {{existing_authz}} -**Data Protection:** {{existing_data_protection}} -**Security Tools:** {{existing_security_tools}} - -### Enhancement Security Requirements - -**New Security Measures:** {{new_security_measures}} -**Integration Points:** {{security_integration_points}} -**Compliance Requirements:** {{compliance_requirements}} - -### Security Testing - -**Existing Security Tests:** {{existing_security_tests}} -**New Security Test Requirements:** {{new_security_tests}} -**Penetration Testing:** {{pentest_requirements}} - -## Risk Assessment and Mitigation - -[[LLM: Identify and plan for risks specific to brownfield development: - -1. Technical integration risks -2. Deployment and operational risks -3. User impact and compatibility risks -4. Mitigation strategies for each risk - -Present risk assessment and apply `tasks#advanced-elicitation` protocol]] - -### Technical Risks - -<> - -**Risk:** {{risk_description}} -**Impact:** {{impact_level}} -**Likelihood:** {{likelihood}} -**Mitigation:** {{mitigation_strategy}} - -<> - -### Operational Risks - -<> - -**Risk:** {{risk_description}} -**Impact:** {{impact_level}} -**Likelihood:** {{likelihood}} -**Mitigation:** {{mitigation_strategy}} - -<> - -### Monitoring and Alerting - -**Enhanced Monitoring:** {{monitoring_additions}} -**New Alerts:** {{new_alerts}} -**Performance Monitoring:** {{performance_monitoring}} - -## Checklist Results Report - -[[LLM: Execute the architect-checklist and populate results here, focusing on brownfield-specific validation]] - -## Next Steps - -[[LLM: After completing the brownfield architecture: - -1. Review integration points with existing system -2. Begin story implementation with Dev agent -3. Set up deployment pipeline integration -4. Plan rollback and monitoring procedures]] - -### Story Manager Handoff - -[[LLM: Create a brief prompt for Story Manager to work with this brownfield enhancement. Include: - -- Reference to this architecture document -- Key integration requirements validated with user -- Existing system constraints based on actual project analysis -- First story to implement with clear integration checkpoints -- Emphasis on maintaining existing system integrity throughout implementation]] - -### Developer Handoff - -[[LLM: Create a brief prompt for developers starting implementation. Include: - -- Reference to this architecture and existing coding standards analyzed from actual project -- Integration requirements with existing codebase validated with user -- Key technical decisions based on real project constraints -- Existing system compatibility requirements with specific verification steps -- Clear sequencing of implementation to minimize risk to existing functionality]] -==================== END: .bmad-core/templates/brownfield-architecture-tmpl.md ==================== +==================== START: .bmad-core/templates/architecture-tmpl.yaml ==================== +template: + id: architecture-template-v2 + name: Architecture Document + version: 2.0 + output: + format: markdown + filename: docs/architecture.md + title: "{{project_name}} Architecture Document" + +workflow: + mode: interactive + elicitation: advanced-elicitation + +sections: + - id: introduction + title: Introduction + instruction: | + If available, review any provided relevant documents to gather all relevant context before beginning. If at a minimum you cannot locate docs/prd.md ask the user what docs will provide the basis for the architecture. + sections: + - id: intro-content + content: | + This document outlines the overall project architecture for {{project_name}}, including backend systems, shared services, and non-UI specific concerns. Its primary goal is to serve as the guiding architectural blueprint for AI-driven development, ensuring consistency and adherence to chosen patterns and technologies. + + **Relationship to Frontend Architecture:** + If the project includes a significant user interface, a separate Frontend Architecture Document will detail the frontend-specific design and MUST be used in conjunction with this document. Core technology stack choices documented herein (see "Tech Stack") are definitive for the entire project, including any frontend components. + - id: starter-template + title: Starter Template or Existing Project + instruction: | + Before proceeding further with architecture design, check if the project is based on a starter template or existing codebase: + + 1. Review the PRD and brainstorming brief for any mentions of: + - Starter templates (e.g., Create React App, Next.js, Vue CLI, Angular CLI, etc.) + - Existing projects or codebases being used as a foundation + - Boilerplate projects or scaffolding tools + - Previous projects to be cloned or adapted + + 2. If a starter template or existing project is mentioned: + - Ask the user to provide access via one of these methods: + - Link to the starter template documentation + - Upload/attach the project files (for small projects) + - Share a link to the project repository (GitHub, GitLab, etc.) + - Analyze the starter/existing project to understand: + - Pre-configured technology stack and versions + - Project structure and organization patterns + - Built-in scripts and tooling + - Existing architectural patterns and conventions + - Any limitations or constraints imposed by the starter + - Use this analysis to inform and align your architecture decisions + + 3. If no starter template is mentioned but this is a greenfield project: + - Suggest appropriate starter templates based on the tech stack preferences + - Explain the benefits (faster setup, best practices, community support) + - Let the user decide whether to use one + + 4. If the user confirms no starter template will be used: + - Proceed with architecture design from scratch + - Note that manual setup will be required for all tooling and configuration + + Document the decision here before proceeding with the architecture design. If none, just say N/A + elicit: true + - id: changelog + title: Change Log + type: table + columns: [Date, Version, Description, Author] + instruction: Track document versions and changes + + - id: high-level-architecture + title: High Level Architecture + instruction: | + This section contains multiple subsections that establish the foundation of the architecture. Present all subsections together at once. + elicit: true + sections: + - id: technical-summary + title: Technical Summary + instruction: | + Provide a brief paragraph (3-5 sentences) overview of: + - The system's overall architecture style + - Key components and their relationships + - Primary technology choices + - Core architectural patterns being used + - Reference back to the PRD goals and how this architecture supports them + - id: high-level-overview + title: High Level Overview + instruction: | + Based on the PRD's Technical Assumptions section, describe: + + 1. The main architectural style (e.g., Monolith, Microservices, Serverless, Event-Driven) + 2. Repository structure decision from PRD (Monorepo/Polyrepo) + 3. Service architecture decision from PRD + 4. Primary user interaction flow or data flow at a conceptual level + 5. Key architectural decisions and their rationale + - id: project-diagram + title: High Level Project Diagram + type: mermaid + mermaid_type: graph + instruction: | + Create a Mermaid diagram that visualizes the high-level architecture. Consider: + - System boundaries + - Major components/services + - Data flow directions + - External integrations + - User entry points + + - id: architectural-patterns + title: Architectural and Design Patterns + instruction: | + List the key high-level patterns that will guide the architecture. For each pattern: + + 1. Present 2-3 viable options if multiple exist + 2. Provide your recommendation with clear rationale + 3. Get user confirmation before finalizing + 4. These patterns should align with the PRD's technical assumptions and project goals + + Common patterns to consider: + - Architectural style patterns (Serverless, Event-Driven, Microservices, CQRS, Hexagonal) + - Code organization patterns (Dependency Injection, Repository, Module, Factory) + - Data patterns (Event Sourcing, Saga, Database per Service) + - Communication patterns (REST, GraphQL, Message Queue, Pub/Sub) + template: "- **{{pattern_name}}:** {{pattern_description}} - _Rationale:_ {{rationale}}" + examples: + - "**Serverless Architecture:** Using AWS Lambda for compute - _Rationale:_ Aligns with PRD requirement for cost optimization and automatic scaling" + - "**Repository Pattern:** Abstract data access logic - _Rationale:_ Enables testing and future database migration flexibility" + - "**Event-Driven Communication:** Using SNS/SQS for service decoupling - _Rationale:_ Supports async processing and system resilience" + + - id: tech-stack + title: Tech Stack + instruction: | + This is the DEFINITIVE technology selection section. Work with the user to make specific choices: + + 1. Review PRD technical assumptions and any preferences from .bmad-core/data/technical-preferences.yaml or an attached technical-preferences + 2. For each category, present 2-3 viable options with pros/cons + 3. Make a clear recommendation based on project needs + 4. Get explicit user approval for each selection + 5. Document exact versions (avoid "latest" - pin specific versions) + 6. This table is the single source of truth - all other docs must reference these choices + + Key decisions to finalize - before displaying the table, ensure you are aware of or ask the user about - let the user know if they are not sure on any that you can also provide suggestions with rationale: + + - Starter templates (if any) + - Languages and runtimes with exact versions + - Frameworks and libraries / packages + - Cloud provider and key services choices + - Database and storage solutions - if unclear suggest sql or nosql or other types depending on the project and depending on cloud provider offer a suggestion + - Development tools + + Upon render of the table, ensure the user is aware of the importance of this sections choices, should also look for gaps or disagreements with anything, ask for any clarifications if something is unclear why its in the list, and also right away elicit feedback - this statement and the options should be rendered and then prompt right all before allowing user input. + elicit: true + sections: + - id: cloud-infrastructure + title: Cloud Infrastructure + template: | + - **Provider:** {{cloud_provider}} + - **Key Services:** {{core_services_list}} + - **Deployment Regions:** {{regions}} + - id: technology-stack-table + title: Technology Stack Table + type: table + columns: [Category, Technology, Version, Purpose, Rationale] + instruction: Populate the technology stack table with all relevant technologies + examples: + - "| **Language** | TypeScript | 5.3.3 | Primary development language | Strong typing, excellent tooling, team expertise |" + - "| **Runtime** | Node.js | 20.11.0 | JavaScript runtime | LTS version, stable performance, wide ecosystem |" + - "| **Framework** | NestJS | 10.3.2 | Backend framework | Enterprise-ready, good DI, matches team patterns |" + + - id: data-models + title: Data Models + instruction: | + Define the core data models/entities: + + 1. Review PRD requirements and identify key business entities + 2. For each model, explain its purpose and relationships + 3. Include key attributes and data types + 4. Show relationships between models + 5. Discuss design decisions with user + + Create a clear conceptual model before moving to database schema. + elicit: true + repeatable: true + sections: + - id: model + title: "{{model_name}}" + template: | + **Purpose:** {{model_purpose}} + + **Key Attributes:** + - {{attribute_1}}: {{type_1}} - {{description_1}} + - {{attribute_2}}: {{type_2}} - {{description_2}} + + **Relationships:** + - {{relationship_1}} + - {{relationship_2}} + + - id: components + title: Components + instruction: | + Based on the architectural patterns, tech stack, and data models from above: + + 1. Identify major logical components/services and their responsibilities + 2. Consider the repository structure (monorepo/polyrepo) from PRD + 3. Define clear boundaries and interfaces between components + 4. For each component, specify: + - Primary responsibility + - Key interfaces/APIs exposed + - Dependencies on other components + - Technology specifics based on tech stack choices + + 5. Create component diagrams where helpful + elicit: true + sections: + - id: component-list + repeatable: true + title: "{{component_name}}" + template: | + **Responsibility:** {{component_description}} + + **Key Interfaces:** + - {{interface_1}} + - {{interface_2}} + + **Dependencies:** {{dependencies}} + + **Technology Stack:** {{component_tech_details}} + - id: component-diagrams + title: Component Diagrams + type: mermaid + instruction: | + Create Mermaid diagrams to visualize component relationships. Options: + - C4 Container diagram for high-level view + - Component diagram for detailed internal structure + - Sequence diagrams for complex interactions + Choose the most appropriate for clarity + + - id: external-apis + title: External APIs + condition: Project requires external API integrations + instruction: | + For each external service integration: + + 1. Identify APIs needed based on PRD requirements and component design + 2. If documentation URLs are unknown, ask user for specifics + 3. Document authentication methods and security considerations + 4. List specific endpoints that will be used + 5. Note any rate limits or usage constraints + + If no external APIs are needed, state this explicitly and skip to next section. + elicit: true + repeatable: true + sections: + - id: api + title: "{{api_name}} API" + template: | + - **Purpose:** {{api_purpose}} + - **Documentation:** {{api_docs_url}} + - **Base URL(s):** {{api_base_url}} + - **Authentication:** {{auth_method}} + - **Rate Limits:** {{rate_limits}} + + **Key Endpoints Used:** + - `{{method}} {{endpoint_path}}` - {{endpoint_purpose}} + + **Integration Notes:** {{integration_considerations}} + + - id: core-workflows + title: Core Workflows + type: mermaid + mermaid_type: sequence + instruction: | + Illustrate key system workflows using sequence diagrams: + + 1. Identify critical user journeys from PRD + 2. Show component interactions including external APIs + 3. Include error handling paths + 4. Document async operations + 5. Create both high-level and detailed diagrams as needed + + Focus on workflows that clarify architecture decisions or complex interactions. + elicit: true + + - id: rest-api-spec + title: REST API Spec + condition: Project includes REST API + type: code + language: yaml + instruction: | + If the project includes a REST API: + + 1. Create an OpenAPI 3.0 specification + 2. Include all endpoints from epics/stories + 3. Define request/response schemas based on data models + 4. Document authentication requirements + 5. Include example requests/responses + + Use YAML format for better readability. If no REST API, skip this section. + elicit: true + template: | + openapi: 3.0.0 + info: + title: {{api_title}} + version: {{api_version}} + description: {{api_description}} + servers: + - url: {{server_url}} + description: {{server_description}} + + - id: database-schema + title: Database Schema + instruction: | + Transform the conceptual data models into concrete database schemas: + + 1. Use the database type(s) selected in Tech Stack + 2. Create schema definitions using appropriate notation + 3. Include indexes, constraints, and relationships + 4. Consider performance and scalability + 5. For NoSQL, show document structures + + Present schema in format appropriate to database type (SQL DDL, JSON schema, etc.) + elicit: true + + - id: source-tree + title: Source Tree + type: code + language: plaintext + instruction: | + Create a project folder structure that reflects: + + 1. The chosen repository structure (monorepo/polyrepo) + 2. The service architecture (monolith/microservices/serverless) + 3. The selected tech stack and languages + 4. Component organization from above + 5. Best practices for the chosen frameworks + 6. Clear separation of concerns + + Adapt the structure based on project needs. For monorepos, show service separation. For serverless, show function organization. Include language-specific conventions. + elicit: true + examples: + - | + project-root/ + ├── packages/ + │ ├── api/ # Backend API service + │ ├── web/ # Frontend application + │ ├── shared/ # Shared utilities/types + │ └── infrastructure/ # IaC definitions + ├── scripts/ # Monorepo management scripts + └── package.json # Root package.json with workspaces + + - id: infrastructure-deployment + title: Infrastructure and Deployment + instruction: | + Define the deployment architecture and practices: + + 1. Use IaC tool selected in Tech Stack + 2. Choose deployment strategy appropriate for the architecture + 3. Define environments and promotion flow + 4. Establish rollback procedures + 5. Consider security, monitoring, and cost optimization + + Get user input on deployment preferences and CI/CD tool choices. + elicit: true + sections: + - id: infrastructure-as-code + title: Infrastructure as Code + template: | + - **Tool:** {{iac_tool}} {{version}} + - **Location:** `{{iac_directory}}` + - **Approach:** {{iac_approach}} + - id: deployment-strategy + title: Deployment Strategy + template: | + - **Strategy:** {{deployment_strategy}} + - **CI/CD Platform:** {{cicd_platform}} + - **Pipeline Configuration:** `{{pipeline_config_location}}` + - id: environments + title: Environments + repeatable: true + template: "- **{{env_name}}:** {{env_purpose}} - {{env_details}}" + - id: promotion-flow + title: Environment Promotion Flow + type: code + language: text + template: "{{promotion_flow_diagram}}" + - id: rollback-strategy + title: Rollback Strategy + template: | + - **Primary Method:** {{rollback_method}} + - **Trigger Conditions:** {{rollback_triggers}} + - **Recovery Time Objective:** {{rto}} + + - id: error-handling-strategy + title: Error Handling Strategy + instruction: | + Define comprehensive error handling approach: + + 1. Choose appropriate patterns for the language/framework from Tech Stack + 2. Define logging standards and tools + 3. Establish error categories and handling rules + 4. Consider observability and debugging needs + 5. Ensure security (no sensitive data in logs) + + This section guides both AI and human developers in consistent error handling. + elicit: true + sections: + - id: general-approach + title: General Approach + template: | + - **Error Model:** {{error_model}} + - **Exception Hierarchy:** {{exception_structure}} + - **Error Propagation:** {{propagation_rules}} + - id: logging-standards + title: Logging Standards + template: | + - **Library:** {{logging_library}} {{version}} + - **Format:** {{log_format}} + - **Levels:** {{log_levels_definition}} + - **Required Context:** + - Correlation ID: {{correlation_id_format}} + - Service Context: {{service_context}} + - User Context: {{user_context_rules}} + - id: error-patterns + title: Error Handling Patterns + sections: + - id: external-api-errors + title: External API Errors + template: | + - **Retry Policy:** {{retry_strategy}} + - **Circuit Breaker:** {{circuit_breaker_config}} + - **Timeout Configuration:** {{timeout_settings}} + - **Error Translation:** {{error_mapping_rules}} + - id: business-logic-errors + title: Business Logic Errors + template: | + - **Custom Exceptions:** {{business_exception_types}} + - **User-Facing Errors:** {{user_error_format}} + - **Error Codes:** {{error_code_system}} + - id: data-consistency + title: Data Consistency + template: | + - **Transaction Strategy:** {{transaction_approach}} + - **Compensation Logic:** {{compensation_patterns}} + - **Idempotency:** {{idempotency_approach}} + + - id: coding-standards + title: Coding Standards + instruction: | + These standards are MANDATORY for AI agents. Work with user to define ONLY the critical rules needed to prevent bad code. Explain that: + + 1. This section directly controls AI developer behavior + 2. Keep it minimal - assume AI knows general best practices + 3. Focus on project-specific conventions and gotchas + 4. Overly detailed standards bloat context and slow development + 5. Standards will be extracted to separate file for dev agent use + + For each standard, get explicit user confirmation it's necessary. + elicit: true + sections: + - id: core-standards + title: Core Standards + template: | + - **Languages & Runtimes:** {{languages_and_versions}} + - **Style & Linting:** {{linter_config}} + - **Test Organization:** {{test_file_convention}} + - id: naming-conventions + title: Naming Conventions + type: table + columns: [Element, Convention, Example] + instruction: Only include if deviating from language defaults + - id: critical-rules + title: Critical Rules + instruction: | + List ONLY rules that AI might violate or project-specific requirements. Examples: + - "Never use console.log in production code - use logger" + - "All API responses must use ApiResponse wrapper type" + - "Database queries must use repository pattern, never direct ORM" + + Avoid obvious rules like "use SOLID principles" or "write clean code" + repeatable: true + template: "- **{{rule_name}}:** {{rule_description}}" + - id: language-specifics + title: Language-Specific Guidelines + condition: Critical language-specific rules needed + instruction: Add ONLY if critical for preventing AI mistakes. Most teams don't need this section. + sections: + - id: language-rules + title: "{{language_name}} Specifics" + repeatable: true + template: "- **{{rule_topic}}:** {{rule_detail}}" + + - id: test-strategy + title: Test Strategy and Standards + instruction: | + Work with user to define comprehensive test strategy: + + 1. Use test frameworks from Tech Stack + 2. Decide on TDD vs test-after approach + 3. Define test organization and naming + 4. Establish coverage goals + 5. Determine integration test infrastructure + 6. Plan for test data and external dependencies + + Note: Basic info goes in Coding Standards for dev agent. This detailed section is for QA agent and team reference. + elicit: true + sections: + - id: testing-philosophy + title: Testing Philosophy + template: | + - **Approach:** {{test_approach}} + - **Coverage Goals:** {{coverage_targets}} + - **Test Pyramid:** {{test_distribution}} + - id: test-types + title: Test Types and Organization + sections: + - id: unit-tests + title: Unit Tests + template: | + - **Framework:** {{unit_test_framework}} {{version}} + - **File Convention:** {{unit_test_naming}} + - **Location:** {{unit_test_location}} + - **Mocking Library:** {{mocking_library}} + - **Coverage Requirement:** {{unit_coverage}} + + **AI Agent Requirements:** + - Generate tests for all public methods + - Cover edge cases and error conditions + - Follow AAA pattern (Arrange, Act, Assert) + - Mock all external dependencies + - id: integration-tests + title: Integration Tests + template: | + - **Scope:** {{integration_scope}} + - **Location:** {{integration_test_location}} + - **Test Infrastructure:** + - **{{dependency_name}}:** {{test_approach}} ({{test_tool}}) + examples: + - "**Database:** In-memory H2 for unit tests, Testcontainers PostgreSQL for integration" + - "**Message Queue:** Embedded Kafka for tests" + - "**External APIs:** WireMock for stubbing" + - id: e2e-tests + title: End-to-End Tests + template: | + - **Framework:** {{e2e_framework}} {{version}} + - **Scope:** {{e2e_scope}} + - **Environment:** {{e2e_environment}} + - **Test Data:** {{e2e_data_strategy}} + - id: test-data-management + title: Test Data Management + template: | + - **Strategy:** {{test_data_approach}} + - **Fixtures:** {{fixture_location}} + - **Factories:** {{factory_pattern}} + - **Cleanup:** {{cleanup_strategy}} + - id: continuous-testing + title: Continuous Testing + template: | + - **CI Integration:** {{ci_test_stages}} + - **Performance Tests:** {{perf_test_approach}} + - **Security Tests:** {{security_test_approach}} + + - id: security + title: Security + instruction: | + Define MANDATORY security requirements for AI and human developers: + + 1. Focus on implementation-specific rules + 2. Reference security tools from Tech Stack + 3. Define clear patterns for common scenarios + 4. These rules directly impact code generation + 5. Work with user to ensure completeness without redundancy + elicit: true + sections: + - id: input-validation + title: Input Validation + template: | + - **Validation Library:** {{validation_library}} + - **Validation Location:** {{where_to_validate}} + - **Required Rules:** + - All external inputs MUST be validated + - Validation at API boundary before processing + - Whitelist approach preferred over blacklist + - id: auth-authorization + title: Authentication & Authorization + template: | + - **Auth Method:** {{auth_implementation}} + - **Session Management:** {{session_approach}} + - **Required Patterns:** + - {{auth_pattern_1}} + - {{auth_pattern_2}} + - id: secrets-management + title: Secrets Management + template: | + - **Development:** {{dev_secrets_approach}} + - **Production:** {{prod_secrets_service}} + - **Code Requirements:** + - NEVER hardcode secrets + - Access via configuration service only + - No secrets in logs or error messages + - id: api-security + title: API Security + template: | + - **Rate Limiting:** {{rate_limit_implementation}} + - **CORS Policy:** {{cors_configuration}} + - **Security Headers:** {{required_headers}} + - **HTTPS Enforcement:** {{https_approach}} + - id: data-protection + title: Data Protection + template: | + - **Encryption at Rest:** {{encryption_at_rest}} + - **Encryption in Transit:** {{encryption_in_transit}} + - **PII Handling:** {{pii_rules}} + - **Logging Restrictions:** {{what_not_to_log}} + - id: dependency-security + title: Dependency Security + template: | + - **Scanning Tool:** {{dependency_scanner}} + - **Update Policy:** {{update_frequency}} + - **Approval Process:** {{new_dep_process}} + - id: security-testing + title: Security Testing + template: | + - **SAST Tool:** {{static_analysis}} + - **DAST Tool:** {{dynamic_analysis}} + - **Penetration Testing:** {{pentest_schedule}} + + - id: checklist-results + title: Checklist Results Report + instruction: Before running the checklist, offer to output the full architecture document. Once user confirms, execute the architect-checklist and populate results here. + + - id: next-steps + title: Next Steps + instruction: | + After completing the architecture: + + 1. If project has UI components: + - Recommend engaging Design Architect agent + - Use "Frontend Architecture Mode" + - Provide this document as input + + 2. For all projects: + - Review with Product Owner + - Begin story implementation with Dev agent + - Set up infrastructure with DevOps agent + + 3. Include specific prompts for next agents if needed + sections: + - id: design-architect-prompt + title: Design Architect Prompt + condition: Project has UI components + instruction: | + Create a brief prompt to hand off to Design Architect for Frontend Architecture creation. Include: + - Reference to this architecture document + - Key UI requirements from PRD + - Any frontend-specific decisions made here + - Request for detailed frontend architecture + - id: developer-handoff + title: Developer Handoff + instruction: | + Create a brief prompt for developers starting implementation. Include: + - Reference to this architecture and coding standards + - First epic/story to implement + - Key technical decisions to follow +==================== END: .bmad-core/templates/architecture-tmpl.yaml ==================== + +==================== START: .bmad-core/templates/front-end-architecture-tmpl.yaml ==================== +template: + id: frontend-architecture-template-v2 + name: Frontend Architecture Document + version: 2.0 + output: + format: markdown + filename: docs/ui-architecture.md + title: "{{project_name}} Frontend Architecture Document" + +workflow: + mode: interactive + elicitation: advanced-elicitation + +sections: + - id: template-framework-selection + title: Template and Framework Selection + instruction: | + Review provided documents including PRD, UX-UI Specification, and main Architecture Document. Focus on extracting technical implementation details needed for AI frontend tools and developer agents. Ask the user for any of these documents if you are unable to locate and were not provided. + + Before proceeding with frontend architecture design, check if the project is using a frontend starter template or existing codebase: + + 1. Review the PRD, main architecture document, and brainstorming brief for mentions of: + - Frontend starter templates (e.g., Create React App, Next.js, Vite, Vue CLI, Angular CLI, etc.) + - UI kit or component library starters + - Existing frontend projects being used as a foundation + - Admin dashboard templates or other specialized starters + - Design system implementations + + 2. If a frontend starter template or existing project is mentioned: + - Ask the user to provide access via one of these methods: + - Link to the starter template documentation + - Upload/attach the project files (for small projects) + - Share a link to the project repository + - Analyze the starter/existing project to understand: + - Pre-installed dependencies and versions + - Folder structure and file organization + - Built-in components and utilities + - Styling approach (CSS modules, styled-components, Tailwind, etc.) + - State management setup (if any) + - Routing configuration + - Testing setup and patterns + - Build and development scripts + - Use this analysis to ensure your frontend architecture aligns with the starter's patterns + + 3. If no frontend starter is mentioned but this is a new UI, ensure we know what the ui language and framework is: + - Based on the framework choice, suggest appropriate starters: + - React: Create React App, Next.js, Vite + React + - Vue: Vue CLI, Nuxt.js, Vite + Vue + - Angular: Angular CLI + - Or suggest popular UI templates if applicable + - Explain benefits specific to frontend development + + 4. If the user confirms no starter template will be used: + - Note that all tooling, bundling, and configuration will need manual setup + - Proceed with frontend architecture from scratch + + Document the starter template decision and any constraints it imposes before proceeding. + sections: + - id: changelog + title: Change Log + type: table + columns: [Date, Version, Description, Author] + instruction: Track document versions and changes + + - id: frontend-tech-stack + title: Frontend Tech Stack + instruction: Extract from main architecture's Technology Stack Table. This section MUST remain synchronized with the main architecture document. + elicit: true + sections: + - id: tech-stack-table + title: Technology Stack Table + type: table + columns: [Category, Technology, Version, Purpose, Rationale] + instruction: Fill in appropriate technology choices based on the selected framework and project requirements. + rows: + - ["Framework", "{{framework}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] + - ["UI Library", "{{ui_library}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] + - ["State Management", "{{state_management}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] + - ["Routing", "{{routing_library}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] + - ["Build Tool", "{{build_tool}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] + - ["Styling", "{{styling_solution}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] + - ["Testing", "{{test_framework}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] + - ["Component Library", "{{component_lib}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] + - ["Form Handling", "{{form_library}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] + - ["Animation", "{{animation_lib}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] + - ["Dev Tools", "{{dev_tools}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] + + - id: project-structure + title: Project Structure + instruction: Define exact directory structure for AI tools based on the chosen framework. Be specific about where each type of file goes. Generate a structure that follows the framework's best practices and conventions. + elicit: true + type: code + language: plaintext + + - id: component-standards + title: Component Standards + instruction: Define exact patterns for component creation based on the chosen framework. + elicit: true + sections: + - id: component-template + title: Component Template + instruction: Generate a minimal but complete component template following the framework's best practices. Include TypeScript types, proper imports, and basic structure. + type: code + language: typescript + - id: naming-conventions + title: Naming Conventions + instruction: Provide naming conventions specific to the chosen framework for components, files, services, state management, and other architectural elements. + + - id: state-management + title: State Management + instruction: Define state management patterns based on the chosen framework. + elicit: true + sections: + - id: store-structure + title: Store Structure + instruction: Generate the state management directory structure appropriate for the chosen framework and selected state management solution. + type: code + language: plaintext + - id: state-template + title: State Management Template + instruction: Provide a basic state management template/example following the framework's recommended patterns. Include TypeScript types and common operations like setting, updating, and clearing state. + type: code + language: typescript + + - id: api-integration + title: API Integration + instruction: Define API service patterns based on the chosen framework. + elicit: true + sections: + - id: service-template + title: Service Template + instruction: Provide an API service template that follows the framework's conventions. Include proper TypeScript types, error handling, and async patterns. + type: code + language: typescript + - id: api-client-config + title: API Client Configuration + instruction: Show how to configure the HTTP client for the chosen framework, including authentication interceptors/middleware and error handling. + type: code + language: typescript + + - id: routing + title: Routing + instruction: Define routing structure and patterns based on the chosen framework. + elicit: true + sections: + - id: route-configuration + title: Route Configuration + instruction: Provide routing configuration appropriate for the chosen framework. Include protected route patterns, lazy loading where applicable, and authentication guards/middleware. + type: code + language: typescript + + - id: styling-guidelines + title: Styling Guidelines + instruction: Define styling approach based on the chosen framework. + elicit: true + sections: + - id: styling-approach + title: Styling Approach + instruction: Describe the styling methodology appropriate for the chosen framework (CSS Modules, Styled Components, Tailwind, etc.) and provide basic patterns. + - id: global-theme + title: Global Theme Variables + instruction: Provide a CSS custom properties (CSS variables) theme system that works across all frameworks. Include colors, spacing, typography, shadows, and dark mode support. + type: code + language: css + + - id: testing-requirements + title: Testing Requirements + instruction: Define minimal testing requirements based on the chosen framework. + elicit: true + sections: + - id: component-test-template + title: Component Test Template + instruction: Provide a basic component test template using the framework's recommended testing library. Include examples of rendering tests, user interaction tests, and mocking. + type: code + language: typescript + - id: testing-best-practices + title: Testing Best Practices + type: numbered-list + items: + - "**Unit Tests**: Test individual components in isolation" + - "**Integration Tests**: Test component interactions" + - "**E2E Tests**: Test critical user flows (using Cypress/Playwright)" + - "**Coverage Goals**: Aim for 80% code coverage" + - "**Test Structure**: Arrange-Act-Assert pattern" + - "**Mock External Dependencies**: API calls, routing, state management" + + - id: environment-configuration + title: Environment Configuration + instruction: List required environment variables based on the chosen framework. Show the appropriate format and naming conventions for the framework. + elicit: true + + - id: frontend-developer-standards + title: Frontend Developer Standards + sections: + - id: critical-coding-rules + title: Critical Coding Rules + instruction: List essential rules that prevent common AI mistakes, including both universal rules and framework-specific ones. + elicit: true + - id: quick-reference + title: Quick Reference + instruction: | + Create a framework-specific cheat sheet with: + - Common commands (dev server, build, test) + - Key import patterns + - File naming conventions + - Project-specific patterns and utilities +==================== END: .bmad-core/templates/front-end-architecture-tmpl.yaml ==================== + +==================== START: .bmad-core/templates/fullstack-architecture-tmpl.yaml ==================== +template: + id: fullstack-architecture-template-v2 + name: Fullstack Architecture Document + version: 2.0 + output: + format: markdown + filename: docs/architecture.md + title: "{{project_name}} Fullstack Architecture Document" + +workflow: + mode: interactive + elicitation: advanced-elicitation + +sections: + - id: introduction + title: Introduction + instruction: | + If available, review any provided relevant documents to gather all relevant context before beginning. At minimum, you should have access to docs/prd.md and docs/front-end-spec.md. Ask the user for any documents you need but cannot locate. This template creates a unified architecture that covers both backend and frontend concerns to guide AI-driven fullstack development. + elicit: true + content: | + This document outlines the complete fullstack architecture for {{project_name}}, including backend systems, frontend implementation, and their integration. It serves as the single source of truth for AI-driven development, ensuring consistency across the entire technology stack. + + This unified approach combines what would traditionally be separate backend and frontend architecture documents, streamlining the development process for modern fullstack applications where these concerns are increasingly intertwined. + sections: + - id: starter-template + title: Starter Template or Existing Project + instruction: | + Before proceeding with architecture design, check if the project is based on any starter templates or existing codebases: + + 1. Review the PRD and other documents for mentions of: + - Fullstack starter templates (e.g., T3 Stack, MEAN/MERN starters, Django + React templates) + - Monorepo templates (e.g., Nx, Turborepo starters) + - Platform-specific starters (e.g., Vercel templates, AWS Amplify starters) + - Existing projects being extended or cloned + + 2. If starter templates or existing projects are mentioned: + - Ask the user to provide access (links, repos, or files) + - Analyze to understand pre-configured choices and constraints + - Note any architectural decisions already made + - Identify what can be modified vs what must be retained + + 3. If no starter is mentioned but this is greenfield: + - Suggest appropriate fullstack starters based on tech preferences + - Consider platform-specific options (Vercel, AWS, etc.) + - Let user decide whether to use one + + 4. Document the decision and any constraints it imposes + + If none, state "N/A - Greenfield project" + - id: changelog + title: Change Log + type: table + columns: [Date, Version, Description, Author] + instruction: Track document versions and changes + + - id: high-level-architecture + title: High Level Architecture + instruction: This section contains multiple subsections that establish the foundation. Present all subsections together, then elicit feedback on the complete section. + elicit: true + sections: + - id: technical-summary + title: Technical Summary + instruction: | + Provide a comprehensive overview (4-6 sentences) covering: + - Overall architectural style and deployment approach + - Frontend framework and backend technology choices + - Key integration points between frontend and backend + - Infrastructure platform and services + - How this architecture achieves PRD goals + - id: platform-infrastructure + title: Platform and Infrastructure Choice + instruction: | + Based on PRD requirements and technical assumptions, make a platform recommendation: + + 1. Consider common patterns (not an exhaustive list, use your own best judgement and search the web as needed for emerging trends): + - **Vercel + Supabase**: For rapid development with Next.js, built-in auth/storage + - **AWS Full Stack**: For enterprise scale with Lambda, API Gateway, S3, Cognito + - **Azure**: For .NET ecosystems or enterprise Microsoft environments + - **Google Cloud**: For ML/AI heavy applications or Google ecosystem integration + + 2. Present 2-3 viable options with clear pros/cons + 3. Make a recommendation with rationale + 4. Get explicit user confirmation + + Document the choice and key services that will be used. + template: | + **Platform:** {{selected_platform}} + **Key Services:** {{core_services_list}} + **Deployment Host and Regions:** {{regions}} + - id: repository-structure + title: Repository Structure + instruction: | + Define the repository approach based on PRD requirements and platform choice, explain your rationale or ask questions to the user if unsure: + + 1. For modern fullstack apps, monorepo is often preferred + 2. Consider tooling (Nx, Turborepo, Lerna, npm workspaces) + 3. Define package/app boundaries + 4. Plan for shared code between frontend and backend + template: | + **Structure:** {{repo_structure_choice}} + **Monorepo Tool:** {{monorepo_tool_if_applicable}} + **Package Organization:** {{package_strategy}} + - id: architecture-diagram + title: High Level Architecture Diagram + type: mermaid + mermaid_type: graph + instruction: | + Create a Mermaid diagram showing the complete system architecture including: + - User entry points (web, mobile) + - Frontend application deployment + - API layer (REST/GraphQL) + - Backend services + - Databases and storage + - External integrations + - CDN and caching layers + + Use appropriate diagram type for clarity. + - id: architectural-patterns + title: Architectural Patterns + instruction: | + List patterns that will guide both frontend and backend development. Include patterns for: + - Overall architecture (e.g., Jamstack, Serverless, Microservices) + - Frontend patterns (e.g., Component-based, State management) + - Backend patterns (e.g., Repository, CQRS, Event-driven) + - Integration patterns (e.g., BFF, API Gateway) + + For each pattern, provide recommendation and rationale. + repeatable: true + template: "- **{{pattern_name}}:** {{pattern_description}} - _Rationale:_ {{rationale}}" + examples: + - "**Jamstack Architecture:** Static site generation with serverless APIs - _Rationale:_ Optimal performance and scalability for content-heavy applications" + - "**Component-Based UI:** Reusable React components with TypeScript - _Rationale:_ Maintainability and type safety across large codebases" + - "**Repository Pattern:** Abstract data access logic - _Rationale:_ Enables testing and future database migration flexibility" + - "**API Gateway Pattern:** Single entry point for all API calls - _Rationale:_ Centralized auth, rate limiting, and monitoring" + + - id: tech-stack + title: Tech Stack + instruction: | + This is the DEFINITIVE technology selection for the entire project. Work with user to finalize all choices. This table is the single source of truth - all development must use these exact versions. + + Key areas to cover: + - Frontend and backend languages/frameworks + - Databases and caching + - Authentication and authorization + - API approach + - Testing tools for both frontend and backend + - Build and deployment tools + - Monitoring and logging + + Upon render, elicit feedback immediately. + elicit: true + sections: + - id: tech-stack-table + title: Technology Stack Table + type: table + columns: [Category, Technology, Version, Purpose, Rationale] + rows: + - ["Frontend Language", "{{fe_language}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] + - ["Frontend Framework", "{{fe_framework}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] + - ["UI Component Library", "{{ui_library}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] + - ["State Management", "{{state_mgmt}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] + - ["Backend Language", "{{be_language}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] + - ["Backend Framework", "{{be_framework}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] + - ["API Style", "{{api_style}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] + - ["Database", "{{database}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] + - ["Cache", "{{cache}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] + - ["File Storage", "{{storage}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] + - ["Authentication", "{{auth}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] + - ["Frontend Testing", "{{fe_test}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] + - ["Backend Testing", "{{be_test}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] + - ["E2E Testing", "{{e2e_test}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] + - ["Build Tool", "{{build_tool}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] + - ["Bundler", "{{bundler}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] + - ["IaC Tool", "{{iac_tool}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] + - ["CI/CD", "{{cicd}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] + - ["Monitoring", "{{monitoring}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] + - ["Logging", "{{logging}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] + - ["CSS Framework", "{{css_framework}}", "{{version}}", "{{purpose}}", "{{why_chosen}}"] + + - id: data-models + title: Data Models + instruction: | + Define the core data models/entities that will be shared between frontend and backend: + + 1. Review PRD requirements and identify key business entities + 2. For each model, explain its purpose and relationships + 3. Include key attributes and data types + 4. Show relationships between models + 5. Create TypeScript interfaces that can be shared + 6. Discuss design decisions with user + + Create a clear conceptual model before moving to database schema. + elicit: true + repeatable: true + sections: + - id: model + title: "{{model_name}}" + template: | + **Purpose:** {{model_purpose}} + + **Key Attributes:** + - {{attribute_1}}: {{type_1}} - {{description_1}} + - {{attribute_2}}: {{type_2}} - {{description_2}} + sections: + - id: typescript-interface + title: TypeScript Interface + type: code + language: typescript + template: "{{model_interface}}" + - id: relationships + title: Relationships + type: bullet-list + template: "- {{relationship}}" + + - id: api-spec + title: API Specification + instruction: | + Based on the chosen API style from Tech Stack: + + 1. If REST API, create an OpenAPI 3.0 specification + 2. If GraphQL, provide the GraphQL schema + 3. If tRPC, show router definitions + 4. Include all endpoints from epics/stories + 5. Define request/response schemas based on data models + 6. Document authentication requirements + 7. Include example requests/responses + + Use appropriate format for the chosen API style. If no API (e.g., static site), skip this section. + elicit: true + sections: + - id: rest-api + title: REST API Specification + condition: API style is REST + type: code + language: yaml + template: | + openapi: 3.0.0 + info: + title: {{api_title}} + version: {{api_version}} + description: {{api_description}} + servers: + - url: {{server_url}} + description: {{server_description}} + - id: graphql-api + title: GraphQL Schema + condition: API style is GraphQL + type: code + language: graphql + template: "{{graphql_schema}}" + - id: trpc-api + title: tRPC Router Definitions + condition: API style is tRPC + type: code + language: typescript + template: "{{trpc_routers}}" + + - id: components + title: Components + instruction: | + Based on the architectural patterns, tech stack, and data models from above: + + 1. Identify major logical components/services across the fullstack + 2. Consider both frontend and backend components + 3. Define clear boundaries and interfaces between components + 4. For each component, specify: + - Primary responsibility + - Key interfaces/APIs exposed + - Dependencies on other components + - Technology specifics based on tech stack choices + + 5. Create component diagrams where helpful + elicit: true + sections: + - id: component-list + repeatable: true + title: "{{component_name}}" + template: | + **Responsibility:** {{component_description}} + + **Key Interfaces:** + - {{interface_1}} + - {{interface_2}} + + **Dependencies:** {{dependencies}} + + **Technology Stack:** {{component_tech_details}} + - id: component-diagrams + title: Component Diagrams + type: mermaid + instruction: | + Create Mermaid diagrams to visualize component relationships. Options: + - C4 Container diagram for high-level view + - Component diagram for detailed internal structure + - Sequence diagrams for complex interactions + Choose the most appropriate for clarity + + - id: external-apis + title: External APIs + condition: Project requires external API integrations + instruction: | + For each external service integration: + + 1. Identify APIs needed based on PRD requirements and component design + 2. If documentation URLs are unknown, ask user for specifics + 3. Document authentication methods and security considerations + 4. List specific endpoints that will be used + 5. Note any rate limits or usage constraints + + If no external APIs are needed, state this explicitly and skip to next section. + elicit: true + repeatable: true + sections: + - id: api + title: "{{api_name}} API" + template: | + - **Purpose:** {{api_purpose}} + - **Documentation:** {{api_docs_url}} + - **Base URL(s):** {{api_base_url}} + - **Authentication:** {{auth_method}} + - **Rate Limits:** {{rate_limits}} + + **Key Endpoints Used:** + - `{{method}} {{endpoint_path}}` - {{endpoint_purpose}} + + **Integration Notes:** {{integration_considerations}} + + - id: core-workflows + title: Core Workflows + type: mermaid + mermaid_type: sequence + instruction: | + Illustrate key system workflows using sequence diagrams: + + 1. Identify critical user journeys from PRD + 2. Show component interactions including external APIs + 3. Include both frontend and backend flows + 4. Include error handling paths + 5. Document async operations + 6. Create both high-level and detailed diagrams as needed + + Focus on workflows that clarify architecture decisions or complex interactions. + elicit: true + + - id: database-schema + title: Database Schema + instruction: | + Transform the conceptual data models into concrete database schemas: + + 1. Use the database type(s) selected in Tech Stack + 2. Create schema definitions using appropriate notation + 3. Include indexes, constraints, and relationships + 4. Consider performance and scalability + 5. For NoSQL, show document structures + + Present schema in format appropriate to database type (SQL DDL, JSON schema, etc.) + elicit: true + + - id: frontend-architecture + title: Frontend Architecture + instruction: Define frontend-specific architecture details. After each subsection, note if user wants to refine before continuing. + elicit: true + sections: + - id: component-architecture + title: Component Architecture + instruction: Define component organization and patterns based on chosen framework. + sections: + - id: component-organization + title: Component Organization + type: code + language: text + template: "{{component_structure}}" + - id: component-template + title: Component Template + type: code + language: typescript + template: "{{component_template}}" + - id: state-management + title: State Management Architecture + instruction: Detail state management approach based on chosen solution. + sections: + - id: state-structure + title: State Structure + type: code + language: typescript + template: "{{state_structure}}" + - id: state-patterns + title: State Management Patterns + type: bullet-list + template: "- {{pattern}}" + - id: routing-architecture + title: Routing Architecture + instruction: Define routing structure based on framework choice. + sections: + - id: route-organization + title: Route Organization + type: code + language: text + template: "{{route_structure}}" + - id: protected-routes + title: Protected Route Pattern + type: code + language: typescript + template: "{{protected_route_example}}" + - id: frontend-services + title: Frontend Services Layer + instruction: Define how frontend communicates with backend. + sections: + - id: api-client-setup + title: API Client Setup + type: code + language: typescript + template: "{{api_client_setup}}" + - id: service-example + title: Service Example + type: code + language: typescript + template: "{{service_example}}" + + - id: backend-architecture + title: Backend Architecture + instruction: Define backend-specific architecture details. Consider serverless vs traditional server approaches. + elicit: true + sections: + - id: service-architecture + title: Service Architecture + instruction: Based on platform choice, define service organization. + sections: + - id: serverless-architecture + condition: Serverless architecture chosen + sections: + - id: function-organization + title: Function Organization + type: code + language: text + template: "{{function_structure}}" + - id: function-template + title: Function Template + type: code + language: typescript + template: "{{function_template}}" + - id: traditional-server + condition: Traditional server architecture chosen + sections: + - id: controller-organization + title: Controller/Route Organization + type: code + language: text + template: "{{controller_structure}}" + - id: controller-template + title: Controller Template + type: code + language: typescript + template: "{{controller_template}}" + - id: database-architecture + title: Database Architecture + instruction: Define database schema and access patterns. + sections: + - id: schema-design + title: Schema Design + type: code + language: sql + template: "{{database_schema}}" + - id: data-access-layer + title: Data Access Layer + type: code + language: typescript + template: "{{repository_pattern}}" + - id: auth-architecture + title: Authentication and Authorization + instruction: Define auth implementation details. + sections: + - id: auth-flow + title: Auth Flow + type: mermaid + mermaid_type: sequence + template: "{{auth_flow_diagram}}" + - id: auth-middleware + title: Middleware/Guards + type: code + language: typescript + template: "{{auth_middleware}}" + + - id: unified-project-structure + title: Unified Project Structure + instruction: Create a monorepo structure that accommodates both frontend and backend. Adapt based on chosen tools and frameworks. + elicit: true + type: code + language: plaintext + examples: + - | + {{project-name}}/ + ├── .github/ # CI/CD workflows + │ └── workflows/ + │ ├── ci.yaml + │ └── deploy.yaml + ├── apps/ # Application packages + │ ├── web/ # Frontend application + │ │ ├── src/ + │ │ │ ├── components/ # UI components + │ │ │ ├── pages/ # Page components/routes + │ │ │ ├── hooks/ # Custom React hooks + │ │ │ ├── services/ # API client services + │ │ │ ├── stores/ # State management + │ │ │ ├── styles/ # Global styles/themes + │ │ │ └── utils/ # Frontend utilities + │ │ ├── public/ # Static assets + │ │ ├── tests/ # Frontend tests + │ │ └── package.json + │ └── api/ # Backend application + │ ├── src/ + │ │ ├── routes/ # API routes/controllers + │ │ ├── services/ # Business logic + │ │ ├── models/ # Data models + │ │ ├── middleware/ # Express/API middleware + │ │ ├── utils/ # Backend utilities + │ │ └── {{serverless_or_server_entry}} + │ ├── tests/ # Backend tests + │ └── package.json + ├── packages/ # Shared packages + │ ├── shared/ # Shared types/utilities + │ │ ├── src/ + │ │ │ ├── types/ # TypeScript interfaces + │ │ │ ├── constants/ # Shared constants + │ │ │ └── utils/ # Shared utilities + │ │ └── package.json + │ ├── ui/ # Shared UI components + │ │ ├── src/ + │ │ └── package.json + │ └── config/ # Shared configuration + │ ├── eslint/ + │ ├── typescript/ + │ └── jest/ + ├── infrastructure/ # IaC definitions + │ └── {{iac_structure}} + ├── scripts/ # Build/deploy scripts + ├── docs/ # Documentation + │ ├── prd.md + │ ├── front-end-spec.md + │ └── fullstack-architecture.md + ├── .env.example # Environment template + ├── package.json # Root package.json + ├── {{monorepo_config}} # Monorepo configuration + └── README.md + + - id: development-workflow + title: Development Workflow + instruction: Define the development setup and workflow for the fullstack application. + elicit: true + sections: + - id: local-setup + title: Local Development Setup + sections: + - id: prerequisites + title: Prerequisites + type: code + language: bash + template: "{{prerequisites_commands}}" + - id: initial-setup + title: Initial Setup + type: code + language: bash + template: "{{setup_commands}}" + - id: dev-commands + title: Development Commands + type: code + language: bash + template: | + # Start all services + {{start_all_command}} + + # Start frontend only + {{start_frontend_command}} + + # Start backend only + {{start_backend_command}} + + # Run tests + {{test_commands}} + - id: environment-config + title: Environment Configuration + sections: + - id: env-vars + title: Required Environment Variables + type: code + language: bash + template: | + # Frontend (.env.local) + {{frontend_env_vars}} + + # Backend (.env) + {{backend_env_vars}} + + # Shared + {{shared_env_vars}} + + - id: deployment-architecture + title: Deployment Architecture + instruction: Define deployment strategy based on platform choice. + elicit: true + sections: + - id: deployment-strategy + title: Deployment Strategy + template: | + **Frontend Deployment:** + - **Platform:** {{frontend_deploy_platform}} + - **Build Command:** {{frontend_build_command}} + - **Output Directory:** {{frontend_output_dir}} + - **CDN/Edge:** {{cdn_strategy}} + + **Backend Deployment:** + - **Platform:** {{backend_deploy_platform}} + - **Build Command:** {{backend_build_command}} + - **Deployment Method:** {{deployment_method}} + - id: cicd-pipeline + title: CI/CD Pipeline + type: code + language: yaml + template: "{{cicd_pipeline_config}}" + - id: environments + title: Environments + type: table + columns: [Environment, Frontend URL, Backend URL, Purpose] + rows: + - ["Development", "{{dev_fe_url}}", "{{dev_be_url}}", "Local development"] + - ["Staging", "{{staging_fe_url}}", "{{staging_be_url}}", "Pre-production testing"] + - ["Production", "{{prod_fe_url}}", "{{prod_be_url}}", "Live environment"] + + - id: security-performance + title: Security and Performance + instruction: Define security and performance considerations for the fullstack application. + elicit: true + sections: + - id: security-requirements + title: Security Requirements + template: | + **Frontend Security:** + - CSP Headers: {{csp_policy}} + - XSS Prevention: {{xss_strategy}} + - Secure Storage: {{storage_strategy}} + + **Backend Security:** + - Input Validation: {{validation_approach}} + - Rate Limiting: {{rate_limit_config}} + - CORS Policy: {{cors_config}} + + **Authentication Security:** + - Token Storage: {{token_strategy}} + - Session Management: {{session_approach}} + - Password Policy: {{password_requirements}} + - id: performance-optimization + title: Performance Optimization + template: | + **Frontend Performance:** + - Bundle Size Target: {{bundle_size}} + - Loading Strategy: {{loading_approach}} + - Caching Strategy: {{fe_cache_strategy}} + + **Backend Performance:** + - Response Time Target: {{response_target}} + - Database Optimization: {{db_optimization}} + - Caching Strategy: {{be_cache_strategy}} + + - id: testing-strategy + title: Testing Strategy + instruction: Define comprehensive testing approach for fullstack application. + elicit: true + sections: + - id: testing-pyramid + title: Testing Pyramid + type: code + language: text + template: | + E2E Tests + / \ + Integration Tests + / \ + Frontend Unit Backend Unit + - id: test-organization + title: Test Organization + sections: + - id: frontend-tests + title: Frontend Tests + type: code + language: text + template: "{{frontend_test_structure}}" + - id: backend-tests + title: Backend Tests + type: code + language: text + template: "{{backend_test_structure}}" + - id: e2e-tests + title: E2E Tests + type: code + language: text + template: "{{e2e_test_structure}}" + - id: test-examples + title: Test Examples + sections: + - id: frontend-test + title: Frontend Component Test + type: code + language: typescript + template: "{{frontend_test_example}}" + - id: backend-test + title: Backend API Test + type: code + language: typescript + template: "{{backend_test_example}}" + - id: e2e-test + title: E2E Test + type: code + language: typescript + template: "{{e2e_test_example}}" + + - id: coding-standards + title: Coding Standards + instruction: Define MINIMAL but CRITICAL standards for AI agents. Focus only on project-specific rules that prevent common mistakes. These will be used by dev agents. + elicit: true + sections: + - id: critical-rules + title: Critical Fullstack Rules + repeatable: true + template: "- **{{rule_name}}:** {{rule_description}}" + examples: + - "**Type Sharing:** Always define types in packages/shared and import from there" + - "**API Calls:** Never make direct HTTP calls - use the service layer" + - "**Environment Variables:** Access only through config objects, never process.env directly" + - "**Error Handling:** All API routes must use the standard error handler" + - "**State Updates:** Never mutate state directly - use proper state management patterns" + - id: naming-conventions + title: Naming Conventions + type: table + columns: [Element, Frontend, Backend, Example] + rows: + - ["Components", "PascalCase", "-", "`UserProfile.tsx`"] + - ["Hooks", "camelCase with 'use'", "-", "`useAuth.ts`"] + - ["API Routes", "-", "kebab-case", "`/api/user-profile`"] + - ["Database Tables", "-", "snake_case", "`user_profiles`"] + + - id: error-handling + title: Error Handling Strategy + instruction: Define unified error handling across frontend and backend. + elicit: true + sections: + - id: error-flow + title: Error Flow + type: mermaid + mermaid_type: sequence + template: "{{error_flow_diagram}}" + - id: error-format + title: Error Response Format + type: code + language: typescript + template: | + interface ApiError { + error: { + code: string; + message: string; + details?: Record; + timestamp: string; + requestId: string; + }; + } + - id: frontend-error-handling + title: Frontend Error Handling + type: code + language: typescript + template: "{{frontend_error_handler}}" + - id: backend-error-handling + title: Backend Error Handling + type: code + language: typescript + template: "{{backend_error_handler}}" + + - id: monitoring + title: Monitoring and Observability + instruction: Define monitoring strategy for fullstack application. + elicit: true + sections: + - id: monitoring-stack + title: Monitoring Stack + template: | + - **Frontend Monitoring:** {{frontend_monitoring}} + - **Backend Monitoring:** {{backend_monitoring}} + - **Error Tracking:** {{error_tracking}} + - **Performance Monitoring:** {{perf_monitoring}} + - id: key-metrics + title: Key Metrics + template: | + **Frontend Metrics:** + - Core Web Vitals + - JavaScript errors + - API response times + - User interactions + + **Backend Metrics:** + - Request rate + - Error rate + - Response time + - Database query performance + + - id: checklist-results + title: Checklist Results Report + instruction: Before running the checklist, offer to output the full architecture document. Once user confirms, execute the architect-checklist and populate results here. +==================== END: .bmad-core/templates/fullstack-architecture-tmpl.yaml ==================== + +==================== START: .bmad-core/templates/brownfield-architecture-tmpl.yaml ==================== +template: + id: brownfield-architecture-template-v2 + name: Brownfield Enhancement Architecture + version: 2.0 + output: + format: markdown + filename: docs/architecture.md + title: "{{project_name}} Brownfield Enhancement Architecture" + +workflow: + mode: interactive + elicitation: advanced-elicitation + +sections: + - id: introduction + title: Introduction + instruction: | + IMPORTANT - SCOPE AND ASSESSMENT REQUIRED: + + This architecture document is for SIGNIFICANT enhancements to existing projects that require comprehensive architectural planning. Before proceeding: + + 1. **Verify Complexity**: Confirm this enhancement requires architectural planning. For simple additions, recommend: "For simpler changes that don't require architectural planning, consider using the brownfield-create-epic or brownfield-create-story task with the Product Owner instead." + + 2. **REQUIRED INPUTS**: + - Completed brownfield-prd.md + - Existing project technical documentation (from docs folder or user-provided) + - Access to existing project structure (IDE or uploaded files) + + 3. **DEEP ANALYSIS MANDATE**: You MUST conduct thorough analysis of the existing codebase, architecture patterns, and technical constraints before making ANY architectural recommendations. Every suggestion must be based on actual project analysis, not assumptions. + + 4. **CONTINUOUS VALIDATION**: Throughout this process, explicitly validate your understanding with the user. For every architectural decision, confirm: "Based on my analysis of your existing system, I recommend [decision] because [evidence from actual project]. Does this align with your system's reality?" + + If any required inputs are missing, request them before proceeding. + elicit: true + sections: + - id: intro-content + content: | + This document outlines the architectural approach for enhancing {{project_name}} with {{enhancement_description}}. Its primary goal is to serve as the guiding architectural blueprint for AI-driven development of new features while ensuring seamless integration with the existing system. + + **Relationship to Existing Architecture:** + This document supplements existing project architecture by defining how new components will integrate with current systems. Where conflicts arise between new and existing patterns, this document provides guidance on maintaining consistency while implementing enhancements. + - id: existing-project-analysis + title: Existing Project Analysis + instruction: | + Analyze the existing project structure and architecture: + + 1. Review existing documentation in docs folder + 2. Examine current technology stack and versions + 3. Identify existing architectural patterns and conventions + 4. Note current deployment and infrastructure setup + 5. Document any constraints or limitations + + CRITICAL: After your analysis, explicitly validate your findings: "Based on my analysis of your project, I've identified the following about your existing system: [key findings]. Please confirm these observations are accurate before I proceed with architectural recommendations." + elicit: true + sections: + - id: current-state + title: Current Project State + template: | + - **Primary Purpose:** {{existing_project_purpose}} + - **Current Tech Stack:** {{existing_tech_summary}} + - **Architecture Style:** {{existing_architecture_style}} + - **Deployment Method:** {{existing_deployment_approach}} + - id: available-docs + title: Available Documentation + type: bullet-list + template: "- {{existing_docs_summary}}" + - id: constraints + title: Identified Constraints + type: bullet-list + template: "- {{constraint}}" + - id: changelog + title: Change Log + type: table + columns: [Change, Date, Version, Description, Author] + instruction: Track document versions and changes + + - id: enhancement-scope + title: Enhancement Scope and Integration Strategy + instruction: | + Define how the enhancement will integrate with the existing system: + + 1. Review the brownfield PRD enhancement scope + 2. Identify integration points with existing code + 3. Define boundaries between new and existing functionality + 4. Establish compatibility requirements + + VALIDATION CHECKPOINT: Before presenting the integration strategy, confirm: "Based on my analysis, the integration approach I'm proposing takes into account [specific existing system characteristics]. These integration points and boundaries respect your current architecture patterns. Is this assessment accurate?" + elicit: true + sections: + - id: enhancement-overview + title: Enhancement Overview + template: | + **Enhancement Type:** {{enhancement_type}} + **Scope:** {{enhancement_scope}} + **Integration Impact:** {{integration_impact_level}} + - id: integration-approach + title: Integration Approach + template: | + **Code Integration Strategy:** {{code_integration_approach}} + **Database Integration:** {{database_integration_approach}} + **API Integration:** {{api_integration_approach}} + **UI Integration:** {{ui_integration_approach}} + - id: compatibility-requirements + title: Compatibility Requirements + template: | + - **Existing API Compatibility:** {{api_compatibility}} + - **Database Schema Compatibility:** {{db_compatibility}} + - **UI/UX Consistency:** {{ui_compatibility}} + - **Performance Impact:** {{performance_constraints}} + + - id: tech-stack-alignment + title: Tech Stack Alignment + instruction: | + Ensure new components align with existing technology choices: + + 1. Use existing technology stack as the foundation + 2. Only introduce new technologies if absolutely necessary + 3. Justify any new additions with clear rationale + 4. Ensure version compatibility with existing dependencies + elicit: true + sections: + - id: existing-stack + title: Existing Technology Stack + type: table + columns: [Category, Current Technology, Version, Usage in Enhancement, Notes] + instruction: Document the current stack that must be maintained or integrated with + - id: new-tech-additions + title: New Technology Additions + condition: Enhancement requires new technologies + type: table + columns: [Technology, Version, Purpose, Rationale, Integration Method] + instruction: Only include if new technologies are required for the enhancement + + - id: data-models + title: Data Models and Schema Changes + instruction: | + Define new data models and how they integrate with existing schema: + + 1. Identify new entities required for the enhancement + 2. Define relationships with existing data models + 3. Plan database schema changes (additions, modifications) + 4. Ensure backward compatibility + elicit: true + sections: + - id: new-models + title: New Data Models + repeatable: true + sections: + - id: model + title: "{{model_name}}" + template: | + **Purpose:** {{model_purpose}} + **Integration:** {{integration_with_existing}} + + **Key Attributes:** + - {{attribute_1}}: {{type_1}} - {{description_1}} + - {{attribute_2}}: {{type_2}} - {{description_2}} + + **Relationships:** + - **With Existing:** {{existing_relationships}} + - **With New:** {{new_relationships}} + - id: schema-integration + title: Schema Integration Strategy + template: | + **Database Changes Required:** + - **New Tables:** {{new_tables_list}} + - **Modified Tables:** {{modified_tables_list}} + - **New Indexes:** {{new_indexes_list}} + - **Migration Strategy:** {{migration_approach}} + + **Backward Compatibility:** + - {{compatibility_measure_1}} + - {{compatibility_measure_2}} + + - id: component-architecture + title: Component Architecture + instruction: | + Define new components and their integration with existing architecture: + + 1. Identify new components required for the enhancement + 2. Define interfaces with existing components + 3. Establish clear boundaries and responsibilities + 4. Plan integration points and data flow + + MANDATORY VALIDATION: Before presenting component architecture, confirm: "The new components I'm proposing follow the existing architectural patterns I identified in your codebase: [specific patterns]. The integration interfaces respect your current component structure and communication patterns. Does this match your project's reality?" + elicit: true + sections: + - id: new-components + title: New Components + repeatable: true + sections: + - id: component + title: "{{component_name}}" + template: | + **Responsibility:** {{component_description}} + **Integration Points:** {{integration_points}} + + **Key Interfaces:** + - {{interface_1}} + - {{interface_2}} + + **Dependencies:** + - **Existing Components:** {{existing_dependencies}} + - **New Components:** {{new_dependencies}} + + **Technology Stack:** {{component_tech_details}} + - id: interaction-diagram + title: Component Interaction Diagram + type: mermaid + mermaid_type: graph + instruction: Create Mermaid diagram showing how new components interact with existing ones + + - id: api-design + title: API Design and Integration + condition: Enhancement requires API changes + instruction: | + Define new API endpoints and integration with existing APIs: + + 1. Plan new API endpoints required for the enhancement + 2. Ensure consistency with existing API patterns + 3. Define authentication and authorization integration + 4. Plan versioning strategy if needed + elicit: true + sections: + - id: api-strategy + title: API Integration Strategy + template: | + **API Integration Strategy:** {{api_integration_strategy}} + **Authentication:** {{auth_integration}} + **Versioning:** {{versioning_approach}} + - id: new-endpoints + title: New API Endpoints + repeatable: true + sections: + - id: endpoint + title: "{{endpoint_name}}" + template: | + - **Method:** {{http_method}} + - **Endpoint:** {{endpoint_path}} + - **Purpose:** {{endpoint_purpose}} + - **Integration:** {{integration_with_existing}} + sections: + - id: request + title: Request + type: code + language: json + template: "{{request_schema}}" + - id: response + title: Response + type: code + language: json + template: "{{response_schema}}" + + - id: external-api-integration + title: External API Integration + condition: Enhancement requires new external APIs + instruction: Document new external API integrations required for the enhancement + repeatable: true + sections: + - id: external-api + title: "{{api_name}} API" + template: | + - **Purpose:** {{api_purpose}} + - **Documentation:** {{api_docs_url}} + - **Base URL:** {{api_base_url}} + - **Authentication:** {{auth_method}} + - **Integration Method:** {{integration_approach}} + + **Key Endpoints Used:** + - `{{method}} {{endpoint_path}}` - {{endpoint_purpose}} + + **Error Handling:** {{error_handling_strategy}} + + - id: source-tree-integration + title: Source Tree Integration + instruction: | + Define how new code will integrate with existing project structure: + + 1. Follow existing project organization patterns + 2. Identify where new files/folders will be placed + 3. Ensure consistency with existing naming conventions + 4. Plan for minimal disruption to existing structure + elicit: true + sections: + - id: existing-structure + title: Existing Project Structure + type: code + language: plaintext + instruction: Document relevant parts of current structure + template: "{{existing_structure_relevant_parts}}" + - id: new-file-organization + title: New File Organization + type: code + language: plaintext + instruction: Show only new additions to existing structure + template: | + {{project-root}}/ + ├── {{existing_structure_context}} + │ ├── {{new_folder_1}}/ # {{purpose_1}} + │ │ ├── {{new_file_1}} + │ │ └── {{new_file_2}} + │ ├── {{existing_folder}}/ # Existing folder with additions + │ │ ├── {{existing_file}} # Existing file + │ │ └── {{new_file_3}} # New addition + │ └── {{new_folder_2}}/ # {{purpose_2}} + - id: integration-guidelines + title: Integration Guidelines + template: | + - **File Naming:** {{file_naming_consistency}} + - **Folder Organization:** {{folder_organization_approach}} + - **Import/Export Patterns:** {{import_export_consistency}} + + - id: infrastructure-deployment + title: Infrastructure and Deployment Integration + instruction: | + Define how the enhancement will be deployed alongside existing infrastructure: + + 1. Use existing deployment pipeline and infrastructure + 2. Identify any infrastructure changes needed + 3. Plan deployment strategy to minimize risk + 4. Define rollback procedures + elicit: true + sections: + - id: existing-infrastructure + title: Existing Infrastructure + template: | + **Current Deployment:** {{existing_deployment_summary}} + **Infrastructure Tools:** {{existing_infrastructure_tools}} + **Environments:** {{existing_environments}} + - id: enhancement-deployment + title: Enhancement Deployment Strategy + template: | + **Deployment Approach:** {{deployment_approach}} + **Infrastructure Changes:** {{infrastructure_changes}} + **Pipeline Integration:** {{pipeline_integration}} + - id: rollback-strategy + title: Rollback Strategy + template: | + **Rollback Method:** {{rollback_method}} + **Risk Mitigation:** {{risk_mitigation}} + **Monitoring:** {{monitoring_approach}} + + - id: coding-standards + title: Coding Standards and Conventions + instruction: | + Ensure new code follows existing project conventions: + + 1. Document existing coding standards from project analysis + 2. Identify any enhancement-specific requirements + 3. Ensure consistency with existing codebase patterns + 4. Define standards for new code organization + elicit: true + sections: + - id: existing-standards + title: Existing Standards Compliance + template: | + **Code Style:** {{existing_code_style}} + **Linting Rules:** {{existing_linting}} + **Testing Patterns:** {{existing_test_patterns}} + **Documentation Style:** {{existing_doc_style}} + - id: enhancement-standards + title: Enhancement-Specific Standards + condition: New patterns needed for enhancement + repeatable: true + template: "- **{{standard_name}}:** {{standard_description}}" + - id: integration-rules + title: Critical Integration Rules + template: | + - **Existing API Compatibility:** {{api_compatibility_rule}} + - **Database Integration:** {{db_integration_rule}} + - **Error Handling:** {{error_handling_integration}} + - **Logging Consistency:** {{logging_consistency}} + + - id: testing-strategy + title: Testing Strategy + instruction: | + Define testing approach for the enhancement: + + 1. Integrate with existing test suite + 2. Ensure existing functionality remains intact + 3. Plan for testing new features + 4. Define integration testing approach + elicit: true + sections: + - id: existing-test-integration + title: Integration with Existing Tests + template: | + **Existing Test Framework:** {{existing_test_framework}} + **Test Organization:** {{existing_test_organization}} + **Coverage Requirements:** {{existing_coverage_requirements}} + - id: new-testing + title: New Testing Requirements + sections: + - id: unit-tests + title: Unit Tests for New Components + template: | + - **Framework:** {{test_framework}} + - **Location:** {{test_location}} + - **Coverage Target:** {{coverage_target}} + - **Integration with Existing:** {{test_integration}} + - id: integration-tests + title: Integration Tests + template: | + - **Scope:** {{integration_test_scope}} + - **Existing System Verification:** {{existing_system_verification}} + - **New Feature Testing:** {{new_feature_testing}} + - id: regression-tests + title: Regression Testing + template: | + - **Existing Feature Verification:** {{regression_test_approach}} + - **Automated Regression Suite:** {{automated_regression}} + - **Manual Testing Requirements:** {{manual_testing_requirements}} + + - id: security-integration + title: Security Integration + instruction: | + Ensure security consistency with existing system: + + 1. Follow existing security patterns and tools + 2. Ensure new features don't introduce vulnerabilities + 3. Maintain existing security posture + 4. Define security testing for new components + elicit: true + sections: + - id: existing-security + title: Existing Security Measures + template: | + **Authentication:** {{existing_auth}} + **Authorization:** {{existing_authz}} + **Data Protection:** {{existing_data_protection}} + **Security Tools:** {{existing_security_tools}} + - id: enhancement-security + title: Enhancement Security Requirements + template: | + **New Security Measures:** {{new_security_measures}} + **Integration Points:** {{security_integration_points}} + **Compliance Requirements:** {{compliance_requirements}} + - id: security-testing + title: Security Testing + template: | + **Existing Security Tests:** {{existing_security_tests}} + **New Security Test Requirements:** {{new_security_tests}} + **Penetration Testing:** {{pentest_requirements}} + + - id: checklist-results + title: Checklist Results Report + instruction: Execute the architect-checklist and populate results here, focusing on brownfield-specific validation + + - id: next-steps + title: Next Steps + instruction: | + After completing the brownfield architecture: + + 1. Review integration points with existing system + 2. Begin story implementation with Dev agent + 3. Set up deployment pipeline integration + 4. Plan rollback and monitoring procedures + sections: + - id: story-manager-handoff + title: Story Manager Handoff + instruction: | + Create a brief prompt for Story Manager to work with this brownfield enhancement. Include: + - Reference to this architecture document + - Key integration requirements validated with user + - Existing system constraints based on actual project analysis + - First story to implement with clear integration checkpoints + - Emphasis on maintaining existing system integrity throughout implementation + - id: developer-handoff + title: Developer Handoff + instruction: | + Create a brief prompt for developers starting implementation. Include: + - Reference to this architecture and existing coding standards analyzed from actual project + - Integration requirements with existing codebase validated with user + - Key technical decisions based on real project constraints + - Existing system compatibility requirements with specific verification steps + - Clear sequencing of implementation to minimize risk to existing functionality +==================== END: .bmad-core/templates/brownfield-architecture-tmpl.yaml ==================== ==================== START: .bmad-core/checklists/architect-checklist.md ==================== # Architect Solution Validation Checklist @@ -9000,66 +8745,145 @@ Provide a structured validation report including: - **Confidence Level**: High/Medium/Low for successful implementation ==================== END: .bmad-core/tasks/validate-next-story.md ==================== -==================== START: .bmad-core/templates/story-tmpl.md ==================== ---- -defaultOutput: docs/stories/{{EpicNum}}.{{StoryNum}}.{{Short Title Copied from Epic File specific story}}.md -smAgent: - editableSections: Status, Story, Acceptance Criteria, Tasks / Subtasks, Dev Notes, Testing, Change Log - sectionSpecificInstructions: - "Dev Notes": - - Populate relevant information, only what was pulled from actual artifacts from docs folder, relevant to this story - - Do not invent information. - - If known add Relevant Source Tree info that relates to this story. - - If there were important notes from previous story that are relevant to this one, include them here. - - Put enough information in this section so that the dev agent should NEVER need to read the architecture documents, these notes along with the tasks and subtasks must give the Dev Agent the complete context it needs to comprehend with the least amount of overhead the information to complete the story, meeting all AC and completing all tasks+subtasks. - Testing: - - List Relevant Testing Standards from Architecture the Developer needs to conform to (test file location, test standards, etc) ---- +==================== START: .bmad-core/templates/story-tmpl.yaml ==================== +template: + id: story-template-v2 + name: Story Document + version: 2.0 + output: + format: markdown + filename: docs/stories/{{epic_num}}.{{story_num}}.{{story_title_short}}.md + title: "Story {{epic_num}}.{{story_num}}: {{story_title_short}}" -# Story {{EpicNum}}.{{StoryNum}}: {{Short Title Copied from Epic File specific story}} +workflow: + mode: interactive + elicitation: advanced-elicitation -## Status: {{ Draft | Approved | InProgress | Review | Done }} +agent_config: + editable_sections: + - Status + - Story + - Acceptance Criteria + - Tasks / Subtasks + - Dev Notes + - Testing + - Change Log -## Story - -**As a** {{role}},\ -**I want** {{action}},\ -**so that** {{benefit}} - -## Acceptance Criteria - -{{ Copy of Acceptance Criteria numbered list }} - -## Tasks / Subtasks - -- [ ] Task 1 (AC: # if applicable) - - [ ] Subtask1.1... -- [ ] Task 2 (AC: # if applicable) - - [ ] Subtask 2.1... -- [ ] Task 3 (AC: # if applicable) - - [ ] Subtask 3.1... - -## Dev Notes - -### Testing - -## Change Log - -| Date | Version | Description | Author | -| :--- | :------ | :---------- | :----- | - -## Dev Agent Record - -### Agent Model Used: {{Agent Model Name/Version}} - -### Debug Log References - -### Completion Notes List - -### File List - -## QA Results -==================== END: .bmad-core/templates/story-tmpl.md ==================== +sections: + - id: status + title: Status + type: choice + choices: [Draft, Approved, InProgress, Review, Done] + instruction: Select the current status of the story + owner: scrum-master + editors: [scrum-master, dev-agent] + + - id: story + title: Story + type: template-text + template: | + **As a** {{role}}, + **I want** {{action}}, + **so that** {{benefit}} + instruction: Define the user story using the standard format with role, action, and benefit + elicit: true + owner: scrum-master + editors: [scrum-master] + + - id: acceptance-criteria + title: Acceptance Criteria + type: numbered-list + instruction: Copy the acceptance criteria numbered list from the epic file + elicit: true + owner: scrum-master + editors: [scrum-master] + + - id: tasks-subtasks + title: Tasks / Subtasks + type: bullet-list + instruction: | + Break down the story into specific tasks and subtasks needed for implementation. + Reference applicable acceptance criteria numbers where relevant. + template: | + - [ ] Task 1 (AC: # if applicable) + - [ ] Subtask1.1... + - [ ] Task 2 (AC: # if applicable) + - [ ] Subtask 2.1... + - [ ] Task 3 (AC: # if applicable) + - [ ] Subtask 3.1... + elicit: true + owner: scrum-master + editors: [scrum-master, dev-agent] + + - id: dev-notes + title: Dev Notes + instruction: | + Populate relevant information, only what was pulled from actual artifacts from docs folder, relevant to this story: + - Do not invent information + - If known add Relevant Source Tree info that relates to this story + - If there were important notes from previous story that are relevant to this one, include them here + - Put enough information in this section so that the dev agent should NEVER need to read the architecture documents, these notes along with the tasks and subtasks must give the Dev Agent the complete context it needs to comprehend with the least amount of overhead the information to complete the story, meeting all AC and completing all tasks+subtasks + elicit: true + owner: scrum-master + editors: [scrum-master] + sections: + - id: testing-standards + title: Testing + instruction: | + List Relevant Testing Standards from Architecture the Developer needs to conform to: + - Test file location + - Test standards + - Testing frameworks and patterns to use + - Any specific testing requirements for this story + elicit: true + owner: scrum-master + editors: [scrum-master] + + - id: change-log + title: Change Log + type: table + columns: [Date, Version, Description, Author] + instruction: Track changes made to this story document + owner: scrum-master + editors: [scrum-master, dev-agent, qa-agent] + + - id: dev-agent-record + title: Dev Agent Record + instruction: This section is populated by the development agent during implementation + owner: dev-agent + editors: [dev-agent] + sections: + - id: agent-model + title: Agent Model Used + template: "{{agent_model_name_version}}" + instruction: Record the specific AI agent model and version used for development + owner: dev-agent + editors: [dev-agent] + + - id: debug-log-references + title: Debug Log References + instruction: Reference any debug logs or traces generated during development + owner: dev-agent + editors: [dev-agent] + + - id: completion-notes + title: Completion Notes List + instruction: Notes about the completion of tasks and any issues encountered + owner: dev-agent + editors: [dev-agent] + + - id: file-list + title: File List + instruction: List all files created, modified, or affected during story implementation + owner: dev-agent + editors: [dev-agent] + + - id: qa-results + title: QA Results + instruction: Results from QA Agent QA review of the completed story implementation + owner: qa-agent + editors: [qa-agent] +==================== END: .bmad-core/templates/story-tmpl.yaml ==================== ==================== START: .bmad-core/checklists/po-master-checklist.md ==================== # Product Owner (PO) Master Validation Checklist diff --git a/expansion-packs/bmad-2d-phaser-game-dev/agent-teams/phaser-2d-nodejs-game-team.yaml b/expansion-packs/bmad-2d-phaser-game-dev/agent-teams/phaser-2d-nodejs-game-team.yaml index c0a636df..6cbae16d 100644 --- a/expansion-packs/bmad-2d-phaser-game-dev/agent-teams/phaser-2d-nodejs-game-team.yaml +++ b/expansion-packs/bmad-2d-phaser-game-dev/agent-teams/phaser-2d-nodejs-game-team.yaml @@ -9,5 +9,5 @@ agents: - game-developer - game-sm workflows: - - game-dev-greenfield - - game-prototype + - game-dev-greenfield.md + - game-prototype.md diff --git a/expansion-packs/bmad-2d-phaser-game-dev/agents/game-designer.md b/expansion-packs/bmad-2d-phaser-game-dev/agents/game-designer.md index 072a6ee5..55e1c97a 100644 --- a/expansion-packs/bmad-2d-phaser-game-dev/agents/game-designer.md +++ b/expansion-packs/bmad-2d-phaser-game-dev/agents/game-designer.md @@ -6,7 +6,6 @@ CRITICAL: Read the full YAML, start activation to alter your state of being, fol root: .bmad-2d-phaser-game-dev IDE-FILE-RESOLUTION: Dependencies map to files as {root}/{type}/{name} where root=".bmad-core", type=folder (tasks/templates/checklists/utils), name=dependency name. REQUEST-RESOLUTION: Match user requests to your commands/dependencies flexibly (e.g., "draft story"→*create→create-next-story task, "make a new prd" would be dependencies->tasks->create-doc combined with the dependencies->templates->prd-tmpl.md), or ask for clarification if ambiguous. -activation-instructions: activation-instructions: - Follow all instructions in this file -> this defines you, your persona and more importantly what you can do. STAY IN CHARACTER! - Only read the files/tasks listed here when user selects them for execution to minimize context usage diff --git a/tools/builders/web-builder.js b/tools/builders/web-builder.js index 51d8a6ce..dc6af2be 100644 --- a/tools/builders/web-builder.js +++ b/tools/builders/web-builder.js @@ -211,6 +211,7 @@ These references map directly to bundle sections: parsed["activation-instructions"] = parsed["activation-instructions"].filter( (instruction) => { return ( + typeof instruction === 'string' && !instruction.startsWith("IDE-FILE-RESOLUTION:") && !instruction.startsWith("REQUEST-RESOLUTION:") ); @@ -393,67 +394,57 @@ These references map directly to bundle sections: if (Array.isArray(resources)) { for (const resourceName of resources) { let found = false; - const extensions = [".md", ".yaml"]; // Try expansion pack first - for (const ext of extensions) { - const resourcePath = path.join(packDir, resourceType, `${resourceName}${ext}`); - try { - const resourceContent = await fs.readFile(resourcePath, "utf8"); - const resourceWebPath = this.convertToWebPath(resourcePath, packName); - sections.push( - this.formatSection(resourceWebPath, resourceContent, packName) - ); - found = true; - break; - } catch (error) { - // Not in expansion pack, continue - } + const resourcePath = path.join(packDir, resourceType, resourceName); + try { + const resourceContent = await fs.readFile(resourcePath, "utf8"); + const resourceWebPath = this.convertToWebPath(resourcePath, packName); + sections.push( + this.formatSection(resourceWebPath, resourceContent, packName) + ); + found = true; + } catch (error) { + // Not in expansion pack, continue } // If not found in expansion pack, try core if (!found) { - for (const ext of extensions) { - const corePath = path.join( - this.rootDir, - "bmad-core", - resourceType, - `${resourceName}${ext}` + const corePath = path.join( + this.rootDir, + "bmad-core", + resourceType, + resourceName + ); + try { + const coreContent = await fs.readFile(corePath, "utf8"); + const coreWebPath = this.convertToWebPath(corePath, packName); + sections.push( + this.formatSection(coreWebPath, coreContent, packName) ); - try { - const coreContent = await fs.readFile(corePath, "utf8"); - const coreWebPath = this.convertToWebPath(corePath, packName); - sections.push( - this.formatSection(coreWebPath, coreContent, packName) - ); - found = true; - break; - } catch (error) { - // Not in core either, continue - } + found = true; + } catch (error) { + // Not in core either, continue } } // If not found in core, try common folder if (!found) { - for (const ext of extensions) { - const commonPath = path.join( - this.rootDir, - "common", - resourceType, - `${resourceName}${ext}` + const commonPath = path.join( + this.rootDir, + "common", + resourceType, + resourceName + ); + try { + const commonContent = await fs.readFile(commonPath, "utf8"); + const commonWebPath = this.convertToWebPath(commonPath, packName); + sections.push( + this.formatSection(commonWebPath, commonContent, packName) ); - try { - const commonContent = await fs.readFile(commonPath, "utf8"); - const commonWebPath = this.convertToWebPath(commonPath, packName); - sections.push( - this.formatSection(commonWebPath, commonContent, packName) - ); - found = true; - break; - } catch (error) { - // Not in common either, continue - } + found = true; + } catch (error) { + // Not in common either, continue } } @@ -509,8 +500,7 @@ These references map directly to bundle sections: for (const resourceFile of resourceFiles.filter( (f) => f.endsWith(".md") || f.endsWith(".yaml") )) { - const fileName = resourceFile.replace(/\.(md|yaml)$/, ""); - expansionResources.set(`${resourceDir}#${fileName}`, true); + expansionResources.set(`${resourceDir}#${resourceFile}`, true); } } catch (error) { // Directory might not exist, that's fine @@ -597,55 +587,45 @@ These references map directly to bundle sections: // Always prefer expansion pack versions if they exist for (const [key, dep] of allDependencies) { let found = false; - const extensions = [".md", ".yaml"]; // Always check expansion pack first, even if the dependency came from a core agent if (expansionResources.has(key)) { // We know it exists in expansion pack, find and load it - for (const ext of extensions) { - const expansionPath = path.join(packDir, dep.type, `${dep.name}${ext}`); - try { - const content = await fs.readFile(expansionPath, "utf8"); - const expansionWebPath = this.convertToWebPath(expansionPath, packName); - sections.push(this.formatSection(expansionWebPath, content, packName)); - console.log(` ✓ Using expansion override for ${key}`); - found = true; - break; - } catch (error) { - // Try next extension - } + const expansionPath = path.join(packDir, dep.type, dep.name); + try { + const content = await fs.readFile(expansionPath, "utf8"); + const expansionWebPath = this.convertToWebPath(expansionPath, packName); + sections.push(this.formatSection(expansionWebPath, content, packName)); + console.log(` ✓ Using expansion override for ${key}`); + found = true; + } catch (error) { + // Try next extension } } // If not found in expansion pack (or doesn't exist there), try core if (!found) { - for (const ext of extensions) { - const corePath = path.join(this.rootDir, "bmad-core", dep.type, `${dep.name}${ext}`); - try { - const content = await fs.readFile(corePath, "utf8"); - const coreWebPath = this.convertToWebPath(corePath, packName); - sections.push(this.formatSection(coreWebPath, content, packName)); - found = true; - break; - } catch (error) { - // Not in core either, continue - } + const corePath = path.join(this.rootDir, "bmad-core", dep.type, dep.name); + try { + const content = await fs.readFile(corePath, "utf8"); + const coreWebPath = this.convertToWebPath(corePath, packName); + sections.push(this.formatSection(coreWebPath, content, packName)); + found = true; + } catch (error) { + // Not in core either, continue } } // If not found in core, try common folder if (!found) { - for (const ext of extensions) { - const commonPath = path.join(this.rootDir, "common", dep.type, `${dep.name}${ext}`); - try { - const content = await fs.readFile(commonPath, "utf8"); - const commonWebPath = this.convertToWebPath(commonPath, packName); - sections.push(this.formatSection(commonWebPath, content, packName)); - found = true; - break; - } catch (error) { - // Not in common either, continue - } + const commonPath = path.join(this.rootDir, "common", dep.type, dep.name); + try { + const content = await fs.readFile(commonPath, "utf8"); + const commonWebPath = this.convertToWebPath(commonPath, packName); + sections.push(this.formatSection(commonWebPath, content, packName)); + found = true; + } catch (error) { + // Not in common either, continue } } diff --git a/tools/lib/dependency-resolver.js b/tools/lib/dependency-resolver.js index 4f8b5430..decab6b1 100644 --- a/tools/lib/dependency-resolver.js +++ b/tools/lib/dependency-resolver.js @@ -116,31 +116,20 @@ class DependencyResolver { } try { - const extensions = ['.md', '.yaml']; let content = null; let filePath = null; // First try bmad-core - for (const ext of extensions) { + try { + filePath = path.join(this.bmadCore, type, id); + content = await fs.readFile(filePath, 'utf8'); + } catch (e) { + // If not found in bmad-core, try common folder try { - filePath = path.join(this.bmadCore, type, `${id}${ext}`); + filePath = path.join(this.common, type, id); content = await fs.readFile(filePath, 'utf8'); - break; - } catch (e) { - // Try next extension - } - } - - // If not found in bmad-core, try common folder - if (!content) { - for (const ext of extensions) { - try { - filePath = path.join(this.common, type, `${id}${ext}`); - content = await fs.readFile(filePath, 'utf8'); - break; - } catch (e) { - // Try next extension - } + } catch (e2) { + // File not found in either location } }