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