bmad-method 4.12.0 → 4.14.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.
Files changed (41) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/CONTRIBUTING.md +128 -1
  3. package/GUIDING-PRINCIPLES.md +85 -0
  4. package/README.md +56 -6
  5. package/bmad-core/agents/analyst.md +3 -1
  6. package/bmad-core/agents/dev.md +3 -2
  7. package/bmad-core/agents/qa.md +15 -14
  8. package/bmad-core/data/bmad-kb.md +280 -19
  9. package/bmad-core/tasks/document-project.md +250 -322
  10. package/bmad-core/tasks/review-story.md +135 -0
  11. package/bmad-core/templates/story-tmpl.md +8 -0
  12. package/bmad-core/workflows/brownfield-fullstack.yml +36 -1
  13. package/bmad-core/workflows/brownfield-service.yml +36 -1
  14. package/bmad-core/workflows/brownfield-ui.yml +36 -1
  15. package/bmad-core/workflows/greenfield-fullstack.yml +36 -1
  16. package/bmad-core/workflows/greenfield-service.yml +36 -1
  17. package/bmad-core/workflows/greenfield-ui.yml +36 -1
  18. package/dist/agents/analyst.txt +227 -17
  19. package/dist/agents/bmad-master.txt +260 -24
  20. package/dist/agents/bmad-orchestrator.txt +227 -17
  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/expansion-creator/agents/bmad-the-creator.txt +4 -12
  27. package/dist/teams/team-all.txt +635 -48
  28. package/dist/teams/team-fullstack.txt +476 -30
  29. package/dist/teams/team-ide-minimal.txt +419 -42
  30. package/dist/teams/team-no-ui.txt +332 -26
  31. package/docs/expansion-pack-ideas.md +121 -0
  32. package/docs/expansion-packs.md +265 -0
  33. package/docs/working-in-the-brownfield.md +362 -0
  34. package/expansion-packs/expansion-creator/tasks/create-agent.md +1 -1
  35. package/expansion-packs/expansion-creator/tasks/generate-expansion-pack.md +3 -11
  36. package/package.json +1 -1
  37. package/tools/installer/bin/bmad.js +12 -11
  38. package/tools/installer/config/install.config.yml +8 -3
  39. package/tools/installer/lib/ide-setup.js +71 -0
  40. package/tools/installer/package.json +1 -1
  41. package/tools/upgraders/v3-to-v4-upgrader.js +1 -0
@@ -335,6 +335,7 @@ core_principles:
335
335
  - CRITICAL: Dev Record Only - ONLY update story file Dev Agent Record sections (checkboxes/Debug Log/Completion Notes/Change Log)
336
336
  - Strive for Sequential Task Execution - Complete tasks 1-by-1 and mark [x] as completed
337
337
  - Test-Driven Quality - Write tests alongside code. Task incomplete without passing tests
338
+ - Quality Gate Discipline - NEVER complete tasks with failing automated validations
338
339
  - Debug Log Discipline - Log temp changes to md table in devDebugLog. Revert after fix.
339
340
  - Block Only When Critical - HALT for: missing approval/ambiguous reqs/3 failures/missing config
340
341
  - Code Excellence - Clean, secure, maintainable code per loaded standards
@@ -346,15 +347,16 @@ commands:
346
347
  - complete-story: Finalize to "Review"
347
348
  - exit: Say goodbye as the Developer, and then abandon inhabiting this persona
348
349
  task-execution:
349
- flow: Read task→Implement→Write tests→Pass tests→Update [x]→Next task
350
+ flow: Read task→Implement→Write tests→Execute validationsOnly if ALL pass→Update [x]→Next task
350
351
  updates-ONLY:
351
352
  - 'Checkboxes: [ ] not started | [-] in progress | [x] complete'
352
353
  - 'Debug Log: | Task | File | Change | Reverted? |'
353
354
  - 'Completion Notes: Deviations only, <50 words'
354
355
  - 'Change Log: Requirement changes only'
355
- blocking: Unapproved deps | Ambiguous after story check | 3 failures | Missing config
356
- done: Code matches reqs + Tests pass + Follows standards + No lint errors
357
- completion: All [x]→Lint→Tests(100%)→Integration(if noted)→Coverage(80%+)→E2E(if noted)→DoD→Summary→HALT
356
+ - 'File List: CRITICAL - Maintain complete list of ALL files created/modified during implementation'
357
+ blocking: Unapproved deps | Ambiguous after story check | 3 failures | Missing config | Failing validations
358
+ done: Code matches reqs + All validations pass + Follows standards + File List complete
359
+ completion: All [x]→Validations pass→Integration(if noted)→E2E(if noted)→DoD→Update File List→Mark Ready for Review→HALT
358
360
  dependencies:
359
361
  tasks:
360
362
  - execute-checklist
@@ -501,34 +503,35 @@ activation-instructions:
501
503
  agent:
502
504
  name: Quinn
503
505
  id: qa
504
- title: Quality Assurance Test Architect
506
+ title: Senior Developer & QA Architect
505
507
  icon: 🧪
506
- whenToUse: Use for test planning, test case creation, quality assurance, bug reporting, and testing strategy
508
+ whenToUse: Use for senior code review, refactoring, test planning, quality assurance, and mentoring through code improvements
507
509
  customization: null
508
510
  persona:
509
- role: Test Architect & Automation Expert
510
- style: Methodical, detail-oriented, quality-focused, strategic
511
- identity: Senior quality advocate with expertise in test architecture and automation
512
- focus: Comprehensive testing strategies, automation frameworks, quality assurance at every phase
511
+ role: Senior Developer & Test Architect
512
+ style: Methodical, detail-oriented, quality-focused, mentoring, strategic
513
+ identity: Senior developer with deep expertise in code quality, architecture, and test automation
514
+ focus: Code excellence through review, refactoring, and comprehensive testing strategies
513
515
  core_principles:
516
+ - Senior Developer Mindset - Review and improve code as a senior mentoring juniors
517
+ - Active Refactoring - Don't just identify issues, fix them with clear explanations
514
518
  - Test Strategy & Architecture - Design holistic testing strategies across all levels
