bmad-method 1.1.0 → 4.4.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 (87) hide show
  1. package/.bmad-core/agents/analyst.md +14 -20
  2. package/.bmad-core/agents/architect.md +15 -20
  3. package/.bmad-core/agents/bmad-master.md +18 -26
  4. package/.bmad-core/agents/bmad-orchestrator.md +16 -28
  5. package/.bmad-core/agents/dev.md +5 -4
  6. package/.bmad-core/agents/pm.md +11 -16
  7. package/.bmad-core/agents/sm.md +20 -25
  8. package/.bmad-core/bmad-core-config.yml +60 -0
  9. package/.bmad-core/data/bmad-kb.md +12 -1
  10. package/.bmad-core/tasks/doc-migration-task.md +91 -146
  11. package/.bmad-core/tasks/document-project.md +389 -0
  12. package/.bmad-core/tasks/generate-ai-frontend-prompt.md +41 -48
  13. package/.bmad-core/tasks/index-docs.md +4 -1
  14. package/.bmad-core/templates/architecture-tmpl.md +15 -12
  15. package/.bmad-core/templates/fullstack-architecture-tmpl.md +85 -103
  16. package/.bmad-core/templates/prd-tmpl.md +1 -1
  17. package/.bmad-core/templates/simple-project-prd-tmpl.md +461 -0
  18. package/.bmad-core/templates/story-tmpl.md +2 -2
  19. package/.bmad-core/utils/workflow-management.md +14 -15
  20. package/.bmad-core/web-bundles/agents/analyst.txt +26 -21
  21. package/.bmad-core/web-bundles/agents/architect.txt +605 -233
  22. package/.bmad-core/web-bundles/agents/bmad-master.txt +457 -1039
  23. package/.bmad-core/web-bundles/agents/bmad-orchestrator.txt +36 -903
  24. package/.bmad-core/web-bundles/agents/dev.txt +5 -4
  25. package/.bmad-core/web-bundles/agents/pm.txt +476 -17
  26. package/.bmad-core/web-bundles/agents/po.txt +2 -2
  27. package/.bmad-core/web-bundles/agents/sm.txt +22 -27
  28. package/.bmad-core/web-bundles/agents/ux-expert.txt +41 -48
  29. package/.bmad-core/web-bundles/teams/team-all.txt +4394 -4447
  30. package/.bmad-core/web-bundles/teams/team-fullstack.txt +2760 -2809
  31. package/.bmad-core/web-bundles/teams/team-no-ui.txt +2718 -2760
  32. package/.bmad-core/workflows/greenfield-fullstack.yml +3 -3
  33. package/.claude/commands/analyst.md +14 -20
  34. package/.claude/commands/architect.md +15 -20
  35. package/.claude/commands/bmad-master.md +18 -26
  36. package/.claude/commands/bmad-orchestrator.md +16 -28
  37. package/.claude/commands/dev.md +5 -4
  38. package/.claude/commands/pm.md +11 -16
  39. package/.claude/commands/sm.md +20 -25
  40. package/.cursor/rules/analyst.mdc +13 -19
  41. package/.cursor/rules/architect.mdc +14 -19
  42. package/.cursor/rules/bmad-master.mdc +18 -26
  43. package/.cursor/rules/bmad-orchestrator.mdc +15 -27
  44. package/.cursor/rules/dev.mdc +5 -4
  45. package/.cursor/rules/pm.mdc +11 -16
  46. package/.cursor/rules/sm.mdc +19 -24
  47. package/.releaserc.json +2 -1
  48. package/.vscode/settings.json +4 -0
  49. package/.windsurf/rules/analyst.md +13 -19
  50. package/.windsurf/rules/architect.md +14 -19
  51. package/.windsurf/rules/bmad-master.md +18 -26
  52. package/.windsurf/rules/bmad-orchestrator.md +15 -27
  53. package/.windsurf/rules/dev.md +5 -4
  54. package/.windsurf/rules/pm.md +11 -16
  55. package/.windsurf/rules/sm.md +19 -24
  56. package/CHANGELOG.md +120 -2
  57. package/CONTRIBUTING.md +2 -0
  58. package/README.md +21 -3
  59. package/{.bmad-core → creator-tools}/tasks/create-agent.md +10 -12
  60. package/{.bmad-core/tasks/create-expansion-pack.md → creator-tools/tasks/generate-expansion-pack.md} +8 -6
  61. package/docs/bmad-workflow-guide.md +161 -0
  62. package/docs/claude-code-guide.md +119 -0
  63. package/docs/core-architecture.md +213 -0
  64. package/docs/cursor-guide.md +127 -0
  65. package/docs/how-to-contribute-with-pull-requests.md +141 -0
  66. package/docs/roo-code-guide.md +140 -0
  67. package/docs/user-guide.md +1044 -0
  68. package/docs/windsurf-guide.md +127 -0
  69. package/expansion-packs/README.md +1 -111
  70. package/expansion-packs/infrastructure-devops/agents/infra-devops-platform.md +1 -1
  71. package/expansion-packs/infrastructure-devops/tasks/create-doc.md +74 -0
  72. package/package.json +19 -13
  73. package/tools/builders/web-builder.js +16 -15
  74. package/tools/installer/bin/bmad.js +50 -29
  75. package/tools/installer/lib/file-manager.js +20 -3
  76. package/tools/installer/lib/ide-setup.js +11 -1
  77. package/tools/installer/lib/installer.js +149 -29
  78. package/tools/installer/package-lock.json +537 -335
  79. package/tools/installer/package.json +7 -7
  80. package/tools/lib/dependency-resolver.js +1 -1
  81. package/tools/semantic-release-sync-installer.js +31 -0
  82. package/tools/sync-installer-version.js +34 -0
  83. package/tools/upgraders/v3-to-v4-upgrader.js +18 -13
  84. package/tools/version-bump.js +33 -26
  85. package/tools/yaml-format.js +54 -25
  86. package/.bmad-core/schemas/agent-team-schema.yml +0 -153
  87. package/.bmad-core/tasks/create-team.md +0 -229
