bmad-method 4.6.3 → 4.8.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 (50) hide show
  1. package/.prettierignore +0 -1
  2. package/CHANGELOG.md +24 -0
  3. package/README.md +18 -1
  4. package/bmad-core/agents/analyst.md +11 -8
  5. package/bmad-core/agents/architect.md +10 -7
  6. package/bmad-core/agents/bmad-master.md +13 -11
  7. package/bmad-core/agents/bmad-orchestrator.md +3 -0
  8. package/bmad-core/agents/dev.md +19 -14
  9. package/bmad-core/agents/pm.md +8 -5
  10. package/bmad-core/agents/po.md +13 -10
  11. package/bmad-core/agents/qa.md +8 -5
  12. package/bmad-core/agents/sm.md +15 -25
  13. package/bmad-core/agents/ux-expert.md +11 -8
  14. package/bmad-core/core-config.yml +24 -0
  15. package/bmad-core/data/bmad-kb.md +391 -10
  16. package/bmad-core/tasks/create-next-story.md +63 -45
  17. package/bmad-core/utils/file-resolution-context.md +10 -0
  18. package/dist/agents/analyst.txt +404 -17
  19. package/dist/agents/architect.txt +14 -6
  20. package/dist/agents/bmad-master.txt +485 -109
  21. package/dist/agents/bmad-orchestrator.txt +402 -22
  22. package/dist/agents/dev.txt +26 -34
  23. package/dist/agents/pm.txt +9 -5
  24. package/dist/agents/po.txt +10 -10
  25. package/dist/agents/qa.txt +4 -4
  26. package/dist/agents/sm.txt +74 -63
  27. package/dist/agents/ux-expert.txt +9 -7
  28. package/dist/expansion-packs/bmad-2d-phaser-game-dev/teams/phaser-2d-nodejs-game-team.txt +49 -20
  29. package/dist/expansion-packs/expansion-creator/agents/bmad-the-creator.txt +6 -3
  30. package/dist/teams/team-all.txt +561 -158
  31. package/dist/teams/team-fullstack.txt +457 -57
  32. package/dist/teams/team-ide-minimal.txt +516 -133
  33. package/dist/teams/team-no-ui.txt +448 -50
  34. package/docs/bmad-workflow-guide.md +10 -8
  35. package/docs/claude-code-guide.md +1 -1
  36. package/docs/core-architecture.md +4 -4
  37. package/docs/cursor-guide.md +1 -1
  38. package/docs/roo-code-guide.md +1 -1
  39. package/docs/user-guide.md +30 -21
  40. package/docs/windsurf-guide.md +1 -1
  41. package/expansion-packs/bmad-infrastructure-devops/data/bmad-kb.md +3 -0
  42. package/expansion-packs/expansion-creator/templates/agent-tmpl.md +4 -1
  43. package/package.json +1 -1
  44. package/tools/builders/web-builder.js +158 -94
  45. package/tools/installer/bin/bmad.js +34 -2
  46. package/tools/installer/lib/file-manager.js +3 -2
  47. package/tools/installer/lib/ide-setup.js +39 -123
  48. package/tools/installer/lib/installer.js +13 -1
  49. package/tools/installer/package.json +1 -1
  50. /package/bmad-core/{templates/web-agent-startup-instructions-template.md → utils/web-agent-startup-instructions.md} +0 -0
@@ -12,6 +12,60 @@ BMAD-METHOD (Breakthrough Method of Agile AI-driven Development) is a framework
12
12
  - **Reusable Resources**: Portable templates, tasks, and checklists
13
13
  - **Slash Command Integration**: Quick agent switching and control
14
14
 
15
+ ### When to Use BMAD
16
+
17
+ - **New Projects (Greenfield)**: Complete end-to-end development
18
+ - **Existing Projects (Brownfield)**: Feature additions and enhancements
19
+ - **Team Collaboration**: Multiple roles working together
20
+ - **Quality Assurance**: Structured testing and validation
21
+ - **Documentation**: Professional PRDs, architecture docs, user stories
22
+
23
+ ## Getting Started
24
+
25
+ ### Quick Start Options
26
+
27
+ #### Option 1: Web UI
28
+ **Best for**: ChatGPT, Claude, Gemini users who want to start immediately
29
+
30
+ 1. Navigate to `dist/teams/`
31
+ 2. Copy `team-fullstack.txt` content
32
+ 3. Create new Gemini Gem or CustomGPT
33
+ 4. Upload file with instructions: "Your critical operating instructions are attached, do not break character as directed"
34
+ 5. Type `/help` to see available commands
35
+
36
+ #### Option 2: IDE Integration
37
+ **Best for**: Cursor, Claude Code, Windsurf, VS Code users
38
+
39
+ ```bash
40
+ # Interactive installation (recommended)
41
+ npx bmad-method install
42
+ ```
43
+
44
+ **Installation Steps**:
45
+ - Choose "Complete installation"
46
+ - Select your IDE (Cursor, Claude Code, Windsurf, or Roo Code)
47
+
48
+ **Verify Installation**:
49
+ - `.bmad-core/` folder created with all agents
50
+ - IDE-specific integration files created
51
+ - All agent commands/rules/modes available
52
+
53
+ ### Environment Selection Guide
54
+
55
+ **Use Web UI for**:
56
+ - Initial planning and documentation (PRD, architecture)
57
+ - Cost-effective document creation (especially with Gemini)
58
+ - Brainstorming and analysis phases
59
+ - Multi-agent consultation and planning
60
+
61
+ **Use IDE for**:
62
+ - Active development and coding
63
+ - File operations and project integration
64
+ - Document sharding and story management
65
+ - Implementation workflow (SM/Dev cycles)
66
+
67
+ **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.
68
+
15
69
  ## Core Philosophy
