bmad-method 4.26.0 → 4.27.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (109) hide show
  1. package/.vscode/settings.json +2 -0
  2. package/CHANGELOG.md +22 -0
  3. package/README.md +29 -282
  4. package/bmad-core/agent-teams/team-all.yaml +6 -6
  5. package/bmad-core/agent-teams/team-fullstack.yaml +6 -6
  6. package/bmad-core/agent-teams/team-no-ui.yaml +2 -2
  7. package/bmad-core/agents/analyst.md +17 -18
  8. package/bmad-core/agents/architect.md +15 -18
  9. package/bmad-core/agents/bmad-master.md +56 -53
  10. package/bmad-core/agents/bmad-orchestrator.md +24 -23
  11. package/bmad-core/agents/dev.md +10 -10
  12. package/bmad-core/agents/pm.md +17 -20
  13. package/bmad-core/agents/po.md +12 -15
  14. package/bmad-core/agents/qa.md +7 -8
  15. package/bmad-core/agents/sm.md +8 -13
  16. package/bmad-core/agents/ux-expert.md +7 -11
  17. package/bmad-core/core-config.yaml +1 -1
  18. package/bmad-core/data/bmad-kb.md +74 -15
  19. package/bmad-core/data/brainstorming-techniques.md +36 -0
  20. package/bmad-core/data/elicitation-methods.md +134 -0
  21. package/bmad-core/tasks/advanced-elicitation.md +82 -57
  22. package/bmad-core/tasks/facilitate-brainstorming-session.md +136 -0
  23. package/bmad-core/templates/architecture-tmpl.yaml +658 -0
  24. package/bmad-core/templates/brainstorming-output-tmpl.yaml +156 -0
  25. package/bmad-core/templates/brownfield-architecture-tmpl.yaml +476 -0
  26. package/bmad-core/templates/brownfield-prd-tmpl.yaml +280 -0
  27. package/bmad-core/templates/competitor-analysis-tmpl.yaml +293 -0
  28. package/bmad-core/templates/front-end-architecture-tmpl.yaml +206 -0
  29. package/bmad-core/templates/front-end-spec-tmpl.yaml +349 -0
  30. package/bmad-core/templates/fullstack-architecture-tmpl.yaml +805 -0
  31. package/bmad-core/templates/market-research-tmpl.yaml +252 -0
  32. package/bmad-core/templates/prd-tmpl.yaml +202 -0
  33. package/bmad-core/templates/project-brief-tmpl.yaml +221 -0
  34. package/bmad-core/templates/story-tmpl.yaml +137 -0
  35. package/bmad-core/utils/plan-management.md +9 -13
  36. package/bmad-core/workflows/greenfield-service.yaml +1 -1
  37. package/common/tasks/create-doc.md +55 -67
  38. package/common/utils/bmad-doc-template.md +325 -0
  39. package/dist/agents/analyst.txt +1312 -1193
  40. package/dist/agents/architect.txt +2484 -2895
  41. package/dist/agents/bmad-master.txt +4680 -4897
  42. package/dist/agents/bmad-orchestrator.txt +400 -195
  43. package/dist/agents/dev.txt +21 -24
  44. package/dist/agents/pm.txt +590 -619
  45. package/dist/agents/po.txt +178 -130
  46. package/dist/agents/qa.txt +159 -48
  47. package/dist/agents/sm.txt +166 -120
  48. package/dist/agents/ux-expert.txt +436 -544
  49. package/dist/expansion-packs/bmad-2d-phaser-game-dev/agents/game-designer.txt +1283 -1260
  50. package/dist/expansion-packs/bmad-2d-phaser-game-dev/agents/game-developer.txt +642 -591
  51. package/dist/expansion-packs/bmad-2d-phaser-game-dev/agents/game-sm.txt +284 -268
  52. package/dist/expansion-packs/bmad-2d-phaser-game-dev/teams/phaser-2d-nodejs-game-team.txt +9258 -4977
  53. package/dist/expansion-packs/bmad-creator-tools/agents/bmad-the-creator.txt +388 -325
  54. package/dist/expansion-packs/bmad-infrastructure-devops/agents/infra-devops-platform.txt +1144 -1165
  55. package/dist/teams/team-all.txt +4885 -4967
  56. package/dist/teams/team-fullstack.txt +5621 -5693
  57. package/dist/teams/team-ide-minimal.txt +604 -333
  58. package/dist/teams/team-no-ui.txt +5209 -5213
  59. package/docs/agentic-tools/github-copilot-guide.md +29 -9
  60. package/docs/bmad-workflow-guide.md +2 -2
  61. package/expansion-packs/bmad-2d-phaser-game-dev/agent-teams/phaser-2d-nodejs-game-team.yaml +2 -2
  62. package/expansion-packs/bmad-2d-phaser-game-dev/agents/game-designer.md +17 -15
  63. package/expansion-packs/bmad-2d-phaser-game-dev/agents/game-developer.md +13 -11
  64. package/expansion-packs/bmad-2d-phaser-game-dev/agents/game-sm.md +13 -11
  65. package/expansion-packs/bmad-2d-phaser-game-dev/config.yaml +1 -1
  66. package/expansion-packs/bmad-2d-phaser-game-dev/tasks/create-game-story.md +2 -2
  67. package/expansion-packs/bmad-2d-phaser-game-dev/templates/game-architecture-tmpl.yaml +613 -0
  68. package/expansion-packs/bmad-2d-phaser-game-dev/templates/game-brief-tmpl.yaml +356 -0
  69. package/expansion-packs/bmad-2d-phaser-game-dev/templates/game-design-doc-tmpl.yaml +343 -0
  70. package/expansion-packs/bmad-2d-phaser-game-dev/templates/game-story-tmpl.yaml +253 -0
  71. package/expansion-packs/bmad-2d-phaser-game-dev/templates/level-design-doc-tmpl.yaml +484 -0
  72. package/expansion-packs/bmad-creator-tools/agents/bmad-the-creator.md +14 -12
  73. package/expansion-packs/bmad-creator-tools/config.yaml +1 -1
  74. package/expansion-packs/bmad-creator-tools/templates/agent-teams-tmpl.yaml +178 -0
  75. package/expansion-packs/bmad-creator-tools/templates/agent-tmpl.yaml +154 -0
  76. package/expansion-packs/bmad-creator-tools/templates/expansion-pack-plan-tmpl.yaml +120 -0
  77. package/expansion-packs/bmad-infrastructure-devops/agents/infra-devops-platform.md +14 -14
  78. package/expansion-packs/bmad-infrastructure-devops/config.yaml +1 -1
  79. package/expansion-packs/bmad-infrastructure-devops/templates/infrastructure-architecture-tmpl.yaml +424 -0
  80. package/expansion-packs/bmad-infrastructure-devops/templates/infrastructure-platform-from-arch-tmpl.yaml +629 -0
  81. package/package.json +1 -1
  82. package/tools/builders/web-builder.js +170 -95
  83. package/tools/installer/config/install.config.yaml +2 -2
  84. package/tools/installer/lib/ide-setup.js +2 -2
  85. package/tools/installer/package.json +1 -1
  86. package/tools/lib/dependency-resolver.js +11 -22
  87. package/tools/md-assets/web-agent-startup-instructions.md +10 -10
  88. package/bmad-core/tasks/brainstorming-techniques.md +0 -238
  89. package/bmad-core/templates/architecture-tmpl.md +0 -776
  90. package/bmad-core/templates/brownfield-architecture-tmpl.md +0 -544
  91. package/bmad-core/templates/brownfield-prd-tmpl.md +0 -266
  92. package/bmad-core/templates/competitor-analysis-tmpl.md +0 -291
  93. package/bmad-core/templates/front-end-architecture-tmpl.md +0 -175
  94. package/bmad-core/templates/front-end-spec-tmpl.md +0 -413
  95. package/bmad-core/templates/fullstack-architecture-tmpl.md +0 -1018
  96. package/bmad-core/templates/market-research-tmpl.md +0 -263
  97. package/bmad-core/templates/prd-tmpl.md +0 -202
  98. package/bmad-core/templates/project-brief-tmpl.md +0 -232
  99. package/bmad-core/templates/story-tmpl.md +0 -58
  100. package/expansion-packs/bmad-2d-phaser-game-dev/templates/game-architecture-tmpl.md +0 -560
  101. package/expansion-packs/bmad-2d-phaser-game-dev/templates/game-brief-tmpl.md +0 -345
  102. package/expansion-packs/bmad-2d-phaser-game-dev/templates/game-design-doc-tmpl.md +0 -331
  103. package/expansion-packs/bmad-2d-phaser-game-dev/templates/game-story-tmpl.md +0 -235
  104. package/expansion-packs/bmad-2d-phaser-game-dev/templates/level-design-doc-tmpl.md +0 -470
  105. package/expansion-packs/bmad-creator-tools/templates/agent-teams-tmpl.md +0 -154
  106. package/expansion-packs/bmad-creator-tools/templates/agent-tmpl.md +0 -143
  107. package/expansion-packs/bmad-creator-tools/templates/expansion-pack-plan-tmpl.md +0 -91
  108. package/expansion-packs/bmad-infrastructure-devops/templates/infrastructure-architecture-tmpl.md +0 -415
  109. package/expansion-packs/bmad-infrastructure-devops/templates/infrastructure-platform-from-arch-tmpl.md +0 -0
