bmad-method 4.27.0 → 4.27.2

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 (99) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/bmad-core/agent-teams/team-all.yaml +6 -6
  3. package/bmad-core/agent-teams/team-fullstack.yaml +6 -6
  4. package/bmad-core/agent-teams/team-no-ui.yaml +2 -2
  5. package/bmad-core/agents/analyst.md +17 -20
  6. package/bmad-core/agents/architect.md +15 -18
  7. package/bmad-core/agents/bmad-master.md +55 -56
  8. package/bmad-core/agents/bmad-orchestrator.md +24 -23
  9. package/bmad-core/agents/dev.md +10 -10
  10. package/bmad-core/agents/pm.md +17 -20
  11. package/bmad-core/agents/po.md +12 -15
  12. package/bmad-core/agents/qa.md +7 -8
  13. package/bmad-core/agents/sm.md +8 -13
  14. package/bmad-core/agents/ux-expert.md +7 -11
  15. package/bmad-core/core-config.yaml +1 -1
  16. package/bmad-core/templates/architecture-tmpl.yaml +650 -0
  17. package/bmad-core/templates/brainstorming-output-tmpl.yaml +156 -0
  18. package/bmad-core/templates/brownfield-architecture-tmpl.yaml +476 -0
  19. package/bmad-core/templates/brownfield-prd-tmpl.yaml +280 -0
  20. package/bmad-core/templates/competitor-analysis-tmpl.yaml +293 -0
  21. package/bmad-core/templates/front-end-architecture-tmpl.yaml +206 -0
  22. package/bmad-core/templates/front-end-spec-tmpl.yaml +349 -0
  23. package/bmad-core/templates/fullstack-architecture-tmpl.yaml +805 -0
  24. package/bmad-core/templates/market-research-tmpl.yaml +252 -0
  25. package/bmad-core/templates/{prd-tmpl2.yaml → prd-tmpl.yaml} +3 -3
  26. package/bmad-core/templates/project-brief-tmpl.yaml +221 -0
  27. package/bmad-core/templates/story-tmpl.yaml +137 -0
  28. package/common/tasks/create-doc.md +55 -67
  29. package/common/utils/bmad-doc-template.md +29 -0
  30. package/dist/agents/analyst.txt +1004 -1061
  31. package/dist/agents/architect.txt +2460 -2872
  32. package/dist/agents/bmad-master.txt +3842 -4354
  33. package/dist/agents/bmad-orchestrator.txt +211 -87
  34. package/dist/agents/dev.txt +4 -8
  35. package/dist/agents/pm.txt +557 -587
  36. package/dist/agents/po.txt +149 -102
  37. package/dist/agents/qa.txt +145 -35
  38. package/dist/agents/sm.txt +145 -100
  39. package/dist/agents/ux-expert.txt +413 -522
  40. package/dist/expansion-packs/bmad-2d-phaser-game-dev/agents/game-designer.txt +1258 -1236
  41. package/dist/expansion-packs/bmad-2d-phaser-game-dev/agents/game-developer.txt +623 -573
  42. package/dist/expansion-packs/bmad-2d-phaser-game-dev/agents/game-sm.txt +263 -248
  43. package/dist/expansion-packs/bmad-2d-phaser-game-dev/teams/phaser-2d-nodejs-game-team.txt +9135 -4942
  44. package/dist/expansion-packs/bmad-creator-tools/agents/bmad-the-creator.txt +288 -251
  45. package/dist/expansion-packs/bmad-infrastructure-devops/agents/infra-devops-platform.txt +1123 -1145
  46. package/dist/teams/team-all.txt +4583 -4837
  47. package/dist/teams/team-fullstack.txt +5276 -5520
  48. package/dist/teams/team-ide-minimal.txt +375 -185
  49. package/dist/teams/team-no-ui.txt +4875 -5051
  50. package/expansion-packs/bmad-2d-phaser-game-dev/agent-teams/phaser-2d-nodejs-game-team.yaml +2 -2
  51. package/expansion-packs/bmad-2d-phaser-game-dev/agents/game-designer.md +17 -15
  52. package/expansion-packs/bmad-2d-phaser-game-dev/agents/game-developer.md +13 -11
  53. package/expansion-packs/bmad-2d-phaser-game-dev/agents/game-sm.md +13 -11
  54. package/expansion-packs/bmad-2d-phaser-game-dev/config.yaml +1 -1
  55. package/expansion-packs/bmad-2d-phaser-game-dev/templates/game-architecture-tmpl.yaml +613 -0
  56. package/expansion-packs/bmad-2d-phaser-game-dev/templates/game-brief-tmpl.yaml +356 -0
  57. package/expansion-packs/bmad-2d-phaser-game-dev/templates/game-design-doc-tmpl.yaml +343 -0
  58. package/expansion-packs/bmad-2d-phaser-game-dev/templates/game-story-tmpl.yaml +253 -0
  59. package/expansion-packs/bmad-2d-phaser-game-dev/templates/level-design-doc-tmpl.yaml +484 -0
  60. package/expansion-packs/bmad-creator-tools/agents/bmad-the-creator.md +14 -12
  61. package/expansion-packs/bmad-creator-tools/config.yaml +1 -1
  62. package/expansion-packs/bmad-creator-tools/templates/agent-teams-tmpl.yaml +178 -0
  63. package/expansion-packs/bmad-creator-tools/templates/agent-tmpl.yaml +154 -0
  64. package/expansion-packs/bmad-creator-tools/templates/expansion-pack-plan-tmpl.yaml +120 -0
  65. package/expansion-packs/bmad-infrastructure-devops/agents/infra-devops-platform.md +14 -14
  66. package/expansion-packs/bmad-infrastructure-devops/config.yaml +1 -1
  67. package/expansion-packs/bmad-infrastructure-devops/templates/infrastructure-architecture-tmpl.yaml +424 -0
  68. package/expansion-packs/bmad-infrastructure-devops/templates/infrastructure-platform-from-arch-tmpl.yaml +629 -0
  69. package/package.json +1 -1
  70. package/tools/builders/web-builder.js +65 -85
  71. package/tools/installer/package.json +1 -1
  72. package/tools/lib/dependency-resolver.js +8 -19
  73. package/zoo/docs/architecture.md +812 -0
  74. package/zoo/docs/brief.md +253 -0
  75. package/zoo/docs/prd.md +500 -0
  76. package/zoo/docs/stories/1.1.story.md +278 -0
  77. package/bmad-core/templates/architecture-tmpl.md +0 -776
  78. package/bmad-core/templates/brainstorming-output-tmpl.md +0 -149
  79. package/bmad-core/templates/brownfield-architecture-tmpl.md +0 -544
  80. package/bmad-core/templates/brownfield-prd-tmpl.md +0 -266
  81. package/bmad-core/templates/competitor-analysis-tmpl.md +0 -291
  82. package/bmad-core/templates/front-end-architecture-tmpl.md +0 -175
  83. package/bmad-core/templates/front-end-spec-tmpl.md +0 -413
  84. package/bmad-core/templates/fullstack-architecture-tmpl.md +0 -1018
  85. package/bmad-core/templates/market-research-tmpl.md +0 -263
  86. package/bmad-core/templates/prd-tmpl.md +0 -202
  87. package/bmad-core/templates/project-brief-tmpl.md +0 -232
  88. package/bmad-core/templates/story-tmpl.md +0 -58
  89. package/common/tasks/create-doc2.md +0 -65
  90. package/expansion-packs/bmad-2d-phaser-game-dev/templates/game-architecture-tmpl.md +0 -560
  91. package/expansion-packs/bmad-2d-phaser-game-dev/templates/game-brief-tmpl.md +0 -345
  92. package/expansion-packs/bmad-2d-phaser-game-dev/templates/game-design-doc-tmpl.md +0 -331
  93. package/expansion-packs/bmad-2d-phaser-game-dev/templates/game-story-tmpl.md +0 -235
  94. package/expansion-packs/bmad-2d-phaser-game-dev/templates/level-design-doc-tmpl.md +0 -470
  95. package/expansion-packs/bmad-creator-tools/templates/agent-teams-tmpl.md +0 -154
  96. package/expansion-packs/bmad-creator-tools/templates/agent-tmpl.md +0 -143
  97. package/expansion-packs/bmad-creator-tools/templates/expansion-pack-plan-tmpl.md +0 -91
  98. package/expansion-packs/bmad-infrastructure-devops/templates/infrastructure-architecture-tmpl.md +0 -415
  99. package/expansion-packs/bmad-infrastructure-devops/templates/infrastructure-platform-from-arch-tmpl.md +0 -0