@@ -2,197 +2,142 @@
2
2
 
3
3
  ## Purpose
4
4
 
5
- Migrate BMAD-METHOD documents to match V4 template structure exactly, preserving all content while enforcing strict template compliance.
5
+ Simple document migration that cleans up heading formats and adds epic structure for PRDs.
6
6
 
7
7
  ## Task Requirements
8
8
 
9
- 1. **Input**: User MUST specify the document to migrate (e.g., `docs/prd.md`)
10
- 2. **Template**: User MUST specify the V4 template to use (e.g., `.bmad-core/templates/prd-tmpl.md`)
11
- 3. **Validation**: Verify document and template are compatible types
12
- 4. **Output**: Creates migrated document with original name, backs up original with `.bak` extension
13
-
14
- [[LLM: VALIDATION REQUIREMENTS:
15
-
16
- - Both input document and template paths MUST be provided by the user
17
- - Do NOT assume or select templates automatically
18
- - Validate that document type matches template type (e.g., PRD → PRD template)
19
- - Reject incompatible migrations (e.g., PRD → architecture template)
20
-
21
- ]]
9
+ 1. **Input**: User specifies the document to migrate (e.g., `docs/prd.md`)
10
+ 2. **Detection**: Automatically determine if it's a PRD or other document type
11
+ 3. **Migration**: Apply appropriate transformations
12
+ 4. **Backup**: Create backup with `.bak` extension
22
13
 
23
14
  ## Migration Rules
24
15
 
