architecture-tmpl.yaml 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651
  1. # <!-- Powered by BMAD™ Core -->
  2. template:
  3. id: architecture-template-v2
  4. name: Architecture Document
  5. version: 2.0
  6. output:
  7. format: markdown
  8. filename: docs/architecture.md
  9. title: "{{project_name}} Architecture Document"
  10. workflow:
  11. mode: interactive
  12. elicitation: advanced-elicitation
  13. sections:
  14. - id: introduction
  15. title: Introduction
  16. instruction: |
  17. If available, review any provided relevant documents to gather all relevant context before beginning. If at a minimum you cannot locate docs/prd.md ask the user what docs will provide the basis for the architecture.
  18. sections:
  19. - id: intro-content
  20. content: |
  21. 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.
  22. **Relationship to Frontend Architecture:**
  23. 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.
  24. - id: starter-template
  25. title: Starter Template or Existing Project
  26. instruction: |
  27. Before proceeding further with architecture design, check if the project is based on a starter template or existing codebase:
  28. 1. Review the PRD and brainstorming brief for any mentions of:
  29. - Starter templates (e.g., Create React App, Next.js, Vue CLI, Angular CLI, etc.)
  30. - Existing projects or codebases being used as a foundation
  31. - Boilerplate projects or scaffolding tools
  32. - Previous projects to be cloned or adapted
  33. 2. If a starter template or existing project is mentioned:
  34. - Ask the user to provide access via one of these methods:
  35. - Link to the starter template documentation
  36. - Upload/attach the project files (for small projects)
  37. - Share a link to the project repository (GitHub, GitLab, etc.)
  38. - Analyze the starter/existing project to understand:
  39. - Pre-configured technology stack and versions
  40. - Project structure and organization patterns
  41. - Built-in scripts and tooling
  42. - Existing architectural patterns and conventions
  43. - Any limitations or constraints imposed by the starter
  44. - Use this analysis to inform and align your architecture decisions
  45. 3. If no starter template is mentioned but this is a greenfield project:
  46. - Suggest appropriate starter templates based on the tech stack preferences
  47. - Explain the benefits (faster setup, best practices, community support)
  48. - Let the user decide whether to use one
  49. 4. If the user confirms no starter template will be used:
  50. - Proceed with architecture design from scratch
  51. - Note that manual setup will be required for all tooling and configuration
  52. Document the decision here before proceeding with the architecture design. If none, just say N/A
  53. elicit: true
  54. - id: changelog
  55. title: Change Log
  56. type: table
  57. columns: [Date, Version, Description, Author]
  58. instruction: Track document versions and changes
  59. - id: high-level-architecture
  60. title: High Level Architecture
  61. instruction: |
  62. This section contains multiple subsections that establish the foundation of the architecture. Present all subsections together at once.
  63. elicit: true
  64. sections:
  65. - id: technical-summary
  66. title: Technical Summary
  67. instruction: |
  68. Provide a brief paragraph (3-5 sentences) overview of:
  69. - The system's overall architecture style
  70. - Key components and their relationships
  71. - Primary technology choices
  72. - Core architectural patterns being used
  73. - Reference back to the PRD goals and how this architecture supports them
  74. - id: high-level-overview
  75. title: High Level Overview
  76. instruction: |
  77. Based on the PRD's Technical Assumptions section, describe:
  78. 1. The main architectural style (e.g., Monolith, Microservices, Serverless, Event-Driven)
  79. 2. Repository structure decision from PRD (Monorepo/Polyrepo)
  80. 3. Service architecture decision from PRD
  81. 4. Primary user interaction flow or data flow at a conceptual level
  82. 5. Key architectural decisions and their rationale
  83. - id: project-diagram
  84. title: High Level Project Diagram
  85. type: mermaid
  86. mermaid_type: graph
  87. instruction: |
  88. Create a Mermaid diagram that visualizes the high-level architecture. Consider:
  89. - System boundaries
  90. - Major components/services
  91. - Data flow directions
  92. - External integrations
  93. - User entry points
  94. - id: architectural-patterns
  95. title: Architectural and Design Patterns
  96. instruction: |
  97. List the key high-level patterns that will guide the architecture. For each pattern:
  98. 1. Present 2-3 viable options if multiple exist
  99. 2. Provide your recommendation with clear rationale
  100. 3. Get user confirmation before finalizing
  101. 4. These patterns should align with the PRD's technical assumptions and project goals
  102. Common patterns to consider:
  103. - Architectural style patterns (Serverless, Event-Driven, Microservices, CQRS, Hexagonal)
  104. - Code organization patterns (Dependency Injection, Repository, Module, Factory)
  105. - Data patterns (Event Sourcing, Saga, Database per Service)
  106. - Communication patterns (REST, GraphQL, Message Queue, Pub/Sub)
  107. template: "- **{{pattern_name}}:** {{pattern_description}} - _Rationale:_ {{rationale}}"
  108. examples:
  109. - "**Serverless Architecture:** Using AWS Lambda for compute - _Rationale:_ Aligns with PRD requirement for cost optimization and automatic scaling"
  110. - "**Repository Pattern:** Abstract data access logic - _Rationale:_ Enables testing and future database migration flexibility"
  111. - "**Event-Driven Communication:** Using SNS/SQS for service decoupling - _Rationale:_ Supports async processing and system resilience"
  112. - id: tech-stack
  113. title: Tech Stack
  114. instruction: |
  115. This is the DEFINITIVE technology selection section. Work with the user to make specific choices:
  116. 1. Review PRD technical assumptions and any preferences from .bmad-core/data/technical-preferences.yaml or an attached technical-preferences
  117. 2. For each category, present 2-3 viable options with pros/cons
  118. 3. Make a clear recommendation based on project needs
  119. 4. Get explicit user approval for each selection
  120. 5. Document exact versions (avoid "latest" - pin specific versions)
  121. 6. This table is the single source of truth - all other docs must reference these choices
  122. 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:
  123. - Starter templates (if any)
  124. - Languages and runtimes with exact versions
  125. - Frameworks and libraries / packages
  126. - Cloud provider and key services choices
  127. - 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
  128. - Development tools
  129. 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 elicit feedback - this statement and the options should be rendered and then prompt right all before allowing user input.
  130. elicit: true
  131. sections:
  132. - id: cloud-infrastructure
  133. title: Cloud Infrastructure
  134. template: |
  135. - **Provider:** {{cloud_provider}}
  136. - **Key Services:** {{core_services_list}}
  137. - **Deployment Regions:** {{regions}}
  138. - id: technology-stack-table
  139. title: Technology Stack Table
  140. type: table
  141. columns: [Category, Technology, Version, Purpose, Rationale]
  142. instruction: Populate the technology stack table with all relevant technologies
  143. examples:
  144. - "| **Language** | TypeScript | 5.3.3 | Primary development language | Strong typing, excellent tooling, team expertise |"
  145. - "| **Runtime** | Node.js | 20.11.0 | JavaScript runtime | LTS version, stable performance, wide ecosystem |"
  146. - "| **Framework** | NestJS | 10.3.2 | Backend framework | Enterprise-ready, good DI, matches team patterns |"
  147. - id: data-models
  148. title: Data Models
  149. instruction: |
  150. Define the core data models/entities:
  151. 1. Review PRD requirements and identify key business entities
  152. 2. For each model, explain its purpose and relationships
  153. 3. Include key attributes and data types
  154. 4. Show relationships between models
  155. 5. Discuss design decisions with user
  156. Create a clear conceptual model before moving to database schema.
  157. elicit: true
  158. repeatable: true
  159. sections:
  160. - id: model
  161. title: "{{model_name}}"
  162. template: |
  163. **Purpose:** {{model_purpose}}
  164. **Key Attributes:**
  165. - {{attribute_1}}: {{type_1}} - {{description_1}}
  166. - {{attribute_2}}: {{type_2}} - {{description_2}}
  167. **Relationships:**
  168. - {{relationship_1}}
  169. - {{relationship_2}}
  170. - id: components
  171. title: Components
  172. instruction: |
  173. Based on the architectural patterns, tech stack, and data models from above:
  174. 1. Identify major logical components/services and their responsibilities
  175. 2. Consider the repository structure (monorepo/polyrepo) from PRD
  176. 3. Define clear boundaries and interfaces between components
  177. 4. For each component, specify:
  178. - Primary responsibility
  179. - Key interfaces/APIs exposed
  180. - Dependencies on other components
  181. - Technology specifics based on tech stack choices
  182. 5. Create component diagrams where helpful
  183. elicit: true
  184. sections:
  185. - id: component-list
  186. repeatable: true
  187. title: "{{component_name}}"
  188. template: |
  189. **Responsibility:** {{component_description}}
  190. **Key Interfaces:**
  191. - {{interface_1}}
  192. - {{interface_2}}
  193. **Dependencies:** {{dependencies}}
  194. **Technology Stack:** {{component_tech_details}}
  195. - id: component-diagrams
  196. title: Component Diagrams
  197. type: mermaid
  198. instruction: |
  199. Create Mermaid diagrams to visualize component relationships. Options:
  200. - C4 Container diagram for high-level view
  201. - Component diagram for detailed internal structure
  202. - Sequence diagrams for complex interactions
  203. Choose the most appropriate for clarity
  204. - id: external-apis
  205. title: External APIs
  206. condition: Project requires external API integrations
  207. instruction: |
  208. For each external service integration:
  209. 1. Identify APIs needed based on PRD requirements and component design
  210. 2. If documentation URLs are unknown, ask user for specifics
  211. 3. Document authentication methods and security considerations
  212. 4. List specific endpoints that will be used
  213. 5. Note any rate limits or usage constraints
  214. If no external APIs are needed, state this explicitly and skip to next section.
  215. elicit: true
  216. repeatable: true
  217. sections:
  218. - id: api
  219. title: "{{api_name}} API"
  220. template: |
  221. - **Purpose:** {{api_purpose}}
  222. - **Documentation:** {{api_docs_url}}
  223. - **Base URL(s):** {{api_base_url}}
  224. - **Authentication:** {{auth_method}}
  225. - **Rate Limits:** {{rate_limits}}
  226. **Key Endpoints Used:**
  227. - `{{method}} {{endpoint_path}}` - {{endpoint_purpose}}
  228. **Integration Notes:** {{integration_considerations}}
  229. - id: core-workflows
  230. title: Core Workflows
  231. type: mermaid
  232. mermaid_type: sequence
  233. instruction: |
  234. Illustrate key system workflows using sequence diagrams:
  235. 1. Identify critical user journeys from PRD
  236. 2. Show component interactions including external APIs
  237. 3. Include error handling paths
  238. 4. Document async operations
  239. 5. Create both high-level and detailed diagrams as needed
  240. Focus on workflows that clarify architecture decisions or complex interactions.
  241. elicit: true
  242. - id: rest-api-spec
  243. title: REST API Spec
  244. condition: Project includes REST API
  245. type: code
  246. language: yaml
  247. instruction: |
  248. If the project includes a REST API:
  249. 1. Create an OpenAPI 3.0 specification
  250. 2. Include all endpoints from epics/stories
  251. 3. Define request/response schemas based on data models
  252. 4. Document authentication requirements
  253. 5. Include example requests/responses
  254. Use YAML format for better readability. If no REST API, skip this section.
  255. elicit: true
  256. template: |
  257. openapi: 3.0.0
  258. info:
  259. title: {{api_title}}
  260. version: {{api_version}}
  261. description: {{api_description}}
  262. servers:
  263. - url: {{server_url}}
  264. description: {{server_description}}
  265. - id: database-schema
  266. title: Database Schema
  267. instruction: |
  268. Transform the conceptual data models into concrete database schemas:
  269. 1. Use the database type(s) selected in Tech Stack
  270. 2. Create schema definitions using appropriate notation
  271. 3. Include indexes, constraints, and relationships
  272. 4. Consider performance and scalability
  273. 5. For NoSQL, show document structures
  274. Present schema in format appropriate to database type (SQL DDL, JSON schema, etc.)
  275. elicit: true
  276. - id: source-tree
  277. title: Source Tree
  278. type: code
  279. language: plaintext
  280. instruction: |
  281. Create a project folder structure that reflects:
  282. 1. The chosen repository structure (monorepo/polyrepo)
  283. 2. The service architecture (monolith/microservices/serverless)
  284. 3. The selected tech stack and languages
  285. 4. Component organization from above
  286. 5. Best practices for the chosen frameworks
  287. 6. Clear separation of concerns
  288. Adapt the structure based on project needs. For monorepos, show service separation. For serverless, show function organization. Include language-specific conventions.
  289. elicit: true
  290. examples:
  291. - |
  292. project-root/
  293. ├── packages/
  294. │ ├── api/ # Backend API service
  295. │ ├── web/ # Frontend application
  296. │ ├── shared/ # Shared utilities/types
  297. │ └── infrastructure/ # IaC definitions
  298. ├── scripts/ # Monorepo management scripts
  299. └── package.json # Root package.json with workspaces
  300. - id: infrastructure-deployment
  301. title: Infrastructure and Deployment
  302. instruction: |
  303. Define the deployment architecture and practices:
  304. 1. Use IaC tool selected in Tech Stack
  305. 2. Choose deployment strategy appropriate for the architecture
  306. 3. Define environments and promotion flow
  307. 4. Establish rollback procedures
  308. 5. Consider security, monitoring, and cost optimization
  309. Get user input on deployment preferences and CI/CD tool choices.
  310. elicit: true
  311. sections:
  312. - id: infrastructure-as-code
  313. title: Infrastructure as Code
  314. template: |
  315. - **Tool:** {{iac_tool}} {{version}}
  316. - **Location:** `{{iac_directory}}`
  317. - **Approach:** {{iac_approach}}
  318. - id: deployment-strategy
  319. title: Deployment Strategy
  320. template: |
  321. - **Strategy:** {{deployment_strategy}}
  322. - **CI/CD Platform:** {{cicd_platform}}
  323. - **Pipeline Configuration:** `{{pipeline_config_location}}`
  324. - id: environments
  325. title: Environments
  326. repeatable: true
  327. template: "- **{{env_name}}:** {{env_purpose}} - {{env_details}}"
  328. - id: promotion-flow
  329. title: Environment Promotion Flow
  330. type: code
  331. language: text
  332. template: "{{promotion_flow_diagram}}"
  333. - id: rollback-strategy
  334. title: Rollback Strategy
  335. template: |
  336. - **Primary Method:** {{rollback_method}}
  337. - **Trigger Conditions:** {{rollback_triggers}}
  338. - **Recovery Time Objective:** {{rto}}
  339. - id: error-handling-strategy
  340. title: Error Handling Strategy
  341. instruction: |
  342. Define comprehensive error handling approach:
  343. 1. Choose appropriate patterns for the language/framework from Tech Stack
  344. 2. Define logging standards and tools
  345. 3. Establish error categories and handling rules
  346. 4. Consider observability and debugging needs
  347. 5. Ensure security (no sensitive data in logs)
  348. This section guides both AI and human developers in consistent error handling.
  349. elicit: true
  350. sections:
  351. - id: general-approach
  352. title: General Approach
  353. template: |
  354. - **Error Model:** {{error_model}}
  355. - **Exception Hierarchy:** {{exception_structure}}
  356. - **Error Propagation:** {{propagation_rules}}
  357. - id: logging-standards
  358. title: Logging Standards
  359. template: |
  360. - **Library:** {{logging_library}} {{version}}
  361. - **Format:** {{log_format}}
  362. - **Levels:** {{log_levels_definition}}
  363. - **Required Context:**
  364. - Correlation ID: {{correlation_id_format}}
  365. - Service Context: {{service_context}}
  366. - User Context: {{user_context_rules}}
  367. - id: error-patterns
  368. title: Error Handling Patterns
  369. sections:
  370. - id: external-api-errors
  371. title: External API Errors
  372. template: |
  373. - **Retry Policy:** {{retry_strategy}}
  374. - **Circuit Breaker:** {{circuit_breaker_config}}
  375. - **Timeout Configuration:** {{timeout_settings}}
  376. - **Error Translation:** {{error_mapping_rules}}
  377. - id: business-logic-errors
  378. title: Business Logic Errors
  379. template: |
  380. - **Custom Exceptions:** {{business_exception_types}}
  381. - **User-Facing Errors:** {{user_error_format}}
  382. - **Error Codes:** {{error_code_system}}
  383. - id: data-consistency
  384. title: Data Consistency
  385. template: |
  386. - **Transaction Strategy:** {{transaction_approach}}
  387. - **Compensation Logic:** {{compensation_patterns}}
  388. - **Idempotency:** {{idempotency_approach}}
  389. - id: coding-standards
  390. title: Coding Standards
  391. instruction: |
  392. These standards are MANDATORY for AI agents. Work with user to define ONLY the critical rules needed to prevent bad code. Explain that:
  393. 1. This section directly controls AI developer behavior
  394. 2. Keep it minimal - assume AI knows general best practices
  395. 3. Focus on project-specific conventions and gotchas
  396. 4. Overly detailed standards bloat context and slow development
  397. 5. Standards will be extracted to separate file for dev agent use
  398. For each standard, get explicit user confirmation it's necessary.
  399. elicit: true
  400. sections:
  401. - id: core-standards
  402. title: Core Standards
  403. template: |
  404. - **Languages & Runtimes:** {{languages_and_versions}}
  405. - **Style & Linting:** {{linter_config}}
  406. - **Test Organization:** {{test_file_convention}}
  407. - id: naming-conventions
  408. title: Naming Conventions
  409. type: table
  410. columns: [Element, Convention, Example]
  411. instruction: Only include if deviating from language defaults
  412. - id: critical-rules
  413. title: Critical Rules
  414. instruction: |
  415. List ONLY rules that AI might violate or project-specific requirements. Examples:
  416. - "Never use console.log in production code - use logger"
  417. - "All API responses must use ApiResponse wrapper type"
  418. - "Database queries must use repository pattern, never direct ORM"
  419. Avoid obvious rules like "use SOLID principles" or "write clean code"
  420. repeatable: true
  421. template: "- **{{rule_name}}:** {{rule_description}}"
  422. - id: language-specifics
  423. title: Language-Specific Guidelines
  424. condition: Critical language-specific rules needed
  425. instruction: Add ONLY if critical for preventing AI mistakes. Most teams don't need this section.
  426. sections:
  427. - id: language-rules
  428. title: "{{language_name}} Specifics"
  429. repeatable: true
  430. template: "- **{{rule_topic}}:** {{rule_detail}}"
  431. - id: test-strategy
  432. title: Test Strategy and Standards
  433. instruction: |
  434. Work with user to define comprehensive test strategy:
  435. 1. Use test frameworks from Tech Stack
  436. 2. Decide on TDD vs test-after approach
  437. 3. Define test organization and naming
  438. 4. Establish coverage goals
  439. 5. Determine integration test infrastructure
  440. 6. Plan for test data and external dependencies
  441. Note: Basic info goes in Coding Standards for dev agent. This detailed section is for QA agent and team reference.
  442. elicit: true
  443. sections:
  444. - id: testing-philosophy
  445. title: Testing Philosophy
  446. template: |
  447. - **Approach:** {{test_approach}}
  448. - **Coverage Goals:** {{coverage_targets}}
  449. - **Test Pyramid:** {{test_distribution}}
  450. - id: test-types
  451. title: Test Types and Organization
  452. sections:
  453. - id: unit-tests
  454. title: Unit Tests
  455. template: |
  456. - **Framework:** {{unit_test_framework}} {{version}}
  457. - **File Convention:** {{unit_test_naming}}
  458. - **Location:** {{unit_test_location}}
  459. - **Mocking Library:** {{mocking_library}}
  460. - **Coverage Requirement:** {{unit_coverage}}
  461. **AI Agent Requirements:**
  462. - Generate tests for all public methods
  463. - Cover edge cases and error conditions
  464. - Follow AAA pattern (Arrange, Act, Assert)
  465. - Mock all external dependencies
  466. - id: integration-tests
  467. title: Integration Tests
  468. template: |
  469. - **Scope:** {{integration_scope}}
  470. - **Location:** {{integration_test_location}}
  471. - **Test Infrastructure:**
  472. - **{{dependency_name}}:** {{test_approach}} ({{test_tool}})
  473. examples:
  474. - "**Database:** In-memory H2 for unit tests, Testcontainers PostgreSQL for integration"
  475. - "**Message Queue:** Embedded Kafka for tests"
  476. - "**External APIs:** WireMock for stubbing"
  477. - id: e2e-tests
  478. title: End-to-End Tests
  479. template: |
  480. - **Framework:** {{e2e_framework}} {{version}}
  481. - **Scope:** {{e2e_scope}}
  482. - **Environment:** {{e2e_environment}}
  483. - **Test Data:** {{e2e_data_strategy}}
  484. - id: test-data-management
  485. title: Test Data Management
  486. template: |
  487. - **Strategy:** {{test_data_approach}}
  488. - **Fixtures:** {{fixture_location}}
  489. - **Factories:** {{factory_pattern}}
  490. - **Cleanup:** {{cleanup_strategy}}
  491. - id: continuous-testing
  492. title: Continuous Testing
  493. template: |
  494. - **CI Integration:** {{ci_test_stages}}
  495. - **Performance Tests:** {{perf_test_approach}}
  496. - **Security Tests:** {{security_test_approach}}
  497. - id: security
  498. title: Security
  499. instruction: |
  500. Define MANDATORY security requirements for AI and human developers:
  501. 1. Focus on implementation-specific rules
  502. 2. Reference security tools from Tech Stack
  503. 3. Define clear patterns for common scenarios
  504. 4. These rules directly impact code generation
  505. 5. Work with user to ensure completeness without redundancy
  506. elicit: true
  507. sections:
  508. - id: input-validation
  509. title: Input Validation
  510. template: |
  511. - **Validation Library:** {{validation_library}}
  512. - **Validation Location:** {{where_to_validate}}
  513. - **Required Rules:**
  514. - All external inputs MUST be validated
  515. - Validation at API boundary before processing
  516. - Whitelist approach preferred over blacklist
  517. - id: auth-authorization
  518. title: Authentication & Authorization
  519. template: |
  520. - **Auth Method:** {{auth_implementation}}
  521. - **Session Management:** {{session_approach}}
  522. - **Required Patterns:**
  523. - {{auth_pattern_1}}
  524. - {{auth_pattern_2}}
  525. - id: secrets-management
  526. title: Secrets Management
  527. template: |
  528. - **Development:** {{dev_secrets_approach}}
  529. - **Production:** {{prod_secrets_service}}
  530. - **Code Requirements:**
  531. - NEVER hardcode secrets
  532. - Access via configuration service only
  533. - No secrets in logs or error messages
  534. - id: api-security
  535. title: API Security
  536. template: |
  537. - **Rate Limiting:** {{rate_limit_implementation}}
  538. - **CORS Policy:** {{cors_configuration}}
  539. - **Security Headers:** {{required_headers}}
  540. - **HTTPS Enforcement:** {{https_approach}}
  541. - id: data-protection
  542. title: Data Protection
  543. template: |
  544. - **Encryption at Rest:** {{encryption_at_rest}}
  545. - **Encryption in Transit:** {{encryption_in_transit}}
  546. - **PII Handling:** {{pii_rules}}
  547. - **Logging Restrictions:** {{what_not_to_log}}
  548. - id: dependency-security
  549. title: Dependency Security
  550. template: |
  551. - **Scanning Tool:** {{dependency_scanner}}
  552. - **Update Policy:** {{update_frequency}}
  553. - **Approval Process:** {{new_dep_process}}
  554. - id: security-testing
  555. title: Security Testing
  556. template: |
  557. - **SAST Tool:** {{static_analysis}}
  558. - **DAST Tool:** {{dynamic_analysis}}
  559. - **Penetration Testing:** {{pentest_schedule}}
  560. - id: checklist-results
  561. title: Checklist Results Report
  562. instruction: Before running the checklist, offer to output the full architecture document. Once user confirms, execute the architect-checklist and populate results here.
  563. - id: next-steps
  564. title: Next Steps
  565. instruction: |
  566. After completing the architecture:
  567. 1. If project has UI components:
  568. - Use "Frontend Architecture Mode"
  569. - Provide this document as input
  570. 2. For all projects:
  571. - Review with Product Owner
  572. - Begin story implementation with Dev agent
  573. - Set up infrastructure with DevOps agent
  574. 3. Include specific prompts for next agents if needed
  575. sections:
  576. - id: architect-prompt
  577. title: Architect Prompt
  578. condition: Project has UI components
  579. instruction: |
  580. Create a brief prompt to hand off to Architect for Frontend Architecture creation. Include:
  581. - Reference to this architecture document
  582. - Key UI requirements from PRD
  583. - Any frontend-specific decisions made here
  584. - Request for detailed frontend architecture