16
70
 
17
71
  ### Vibe CEO'ing
@@ -33,15 +87,342 @@ You are the "Vibe CEO" - thinking like a CEO with unlimited resources and a sing
33
87
  7. **START_SMALL_SCALE_FAST**: Test concepts, then expand.
34
88
  8. **EMBRACE_THE_CHAOS**: Adapt and overcome challenges.
35
89
 
36
- ## IDE Development Workflow
90
+ ### Key Workflow Principles
91
+
92
+ 1. **Agent Specialization**: Each agent has specific expertise and responsibilities
93
+ 2. **Clean Handoffs**: Always start fresh when switching between agents
94
+ 3. **Status Tracking**: Maintain story statuses (Draft → Approved → InProgress → Done)
95
+ 4. **Iterative Development**: Complete one story before starting the next
96
+ 5. **Documentation First**: Always start with solid PRD and architecture
97
+
98
+ ## Agent System
99
+
100
+ ### Core Development Team
101
+
102
+ | Agent | Role | Primary Functions | When to Use |
103
+ | ----------- | ------------------ | --------------------------------------- | -------------------------------------- |
104
+ | `analyst` | Business Analyst | Market research, requirements gathering | Project planning, competitive analysis |
105
+ | `pm` | Product Manager | PRD creation, feature prioritization | Strategic planning, roadmaps |
106
+ | `architect` | Solution Architect | System design, technical architecture | Complex systems, scalability planning |
107
+ | `dev` | Developer | Code implementation, debugging | All development tasks |
108
+ | `qa` | QA Specialist | Test planning, quality assurance | Testing strategies, bug validation |
109
+ | `ux-expert` | UX Designer | UI/UX design, prototypes | User experience, interface design |
110
+ | `po` | Product Owner | Backlog management, story validation | Story refinement, acceptance criteria |
111
+ | `sm` | Scrum Master | Sprint planning, story creation | Project management, workflow |
112
+
113
+ ### Meta Agents
114
+
115
+ | Agent | Role | Primary Functions | When to Use |
116
+ | ------------------- | ---------------- | ------------------------------------- | --------------------------------- |
117
+ | `bmad-orchestrator` | Team Coordinator | Multi-agent workflows, role switching | Complex multi-role tasks |
118
+ | `bmad-master` | Universal Expert | All capabilities without switching | Single-session comprehensive work |
119
+
120
+ ### Agent Interaction Commands
121
+
122
+ #### IDE-Specific Syntax
123
+
124
+ **Agent Loading by IDE**:
125
+ - **Claude Code**: `/agent-name` (e.g., `/bmad-master`)
126
+ - **Cursor**: `@agent-name` (e.g., `@bmad-master`)
127
+ - **Windsurf**: `@agent-name` (e.g., `@bmad-master`)
128
+ - **Roo Code**: Select mode from mode selector (e.g., `bmad-bmad-master`)
129
+
130
+ **Chat Management Guidelines**:
131
+ - **Claude Code, Cursor, Windsurf**: Start new chats when switching agents
132
+ - **Roo Code**: Switch modes within the same conversation
133
+
134
+ **Common Task Commands**:
135
+ - `*help` - Show available commands
136
+ - `*status` - Show current context/progress
137
+ - `*exit` - Exit the agent mode
138
+ - `*shard-doc docs/prd.md prd` - Shard PRD into manageable pieces
139
+ - `*shard-doc docs/architecture.md architecture` - Shard architecture document
140
+ - `*create` - Run create-next-story task (SM agent)
141
+
142
+ **In Web UI**:
143
+ ```text
144
+ /pm create-doc prd
145
+ /architect review system design
146
+ /dev implement story 1.2
147
+ /help - Show available commands
148
+ /switch agent-name - Change active agent (if orchestrator available)
149
+ ```
150
+
151
+ ## Team Configurations
152
+
153
+ ### Pre-Built Teams
154
+
155
+ #### Team All
156
+ - **Includes**: All 10 agents + orchestrator
157
+ - **Use Case**: Complete projects requiring all roles
158
+ - **Bundle**: `team-all.txt`
159
+
160
+ #### Team Fullstack
161
+ - **Includes**: PM, Architect, Developer, QA, UX Expert
162
+ - **Use Case**: End-to-end web/mobile development
163
+ - **Bundle**: `team-fullstack.txt`
164
+
165
+ #### Team No-UI
166
+ - **Includes**: PM, Architect, Developer, QA (no UX Expert)
167
+ - **Use Case**: Backend services, APIs, system development
168
+ - **Bundle**: `team-no-ui.txt`
169
+
170
+ ## Core Architecture
171
+
172
+ ### System Overview
173
+
174
+ The BMAD-Method is built around a modular architecture centered on the `bmad-core` directory, which serves as the brain of the entire system. This design enables the framework to operate effectively in both IDE environments (like Cursor, VS Code) and web-based AI interfaces (like ChatGPT, Gemini).
175
+
176
+ ### Key Architectural Components
177
+
178
+ #### 1. Agents (`bmad-core/agents/`)
179
+ - **Purpose**: Each markdown file defines a specialized AI agent for a specific Agile role (PM, Dev, Architect, etc.)
180
+ - **Structure**: Contains YAML headers specifying the agent's persona, capabilities, and dependencies
181
+ - **Dependencies**: Lists of tasks, templates, checklists, and data files the agent can use
182
+ - **Startup Instructions**: Can load project-specific documentation for immediate context
183
+
184
+ #### 2. Agent Teams (`bmad-core/agent-teams/`)
185
+ - **Purpose**: Define collections of agents bundled together for specific purposes
186
+ - **Examples**: `team-all.yml` (comprehensive bundle), `team-fullstack.yml` (full-stack development)
187
+ - **Usage**: Creates pre-packaged contexts for web UI environments
188
+
189
+ #### 3. Workflows (`bmad-core/workflows/`)
190
+ - **Purpose**: YAML files defining prescribed sequences of steps for specific project types
191
+ - **Types**: Greenfield (new projects) and Brownfield (existing projects) for UI, service, and fullstack development
192
+ - **Structure**: Defines agent interactions, artifacts created, and transition conditions
193
+
194
+ #### 4. Reusable Resources
195
+ - **Templates** (`bmad-core/templates/`): Markdown templates for PRDs, architecture specs, user stories
196
+ - **Tasks** (`bmad-core/tasks/`): Instructions for specific repeatable actions like "shard-doc" or "create-next-story"
197
+ - **Checklists** (`bmad-core/checklists/`): Quality assurance checklists for validation and review
198
+ - **Data** (`bmad-core/data/`): Core knowledge base and technical preferences
199
+
200
+ ### Dual Environment Architecture
201
+
202
+ #### IDE Environment
203
+
204
+ - Users interact directly with agent markdown files
205
+ - Agents can access all dependencies dynamically
206
+ - Supports real-time file operations and project integration
207
+ - Optimized for development workflow execution
208
+
209
+ #### Web UI Environment
210
+
211
+ - Uses pre-built bundles from `dist/teams` for stand alone 1 upload files for all agents and their assest with an orchestrating agent
212
+ - Single text files containing all agent dependencies are in `dist/agents/` - these are unnecessary unless you want to create a web agent that is only a single agent and not a team
213
+ - Created by the web-builder tool for upload to web interfaces
214
+ - Provides complete context in one package
215
+
216
+ ### Template Processing System
217
+
218
+ BMAD employs a sophisticated template system with three key components:
219
+
220
+ 1. **Template Format** (`utils/template-format.md`): Defines markup language for variable substitution and AI processing directives
221
+ 2. **Document Creation** (`tasks/create-doc.md`): Orchestrates template selection and user interaction
222
+ 3. **Advanced Elicitation** (`tasks/advanced-elicitation.md`): Provides interactive refinement through structured brainstorming
223
+
224
+ **Template Features**:
225
+
226
+ - **Self-contained**: Templates embed both output structure and processing instructions
227
+ - **Variable Substitution**: `{{placeholders}}` for dynamic content
228
+ - **AI Processing Directives**: `[[LLM: instructions]]` for AI-only processing
229
+ - **Interactive Refinement**: Built-in elicitation processes for quality improvement
230
+
231
+ ### Technical Preferences Integration
232
+
233
+ The `technical-preferences.md` file serves as a persistent technical profile that:
234
+ - Ensures consistency across all agents and projects
235
+ - Eliminates repetitive technology specification
236
+ - Provides personalized recommendations aligned with user preferences
237
+ - Evolves over time with lessons learned
238
+
239
+ ### Build and Delivery Process
240
+
241
+ The `web-builder.js` tool creates web-ready bundles by:
242
+ 1. Reading agent or team definition files
243
+ 2. Recursively resolving all dependencies
244
+ 3. Concatenating content into single text files with clear separators
245
+ 4. Outputting ready-to-upload bundles for web AI interfaces
246
+
247
+ This architecture enables seamless operation across environments while maintaining the rich, interconnected agent ecosystem that makes BMAD powerful.
248
+
249
+ ## Complete Development Workflow
250
+
251
+ ### Planning Phase (Web UI Recommended)
252
+
253
+ **Ideal for cost efficiency, especially with Gemini:**
254
+
255
+ 1. **Optional Analysis**: `/analyst` - Market research, competitive analysis
256
+ 2. **Project Brief**: Create foundation document (Analyst or user)
257
+ 3. **PRD Creation**: `/pm create-doc prd` - Comprehensive product requirements
258
+ 4. **Architecture Design**: `/architect create-doc architecture` - Technical foundation
259
+ 5. **Validation & Alignment**: `/po` run master checklist to ensure document consistency
260
+ 6. **Document Preparation**: Copy final documents to project as `docs/prd.md` and `docs/architecture.md`
261
+
262
+ #### Example Planning Prompts
263
+
264
+ **For PRD Creation**:
265
+ ```text
266
+ "I want to build a [type] application that [core purpose].
267
+ Help me brainstorm features and create a comprehensive PRD."
268
+ ```
269
+
270
+ **For Architecture Design**:
271
+ ```text
272
+ "Based on this PRD, design a scalable technical architecture
273
+ that can handle [specific requirements]."
274
+ ```
275
+
276
+ ### Critical Transition: Web UI to IDE
277
+
278
+ **Once planning is complete, you MUST switch to IDE for development:**
279
+
280
+ - **Why**: Development workflow requires file operations, real-time project integration, and document sharding
281
+ - **Cost Benefit**: Web UI is more cost-effective for large document creation; IDE is optimized for development tasks
282
+ - **Required Files**: Ensure `docs/prd.md` and `docs/architecture.md` exist in your project
283
+
284
+ ### IDE Development Workflow
285
+
286
+ **Prerequisites**: Planning documents must exist in `docs/` folder
287
+
288
+ 1. **Document Sharding**:
289
+ - `@bmad-master` or `@po` shard `docs/prd.md` to `docs/prd/` folder
290
+ - If architecture exists, shard to `docs/architecture/` folder
291
+ - Results in multiple manageable documents and epic files
292
+
293
+ 2. **Verify Sharded Content**:
294
+ - At least one `epic-n.md` file in `docs/prd/` with stories in development order
295
+ - Source tree document and coding standards for dev agent reference
296
+ - Sharded docs for SM agent story creation
297
+
298
+ **Resulting Folder Structure**:
299
+ - `docs/prd/` - Broken down PRD sections
300
+ - `docs/architecture/` - Broken down architecture sections
301
+ - `docs/stories/` - Generated user stories
302
+
303
+ 3. **Development Cycle** (Sequential, one story at a time):
304
+
305
+ **Step 1 - Story Creation**: New chat window → `@sm` → `*create`
306
+ - SM executes create-next-story task
307
+ - Review generated story in `docs/stories/`
308
+ - Update status from "Draft" to "Approved"
309
+
310
+ **Step 2 - Story Implementation**: New chat window → `@dev`
311
+ - Agent asks which story to implement
312
+ - Include story file content to save dev agent lookup time
313
+ - Dev follows tasks/subtasks, marking completion
314
+ - Dev leaves notes for SM about any deviations
315
+ - Update status to "Done"
316
+
317
+ **Step 3 - Repeat**: Continue SM → Dev cycle until all epic stories complete
318
+
319
+ **Important**: Only 1 story in progress at a time, worked sequentially until all epic stories complete.
320
+
321
+ ### Status Tracking Workflow
322
+
323
+ Stories progress through defined statuses:
324
+ - **Draft** → **Approved** → **InProgress** → **Done**
325
+
326
+ Each status change requires user verification and approval before proceeding.
327
+
328
+ ### Workflow Types
329
+
330
+ #### Greenfield Development
331
+ - Business analysis and market research
332
+ - Product requirements and feature definition
333
+ - System architecture and design
334
+ - Development execution
335
+ - Testing and deployment
336
+
337
+ #### Brownfield Enhancement
338
+ - Current system analysis
339
+ - Enhancement planning
340
+ - Impact assessment
341
+ - Incremental development
342
+ - Integration testing
343
+
344
+ ## Document Creation Best Practices
345
+
346
+ ### Required File Naming for Framework Integration
347
+
348
+ - `docs/prd.md` - Product Requirements Document
349
+ - `docs/architecture.md` - System Architecture Document
350
+
351
+ **Why These Names Matter**:
352
+ - Agents automatically reference these files during development
353
+ - Sharding tasks expect these specific filenames
354
+ - Workflow automation depends on standard naming
355
+
356
+ ### Cost-Effective Document Creation Workflow
357
+
358
+ **Recommended for Large Documents (PRD, Architecture):**
359
+
360
+ 1. **Use Web UI**: Create documents in web interface for cost efficiency
361
+ 2. **Copy Final Output**: Save complete markdown to your project
362
+ 3. **Standard Names**: Save as `docs/prd.md` and `docs/architecture.md`
363
+ 4. **Switch to IDE**: Use IDE agents for development and smaller documents
364
+
365
+ ### Document Sharding
366
+
367
+ Templates with Level 2 headings (`##`) can be automatically sharded:
368
+
369
+ **Original PRD**:
370
+ ```markdown
371
+ ## Goals and Background Context
372
+ ## Requirements
373
+ ## User Interface Design Goals
374
+ ## Success Metrics
375
+ ```
376
+
377
+ **After Sharding**:
378
+ - `docs/prd/goals-and-background-context.md`
379
+ - `docs/prd/requirements.md`
380
+ - `docs/prd/user-interface-design-goals.md`
381
+ - `docs/prd/success-metrics.md`
382
+
383
+ Use the `shard-doc` task or `@kayvan/markdown-tree-parser` tool for automatic sharding.
384
+
385
+ ## Usage Patterns and Best Practices
386
+
387
+ ### Environment-Specific Usage
388
+
389
+ **Web UI Best For**:
390
+ - Initial planning and documentation phases
391
+ - Cost-effective large document creation
392
+ - Agent consultation and brainstorming
393
+ - Multi-agent workflows with orchestrator
394
+
395
+ **IDE Best For**:
396
+ - Active development and implementation
397
+ - File operations and project integration
398
+ - Story management and development cycles
399
+ - Code review and debugging
400
+
401
+ ### Quality Assurance
402
+
403
+ - Use appropriate agents for specialized tasks
404
+ - Follow Agile ceremonies and review processes
405
+ - Maintain document consistency with PO agent
406
+ - Regular validation with checklists and templates
407
+
408
+ ### Performance Optimization
409
+
410
+ - Use specific agents vs. `bmad-master` for focused tasks
411
+ - Choose appropriate team size for project needs
412
+ - Leverage technical preferences for consistency
413
+ - Regular context management and cache clearing
414
+
415
+ ## Success Tips
416
+
417
+ - **Use Gemini for big picture planning** - The team-fullstack bundle provides collaborative expertise
418
+ - **Use bmad-master for document organization** - Sharding creates manageable chunks
419
+ - **Follow the SM → Dev cycle religiously** - This ensures systematic progress
420
+ - **Keep conversations focused** - One agent, one task per conversation
421
+ - **Review everything** - Always review and approve before marking complete
37
422
 