25
- ### Strict Template Compliance
26
-
27
- [[LLM: CRITICAL RULES:
28
-
29
- 1. The ONLY Level 2 headings (##) allowed are EXACTLY those in the V4 template
30
- 2. No additions, no removals, no modifications to Level 2 headings
31
- 3. All user content must be preserved and placed under appropriate template sections
32
- 4. Remove any existing table of contents
33
- 5. Never delete user content - find the most appropriate section
34
- 6. DO NOT add any LLM prompts, placeholders, or "TBD" content
35
- 7. Leave empty sections empty - no instructions or guidance text
36
-
37
- ]]
16
+ ### For PRDs
38
17
 
39
- ### Content Migration Process
18
+ - Find all level 3 headings that appear to be epics
19
+ - Add a level 2 heading "## Epic #" (incrementing number) before each epic
20
+ - Also apply the heading cleanup rules below
40
21
 
41
- 1. **Read Template Structure**
22
+ ### For All Documents
42
23
 
43
- - Extract all Level 2 headings from the V4 template
44
- - These are the ONLY Level 2 headings allowed in the final document
24
+ - Find all level 2 headings (`## ...`)
25
+ - Remove leading numbers and symbols
26
+ - Keep only alphabetic characters and spaces
27
+ - **CRITICAL**: Do not lose any information - preserve all content under appropriate headings
28
+ - Examples:
29
+ - `## 1. Foo & Bar` → `## Foo Bar`
30
+ - `## 2.1 Technical Overview` → `## Technical Overview`
31
+ - `## 3) User Experience` → `## User Experience`
45
32
 
46
- 2. **Analyze Original Document**
33
+ ### For Architecture Documents
47
34
 
48
- - Identify all content blocks
49
- - Note original section organization
50
- - Flag any custom sections
35
+ - **PRIMARY GOAL**: Align level 2 headings to match template level 2 titles exactly
36
+ - **PRESERVE EVERYTHING**: Do not lose any information during migration
37
+ - Map existing content to the closest matching template section
38
+ - If content doesn't fit template sections, create appropriate level 3 subsections
51
39
 
52
- 3. **Create Backup First**
40
+ ## Detection Logic
53
41
 
54
- - Rename original file: `mv filename.md filename.md.bak`
55
- - This preserves the original completely
42
+ A document is considered a PRD if:
56
43
 
57
- 4. **Create New File**
44
+ - Filename contains "prd" (case insensitive)
45
+ - OR main title contains "Product Requirements" or "PRD"
46
+ - OR contains sections like "User Stories", "Functional Requirements", "Acceptance Criteria"
58
47
 
59
- - Create new `filename.md` from scratch
60
- - Start with template structure (all Level 2 headings)
61
- - For each content block from original:
62
- - Find the most appropriate V4 template section
63
- - If original had Level 2 heading not in template, demote to Level 3
64
- - Preserve all text, lists, code blocks, diagrams, tables
65
- - Remove only table of contents sections
66
- - **IMPORTANT**: Do NOT add any LLM prompts, placeholders, or instructions
67
- - If a template section has no matching content, leave it empty
48
+ ## Implementation Steps
68
49
 
69
- 5. **Validate Content Preservation**
70
- - For each major content block from original (excluding headings):
71
- - Use grep or search to verify it exists in new file
72
- - Report any content that couldn't be verified
73
- - This ensures no accidental content loss
50
+ 1. **Backup Original**: Copy `filename.md` to `filename.md.bak`
51
+ 2. **Detect Type**: Check if document is a PRD
52
+ 3. **Process Headings**:
53
+ - Clean all level 2 headings
54
+ - If PRD: Add epic structure before level 3 headings that look like epics
55
+ 4. **Write Result**: Overwrite original file with migrated content
74
56
 
75
- ## Example Migration
57
+ ## Epic Detection for PRDs
76
58
 
77
- ```markdown
78
- Original (prd.md):
79
-
80
- ## Executive Summary
59
+ Level 3 headings are treated as epics if they:
81
60
 
82
- [content...]
61
+ - Describe features or functionality
62
+ - Are substantial sections (not just "Overview" or "Notes")
63
+ - Common epic patterns: "User Management", "Payment Processing", "Reporting Dashboard"
83
64
 
84
- ## Custom Feature Section
65
+ The epic numbering starts at 1 and increments for each epic found.
85
66
 
86
- [content...]
67
+ ## Example
87
68
 
88
- ## Table of Contents
69
+ ### Before (PRD):
89
70
 
90
- [toc...]
71
+ `````markdown
72
+ # Product Requirements Document
91
73
 
92
- Template (prd-tmpl.md):
74
+ ## 1. Executive Summary
93
75
 
94
- ## Goals and Background Context
76
+ Content here...
95
77
 
96
- ## Functional Requirements
78
+ ## 2.1 Functional Requirements & Specs
97
79
 
98
- ## Success Metrics and KPIs
80
+ Content here...
99
81
 
100
- Result (prd.md):
82
+ ### User Management System
101
83
 
102
- ## Goals and Background Context
84
+ Epic content...
103
85
 
104
- [executive summary content moved here]
86
+ ### Payment Processing
105
87
 
106
- ### Custom Feature Section
88
+ Epic content...
107
89
 
108
- [content preserved but demoted to Level 3]
109
-
110
- ## Functional Requirements
111
-
112
- ## Success Metrics and KPIs
113
- ```
90
+ ## 3) Success Metrics
114
91
 
115
- ## Execution Instructions
92
+ Content here...
116
93
 
117
- [[LLM: When executing this task:
94
+ ````text
118
95
 
119
- 1. Ask user for BOTH: input file path AND template path (do not assume)
120
- 2. Validate compatibility:
121
- - Check document title/type (PRD, Architecture, etc.)
122
- - Ensure template matches document type
123
- - REJECT if types don't match (e.g., "Cannot migrate PRD to architecture template")
124
- 3. Read both files completely
125
- 4. Rename original to .bak: `mv original.md original.md.bak`
126
- 5. Extract Level 2 headings from template - these are MANDATORY
127
- 6. Create NEW file with original name
128
- 7. Build new content:
129
- - Start with all template Level 2 sections
130
- - Map original content to appropriate sections
131
- - Demote any non-template Level 2 headings to Level 3
132
- - Leave empty sections empty (no placeholders or instructions)
133
- 8. Validate content preservation:
134
- - Extract key content snippets from .bak file
135
- - Use grep to verify each exists in new file
136
- - Report any missing content
137
- 9. Report migration summary:
138
- - Sections moved/demoted
139
- - Content validation results
140
- - Any manual review needed
141
-
142
- ]]
143
-
144
- ### Document Type Detection
145
-
146
- [[LLM: Detect document type by examining:
147
-
148
- - File name (prd.md, architecture.md, etc.)
149
- - Main title (# Product Requirements Document, # Architecture, etc.)
150
- - Content patterns (user stories → PRD, technology stack → Architecture)
151
-
152
- Template compatibility:
153
-
154
- - prd-tmpl.md → Only for PRD documents
155
- - architecture-tmpl.md → Only for backend/single architecture
156
- - full-stack-architecture-tmpl.md → Only for architecture documents (can merge multiple)
96
+ ### After (PRD):
97
+ ```markdown
98
+ # Product Requirements Document
157
99
 
158
- ]]
100
+ ## Executive Summary
101
+ Content here...
159
102
 