@@ -1,776 +0,0 @@
1
- # {{Project Name}} Architecture Document
2
-
3
- [[LLM: If available, review any provided relevant documents to gather all relevant context before beginning. If at a minimum you cannot local `docs/prd.md` ask the user what docs will provide the basis for the architecture.]]
4
-
5
- [[LLM: The default path and filename unless specified is docs/architecture.md]]
6
-
7
- ## Introduction
8
-
9
- [[LLM: This section establishes the document's purpose and scope. Keep the content below but ensure project name is properly substituted.
10
-
11
- After presenting this section, apply `{root}/tasks/advanced-elicitation.md` protocol]]
12
-
13
- This document outlines the overall project architecture for {{Project Name}}, including backend systems, shared services, and non-UI specific concerns. Its primary goal is to serve as the guiding architectural blueprint for AI-driven development, ensuring consistency and adherence to chosen patterns and technologies.
14
-
15
- **Relationship to Frontend Architecture:**
16
- If the project includes a significant user interface, a separate Frontend Architecture Document will detail the frontend-specific design and MUST be used in conjunction with this document. Core technology stack choices documented herein (see "Tech Stack") are definitive for the entire project, including any frontend components.
17
-
18
- ### Starter Template or Existing Project
19
-
20
- [[LLM: Before proceeding further with architecture design, check if the project is based on a starter template or existing codebase:
21
-
22
- 1. Review the PRD and brainstorming brief for any mentions of:
23
-
24
- - Starter templates (e.g., Create React App, Next.js, Vue CLI, Angular CLI, etc.)
25
- - Existing projects or codebases being used as a foundation
26
- - Boilerplate projects or scaffolding tools
27
- - Previous projects to be cloned or adapted
28
-
29
- 2. If a starter template or existing project is mentioned:
30
-
31
- - Ask the user to provide access via one of these methods:
32
- - Link to the starter template documentation
33
- - Upload/attach the project files (for small projects)
34
- - Share a link to the project repository (GitHub, GitLab, etc.)
35
- - Analyze the starter/existing project to understand:
36
- - Pre-configured technology stack and versions
37
- - Project structure and organization patterns
38
- - Built-in scripts and tooling
39
- - Existing architectural patterns and conventions
40
- - Any limitations or constraints imposed by the starter
41
- - Use this analysis to inform and align your architecture decisions
42
-
43
- 3. If no starter template is mentioned but this is a greenfield project:
44
-
45
- - Suggest appropriate starter templates based on the tech stack preferences
46
- - Explain the benefits (faster setup, best practices, community support)
47
- - Let the user decide whether to use one
48
-
49
- 4. If the user confirms no starter template will be used:
50
-
51
- - Proceed with architecture design from scratch
52
- - Note that manual setup will be required for all tooling and configuration
53
-
54
- Document the decision here before proceeding with the architecture design. In none, just say N/A
55
-
56
- After presenting this starter template section, apply `{root}/tasks/advanced-elicitation.md` protocol]]
57
-
58
- ### Change Log
59
-
60
- [[LLM: Track document versions and changes]]
61
-
62
- | Date | Version | Description | Author |
63
- | :--- | :------ | :---------- | :----- |
64
-
65
- ## High Level Architecture
66
-
67
- [[LLM: This section contains multiple subsections that establish the foundation of the architecture. Present all subsections together (Introduction, Technical Summary, High Level Overview, Project Diagram, and Architectural Patterns), then apply `{root}/tasks/advanced-elicitation.md` protocol to the complete High Level Architecture section. The user can choose to refine the entire section or specific subsections.]]
68
-
69
- ### Technical Summary
70
-
71
- [[LLM: Provide a brief paragraph (3-5 sentences) overview of:
72
-
73
- - The system's overall architecture style
74
- - Key components and their relationships
75
- - Primary technology choices
76
- - Core architectural patterns being used
77
- - Reference back to the PRD goals and how this architecture supports them]]
78
-
79
- ### High Level Overview
80
-
81
- [[LLM: Based on the PRD's Technical Assumptions section, describe:
82
-
83
- 1. The main architectural style (e.g., Monolith, Microservices, Serverless, Event-Driven)
84
- 2. Repository structure decision from PRD (Monorepo/Polyrepo)
85
- 3. Service architecture decision from PRD
86
- 4. Primary user interaction flow or data flow at a conceptual level
87
- 5. Key architectural decisions and their rationale
88
-
89
- After presenting this section, apply `{root}/tasks/advanced-elicitation.md` protocol]]
90
-
91
- ### High Level Project Diagram
92
-
93
- [[LLM: Create a Mermaid diagram that visualizes the high-level architecture. Consider:
94
-
95
- - System boundaries
96
- - Major components/services
97
- - Data flow directions
98
- - External integrations
99
- - User entry points
100
-
101
- Use appropriate Mermaid diagram type (graph TD, C4, sequence) based on what best represents the architecture
102
-
103
- After presenting the diagram, apply `{root}/tasks/advanced-elicitation.md` protocol]]
104
-
105
- ### Architectural and Design Patterns
106
-
107
- [[LLM: List the key high-level patterns that will guide the architecture. For each pattern:
108
-
109
- 1. Present 2-3 viable options if multiple exist
110
- 2. Provide your recommendation with clear rationale
111
- 3. Get user confirmation before finalizing
112
- 4. These patterns should align with the PRD's technical assumptions and project goals
113
-
114
- Common patterns to consider:
115
-
116
- - Architectural style patterns (Serverless, Event-Driven, Microservices, CQRS, Hexagonal)
117
- - Code organization patterns (Dependency Injection, Repository, Module, Factory)
118
- - Data patterns (Event Sourcing, Saga, Database per Service)
119
- - Communication patterns (REST, GraphQL, Message Queue, Pub/Sub)]]
120
-
121
- <<REPEAT: pattern>>
122
-
123
- - **{{pattern_name}}:** {{pattern_description}} - _Rationale:_ {{rationale}}
124
-
125
- <</REPEAT>>
126
-
127
- @{example: patterns}
128
-
129
- - **Serverless Architecture:** Using AWS Lambda for compute - _Rationale:_ Aligns with PRD requirement for cost optimization and automatic scaling
130
- - **Repository Pattern:** Abstract data access logic - _Rationale:_ Enables testing and future database migration flexibility
131
- - **Event-Driven Communication:** Using SNS/SQS for service decoupling - _Rationale:_ Supports async processing and system resilience
132
-
133
- @{/example}
134
-
135
- [[LLM: After presenting the patterns, apply `{root}/tasks/advanced-elicitation.md` protocol]]
136
-
137
- ## Tech Stack
138
-
139
- [[LLM: This is the DEFINITIVE technology selection section. Work with the user to make specific choices:
140
-
141
- 1. Review PRD technical assumptions and any preferences from `{root}/data/technical-preferences.yaml` or an attached `technical-preferences`
142
- 2. For each category, present 2-3 viable options with pros/cons
143
- 3. Make a clear recommendation based on project needs
144
- 4. Get explicit user approval for each selection
145
- 5. Document exact versions (avoid "latest" - pin specific versions)
146
- 6. This table is the single source of truth - all other docs must reference these choices
147
-
148
- Key decisions to finalize - before displaying the table, ensure you are aware of or ask the user about - let the user know if they are not sure on any that you can also provide suggestions with rationale:
149
-
150
- - Starter templates (if any)
151
- - Languages and runtimes with exact versions
152
- - Frameworks and libraries / packages
153
- - Cloud provider and key services choices
154
- - Database and storage solutions - if unclear suggest sql or nosql or other types depending on the project and depending on cloud provider offer a suggestion
155
- - Development tools
156
-
157
- Upon render of the table, ensure the user is aware of the importance of this sections choices, should also look for gaps or disagreements with anything, ask for any clarifications if something is unclear why its in the list, and also right away apply `{root}/tasks/advanced-elicitation.md` display - this statement and the options should be rendered and then prompt right all before allowing user input.]]
158
-
159
- ### Cloud Infrastructure
160
-
161
- - **Provider:** {{cloud_provider}}
162
- - **Key Services:** {{core_services_list}}
163
- - **Deployment Regions:** {{regions}}
164
-
165
- ### Technology Stack Table
166
-
167
- | Category | Technology | Version | Purpose | Rationale |
168
- | :----------------- | :----------------- | :---------- | :---------- | :------------- |
169
- | **Language** | {{language}} | {{version}} | {{purpose}} | {{why_chosen}} |
170
- | **Runtime** | {{runtime}} | {{version}} | {{purpose}} | {{why_chosen}} |
171
- | **Framework** | {{framework}} | {{version}} | {{purpose}} | {{why_chosen}} |
172
- | **Database** | {{database}} | {{version}} | {{purpose}} | {{why_chosen}} |
173
- | **Cache** | {{cache}} | {{version}} | {{purpose}} | {{why_chosen}} |
174
- | **Message Queue** | {{queue}} | {{version}} | {{purpose}} | {{why_chosen}} |
175
- | **API Style** | {{api_style}} | {{version}} | {{purpose}} | {{why_chosen}} |
176
- | **Authentication** | {{auth}} | {{version}} | {{purpose}} | {{why_chosen}} |
177
- | **Testing** | {{test_framework}} | {{version}} | {{purpose}} | {{why_chosen}} |
178
- | **Build Tool** | {{build_tool}} | {{version}} | {{purpose}} | {{why_chosen}} |
179
- | **IaC Tool** | {{iac_tool}} | {{version}} | {{purpose}} | {{why_chosen}} |
180
- | **Monitoring** | {{monitoring}} | {{version}} | {{purpose}} | {{why_chosen}} |
181
- | **Logging** | {{logging}} | {{version}} | {{purpose}} | {{why_chosen}} |
182
-
183
- @{example: tech_stack_row}
184
- | **Language** | TypeScript | 5.3.3 | Primary development language | Strong typing, excellent tooling, team expertise |
185
- | **Runtime** | Node.js | 20.11.0 | JavaScript runtime | LTS version, stable performance, wide ecosystem |
186
- | **Framework** | NestJS | 10.3.2 | Backend framework | Enterprise-ready, good DI, matches team patterns |
187
- @{/example}
188
-
189
- ## Data Models
190
-
191
- [[LLM: Define the core data models/entities:
192
-
193
- 1. Review PRD requirements and identify key business entities
194
- 2. For each model, explain its purpose and relationships
195
- 3. Include key attributes and data types
196
- 4. Show relationships between models
197
- 5. Discuss design decisions with user
198
-
199
- Create a clear conceptual model before moving to database schema.
200
-
201
- After presenting all data models, apply `{root}/tasks/advanced-elicitation.md` protocol]]
202
-
203
- <<REPEAT: data_model>>
204
-
205
- ### {{model_name}}
206
-
207
- **Purpose:** {{model_purpose}}
208
-
209
- **Key Attributes:**
210
-
211
- - {{attribute_1}}: {{type_1}} - {{description_1}}
212
- - {{attribute_2}}: {{type_2}} - {{description_2}}
213
-
214
- **Relationships:**
215
-
216
- - {{relationship_1}}
217
- - {{relationship_2}}
218
- <</REPEAT>>
219
-
220
- ## Components
221
-
222
- [[LLM: Based on the architectural patterns, tech stack, and data models from above:
223
-
224
- 1. Identify major logical components/services and their responsibilities
225
- 2. Consider the repository structure (monorepo/polyrepo) from PRD
226
- 3. Define clear boundaries and interfaces between components
227
- 4. For each component, specify:
228
-
229
- - Primary responsibility
230
- - Key interfaces/APIs exposed
231
- - Dependencies on other components
232
- - Technology specifics based on tech stack choices
233
-
234
- 5. Create component diagrams where helpful
235
- 6. After presenting all components, apply `{root}/tasks/advanced-elicitation.md` protocol]]
236
-
237
- <<REPEAT: component>>
238
-
239
- ### {{component_name}}
240
-
241
- **Responsibility:** {{component_description}}
242
-
243
- **Key Interfaces:**
244
-
245
- - {{interface_1}}
246
- - {{interface_2}}
247
-
248
- **Dependencies:** {{dependencies}}
249
-
250
- **Technology Stack:** {{component_tech_details}}
251
- <</REPEAT>>
252
-
253
- ### Component Diagrams
254
-
255
- [[LLM: Create Mermaid diagrams to visualize component relationships. Options:
256
-
257
- - C4 Container diagram for high-level view
258
- - Component diagram for detailed internal structure
259
- - Sequence diagrams for complex interactions
260
- Choose the most appropriate for clarity
261
-
262
- After presenting the diagrams, apply `{root}/tasks/advanced-elicitation.md` protocol]]
263
-
264
- ## External APIs
265
-
266
- [[LLM: For each external service integration:
267
-
268
- 1. Identify APIs needed based on PRD requirements and component design
269
- 2. If documentation URLs are unknown, ask user for specifics
270
- 3. Document authentication methods and security considerations
271
- 4. List specific endpoints that will be used
272
- 5. Note any rate limits or usage constraints
273
-
274
- If no external APIs are needed, state this explicitly and skip to next section.]]
275
-
276
- ^^CONDITION: has_external_apis^^
277
-
278
- <<REPEAT: external_api>>
279
-
280
- ### {{api_name}} API
281
-
282
- - **Purpose:** {{api_purpose}}
283
- - **Documentation:** {{api_docs_url}}
284
- - **Base URL(s):** {{api_base_url}}
285
- - **Authentication:** {{auth_method}}
286
- - **Rate Limits:** {{rate_limits}}
287
-
288
- **Key Endpoints Used:**
289
- <<REPEAT: endpoint>>
290
-
291
- - `{{method}} {{endpoint_path}}` - {{endpoint_purpose}}
292
- <</REPEAT>>
293
-
294
- **Integration Notes:** {{integration_considerations}}
295
- <</REPEAT>>
296
-
297
- @{example: external_api}
298
-
299
- ### Stripe API
300
-
301
- - **Purpose:** Payment processing and subscription management
302
- - **Documentation:** https://stripe.com/docs/api
303
- - **Base URL(s):** `https://api.stripe.com/v1`
304
- - **Authentication:** Bearer token with secret key
305
- - **Rate Limits:** 100 requests per second
306
-
307
- **Key Endpoints Used:**
308
-
309
- - `POST /customers` - Create customer profiles
310
- - `POST /payment_intents` - Process payments
311
- - `POST /subscriptions` - Manage subscriptions
312
- @{/example}
313
-
314
- ^^/CONDITION: has_external_apis^^
315
-
316
- [[LLM: After presenting external APIs (or noting their absence), apply `{root}/tasks/advanced-elicitation.md` protocol]]
317
-
318
- ## Core Workflows
319
-
320
- [[LLM: Illustrate key system workflows using sequence diagrams:
321
-
322
- 1. Identify critical user journeys from PRD
323
- 2. Show component interactions including external APIs
324
- 3. Include error handling paths
325
- 4. Document async operations
326
- 5. Create both high-level and detailed diagrams as needed
327
-
328
- Focus on workflows that clarify architecture decisions or complex interactions.
329
-
330
- After presenting the workflow diagrams, apply `{root}/tasks/advanced-elicitation.md` protocol]]
331
-
332
- ## REST API Spec
333
-
334
- [[LLM: If the project includes a REST API:
335
-
336
- 1. Create an OpenAPI 3.0 specification
337
- 2. Include all endpoints from epics/stories
338
- 3. Define request/response schemas based on data models
339
- 4. Document authentication requirements
340
- 5. Include example requests/responses
341
-
342
- Use YAML format for better readability. If no REST API, skip this section.]]
343
-
344
- ^^CONDITION: has_rest_api^^
345
-
346
- ```yaml
347
- openapi: 3.0.0
348
- info:
349
- title:
350
- '[object Object]': null
351
- version:
352
- '[object Object]': null
353
- description:
354
- '[object Object]': null
355
- servers:
356
- - url:
357
- '[object Object]': null
358
- description:
359
- '[object Object]': null
360
- ```
361
-
362
- ^^/CONDITION: has_rest_api^^
363
-
364
- [[LLM: After presenting the REST API spec (or noting its absence if not applicable), apply `{root}/tasks/advanced-elicitation.md` protocol]]
365
-
366
- ## Database Schema
367
-
368
- [[LLM: Transform the conceptual data models into concrete database schemas:
369
-
370
- 1. Use the database type(s) selected in Tech Stack
371
- 2. Create schema definitions using appropriate notation
372
- 3. Include indexes, constraints, and relationships
373
- 4. Consider performance and scalability
374
- 5. For NoSQL, show document structures
375
-
376
- Present schema in format appropriate to database type (SQL DDL, JSON schema, etc.)
377
-
378
- After presenting the database schema, apply `{root}/tasks/advanced-elicitation.md` protocol]]
379
-
380
- ## Source Tree
381
-
382
- [[LLM: Create a project folder structure that reflects:
383
-
384
- 1. The chosen repository structure (monorepo/polyrepo)
385
- 2. The service architecture (monolith/microservices/serverless)
386
- 3. The selected tech stack and languages
387
- 4. Component organization from above
388
- 5. Best practices for the chosen frameworks
389
- 6. Clear separation of concerns
390
-
391
- Adapt the structure based on project needs. For monorepos, show service separation. For serverless, show function organization. Include language-specific conventions.
392
-
393
- After presenting the structure, apply `{root}/tasks/advanced-elicitation.md` protocol to refine based on user feedback.]]
394
-
395
- ```plaintext
396
- {{project-root}}/
397
- ├── .github/ # CI/CD workflows
398
- │ └── workflows/
399
- │ └── main.yaml
400
- ├── .vscode/ # VSCode settings (optional)
401
- │ └── settings.json
402
- ├── build/ # Compiled output (git-ignored)
403
- ├── config/ # Configuration files
404
- ├── docs/ # Project documentation
405
- │ ├── PRD.md
406
- │ ├── architecture.md
407
- │ └── ...
408
- ├── infra/ # Infrastructure as Code
409
- │ └── {{iac-structure}}
410
- ├── {{dependencies-dir}}/ # Dependencies (git-ignored)
411
- ├── scripts/ # Utility scripts
412
- ├── src/ # Application source code
413
- │ └── {{source-structure}}
414
- ├── tests/ # Test files
415
- │ ├── unit/
416
- │ ├── integration/
417
- │ └── e2e/
418
- ├── .env.example # Environment variables template
419
- ├── .gitignore # Git ignore rules
420
- ├── {{package-manifest}} # Dependencies manifest
421
- ├── {{config-files}} # Language/framework configs
422
- └── README.md # Project documentation
423
-
424
- @{example: monorepo-structure}
425
- project-root/
426
- ├── packages/
427
- │ ├── api/ # Backend API service
428
- │ ├── web/ # Frontend application
429
- │ ├── shared/ # Shared utilities/types
430
- │ └── infrastructure/ # IaC definitions
431
- ├── scripts/ # Monorepo management scripts
432
- └── package.json # Root package.json with workspaces
433
- @{/example}
434
- ```
435
-
436
- [[LLM: After presenting the source tree structure, apply `{root}/tasks/advanced-elicitation.md` protocol]]
437
-
438
- ## Infrastructure and Deployment
439
-
440
- [[LLM: Define the deployment architecture and practices:
441
-
442
- 1. Use IaC tool selected in Tech Stack
443
- 2. Choose deployment strategy appropriate for the architecture
444
- 3. Define environments and promotion flow
445
- 4. Establish rollback procedures
446
- 5. Consider security, monitoring, and cost optimization
447
-
448
- Get user input on deployment preferences and CI/CD tool choices.]]
449
-
450
- ### Infrastructure as Code
451
-
452
- - **Tool:** {{iac_tool}} {{version}}
453
- - **Location:** `{{iac_directory}}`
454
- - **Approach:** {{iac_approach}}
455
-
456
- ### Deployment Strategy
457
-
458
- - **Strategy:** {{deployment_strategy}}
459
- - **CI/CD Platform:** {{cicd_platform}}
460
- - **Pipeline Configuration:** `{{pipeline_config_location}}`
461
-
462
- ### Environments
463
-
464
- <<REPEAT: environment>>
465
-
466
- - **{{env_name}}:** {{env_purpose}} - {{env_details}}
467
- <</REPEAT>>
468
-
469
- ### Environment Promotion Flow
470
-
471
- ```text
472
- {{promotion_flow_diagram}}
473
- ```
474
-
475
- ### Rollback Strategy
476
-
477
- - **Primary Method:** {{rollback_method}}
478
- - **Trigger Conditions:** {{rollback_triggers}}
479
- - **Recovery Time Objective:** {{rto}}
480
-
481
- [[LLM: After presenting the infrastructure and deployment section, apply `{root}/tasks/advanced-elicitation.md` protocol]]
482
-
483
- ## Error Handling Strategy
484
-
485
- [[LLM: Define comprehensive error handling approach:
486
-
487
- 1. Choose appropriate patterns for the language/framework from Tech Stack
488
- 2. Define logging standards and tools
489
- 3. Establish error categories and handling rules
490
- 4. Consider observability and debugging needs
491
- 5. Ensure security (no sensitive data in logs)
492
-
493
- This section guides both AI and human developers in consistent error handling.]]
494
-
495
- ### General Approach
496
-
497
- - **Error Model:** {{error_model}}
498
- - **Exception Hierarchy:** {{exception_structure}}
499
- - **Error Propagation:** {{propagation_rules}}
500
-
501
- ### Logging Standards
502
-
503
- - **Library:** {{logging_library}} {{version}}
504
- - **Format:** {{log_format}}
505
- - **Levels:** {{log_levels_definition}}
506
- - **Required Context:**
507
- - Correlation ID: {{correlation_id_format}}
508
- - Service Context: {{service_context}}
509
- - User Context: {{user_context_rules}}
510
-
511
- ### Error Handling Patterns
512
-
513
- #### External API Errors
514
-
515
- - **Retry Policy:** {{retry_strategy}}
516
- - **Circuit Breaker:** {{circuit_breaker_config}}
517
- - **Timeout Configuration:** {{timeout_settings}}
518
- - **Error Translation:** {{error_mapping_rules}}
519
-
520
- #### Business Logic Errors
521
-
522
- - **Custom Exceptions:** {{business_exception_types}}
523
- - **User-Facing Errors:** {{user_error_format}}
524
- - **Error Codes:** {{error_code_system}}
525
-
526
- #### Data Consistency
527
-
528
- - **Transaction Strategy:** {{transaction_approach}}
529
- - **Compensation Logic:** {{compensation_patterns}}
530
- - **Idempotency:** {{idempotency_approach}}
531
-
532
- [[LLM: After presenting the error handling strategy, apply `{root}/tasks/advanced-elicitation.md` protocol]]
533
-
534
- ## Coding Standards
535
-
536
- [[LLM: These standards are MANDATORY for AI agents. Work with user to define ONLY the critical rules needed to prevent bad code. Explain that:
537
-
538
- 1. This section directly controls AI developer behavior
539
- 2. Keep it minimal - assume AI knows general best practices
540
- 3. Focus on project-specific conventions and gotchas
541
- 4. Overly detailed standards bloat context and slow development
542
- 5. Standards will be extracted to separate file for dev agent use
543
-
544
- For each standard, get explicit user confirmation it's necessary.]]
545
-
546
- ### Core Standards
547
-
548
- - **Languages & Runtimes:** {{languages_and_versions}}
549
- - **Style & Linting:** {{linter_config}}
550
- - **Test Organization:** {{test_file_convention}}
551
-
552
- ### Naming Conventions
553
-
554
- [[LLM: Only include if deviating from language defaults]]
555
-
556
- | Element | Convention | Example |
557
- | :-------- | :------------------- | :---------------- |
558
- | Variables | {{var_convention}} | {{var_example}} |
559
- | Functions | {{func_convention}} | {{func_example}} |
560
- | Classes | {{class_convention}} | {{class_example}} |
561
- | Files | {{file_convention}} | {{file_example}} |
562
-
563
- ### Critical Rules
564
-
565
- [[LLM: List ONLY rules that AI might violate or project-specific requirements. Examples:
566
-
567
- - "Never use console.log in production code - use logger"
568
- - "All API responses must use ApiResponse wrapper type"
569
- - "Database queries must use repository pattern, never direct ORM"
570
-
571
- Avoid obvious rules like "use SOLID principles" or "write clean code"]]
572
-
573
- <<REPEAT: critical_rule>>
574
-
575
- - **{{rule_name}}:** {{rule_description}}
576
- <</REPEAT>>
577
-
578
- ### Language-Specific Guidelines
579
-
580
- [[LLM: Add ONLY if critical for preventing AI mistakes. Most teams don't need this section.]]
581
-
582
- ^^CONDITION: has_language_specifics^^
583
-
584
- #### {{language_name}} Specifics
585
-
586
- <<REPEAT: language_rule>>
587
-
588
- - **{{rule_topic}}:** {{rule_detail}}
589
- <</REPEAT>>
590
-
591
- ^^/CONDITION: has_language_specifics^^
592
-
593
- [[LLM: After presenting the coding standards, apply `{root}/tasks/advanced-elicitation.md` protocol]]
594
-
595
- ## Test Strategy and Standards
596
-
597
- [[LLM: Work with user to define comprehensive test strategy:
598
-
599
- 1. Use test frameworks from Tech Stack
600
- 2. Decide on TDD vs test-after approach
601
- 3. Define test organization and naming
602
- 4. Establish coverage goals
603
- 5. Determine integration test infrastructure
604
- 6. Plan for test data and external dependencies
605
-
606
- Note: Basic info goes in Coding Standards for dev agent. This detailed section is for QA agent and team reference. Apply `{root}/tasks/advanced-elicitation.md` after initial draft.]]
607
-
608
- ### Testing Philosophy
609
-
610
- - **Approach:** {{test_approach}}
611
- - **Coverage Goals:** {{coverage_targets}}
612
- - **Test Pyramid:** {{test_distribution}}
613
-
614
- ### Test Types and Organization
615
-
616
- #### Unit Tests
617
-
618
- - **Framework:** {{unit_test_framework}} {{version}}
619
- - **File Convention:** {{unit_test_naming}}
620
- - **Location:** {{unit_test_location}}
621
- - **Mocking Library:** {{mocking_library}}
622
- - **Coverage Requirement:** {{unit_coverage}}
623
-
624
- **AI Agent Requirements:**
625
-
626
- - Generate tests for all public methods
627
- - Cover edge cases and error conditions
628
- - Follow AAA pattern (Arrange, Act, Assert)
629
- - Mock all external dependencies
630
-
631
- #### Integration Tests
632
-
633
- - **Scope:** {{integration_scope}}
634
- - **Location:** {{integration_test_location}}
635
- - **Test Infrastructure:**
636
- <<REPEAT: test_dependency>>
637
- - **{{dependency_name}}:** {{test_approach}} ({{test_tool}})
638
- <</REPEAT>>
639
-
640
- @{example: test_dependencies}
641
-
642
- - **Database:** In-memory H2 for unit tests, Testcontainers PostgreSQL for integration
643
- - **Message Queue:** Embedded Kafka for tests
644
- - **External APIs:** WireMock for stubbing
645
- @{/example}
646
-
647
- #### End-to-End Tests
648
-
649
- - **Framework:** {{e2e_framework}} {{version}}
650
- - **Scope:** {{e2e_scope}}
651
- - **Environment:** {{e2e_environment}}
652
- - **Test Data:** {{e2e_data_strategy}}
653
-
654
- ### Test Data Management
655
-
656
- - **Strategy:** {{test_data_approach}}
657
- - **Fixtures:** {{fixture_location}}
658
- - **Factories:** {{factory_pattern}}
659
- - **Cleanup:** {{cleanup_strategy}}
660
-
661
- ### Continuous Testing
662
-
663
- - **CI Integration:** {{ci_test_stages}}
664
- - **Performance Tests:** {{perf_test_approach}}
665
- - **Security Tests:** {{security_test_approach}}
666
-
667
- [[LLM: After presenting the test strategy section, apply `{root}/tasks/advanced-elicitation.md` protocol]]
668
-
669
- ## Security
670
-
671
- [[LLM: Define MANDATORY security requirements for AI and human developers:
672
-
673
- 1. Focus on implementation-specific rules
674
- 2. Reference security tools from Tech Stack
675
- 3. Define clear patterns for common scenarios
676
- 4. These rules directly impact code generation
677
- 5. Work with user to ensure completeness without redundancy]]
678
-
679
- ### Input Validation
680
-
681
- - **Validation Library:** {{validation_library}}
682
- - **Validation Location:** {{where_to_validate}}
683
- - **Required Rules:**
684
- - All external inputs MUST be validated
685
- - Validation at API boundary before processing
686
- - Whitelist approach preferred over blacklist
687
-
688
- ### Authentication & Authorization
689
-
690
- - **Auth Method:** {{auth_implementation}}
691
- - **Session Management:** {{session_approach}}
692
- - **Required Patterns:**
693
- - {{auth_pattern_1}}
694
- - {{auth_pattern_2}}
695
-
696
- ### Secrets Management
697
-
698
- - **Development:** {{dev_secrets_approach}}
699
- - **Production:** {{prod_secrets_service}}
700
- - **Code Requirements:**
701
- - NEVER hardcode secrets
702
- - Access via configuration service only
703
- - No secrets in logs or error messages
704
-
705
- ### API Security
706
-
707
- - **Rate Limiting:** {{rate_limit_implementation}}
708
- - **CORS Policy:** {{cors_configuration}}
709
- - **Security Headers:** {{required_headers}}
710
- - **HTTPS Enforcement:** {{https_approach}}
711
-
712
- ### Data Protection
713
-
714
- - **Encryption at Rest:** {{encryption_at_rest}}
715
- - **Encryption in Transit:** {{encryption_in_transit}}
716
- - **PII Handling:** {{pii_rules}}
717
- - **Logging Restrictions:** {{what_not_to_log}}
718
-
719
- ### Dependency Security
720
-
721
- - **Scanning Tool:** {{dependency_scanner}}
722
- - **Update Policy:** {{update_frequency}}
723
- - **Approval Process:** {{new_dep_process}}
724
-
725
- ### Security Testing
726
-
727
- - **SAST Tool:** {{static_analysis}}
728
- - **DAST Tool:** {{dynamic_analysis}}
729
- - **Penetration Testing:** {{pentest_schedule}}
730
-
731
- [[LLM: After presenting the security section, apply `{root}/tasks/advanced-elicitation.md` protocol]]
732
-
733
- ## Checklist Results Report
734
-
735
- [[LLM: Before running the checklist, offer to output the full architecture document. Once user confirms, execute the `architect-checklist` and populate results here.]]
736
-
737
- ---
738
-
739
- ## Next Steps
740
-
741
- [[LLM: After completing the architecture:
742
-
743
- 1. If project has UI components:
744
-
745
- - Recommend engaging Design Architect agent
746
- - Use "Frontend Architecture Mode"
747
- - Provide this document as input
748
-
749
- 2. For all projects:
750
-
751
- - Review with Product Owner
752
- - Begin story implementation with Dev agent
753
- - Set up infrastructure with DevOps agent
754
-
755
- 3. Include specific prompts for next agents if needed]]
756
-
757
- ^^CONDITION: has_ui^^
758
-
759
- ### Design Architect Prompt
760
-
761
- [[LLM: Create a brief prompt to hand off to Design Architect for Frontend Architecture creation. Include:
762
-
763
- - Reference to this architecture document
764
- - Key UI requirements from PRD
765
- - Any frontend-specific decisions made here
766
- - Request for detailed frontend architecture]]
767
-
768
- ^^/CONDITION: has_ui^^
769
-
770
- ### Developer Handoff
771
-
772
- [[LLM: Create a brief prompt for developers starting implementation. Include:
773
-
774
- - Reference to this architecture and coding standards
775
- - First epic/story to implement
776
- - Key technical decisions to follow]]