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
@@ -1333,385 +1333,313 @@ Generate comprehensive documentation for existing projects optimized for AI deve
1333
1333
 
1334
1334
  ### 1. Initial Project Analysis
1335
1335
 
1336
- [[LLM: Begin by conducting a comprehensive analysis of the existing project. Use available tools to:
1336
+ [[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.
1337
1337
 
1338
- 1. **Project Structure Discovery**: Examine the root directory structure, identify main folders, and understand the overall organization
1339
- 2. **Technology Stack Identification**: Look for package.json, requirements.txt, Cargo.toml, pom.xml, etc. to identify languages, frameworks, and dependencies
1340
- 3. **Build System Analysis**: Find build scripts, CI/CD configurations, and development commands
1341
- 4. **Existing Documentation Review**: Check for README files, docs folders, and any existing documentation
1342
- 5. **Code Pattern Analysis**: Sample key files to understand coding patterns, naming conventions, and architectural approaches
1343
-
1344
- Ask the user these elicitation questions to better understand their needs:
1345
-
1346
- - What is the primary purpose of this project?
1347
- - Are there any specific areas of the codebase that are particularly complex or important for agents to understand?
1348
- - What types of tasks do you expect AI agents to perform on this project? (e.g., bug fixes, feature additions, refactoring, testing)
1349
- - Are there any existing documentation standards or formats you prefer?
1350
- - What level of technical detail should the documentation target? (junior developers, senior developers, mixed team)
1351
- ]]
1352
-
1353
- ### 2. Core Documentation Generation
1354
-
1355
- [[LLM: Based on your analysis, generate the following core documentation files. Adapt the content and structure to match the specific project type and context you discovered:
1356
-
1357
- **Core Documents (always generate):**
1358
-
1359
- 1. **docs/index.md** - Master documentation index
1360
- 2. **docs/architecture/index.md** - Architecture documentation index
1361
- 3. **docs/architecture/coding-standards.md** - Coding conventions and style guidelines
1362
- 4. **docs/architecture/tech-stack.md** - Technology stack and version constraints
1363
- 5. **docs/architecture/unified-project-structure.md** - Project structure and organization
1364
- 6. **docs/architecture/testing-strategy.md** - Testing approaches and requirements
1365
-
1366
- **Backend Documents (generate for backend/full-stack projects):**
1367
-
1368
- 7. **docs/architecture/backend-architecture.md** - Backend service patterns and structure
1369
- 8. **docs/architecture/rest-api-spec.md** - API endpoint specifications
1370
- 9. **docs/architecture/data-models.md** - Data structures and validation rules
1371
- 10. **docs/architecture/database-schema.md** - Database design and relationships
1372
- 11. **docs/architecture/external-apis.md** - Third-party integrations
1373
-
1374
- **Frontend Documents (generate for frontend/full-stack projects):**
1375
-
1376
- 12. **docs/architecture/frontend-architecture.md** - Frontend patterns and structure
1377
- 13. **docs/architecture/components.md** - UI component specifications
1378
- 14. **docs/architecture/core-workflows.md** - User interaction flows
1379
- 15. **docs/architecture/ui-ux-spec.md** - UI/UX specifications and guidelines
1380
-
1381
- **Additional Documents (generate if applicable):**
1382
-
1383
- 16. **docs/prd.md** - Product requirements document (if not exists)
1384
- 17. **docs/architecture/deployment-guide.md** - Deployment and operations info
1385
- 18. **docs/architecture/security-considerations.md** - Security patterns and requirements
1386
- 19. **docs/architecture/performance-guidelines.md** - Performance optimization patterns
1387
-
1388
- **Optional Enhancement Documents:**
1389
-
1390
- 20. **docs/architecture/troubleshooting-guide.md** - Common issues and solutions
1391
- 21. **docs/architecture/changelog-conventions.md** - Change management practices
1392
- 22. **docs/architecture/code-review-checklist.md** - Review standards and practices
1393
-
1394
- Present each document section by section, using the advanced elicitation task after each major section.]]
1395
-
1396
- ### 3. Document Structure Template
1397
-
1398
- [[LLM: Use this standardized structure for each documentation file, adapting content as needed:
1399
-
1400
- ```markdown
1401
- # {{Document Title}}
1402
-
1403
- ## Overview
1404
-
1405
- {{Brief description of what this document covers and why it's important for AI agents}}
1338
+ **IF PRD EXISTS**:
1406
1339
 
1407
- ## Quick Reference
1340
+ - Review the PRD to understand what enhancement/feature is planned
1341
+ - Identify which modules, services, or areas will be affected
1342
+ - Focus documentation ONLY on these relevant areas
1343
+ - Skip unrelated parts of the codebase to keep docs lean
1408
1344
 
1409
- {{Key points, commands, or patterns that agents need most frequently}}
1345
+ **IF NO PRD EXISTS**:
1346
+ Ask the user:
1410
1347
 
1411
- ## Detailed Information
1348
+ "I notice you haven't provided a PRD or requirements document. To create more focused and useful documentation, I recommend one of these options:
1412
1349
 
1413
- {{Comprehensive information organized into logical sections}}
1350
+ 1. **Create a PRD first** - Would you like me to help create a brownfield PRD before documenting? This helps focus documentation on relevant areas.
1414
1351
 
1415
- ## Examples
1352
+ 2. **Provide existing requirements** - Do you have a requirements document, epic, or feature description you can share?
1416
1353
 
1417
- {{Concrete examples showing proper usage or implementation}}
1354
+ 3. **Describe the focus** - Can you briefly describe what enhancement or feature you're planning? For example:
1355
+ - 'Adding payment processing to the user service'
1356
+ - 'Refactoring the authentication module'
1357
+ - 'Integrating with a new third-party API'
1418
1358
 
1419
- ## Common Patterns
1359
+ 4. **Document everything** - Or should I proceed with comprehensive documentation of the entire codebase? (Note: This may create excessive documentation for large projects)
1420
1360
 
1421
- {{Recurring patterns agents should recognize and follow}}
1361
+ Please let me know your preference, or I can proceed with full documentation if you prefer."
1422
1362
 
1423
- ## Things to Avoid
1363
+ Based on their response:
1424
1364
 
1425
- {{Anti-patterns, deprecated approaches, or common mistakes}}
1365
+ - If they choose option 1-3: Use that context to focus documentation
1366
+ - If they choose option 4 or decline: Proceed with comprehensive analysis below
1426
1367
 
1427
- ## Related Resources
1368
+ Begin by conducting analysis of the existing project. Use available tools to:
1428
1369
 
1429
- {{Links to other relevant documentation or external resources}}
1430
- ```
1370
+ 1. **Project Structure Discovery**: Examine the root directory structure, identify main folders, and understand the overall organization
1371
+ 2. **Technology Stack Identification**: Look for package.json, requirements.txt, Cargo.toml, pom.xml, etc. to identify languages, frameworks, and dependencies
1372
+ 3. **Build System Analysis**: Find build scripts, CI/CD configurations, and development commands
1373
+ 4. **Existing Documentation Review**: Check for README files, docs folders, and any existing documentation
1374
+ 5. **Code Pattern Analysis**: Sample key files to understand coding patterns, naming conventions, and architectural approaches
1431
1375
 
1432
- Each document should be:
1376
+ Ask the user these elicitation questions to better understand their needs:
1433
1377
 
1434
- - **Concrete and actionable** - Focus on what agents need to do, not just concepts
1435
- - **Pattern-focused** - Highlight recurring patterns agents can recognize and replicate
1436
- - **Example-rich** - Include specific code examples and real file references
1437
- - **Context-aware** - Reference actual project files, folders, and conventions
1438
- - **Assumption-free** - Don't assume agents know project history or implicit knowledge
1378
+ - What is the primary purpose of this project?
1379
+ - Are there any specific areas of the codebase that are particularly complex or important for agents to understand?
1380
+ - What types of tasks do you expect AI agents to perform on this project? (e.g., bug fixes, feature additions, refactoring, testing)
1381
+ - Are there any existing documentation standards or formats you prefer?
1382
+ - What level of technical detail should the documentation target? (junior developers, senior developers, mixed team)
1383
+ - Is there a specific feature or enhancement you're planning? (This helps focus documentation)
1439
1384
  ]]
1440
1385
 
1441
- ### 4. Content Guidelines for Each Document Type
1442
-
1443
- #### Core Architecture Documents
1444
-
1445
- ##### docs/architecture/index.md
1446
-
1447
- [[LLM: Create a comprehensive index of all architecture documentation:
1448
-
1449
- - List all architecture documents with brief descriptions
1450
- - Group documents by category (backend, frontend, shared)
1451
- - Include quick links to key sections
1452
- - Provide reading order recommendations for different use cases]]
1453
-
1454
- ##### docs/architecture/unified-project-structure.md
1386
+ ### 2. Deep Codebase Analysis
1455
1387
 
1456
- [[LLM: Document the complete project structure:
1388
+ [[LLM: Before generating documentation, conduct extensive analysis of the existing codebase:
1457
1389
 
1458
- - Root-level directory structure with explanations
1459
- - Where each type of code belongs (backend, frontend, tests, etc.)
1460
- - File naming conventions and patterns
1461
- - Module/package organization
1462
- - Generated vs. source file locations
1463
- - Build output locations]]
1390
+ 1. **Explore Key Areas**:
1391
+ - Entry points (main files, index files, app initializers)
1392
+ - Configuration files and environment setup
1393
+ - Package dependencies and versions
1394
+ - Build and deployment configurations
1395
+ - Test suites and coverage
1464
1396
 
1465
- ##### docs/architecture/coding-standards.md
1397
+ 2. **Ask Clarifying Questions**:
1398
+ - "I see you're using [technology X]. Are there any custom patterns or conventions I should document?"
1399
+ - "What are the most critical/complex parts of this system that developers struggle with?"
1400
+ - "Are there any undocumented 'tribal knowledge' areas I should capture?"
1401
+ - "What technical debt or known issues should I document?"
1402
+ - "Which parts of the codebase change most frequently?"
1466
1403
 
1467
- [[LLM: Capture project-wide coding conventions:
1404
+ 3. **Map the Reality**:
1405
+ - Identify ACTUAL patterns used (not theoretical best practices)
1406
+ - Find where key business logic lives
1407
+ - Locate integration points and external dependencies
1408
+ - Document workarounds and technical debt
1409
+ - Note areas that differ from standard patterns
1468
1410
 
1469
- - Language-specific style guidelines
1470
- - Naming conventions (variables, functions, classes, files)
1471
- - Code organization within files
1472
- - Import/export patterns
1473
- - Comment and documentation standards
1474
- - Linting and formatting tool configurations
1475
- - Git commit message conventions]]
1411
+ **IF PRD PROVIDED**: Also analyze what would need to change for the enhancement]]
1476
1412
 
1477
- ##### docs/architecture/tech-stack.md
1413
+ ### 3. Core Documentation Generation
1478
1414
 
1479
- [[LLM: Document all technologies and versions:
1415
+ [[LLM: Generate a comprehensive BROWNFIELD architecture document that reflects the ACTUAL state of the codebase.
1480
1416
 
1481
- - Primary languages and versions
1482
- - Frameworks and major libraries with versions
1483
- - Development tools and their versions
1484
- - Database systems and versions
1485
- - External services and APIs used
1486
- - Browser/runtime requirements]]
1417
+ **CRITICAL**: This is NOT an aspirational architecture document. Document what EXISTS, including:
1418
+ - Technical debt and workarounds
1419
+ - Inconsistent patterns between different parts
1420
+ - Legacy code that can't be changed
1421
+ - Integration constraints
1422
+ - Performance bottlenecks
1487
1423
 
1488
- ##### docs/architecture/testing-strategy.md
1424
+ **Document Structure**:
1489
1425
 
1490
- [[LLM: Define testing approaches and requirements:
1426
+ # [Project Name] Brownfield Architecture Document
1491
1427
 
1492
- - Test file locations and naming conventions
1493
- - Unit testing patterns and frameworks
1494
- - Integration testing approaches
1495
- - E2E testing setup (if applicable)
1496
- - Test coverage requirements
1497
- - Mocking strategies
1498
- - Test data management]]
1499
-
1500
- #### Backend Architecture Documents
1501
-
1502
- ##### docs/architecture/backend-architecture.md
1503
-
1504
- [[LLM: Document backend service structure:
1505
-
1506
- - Service layer organization
1507
- - Controller/route patterns
1508
- - Middleware architecture
1509
- - Authentication/authorization patterns
1510
- - Request/response flow
1511
- - Background job processing
1512
- - Service communication patterns]]
1513
-
1514
- ##### docs/architecture/rest-api-spec.md
1515
-
1516
- [[LLM: Specify all API endpoints:
1517
-
1518
- - Base URL and versioning strategy
1519
- - Authentication methods
1520
- - Common headers and parameters
1521
- - Each endpoint with:
1522
- - HTTP method and path
1523
- - Request parameters/body
1524
- - Response format and status codes
1525
- - Error responses
1526
- - Rate limiting and quotas]]
1527
-
1528
- ##### docs/architecture/data-models.md
1529
-
1530
- [[LLM: Define data structures and validation:
1531
-
1532
- - Core business entities
1533
- - Data validation rules
1534
- - Relationships between entities
1535
- - Computed fields and derivations
1536
- - Data transformation patterns
1537
- - Serialization formats]]
1538
-
1539
- ##### docs/architecture/database-schema.md
1540
-
1541
- [[LLM: Document database design:
1542
-
1543
- - Database type and version
1544
- - Table/collection structures
1545
- - Indexes and constraints
1546
- - Relationships and foreign keys
1547
- - Migration patterns
1548
- - Seed data requirements
1549
- - Backup and recovery procedures]]
1550
-
1551
- ##### docs/architecture/external-apis.md
1552
-
1553
- [[LLM: Document third-party integrations:
1554
-
1555
- - List of external services used
1556
- - Authentication methods for each
1557
- - API endpoints and usage patterns
1558
- - Rate limits and quotas
1559
- - Error handling strategies
1560
- - Webhook configurations
1561
- - Data synchronization patterns]]
1428
+ ## Introduction
1429
+ 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.
1562
1430
 
1563
- #### Frontend Architecture Documents
1431
+ ### Document Scope
1432
+ [If PRD provided: "Focused on areas relevant to: {enhancement description}"]
1433
+ [If no PRD: "Comprehensive documentation of entire system"]
1564
1434
 
1565
- ##### docs/architecture/frontend-architecture.md
1435
+ ### Change Log
1436
+ | Date | Version | Description | Author |
1437
+ |------|---------|-------------|--------|
1438
+ | [Date] | 1.0 | Initial brownfield analysis | [Analyst] |
1566
1439
 
1567
- [[LLM: Document frontend application structure:
1440
+ ## Quick Reference - Key Files and Entry Points
1568
1441
 
1569
- - Component hierarchy and organization
1570
- - State management patterns
1571
- - Routing architecture
1572
- - Data fetching patterns
1573
- - Authentication flow
1574
- - Error boundary strategies
1575
- - Performance optimization patterns]]
1442
+ ### Critical Files for Understanding the System
1443
+ - **Main Entry**: `src/index.js` (or actual entry point)
1444
+ - **Configuration**: `config/app.config.js`, `.env.example`
1445
+ - **Core Business Logic**: `src/services/`, `src/domain/`
1446
+ - **API Definitions**: `src/routes/` or link to OpenAPI spec
1447
+ - **Database Models**: `src/models/` or link to schema files
1448
+ - **Key Algorithms**: [List specific files with complex logic]
1576
1449
 
1577
- ##### docs/architecture/components.md
1450
+ ### If PRD Provided - Enhancement Impact Areas
1451
+ [Highlight which files/modules will be affected by the planned enhancement]
1578
1452
 
1579
- [[LLM: Specify UI components:
1453
+ ## High Level Architecture
1580
1454
 
1581
- - Component library/design system used
1582
- - Custom component specifications
1583
- - Props and state for each component
1584
- - Component composition patterns
1585
- - Styling approaches
1586
- - Accessibility requirements
1587
- - Component testing patterns]]
1455
+ ### Technical Summary
1456
+ [Real assessment of architecture - mention if it's well-structured or has issues]
1588
1457
 
1589
- ##### docs/architecture/core-workflows.md
1458
+ ### Actual Tech Stack (from package.json/requirements.txt)
1459
+ | Category | Technology | Version | Notes |
1460
+ |----------|------------|---------|--------|
1461
+ | Runtime | Node.js | 16.x | [Any constraints] |
1462
+ | Framework | Express | 4.18.2 | [Custom middleware?] |
1463
+ | Database | PostgreSQL | 13 | [Connection pooling setup] |
1464
+ | [etc...] |
1590
1465
 
1591
- [[LLM: Document user interaction flows:
1466
+ ### Repository Structure Reality Check
1467
+ - Type: [Monorepo/Polyrepo/Hybrid]
1468
+ - Package Manager: [npm/yarn/pnpm]
1469
+ - Notable: [Any unusual structure decisions]
1592
1470
 
1593
- - Major user journeys
1594
- - Screen flow diagrams
1595
- - Form handling patterns
1596
- - Navigation patterns
1597
- - Data flow through workflows
1598
- - Error states and recovery
1599
- - Loading and transition states]]
1471
+ ## Source Tree and Module Organization
1600
1472
 
1601
- ##### docs/architecture/ui-ux-spec.md
1473
+ ### Project Structure (Actual)
1474
+ ```
1475
+ project-root/
1476
+ ├── src/
1477
+ │ ├── controllers/ # HTTP request handlers
1478
+ │ ├── services/ # Business logic (NOTE: inconsistent patterns between user and payment services)
1479
+ │ ├── models/ # Database models (Sequelize)
1480
+ │ ├── utils/ # Mixed bag - needs refactoring
1481
+ │ └── legacy/ # DO NOT MODIFY - old payment system still in use
1482
+ ├── tests/ # Jest tests (60% coverage)
1483
+ ├── scripts/ # Build and deployment scripts
1484
+ └── config/ # Environment configs
1485
+ ```
1602
1486
 
1603
- [[LLM: Define UI/UX guidelines:
1487
+ ### Key Modules and Their Purpose
1488
+ - **User Management**: `src/services/userService.js` - Handles all user operations
1489
+ - **Authentication**: `src/middleware/auth.js` - JWT-based, custom implementation
1490
+ - **Payment Processing**: `src/legacy/payment.js` - CRITICAL: Do not refactor, tightly coupled
1491
+ - **[List other key modules with their actual files]**
1604
1492
 
1605
- - Design system specifications
1606
- - Color palette and typography
1607
- - Spacing and layout grids
1608
- - Responsive breakpoints
1609
- - Animation and transition guidelines
1610
- - Accessibility standards
1611
- - Browser compatibility requirements]]
1493
+ ## Data Models and APIs
1612
1494
 
1613
- ### 5. Adaptive Content Strategy
1495
+ ### Data Models
1496
+ Instead of duplicating, reference actual model files:
1497
+ - **User Model**: See `src/models/User.js`
1498
+ - **Order Model**: See `src/models/Order.js`
1499
+ - **Related Types**: TypeScript definitions in `src/types/`
1614
1500
 
1615
- [[LLM: Adapt your documentation approach based on project characteristics:
1501
+ ### API Specifications
1502
+ - **OpenAPI Spec**: `docs/api/openapi.yaml` (if exists)
1503
+ - **Postman Collection**: `docs/api/postman-collection.json`
1504
+ - **Manual Endpoints**: [List any undocumented endpoints discovered]
1616
1505
 
1617
- **For Web Applications:**
1506
+ ## Technical Debt and Known Issues
1618
1507
 
1619
- - Focus on component patterns, routing, state management
1620
- - Include build processes, asset handling, and deployment
1621
- - Cover API integration patterns and data fetching
1508
+ ### Critical Technical Debt
1509
+ 1. **Payment Service**: Legacy code in `src/legacy/payment.js` - tightly coupled, no tests
1510
+ 2. **User Service**: Different pattern than other services, uses callbacks instead of promises
1511
+ 3. **Database Migrations**: Manually tracked, no proper migration tool
1512
+ 4. **[Other significant debt]**
1622
1513
 
1623
- **For Backend Services:**
1514
+ ### Workarounds and Gotchas
1515
+ - **Environment Variables**: Must set `NODE_ENV=production` even for staging (historical reason)
1516
+ - **Database Connections**: Connection pool hardcoded to 10, changing breaks payment service
1517
+ - **[Other workarounds developers need to know]**
1624
1518
 
1625
- - Emphasize service architecture, data models, and API design
1626
- - Include database interaction patterns and migration strategies
1627
- - Cover authentication, authorization, and security patterns
1519
+ ## Integration Points and External Dependencies
1628
1520
 
1629
- **For CLI Tools:**
1521
+ ### External Services
1522
+ | Service | Purpose | Integration Type | Key Files |
1523
+ |---------|---------|------------------|-----------|
1524
+ | Stripe | Payments | REST API | `src/integrations/stripe/` |
1525
+ | SendGrid | Emails | SDK | `src/services/emailService.js` |
1526
+ | [etc...] |
1630
1527
 
1631
- - Focus on command structure, argument parsing, and output formatting
1632
- - Include plugin/extension patterns if applicable
1633
- - Cover configuration file handling and user interaction patterns
1528
+ ### Internal Integration Points
1529
+ - **Frontend Communication**: REST API on port 3000, expects specific headers
1530
+ - **Background Jobs**: Redis queue, see `src/workers/`
1531
+ - **[Other integrations]**
1634
1532
 
1635
- **For Libraries/Frameworks:**
1533
+ ## Development and Deployment
1636
1534
 
1637
- - Emphasize public API design and usage patterns
1638
- - Include extension points and customization approaches
1639
- - Cover versioning, compatibility, and migration strategies
1535
+ ### Local Development Setup
1536
+ 1. Actual steps that work (not ideal steps)
1537
+ 2. Known issues with setup
1538
+ 3. Required environment variables (see `.env.example`)
1640
1539
 
1641
- **For Mobile Applications:**
1540
+ ### Build and Deployment Process
1541
+ - **Build Command**: `npm run build` (webpack config in `webpack.config.js`)
1542
+ - **Deployment**: Manual deployment via `scripts/deploy.sh`
1543
+ - **Environments**: Dev, Staging, Prod (see `config/environments/`)
1642
1544
 
1643
- - Focus on platform-specific patterns and navigation
1644
- - Include state management and data persistence approaches
1645
- - Cover platform integration and native feature usage
1545
+ ## Testing Reality
1646
1546
 
1647
- **For Data Science/ML Projects:**
1547
+ ### Current Test Coverage
1548
+ - Unit Tests: 60% coverage (Jest)
1549
+ - Integration Tests: Minimal, in `tests/integration/`
1550
+ - E2E Tests: None
1551
+ - Manual Testing: Primary QA method
1648
1552
 
1649
- - Emphasize data pipeline patterns and model organization
1650
- - Include experiment tracking and reproducibility approaches
1651
- - Cover data validation and model deployment patterns
1652
- ]]
1553
+ ### Running Tests
1554
+ ```bash
1555
+ npm test # Runs unit tests
1556
+ npm run test:integration # Runs integration tests (requires local DB)
1557
+ ```
1653
1558
 
1654
- ### 6. Quality Assurance
1559
+ ## If Enhancement PRD Provided - Impact Analysis
1655
1560
 
1656
- [[LLM: Before completing each document:
1561
+ ### Files That Will Need Modification
1562
+ Based on the enhancement requirements, these files will be affected:
1563
+ - `src/services/userService.js` - Add new user fields
1564
+ - `src/models/User.js` - Update schema
1565
+ - `src/routes/userRoutes.js` - New endpoints
1566
+ - [etc...]
1657
1567
 
1658
- 1. **Accuracy Check**: Verify all file paths, commands, and code examples work
1659
- 2. **Completeness Review**: Ensure the document covers the most important patterns an agent would encounter
1660
- 3. **Clarity Assessment**: Check that explanations are clear and actionable
1661
- 4. **Consistency Verification**: Ensure terminology and patterns align across all documents
1662
- 5. **Agent Perspective**: Review from the viewpoint of an AI agent that needs to contribute to this project
1568
+ ### New Files/Modules Needed
1569
+ - `src/services/newFeatureService.js` - New business logic
1570
+ - `src/models/NewFeature.js` - New data model
1571
+ - [etc...]
1663
1572
 
1664
- Ask the user to review each completed document and use the advanced elicitation task to refine based on their feedback.]]
1573
+ ### Integration Considerations
1574
+ - Will need to integrate with existing auth middleware
1575
+ - Must follow existing response format in `src/utils/responseFormatter.js`
1576
+ - [Other integration points]
1665
1577
 
1666
- ### 7. Final Integration
1578
+ ## Appendix - Useful Commands and Scripts
1667
1579
 
1668
- [[LLM: After all documents are completed:
1580
+ ### Frequently Used Commands
1581
+ ```bash
1582
+ npm run dev # Start development server
1583
+ npm run build # Production build
1584
+ npm run migrate # Run database migrations
1585
+ npm run seed # Seed test data
1586
+ ```
1669
1587
 
1670
- 1. Ensure all documents are created in the proper BMAD-expected locations:
1588
+ ### Debugging and Troubleshooting
1589
+ - **Logs**: Check `logs/app.log` for application logs
1590
+ - **Debug Mode**: Set `DEBUG=app:*` for verbose logging
1591
+ - **Common Issues**: See `docs/troubleshooting.md`]]
1671
1592
 
1672
- - Core docs in `docs/` (index.md, prd.md)
1673
- - Architecture shards in `docs/architecture/` subdirectory
1674
- - Create the `docs/architecture/` directory if it doesn't exist
1593
+ ### 4. Document Delivery
1675
1594
 
1676
- 2. Create/update the master index documents:
1595
+ [[LLM: After generating the complete architecture document:
1677
1596
 
1678
- - Update `docs/index.md` to reference all documentation
1679
- - Create `docs/architecture/index.md` listing all architecture shards
1597
+ 1. **In Web UI (Gemini, ChatGPT, Claude)**:
1598
+ - Present the entire document in one response (or multiple if too long)
1599
+ - Tell user to copy and save as `docs/brownfield-architecture.md` or `docs/project-architecture.md`
1600
+ - Mention it can be sharded later in IDE if needed
1680
1601
 
1681
- 3. Verify document cross-references:
1602
+ 2. **In IDE Environment**:
1603
+ - Create the document as `docs/brownfield-architecture.md`
1604
+ - Inform user this single document contains all architectural information
1605
+ - Can be sharded later using PO agent if desired
1682
1606
 
1683
- - Ensure all documents link to related documentation
1684
- - Check that file paths match the actual project structure
1685
- - Validate that examples reference real files in the project
1607
+ The document should be comprehensive enough that future agents can understand:
1608
+ - The actual state of the system (not idealized)
1609
+ - Where to find key files and logic
1610
+ - What technical debt exists
1611
+ - What constraints must be respected
1612
+ - If PRD provided: What needs to change for the enhancement]]
1686
1613
 
1687
- 4. Provide maintenance guidance:
1614
+ ### 5. Quality Assurance
1688
1615
 
1689
- - Document update triggers (when to update each doc)
1690
- - Create a simple checklist for keeping docs current
1691
- - Suggest automated validation approaches
1616
+ [[LLM: Before finalizing the document:
1692
1617
 
1693
- 5. Summary report including:
1694
- - List of all documents created with their paths
1695
- - Any gaps or areas needing human review
1696
- - Recommendations for project-specific additions
1697
- - Next steps for maintaining documentation accuracy
1618
+ 1. **Accuracy Check**: Verify all technical details match the actual codebase
1619
+ 2. **Completeness Review**: Ensure all major system components are documented
1620
+ 3. **Focus Validation**: If user provided scope, verify relevant areas are emphasized
1621
+ 4. **Clarity Assessment**: Check that explanations are clear for AI agents
1622
+ 5. **Navigation**: Ensure document has clear section structure for easy reference
1698
1623
 
1699
- Present a summary of what was created and ask if any additional documentation would be helpful for AI agents working on this specific project.]]
1624
+ Apply the advanced elicitation task after major sections to refine based on user feedback.]]
1700
1625
 
1701
1626
  ## Success Criteria
1702
1627
 
1703
- - Documentation enables AI agents to understand project context without additional explanation
1704
- - All major architectural patterns and coding conventions are captured
1705
- - Examples reference actual project files and demonstrate real usage
1706
- - Documentation is structured consistently and easy to navigate
1707
- - Content is actionable and focuses on what agents need to do, not just understand
1628
+ - Single comprehensive brownfield architecture document created
1629
+ - Document reflects REALITY including technical debt and workarounds
1630
+ - Key files and modules are referenced with actual paths
1631
+ - Models/APIs reference source files rather than duplicating content
1632
+ - If PRD provided: Clear impact analysis showing what needs to change
1633
+ - Document enables AI agents to navigate and understand the actual codebase
1634
+ - Technical constraints and "gotchas" are clearly documented
1708
1635
 
1709
1636
  ## Notes
1710
1637
 
1711
- - This task is designed to work with any project type, language, or framework
1712
- - The documentation should reflect the project as it actually is, not as it should be
1713
- - Focus on patterns that agents can recognize and replicate consistently
1714
- - Include both positive examples (what to do) and negative examples (what to avoid)
1638
+ - This task creates ONE document that captures the TRUE state of the system
1639
+ - References actual files rather than duplicating content when possible
1640
+ - Documents technical debt, workarounds, and constraints honestly
1641
+ - For brownfield projects with PRD: Provides clear enhancement impact analysis
1642
+ - The goal is PRACTICAL documentation for AI agents doing real work
1715
1643
  ==================== END: tasks#document-project ====================
1716
1644
 
1717
1645
  ==================== START: tasks#create-next-story ====================
@@ -2314,9 +2242,27 @@ Would you like to proceed with documentation indexing? Please provide the requir
2314
2242
  - Create a folder structure to organize the sharded documents
2315
2243
  - Maintain all content integrity including code blocks, diagrams, and markdown formatting
2316
2244
 
2317
- ## Recommended Method: @kayvan/markdown-tree-parser
2245
+ ## Primary Method: Automatic with markdown-tree
2246
+
2247
+ [[LLM: First, check if markdownExploder is set to true in bmad-core/core-config.yml. If it is, attempt to run the command: `md-tree explode {input file} {output path}`.
2248
+
2249
+ If the command succeeds, inform the user that the document has been sharded successfully and STOP - do not proceed further.
2250
+
2251
+ If the command fails (especially with an error indicating the command is not found or not available), inform the user: "The markdownExploder setting is enabled but the md-tree command is not available. Please either:
2252
+
2253
+ 1. Install @kayvan/markdown-tree-parser globally with: `npm install -g @kayvan/markdown-tree-parser`
2254
+ 2. Or set markdownExploder to false in bmad-core/core-config.yml
2318
2255
 
2319
- [[LLM: First, suggest the user install and use the @kayvan/markdown-tree-parser tool if the md-tree command is unavailable so we can have the best performance and reliable document sharding. Let the user know this will save cost of having the LLM to the expensive sharding operation. Give instructions for MPV NPX and PNPM global installs.]]
2256
+ **IMPORTANT: STOP HERE - do not proceed with manual sharding until one of the above actions is taken.**"
2257
+
2258
+ If markdownExploder is set to false, inform the user: "The markdownExploder setting is currently false. For better performance and reliability, you should:
2259
+
2260
+ 1. Set markdownExploder to true in bmad-core/core-config.yml
2261
+ 2. Install @kayvan/markdown-tree-parser globally with: `npm install -g @kayvan/markdown-tree-parser`
2262
+
2263
+ I will now proceed with the manual sharding process."
2264
+
2265
+ Then proceed with the manual method below ONLY if markdownExploder is false.]]
2320
2266
 
2321
2267
  ### Installation and Usage
2322
2268
 
@@ -2349,19 +2295,19 @@ If the user has @kayvan/markdown-tree-parser installed, use it and skip the manu
2349
2295
 
2350
2296
  ---
2351
2297
 
2352
- ## Manual Method (if @kayvan/markdown-tree-parser is not available)
2298
+ ## Manual Method (if @kayvan/markdown-tree-parser is not available or user indicated manual method)
2353
2299
 
2354
2300
  [[LLM: Only proceed with the manual instructions below if the user cannot or does not want to use @kayvan/markdown-tree-parser.]]
2355
2301
 
2356
2302
  ### Task Instructions
2357
2303
 
2358
- ### 1. Identify Document and Target Location
2304
+ 1. Identify Document and Target Location
2359
2305
 
2360
2306
  - Determine which document to shard (user-provided path)
2361
2307
  - Create a new folder under `docs/` with the same name as the document (without extension)
2362
2308
  - Example: `docs/prd.md` → create folder `docs/prd/`
2363
2309
 
2364
- ### 2. Parse and Extract Sections
2310
+ 2. Parse and Extract Sections
2365
2311
 
2366
2312
  [[LLM: When sharding the document:
2367
2313
 
@@ -2371,7 +2317,7 @@ If the user has @kayvan/markdown-tree-parser installed, use it and skip the manu
2371
2317
  - Extract the section heading and ALL content until the next level 2 section
2372
2318
  - Include all subsections, code blocks, diagrams, lists, tables, etc.
2373
2319
  - Be extremely careful with:
2374
- - Fenced code blocks (```) - ensure you capture the full block including closing backticks
2320
+ - Fenced code blocks (```) - ensure you capture the full block including closing backticks and account for potential misleading level 2's that are actually part of a fenced section example
2375
2321
  - Mermaid diagrams - preserve the complete diagram syntax
2376
2322
  - Nested markdown elements
2377
2323
  - Multi-line content that might contain ## inside code blocks
@@ -2390,7 +2336,7 @@ For each extracted section:
2390
2336
 
2391
2337
  2. **Adjust heading levels**:
2392
2338
 
2393
- - The level 2 heading becomes level 1 (# instead of ##)
2339
+ - The level 2 heading becomes level 1 (# instead of ##) in the sharded new document
2394
2340
  - All subsection levels decrease by 1:
2395
2341
 
2396
2342
  ```txt
@@ -6720,6 +6666,10 @@ Manual Test Steps: [[LLM: Include how if possible the user can manually test the
6720
6666
  [[LLM: (SM Agent) When Drafting Story, leave next prompt in place for dev agent to remove and update - remove this line to the SM]]
6721
6667
  [[LLM: (Dev Agent) Anything the SM needs to know that deviated from the story that might impact drafting the next story.]]
6722
6668
 
6669
+ ### File List
6670
+
6671
+ [[LLM: (Dev Agent) List every new file created, or existing file modified in a bullet list.]]
6672
+
6723
6673
  ### Change Log
6724
6674
 
6725
6675
  [[LLM: (SM Agent) When Drafting Story, leave next prompt in place for dev agent to remove and update- remove this line to the SM]]
@@ -6727,6 +6677,10 @@ Manual Test Steps: [[LLM: Include how if possible the user can manually test the
6727
6677
 
6728
6678
  | Date | Version | Description | Author |
6729
6679
  | :--- | :------ | :---------- | :----- |
6680
+
6681
+ ## QA Results
6682
+
6683
+ [[LLM: QA Agent Results]]
6730
6684
  ==================== END: templates#story-tmpl ====================
6731
6685
 
6732
6686
  ==================== START: checklists#architect-checklist ====================
@@ -8468,6 +8422,50 @@ BMAD-METHOD (Breakthrough Method of Agile AI-driven Development) is a framework
8468
8422
  - **Quality Assurance**: Structured testing and validation
8469
8423
  - **Documentation**: Professional PRDs, architecture docs, user stories
8470
8424
 
8425
+ ## How BMAD Works
8426
+
8427
+ ### The Core Method
8428
+
8429
+ BMAD transforms you into a "Vibe CEO" - directing a team of specialized AI agents through structured workflows. Here's how:
8430
+
8431
+ 1. **You Direct, AI Executes**: You provide vision and decisions; agents handle implementation details
8432
+ 2. **Specialized Agents**: Each agent masters one role (PM, Developer, Architect, etc.)
8433
+ 3. **Structured Workflows**: Proven patterns guide you from idea to deployed code
8434
+ 4. **Clean Handoffs**: Fresh context windows ensure agents stay focused and effective
8435
+
8436
+ ### The Two-Phase Approach
8437
+
8438
+ **Phase 1: Planning (Web UI - Cost Effective)**
8439
+ - Use large context windows (Gemini's 1M tokens)
8440
+ - Generate comprehensive documents (PRD, Architecture)
8441
+ - Leverage multiple agents for brainstorming
8442
+ - Create once, use throughout development
8443
+
8444
+ **Phase 2: Development (IDE - Implementation)**
8445
+ - Shard documents into manageable pieces
8446
+ - Execute focused SM → Dev cycles
8447
+ - One story at a time, sequential progress
8448
+ - Real-time file operations and testing
8449
+
8450
+ ### The Development Loop
8451
+
8452
+ ```text
8453
+ 1. SM Agent (New Chat) → Creates next story from sharded docs
8454
+ 2. You → Review and approve story
8455
+ 3. Dev Agent (New Chat) → Implements approved story
8456
+ 4. QA Agent (New Chat) → Reviews and refactors code
8457
+ 5. You → Verify completion
8458
+ 6. Repeat until epic complete
8459
+ ```
8460
+
8461
+ ### Why This Works
8462
+
8463
+ - **Context Optimization**: Clean chats = better AI performance
8464
+ - **Role Clarity**: Agents don't context-switch = higher quality
8465
+ - **Incremental Progress**: Small stories = manageable complexity
8466
+ - **Human Oversight**: You validate each step = quality control
8467
+ - **Document-Driven**: Specs guide everything = consistency
8468
+
8471
8469
  ## Getting Started
8472
8470
 
8473
8471
  ### Quick Start Options
@@ -8482,7 +8480,7 @@ BMAD-METHOD (Breakthrough Method of Agile AI-driven Development) is a framework
8482
8480
  5. Type `/help` to see available commands
8483
8481
 
8484
8482
  #### Option 2: IDE Integration
8485
- **Best for**: Cursor, Claude Code, Windsurf, VS Code users
8483
+ **Best for**: Cursor, Claude Code, Windsurf, Cline, Roo Code users
8486
8484
 
8487
8485
  ```bash
8488
8486
  # Interactive installation (recommended)
@@ -8491,13 +8489,22 @@ npx bmad-method install
8491
8489
 
8492
8490
  **Installation Steps**:
8493
8491
  - Choose "Complete installation"
8494
- - Select your IDE (Cursor, Claude Code, Windsurf, or Roo Code)
8492
+ - Select your IDE from supported options:
8493
+ - **Cursor**: Native AI integration
8494
+ - **Claude Code**: Anthropic's official IDE
8495
+ - **Windsurf**: Built-in AI capabilities
8496
+ - **Cline**: VS Code extension with AI features
8497
+ - **Roo Code**: Web-based IDE with agent support
8498
+
8499
+ **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.
8495
8500
 
8496
8501
  **Verify Installation**:
8497
8502
  - `.bmad-core/` folder created with all agents
8498
8503
  - IDE-specific integration files created
8499
8504
  - All agent commands/rules/modes available
8500
8505
 
8506
+ **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
8507
+
8501
8508
  ### Environment Selection Guide
8502
8509
 
8503
8510
  **Use Web UI for**:
@@ -8514,6 +8521,47 @@ npx bmad-method install
8514
8521
 
8515
8522
  **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.
8516
8523
 
8524
+ ### IDE-Only Workflow Considerations
8525
+
8526
+ **Can you do everything in IDE?** Yes, but understand the tradeoffs:
8527
+
8528
+ **Pros of IDE-Only**:
8529
+ - Single environment workflow
8530
+ - Direct file operations from start
8531
+ - No copy/paste between environments
8532
+ - Immediate project integration
8533
+
8534
+ **Cons of IDE-Only**:
8535
+ - Higher token costs for large document creation
8536
+ - Smaller context windows (varies by IDE/model)
8537
+ - May hit limits during planning phases
8538
+ - Less cost-effective for brainstorming
8539
+
8540
+ **Using Web Agents in IDE**:
8541
+ - **NOT RECOMMENDED**: Web agents (PM, Architect) have rich dependencies designed for large contexts
8542
+ - **Why it matters**: Dev agents are kept lean to maximize coding context
8543
+ - **The principle**: "Dev agents code, planning agents plan" - mixing breaks this optimization
8544
+
8545
+ **About bmad-master and bmad-orchestrator**:
8546
+ - **bmad-master**: CAN do any task without switching agents, BUT...
8547
+ - **Still use specialized agents for planning**: PM, Architect, and UX Expert have tuned personas that produce better results
8548
+ - **Why specialization matters**: Each agent's personality and focus creates higher quality outputs
8549
+ - **If using bmad-master/orchestrator**: Fine for planning phases, but...
8550
+
8551
+ **CRITICAL RULE for Development**:
8552
+ - **ALWAYS use SM agent for story creation** - Never use bmad-master/orchestrator
8553
+ - **ALWAYS use Dev agent for implementation** - Never use bmad-master/orchestrator
8554
+ - **Why this matters**: SM and Dev agents are specifically optimized for the development workflow
8555
+ - **No exceptions**: Even if using bmad-master for everything else, switch to SM → Dev for implementation
8556
+
8557
+ **Best Practice for IDE-Only**:
8558
+ 1. Use PM/Architect/UX agents for planning (better than bmad-master)
8559
+ 2. Create documents directly in project
8560
+ 3. Shard immediately after creation
8561
+ 4. **MUST switch to SM agent** for story creation
8562
+ 5. **MUST switch to Dev agent** for implementation
8563
+ 6. Keep planning and coding in separate chat sessions
8564
+
8517
8565
  ## Core Configuration (core-config.yml)
8518
8566
 
8519
8567
  **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.
@@ -8754,10 +8802,16 @@ This architecture enables seamless operation across environments while maintaini
8754
8802
 
8755
8803
  ## Complete Development Workflow
8756
8804
 
8757
- ### Planning Phase (Web UI Recommended)
8805
+ ### Planning Phase (Web UI Recommended - Especially Gemini!)
8758
8806
 
8759
- **Ideal for cost efficiency, especially with Gemini:**
8807
+ **Ideal for cost efficiency with Gemini's massive context:**
8760
8808
 
8809
+ **For Brownfield Projects - Start Here!**:
8810
+ 1. **Upload entire project to Gemini Web** (GitHub URL, files, or zip)
8811
+ 2. **Document existing system**: `/analyst` → `*document-project`
8812
+ 3. **Creates comprehensive docs** from entire codebase analysis
8813
+
8814
+ **For All Projects**:
8761
8815
  1. **Optional Analysis**: `/analyst` - Market research, competitive analysis
8762
8816
  2. **Project Brief**: Create foundation document (Analyst or user)
8763
8817
  3. **PRD Creation**: `/pm create-doc prd` - Comprehensive product requirements
@@ -8791,10 +8845,14 @@ that can handle [specific requirements]."
8791
8845
 
8792
8846
  **Prerequisites**: Planning documents must exist in `docs/` folder
8793
8847
 
8794
- 1. **Document Sharding**:
8795
- - `@bmad-master` or `@po` shard `docs/prd.md` to `docs/prd/` folder
8796
- - If architecture exists, shard to `docs/architecture/` folder
8797
- - Results in multiple manageable documents and epic files
8848
+ 1. **Document Sharding** (CRITICAL STEP):
8849
+ - Documents created by PM/Architect (in Web or IDE) MUST be sharded for development
8850
+ - Two methods to shard:
8851
+ a) **Manual**: Drag `shard-doc` task + document file into chat
8852
+ b) **Agent**: Ask `@bmad-master` or `@po` to shard documents
8853
+ - Shards `docs/prd.md` → `docs/prd/` folder
8854
+ - Shards `docs/architecture.md` → `docs/architecture/` folder
8855
+ - **WARNING**: Do NOT shard in Web UI - copying many small files is painful!
8798
8856
 
8799
8857
  2. **Verify Sharded Content**:
8800
8858
  - At least one `epic-n.md` file in `docs/prd/` with stories in development order
@@ -8808,19 +8866,34 @@ that can handle [specific requirements]."
8808
8866
 
8809
8867
  3. **Development Cycle** (Sequential, one story at a time):
8810
8868
 
8811
- **Step 1 - Story Creation**: New chat window → `@sm` → `*create`
8869
+ **CRITICAL CONTEXT MANAGEMENT**:
8870
+ - **Context windows matter!** Always use fresh, clean context windows
8871
+ - **Model selection matters!** Use most powerful thinking model for SM story creation
8872
+ - **ALWAYS start new chat between SM, Dev, and QA work**
8873
+
8874
+ **Step 1 - Story Creation**:
8875
+ - **NEW CLEAN CHAT** → Select powerful model → `@sm` → `*create`
8812
8876
  - SM executes create-next-story task
8813
8877
  - Review generated story in `docs/stories/`
8814
8878
  - Update status from "Draft" to "Approved"
8815
8879
 
8816
- **Step 2 - Story Implementation**: New chat window → `@dev`
8880
+ **Step 2 - Story Implementation**:
8881
+ - **NEW CLEAN CHAT** → `@dev`
8817
8882
  - Agent asks which story to implement
8818
8883
  - Include story file content to save dev agent lookup time
8819
8884
  - Dev follows tasks/subtasks, marking completion
8820
- - Dev leaves notes for SM about any deviations
8821
- - Update status to "Done"
8885
+ - Dev maintains File List of all changes
8886
+ - Dev marks story as "Review" when complete with all tests passing
8822
8887
 
8823
- **Step 3 - Repeat**: Continue SM → Dev cycle until all epic stories complete
8888
+ **Step 3 - Senior QA Review**:
8889
+ - **NEW CLEAN CHAT** → `@qa` → execute review-story task
8890
+ - QA performs senior developer code review
8891
+ - QA can refactor and improve code directly
8892
+ - QA appends results to story's QA Results section
8893
+ - If approved: Status → "Done"
8894
+ - If changes needed: Status stays "Review" with unchecked items for dev
8895
+
8896
+ **Step 4 - Repeat**: Continue SM → Dev → QA cycle until all epic stories complete
8824
8897
 
8825
8898
  **Important**: Only 1 story in progress at a time, worked sequentially until all epic stories complete.
8826
8899
 
@@ -8840,12 +8913,72 @@ Each status change requires user verification and approval before proceeding.
8840
8913
  - Development execution
8841
8914
  - Testing and deployment
8842
8915
 
8843
- #### Brownfield Enhancement
8844
- - Current system analysis
8845
- - Enhancement planning
8846
- - Impact assessment
8847
- - Incremental development
8848
- - Integration testing
8916
+ #### Brownfield Enhancement (Existing Projects)
8917
+
8918
+ **Key Concept**: Brownfield development requires comprehensive documentation of your existing project for AI agents to understand context, patterns, and constraints.
8919
+
8920
+ **Complete Brownfield Workflow Options**:
8921
+
8922
+ **Option 1: PRD-First (Recommended for Large Codebases/Monorepos)**:
8923
+ 1. **Upload project to Gemini Web** (GitHub URL, files, or zip)
8924
+ 2. **Create PRD first**: `@pm` → `*create-doc brownfield-prd`
8925
+ 3. **Focused documentation**: `@analyst` → `*document-project`
8926
+ - Analyst asks for focus if no PRD provided
8927
+ - Choose "single document" format for Web UI
8928
+ - Uses PRD to document ONLY relevant areas
8929
+ - Creates one comprehensive markdown file
8930
+ - Avoids bloating docs with unused code
8931
+
8932
+ **Option 2: Document-First (Good for Smaller Projects)**:
8933
+ 1. **Upload project to Gemini Web**
8934
+ 2. **Document everything**: `@analyst` → `*document-project`
8935
+ 3. **Then create PRD**: `@pm` → `*create-doc brownfield-prd`
8936
+ - More thorough but can create excessive documentation
8937
+
8938
+ 2. **Requirements Gathering**:
8939
+ - **Brownfield PRD**: Use PM agent with `brownfield-prd-tmpl`
8940
+ - **Analyzes**: Existing system, constraints, integration points
8941
+ - **Defines**: Enhancement scope, compatibility requirements, risk assessment
8942
+ - **Creates**: Epic and story structure for changes
8943
+
8944
+ 3. **Architecture Planning**:
8945
+ - **Brownfield Architecture**: Use Architect agent with `brownfield-architecture-tmpl`
8946
+ - **Integration Strategy**: How new features integrate with existing system
8947
+ - **Migration Planning**: Gradual rollout and backwards compatibility
8948
+ - **Risk Mitigation**: Addressing potential breaking changes
8949
+
8950
+ **Brownfield-Specific Resources**:
8951
+
8952
+ **Templates**:
8953
+ - `brownfield-prd-tmpl.md`: Comprehensive enhancement planning with existing system analysis
8954
+ - `brownfield-architecture-tmpl.md`: Integration-focused architecture for existing systems
8955
+
8956
+ **Tasks**:
8957
+ - `document-project`: Generates comprehensive documentation from existing codebase
8958
+ - `brownfield-create-epic`: Creates single epic for focused enhancements (when full PRD is overkill)
8959
+ - `brownfield-create-story`: Creates individual story for small, isolated changes
8960
+
8961
+ **When to Use Each Approach**:
8962
+
8963
+ **Full Brownfield Workflow** (Recommended for):
8964
+ - Major feature additions
8965
+ - System modernization
8966
+ - Complex integrations
8967
+ - Multiple related changes
8968
+
8969
+ **Quick Epic/Story Creation** (Use when):
8970
+ - Single, focused enhancement
8971
+ - Isolated bug fixes
8972
+ - Small feature additions
8973
+ - Well-documented existing system
8974
+
8975
+ **Critical Success Factors**:
8976
+ 1. **Documentation First**: Always run `document-project` if docs are outdated/missing
8977
+ 2. **Context Matters**: Provide agents access to relevant code sections
8978
+ 3. **Integration Focus**: Emphasize compatibility and non-breaking changes
8979
+ 4. **Incremental Approach**: Plan for gradual rollout and testing
8980
+
8981
+ **For detailed guide**: See `docs/working-in-the-brownfield.md`
8849
8982
 
8850
8983
  ## Document Creation Best Practices
8851
8984
 
@@ -8926,12 +9059,94 @@ Use the `shard-doc` task or `@kayvan/markdown-tree-parser` tool for automatic sh
8926
9059
  - **Keep conversations focused** - One agent, one task per conversation
8927
9060
  - **Review everything** - Always review and approve before marking complete
8928
9061
 
9062
+ ## Contributing to BMAD-METHOD
9063
+
9064
+ ### Quick Contribution Guidelines
9065
+
9066
+ For full details, see `CONTRIBUTING.md`. Key points:
9067
+
9068
+ **Fork Workflow**:
9069
+ 1. Fork the repository
9070
+ 2. Create feature branches
9071
+ 3. Submit PRs to `next` branch (default) or `main` for critical fixes only
9072
+ 4. Keep PRs small: 200-400 lines ideal, 800 lines maximum
9073
+ 5. One feature/fix per PR
9074
+
9075
+ **PR Requirements**:
9076
+ - Clear descriptions (max 200 words) with What/Why/How/Testing
9077
+ - Use conventional commits (feat:, fix:, docs:)
9078
+ - Atomic commits - one logical change per commit
9079
+ - Must align with guiding principles
9080
+
9081
+ **Core Principles** (from GUIDING-PRINCIPLES.md):
9082
+ - **Dev Agents Must Be Lean**: Minimize dependencies, save context for code
9083
+ - **Natural Language First**: Everything in markdown, no code in core
9084
+ - **Core vs Expansion Packs**: Core for universal needs, packs for specialized domains
9085
+ - **Design Philosophy**: "Dev agents code, planning agents plan"
9086
+
9087
+ ## Expansion Packs
9088
+
9089
+ ### What Are Expansion Packs?
9090
+
9091
+ 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.
9092
+
9093
+ ### Why Use Expansion Packs?
9094
+
9095
+ 1. **Keep Core Lean**: Dev agents maintain maximum context for coding
9096
+ 2. **Domain Expertise**: Deep, specialized knowledge without bloating core
9097
+ 3. **Community Innovation**: Anyone can create and share packs
9098
+ 4. **Modular Design**: Install only what you need
9099
+
9100
+ ### Available Expansion Packs
9101
+
9102
+ **Technical Packs**:
9103
+ - **Infrastructure/DevOps**: Cloud architects, SRE experts, security specialists
9104
+ - **Game Development**: Game designers, level designers, narrative writers
9105
+ - **Mobile Development**: iOS/Android specialists, mobile UX experts
9106
+ - **Data Science**: ML engineers, data scientists, visualization experts
9107
+
9108
+ **Non-Technical Packs**:
9109
+ - **Business Strategy**: Consultants, financial analysts, marketing strategists
9110
+ - **Creative Writing**: Plot architects, character developers, world builders
9111
+ - **Health & Wellness**: Fitness trainers, nutritionists, habit engineers
9112
+ - **Education**: Curriculum designers, assessment specialists
9113
+ - **Legal Support**: Contract analysts, compliance checkers
9114
+
9115
+ **Specialty Packs**:
9116
+ - **Expansion Creator**: Tools to build your own expansion packs
9117
+ - **RPG Game Master**: Tabletop gaming assistance
9118
+ - **Life Event Planning**: Wedding planners, event coordinators
9119
+ - **Scientific Research**: Literature reviewers, methodology designers
9120
+
9121
+ ### Using Expansion Packs
9122
+
9123
+ 1. **Browse Available Packs**: Check `expansion-packs/` directory
9124
+ 2. **Get Inspiration**: See `docs/expansion-pack-ideas.md` for detailed examples
9125
+ 3. **Install via CLI**:
9126
+ ```bash
9127
+ npx bmad-method install
9128
+ # Select "Install expansion pack" option
9129
+ ```
9130
+ 4. **Use in Your Workflow**: Installed packs integrate seamlessly with existing agents
9131
+
9132
+ ### Creating Custom Expansion Packs
9133
+
9134
+ Use the **expansion-creator** pack to build your own:
9135
+
9136
+ 1. **Define Domain**: What expertise are you capturing?
9137
+ 2. **Design Agents**: Create specialized roles with clear boundaries
9138
+ 3. **Build Resources**: Tasks, templates, checklists for your domain
9139
+ 4. **Test & Share**: Validate with real use cases, share with community
9140
+
9141
+ **Key Principle**: Expansion packs democratize expertise by making specialized knowledge accessible through AI agents.
9142
+
8929
9143
  ## Getting Help
8930
9144
 
8931
9145
  - **Commands**: Use `/help` in any environment to see available commands
8932
9146
  - **Agent Switching**: Use `/switch agent-name` with orchestrator for role changes
8933
9147
  - **Documentation**: Check `docs/` folder for project-specific context
8934
9148
  - **Community**: Discord and GitHub resources available for support
9149
+ - **Contributing**: See `CONTRIBUTING.md` for full guidelines
8935
9150
  ==================== END: data#bmad-kb ====================
8936
9151
 
8937
9152
  ==================== START: data#technical-preferences ====================