38
- 1. Shard the PRD (And Architecture documents if they exist also based on workflow type) using the Doc Shard task. The BMad-Master agent can help you do this. You will select the task, provide the doc to shard and the output folder. for example: `BMad Master, please Shard the docs/prd.md to the doc/prd/ folder` - this should ask you to use the md-tree-parser which is recommended, but either way shoudl result in multiple documents being created in the folder docs/prd.
39
- 2. If you have fullstack, front end and or back end architecture documents you will want to follow the same thing, but shard all of these to an architecture folder instead of a prd folder.
40
- 3. Ensure that you have at least one epic-n.md file in your prd folder, with the stories in order to develop.
41
- 4. The docs or architecture folder or prd folder should have a source tree document and coding standards at a minimum. These are used by the dev agent, and the many other sharded docs are used by the SM agent.
42
- 5. Use a new chat window to allow the SM agent to `draft the next story`.
43
- 6. If you agree the story is correct, mark it as approved in the status field, and then start a new chat window with the dev agent.
44
- 7. Ask the dev agent to implement the next story. If you draft the story file into the chat it will save time for the dev to have to find what the next one is. The dev should follow the tasks and subtasks marking them off as they are completed. The dev agent will also leave notes potentially for the SM to know about any deviations that might have occured to help draft the next story.
45
- 8. Once complete and you have verified, mark it done, and start a new chat. Ask the SM to draft the next story - repeating the cycle.
423
+ ## Getting Help
46
424
 