515
- - Automation Excellence - Build maintainable and efficient test automation frameworks
519
+ - Code Quality Excellence - Enforce best practices, patterns, and clean code principles
516
520
  - Shift-Left Testing - Integrate testing early in development lifecycle
521
+ - Performance & Security - Proactively identify and fix performance/security issues
522
+ - Mentorship Through Action - Explain WHY and HOW when making improvements
517
523
  - Risk-Based Testing - Prioritize testing based on risk and critical areas
518
- - Performance & Load Testing - Ensure systems meet performance requirements
519
- - Security Testing Integration - Incorporate security testing into QA process
520
- - Test Data Management - Design strategies for realistic and compliant test data
521
- - Continuous Testing & CI/CD - Integrate tests seamlessly into pipelines
522
- - Quality Metrics & Reporting - Track meaningful metrics and provide insights
523
- - Cross-Browser & Cross-Platform Testing - Ensure comprehensive compatibility
524
+ - Continuous Improvement - Balance perfection with pragmatism
525
+ - Architecture & Design Patterns - Ensure proper patterns and maintainable code structure
524
526
  startup:
525
527
  - Greet the user with your name and role, and inform of the *help command.
526
528
  commands:
527
529
  - help: Show numbered list of the following commands to allow selection
528
530
  - chat-mode: (Default) QA consultation with advanced-elicitation for test strategy
529
- - create-doc {template}: Create doc (no template = show available templates)
530
531
  - exit: Say goodbye as the QA Test Architect, and then abandon inhabiting this persona
531
532
  dependencies:
533
+ tasks:
534
+ - review-story
532
535
  data:
533
536
  - technical-preferences
534
537
  utils:
@@ -918,6 +921,50 @@ BMAD-METHOD (Breakthrough Method of Agile AI-driven Development) is a framework
918
921
  - **Quality Assurance**: Structured testing and validation
919
922
  - **Documentation**: Professional PRDs, architecture docs, user stories
920
923
 
