Generate Architecture Documentation
You create professional ARCHITECTURE.md files following IEEE/ISO 15289 (Life-cycle Information Items).
Document Structure
# Architecture — [Project Name]
## Overview
Brief description of the system's purpose, scope, and primary actors.
## Tech Stack
| Layer | Technology | Version | Purpose |
|---|---|---|---|
| Runtime | ... | ... | ... |
| Framework | ... | ... | ... |
| Database | ... | ... | ... |
| Auth | ... | ... | ... |
## Component Architecture
### Module: [name]
- **Responsibility**: ...
- **Public API**: classes/interfaces exposed
- **Dependencies**: other modules consumed
- **Database**: tables owned
(Repeat for each module)
## Data Model
### Entities
For each entity:
- **Name** and primary key
- **Fields** with types and constraints
- **Relationships** to other entities
- **Indexes** for performance
### Schema Changes
List of schema migrations or changes in order, with what each one does.
## API Contracts
(Adapt this section to the project's interface type: REST endpoints, GraphQL schema, gRPC services, CLI commands, SDK methods, or message queue topics)
### Endpoints by Resource
For each resource (e.g., Task, Project, User):
- HTTP method + path
- Request/response schemas
- Auth requirements
- Error responses
## Cross-Cutting Concerns
### Authentication & Authorization
- Auth mechanism (JWT, OAuth, etc.)
- Token claims structure
- Role-based access control rules
### Multi-Tenancy (if applicable)
- Tenant isolation strategy
- Tenant ID propagation
- Cross-tenant data leak prevention
### Rate Limiting (if applicable)
- Limits per tenant/user
- Implementation strategy
- Headers exposed (X-RateLimit-*)
### Logging & Observability
- Log levels and structure
- Tracing/metrics endpoints
## Non-Functional Requirements
| NFR | Target | Validation |
|---|---|---|
| Response time (P95) | < 100ms | Load test |
| Concurrent users | 500 | Stress test |
| Availability | 99.9% | Uptime monitoring |
## Architectural Decisions (ADRs)
### ADR-001: [Decision title]
- **Status**: Accepted/Superseded
- **Context**: Why this decision was needed
- **Decision**: What was decided
- **Consequences**: Trade-offs
(Repeat for each significant decision)
## Standards Compliance
- IEEE SWEBOK v4.0 — used for component categorization
- ISO/IEC/IEEE 12207 — software lifecycle processes
- ISO/IEC/IEEE 15289 — documentation standards
- (Additional standards as applicable)
## Glossary
Definitions of domain-specific terms used throughout the codebase.
How to Use
- Read the project structure: source files, package layout, README
- Identify modules and their responsibilities
- Map entities and relationships from data model definitions (ORM models, schema files, migration scripts)
- Extract interfaces from the codebase (API endpoints, CLI commands, SDK methods, message handlers)
- Identify cross-cutting concerns from middleware, interceptors, decorators, or framework configuration
- Generate the document in the order above
- Save as ARCHITECTURE.md in project root
Quality Checklist
1---2name: generate-architecture-doc3description: Generates ARCHITECTURE.md following IEEE 15289 standards. Use when documenting a new or existing project's technical architecture. Do NOT use for user-facing docs (use generate-user-guide) or API docs (use generate-api-catalog). Trigger with "generate architecture doc", "document the architecture", or "create ARCHITECTURE.md".4---56# Generate Architecture Documentation78You create professional ARCHITECTURE.md files following IEEE/ISO 15289 (Life-cycle Information Items).910## Document Structure1112```markdown13# Architecture — [Project Name]1415## Overview16Brief description of the system's purpose, scope, and primary actors.1718## Tech Stack19| Layer | Technology | Version | Purpose |20|---|---|---|---|21| Runtime | ... | ... | ... |22| Framework | ... | ... | ... |23| Database | ... | ... | ... |24| Auth | ... | ... | ... |2526## Component Architecture2728### Module: [name]29- **Responsibility**: ...30- **Public API**: classes/interfaces exposed31- **Dependencies**: other modules consumed32- **Database**: tables owned3334(Repeat for each module)3536## Data Model3738### Entities39For each entity:40- **Name** and primary key41- **Fields** with types and constraints42- **Relationships** to other entities43- **Indexes** for performance4445### Schema Changes46List of schema migrations or changes in order, with what each one does.4748## API Contracts4950(Adapt this section to the project's interface type: REST endpoints, GraphQL schema, gRPC services, CLI commands, SDK methods, or message queue topics)5152### Endpoints by Resource53For each resource (e.g., Task, Project, User):54- HTTP method + path55- Request/response schemas56- Auth requirements57- Error responses5859## Cross-Cutting Concerns6061### Authentication & Authorization62- Auth mechanism (JWT, OAuth, etc.)63- Token claims structure64- Role-based access control rules6566### Multi-Tenancy (if applicable)67- Tenant isolation strategy68- Tenant ID propagation69- Cross-tenant data leak prevention7071### Rate Limiting (if applicable)72- Limits per tenant/user73- Implementation strategy74- Headers exposed (X-RateLimit-*)7576### Logging & Observability77- Log levels and structure78- Tracing/metrics endpoints7980## Non-Functional Requirements8182| NFR | Target | Validation |83|---|---|---|84| Response time (P95) | < 100ms | Load test |85| Concurrent users | 500 | Stress test |86| Availability | 99.9% | Uptime monitoring |8788## Architectural Decisions (ADRs)8990### ADR-001: [Decision title]91- **Status**: Accepted/Superseded92- **Context**: Why this decision was needed93- **Decision**: What was decided94- **Consequences**: Trade-offs9596(Repeat for each significant decision)9798## Standards Compliance99100- IEEE SWEBOK v4.0 — used for component categorization101- ISO/IEC/IEEE 12207 — software lifecycle processes102- ISO/IEC/IEEE 15289 — documentation standards103- (Additional standards as applicable)104105## Glossary106107Definitions of domain-specific terms used throughout the codebase.108```109110## How to Use1111121. Read the project structure: source files, package layout, README1132. Identify modules and their responsibilities1143. Map entities and relationships from data model definitions (ORM models, schema files, migration scripts)1154. Extract interfaces from the codebase (API endpoints, CLI commands, SDK methods, message handlers)1165. Identify cross-cutting concerns from middleware, interceptors, decorators, or framework configuration1176. Generate the document in the order above1187. Save as ARCHITECTURE.md in project root119120## Quality Checklist121122- [ ] Tech stack table with exact versions123- [ ] Each module has Responsibility, Public API, Dependencies124- [ ] Entity diagram or table with all fields125- [ ] All endpoints documented (no orphan controllers)126- [ ] Auth flow described step-by-step127- [ ] At least 3 ADRs for significant decisions128- [ ] Standards compliance section129- [ ] No code blocks longer than 20 lines (link to file instead)