47
- With this work flow, there is only 1 story in progress at a time, worked sequentially.
425
+ - **Commands**: Use `/help` in any environment to see available commands
426
+ - **Agent Switching**: Use `/switch agent-name` with orchestrator for role changes
427
+ - **Documentation**: Check `docs/` folder for project-specific context
428
+ - **Community**: Discord and GitHub resources available for support
@@ -4,45 +4,42 @@
4
4
 
5
5
  To identify the next logical story based on project progress and epic definitions, and then to prepare a comprehensive, self-contained, and actionable story file using the `Story Template`. This task ensures the story is enriched with all necessary technical context, requirements, and acceptance criteria, making it ready for efficient implementation by a Developer Agent with minimal need for additional research.
6
6
 
7
- ## Inputs for this Task
8
-
9
- - Access to the project's documentation repository, specifically:
10
- - `docs/index.md` (hereafter "Index Doc")
11
- - All Epic files - located in one of these locations:
12
- - Primary: `docs/prd/epic-{n}-{description}.md` (e.g., `epic-1-foundation-core-infrastructure.md`)
13
- - Secondary: `docs/epics/epic-{n}-{description}.md`
14
- - User-specified location if not found in above paths
15
- - Existing story files in `docs/stories/`
16
- - Main PRD (hereafter "PRD Doc")
17
- - Main Architecture Document (hereafter "Main Arch Doc")
18
- - Frontend Architecture Document (hereafter "Frontend Arch Doc," if relevant)
19
- - Project Structure Guide (`docs/project-structure.md`)
20
- - Operational Guidelines Document (`docs/operational-guidelines.md`)
21
- - Technology Stack Document (`docs/tech-stack.md`)
22
- - Data Models Document (as referenced in Index Doc)
23
- - API Reference Document (as referenced in Index Doc)
24
- - UI/UX Specifications, Style Guides, Component Guides (if relevant, as referenced in Index Doc)
25
- - The `bmad-core/templates/story-tmpl.md` (hereafter "Story Template")
26
- - The `bmad-core/checklists/story-draft-checklist.md` (hereafter "Story Draft Checklist")
27
- - User confirmation to proceed with story identification and, if needed, to override warnings about incomplete prerequisite stories.
28
-
29
7
  ## Task Execution Instructions
