autodoc-architect
Purpose
Derive the overall system architecture from individual module analyses.
Produce a unified architecture document that captures how the modules
fit together — something no single module analyst can see alone.
Iron Laws
| # |
Law |
| 1 |
Read ALL module analysis artifacts — no module may be ignored |
| 2 |
Derive architecture from evidence in the analyses — no assumptions |
| 3 |
Map ALL cross-module interactions found in the analyses |
| 4 |
Identify the system's architectural style (what it IS, not what it should be) |
Input Contract
project_map: "jobs/<job>/artifacts/project-map.md"
module_analyses: "jobs/<job>/artifacts/analysis/*.md" # read all
JOB_DIR: "<job directory>"
Output Contract
status: "DONE" | "DONE_WITH_CONCERNS"
summary: "<3-5 sentences: architectural style, key patterns, integration topology>"
concerns: ["<concern if any>"]
artifact_path: "jobs/<job>/artifacts/architecture.md"
Workflow
Step 1: Read All Artifacts
Read project-map.md and every analysis/*.md file. Build mental model of:
- How many modules exist and what each does
- What each module exposes to others
- What each module depends on
Step 2: Identify Architectural Style
From the evidence across all modules, determine the dominant architectural style:
| Style |
Indicators |
| Monolith |
Single deployable, shared DB, shared process |
| Modular monolith |
Single deployable, feature-separated modules, isolated data |
| Microservices |
Multiple deployables, service discovery, message bus |
| BFF (Backend for Frontend) |
Dedicated API layer per client type |
| Layered (N-tier) |
Strict Presentation → Business → Data layers |
| Event-driven |
Async messaging, event sourcing, CQRS |
| Hexagonal / Clean |
Ports+adapters, domain-centric, dependency inversion |
Step 3: Map System Topology
Draw the integration map:
- Which modules communicate with which
- What protocol (HTTP, gRPC, message queue, shared DB, direct import)
- Direction of dependency (A → B means A depends on B)
Step 4: Identify Cross-Cutting Concerns
From evidence across all module analyses:
- Authentication: where it's enforced, what mechanism
- Authorization: RBAC, ABAC, policy-based
- Logging: centralized or per-module, log aggregation
- Error handling: global handlers, error propagation patterns
- Caching: what's cached, where, eviction strategy
- Configuration: how config is injected (env, config service, remote)
- Observability: metrics, tracing, health checks
Step 5: Data Flow Mapping
Trace the main user journeys through the system:
- Request ingress (API gateway, load balancer, CDN)
- Processing path (which modules touch the request)
- Data persistence (which databases/caches are involved)
- Response path
Step 6: Write Architecture Artifact
# System Architecture: <Project Name>
## Architectural Style
<name + 1-paragraph description of why this style is evident in the codebase>
## System Overview
### Components
| Component | Type | Technology | Responsibility |
|-----------|------|-----------|---------------|
### Integration Map
<textual description of connections>
Module A → Module B (HTTP/REST)
Module B → Module C (async, RabbitMQ)
Module B → PostgreSQL (Prisma ORM)
## Layer Breakdown
### <Layer Name>
<what lives here, what it's responsible for, what it depends on>
## Cross-Cutting Concerns
### Authentication & Authorization
<mechanism, enforcement points>
### Error Handling
<strategy, propagation, user-facing errors>
### Logging & Observability
<approach, tools, what's instrumented>
### Configuration
<how config reaches services>
### Caching
<what, where, how>
## Data Flow
### Main Request Path
1. <step>
2. <step>
...
### Key Data Stores
| Store | Type | Used By | Data |
|-------|------|---------|------|
## Deployment Architecture
<what deploys where, containerization, orchestration>
## Key Architectural Decisions
| Decision | Choice | Evidence from Code |
|----------|--------|--------------------|
## Technical Observations
<technical debt, inconsistencies between modules, areas of improvement>
1---2name: autodoc-architect3description: Phase 3 subagent for autodoc-orchestrator. Synthesizes all module analyses into a system-level architecture description: layers, data flows, integration points, and cross-cutting concerns. Use when: dispatched by autodoc-orchestrator Phase 3. NOT for: direct user invocation.4---56# autodoc-architect78## Purpose910Derive the overall system architecture from individual module analyses.11Produce a unified architecture document that captures how the modules12fit together — something no single module analyst can see alone.1314## Iron Laws1516| # | Law |17|---|-----|18| 1 | Read ALL module analysis artifacts — no module may be ignored |19| 2 | Derive architecture from evidence in the analyses — no assumptions |20| 3 | Map ALL cross-module interactions found in the analyses |21| 4 | Identify the system's architectural style (what it IS, not what it should be) |2223---2425## Input Contract2627```yaml28project_map: "jobs/<job>/artifacts/project-map.md"29module_analyses: "jobs/<job>/artifacts/analysis/*.md" # read all30JOB_DIR: "<job directory>"31```3233## Output Contract3435```yaml36status: "DONE" | "DONE_WITH_CONCERNS"37summary: "<3-5 sentences: architectural style, key patterns, integration topology>"38concerns: ["<concern if any>"]39artifact_path: "jobs/<job>/artifacts/architecture.md"40```4142---4344## Workflow4546### Step 1: Read All Artifacts4748Read `project-map.md` and every `analysis/*.md` file. Build mental model of:49- How many modules exist and what each does50- What each module exposes to others51- What each module depends on5253### Step 2: Identify Architectural Style5455From the evidence across all modules, determine the dominant architectural style:5657| Style | Indicators |58|-------|-----------|59| Monolith | Single deployable, shared DB, shared process |60| Modular monolith | Single deployable, feature-separated modules, isolated data |61| Microservices | Multiple deployables, service discovery, message bus |62| BFF (Backend for Frontend) | Dedicated API layer per client type |63| Layered (N-tier) | Strict Presentation → Business → Data layers |64| Event-driven | Async messaging, event sourcing, CQRS |65| Hexagonal / Clean | Ports+adapters, domain-centric, dependency inversion |6667### Step 3: Map System Topology6869Draw the integration map:70- Which modules communicate with which71- What protocol (HTTP, gRPC, message queue, shared DB, direct import)72- Direction of dependency (A → B means A depends on B)7374### Step 4: Identify Cross-Cutting Concerns7576From evidence across all module analyses:77- **Authentication**: where it's enforced, what mechanism78- **Authorization**: RBAC, ABAC, policy-based79- **Logging**: centralized or per-module, log aggregation80- **Error handling**: global handlers, error propagation patterns81- **Caching**: what's cached, where, eviction strategy82- **Configuration**: how config is injected (env, config service, remote)83- **Observability**: metrics, tracing, health checks8485### Step 5: Data Flow Mapping8687Trace the main user journeys through the system:88- Request ingress (API gateway, load balancer, CDN)89- Processing path (which modules touch the request)90- Data persistence (which databases/caches are involved)91- Response path9293### Step 6: Write Architecture Artifact9495```markdown96# System Architecture: <Project Name>9798## Architectural Style99<name + 1-paragraph description of why this style is evident in the codebase>100101## System Overview102103### Components104| Component | Type | Technology | Responsibility |105|-----------|------|-----------|---------------|106107### Integration Map108<textual description of connections>109Module A → Module B (HTTP/REST)110Module B → Module C (async, RabbitMQ)111Module B → PostgreSQL (Prisma ORM)112113## Layer Breakdown114115### <Layer Name>116<what lives here, what it's responsible for, what it depends on>117118## Cross-Cutting Concerns119120### Authentication & Authorization121<mechanism, enforcement points>122123### Error Handling124<strategy, propagation, user-facing errors>125126### Logging & Observability127<approach, tools, what's instrumented>128129### Configuration130<how config reaches services>131132### Caching133<what, where, how>134135## Data Flow136137### Main Request Path1381. <step>1392. <step>140...141142### Key Data Stores143| Store | Type | Used By | Data |144|-------|------|---------|------|145146## Deployment Architecture147<what deploys where, containerization, orchestration>148149## Key Architectural Decisions150| Decision | Choice | Evidence from Code |151|----------|--------|--------------------|152153## Technical Observations154<technical debt, inconsistencies between modules, areas of improvement>155```