@@ -1,1018 +0,0 @@
1
- # {{Project Name}} Fullstack Architecture Document
2
-
3
- [[LLM: The default path and filename unless specified is docs/architecture.md]]
4
-
5
- [[LLM: If available, review any provided relevant documents to gather all relevant context before beginning. At minimum, you should have access to docs/prd.md and docs/front-end-spec.md. Ask the user for any documents you need but cannot locate. This template creates a unified architecture that covers both backend and frontend concerns to guide AI-driven fullstack development.]]
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 `tasks#advanced-elicitation` protocol]]
12
-
13
- This document outlines the complete fullstack architecture for {{Project Name}}, including backend systems, frontend implementation, and their integration. It serves as the single source of truth for AI-driven development, ensuring consistency across the entire technology stack.
14
-
15
- This unified approach combines what would traditionally be separate backend and frontend architecture documents, streamlining the development process for modern fullstack applications where these concerns are increasingly intertwined.
16
-
17
- ### Starter Template or Existing Project
18
-
19
- [[LLM: Before proceeding with architecture design, check if the project is based on any starter templates or existing codebases:
20
-
21
- 1. Review the PRD and other documents for mentions of:
22
-
23
- - Fullstack starter templates (e.g., T3 Stack, MEAN/MERN starters, Django + React templates)
24
- - Monorepo templates (e.g., Nx, Turborepo starters)
25
- - Platform-specific starters (e.g., Vercel templates, AWS Amplify starters)
26
- - Existing projects being extended or cloned
27
-
28
- 2. If starter templates or existing projects are mentioned:
29
-
30
- - Ask the user to provide access (links, repos, or files)
31
- - Analyze to understand pre-configured choices and constraints
32
- - Note any architectural decisions already made
33
- - Identify what can be modified vs what must be retained
34
-
35
- 3. If no starter is mentioned but this is greenfield:
36
-
37
- - Suggest appropriate fullstack starters based on tech preferences
38
- - Consider platform-specific options (Vercel, AWS, etc.)
39
- - Let user decide whether to use one
40
-
41
- 4. Document the decision and any constraints it imposes
42
-
43
- If none, state "N/A - Greenfield project"
44
-
45
- ### Change Log
46
-
47
- [[LLM: Track document versions and changes]]
48
-
49
- | Date | Version | Description | Author |
50
- | :--- | :------ | :---------- | :----- |
51
-
52
- ## High Level Architecture
53
-
54
- [[LLM: This section contains multiple subsections that establish the foundation. Present all subsections together, then apply `tasks#advanced-elicitation` protocol to the complete section.]]
55
-
56
- ### Technical Summary
57
-
58
- [[LLM: Provide a comprehensive overview (4-6 sentences) covering:
59
-
60
- - Overall architectural style and deployment approach
61
- - Frontend framework and backend technology choices
62
- - Key integration points between frontend and backend
63
- - Infrastructure platform and services
64
- - How this architecture achieves PRD goals]]
65
-
66
- ### Platform and Infrastructure Choice
67
-
68
- [[LLM: Based on PRD requirements and technical assumptions, make a platform recommendation:
69
-
70
- 1. Consider common patterns (not an exhaustive list, use your own best judgement and search the web as needed for emerging trends):
71
-
72
- - **Vercel + Supabase**: For rapid development with Next.js, built-in auth/storage
73
- - **AWS Full Stack**: For enterprise scale with Lambda, API Gateway, S3, Cognito
74
- - **Azure**: For .NET ecosystems or enterprise Microsoft environments
75
- - **Google Cloud**: For ML/AI heavy applications or Google ecosystem integration
76
-
77
- 2. Present 2-3 viable options with clear pros/cons
78
- 3. Make a recommendation with rationale
79
- 4. Get explicit user confirmation
80
-
81
- Document the choice and key services that will be used.]]
82
-
83
- **Platform:** {{selected_platform}}
84
- **Key Services:** {{core_services_list}}
85
- **Deployment Host and Regions:** {{regions}}
86
-
87
- ### Repository Structure
88
-
89
- [[LLM: Define the repository approach based on PRD requirements and platform choice, explain your rationale or ask quetsions to the user if unsure:
90
-
91
- 1. For modern fullstack apps, monorepo is often preferred
92
- 2. Consider tooling (Nx, Turborepo, Lerna, npm workspaces)
93
- 3. Define package/app boundaries
94
- 4. Plan for shared code between frontend and backend]]
95
-
96
- **Structure:** {{repo_structure_choice}}
97
- **Monorepo Tool:** {{monorepo_tool_if_applicable}}
98
- **Package Organization:** {{package_strategy}}
99
-
100
- ### High Level Architecture Diagram
101
-
102
- [[LLM: Create a Mermaid diagram showing the complete system architecture including:
103
-
104
- - User entry points (web, mobile)
105
- - Frontend application deployment
106
- - API layer (REST/GraphQL)
107
- - Backend services
108
- - Databases and storage
109
- - External integrations
110
- - CDN and caching layers
111
-
112
- Use appropriate diagram type for clarity.]]
113
-
114
- ```mermaid
115
- {{architecture_diagram}}
116
- ```
117
-
118
- ### Architectural Patterns
119
-
120
- [[LLM: List patterns that will guide both frontend and backend development. Include patterns for:
121
-
122
- - Overall architecture (e.g., Jamstack, Serverless, Microservices)
123
- - Frontend patterns (e.g., Component-based, State management)
124
- - Backend patterns (e.g., Repository, CQRS, Event-driven)
125
- - Integration patterns (e.g., BFF, API Gateway)
126
-
127
- For each pattern, provide recommendation and rationale.]]
128
-
129
- <<REPEAT: pattern>>
130
-
131
- - **{{pattern_name}}:** {{pattern_description}} - _Rationale:_ {{rationale}}
132
- <</REPEAT>>
133
-
134
- @{example: patterns}
135
-
136
- - **Jamstack Architecture:** Static site generation with serverless APIs - _Rationale:_ Optimal performance and scalability for content-heavy applications
137
- - **Component-Based UI:** Reusable React components with TypeScript - _Rationale:_ Maintainability and type safety across large codebases
138
- - **Repository Pattern:** Abstract data access logic - _Rationale:_ Enables testing and future database migration flexibility
139
- - **API Gateway Pattern:** Single entry point for all API calls - _Rationale:_ Centralized auth, rate limiting, and monitoring
140
- @{/example}
141
-
142
- ## Tech Stack
143
-
144
- [[LLM: This is the DEFINITIVE technology selection for the entire project. Work with user to finalize all choices. This table is the single source of truth - all development must use these exact versions.
145
-
146
- Key areas to cover:
147
-
148
- - Frontend and backend languages/frameworks
149
- - Databases and caching
150
- - Authentication and authorization
151
- - API approach
152
- - Testing tools for both frontend and backend
153
- - Build and deployment tools
154
- - Monitoring and logging
155
-
156
- Upon render, apply `tasks#advanced-elicitation` display immediately.]]
157
-
158
- ### Technology Stack Table
159
-
160
- | Category | Technology | Version | Purpose | Rationale |
161
- | :----------------------- | :---------------- | :---------- | :---------- | :------------- |
162
- | **Frontend Language** | {{fe_language}} | {{version}} | {{purpose}} | {{why_chosen}} |
163
- | **Frontend Framework** | {{fe_framework}} | {{version}} | {{purpose}} | {{why_chosen}} |
164
- | **UI Component Library** | {{ui_library}} | {{version}} | {{purpose}} | {{why_chosen}} |
165
- | **State Management** | {{state_mgmt}} | {{version}} | {{purpose}} | {{why_chosen}} |
166
- | **Backend Language** | {{be_language}} | {{version}} | {{purpose}} | {{why_chosen}} |
167
- | **Backend Framework** | {{be_framework}} | {{version}} | {{purpose}} | {{why_chosen}} |
168
- | **API Style** | {{api_style}} | {{version}} | {{purpose}} | {{why_chosen}} |
169
- | **Database** | {{database}} | {{version}} | {{purpose}} | {{why_chosen}} |
170
- | **Cache** | {{cache}} | {{version}} | {{purpose}} | {{why_chosen}} |
171
- | **File Storage** | {{storage}} | {{version}} | {{purpose}} | {{why_chosen}} |
172
- | **Authentication** | {{auth}} | {{version}} | {{purpose}} | {{why_chosen}} |
173
- | **Frontend Testing** | {{fe_test}} | {{version}} | {{purpose}} | {{why_chosen}} |
174
- | **Backend Testing** | {{be_test}} | {{version}} | {{purpose}} | {{why_chosen}} |
175
- | **E2E Testing** | {{e2e_test}} | {{version}} | {{purpose}} | {{why_chosen}} |
176
- | **Build Tool** | {{build_tool}} | {{version}} | {{purpose}} | {{why_chosen}} |
177
- | **Bundler** | {{bundler}} | {{version}} | {{purpose}} | {{why_chosen}} |
178
- | **IaC Tool** | {{iac_tool}} | {{version}} | {{purpose}} | {{why_chosen}} |
179
- | **CI/CD** | {{cicd}} | {{version}} | {{purpose}} | {{why_chosen}} |
180
- | **Monitoring** | {{monitoring}} | {{version}} | {{purpose}} | {{why_chosen}} |
181
- | **Logging** | {{logging}} | {{version}} | {{purpose}} | {{why_chosen}} |
182
- | **CSS Framework** | {{css_framework}} | {{version}} | {{purpose}} | {{why_chosen}} |
183
-
184
- @{example: tech_stack_rows}
185
- | **Frontend Language** | TypeScript | 5.3.3 | Type-safe frontend development | Strong typing, excellent tooling |
186
- | **Frontend Framework** | Next.js | 14.1.0 | React framework with SSR/SSG | SEO, performance, Vercel integration |
187
- | **Backend Language** | TypeScript | 5.3.3 | Type-safe backend development | Code sharing with frontend |
188
- | **API Style** | REST + tRPC | - | Type-safe API communication | End-to-end type safety |
189
- | **Database** | PostgreSQL | 16.1 | Primary data store | ACID compliance, JSON support |
190
- | **Authentication** | Supabase Auth | 2.39.0 | User authentication | Built-in auth flows, social providers |
191
- @{/example}
192
-
193
- ## Data Models
194
-
195
- [[LLM: Define the core data models/entities that will be shared between frontend and backend:
196
-
197
- 1. Review PRD requirements and identify key business entities
198
- 2. For each model, explain its purpose and relationships
199
- 3. Include key attributes and data types
200
- 4. Show relationships between models
201
- 5. Create TypeScript interfaces that can be shared
202
- 6. Discuss design decisions with user
203
-
204
- Create a clear conceptual model before moving to database schema.
205
-
206
- After presenting all data models, apply `tasks#advanced-elicitation` protocol]]
207
-
208
- <<REPEAT: data_model>>
209
-
210
- ### {{model_name}}
211
-
212
- **Purpose:** {{model_purpose}}
213
-
214
- **Key Attributes:**
215
-
216
- - {{attribute_1}}: {{type_1}} - {{description_1}}
217
- - {{attribute_2}}: {{type_2}} - {{description_2}}
218
-
219
- **TypeScript Interface:**
220
-
221
- ```typescript
222
- {
223
- {
224
- model_interface;
225
- }
226
- }
227
- ```
228
-
229
- **Relationships:**
230
-
231
- - {{relationship_1}}
232
- - {{relationship_2}}
233
- <</REPEAT>>
234
-
235
- @{example: data_model}
236
-
237
- ### User
238
-
239
- **Purpose:** Represents authenticated users in the system
240
-
241
- **Key Attributes:**
242
-
243
- - id: string - Unique identifier
244
- - email: string - User's email address
245
- - name: string - Display name
246
- - role: enum - User permission level
247
- - timestamps: Date - Created and updated times
248
-
249
- **TypeScript Interface:**
250
-
251
- ```typescript
252
- interface User {
253
- id: string;
254
- email: string;
255
- name: string;
256
- role: "admin" | "user" | "guest";
257
- createdAt: Date;
258
- updatedAt: Date;
259
- profile?: UserProfile;
260
- }
261
-
262
- interface UserProfile {
263
- avatarUrl?: string;
264
- bio?: string;
265
- preferences: Record<string, any>;
266
- }
267
- ```
268
-
269
- **Relationships:**
270
-
271
- - Has many Posts (1:n)
272
- - Has one Profile (1:1)
273
- @{/example}
274
-
275
- ## REST API Spec
276
-
277
- [[LLM: Based on the chosen API style from Tech Stack:
278
-
279
- 1. If REST API, create an OpenAPI 3.0 specification
280
- 2. If GraphQL, provide the GraphQL schema
281
- 3. If tRPC, show router definitions
282
- 4. Include all endpoints from epics/stories
283
- 5. Define request/response schemas based on data models
284
- 6. Document authentication requirements
285
- 7. Include example requests/responses
286
-
287
- Use appropriate format for the chosen API style. If no API (e.g., static site), skip this section.]]
288
-
289
- ^^CONDITION: has_rest_api^^
290
-
291
- ```yaml
292
- openapi: 3.0.0
293
- info:
294
- title:
295
- '[object Object]': null
296
- version:
297
- '[object Object]': null
298
- description:
299
- '[object Object]': null
300
- servers:
301
- - url:
302
- '[object Object]': null
303
- description:
304
- '[object Object]': null
305
- ```
306
-
307
- ^^/CONDITION: has_rest_api^^
308
-
309
- ^^CONDITION: has_graphql_api^^
310
-
311
- ```graphql
312
- # GraphQL Schema
313
- {{graphql_schema}}
314
- ```
315
-
316
- ^^/CONDITION: has_graphql_api^^
317
-
318
- ^^CONDITION: has_trpc_api^^
319
-
320
- ```typescript
321
- // tRPC Router Definitions
322
- {
323
- {
324
- trpc_routers;
325
- }
326
- }
327
- ```
328
-
329
- ^^/CONDITION: has_trpc_api^^
330
-
331
- [[LLM: After presenting the API spec (or noting its absence if not applicable), apply `tasks#advanced-elicitation` protocol]]
332
-
333
- ## Components
334
-
335
- [[LLM: Based on the architectural patterns, tech stack, and data models from above:
336
-
337
- 1. Identify major logical components/services across the fullstack
338
- 2. Consider both frontend and backend components
339
- 3. Define clear boundaries and interfaces between components
340
- 4. For each component, specify:
341
-
342
- - Primary responsibility
343
- - Key interfaces/APIs exposed
344
- - Dependencies on other components
345
- - Technology specifics based on tech stack choices
346
-
347
- 5. Create component diagrams where helpful
348
- 6. After presenting all components, apply `tasks#advanced-elicitation` protocol]]
349
-
350
- <<REPEAT: component>>
351
-
352
- ### {{component_name}}
353
-
354
- **Responsibility:** {{component_description}}
355
-
356
- **Key Interfaces:**
357
-
358
- - {{interface_1}}
359
- - {{interface_2}}
360
-
361
- **Dependencies:** {{dependencies}}
362
-
363
- **Technology Stack:** {{component_tech_details}}
364
- <</REPEAT>>
365
-
366
- ### Component Diagrams
367
-
368
- [[LLM: Create Mermaid diagrams to visualize component relationships. Options:
369
-
370
- - C4 Container diagram for high-level view
371
- - Component diagram for detailed internal structure
372
- - Sequence diagrams for complex interactions
373
- Choose the most appropriate for clarity
374
-
375
- After presenting the diagrams, apply `tasks#advanced-elicitation` protocol]]
376
-
377
- ## External APIs
378
-
379
- [[LLM: For each external service integration:
380
-
381
- 1. Identify APIs needed based on PRD requirements and component design
382
- 2. If documentation URLs are unknown, ask user for specifics
383
- 3. Document authentication methods and security considerations
384
- 4. List specific endpoints that will be used
385
- 5. Note any rate limits or usage constraints
386
-
387
- If no external APIs are needed, state this explicitly and skip to next section.]]
388
-
389
- ^^CONDITION: has_external_apis^^
390
-
391
- <<REPEAT: external_api>>
392
-
393
- ### {{api_name}} API
394
-
395
- - **Purpose:** {{api_purpose}}
396
- - **Documentation:** {{api_docs_url}}
397
- - **Base URL(s):** {{api_base_url}}
398
- - **Authentication:** {{auth_method}}
399
- - **Rate Limits:** {{rate_limits}}
400
-
401
- **Key Endpoints Used:**
402
- <<REPEAT: endpoint>>
403
-
404
- - `{{method}} {{endpoint_path}}` - {{endpoint_purpose}}
405
- <</REPEAT>>
406
-
407
- **Integration Notes:** {{integration_considerations}}
408
- <</REPEAT>>
409
-
410
- @{example: external_api}
411
-
412
- ### Stripe API
413
-
414
- - **Purpose:** Payment processing and subscription management
415
- - **Documentation:** https://stripe.com/docs/api
416
- - **Base URL(s):** `https://api.stripe.com/v1`
417
- - **Authentication:** Bearer token with secret key
418
- - **Rate Limits:** 100 requests per second
419
-
420
- **Key Endpoints Used:**
421
-
422
- - `POST /customers` - Create customer profiles
423
- - `POST /payment_intents` - Process payments
424
- - `POST /subscriptions` - Manage subscriptions
425
- @{/example}
426
-
427
- ^^/CONDITION: has_external_apis^^
428
-
429
- [[LLM: After presenting external APIs (or noting their absence), apply `tasks#advanced-elicitation` protocol]]
430
-
431
- ## Core Workflows
432
-
433
- [[LLM: Illustrate key system workflows using sequence diagrams:
434
-
435
- 1. Identify critical user journeys from PRD
436
- 2. Show component interactions including external APIs
437
- 3. Include both frontend and backend flows
438
- 4. Include error handling paths
439
- 5. Document async operations
440
- 6. Create both high-level and detailed diagrams as needed
441
-
442
- Focus on workflows that clarify architecture decisions or complex interactions.
443
-
444
- After presenting the workflow diagrams, apply `tasks#advanced-elicitation` protocol]]
445
-
446
- ## Database Schema
447
-
448
- [[LLM: Transform the conceptual data models into concrete database schemas:
449
-
450
- 1. Use the database type(s) selected in Tech Stack
451
- 2. Create schema definitions using appropriate notation
452
- 3. Include indexes, constraints, and relationships
453
- 4. Consider performance and scalability
454
- 5. For NoSQL, show document structures
455
-
456
- Present schema in format appropriate to database type (SQL DDL, JSON schema, etc.)
457
-
458
- After presenting the database schema, apply `tasks#advanced-elicitation` protocol]]
459
-
460
- ## Frontend Architecture
461
-
462
- [[LLM: Define frontend-specific architecture details. After each subsection, note if user wants to refine before continuing.
463
-
464
- After presenting this section, apply `tasks#advanced-elicitation` protocol]]
465
-
466
- ### Component Architecture
467
-
468
- [[LLM: Define component organization and patterns based on chosen framework.]]
469
-
470
- **Component Organization:**
471
-
472
- ```text
473
- {{component_structure}}
474
- ```
475
-
476
- **Component Template:**
477
-
478
- ```typescript
479
- {
480
- {
481
- component_template;
482
- }
483
- }
484
- ```
485
-
486
- ### State Management Architecture
487
-
488
- [[LLM: Detail state management approach based on chosen solution.]]
489
-
490
- **State Structure:**
491
-
492
- ```typescript
493
- {
494
- {
495
- state_structure;
496
- }
497
- }
498
- ```
499
-
500
- **State Management Patterns:**
501
-
502
- - {{pattern_1}}
503
- - {{pattern_2}}
504
-
505
- ### Routing Architecture
506
-
507
- [[LLM: Define routing structure based on framework choice.]]
508
-
509
- **Route Organization:**
510
-
511
- ```text
512
- {{route_structure}}
513
- ```
514
-
515
- **Protected Route Pattern:**
516
-
517
- ```typescript
518
- {
519
- {
520
- protected_route_example;
521
- }
522
- }
523
- ```
524
-
525
- ### Frontend Services Layer
526
-
527
- [[LLM: Define how frontend communicates with backend.]]
528
-
529
- **API Client Setup:**
530
-
531
- ```typescript
532
- {
533
- {
534
- api_client_setup;
535
- }
536
- }
537
- ```
538
-
539
- **Service Example:**
540
-
541
- ```typescript
542
- {
543
- {
544
- service_example;
545
- }
546
- }
547
- ```
548
-
549
- ## Backend Architecture
550
-
551
- [[LLM: Define backend-specific architecture details. Consider serverless vs traditional server approaches.
552
-
553
- After presenting this section, apply `tasks#advanced-elicitation` protocol]]
554
-
555
- ### Service Architecture
556
-
557
- [[LLM: Based on platform choice, define service organization.]]
558
-
559
- ^^CONDITION: serverless^^
560
- **Function Organization:**
561
-
562
- ```text
563
-
564
- {{function_structure}}
565
-
566
- ```
567
-
568
- **Function Template:**
569
-
570
- ```typescript
571
- {
572
- {
573
- function_template;
574
- }
575
- }
576
- ```
577
-
578
- ^^/CONDITION: serverless^^
579
-
580
- ^^CONDITION: traditional_server^^
581
- **Controller/Route Organization:**
582
-
583
- ```text
584
- {{controller_structure}}
585
- ```
586
-
587
- **Controller Template:**
588
-
589
- ```typescript
590
- {
591
- {
592
- controller_template;
593
- }
594
- }
595
- ```
596
-
597
- ^^/CONDITION: traditional_server^^
598
-
599
- ### Database Architecture
600
-
601
- [[LLM: Define database schema and access patterns.]]
602
-
603
- **Schema Design:**
604
-
605
- ```sql
606
- {{database_schema}}
607
- ```
608
-
609
- **Data Access Layer:**
610
-
611
- ```typescript
612
- {
613
- {
614
- repository_pattern;
615
- }
616
- }
617
- ```
618
-
619
- ### Authentication and Authorization
620
-
621
- [[LLM: Define auth implementation details.]]
622
-
623
- **Auth Flow:**
624
-
625
- ```mermaid
626
- {{auth_flow_diagram}}
627
- ```
628
-
629
- **Middleware/Guards:**
630
-
631
- ```typescript
632
- {
633
- {
634
- auth_middleware;
635
- }
636
- }
637
- ```
638
-
639
- ## Unified Project Structure
640
-
641
- [[LLM: Create a monorepo structure that accommodates both frontend and backend. Adapt based on chosen tools and frameworks. After presenting, apply `tasks#advanced-elicitation` protocol.]]
642
-
643
- ```plaintext
644
- {{project-name}}/
645
- ├── .github/ # CI/CD workflows
646
- │ └── workflows/
647
- │ ├── ci.yaml
648
- │ └── deploy.yaml
649
- ├── apps/ # Application packages
650
- │ ├── web/ # Frontend application
651
- │ │ ├── src/
652
- │ │ │ ├── components/ # UI components
653
- │ │ │ ├── pages/ # Page components/routes
654
- │ │ │ ├── hooks/ # Custom React hooks
655
- │ │ │ ├── services/ # API client services
656
- │ │ │ ├── stores/ # State management
657
- │ │ │ ├── styles/ # Global styles/themes
658
- │ │ │ └── utils/ # Frontend utilities
659
- │ │ ├── public/ # Static assets
660
- │ │ ├── tests/ # Frontend tests
661
- │ │ └── package.json
662
- │ └── api/ # Backend application
663
- │ ├── src/
664
- │ │ ├── routes/ # API routes/controllers
665
- │ │ ├── services/ # Business logic
666
- │ │ ├── models/ # Data models
667
- │ │ ├── middleware/ # Express/API middleware
668
- │ │ ├── utils/ # Backend utilities
669
- │ │ └── {{serverless_or_server_entry}}
670
- │ ├── tests/ # Backend tests
671
- │ └── package.json
672
- ├── packages/ # Shared packages
673
- │ ├── shared/ # Shared types/utilities
674
- │ │ ├── src/
675
- │ │ │ ├── types/ # TypeScript interfaces
676
- │ │ │ ├── constants/ # Shared constants
677
- │ │ │ └── utils/ # Shared utilities
678
- │ │ └── package.json
679
- │ ├── ui/ # Shared UI components
680
- │ │ ├── src/
681
- │ │ └── package.json
682
- │ └── config/ # Shared configuration
683
- │ ├── eslint/
684
- │ ├── typescript/
685
- │ └── jest/
686
- ├── infrastructure/ # IaC definitions
687
- │ └── {{iac_structure}}
688
- ├── scripts/ # Build/deploy scripts
689
- ├── docs/ # Documentation
690
- │ ├── prd.md
691
- │ ├── front-end-spec.md
692
- │ └── fullstack-architecture.md
693
- ├── .env.example # Environment template
694
- ├── package.json # Root package.json
695
- ├── {{monorepo_config}} # Monorepo configuration
696
- └── README.md
697
- ```
698
-
699
- @{example: vercel_structure}
700
- apps/
701
- ├── web/ # Next.js app
702
- │ ├── app/ # App directory (Next.js 14+)
703
- │ ├── components/
704
- │ └── lib/
705
- └── api/ # API routes in Next.js or separate
706
- └── pages/api/ # API routes
707
- @{/example}
708
-
709
- ## Development Workflow
710
-
711
- [[LLM: Define the development setup and workflow for the fullstack application.
712
-
713
- After presenting this section, apply `tasks#advanced-elicitation` protocol]]
714
-
715
- ### Local Development Setup
716
-
717
- **Prerequisites:**
718
-
719
- ```bash
720
- {{prerequisites_commands}}
721
- ```
722
-
723
- **Initial Setup:**
724
-
725
- ```bash
726
- {{setup_commands}}
727
- ```
728
-
729
- **Development Commands:**
730
-
731
- ```bash
732
- # Start all services
733
- {{start_all_command}}
734
-
735
- # Start frontend only
736
- {{start_frontend_command}}
737
-
738
- # Start backend only
739
- {{start_backend_command}}
740
-
741
- # Run tests
742
- {{test_commands}}
743
- ```
744
-
745
- ### Environment Configuration
746
-
747
- **Required Environment Variables:**
748
-
749
- ```bash
750
- # Frontend (.env.local)
751
- {{frontend_env_vars}}
752
-
753
- # Backend (.env)
754
- {{backend_env_vars}}
755
-
756
- # Shared
757
- {{shared_env_vars}}
758
- ```
759
-
760
- ## Deployment Architecture
761
-
762
- [[LLM: Define deployment strategy based on platform choice. After presenting, apply `tasks#advanced-elicitation` protocol.]]
763
-
764
- ### Deployment Strategy
765
-
766
- **Frontend Deployment:**
767
-
768
- - **Platform:** {{frontend_deploy_platform}}
769
- - **Build Command:** {{frontend_build_command}}
770
- - **Output Directory:** {{frontend_output_dir}}
771
- - **CDN/Edge:** {{cdn_strategy}}
772
-
773
- **Backend Deployment:**
774
-
775
- - **Platform:** {{backend_deploy_platform}}
776
- - **Build Command:** {{backend_build_command}}
777
- - **Deployment Method:** {{deployment_method}}
778
-
779
- ### CI/CD Pipeline
780
-
781
- ```yaml
782
- '[object Object]': null
783
- ```
784
-
785
- ### Environments
786
-
787
- | Environment | Frontend URL | Backend URL | Purpose |
788
- | :---------- | :----------------- | :----------------- | :--------------------- |
789
- | Development | {{dev_fe_url}} | {{dev_be_url}} | Local development |
790
- | Staging | {{staging_fe_url}} | {{staging_be_url}} | Pre-production testing |
791
- | Production | {{prod_fe_url}} | {{prod_be_url}} | Live environment |
792
-
793
- ## Security and Performance
794
-
795
- [[LLM: Define security and performance considerations for the fullstack application.
796
-
797
- After presenting this section, apply `tasks#advanced-elicitation` protocol]]
798
-
799
- ### Security Requirements
800
-
801
- **Frontend Security:**
802
-
803
- - CSP Headers: {{csp_policy}}
804
- - XSS Prevention: {{xss_strategy}}
805
- - Secure Storage: {{storage_strategy}}
806
-
807
- **Backend Security:**
808
-
809
- - Input Validation: {{validation_approach}}
810
- - Rate Limiting: {{rate_limit_config}}
811
- - CORS Policy: {{cors_config}}
812
-
813
- **Authentication Security:**
814
-
815
- - Token Storage: {{token_strategy}}
816
- - Session Management: {{session_approach}}
817
- - Password Policy: {{password_requirements}}
818
-
819
- ### Performance Optimization
820
-
821
- **Frontend Performance:**
822
-
823
- - Bundle Size Target: {{bundle_size}}
824
- - Loading Strategy: {{loading_approach}}
825
- - Caching Strategy: {{fe_cache_strategy}}
826
-
827
- **Backend Performance:**
828
-
829
- - Response Time Target: {{response_target}}
830
- - Database Optimization: {{db_optimization}}
831
- - Caching Strategy: {{be_cache_strategy}}
832
-
833
- ## Testing Strategy
834
-
835
- [[LLM: Define comprehensive testing approach for fullstack application.
836
-
837
- After presenting this section, apply `tasks#advanced-elicitation` protocol]]
838
-
839
- ### Testing Pyramid
840
-
841
- ```text
842
-
843
- E2E Tests
844
- / \
845
- Integration Tests
846
-
847
- / \
848
- Frontend Unit Backend Unit
849
-
850
- ```
851
-
852
- ### Test Organization
853
-
854
- **Frontend Tests:**
855
-
856
- ```text
857
-
858
- {{frontend_test_structure}}
859
-
860
- ```
861
-
862
- **Backend Tests:**
863
-
864
- ```text
865
-
866
- {{backend_test_structure}}
867
-
868
- ```
869
-
870
- **E2E Tests:**
871
-
872
- ```text
873
-
874
- {{e2e_test_structure}}
875
-
876
- ```
877
-
878
- ### Test Examples
879
-
880
- **Frontend Component Test:**
881
-
882
- ```typescript
883
- {
884
- {
885
- frontend_test_example;
886
- }
887
- }
888
- ```
889
-
890
- **Backend API Test:**
891
-
892
- ```typescript
893
- {
894
- {
895
- backend_test_example;
896
- }
897
- }
898
- ```
899
-
900
- **E2E Test:**
901
-
902
- ```typescript
903
- {
904
- {
905
- e2e_test_example;
906
- }
907
- }
908
- ```
909
-
910
- ## Coding Standards
911
-
912
- [[LLM: Define MINIMAL but CRITICAL standards for AI agents. Focus only on project-specific rules that prevent common mistakes. These will be used by dev agents.
913
-
914
- After presenting this section, apply `tasks#advanced-elicitation` protocol]]
915
-
916
- ### Critical Fullstack Rules
917
-
918
- <<REPEAT: critical_rule>>
919
-
920
- - **{{rule_name}}:** {{rule_description}}
921
- <</REPEAT>>
922
-
923
- @{example: critical_rules}
924
-
925
- - **Type Sharing:** Always define types in packages/shared and import from there
926
- - **API Calls:** Never make direct HTTP calls - use the service layer
927
- - **Environment Variables:** Access only through config objects, never process.env directly
928
- - **Error Handling:** All API routes must use the standard error handler
929
- - **State Updates:** Never mutate state directly - use proper state management patterns
930
- @{/example}
931
-
932
- ### Naming Conventions
933
-
934
- | Element | Frontend | Backend | Example |
935
- | :-------------- | :------------------- | :--------- | :------------------ |
936
- | Components | PascalCase | - | `UserProfile.tsx` |
937
- | Hooks | camelCase with 'use' | - | `useAuth.ts` |
938
- | API Routes | - | kebab-case | `/api/user-profile` |
939
- | Database Tables | - | snake_case | `user_profiles` |
940
-
941
- ## Error Handling Strategy
942
-
943
- [[LLM: Define unified error handling across frontend and backend.
944
-
945
- After presenting this section, apply `tasks#advanced-elicitation` protocol]]
946
-
947
- ### Error Flow
948
-
949
- ```mermaid
950
- {{error_flow_diagram}}
951
- ```
952
-
953
- ### Error Response Format
954
-
955
- ```typescript
956
- interface ApiError {
957
- error: {
958
- code: string;
959
- message: string;
960
- details?: Record<string, any>;
961
- timestamp: string;
962
- requestId: string;
963
- };
964
- }
965
- ```
966
-
967
- ### Frontend Error Handling
968
-
969
- ```typescript
970
- {
971
- {
972
- frontend_error_handler;
973
- }
974
- }
975
- ```
976
-
977
- ### Backend Error Handling
978
-
979
- ```typescript
980
- {
981
- {
982
- backend_error_handler;
983
- }
984
- }
985
- ```
986
-
987
- ## Monitoring and Observability
988
-
989
- [[LLM: Define monitoring strategy for fullstack application.
990
-
991
- After presenting this section, apply `tasks#advanced-elicitation` protocol]]
992
-
993
- ### Monitoring Stack
994
-
995
- - **Frontend Monitoring:** {{frontend_monitoring}}
996
- - **Backend Monitoring:** {{backend_monitoring}}
997
- - **Error Tracking:** {{error_tracking}}
998
- - **Performance Monitoring:** {{perf_monitoring}}
999
-
1000
- ### Key Metrics
1001
-
1002
- **Frontend Metrics:**
1003
-
1004
- - Core Web Vitals
1005
- - JavaScript errors
1006
- - API response times
1007
- - User interactions
1008
-
1009
- **Backend Metrics:**
1010
-
1011
- - Request rate
1012
- - Error rate
1013
- - Response time
1014
- - Database query performance
1015
-
1016
- ## Checklist Results Report
1017
-
1018
- [[LLM: Before running the checklist, offer to output the full architecture document. Once user confirms, execute the `architect-checklist` and populate results here.]]