30
8
 
9
+ ### 0. Load Core Configuration
10
+
11
+ [[LLM: CRITICAL - This MUST be your first step]]
12
+
13
+ - Load `.bmad-core/core-config.yml` from the project root
14
+ - If the file does not exist:
15
+ - HALT and inform the user: "core-config.yml not found. This file is required for story creation. You can:
16
+ 1. Copy it from GITHUB BMAD-METHOD/bmad-core/core-config.yml and configure it for your project
17
+ 2. Run the BMAD installer against your project to upgrade and add the file automatically
18
+ Please add and configure core-config.yml before proceeding."
19
+ - Extract the following key configurations:
20
+ - `dev-story-location`: Where to save story files
21
+ - `prd.prdSharded`: Whether PRD is sharded or monolithic
22
+ - `prd.prd-file`: Location of monolithic PRD (if not sharded)
23
+ - `prd.prdShardedLocation`: Location of sharded epic files
24
+ - `prd.epicFilePattern`: Pattern for epic files (e.g., `epic-{n}*.md`)
25
+ - `architecture.architectureVersion`: Architecture document version
26
+ - `architecture.architectureSharded`: Whether architecture is sharded
27
+ - `architecture.architecture-file`: Location of monolithic architecture
28
+ - `architecture.architectureShardedLocation`: Location of sharded architecture files
29
+
31
30
  ### 1. Identify Next Story for Preparation