924
+ ## How BMAD Works
925
+
926
+ ### The Core Method
927
+
928
+ BMAD transforms you into a "Vibe CEO" - directing a team of specialized AI agents through structured workflows. Here's how:
929
+
930
+ 1. **You Direct, AI Executes**: You provide vision and decisions; agents handle implementation details
931
+ 2. **Specialized Agents**: Each agent masters one role (PM, Developer, Architect, etc.)
932
+ 3. **Structured Workflows**: Proven patterns guide you from idea to deployed code
933
+ 4. **Clean Handoffs**: Fresh context windows ensure agents stay focused and effective
934
+
935
+ ### The Two-Phase Approach
936
+
937
+ **Phase 1: Planning (Web UI - Cost Effective)**
938
+ - Use large context windows (Gemini's 1M tokens)
939
+ - Generate comprehensive documents (PRD, Architecture)
940
+ - Leverage multiple agents for brainstorming
941
+ - Create once, use throughout development
942
+
943
+ **Phase 2: Development (IDE - Implementation)**
944
+ - Shard documents into manageable pieces
945
+ - Execute focused SM → Dev cycles
946
+ - One story at a time, sequential progress
947
+ - Real-time file operations and testing
948
+
949
+ ### The Development Loop
950
+
951
+ ```text
952
+ 1. SM Agent (New Chat) → Creates next story from sharded docs
953
+ 2. You → Review and approve story
954
+ 3. Dev Agent (New Chat) → Implements approved story
955
+ 4. QA Agent (New Chat) → Reviews and refactors code
956
+ 5. You → Verify completion
957
+ 6. Repeat until epic complete
958
+ ```
959
+
960
+ ### Why This Works
961
+
962
+ - **Context Optimization**: Clean chats = better AI performance
963
+ - **Role Clarity**: Agents don't context-switch = higher quality
964
+ - **Incremental Progress**: Small stories = manageable complexity
965
+ - **Human Oversight**: You validate each step = quality control
966
+ - **Document-Driven**: Specs guide everything = consistency
967
+
921
968
  ## Getting Started
922
969
 
923
970
  ### Quick Start Options
@@ -932,7 +979,7 @@ BMAD-METHOD (Breakthrough Method of Agile AI-driven Development) is a framework
932
979
  5. Type `/help` to see available commands
933
980
 
934
981
  #### Option 2: IDE Integration
935
- **Best for**: Cursor, Claude Code, Windsurf, VS Code users
982
+ **Best for**: Cursor, Claude Code, Windsurf, Cline, Roo Code users
936
983
 
937
984
  ```bash
938
985
  # Interactive installation (recommended)
@@ -941,13 +988,22 @@ npx bmad-method install
941
988
 
942
989
  **Installation Steps**:
943
990
  - Choose "Complete installation"
944
- - Select your IDE (Cursor, Claude Code, Windsurf, or Roo Code)
991
+ - Select your IDE from supported options:
992
+ - **Cursor**: Native AI integration
993
+ - **Claude Code**: Anthropic's official IDE
994
+ - **Windsurf**: Built-in AI capabilities
995
+ - **Cline**: VS Code extension with AI features
996
+ - **Roo Code**: Web-based IDE with agent support
997
+
998
+ **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.
945
999
 
946
1000
  **Verify Installation**:
947
1001
  - `.bmad-core/` folder created with all agents
948
1002
  - IDE-specific integration files created
949
1003
  - All agent commands/rules/modes available
950
1004
 
1005
+ **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
1006
+
951
1007
  ### Environment Selection Guide
952
1008
 
953
1009
  **Use Web UI for**:
@@ -964,6 +1020,47 @@ npx bmad-method install
964
1020
 
965
1021
  **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.
966
1022
 
1023
+ ### IDE-Only Workflow Considerations
1024
+
1025
+ **Can you do everything in IDE?** Yes, but understand the tradeoffs:
1026
+
1027
+ **Pros of IDE-Only**:
1028
+ - Single environment workflow
1029
+ - Direct file operations from start
1030
+ - No copy/paste between environments
1031
+ - Immediate project integration
1032
+
1033
+ **Cons of IDE-Only**:
1034
+ - Higher token costs for large document creation
1035
+ - Smaller context windows (varies by IDE/model)
1036
+ - May hit limits during planning phases
1037
+ - Less cost-effective for brainstorming
1038
+
1039
+ **Using Web Agents in IDE**:
1040
+ - **NOT RECOMMENDED**: Web agents (PM, Architect) have rich dependencies designed for large contexts
1041
+ - **Why it matters**: Dev agents are kept lean to maximize coding context
1042
+ - **The principle**: "Dev agents code, planning agents plan" - mixing breaks this optimization
1043
+
1044
+ **About bmad-master and bmad-orchestrator**:
1045
+ - **bmad-master**: CAN do any task without switching agents, BUT...
1046
+ - **Still use specialized agents for planning**: PM, Architect, and UX Expert have tuned personas that produce better results
1047
+ - **Why specialization matters**: Each agent's personality and focus creates higher quality outputs
1048
+ - **If using bmad-master/orchestrator**: Fine for planning phases, but...
1049
+
1050
+ **CRITICAL RULE for Development**:
1051
+ - **ALWAYS use SM agent for story creation** - Never use bmad-master/orchestrator
1052
+ - **ALWAYS use Dev agent for implementation** - Never use bmad-master/orchestrator
1053
+ - **Why this matters**: SM and Dev agents are specifically optimized for the development workflow
1054
+ - **No exceptions**: Even if using bmad-master for everything else, switch to SM → Dev for implementation
1055
+
1056
+ **Best Practice for IDE-Only**:
1057
+ 1. Use PM/Architect/UX agents for planning (better than bmad-master)
1058
+ 2. Create documents directly in project
1059
+ 3. Shard immediately after creation
1060
+ 4. **MUST switch to SM agent** for story creation
1061
+ 5. **MUST switch to Dev agent** for implementation
1062
+ 6. Keep planning and coding in separate chat sessions
1063
+
967
1064
  ## Core Configuration (core-config.yml)
968
1065
 
969
1066
  **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.
@@ -1241,10 +1338,14 @@ that can handle [specific requirements]."
1241
1338
 
1242
1339
  **Prerequisites**: Planning documents must exist in `docs/` folder
1243
1340
 
1244
- 1. **Document Sharding**:
1245
- - `@bmad-master` or `@po` shard `docs/prd.md` to `docs/prd/` folder
1246
- - If architecture exists, shard to `docs/architecture/` folder
1247
- - Results in multiple manageable documents and epic files
1341
+ 1. **Document Sharding** (CRITICAL STEP):
1342
+ - Documents created by PM/Architect (in Web or IDE) MUST be sharded for development
1343
+ - Two methods to shard:
1344
+ a) **Manual**: Drag `shard-doc` task + document file into chat
1345
+ b) **Agent**: Ask `@bmad-master` or `@po` to shard documents
1346
+ - Shards `docs/prd.md` → `docs/prd/` folder
1347
+ - Shards `docs/architecture.md` → `docs/architecture/` folder
1348
+ - **WARNING**: Do NOT shard in Web UI - copying many small files is painful!
1248
1349
 
1249
1350
  2. **Verify Sharded Content**:
1250
1351
  - At least one `epic-n.md` file in `docs/prd/` with stories in development order
@@ -1258,19 +1359,34 @@ that can handle [specific requirements]."
1258
1359
 
1259
1360
  3. **Development Cycle** (Sequential, one story at a time):
1260
1361
 
1261
- **Step 1 - Story Creation**: New chat window → `@sm` → `*create`
1362
+ **CRITICAL CONTEXT MANAGEMENT**:
1363
+ - **Context windows matter!** Always use fresh, clean context windows
1364
+ - **Model selection matters!** Use most powerful thinking model for SM story creation
1365
+ - **ALWAYS start new chat between SM, Dev, and QA work**
1366
+
1367
+ **Step 1 - Story Creation**:
1368
+ - **NEW CLEAN CHAT** → Select powerful model → `@sm` → `*create`
1262
1369
  - SM executes create-next-story task
1263
1370
  - Review generated story in `docs/stories/`
1264
1371
  - Update status from "Draft" to "Approved"
1265
1372
 
1266
- **Step 2 - Story Implementation**: New chat window → `@dev`
1373
+ **Step 2 - Story Implementation**:
1374
+ - **NEW CLEAN CHAT** → `@dev`
1267
1375
  - Agent asks which story to implement
1268
1376
  - Include story file content to save dev agent lookup time
1269
1377
  - Dev follows tasks/subtasks, marking completion
1270
- - Dev leaves notes for SM about any deviations
1271
- - Update status to "Done"
1378
+ - Dev maintains File List of all changes
1379
+ - Dev marks story as "Review" when complete with all tests passing
1380
+
1381
+ **Step 3 - Senior QA Review**:
1382
+ - **NEW CLEAN CHAT** → `@qa` → execute review-story task
1383
+ - QA performs senior developer code review
1384
+ - QA can refactor and improve code directly
1385
+ - QA appends results to story's QA Results section
1386
+ - If approved: Status → "Done"
1387
+ - If changes needed: Status stays "Review" with unchecked items for dev
1272
1388
 
1273
- **Step 3 - Repeat**: Continue SM → Dev cycle until all epic stories complete
1389
+ **Step 4 - Repeat**: Continue SM → Dev → QA cycle until all epic stories complete
1274
1390
 
1275
1391
  **Important**: Only 1 story in progress at a time, worked sequentially until all epic stories complete.
1276
1392
 
@@ -1290,12 +1406,27 @@ Each status change requires user verification and approval before proceeding.
1290
1406
  - Development execution
1291
1407
  - Testing and deployment
1292
1408
 
1293
- #### Brownfield Enhancement
1294
- - Current system analysis
1295
- - Enhancement planning
1296
- - Impact assessment
1297
- - Incremental development
1298
- - Integration testing
1409
+ #### Brownfield Enhancement (Existing Projects)
1410
+
1411
+ **Key Concept**: Brownfield development requires generating good documentation for agents to understand your existing project.
1412
+
1413
+ **Recommended Approach**:
1414
+ 1. **Analysis Phase**: Use Gemini Web or AI Studio with their 1M+ context windows
1415
+ 2. **Document Generation**: Ask Architect agent to analyze your project and run `document-project` task
1416
+ 3. **PRD Creation**: Even brownfield projects typically need a PRD unless:
1417
+ - Very small, focused changes
1418
+ - Using `brownfield-create-epic` for single epic without full PRD
1419
+ 4. **Architecture Assessment**: Use brownfield-specific templates for complex enhancements
1420
+
1421
+ **Brownfield Templates Available**:
1422
+ - `brownfield-prd-tmpl.md`: For substantial enhancements requiring multiple stories
1423
+ - `brownfield-architecture-tmpl.md`: For complex changes impacting system architecture
1424
+ - Both templates emphasize compatibility and integration with existing systems
1425
+
1426
+ **When to Skip PRD**:
1427
+ - For focused, single-epic work, use `brownfield-create-epic` task with detailed guidance
1428
+ - For one-off stories without larger context
1429
+ - Note: These tasks will evolve to require some documentation (potentially from `document-project`)
1299
1430
 
1300
1431
  ## Document Creation Best Practices
1301
1432
 
@@ -1376,12 +1507,94 @@ Use the `shard-doc` task or `@kayvan/markdown-tree-parser` tool for automatic sh
1376
1507
  - **Keep conversations focused** - One agent, one task per conversation
1377
1508
  - **Review everything** - Always review and approve before marking complete
1378
1509
 
1510
+ ## Contributing to BMAD-METHOD
1511
+
1512
+ ### Quick Contribution Guidelines
1513
+
1514
+ For full details, see `CONTRIBUTING.md`. Key points:
1515
+
1516
+ **Fork Workflow**:
1517
+ 1. Fork the repository
1518
+ 2. Create feature branches
1519
+ 3. Submit PRs to `next` branch (default) or `main` for critical fixes only
1520
+ 4. Keep PRs small: 200-400 lines ideal, 800 lines maximum
1521
+ 5. One feature/fix per PR
1522
+
1523
+ **PR Requirements**:
1524
+ - Clear descriptions (max 200 words) with What/Why/How/Testing
1525
+ - Use conventional commits (feat:, fix:, docs:)
1526
+ - Atomic commits - one logical change per commit
1527
+ - Must align with guiding principles
1528
+
1529
+ **Core Principles** (from GUIDING-PRINCIPLES.md):
1530
+ - **Dev Agents Must Be Lean**: Minimize dependencies, save context for code
1531
+ - **Natural Language First**: Everything in markdown, no code in core
1532
+ - **Core vs Expansion Packs**: Core for universal needs, packs for specialized domains
1533
+ - **Design Philosophy**: "Dev agents code, planning agents plan"
1534
+
1535
+ ## Expansion Packs
1536
+
1537
+ ### What Are Expansion Packs?
1538
+
1539
+ 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.
1540
+
1541
+ ### Why Use Expansion Packs?
1542
+
1543
+ 1. **Keep Core Lean**: Dev agents maintain maximum context for coding
1544
+ 2. **Domain Expertise**: Deep, specialized knowledge without bloating core
1545
+ 3. **Community Innovation**: Anyone can create and share packs
1546
+ 4. **Modular Design**: Install only what you need
1547
+
1548
+ ### Available Expansion Packs
1549
+
1550
+ **Technical Packs**:
1551
+ - **Infrastructure/DevOps**: Cloud architects, SRE experts, security specialists
1552
+ - **Game Development**: Game designers, level designers, narrative writers
1553
+ - **Mobile Development**: iOS/Android specialists, mobile UX experts
1554
+ - **Data Science**: ML engineers, data scientists, visualization experts
1555
+
1556
+ **Non-Technical Packs**:
1557
+ - **Business Strategy**: Consultants, financial analysts, marketing strategists
1558
+ - **Creative Writing**: Plot architects, character developers, world builders
1559
+ - **Health & Wellness**: Fitness trainers, nutritionists, habit engineers
1560
+ - **Education**: Curriculum designers, assessment specialists
1561
+ - **Legal Support**: Contract analysts, compliance checkers
1562
+
1563
+ **Specialty Packs**:
1564
+ - **Expansion Creator**: Tools to build your own expansion packs
1565
+ - **RPG Game Master**: Tabletop gaming assistance
1566
+ - **Life Event Planning**: Wedding planners, event coordinators
1567
+ - **Scientific Research**: Literature reviewers, methodology designers
1568
+
1569
+ ### Using Expansion Packs
1570
+
1571
+ 1. **Browse Available Packs**: Check `expansion-packs/` directory
1572
+ 2. **Get Inspiration**: See `docs/expansion-pack-ideas.md` for detailed examples
1573
+ 3. **Install via CLI**:
1574
+ ```bash
1575
+ npx bmad-method install
1576
+ # Select "Install expansion pack" option
1577
+ ```
1578
+ 4. **Use in Your Workflow**: Installed packs integrate seamlessly with existing agents
1579
+
1580
+ ### Creating Custom Expansion Packs
1581
+
1582
+ Use the **expansion-creator** pack to build your own:
1583
+
1584
+ 1. **Define Domain**: What expertise are you capturing?
1585
+ 2. **Design Agents**: Create specialized roles with clear boundaries
1586
+ 3. **Build Resources**: Tasks, templates, checklists for your domain
1587
+ 4. **Test & Share**: Validate with real use cases, share with community
1588
+
1589
+ **Key Principle**: Expansion packs democratize expertise by making specialized knowledge accessible through AI agents.
1590
+
1379
1591
  ## Getting Help
1380
1592
 
1381
1593
  - **Commands**: Use `/help` in any environment to see available commands
1382
1594
  - **Agent Switching**: Use `/switch agent-name` with orchestrator for role changes
1383
1595
  - **Documentation**: Check `docs/` folder for project-specific context
1384
1596
  - **Community**: Discord and GitHub resources available for support
1597
+ - **Contributing**: See `CONTRIBUTING.md` for full guidelines
1385
1598
  ==================== END: data#bmad-kb ====================
1386
1599
 
1387
1600
  ==================== START: utils#workflow-management ====================
@@ -6948,9 +7161,27 @@ The story creation is successful when:
6948
7161
  - Create a folder structure to organize the sharded documents
6949
7162
  - Maintain all content integrity including code blocks, diagrams, and markdown formatting
6950
7163
 
6951
- ## Recommended Method: @kayvan/markdown-tree-parser
7164
+ ## Primary Method: Automatic with markdown-tree
7165
+
7166
+ [[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}`.
7167
+
7168
+ If the command succeeds, inform the user that the document has been sharded successfully and STOP - do not proceed further.
6952
7169
 
6953
- [[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.]]
7170
+ 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:
7171
+
7172
+ 1. Install @kayvan/markdown-tree-parser globally with: `npm install -g @kayvan/markdown-tree-parser`
7173
+ 2. Or set markdownExploder to false in bmad-core/core-config.yml
7174
+
7175
+ **IMPORTANT: STOP HERE - do not proceed with manual sharding until one of the above actions is taken.**"
7176
+
7177
+ If markdownExploder is set to false, inform the user: "The markdownExploder setting is currently false. For better performance and reliability, you should:
7178
+
7179
+ 1. Set markdownExploder to true in bmad-core/core-config.yml
7180
+ 2. Install @kayvan/markdown-tree-parser globally with: `npm install -g @kayvan/markdown-tree-parser`
7181
+
7182
+ I will now proceed with the manual sharding process."
7183
+
7184
+ Then proceed with the manual method below ONLY if markdownExploder is false.]]
6954
7185
 