160
- ## Common Migrations
103
+ ## Functional Requirements Specs
104
+ Content here...
161
105
 
162
- Valid migrations:
106
+ ## Epic 1
107
+ ### User Management System
108
+ Epic content...
163
109
 
164
- - `prd.md` → `.bmad-core/templates/prd-tmpl.md`
165
- - `architecture.md` → `.bmad-core/templates/architecture-tmpl.md`
166
- - `architecture.md` + `front-end-architecture.md` → `.bmad-core/templates/full-stack-architecture-tmpl.md`
110
+ ## Epic 2
111
+ ### Payment Processing
112
+ Epic content...
167
113
 
168
- Invalid migrations (MUST REJECT):
114
+ ## Success Metrics
115
+ Content here...
116
+ ```text
169
117
 
170
- - `prd.md` → `.bmad-core/templates/architecture-tmpl.md`
171
- - `architecture.md` → `.bmad-core/templates/prd-tmpl.md`
172
- - `ux-ui-spec.md` → `.bmad-core/templates/prd-tmpl.md`
118
+ ### Before (Non-PRD):
119
+ ```markdown
120
+ # Architecture Document
173
121
 
174
- ## Validation
122
+ ## 1. System Overview
123
+ Content...
175
124
 
176
- After migration verify:
125
+ ## 2.1 Technical Stack & Tools
126
+ Content...
127
+ ```text
177
128
 
178
- - [ ] All Level 2 headings match template exactly
179
- - [ ] All original content is preserved (use grep validation)
180
- - [ ] No table of contents remains
181
- - [ ] Backup file exists with .bak extension
182
- - [ ] Custom sections demoted to Level 3 or lower
129
+ ### After (Non-PRD):
130
+ ```markdown
131
+ # Architecture Document
183
132
 
