bmad-method 4.13.0 → 4.14.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/GUIDING-PRINCIPLES.md +0 -33
  3. package/README.md +3 -2
  4. package/bmad-core/agents/analyst.md +3 -1
  5. package/bmad-core/agents/dev.md +3 -2
  6. package/bmad-core/agents/qa.md +15 -14
  7. package/bmad-core/data/bmad-kb.md +280 -19
  8. package/bmad-core/tasks/document-project.md +250 -322
  9. package/bmad-core/tasks/review-story.md +135 -0
  10. package/bmad-core/templates/story-tmpl.md +8 -0
  11. package/bmad-core/workflows/brownfield-fullstack.yml +36 -1
  12. package/bmad-core/workflows/brownfield-service.yml +36 -1
  13. package/bmad-core/workflows/brownfield-ui.yml +36 -1
  14. package/bmad-core/workflows/greenfield-fullstack.yml +36 -1
  15. package/bmad-core/workflows/greenfield-service.yml +36 -1
  16. package/bmad-core/workflows/greenfield-ui.yml +36 -1
  17. package/dist/agents/analyst.txt +603 -20
  18. package/dist/agents/architect.txt +230 -302
  19. package/dist/agents/bmad-master.txt +543 -328
  20. package/dist/agents/bmad-orchestrator.txt +280 -19
  21. package/dist/agents/dev.txt +6 -4
  22. package/dist/agents/pm.txt +25 -7
  23. package/dist/agents/po.txt +33 -7
  24. package/dist/agents/qa.txt +153 -14
  25. package/dist/agents/sm.txt +8 -0
  26. package/dist/expansion-packs/bmad-2d-phaser-game-dev/teams/phaser-2d-nodejs-game-team.txt +323 -1
  27. package/dist/expansion-packs/expansion-creator/agents/bmad-the-creator.txt +4 -12
  28. package/dist/teams/team-all.txt +1011 -443
  29. package/dist/teams/team-fullstack.txt +852 -425
  30. package/dist/teams/team-ide-minimal.txt +472 -44
  31. package/dist/teams/team-no-ui.txt +708 -421
  32. package/docs/working-in-the-brownfield.md +362 -0
  33. package/package.json +1 -1
  34. package/tools/installer/package.json +1 -1
@@ -54,7 +54,7 @@ agent:
54
54
  id: analyst
55
55
  title: Business Analyst
56
56
  icon: 📊
57
- whenToUse: Use for market research, brainstorming, competitive analysis, creating project briefs, and initial project discovery
57
+ whenToUse: Use for market research, brainstorming, competitive analysis, creating project briefs, initial project discovery, and documenting existing projects (brownfield)
58
58
  customization: null
59
59
  persona:
60
60
  role: Insightful Analyst & Strategic Ideation Partner
@@ -82,6 +82,7 @@ commands:
82
82
  - brainstorm {topic}: Facilitate structured brainstorming session
83
83
  - research {topic}: Generate deep research prompt for investigation
84
84
  - elicit: Run advanced elicitation to clarify requirements
85
+ - document-project: Analyze and document existing project structure comprehensively
85
86
  - exit: Say goodbye as the Business Analyst, and then abandon inhabiting this persona
86
87
  dependencies:
87
88
  tasks:
@@ -89,6 +90,7 @@ dependencies:
89
90
  - create-deep-research-prompt
90
91
  - create-doc
91
92
  - advanced-elicitation
93
+ - document-project
92
94
  templates:
93
95
  - project-brief-tmpl
94
96
  - market-research-tmpl