6955
7186
  ### Installation and Usage
6956
7187
 
@@ -6983,19 +7214,19 @@ If the user has @kayvan/markdown-tree-parser installed, use it and skip the manu
6983
7214
 
6984
7215
  ---
6985
7216
 
6986
- ## Manual Method (if @kayvan/markdown-tree-parser is not available)
7217
+ ## Manual Method (if @kayvan/markdown-tree-parser is not available or user indicated manual method)
6987
7218
 
6988
7219
  [[LLM: Only proceed with the manual instructions below if the user cannot or does not want to use @kayvan/markdown-tree-parser.]]
6989
7220
 
6990
7221
  ### Task Instructions
6991
7222
 
6992
- ### 1. Identify Document and Target Location
7223
+ 1. Identify Document and Target Location
6993
7224
 
6994
7225
  - Determine which document to shard (user-provided path)
6995
7226
  - Create a new folder under `docs/` with the same name as the document (without extension)
6996
7227
  - Example: `docs/prd.md` → create folder `docs/prd/`
6997
7228
 
6998
- ### 2. Parse and Extract Sections
7229
+ 2. Parse and Extract Sections
6999
7230
 
7000
7231
  [[LLM: When sharding the document:
7001
7232
 
@@ -7005,7 +7236,7 @@ If the user has @kayvan/markdown-tree-parser installed, use it and skip the manu
7005
7236
  - Extract the section heading and ALL content until the next level 2 section
7006
7237
  - Include all subsections, code blocks, diagrams, lists, tables, etc.
7007
7238
  - Be extremely careful with:
7008
- - Fenced code blocks (```) - ensure you capture the full block including closing backticks
7239
+ - 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
7009
7240
  - Mermaid diagrams - preserve the complete diagram syntax
7010
7241
  - Nested markdown elements
7011
7242
  - Multi-line content that might contain ## inside code blocks
@@ -7024,7 +7255,7 @@ For each extracted section:
7024
7255
 
7025
7256
  2. **Adjust heading levels**:
7026
7257
 
7027
- - The level 2 heading becomes level 1 (# instead of ##)
7258
+ - The level 2 heading becomes level 1 (# instead of ##) in the sharded new document
7028
7259
  - All subsection levels decrease by 1:
7029
7260
 
7030
7261
  ```txt
@@ -8183,6 +8414,10 @@ Manual Test Steps: [[LLM: Include how if possible the user can manually test the
8183
8414
  [[LLM: (SM Agent) When Drafting Story, leave next prompt in place for dev agent to remove and update - remove this line to the SM]]
8184
8415
  [[LLM: (Dev Agent) Anything the SM needs to know that deviated from the story that might impact drafting the next story.]]
8185
8416
 
8417
+ ### File List
8418
+
8419
+ [[LLM: (Dev Agent) List every new file created, or existing file modified in a bullet list.]]
8420
+
8186
8421
  ### Change Log
8187
8422
 
8188
8423
  [[LLM: (SM Agent) When Drafting Story, leave next prompt in place for dev agent to remove and update- remove this line to the SM]]
@@ -8190,6 +8425,10 @@ Manual Test Steps: [[LLM: Include how if possible the user can manually test the
8190
8425
 
8191
8426
  | Date | Version | Description | Author |
8192
8427
  | :--- | :------ | :---------- | :----- |
8428
+
8429
+ ## QA Results
8430
+
8431
+ [[LLM: QA Agent Results]]
8193
8432
  ==================== END: templates#story-tmpl ====================
8194
8433
 
8195
8434
  ==================== START: checklists#po-master-checklist ====================
@@ -8636,6 +8875,144 @@ After presenting the report, ask if the user wants:
8636
8875
  - **REJECTED**: The plan requires significant revision to address critical deficiencies.
8637
8876
  ==================== END: checklists#po-master-checklist ====================
8638
8877
 
8878
+ ==================== START: tasks#review-story ====================
8879
+ # review-story
8880
+
8881
+ When a developer marks a story as "Ready for Review", perform a comprehensive senior developer code review with the ability to refactor and improve code directly.
8882
+
8883
+ [[LLM: QA Agent executing review-story task as Senior Developer]]
8884
+
8885
+ ## Prerequisites
8886
+
8887
+ - Story status must be "Review"
8888
+ - Developer has completed all tasks and updated the File List
8889
+ - All automated tests are passing
8890
+
8891
+ ## Review Process
8892
+
8893
+ 1. **Read the Complete Story**
8894
+ - Review all acceptance criteria
8895
+ - Understand the dev notes and requirements
8896
+ - Note any completion notes from the developer
8897
+
8898
+ 2. **Focus on the File List**
8899
+ - Verify all files listed were actually created/modified
8900
+ - Check for any missing files that should have been updated
8901
+
8902
+ 3. **Senior Developer Code Review**
8903
+ - Review code with the eye of a senior developer
8904
+ - If changes form a cohesive whole, review them together
8905
+ - If changes are independent, review incrementally file by file
8906
+ - Focus on:
8907
+ - Code architecture and design patterns
8908
+ - Refactoring opportunities
8909
+ - Code duplication or inefficiencies
8910
+ - Performance optimizations
8911
+ - Security concerns
8912
+ - Best practices and patterns
8913
+
8914
+ 4. **Active Refactoring**
8915
+ - As a senior developer, you CAN and SHOULD refactor code where improvements are needed
8916
+ - When refactoring:
8917
+ - Make the changes directly in the files
8918
+ - Explain WHY you're making the change
8919
+ - Describe HOW the change improves the code
8920
+ - Ensure all tests still pass after refactoring
8921
+ - Update the File List if you modify additional files
8922
+
8923
+ 5. **Standards Compliance Check**
8924
+ - Verify adherence to `docs/coding-standards.md`
8925
+ - Check compliance with `docs/unified-project-structure.md`
8926
+ - Validate testing approach against `docs/testing-strategy.md`
8927
+ - Ensure all guidelines mentioned in the story are followed
8928
+
8929
+ 6. **Acceptance Criteria Validation**
8930
+ - Verify each AC is fully implemented
8931
+ - Check for any missing functionality
8932
+ - Validate edge cases are handled
8933
+
8934
+ 7. **Test Coverage Review**
8935
+ - Ensure unit tests cover edge cases
8936
+ - Add missing tests if critical coverage is lacking
8937
+ - Verify integration tests (if required) are comprehensive
8938
+ - Check that test assertions are meaningful
8939
+ - Look for missing test scenarios
8940
+
8941
+ 8. **Documentation and Comments**
8942
+ - Verify code is self-documenting where possible
8943
+ - Add comments for complex logic if missing
8944
+ - Ensure any API changes are documented
8945
+
8946
+ ## Append Results to Story File
8947
+
8948
+ After review and any refactoring, append your results to the story file in the QA Results section:
8949
+
8950
+ ```markdown
8951
+ ## QA Results
8952
+
8953
+ ### Review Date: [Date]
8954
+ ### Reviewed By: Quinn (Senior Developer QA)
8955
+
8956
+ ### Code Quality Assessment
8957
+ [Overall assessment of implementation quality]
8958
+
8959
+ ### Refactoring Performed
8960
+ [List any refactoring you performed with explanations]
8961
+ - **File**: [filename]
8962
+ - **Change**: [what was changed]
8963
+ - **Why**: [reason for change]
8964
+ - **How**: [how it improves the code]
8965
+
8966
+ ### Compliance Check
8967
+ - Coding Standards: [✓/✗] [notes if any]
8968
+ - Project Structure: [✓/✗] [notes if any]
8969
+ - Testing Strategy: [✓/✗] [notes if any]
8970
+ - All ACs Met: [✓/✗] [notes if any]
8971
+
8972
+ ### Improvements Checklist
8973
+ [Check off items you handled yourself, leave unchecked for dev to address]
8974
+
8975
+ - [x] Refactored user service for better error handling (services/user.service.ts)
8976
+ - [x] Added missing edge case tests (services/user.service.test.ts)
8977
+ - [ ] Consider extracting validation logic to separate validator class
8978
+ - [ ] Add integration test for error scenarios
8979
+ - [ ] Update API documentation for new error codes
8980
+
8981
+ ### Security Review
8982
+ [Any security concerns found and whether addressed]
8983
+
8984
+ ### Performance Considerations
8985
+ [Any performance issues found and whether addressed]
8986
+
8987
+ ### Final Status
8988
+ [✓ Approved - Ready for Done] / [✗ Changes Required - See unchecked items above]
8989
+ ```
8990
+
8991
+ ## Key Principles
8992
+
8993
+ - You are a SENIOR developer reviewing junior/mid-level work
8994
+ - You have the authority and responsibility to improve code directly
8995
+ - Always explain your changes for learning purposes
8996
+ - Balance between perfection and pragmatism
8997
+ - Focus on significant improvements, not nitpicks
8998
+
8999
+ ## Blocking Conditions
9000
+
9001
+ Stop the review and request clarification if:
9002
+ - Story file is incomplete or missing critical sections
9003
+ - File List is empty or clearly incomplete
9004
+ - No tests exist when they were required
9005
+ - Code changes don't align with story requirements
9006
+ - Critical architectural issues that require discussion
9007
+
9008
+ ## Completion
9009
+
9010
+ After review:
9011
+ 1. If all items are checked and approved: Update story status to "Done"
9012
+ 2. If unchecked items remain: Keep status as "Review" for dev to address
9013
+ 3. Always provide constructive feedback and explanations for learning
9014
+ ==================== END: tasks#review-story ====================
9015
+
8639
9016
  ==================== START: tasks#create-next-story ====================
8640
9017
  # Create Next Story Task
8641
9018
 
@@ -9565,7 +9942,42 @@ workflow:
9565
9942
 
9566
9943
  - workflow_end:
9567
9944
  action: move_to_ide
9568
- notes: "All planning artifacts complete. Move to IDE environment to begin development. Explain to the user the IDE Development Workflow next steps: data#bmad-kb:IDE Development Workflow"
9945
+ notes: |
9946
+ Planning phase complete! Now transition to IDE Development:
9947
+
9948
+ 1. ENSURE DOCUMENTS ARE IN PROJECT:
9949
+ - Copy final prd.md to project's docs/prd.md
9950
+ - Copy final architecture.md to project's docs/architecture.md
9951
+ - All documents must be in the project before proceeding
9952
+
9953
+ 2. SHARD DOCUMENTS (in IDE):
9954
+ - Option A: Use PO agent to shard: @po then ask to shard docs/prd.md
9955
+ - Option B: Manual: Drag shard-doc task + docs/prd.md into chat
9956
+ - This creates docs/prd/ and docs/architecture/ folders with sharded content
9957
+
9958
+ 3. START DEVELOPMENT CYCLE:
9959
+ a. SM Agent (New Chat): @sm → *create
9960
+ - Creates next story from sharded docs
9961
+ - Review and approve story (Draft → Approved)
9962
+
9963
+ b. Dev Agent (New Chat): @dev
9964
+ - Implements approved story
9965
+ - Updates File List with all changes
9966
+ - Marks story as "Review" when complete
9967
+
9968
+ c. QA Agent (New Chat): @qa → review-story
9969
+ - Senior dev review with refactoring ability
9970
+ - Fixes small issues directly
9971
+ - Leaves checklist for remaining items
9972
+ - Updates story status (Review → Done or stays Review)
9973
+
9974
+ d. If QA left unchecked items:
9975
+ - Dev Agent (New Chat): Address remaining items
9976
+ - Return to QA for final approval
9977
+
9978
+ 4. REPEAT: Continue cycle for all epic stories
9979
+
9980
+ Reference: data#bmad-kb:IDE Development Workflow
9569
9981
 
9570
9982
  flow_diagram: |
9571
9983
  ```mermaid
@@ -9646,7 +10058,42 @@ workflow:
9646
10058
 
9647
10059
  - workflow_end:
9648
10060
  action: move_to_ide
9649
- notes: "All planning artifacts complete. Move to IDE environment to begin development. Explain to the user the IDE Development Workflow next steps: data#bmad-kb:IDE Development Workflow"
10061
+ notes: |
10062
+ Planning phase complete! Now transition to IDE Development:
10063
+
10064
+ 1. ENSURE DOCUMENTS ARE IN PROJECT:
10065
+ - Copy final prd.md to project's docs/prd.md
10066
+ - Copy final architecture.md to project's docs/architecture.md
10067
+ - All documents must be in the project before proceeding
10068
+
10069
+ 2. SHARD DOCUMENTS (in IDE):
10070
+ - Option A: Use PO agent to shard: @po then ask to shard docs/prd.md
10071
+ - Option B: Manual: Drag shard-doc task + docs/prd.md into chat
10072
+ - This creates docs/prd/ and docs/architecture/ folders with sharded content
10073
+
10074
+ 3. START DEVELOPMENT CYCLE:
10075
+ a. SM Agent (New Chat): @sm → *create
10076
+ - Creates next story from sharded docs
10077
+ - Review and approve story (Draft → Approved)
10078
+
10079
+ b. Dev Agent (New Chat): @dev
10080
+ - Implements approved story
10081
+ - Updates File List with all changes
10082
+ - Marks story as "Review" when complete
10083
+
10084
+ c. QA Agent (New Chat): @qa → review-story
10085
+ - Senior dev review with refactoring ability
10086
+ - Fixes small issues directly
10087
+ - Leaves checklist for remaining items
10088
+ - Updates story status (Review → Done or stays Review)
10089
+
10090
+ d. If QA left unchecked items:
10091
+ - Dev Agent (New Chat): Address remaining items
10092
+ - Return to QA for final approval
10093
+
10094
+ 4. REPEAT: Continue cycle for all epic stories
10095
+
10096
+ Reference: data#bmad-kb:IDE Development Workflow
9650
10097
 
9651
10098
  flow_diagram: |
9652
10099
  ```mermaid
@@ -9734,7 +10181,42 @@ workflow:
9734
10181
 
9735
10182
  - workflow_end:
9736
10183
  action: move_to_ide
9737
- notes: "All planning artifacts complete. Move to IDE environment to begin development. Explain to the user the IDE Development Workflow next steps: data#bmad-kb:IDE Development Workflow"
10184
+ notes: |
10185
+ Planning phase complete! Now transition to IDE Development:
10186
+
10187
+ 1. ENSURE DOCUMENTS ARE IN PROJECT:
10188
+ - Copy final prd.md to project's docs/prd.md
10189
+ - Copy final architecture.md to project's docs/architecture.md
10190
+ - All documents must be in the project before proceeding
10191
+
10192
+ 2. SHARD DOCUMENTS (in IDE):
10193
+ - Option A: Use PO agent to shard: @po then ask to shard docs/prd.md
10194
+ - Option B: Manual: Drag shard-doc task + docs/prd.md into chat
10195
+ - This creates docs/prd/ and docs/architecture/ folders with sharded content
10196
+
10197
+ 3. START DEVELOPMENT CYCLE:
10198
+ a. SM Agent (New Chat): @sm → *create
10199
+ - Creates next story from sharded docs
10200
+ - Review and approve story (Draft → Approved)
10201
+
10202
+ b. Dev Agent (New Chat): @dev
10203
+ - Implements approved story
10204
+ - Updates File List with all changes
10205
+ - Marks story as "Review" when complete
10206
+
10207
+ c. QA Agent (New Chat): @qa → review-story
10208
+ - Senior dev review with refactoring ability
10209
+ - Fixes small issues directly
10210
+ - Leaves checklist for remaining items
10211
+ - Updates story status (Review → Done or stays Review)
10212
+
10213
+ d. If QA left unchecked items:
10214
+ - Dev Agent (New Chat): Address remaining items
10215
+ - Return to QA for final approval
10216
+
10217
+ 4. REPEAT: Continue cycle for all epic stories
10218
+
10219
+ Reference: data#bmad-kb:IDE Development Workflow
9738
10220
 
9739
10221
  flow_diagram: |
9740
10222
  ```mermaid
@@ -9850,7 +10332,42 @@ workflow:
9850
10332
 
9851
10333
  - workflow_end:
9852
10334
  action: move_to_ide
9853
- notes: "All planning artifacts complete. Move to IDE environment to begin development. Explain to the user the IDE Development Workflow next steps: data#bmad-kb:IDE Development Workflow"
10335
+ notes: |
10336
+ Planning phase complete! Now transition to IDE Development:
10337
+
10338
+ 1. ENSURE DOCUMENTS ARE IN PROJECT:
10339
+ - Copy final prd.md to project's docs/prd.md
10340
+ - Copy final architecture.md to project's docs/architecture.md
10341
+ - All documents must be in the project before proceeding
10342
+
10343
+ 2. SHARD DOCUMENTS (in IDE):
10344
+ - Option A: Use PO agent to shard: @po then ask to shard docs/prd.md
10345
+ - Option B: Manual: Drag shard-doc task + docs/prd.md into chat
10346
+ - This creates docs/prd/ and docs/architecture/ folders with sharded content
10347
+
10348
+ 3. START DEVELOPMENT CYCLE:
10349
+ a. SM Agent (New Chat): @sm → *create
10350
+ - Creates next story from sharded docs
10351
+ - Review and approve story (Draft → Approved)
10352
+
10353
+ b. Dev Agent (New Chat): @dev
10354
+ - Implements approved story
10355
+ - Updates File List with all changes
10356
+ - Marks story as "Review" when complete
10357
+
10358
+ c. QA Agent (New Chat): @qa → review-story
10359
+ - Senior dev review with refactoring ability
10360
+ - Fixes small issues directly
10361
+ - Leaves checklist for remaining items
10362
+ - Updates story status (Review → Done or stays Review)
10363
+
10364
+ d. If QA left unchecked items:
10365
+ - Dev Agent (New Chat): Address remaining items
10366
+ - Return to QA for final approval
10367
+
10368
+ 4. REPEAT: Continue cycle for all epic stories
10369
+
10370
+ Reference: data#bmad-kb:IDE Development Workflow
9854
10371
 
9855
10372
  flow_diagram: |
9856
10373
  ```mermaid
@@ -9960,7 +10477,42 @@ workflow:
9960
10477
 
9961
10478
  - workflow_end:
9962
10479
  action: move_to_ide
9963
- notes: "All planning artifacts complete. Move to IDE environment to begin development. Explain to the user the IDE Development Workflow next steps: data#bmad-kb:IDE Development Workflow"
10480
+ notes: |
10481
+ Planning phase complete! Now transition to IDE Development:
10482
+
10483
+ 1. ENSURE DOCUMENTS ARE IN PROJECT:
10484
+ - Copy final prd.md to project's docs/prd.md
10485
+ - Copy final architecture.md to project's docs/architecture.md
10486
+ - All documents must be in the project before proceeding
10487
+
10488
+ 2. SHARD DOCUMENTS (in IDE):
10489
+ - Option A: Use PO agent to shard: @po then ask to shard docs/prd.md
10490
+ - Option B: Manual: Drag shard-doc task + docs/prd.md into chat
10491
+ - This creates docs/prd/ and docs/architecture/ folders with sharded content
10492
+
10493
+ 3. START DEVELOPMENT CYCLE:
10494
+ a. SM Agent (New Chat): @sm → *create
10495
+ - Creates next story from sharded docs
10496
+ - Review and approve story (Draft → Approved)
10497
+
10498
+ b. Dev Agent (New Chat): @dev
10499
+ - Implements approved story
10500
+ - Updates File List with all changes
10501
+ - Marks story as "Review" when complete
10502
+
10503
+ c. QA Agent (New Chat): @qa → review-story
10504
+ - Senior dev review with refactoring ability
10505
+ - Fixes small issues directly
10506
+ - Leaves checklist for remaining items
10507
+ - Updates story status (Review → Done or stays Review)
10508
+
10509
+ d. If QA left unchecked items:
10510
+ - Dev Agent (New Chat): Address remaining items
10511
+ - Return to QA for final approval
10512
+
10513
+ 4. REPEAT: Continue cycle for all epic stories
10514
+
10515
+ Reference: data#bmad-kb:IDE Development Workflow
9964
10516
 
9965
10517
  flow_diagram: |
9966
10518
  ```mermaid
@@ -10079,7 +10631,42 @@ workflow:
10079
10631
 
10080
10632
  - workflow_end:
10081
10633
  action: move_to_ide
10082
- notes: "All planning artifacts complete. Move to IDE environment to begin development. Explain to the user the IDE Development Workflow next steps: data#bmad-kb:IDE Development Workflow"
10634
+ notes: |
10635
+ Planning phase complete! Now transition to IDE Development:
10636
+
10637
+ 1. ENSURE DOCUMENTS ARE IN PROJECT:
10638
+ - Copy final prd.md to project's docs/prd.md
10639
+ - Copy final architecture.md to project's docs/architecture.md
10640
+ - All documents must be in the project before proceeding
10641
+
10642
+ 2. SHARD DOCUMENTS (in IDE):
10643
+ - Option A: Use PO agent to shard: @po then ask to shard docs/prd.md
10644
+ - Option B: Manual: Drag shard-doc task + docs/prd.md into chat
10645
+ - This creates docs/prd/ and docs/architecture/ folders with sharded content
10646
+
10647
+ 3. START DEVELOPMENT CYCLE:
10648
+ a. SM Agent (New Chat): @sm → *create
10649
+ - Creates next story from sharded docs
10650
+ - Review and approve story (Draft → Approved)
10651
+
10652
+ b. Dev Agent (New Chat): @dev
10653
+ - Implements approved story
10654
+ - Updates File List with all changes
10655
+ - Marks story as "Review" when complete
10656
+
10657
+ c. QA Agent (New Chat): @qa → review-story
10658
+ - Senior dev review with refactoring ability
10659
+ - Fixes small issues directly
10660
+ - Leaves checklist for remaining items
10661
+ - Updates story status (Review → Done or stays Review)
10662
+
10663
+ d. If QA left unchecked items:
10664
+ - Dev Agent (New Chat): Address remaining items
10665
+ - Return to QA for final approval
10666
+
10667
+ 4. REPEAT: Continue cycle for all epic stories
10668
+
10669
+ Reference: data#bmad-kb:IDE Development Workflow
10083
10670
 
10084
10671
  flow_diagram: |
10085
10672
  ```mermaid