32
31
 
33
32
  #### 1.1 Locate Epic Files
34
33
 
35
- - First, determine where epic files are located:
36
- - Check `docs/prd/` for files matching pattern `epic-{n}-*.md`
37
- - If not found, check `docs/epics/` for files matching pattern `epic-{n}-*.md`
38
- - If still not found, ask user: "Unable to locate epic files. Please specify the path where epic files are stored."
39
- - Note: Epic files follow naming convention `epic-{n}-{description}.md` (e.g., `epic-1-foundation-core-infrastructure.md`)
34
+ - Based on `prdSharded` from config:
35
+ - **If `prdSharded: true`**: Look for epic files in `prdShardedLocation` using `epicFilePattern`
36
+ - **If `prdSharded: false`**: Load the full PRD from `prd-file` and extract epics from section headings (## Epic N or ### Epic N)
40
37
 
41
38
  #### 1.2 Review Existing Stories
42
39
 
43
- - Review `docs/stories/` to find the highest-numbered story file.
40
+ - Check `dev-story-location` from config (e.g., `docs/stories/`) for existing story files
41
+ - If the directory exists and has at least 1 file, find the highest-numbered story file.
44
42
  - **If a highest story file exists (`{lastEpicNum}.{lastStoryNum}.story.md`):**
45
-
46
43
  - Verify its `Status` is 'Done' (or equivalent).
47
44
  - If not 'Done', present an alert to the user:
48
45
 
@@ -60,17 +57,17 @@ To identify the next logical story based on project progress and epic definition
60
57
  ```
61
58
 
62
59
  - Proceed only if user selects option 3 (Override) or if the last story was 'Done'.
63
- - If proceeding: Look for the Epic File for `{lastEpicNum}` (e.g., `epic-{lastEpicNum}-*.md`) and check for a story numbered `{lastStoryNum + 1}`. If it exists and its prerequisites (per Epic File) are met, this is the next story.
64
- - Else (story not found or prerequisites not met): The next story is the first story in the next Epic File (e.g., look for `epic-{lastEpicNum + 1}-*.md`, then `epic-{lastEpicNum + 2}-*.md`, etc.) whose prerequisites are met.
60
+ - If proceeding: Look for the Epic File for `{lastEpicNum}` (e.g., `epic-{lastEpicNum}*.md`) and check for a story numbered `{lastStoryNum + 1}`. If it exists and its prerequisites (per Epic File) are met, this is the next story.
61
+ - Else (story not found or prerequisites not met): The next story is the first story in the next Epic File (e.g., look for `epic-{lastEpicNum + 1}*.md`, then `epic-{lastEpicNum + 2}*.md`, etc.) whose prerequisites are met.
65
62
 
66
63
  - **If no story files exist in `docs/stories/`:**
67
64
  - The next story is the first story in the first epic file (look for `epic-1-*.md`, then `epic-2-*.md`, etc.) whose prerequisites are met.
68
65
  - If no suitable story with met prerequisites is found, report to the user that story creation is blocked, specifying what prerequisites are pending. HALT task.
69
66
  - Announce the identified story to the user: "Identified next story for preparation: {epicNum}.{storyNum} - {Story Title}".
70
67
 
71
- ### 2. Gather Core Story Requirements (from Epic File)
68
+ ### 2. Gather Core Story Requirements (from Epic)
72
69
 
73
- - For the identified story, open its parent Epic File (e.g., `epic-{epicNum}-*.md` from the location identified in step 1.1).
70
+ - For the identified story, review its parent Epic (e.g., `epic-{epicNum}*.md` from the location identified in step 1.1).
74
71
  - Extract: Exact Title, full Goal/User Story statement, initial list of Requirements, all Acceptance Criteria (ACs), and any predefined high-level Tasks.
75
72
  - Keep a record of this original epic-defined scope for later deviation analysis.
76
73
 
@@ -79,7 +76,7 @@ To identify the next logical story based on project progress and epic definition
79
76
  [[LLM: This step is CRITICAL for continuity and learning from implementation experience]]
80
77
 
81
78
  - If this is not the first story (i.e., previous story exists):
82
- - Read the previous story file: `docs/stories/{prevEpicNum}.{prevStoryNum}.story.md`
79
+ - Read the previous sequential story from `docs/stories`
83
80
  - Pay special attention to:
84
81
  - Dev Agent Record sections (especially Completion Notes and Debug Log References)
85
82
  - Any deviations from planned implementation
@@ -88,18 +85,30 @@ To identify the next logical story based on project progress and epic definition
88
85
  - Any "lessons learned" or notes for future stories
89
86
  - Extract relevant insights that might inform the current story's preparation
90
87
 
91
- ### 4. Gather & Synthesize Architecture Context from Sharded Docs
88
+ ### 4. Gather & Synthesize Architecture Context
89
+
90
+ [[LLM: CRITICAL - You MUST gather technical details from the architecture documents. NEVER make up technical details not found in these documents.]]
92
91
 
93
- [[LLM: CRITICAL - You MUST gather technical details from the sharded architecture documents. NEVER make up technical details not found in these documents.]]
92
+ #### 4.1 Determine Architecture Document Strategy
94
93
 
95
- #### 4.1 Start with Architecture Index
94
+ Based on configuration loaded in Step 0:
96
95
 
97
- - Read `docs/architecture/index.md` to understand the full scope of available documentation
98
- - Identify which sharded documents are most relevant to the current story
96
+ - **If `architectureVersion: v4` and `architectureSharded: true`**:
97
+ - Read `{architectureShardedLocation}/index.md` to understand available documentation
98
+ - Follow the structured reading order in section 4.2 below
99
+
100
+ - **If `architectureVersion: v4` and `architectureSharded: false`**:
101
+ - Load the monolithic architecture from `architecture-file`
102
+ - Extract relevant sections based on v4 structure (tech stack, project structure, etc.)
103
+
104
+ - **If `architectureVersion` is NOT v4**:
105
+ - Inform user: "Architecture document is not v4 format. Will use best judgment to find relevant information."
106
+ - If `architectureSharded: true`: Search sharded files by filename relevance
107
+ - If `architectureSharded: false`: Search within monolithic `architecture-file` for relevant sections
99
108
 
100
- #### 4.2 Recommended Reading Order Based on Story Type
109
+ #### 4.2 Recommended Reading Order Based on Story Type (v4 Sharded Only)
101
110
 
102
- [[LLM: Read documents in this order, but ALWAYS verify relevance to the specific story. Skip irrelevant sections but NEVER skip documents that contain information needed for the story.]]
111
+ [[LLM: Use this structured approach ONLY for v4 sharded architecture. For other versions, use best judgment based on file names and content.]]
103
112
 
104
113
  **For ALL Stories:**
105
114
 
@@ -108,9 +117,18 @@ To identify the next logical story based on project progress and epic definition
108
117
  3. `docs/architecture/coding-standards.md` - Ensure dev follows project conventions
109
118
  4. `docs/architecture/testing-strategy.md` - Include testing requirements in tasks
110
119
 
111
- **For Backend/API Stories, additionally read:** 5. `docs/architecture/data-models.md` - Data structures and validation rules 6. `docs/architecture/database-schema.md` - Database design and relationships 7. `docs/architecture/backend-architecture.md` - Service patterns and structure 8. `docs/architecture/rest-api-spec.md` - API endpoint specifications 9. `docs/architecture/external-apis.md` - Third-party integrations (if relevant)
120
+ **For Backend/API Stories, additionally read:**
121
+ 5. `docs/architecture/data-models.md` - Data structures and validation rules
122
+ 6. `docs/architecture/database-schema.md` - Database design and relationships
123
+ 7. `docs/architecture/backend-architecture.md` - Service patterns and structure
124
+ 8. `docs/architecture/rest-api-spec.md` - API endpoint specifications
125
+ 9. `docs/architecture/external-apis.md` - Third-party integrations (if relevant)
112
126
 
113
- **For Frontend/UI Stories, additionally read:** 5. `docs/architecture/frontend-architecture.md` - Component structure and patterns 6. `docs/architecture/components.md` - Specific component designs 7. `docs/architecture/core-workflows.md` - User interaction flows 8. `docs/architecture/data-models.md` - Frontend data handling
127
+ **For Frontend/UI Stories, additionally read:**
128
+ 5. `docs/architecture/frontend-architecture.md` - Component structure and patterns
129
+ 6. `docs/architecture/components.md` - Specific component designs
130
+ 7. `docs/architecture/core-workflows.md` - User interaction flows
131
+ 8. `docs/architecture/data-models.md` - Frontend data handling
114
132
 
115
133
  **For Full-Stack Stories:**
116
134
 
@@ -143,7 +161,7 @@ Format references as: `[Source: architecture/{filename}.md#{section}]`
143
161
 
144
162
  ### 6. Populate Story Template with Full Context
145
163
 
146
- - Create a new story file: `docs/stories/{epicNum}.{storyNum}.story.md`.
164
+ - Create a new story file: `{dev-story-location}/{epicNum}.{storyNum}.story.md` (using location from config).
147
165
  - Use the Story Template to structure the file.
148
166
  - Fill in:
149
167
  - Story `{EpicNum}.{StoryNum}: {Short Title Copied from Epic File}`
@@ -190,7 +208,7 @@ Format references as: `[Source: architecture/{filename}.md#{section}]`
190
208
  - Verify all source references are included for technical details
191
209
  - Ensure tasks align with both epic requirements and architecture constraints
192
210
  - Update status to "Draft"
193
- - Save the story file to `docs/stories/{epicNum}.{storyNum}.story.md`
211
+ - Save the story file to `{dev-story-location}/{epicNum}.{storyNum}.story.md` (using location from config)
194
212
 
195
213
  ### 9. Report Completion
196
214
 
@@ -0,0 +1,10 @@
1
+ # File Resolution Context
2
+
3
+ Update the installer/upgrader so that when agents are added to a project (under Add these two lines to any agent's `activation-instructions` for ide installation:
4
+
5
+ ```yaml
6
+ - IDE-FILE-RESOLUTION: Dependencies map to files as {root}/{type}/{name}.md where root=".bmad-core", type=folder (tasks/templates/checklists/utils), name=dependency name.
7
+ - REQUEST-RESOLUTION: Match user requests to your commands/dependencies flexibly (e.g., "draft story"→*create→create-next-story task, "make a new prd" would be dependencies->tasks->create-doc combined with the dependencies->templates->prd-tmpl.md), or ask for clarification if ambiguous.
8
+ ```
9
+
10
+ and add `root: .bmad-core` as the first root yml property.