184
- ### Content Validation Example
133
+ ## System Overview
134
+ Content...
185
135
 
186
- [[LLM: Example validation approach:
136
+ ## Technical Stack Tools
137
+ Content...
138
+ ````
139
+ `````
187
140
 
188
- 1. Extract significant text blocks from .bak file (>20 words)
189
- 2. For each block, grep in new file:
190
- ```bash
191
- grep -F "first 10-15 words of content block" newfile.md
192
- ```
193
- 3. Track validation results:
194
- - ✓ Found: content successfully migrated
195
- - ✗ Missing: needs investigation
196
- 4. Report any content that couldn't be found
141
+ ```text
197
142
 
198
- ]]
143
+ ```
@@ -0,0 +1,389 @@
1
+ # Document an Existing Project
2
+
3
+ ## Purpose
4
+
5
+ Generate comprehensive documentation for existing projects optimized for AI development agents. This task creates structured reference materials that enable AI agents to understand project context, conventions, and patterns for effective contribution to any codebase.
6
+
7
+ ## Task Instructions
8
+
9
+ ### 1. Initial Project Analysis
10
+
11
+ [[LLM: Begin by conducting a comprehensive analysis of the existing project. Use available tools to:
12
+
13
+ 1. **Project Structure Discovery**: Examine the root directory structure, identify main folders, and understand the overall organization
14
+ 2. **Technology Stack Identification**: Look for package.json, requirements.txt, Cargo.toml, pom.xml, etc. to identify languages, frameworks, and dependencies
15
+ 3. **Build System Analysis**: Find build scripts, CI/CD configurations, and development commands
16
+ 4. **Existing Documentation Review**: Check for README files, docs folders, and any existing documentation
17
+ 5. **Code Pattern Analysis**: Sample key files to understand coding patterns, naming conventions, and architectural approaches
18
+
19
+ Ask the user these elicitation questions to better understand their needs:
20
+
21
+ - What is the primary purpose of this project?
22
+ - Are there any specific areas of the codebase that are particularly complex or important for agents to understand?
23
+ - What types of tasks do you expect AI agents to perform on this project? (e.g., bug fixes, feature additions, refactoring, testing)
24
+ - Are there any existing documentation standards or formats you prefer?
25
+ - What level of technical detail should the documentation target? (junior developers, senior developers, mixed team)
26
+ ]]
27
+
28
+ ### 2. Core Documentation Generation
29
+
30
+ [[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:
31
+
32
+ **Core Documents (always generate):**
33
+
34
+ 1. **docs/index.md** - Master documentation index
35
+ 2. **docs/architecture/index.md** - Architecture documentation index
36
+ 3. **docs/architecture/coding-standards.md** - Coding conventions and style guidelines
37
+ 4. **docs/architecture/tech-stack.md** - Technology stack and version constraints
38
+ 5. **docs/architecture/unified-project-structure.md** - Project structure and organization
39
+ 6. **docs/architecture/testing-strategy.md** - Testing approaches and requirements
40
+
41
+ **Backend Documents (generate for backend/full-stack projects):**
42
+
43
+ 7. **docs/architecture/backend-architecture.md** - Backend service patterns and structure
44
+ 8. **docs/architecture/rest-api-spec.md** - API endpoint specifications
45
+ 9. **docs/architecture/data-models.md** - Data structures and validation rules
46
+ 10. **docs/architecture/database-schema.md** - Database design and relationships
47
+ 11. **docs/architecture/external-apis.md** - Third-party integrations
48
+
49
+ **Frontend Documents (generate for frontend/full-stack projects):**
50
+
51
+ 12. **docs/architecture/frontend-architecture.md** - Frontend patterns and structure
52
+ 13. **docs/architecture/components.md** - UI component specifications
53
+ 14. **docs/architecture/core-workflows.md** - User interaction flows
54
+ 15. **docs/architecture/ui-ux-spec.md** - UI/UX specifications and guidelines
55
+
56
+ **Additional Documents (generate if applicable):**
57
+
58
+ 16. **docs/prd.md** - Product requirements document (if not exists)
59
+ 17. **docs/architecture/deployment-guide.md** - Deployment and operations info
60
+ 18. **docs/architecture/security-considerations.md** - Security patterns and requirements
61
+ 19. **docs/architecture/performance-guidelines.md** - Performance optimization patterns
62
+
63
+ **Optional Enhancement Documents:**
64
+
65
+ 20. **docs/architecture/troubleshooting-guide.md** - Common issues and solutions
66
+ 21. **docs/architecture/changelog-conventions.md** - Change management practices
67
+ 22. **docs/architecture/code-review-checklist.md** - Review standards and practices
68
+
69
+ Present each document section by section, using the advanced elicitation task after each major section.]]
70
+
71
+ ### 3. Document Structure Template
72
+
73
+ [[LLM: Use this standardized structure for each documentation file, adapting content as needed:
74
+
75
+ ```markdown
76
+ # {{Document Title}}
77
+
78
+ ## Overview
79
+
80
+ {{Brief description of what this document covers and why it's important for AI agents}}
81
+
82
+ ## Quick Reference
83
+
84
+ {{Key points, commands, or patterns that agents need most frequently}}
85
+
86
+ ## Detailed Information
87
+
88
+ {{Comprehensive information organized into logical sections}}
89
+
90
+ ## Examples
91
+
92
+ {{Concrete examples showing proper usage or implementation}}
93
+
94
+ ## Common Patterns
95
+
96
+ {{Recurring patterns agents should recognize and follow}}
97
+
98
+ ## Things to Avoid
99
+
100
+ {{Anti-patterns, deprecated approaches, or common mistakes}}
101
+
102
+ ## Related Resources
103
+
104
+ {{Links to other relevant documentation or external resources}}
105
+ ```
106
+
107
+ Each document should be:
108
+
109
+ - **Concrete and actionable** - Focus on what agents need to do, not just concepts
110
+ - **Pattern-focused** - Highlight recurring patterns agents can recognize and replicate
111
+ - **Example-rich** - Include specific code examples and real file references
112
+ - **Context-aware** - Reference actual project files, folders, and conventions
113
+ - **Assumption-free** - Don't assume agents know project history or implicit knowledge
114
+ ]]
115
+
116
+ ### 4. Content Guidelines for Each Document Type
117
+
118
+ #### Core Architecture Documents
119
+
120
+ ##### docs/architecture/index.md
121
+
122
+ [[LLM: Create a comprehensive index of all architecture documentation:
123
+
124
+ - List all architecture documents with brief descriptions
125
+ - Group documents by category (backend, frontend, shared)
126
+ - Include quick links to key sections
127
+ - Provide reading order recommendations for different use cases]]
128
+
129
+ ##### docs/architecture/unified-project-structure.md
130
+
131
+ [[LLM: Document the complete project structure:
132
+
133
+ - Root-level directory structure with explanations
134
+ - Where each type of code belongs (backend, frontend, tests, etc.)
135
+ - File naming conventions and patterns
136
+ - Module/package organization
137
+ - Generated vs. source file locations
138
+ - Build output locations]]
139
+
140
+ ##### docs/architecture/coding-standards.md
141
+
142
+ [[LLM: Capture project-wide coding conventions:
143
+
144
+ - Language-specific style guidelines
145
+ - Naming conventions (variables, functions, classes, files)
146
+ - Code organization within files
147
+ - Import/export patterns
148
+ - Comment and documentation standards
149
+ - Linting and formatting tool configurations
150
+ - Git commit message conventions]]
151
+
152
+ ##### docs/architecture/tech-stack.md
153
+
154
+ [[LLM: Document all technologies and versions:
155
+
156
+ - Primary languages and versions
157
+ - Frameworks and major libraries with versions
158
+ - Development tools and their versions
159
+ - Database systems and versions
160
+ - External services and APIs used
161
+ - Browser/runtime requirements]]
162
+
163
+ ##### docs/architecture/testing-strategy.md
164
+
165
+ [[LLM: Define testing approaches and requirements:
166
+
167
+ - Test file locations and naming conventions
168
+ - Unit testing patterns and frameworks
169
+ - Integration testing approaches
170
+ - E2E testing setup (if applicable)
171
+ - Test coverage requirements
172
+ - Mocking strategies
173
+ - Test data management]]
174
+
175
+ #### Backend Architecture Documents
176
+
177
+ ##### docs/architecture/backend-architecture.md
178
+
179
+ [[LLM: Document backend service structure:
180
+
181
+ - Service layer organization
182
+ - Controller/route patterns
183
+ - Middleware architecture
184
+ - Authentication/authorization patterns
185
+ - Request/response flow
186
+ - Background job processing
187
+ - Service communication patterns]]
188
+
189
+ ##### docs/architecture/rest-api-spec.md
190
+
191
+ [[LLM: Specify all API endpoints:
192
+
193
+ - Base URL and versioning strategy
194
+ - Authentication methods
195
+ - Common headers and parameters
196
+ - Each endpoint with:
197
+ - HTTP method and path
198
+ - Request parameters/body
199
+ - Response format and status codes
200
+ - Error responses
201
+ - Rate limiting and quotas]]
202
+
203
+ ##### docs/architecture/data-models.md
204
+
205
+ [[LLM: Define data structures and validation:
206
+
207
+ - Core business entities
208
+ - Data validation rules
209
+ - Relationships between entities
210
+ - Computed fields and derivations
211
+ - Data transformation patterns
212
+ - Serialization formats]]
213
+
214
+ ##### docs/architecture/database-schema.md
215
+
216
+ [[LLM: Document database design:
217
+
218
+ - Database type and version
219
+ - Table/collection structures
220
+ - Indexes and constraints
221
+ - Relationships and foreign keys
222
+ - Migration patterns
223
+ - Seed data requirements
224
+ - Backup and recovery procedures]]
225
+
226
+ ##### docs/architecture/external-apis.md
227
+
228
+ [[LLM: Document third-party integrations:
229
+
230
+ - List of external services used
231
+ - Authentication methods for each
232
+ - API endpoints and usage patterns
233
+ - Rate limits and quotas
234
+ - Error handling strategies
235
+ - Webhook configurations
236
+ - Data synchronization patterns]]
237
+
238
+ #### Frontend Architecture Documents
239
+
240
+ ##### docs/architecture/frontend-architecture.md
241
+
242
+ [[LLM: Document frontend application structure:
243
+
244
+ - Component hierarchy and organization
245
+ - State management patterns
246
+ - Routing architecture
247
+ - Data fetching patterns
248
+ - Authentication flow
249
+ - Error boundary strategies
250
+ - Performance optimization patterns]]
251
+
252
+ ##### docs/architecture/components.md
253
+
254
+ [[LLM: Specify UI components:
255
+
256
+ - Component library/design system used
257
+ - Custom component specifications
258
+ - Props and state for each component
259
+ - Component composition patterns
260
+ - Styling approaches
261
+ - Accessibility requirements
262
+ - Component testing patterns]]
263
+
264
+ ##### docs/architecture/core-workflows.md
265
+
266
+ [[LLM: Document user interaction flows:
267
+
268
+ - Major user journeys
269
+ - Screen flow diagrams
270
+ - Form handling patterns
271
+ - Navigation patterns
272
+ - Data flow through workflows
273
+ - Error states and recovery
274
+ - Loading and transition states]]
275
+
276
+ ##### docs/architecture/ui-ux-spec.md
277
+
278
+ [[LLM: Define UI/UX guidelines:
279
+
280
+ - Design system specifications
281
+ - Color palette and typography
282
+ - Spacing and layout grids
283
+ - Responsive breakpoints
284
+ - Animation and transition guidelines
285
+ - Accessibility standards
286
+ - Browser compatibility requirements]]
287
+
288
+ ### 5. Adaptive Content Strategy
289
+
290
+ [[LLM: Adapt your documentation approach based on project characteristics:
291
+
292
+ **For Web Applications:**
293
+
294
+ - Focus on component patterns, routing, state management
295
+ - Include build processes, asset handling, and deployment
296
+ - Cover API integration patterns and data fetching
297
+
298
+ **For Backend Services:**
299
+
300
+ - Emphasize service architecture, data models, and API design
301
+ - Include database interaction patterns and migration strategies
302
+ - Cover authentication, authorization, and security patterns
303
+
304
+ **For CLI Tools:**
305
+
306
+ - Focus on command structure, argument parsing, and output formatting
307
+ - Include plugin/extension patterns if applicable
308
+ - Cover configuration file handling and user interaction patterns
309
+
310
+ **For Libraries/Frameworks:**
311
+
312
+ - Emphasize public API design and usage patterns
313
+ - Include extension points and customization approaches
314
+ - Cover versioning, compatibility, and migration strategies
315
+
316
+ **For Mobile Applications:**
317
+
318
+ - Focus on platform-specific patterns and navigation
319
+ - Include state management and data persistence approaches
320
+ - Cover platform integration and native feature usage
321
+
322
+ **For Data Science/ML Projects:**
323
+
324
+ - Emphasize data pipeline patterns and model organization
325
+ - Include experiment tracking and reproducibility approaches
326
+ - Cover data validation and model deployment patterns
327
+ ]]
328
+
329
+ ### 6. Quality Assurance
330
+
331
+ [[LLM: Before completing each document:
332
+
333
+ 1. **Accuracy Check**: Verify all file paths, commands, and code examples work
334
+ 2. **Completeness Review**: Ensure the document covers the most important patterns an agent would encounter
335
+ 3. **Clarity Assessment**: Check that explanations are clear and actionable
336
+ 4. **Consistency Verification**: Ensure terminology and patterns align across all documents
337
+ 5. **Agent Perspective**: Review from the viewpoint of an AI agent that needs to contribute to this project
338
+
339
+ Ask the user to review each completed document and use the advanced elicitation task to refine based on their feedback.]]
340
+
341
+ ### 7. Final Integration
342
+
343
+ [[LLM: After all documents are completed:
344
+
345
+ 1. Ensure all documents are created in the proper BMAD-expected locations:
346
+
347
+ - Core docs in `docs/` (index.md, prd.md)
348
+ - Architecture shards in `docs/architecture/` subdirectory
349
+ - Create the `docs/architecture/` directory if it doesn't exist
350
+
351
+ 2. Create/update the master index documents:
352
+
353
+ - Update `docs/index.md` to reference all documentation
354
+ - Create `docs/architecture/index.md` listing all architecture shards
355
+
356
+ 3. Verify document cross-references:
357
+
358
+ - Ensure all documents link to related documentation
359
+ - Check that file paths match the actual project structure
360
+ - Validate that examples reference real files in the project
361
+
362
+ 4. Provide maintenance guidance:
363
+
364
+ - Document update triggers (when to update each doc)
365
+ - Create a simple checklist for keeping docs current
366
+ - Suggest automated validation approaches
367
+
368
+ 5. Summary report including:
369
+ - List of all documents created with their paths
370
+ - Any gaps or areas needing human review
371
+ - Recommendations for project-specific additions
372
+ - Next steps for maintaining documentation accuracy
373
+
374
+ Present a summary of what was created and ask if any additional documentation would be helpful for AI agents working on this specific project.]]
375
+
376
+ ## Success Criteria
377
+
378
+ - Documentation enables AI agents to understand project context without additional explanation
379
+ - All major architectural patterns and coding conventions are captured
380
+ - Examples reference actual project files and demonstrate real usage
381
+ - Documentation is structured consistently and easy to navigate
382
+ - Content is actionable and focuses on what agents need to do, not just understand
383
+
384
+ ## Notes
385
+
386
+ - This task is designed to work with any project type, language, or framework
387
+ - The documentation should reflect the project as it actually is, not as it should be
388
+ - Focus on patterns that agents can recognize and replicate consistently
389
+ - Include both positive examples (what to do) and negative examples (what to avoid)