bmad-method 4.14.0 → 4.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,17 @@
1
+ # [4.15.0](https://github.com/bmadcode/BMAD-METHOD/compare/v4.14.1...v4.15.0) (2025-06-26)
2
+
3
+
4
+ ### Features
5
+
6
+ * Add Gemini CLI Integration ([#271](https://github.com/bmadcode/BMAD-METHOD/issues/271)) ([44b9d7b](https://github.com/bmadcode/BMAD-METHOD/commit/44b9d7bcb5cbb6de5a15d8f2ec7918d186ac9576))
7
+
8
+ ## [4.14.1](https://github.com/bmadcode/BMAD-METHOD/compare/v4.14.0...v4.14.1) (2025-06-26)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * add updated web builds ([6dabbcb](https://github.com/bmadcode/BMAD-METHOD/commit/6dabbcb670ef22708db6c01dac82069547ca79d6))
14
+
1
15
  # [4.14.0](https://github.com/bmadcode/BMAD-METHOD/compare/v4.13.0...v4.14.0) (2025-06-25)
2
16
 
3
17
 
@@ -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
 
@@ -2013,10 +2335,16 @@ This architecture enables seamless operation across environments while maintaini
2013
2335
 
2014
2336
  ## Complete Development Workflow
2015
2337
 
2016
- ### Planning Phase (Web UI Recommended)
2338
+ ### Planning Phase (Web UI Recommended - Especially Gemini!)
2339
+
2340
+ **Ideal for cost efficiency with Gemini's massive context:**
2017
2341
 
2018
- **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
2019
2346
 
2347
+ **For All Projects**:
2020
2348
  1. **Optional Analysis**: `/analyst` - Market research, competitive analysis
2021
2349
  2. **Project Brief**: Create foundation document (Analyst or user)
2022
2350
  3. **PRD Creation**: `/pm create-doc prd` - Comprehensive product requirements
@@ -2120,25 +2448,70 @@ Each status change requires user verification and approval before proceeding.
2120
2448
 
2121
2449
  #### Brownfield Enhancement (Existing Projects)
2122
2450
 
2123
- **Key Concept**: Brownfield development requires generating good documentation for agents to understand your existing project.
2124
-
2125
- **Recommended Approach**:
2126
- 1. **Analysis Phase**: Use Gemini Web or AI Studio with their 1M+ context windows
2127
- 2. **Document Generation**: Ask Architect agent to analyze your project and run `document-project` task
2128
- 3. **PRD Creation**: Even brownfield projects typically need a PRD unless:
2129
- - Very small, focused changes
2130
- - Using `brownfield-create-epic` for single epic without full PRD
2131
- 4. **Architecture Assessment**: Use brownfield-specific templates for complex enhancements
2132
-
2133
- **Brownfield Templates Available**:
2134
- - `brownfield-prd-tmpl.md`: For substantial enhancements requiring multiple stories
2135
- - `brownfield-architecture-tmpl.md`: For complex changes impacting system architecture
2136
- - Both templates emphasize compatibility and integration with existing systems
2137
-
2138
- **When to Skip PRD**:
2139
- - For focused, single-epic work, use `brownfield-create-epic` task with detailed guidance
2140
- - For one-off stories without larger context
2141
- - Note: These tasks will evolve to require some documentation (potentially from `document-project`)
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`
2142
2515
 
2143
2516
  ## Document Creation Best Practices
2144
2517