@@ -817,6 +819,326 @@ Choose an action (0-9 - 9 to bypass - HELP for explanation of these options):
817
819
  [[LLM: Acknowledge the user's choice to finalize the current 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.]]
818
820
  ==================== END: tasks#advanced-elicitation ====================
819
821
 
822
+ ==================== START: tasks#document-project ====================
823
+ # Document an Existing Project
824
+
825
+ ## Purpose
826
+
827
+ Generate comprehensive documentation for existing projects optimized for AI development agents. This task creates structured reference materials that enable AI agents to understand project context, conventions, and patterns for effective contribution to any codebase.
828
+
829
+ ## Task Instructions
830
+
831
+ ### 1. Initial Project Analysis
832
+
833
+ [[LLM: First, check if a PRD or requirements document exists in context. If yes, use it to focus your documentation efforts on relevant areas only.
834
+
835
+ **IF PRD EXISTS**:
836
+
837
+ - Review the PRD to understand what enhancement/feature is planned
838
+ - Identify which modules, services, or areas will be affected
839
+ - Focus documentation ONLY on these relevant areas
840
+ - Skip unrelated parts of the codebase to keep docs lean
841
+
842
+ **IF NO PRD EXISTS**:
843
+ Ask the user:
844
+
845
+ "I notice you haven't provided a PRD or requirements document. To create more focused and useful documentation, I recommend one of these options:
846
+
847
+ 1. **Create a PRD first** - Would you like me to help create a brownfield PRD before documenting? This helps focus documentation on relevant areas.
848
+
849
+ 2. **Provide existing requirements** - Do you have a requirements document, epic, or feature description you can share?
850
+
851
+ 3. **Describe the focus** - Can you briefly describe what enhancement or feature you're planning? For example:
852
+ - 'Adding payment processing to the user service'
853
+ - 'Refactoring the authentication module'
854
+ - 'Integrating with a new third-party API'
855
+
856
+ 4. **Document everything** - Or should I proceed with comprehensive documentation of the entire codebase? (Note: This may create excessive documentation for large projects)
857
+
858
+ Please let me know your preference, or I can proceed with full documentation if you prefer."
859
+
860
+ Based on their response:
861
+
862
+ - If they choose option 1-3: Use that context to focus documentation
863
+ - If they choose option 4 or decline: Proceed with comprehensive analysis below
864
+
865
+ Begin by conducting analysis of the existing project. Use available tools to:
866
+
867
+ 1. **Project Structure Discovery**: Examine the root directory structure, identify main folders, and understand the overall organization
868
+ 2. **Technology Stack Identification**: Look for package.json, requirements.txt, Cargo.toml, pom.xml, etc. to identify languages, frameworks, and dependencies
869
+ 3. **Build System Analysis**: Find build scripts, CI/CD configurations, and development commands
870
+ 4. **Existing Documentation Review**: Check for README files, docs folders, and any existing documentation
871
+ 5. **Code Pattern Analysis**: Sample key files to understand coding patterns, naming conventions, and architectural approaches
872
+
873
+ Ask the user these elicitation questions to better understand their needs:
874
+
875
+ - What is the primary purpose of this project?
876
+ - Are there any specific areas of the codebase that are particularly complex or important for agents to understand?
877
+ - What types of tasks do you expect AI agents to perform on this project? (e.g., bug fixes, feature additions, refactoring, testing)
878
+ - Are there any existing documentation standards or formats you prefer?
879
+ - What level of technical detail should the documentation target? (junior developers, senior developers, mixed team)
880
+ - Is there a specific feature or enhancement you're planning? (This helps focus documentation)
881
+ ]]
882
+
883
+ ### 2. Deep Codebase Analysis
884
+
885
+ [[LLM: Before generating documentation, conduct extensive analysis of the existing codebase:
886
+
887
+ 1. **Explore Key Areas**:
888
+ - Entry points (main files, index files, app initializers)
889
+ - Configuration files and environment setup
890
+ - Package dependencies and versions
891
+ - Build and deployment configurations
892
+ - Test suites and coverage
893
+
894
+ 2. **Ask Clarifying Questions**:
895
+ - "I see you're using [technology X]. Are there any custom patterns or conventions I should document?"
896
+ - "What are the most critical/complex parts of this system that developers struggle with?"
897
+ - "Are there any undocumented 'tribal knowledge' areas I should capture?"
898
+ - "What technical debt or known issues should I document?"
899
+ - "Which parts of the codebase change most frequently?"
900
+
901
+ 3. **Map the Reality**:
902
+ - Identify ACTUAL patterns used (not theoretical best practices)
903
+ - Find where key business logic lives
904
+ - Locate integration points and external dependencies
905
+ - Document workarounds and technical debt
906
+ - Note areas that differ from standard patterns
907
+
908
+ **IF PRD PROVIDED**: Also analyze what would need to change for the enhancement]]
909
+
910
+ ### 3. Core Documentation Generation
911
+
912
+ [[LLM: Generate a comprehensive BROWNFIELD architecture document that reflects the ACTUAL state of the codebase.
913
+
914
+ **CRITICAL**: This is NOT an aspirational architecture document. Document what EXISTS, including:
915
+ - Technical debt and workarounds
916
+ - Inconsistent patterns between different parts
917
+ - Legacy code that can't be changed
918
+ - Integration constraints
919
+ - Performance bottlenecks
920
+
921
+ **Document Structure**:
922
+
923
+ # [Project Name] Brownfield Architecture Document
924
+
925
+ ## Introduction
926
+ This document captures the CURRENT STATE of the [Project Name] codebase, including technical debt, workarounds, and real-world patterns. It serves as a reference for AI agents working on enhancements.
927
+
928
+ ### Document Scope
929
+ [If PRD provided: "Focused on areas relevant to: {enhancement description}"]
930
+ [If no PRD: "Comprehensive documentation of entire system"]
931
+
932
+ ### Change Log
933
+ | Date | Version | Description | Author |
934
+ |------|---------|-------------|--------|
935
+ | [Date] | 1.0 | Initial brownfield analysis | [Analyst] |
936
+
937
+ ## Quick Reference - Key Files and Entry Points
938
+
939
+ ### Critical Files for Understanding the System
940
+ - **Main Entry**: `src/index.js` (or actual entry point)
941
+ - **Configuration**: `config/app.config.js`, `.env.example`
942
+ - **Core Business Logic**: `src/services/`, `src/domain/`
943
+ - **API Definitions**: `src/routes/` or link to OpenAPI spec
944
+ - **Database Models**: `src/models/` or link to schema files
945
+ - **Key Algorithms**: [List specific files with complex logic]
946
+
947
+ ### If PRD Provided - Enhancement Impact Areas
948
+ [Highlight which files/modules will be affected by the planned enhancement]
949
+
950
+ ## High Level Architecture
951
+
952
+ ### Technical Summary
953
+ [Real assessment of architecture - mention if it's well-structured or has issues]
954
+
955
+ ### Actual Tech Stack (from package.json/requirements.txt)
956
+ | Category | Technology | Version | Notes |
957
+ |----------|------------|---------|--------|
958
+ | Runtime | Node.js | 16.x | [Any constraints] |
959
+ | Framework | Express | 4.18.2 | [Custom middleware?] |
960
+ | Database | PostgreSQL | 13 | [Connection pooling setup] |
961
+ | [etc...] |
962
+
963
+ ### Repository Structure Reality Check
964
+ - Type: [Monorepo/Polyrepo/Hybrid]
965
+ - Package Manager: [npm/yarn/pnpm]
966
+ - Notable: [Any unusual structure decisions]
967
+
968
+ ## Source Tree and Module Organization
969
+
970
+ ### Project Structure (Actual)
971
+ ```
972
+ project-root/
973
+ ├── src/
974
+ │ ├── controllers/ # HTTP request handlers
975
+ │ ├── services/ # Business logic (NOTE: inconsistent patterns between user and payment services)
976
+ │ ├── models/ # Database models (Sequelize)
977
+ │ ├── utils/ # Mixed bag - needs refactoring
978
+ │ └── legacy/ # DO NOT MODIFY - old payment system still in use
979
+ ├── tests/ # Jest tests (60% coverage)
980
+ ├── scripts/ # Build and deployment scripts
981
+ └── config/ # Environment configs
982
+ ```
983
+
984
+ ### Key Modules and Their Purpose
985
+ - **User Management**: `src/services/userService.js` - Handles all user operations
986
+ - **Authentication**: `src/middleware/auth.js` - JWT-based, custom implementation
987
+ - **Payment Processing**: `src/legacy/payment.js` - CRITICAL: Do not refactor, tightly coupled
988
+ - **[List other key modules with their actual files]**
989
+
990
+ ## Data Models and APIs
991
+
992
+ ### Data Models
993
+ Instead of duplicating, reference actual model files:
994
+ - **User Model**: See `src/models/User.js`
995
+ - **Order Model**: See `src/models/Order.js`
996
+ - **Related Types**: TypeScript definitions in `src/types/`
997
+
998
+ ### API Specifications
999
+ - **OpenAPI Spec**: `docs/api/openapi.yaml` (if exists)
1000
+ - **Postman Collection**: `docs/api/postman-collection.json`
1001
+ - **Manual Endpoints**: [List any undocumented endpoints discovered]
1002
+
1003
+ ## Technical Debt and Known Issues
1004
+
1005
+ ### Critical Technical Debt
1006
+ 1. **Payment Service**: Legacy code in `src/legacy/payment.js` - tightly coupled, no tests
1007
+ 2. **User Service**: Different pattern than other services, uses callbacks instead of promises
1008
+ 3. **Database Migrations**: Manually tracked, no proper migration tool
1009
+ 4. **[Other significant debt]**
1010
+
1011
+ ### Workarounds and Gotchas
1012
+ - **Environment Variables**: Must set `NODE_ENV=production` even for staging (historical reason)
1013
+ - **Database Connections**: Connection pool hardcoded to 10, changing breaks payment service
1014
+ - **[Other workarounds developers need to know]**
1015
+
1016
+ ## Integration Points and External Dependencies
1017
+
1018
+ ### External Services
1019
+ | Service | Purpose | Integration Type | Key Files |
1020
+ |---------|---------|------------------|-----------|
1021
+ | Stripe | Payments | REST API | `src/integrations/stripe/` |
1022
+ | SendGrid | Emails | SDK | `src/services/emailService.js` |
1023
+ | [etc...] |
1024
+
1025
+ ### Internal Integration Points
1026
+ - **Frontend Communication**: REST API on port 3000, expects specific headers
1027
+ - **Background Jobs**: Redis queue, see `src/workers/`
1028
+ - **[Other integrations]**
1029
+
1030
+ ## Development and Deployment
1031
+
1032
+ ### Local Development Setup
1033
+ 1. Actual steps that work (not ideal steps)
1034
+ 2. Known issues with setup
1035
+ 3. Required environment variables (see `.env.example`)
1036
+
1037
+ ### Build and Deployment Process
1038
+ - **Build Command**: `npm run build` (webpack config in `webpack.config.js`)
1039
+ - **Deployment**: Manual deployment via `scripts/deploy.sh`
1040
+ - **Environments**: Dev, Staging, Prod (see `config/environments/`)
1041
+
1042
+ ## Testing Reality
1043
+
1044
+ ### Current Test Coverage
1045
+ - Unit Tests: 60% coverage (Jest)
1046
+ - Integration Tests: Minimal, in `tests/integration/`
1047
+ - E2E Tests: None
1048
+ - Manual Testing: Primary QA method
1049
+
1050
+ ### Running Tests
1051
+ ```bash
1052
+ npm test # Runs unit tests
1053
+ npm run test:integration # Runs integration tests (requires local DB)
1054
+ ```
1055
+
1056
+ ## If Enhancement PRD Provided - Impact Analysis
1057
+
1058
+ ### Files That Will Need Modification
1059
+ Based on the enhancement requirements, these files will be affected:
1060
+ - `src/services/userService.js` - Add new user fields
1061
+ - `src/models/User.js` - Update schema
1062
+ - `src/routes/userRoutes.js` - New endpoints
1063
+ - [etc...]
1064
+
1065
+ ### New Files/Modules Needed
1066
+ - `src/services/newFeatureService.js` - New business logic
1067
+ - `src/models/NewFeature.js` - New data model
1068
+ - [etc...]
1069
+
1070
+ ### Integration Considerations
1071
+ - Will need to integrate with existing auth middleware
1072
+ - Must follow existing response format in `src/utils/responseFormatter.js`
1073
+ - [Other integration points]
1074
+
1075
+ ## Appendix - Useful Commands and Scripts
1076
+
1077
+ ### Frequently Used Commands
1078
+ ```bash
1079
+ npm run dev # Start development server
1080
+ npm run build # Production build
1081
+ npm run migrate # Run database migrations
1082
+ npm run seed # Seed test data
1083
+ ```
1084
+
1085
+ ### Debugging and Troubleshooting
1086
+ - **Logs**: Check `logs/app.log` for application logs
1087
+ - **Debug Mode**: Set `DEBUG=app:*` for verbose logging
1088
+ - **Common Issues**: See `docs/troubleshooting.md`]]
1089
+
1090
+ ### 4. Document Delivery
1091
+
1092
+ [[LLM: After generating the complete architecture document:
1093
+
1094
+ 1. **In Web UI (Gemini, ChatGPT, Claude)**:
1095
+ - Present the entire document in one response (or multiple if too long)
1096
+ - Tell user to copy and save as `docs/brownfield-architecture.md` or `docs/project-architecture.md`
1097
+ - Mention it can be sharded later in IDE if needed
1098
+
1099
+ 2. **In IDE Environment**:
1100
+ - Create the document as `docs/brownfield-architecture.md`
1101
+ - Inform user this single document contains all architectural information
1102
+ - Can be sharded later using PO agent if desired
1103
+
1104
+ The document should be comprehensive enough that future agents can understand:
1105
+ - The actual state of the system (not idealized)
1106
+ - Where to find key files and logic
1107
+ - What technical debt exists
1108
+ - What constraints must be respected
1109
+ - If PRD provided: What needs to change for the enhancement]]
1110
+
1111
+ ### 5. Quality Assurance
1112
+
1113
+ [[LLM: Before finalizing the document:
1114
+
1115
+ 1. **Accuracy Check**: Verify all technical details match the actual codebase
1116
+ 2. **Completeness Review**: Ensure all major system components are documented
1117
+ 3. **Focus Validation**: If user provided scope, verify relevant areas are emphasized
1118
+ 4. **Clarity Assessment**: Check that explanations are clear for AI agents
1119
+ 5. **Navigation**: Ensure document has clear section structure for easy reference
1120
+
1121
+ Apply the advanced elicitation task after major sections to refine based on user feedback.]]
1122
+
1123
+ ## Success Criteria
1124
+
1125
+ - Single comprehensive brownfield architecture document created
1126
+ - Document reflects REALITY including technical debt and workarounds
1127
+ - Key files and modules are referenced with actual paths
1128
+ - Models/APIs reference source files rather than duplicating content
1129
+ - If PRD provided: Clear impact analysis showing what needs to change
1130
+ - Document enables AI agents to navigate and understand the actual codebase
1131
+ - Technical constraints and "gotchas" are clearly documented
1132
+
1133
+ ## Notes
1134
+
1135
+ - This task creates ONE document that captures the TRUE state of the system
1136
+ - References actual files rather than duplicating content when possible
1137
+ - Documents technical debt, workarounds, and constraints honestly
1138
+ - For brownfield projects with PRD: Provides clear enhancement impact analysis
1139
+ - The goal is PRACTICAL documentation for AI agents doing real work
1140
+ ==================== END: tasks#document-project ====================
1141
+
820
1142
  ==================== START: templates#project-brief-tmpl ====================
821
1143
  # Project Brief: {{Project Name}}
822
1144
 
@@ -1633,6 +1955,50 @@ BMAD-METHOD (Breakthrough Method of Agile AI-driven Development) is a framework
1633
1955
  - **Quality Assurance**: Structured testing and validation
1634
1956
  - **Documentation**: Professional PRDs, architecture docs, user stories
1635
1957
 
1958
+ ## How BMAD Works
1959
+
1960
+ ### The Core Method
1961
+
1962
+ BMAD transforms you into a "Vibe CEO" - directing a team of specialized AI agents through structured workflows. Here's how:
1963
+
1964
+ 1. **You Direct, AI Executes**: You provide vision and decisions; agents handle implementation details
1965
+ 2. **Specialized Agents**: Each agent masters one role (PM, Developer, Architect, etc.)
1966
+ 3. **Structured Workflows**: Proven patterns guide you from idea to deployed code
1967
+ 4. **Clean Handoffs**: Fresh context windows ensure agents stay focused and effective
1968
+
1969
+ ### The Two-Phase Approach
1970
+
1971
+ **Phase 1: Planning (Web UI - Cost Effective)**
1972
+ - Use large context windows (Gemini's 1M tokens)
1973
+ - Generate comprehensive documents (PRD, Architecture)
1974
+ - Leverage multiple agents for brainstorming
1975
+ - Create once, use throughout development
1976
+
1977
+ **Phase 2: Development (IDE - Implementation)**
1978
+ - Shard documents into manageable pieces
1979
+ - Execute focused SM → Dev cycles
1980
+ - One story at a time, sequential progress
1981
+ - Real-time file operations and testing
1982
+
1983
+ ### The Development Loop
1984
+
1985
+ ```text
1986
+ 1. SM Agent (New Chat) → Creates next story from sharded docs
1987
+ 2. You → Review and approve story
1988
+ 3. Dev Agent (New Chat) → Implements approved story
1989
+ 4. QA Agent (New Chat) → Reviews and refactors code
1990
+ 5. You → Verify completion
1991
+ 6. Repeat until epic complete
1992
+ ```
1993
+
1994
+ ### Why This Works
1995
+
1996
+ - **Context Optimization**: Clean chats = better AI performance
1997
+ - **Role Clarity**: Agents don't context-switch = higher quality
1998
+ - **Incremental Progress**: Small stories = manageable complexity
1999
+ - **Human Oversight**: You validate each step = quality control
2000
+ - **Document-Driven**: Specs guide everything = consistency
2001
+
1636
2002
  ## Getting Started
1637
2003
 
1638
2004
  ### Quick Start Options
@@ -1647,7 +2013,7 @@ BMAD-METHOD (Breakthrough Method of Agile AI-driven Development) is a framework
1647
2013
  5. Type `/help` to see available commands
1648
2014
 
1649
2015
  #### Option 2: IDE Integration
1650
- **Best for**: Cursor, Claude Code, Windsurf, VS Code users
2016
+ **Best for**: Cursor, Claude Code, Windsurf, Cline, Roo Code users
1651
2017
 
1652
2018
  ```bash
1653
2019
  # Interactive installation (recommended)
@@ -1656,13 +2022,22 @@ npx bmad-method install
1656
2022
 
1657
2023
  **Installation Steps**:
1658
2024
  - Choose "Complete installation"
1659
- - Select your IDE (Cursor, Claude Code, Windsurf, or Roo Code)
2025
+ - Select your IDE from supported options:
2026
+ - **Cursor**: Native AI integration
2027
+ - **Claude Code**: Anthropic's official IDE
2028
+ - **Windsurf**: Built-in AI capabilities
2029
+ - **Cline**: VS Code extension with AI features
2030
+ - **Roo Code**: Web-based IDE with agent support
2031
+
2032
+ **Note for VS Code Users**: BMAD-METHOD assumes when you mention "VS Code" that you're using it with an AI-powered extension like GitHub Copilot, Cline, or Roo. Standard VS Code without AI capabilities cannot run BMAD agents. The installer includes built-in support for Cline and Roo.
1660
2033
 
1661
2034
  **Verify Installation**:
1662
2035
  - `.bmad-core/` folder created with all agents
1663
2036
  - IDE-specific integration files created
1664
2037
  - All agent commands/rules/modes available
1665
2038
 
2039
+ **Remember**: At its core, BMAD-METHOD is about mastering and harnessing prompt engineering. Any IDE with AI agent support can use BMAD - the framework provides the structured prompts and workflows that make AI development effective
2040
+
1666
2041
  ### Environment Selection Guide
1667
2042
 
1668
2043
  **Use Web UI for**:
@@ -1679,6 +2054,47 @@ npx bmad-method install
1679
2054
 
1680
2055
  **Cost-Saving Tip**: Create large documents (PRDs, architecture) in web UI, then copy to `docs/prd.md` and `docs/architecture.md` in your project before switching to IDE for development.
1681
2056
 
2057
+ ### IDE-Only Workflow Considerations
2058
+
2059
+ **Can you do everything in IDE?** Yes, but understand the tradeoffs:
2060
+
2061
+ **Pros of IDE-Only**:
2062
+ - Single environment workflow
2063
+ - Direct file operations from start
2064
+ - No copy/paste between environments
2065
+ - Immediate project integration
2066
+
2067
+ **Cons of IDE-Only**:
2068
+ - Higher token costs for large document creation
2069
+ - Smaller context windows (varies by IDE/model)
2070
+ - May hit limits during planning phases
2071
+ - Less cost-effective for brainstorming
2072
+
2073
+ **Using Web Agents in IDE**:
2074
+ - **NOT RECOMMENDED**: Web agents (PM, Architect) have rich dependencies designed for large contexts
2075
+ - **Why it matters**: Dev agents are kept lean to maximize coding context
2076
+ - **The principle**: "Dev agents code, planning agents plan" - mixing breaks this optimization
2077
+
2078
+ **About bmad-master and bmad-orchestrator**:
2079
+ - **bmad-master**: CAN do any task without switching agents, BUT...
2080
+ - **Still use specialized agents for planning**: PM, Architect, and UX Expert have tuned personas that produce better results
2081
+ - **Why specialization matters**: Each agent's personality and focus creates higher quality outputs
2082
+ - **If using bmad-master/orchestrator**: Fine for planning phases, but...
2083
+
2084
+ **CRITICAL RULE for Development**:
2085
+ - **ALWAYS use SM agent for story creation** - Never use bmad-master/orchestrator
2086
+ - **ALWAYS use Dev agent for implementation** - Never use bmad-master/orchestrator
2087
+ - **Why this matters**: SM and Dev agents are specifically optimized for the development workflow
2088
+ - **No exceptions**: Even if using bmad-master for everything else, switch to SM → Dev for implementation
2089
+
2090
+ **Best Practice for IDE-Only**:
2091
+ 1. Use PM/Architect/UX agents for planning (better than bmad-master)
2092
+ 2. Create documents directly in project
2093
+ 3. Shard immediately after creation
2094
+ 4. **MUST switch to SM agent** for story creation
2095
+ 5. **MUST switch to Dev agent** for implementation
2096
+ 6. Keep planning and coding in separate chat sessions
2097
+
1682
2098
  ## Core Configuration (core-config.yml)
1683
2099
 
1684
2100
  **New in V4**: The `bmad-core/core-config.yml` file is a critical innovation that enables BMAD to work seamlessly with any project structure, providing maximum flexibility and backwards compatibility.
@@ -1919,10 +2335,16 @@ This architecture enables seamless operation across environments while maintaini
1919
2335
 
1920
2336
  ## Complete Development Workflow
1921
2337
 
1922
- ### Planning Phase (Web UI Recommended)
2338
+ ### Planning Phase (Web UI Recommended - Especially Gemini!)
2339
+
2340
+ **Ideal for cost efficiency with Gemini's massive context:**
1923
2341
 
1924
- **Ideal for cost efficiency, especially with Gemini:**
2342
+ **For Brownfield Projects - Start Here!**:
2343
+ 1. **Upload entire project to Gemini Web** (GitHub URL, files, or zip)
2344
+ 2. **Document existing system**: `/analyst` → `*document-project`
2345
+ 3. **Creates comprehensive docs** from entire codebase analysis
1925
2346
 
2347
+ **For All Projects**:
1926
2348
  1. **Optional Analysis**: `/analyst` - Market research, competitive analysis
1927
2349
  2. **Project Brief**: Create foundation document (Analyst or user)
1928
2350
  3. **PRD Creation**: `/pm create-doc prd` - Comprehensive product requirements
@@ -1956,10 +2378,14 @@ that can handle [specific requirements]."
1956
2378
 
1957
2379
  **Prerequisites**: Planning documents must exist in `docs/` folder
1958
2380
 
1959
- 1. **Document Sharding**:
1960
- - `@bmad-master` or `@po` shard `docs/prd.md` to `docs/prd/` folder
1961
- - If architecture exists, shard to `docs/architecture/` folder
1962
- - Results in multiple manageable documents and epic files
2381
+ 1. **Document Sharding** (CRITICAL STEP):
2382
+ - Documents created by PM/Architect (in Web or IDE) MUST be sharded for development
2383
+ - Two methods to shard:
2384
+ a) **Manual**: Drag `shard-doc` task + document file into chat
2385
+ b) **Agent**: Ask `@bmad-master` or `@po` to shard documents
2386
+ - Shards `docs/prd.md` → `docs/prd/` folder
2387
+ - Shards `docs/architecture.md` → `docs/architecture/` folder
2388
+ - **WARNING**: Do NOT shard in Web UI - copying many small files is painful!
1963
2389
 
1964
2390
  2. **Verify Sharded Content**:
1965
2391
  - At least one `epic-n.md` file in `docs/prd/` with stories in development order
@@ -1973,19 +2399,34 @@ that can handle [specific requirements]."
1973
2399
 
1974
2400
  3. **Development Cycle** (Sequential, one story at a time):
1975
2401
 
1976
- **Step 1 - Story Creation**: New chat window → `@sm` → `*create`
2402
+ **CRITICAL CONTEXT MANAGEMENT**:
2403
+ - **Context windows matter!** Always use fresh, clean context windows
2404
+ - **Model selection matters!** Use most powerful thinking model for SM story creation
2405
+ - **ALWAYS start new chat between SM, Dev, and QA work**
2406
+
2407
+ **Step 1 - Story Creation**:
2408
+ - **NEW CLEAN CHAT** → Select powerful model → `@sm` → `*create`
1977
2409
  - SM executes create-next-story task
1978
2410
  - Review generated story in `docs/stories/`
1979
2411
  - Update status from "Draft" to "Approved"
1980
2412
 
1981
- **Step 2 - Story Implementation**: New chat window → `@dev`
2413
+ **Step 2 - Story Implementation**:
2414
+ - **NEW CLEAN CHAT** → `@dev`
1982
2415
  - Agent asks which story to implement
1983
2416
  - Include story file content to save dev agent lookup time
1984
2417
  - Dev follows tasks/subtasks, marking completion
1985
- - Dev leaves notes for SM about any deviations
1986
- - Update status to "Done"
2418
+ - Dev maintains File List of all changes
2419
+ - Dev marks story as "Review" when complete with all tests passing
2420
+
2421
+ **Step 3 - Senior QA Review**:
2422
+ - **NEW CLEAN CHAT** → `@qa` → execute review-story task
2423
+ - QA performs senior developer code review
2424
+ - QA can refactor and improve code directly
2425
+ - QA appends results to story's QA Results section
2426
+ - If approved: Status → "Done"
2427
+ - If changes needed: Status stays "Review" with unchecked items for dev
1987
2428
 
1988
- **Step 3 - Repeat**: Continue SM → Dev cycle until all epic stories complete
2429
+ **Step 4 - Repeat**: Continue SM → Dev → QA cycle until all epic stories complete
1989
2430
 
1990
2431
  **Important**: Only 1 story in progress at a time, worked sequentially until all epic stories complete.
1991
2432
 
@@ -2005,12 +2446,72 @@ Each status change requires user verification and approval before proceeding.
2005
2446
  - Development execution
2006
2447
  - Testing and deployment
2007
2448
 
2008
- #### Brownfield Enhancement
2009
- - Current system analysis
2010
- - Enhancement planning
2011
- - Impact assessment
2012
- - Incremental development
2013
- - Integration testing
2449
+ #### Brownfield Enhancement (Existing Projects)
2450
+
2451
+ **Key Concept**: Brownfield development requires comprehensive documentation of your existing project for AI agents to understand context, patterns, and constraints.
2452
+
2453
+ **Complete Brownfield Workflow Options**:
2454
+
2455
+ **Option 1: PRD-First (Recommended for Large Codebases/Monorepos)**:
2456
+ 1. **Upload project to Gemini Web** (GitHub URL, files, or zip)
2457
+ 2. **Create PRD first**: `@pm` → `*create-doc brownfield-prd`
2458
+ 3. **Focused documentation**: `@analyst` → `*document-project`
2459
+ - Analyst asks for focus if no PRD provided
2460
+ - Choose "single document" format for Web UI
2461
+ - Uses PRD to document ONLY relevant areas
2462
+ - Creates one comprehensive markdown file
2463
+ - Avoids bloating docs with unused code
2464
+
2465
+ **Option 2: Document-First (Good for Smaller Projects)**:
2466
+ 1. **Upload project to Gemini Web**
2467
+ 2. **Document everything**: `@analyst` → `*document-project`
2468
+ 3. **Then create PRD**: `@pm` → `*create-doc brownfield-prd`
2469
+ - More thorough but can create excessive documentation
2470
+
2471
+ 2. **Requirements Gathering**:
2472
+ - **Brownfield PRD**: Use PM agent with `brownfield-prd-tmpl`
2473
+ - **Analyzes**: Existing system, constraints, integration points
2474
+ - **Defines**: Enhancement scope, compatibility requirements, risk assessment
2475
+ - **Creates**: Epic and story structure for changes
2476
+
2477
+ 3. **Architecture Planning**:
2478
+ - **Brownfield Architecture**: Use Architect agent with `brownfield-architecture-tmpl`
2479
+ - **Integration Strategy**: How new features integrate with existing system
2480
+ - **Migration Planning**: Gradual rollout and backwards compatibility
2481
+ - **Risk Mitigation**: Addressing potential breaking changes
2482
+
2483
+ **Brownfield-Specific Resources**:
2484
+
2485
+ **Templates**:
2486
+ - `brownfield-prd-tmpl.md`: Comprehensive enhancement planning with existing system analysis
2487
+ - `brownfield-architecture-tmpl.md`: Integration-focused architecture for existing systems
2488
+
2489
+ **Tasks**:
2490
+ - `document-project`: Generates comprehensive documentation from existing codebase
2491
+ - `brownfield-create-epic`: Creates single epic for focused enhancements (when full PRD is overkill)
2492
+ - `brownfield-create-story`: Creates individual story for small, isolated changes
2493
+
2494
+ **When to Use Each Approach**:
2495
+
2496
+ **Full Brownfield Workflow** (Recommended for):
2497
+ - Major feature additions
2498
+ - System modernization
2499
+ - Complex integrations
2500
+ - Multiple related changes
2501
+
2502
+ **Quick Epic/Story Creation** (Use when):
2503
+ - Single, focused enhancement
2504
+ - Isolated bug fixes
2505
+ - Small feature additions
2506
+ - Well-documented existing system
2507
+
2508
+ **Critical Success Factors**:
2509
+ 1. **Documentation First**: Always run `document-project` if docs are outdated/missing
2510
+ 2. **Context Matters**: Provide agents access to relevant code sections
2511
+ 3. **Integration Focus**: Emphasize compatibility and non-breaking changes
2512
+ 4. **Incremental Approach**: Plan for gradual rollout and testing
2513
+
2514
+ **For detailed guide**: See `docs/working-in-the-brownfield.md`
2014
2515
 
2015
2516
  ## Document Creation Best Practices
2016
2517
 
@@ -2091,12 +2592,94 @@ Use the `shard-doc` task or `@kayvan/markdown-tree-parser` tool for automatic sh
2091
2592
  - **Keep conversations focused** - One agent, one task per conversation
2092
2593
  - **Review everything** - Always review and approve before marking complete
2093
2594
 
2595
+ ## Contributing to BMAD-METHOD
2596
+
2597
+ ### Quick Contribution Guidelines
2598
+
2599
+ For full details, see `CONTRIBUTING.md`. Key points:
2600
+
2601
+ **Fork Workflow**:
2602
+ 1. Fork the repository
2603
+ 2. Create feature branches
2604
+ 3. Submit PRs to `next` branch (default) or `main` for critical fixes only
2605
+ 4. Keep PRs small: 200-400 lines ideal, 800 lines maximum
2606
+ 5. One feature/fix per PR
2607
+
2608
+ **PR Requirements**:
2609
+ - Clear descriptions (max 200 words) with What/Why/How/Testing
2610
+ - Use conventional commits (feat:, fix:, docs:)
2611
+ - Atomic commits - one logical change per commit
2612
+ - Must align with guiding principles
2613
+
2614
+ **Core Principles** (from GUIDING-PRINCIPLES.md):
2615
+ - **Dev Agents Must Be Lean**: Minimize dependencies, save context for code
2616
+ - **Natural Language First**: Everything in markdown, no code in core
2617
+ - **Core vs Expansion Packs**: Core for universal needs, packs for specialized domains
2618
+ - **Design Philosophy**: "Dev agents code, planning agents plan"
2619
+
2620
+ ## Expansion Packs
2621
+
2622
+ ### What Are Expansion Packs?
2623
+
2624
+ Expansion packs extend BMAD-METHOD beyond traditional software development into ANY domain. They provide specialized agent teams, templates, and workflows while keeping the core framework lean and focused on development.
2625
+
2626
+ ### Why Use Expansion Packs?
2627
+
2628
+ 1. **Keep Core Lean**: Dev agents maintain maximum context for coding
2629
+ 2. **Domain Expertise**: Deep, specialized knowledge without bloating core
2630
+ 3. **Community Innovation**: Anyone can create and share packs
2631
+ 4. **Modular Design**: Install only what you need
2632
+
2633
+ ### Available Expansion Packs
2634
+
2635
+ **Technical Packs**:
2636
+ - **Infrastructure/DevOps**: Cloud architects, SRE experts, security specialists
2637
+ - **Game Development**: Game designers, level designers, narrative writers
2638
+ - **Mobile Development**: iOS/Android specialists, mobile UX experts
2639
+ - **Data Science**: ML engineers, data scientists, visualization experts
2640
+
2641
+ **Non-Technical Packs**:
2642
+ - **Business Strategy**: Consultants, financial analysts, marketing strategists
2643
+ - **Creative Writing**: Plot architects, character developers, world builders
2644
+ - **Health & Wellness**: Fitness trainers, nutritionists, habit engineers
2645
+ - **Education**: Curriculum designers, assessment specialists
2646
+ - **Legal Support**: Contract analysts, compliance checkers
2647
+
2648
+ **Specialty Packs**:
2649
+ - **Expansion Creator**: Tools to build your own expansion packs
2650
+ - **RPG Game Master**: Tabletop gaming assistance
2651
+ - **Life Event Planning**: Wedding planners, event coordinators
2652
+ - **Scientific Research**: Literature reviewers, methodology designers
2653
+
2654
+ ### Using Expansion Packs
2655
+
2656
+ 1. **Browse Available Packs**: Check `expansion-packs/` directory
2657
+ 2. **Get Inspiration**: See `docs/expansion-pack-ideas.md` for detailed examples
2658
+ 3. **Install via CLI**:
2659
+ ```bash
2660
+ npx bmad-method install
2661
+ # Select "Install expansion pack" option
2662
+ ```
2663
+ 4. **Use in Your Workflow**: Installed packs integrate seamlessly with existing agents
2664
+
2665
+ ### Creating Custom Expansion Packs
2666
+
2667
+ Use the **expansion-creator** pack to build your own:
2668
+
2669
+ 1. **Define Domain**: What expertise are you capturing?
2670
+ 2. **Design Agents**: Create specialized roles with clear boundaries
2671
+ 3. **Build Resources**: Tasks, templates, checklists for your domain
2672
+ 4. **Test & Share**: Validate with real use cases, share with community
2673
+
2674
+ **Key Principle**: Expansion packs democratize expertise by making specialized knowledge accessible through AI agents.
2675
+
2094
2676
  ## Getting Help
2095
2677
 
2096
2678
  - **Commands**: Use `/help` in any environment to see available commands
2097
2679
  - **Agent Switching**: Use `/switch agent-name` with orchestrator for role changes
2098
2680
  - **Documentation**: Check `docs/` folder for project-specific context
2099
2681
  - **Community**: Discord and GitHub resources available for support
2682
+ - **Contributing**: See `CONTRIBUTING.md` for full guidelines
2100
2683
  ==================== END: data#bmad-kb ====================
2101
2684
 
2102
2685
  ==================== START: utils#template-format ====================