C4 Architecture Documentation Workflow
Generate comprehensive C4 architecture documentation for an existing repository/codebase using a bottom-up analysis approach.
[Extended thinking: This workflow implements a complete C4 architecture documentation process following the C4 model (Context, Container, Component, Code). It uses a bottom-up approach, starting from the deepest code directories and working upward, ensuring every code element is documented before synthesizing into higher-level abstractions. The workflow coordinates four specialized C4 agents (Code, Component, Container, Context) to create a complete architectural documentation set that serves both technical and non-technical stakeholders.]
Use this skill when
- Working on c4 architecture documentation workflow tasks or workflows
- Needing guidance, best practices, or checklists for c4 architecture documentation workflow
Do not use this skill when
- The task is unrelated to c4 architecture documentation workflow
- You need a different domain or tool outside this scope
Instructions
- Clarify goals, constraints, and required inputs.
- Apply relevant best practices and validate outcomes.
- Provide actionable steps and verification.
Overview
This workflow creates comprehensive C4 architecture documentation following the official C4 model by:
- Code Level: Analyzing every subdirectory bottom-up to create code-level documentation
- Component Level: Synthesizing code documentation into logical components within containers
- Container Level: Mapping components to deployment containers with API documentation (shows high-level technology choices)
- Context Level: Creating high-level system context with personas and user journeys (focuses on people and software systems, not technologies)
Note: According to the C4 model, you don't need to use all 4 levels of diagram - the system context and container diagrams are sufficient for most software development teams. This workflow generates all levels for completeness, but teams can choose which levels to use.
All documentation is written to a new C4-Documentation/ directory in the repository root.
Phase 1: Code-Level Documentation (Bottom-Up Analysis)
1.1 Discover All Subdirectories
- Use codebase search to identify all subdirectories in the repository
- Sort directories by depth (deepest first) for bottom-up processing
- Filter out common non-code directories (node_modules, .git, build, dist, etc.)
- Create list of directories to process
1.2 Process Each Directory (Bottom-Up)
For each directory, starting from the deepest:
Use Task tool with subagent_type="c4-architecture::c4-code"
Prompt: |
Analyze the code in directory: [directory_path]
Create comprehensive C4 Code-level documentation following this structure:
- Overview Section:
- Name: [Descriptive name for this code directory]
- Description: [Short description of what this code does]
- Location: [Link to actual directory path relative to repo root]
- Language: [Primary programming language(s) used]
- Purpose: [What this code accomplishes]
- Code Elements Section:
- Document all functions/methods with complete signatures:
- Function name, parameters (with types), return type
- Description of what each function does
- Location (file path and line numbers)
- Dependencies (what this function depends on)
- Document all classes/modules:
- Class name, description, location
- Methods and their signatures
- Dependencies
- Dependencies Section:
- Internal dependencies (other code in this repo)
- External dependencies (libraries, frameworks, services)
- Relationships Section:
- Optional Mermaid diagram if relationships are complex
Save the output as: C4-Documentation/c4-code-[directory-name].md
Use a sanitized directory name (replace / with -, remove special chars) for the filename.
Ensure the documentation includes:
- Complete function signatures with all parameters and types
- Links to actual source code locations
- All dependencies (internal and external)
- Clear, descriptive names and descriptions
Expected output: c4-code-.md file in C4-Documentation/
Context: All files in the directory and its subdirectories
Repeat for every subdirectory until all directories have corresponding c4-code-*.md files.
Phase 2: Component-Level Synthesis
2.1 Analyze All Code-Level Documentation
- Collect all c4-code-*.md files created in Phase 1
- Analyze code structure, dependencies, and relationships
- Identify logical component boundaries based on:
- Domain boundaries (related business functionality)
- Technical boundaries (shared frameworks, libraries)
- Organizational boundaries (team ownership, if evident)
2.2 Create Component Documentation
For each identified component:
Use Task tool with subagent_type="c4-architecture::c4-component"
Prompt: |
Synthesize the following C4 Code-level documentation files into a logical component:
Code files to analyze:
[List of c4-code-*.md file paths]
Create comprehensive C4 Component-level documentation following this structure:
- Overview Section:
- Name: [Component name - descriptive and meaningful]
- Description: [Short description of component purpose]
- Type: [Application, Service, Library, etc.]
- Technology: [Primary technologies used]
- Purpose Section:
- Detailed description of what this component does
- What problems it solves
- Its role in the system
- Software Features Section:
- List all software features provided by this component
- Each feature with a brief description
- Code Elements Section:
- List all c4-code-*.md files contained in this component
- Link to each file with a brief description
- Interfaces Section:
- Document all component interfaces:
- Interface name
- Protocol (REST, GraphQL, gRPC, Events, etc.)
- Description
- Operations (function signatures, endpoints, etc.)
- Dependencies Section:
- Components used (other components this depends on)
- External systems (databases, APIs, services)
- Component Diagram:
- Mermaid diagram showing this component and its relationships
Save the output as: C4-Documentation/c4-component-[component-name].md
Use a sanitized component name for the filename.
Expected output: c4-component-.md file for each component
Context: All relevant c4-code-*.md files for this component
2.3 Create Master Component Index
Use Task tool with subagent_type="c4-architecture::c4-component"
Prompt: |
Create a master component index that lists all components in the system.
Based on all c4-component-*.md files created, generate:
- System Components Section:
- List all components with:
- Component name
- Short description
- Link to component documentation
- Component Relationships Diagram:
- Mermaid diagram showing all components and their relationships
- Show dependencies between components
- Show external system dependencies
Save the output as: C4-Documentation/c4-component.md
Expected output: Master c4-component.md file
Context: All c4-component-*.md files
Phase 3: Container-Level Synthesis
3.1 Analyze Components and Deployment Definitions
- Review all c4-component-*.md files
- Search for deployment/infrastructure definitions:
- Dockerfiles
- Kubernetes manifests (deployments, services, etc.)
- Docker Compose files
- Terraform/CloudFormation configs
- Cloud service definitions (AWS Lambda, Azure Functions, etc.)
- CI/CD pipeline definitions
3.2 Map Components to Containers
Use Task tool with subagent_type="c4-architecture::c4-container"
Prompt: |
Synthesize components into containers based on deployment definitions.
Component documentation:
[List of all c4-component-*.md file paths]
Deployment definitions found:
[List of deployment config files: Dockerfiles, K8s manifests, etc.]
Create comprehensive C4 Container-level documentation following this structure:
- Containers Section (for each container):
- Name: [Container name]
- Description: [Short description of container purpose and deployment]
- Type: [Web Application, API, Database, Message Queue, etc.]
- Technology: [Primary technologies: Node.js, Python, PostgreSQL, etc.]
- Deployment: [Docker, Kubernetes, Cloud Service, etc.]
- Purpose Section (for each container):
- Detailed description of what this container does
- How it's deployed
- Its role in the system
- Components Section (for each container):
- List all components deployed in this container
- Link to component documentation
- Interfaces Section (for each container):
- Document all container APIs and interfaces:
- API/Interface name
- Protocol (REST, GraphQL, gRPC, Events, etc.)
- Description
- Link to OpenAPI/Swagger/API Spec file
- List of endpoints/operations
- API Specifications:
- For each container API, create an OpenAPI 3.1+ specification
- Save as: C4-Documentation/apis/[container-name]-api.yaml
- Include:
- All endpoints with methods (GET, POST, etc.)
- Request/response schemas
- Authentication requirements
- Error responses
- Dependencies Section (for each container):
- Containers used (other containers this depends on)
- External systems (databases, third-party APIs, etc.)
- Communication protocols
- Infrastructure Section (for each container):
- Link to deployment config (Dockerfile, K8s manifest, etc.)
- Scaling strategy
- Resource requirements (CPU, memory, storage)
- Container Diagram:
- Mermaid diagram showing all containers and their relationships
- Show communication protocols
- Show external system dependencies
Save the output as: C4-Documentation/c4-container.md
Expected output: c4-container.md with all containers and API specifications
Context: All component documentation and deployment definitions
Phase 4: Context-Level Documentation
4.1 Analyze System Documentation
- Review container and component documentation
- Search for system documentation:
- README files
- Architecture documentation
- Requirements documents
- Design documents
- Test files (to understand system behavior)
- API documentation
- User documentation
4.2 Create Context Documentation
Use Task tool with subagent_type="c4-architecture::c4-context"
Prompt: |
Create comprehensive C4 Context-level documentation for the system.
Container documentation: C4-Documentation/c4-container.md
Component documentation: C4-Documentation/c4-component.md
System documentation: [List of README, architecture docs, requirements, etc.]
Test files: [List of test files that show system behavior]
Create comprehensive C4 Context-level documentation following this structure:
- System Overview Section:
- Short Description: [One-sentence description of what the system does]
- Long Description: [Detailed description of system purpose, capabilities, problems solved]
- Personas Section:
- For each persona (human users and programmatic "users"):
- Persona name
- Type (Human User / Programmatic User / External System)
- Description (who they are, what they need)
- Goals (what they want to achieve)
- Key features used
- System Features Section:
- For each high-level feature:
- Feature name
- Description (what this feature does)
- Users (which personas use this feature)
- Link to user journey map
- User Journeys Section:
- For each key feature and persona:
- Journey name: [Feature Name] - [Persona Name] Journey
- Step-by-step journey:
- ...
- Include all system touchpoints
- For programmatic users (external systems, APIs):
- Integration journey with step-by-step process
- External Systems and Dependencies Section:
- For each external system:
- System name
- Type (Database, API, Service, Message Queue, etc.)
- Description (what it provides)
- Integration type (API, Events, File Transfer, etc.)
- Purpose (why the system depends on this)
- System Context Diagram:
- Mermaid C4Context diagram showing:
- The system (as a box in the center)
- All personas (users) around it
- All external systems around it
- Relationships and data flows
- Use C4Context notation for proper C4 diagram
- Related Documentation Section:
- Links to container documentation
- Links to component documentation
Save the output as: C4-Documentation/c4-context.md
Ensure the documentation is:
- Understandable by non-technical stakeholders
- Focuses on system purpose, users, and external relationships
- Includes comprehensive user journey maps
- Identifies all external systems and dependencies
Expected output: c4-context.md with complete system context
Context: All container, component, and system documentation
Configuration Options
target_directory: Root directory to analyze (default: current repository root)
exclude_patterns: Patterns to exclude (default: node_modules, .git, build, dist, etc.)
output_directory: Where to write C4 documentation (default: C4-Documentation/)
include_tests: Whether to analyze test files for context (default: true)
api_format: Format for API specs (default: openapi)
Success Criteria
- ✅ Every subdirectory has a corresponding c4-code-*.md file
- ✅ All code-level documentation includes complete function signatures
- ✅ Components are logically grouped with clear boundaries
- ✅ All components have interface documentation
- ✅ Master component index created with relationship diagram
- ✅ Containers map to actual deployment units
- ✅ All container APIs documented with OpenAPI/Swagger specs
- ✅ Container diagram shows deployment architecture
- ✅ System context includes all personas (human and programmatic)
- ✅ User journeys documented for all key features
- ✅ All external systems and dependencies identified
- ✅ Context diagram shows system, users, and external systems
- ✅ Documentation is organized in C4-Documentation/ directory
Output Structure
C4-Documentation/
├── c4-code-*.md # Code-level docs (one per directory)
├── c4-component-*.md # Component-level docs (one per component)
├── c4-component.md # Master component index
├── c4-container.md # Container-level docs
├── c4-context.md # Context-level docs
└── apis/ # API specifications
├── [container]-api.yaml # OpenAPI specs for each container
└── ...
Coordination Notes
- Bottom-up processing: Process directories from deepest to shallowest
- Incremental synthesis: Each level builds on the previous level's documentation
- Complete coverage: Every directory must have code-level documentation before synthesis
- Link consistency: All documentation files link to each other appropriately
- API documentation: Container APIs must have OpenAPI/Swagger specifications
- Stakeholder-friendly: Context documentation should be understandable by non-technical stakeholders
- Mermaid diagrams: Use proper C4 Mermaid notation for all diagrams
Example Usage
/c4-architecture:c4-architecture
This will:
- Walk through all subdirectories bottom-up
- Create c4-code-*.md for each directory
- Synthesize into components
- Map to containers with API docs
- Create system context with personas and journeys
All documentation written to: C4-Documentation/
Limitations
- Use this skill only when the task clearly matches the scope described above.
- Do not treat the output as a substitute for environment-specific validation, testing, or expert review.
- Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.
1---2name: c4-architecture-c4-architecture3description: "Generate comprehensive C4 architecture documentation for an existing repository/codebase using a bottom-up analysis approach."4risk: critical5source: community6date_added: "2026-02-27"7metadata:8 source: https://skillmd.com/skills/iradoweck/c4-architecture-c4-architecture9---1011# C4 Architecture Documentation Workflow1213Generate comprehensive C4 architecture documentation for an existing repository/codebase using a bottom-up analysis approach.1415[Extended thinking: This workflow implements a complete C4 architecture documentation process following the C4 model (Context, Container, Component, Code). It uses a bottom-up approach, starting from the deepest code directories and working upward, ensuring every code element is documented before synthesizing into higher-level abstractions. The workflow coordinates four specialized C4 agents (Code, Component, Container, Context) to create a complete architectural documentation set that serves both technical and non-technical stakeholders.]1617## Use this skill when1819- Working on c4 architecture documentation workflow tasks or workflows20- Needing guidance, best practices, or checklists for c4 architecture documentation workflow2122## Do not use this skill when2324- The task is unrelated to c4 architecture documentation workflow25- You need a different domain or tool outside this scope2627## Instructions2829- Clarify goals, constraints, and required inputs.30- Apply relevant best practices and validate outcomes.31- Provide actionable steps and verification.3233## Overview3435This workflow creates comprehensive C4 architecture documentation following the [official C4 model](https://c4model.com/diagrams) by:36371. **Code Level**: Analyzing every subdirectory bottom-up to create code-level documentation382. **Component Level**: Synthesizing code documentation into logical components within containers393. **Container Level**: Mapping components to deployment containers with API documentation (shows high-level technology choices)404. **Context Level**: Creating high-level system context with personas and user journeys (focuses on people and software systems, not technologies)4142**Note**: According to the [C4 model](https://c4model.com/diagrams), you don't need to use all 4 levels of diagram - the system context and container diagrams are sufficient for most software development teams. This workflow generates all levels for completeness, but teams can choose which levels to use.4344All documentation is written to a new `C4-Documentation/` directory in the repository root.4546## Phase 1: Code-Level Documentation (Bottom-Up Analysis)4748### 1.1 Discover All Subdirectories4950- Use codebase search to identify all subdirectories in the repository51- Sort directories by depth (deepest first) for bottom-up processing52- Filter out common non-code directories (node_modules, .git, build, dist, etc.)53- Create list of directories to process5455### 1.2 Process Each Directory (Bottom-Up)5657For each directory, starting from the deepest:5859- Use Task tool with subagent_type="c4-architecture::c4-code"60- Prompt: |61 Analyze the code in directory: [directory_path]6263 Create comprehensive C4 Code-level documentation following this structure:64 1. **Overview Section**:65 - Name: [Descriptive name for this code directory]66 - Description: [Short description of what this code does]67 - Location: [Link to actual directory path relative to repo root]68 - Language: [Primary programming language(s) used]69 - Purpose: [What this code accomplishes]70 2. **Code Elements Section**:71 - Document all functions/methods with complete signatures:72 - Function name, parameters (with types), return type73 - Description of what each function does74 - Location (file path and line numbers)75 - Dependencies (what this function depends on)76 - Document all classes/modules:77 - Class name, description, location78 - Methods and their signatures79 - Dependencies80 3. **Dependencies Section**:81 - Internal dependencies (other code in this repo)82 - External dependencies (libraries, frameworks, services)83 4. **Relationships Section**:84 - Optional Mermaid diagram if relationships are complex8586 Save the output as: C4-Documentation/c4-code-[directory-name].md87 Use a sanitized directory name (replace / with -, remove special chars) for the filename.8889 Ensure the documentation includes:90 - Complete function signatures with all parameters and types91 - Links to actual source code locations92 - All dependencies (internal and external)93 - Clear, descriptive names and descriptions9495- Expected output: c4-code-<directory-name>.md file in C4-Documentation/96- Context: All files in the directory and its subdirectories9798**Repeat for every subdirectory** until all directories have corresponding c4-code-\*.md files.99100## Phase 2: Component-Level Synthesis101102### 2.1 Analyze All Code-Level Documentation103104- Collect all c4-code-\*.md files created in Phase 1105- Analyze code structure, dependencies, and relationships106- Identify logical component boundaries based on:107 - Domain boundaries (related business functionality)108 - Technical boundaries (shared frameworks, libraries)109 - Organizational boundaries (team ownership, if evident)110111### 2.2 Create Component Documentation112113For each identified component:114115- Use Task tool with subagent_type="c4-architecture::c4-component"116- Prompt: |117 Synthesize the following C4 Code-level documentation files into a logical component:118119 Code files to analyze:120 [List of c4-code-*.md file paths]121122 Create comprehensive C4 Component-level documentation following this structure:123 1. **Overview Section**:124 - Name: [Component name - descriptive and meaningful]125 - Description: [Short description of component purpose]126 - Type: [Application, Service, Library, etc.]127 - Technology: [Primary technologies used]128 2. **Purpose Section**:129 - Detailed description of what this component does130 - What problems it solves131 - Its role in the system132 3. **Software Features Section**:133 - List all software features provided by this component134 - Each feature with a brief description135 4. **Code Elements Section**:136 - List all c4-code-\*.md files contained in this component137 - Link to each file with a brief description138 5. **Interfaces Section**:139 - Document all component interfaces:140 - Interface name141 - Protocol (REST, GraphQL, gRPC, Events, etc.)142 - Description143 - Operations (function signatures, endpoints, etc.)144 6. **Dependencies Section**:145 - Components used (other components this depends on)146 - External systems (databases, APIs, services)147 7. **Component Diagram**:148 - Mermaid diagram showing this component and its relationships149150 Save the output as: C4-Documentation/c4-component-[component-name].md151 Use a sanitized component name for the filename.152153- Expected output: c4-component-<name>.md file for each component154- Context: All relevant c4-code-\*.md files for this component155156### 2.3 Create Master Component Index157158- Use Task tool with subagent_type="c4-architecture::c4-component"159- Prompt: |160 Create a master component index that lists all components in the system.161162 Based on all c4-component-\*.md files created, generate:163 1. **System Components Section**:164 - List all components with:165 - Component name166 - Short description167 - Link to component documentation168 2. **Component Relationships Diagram**:169 - Mermaid diagram showing all components and their relationships170 - Show dependencies between components171 - Show external system dependencies172173 Save the output as: C4-Documentation/c4-component.md174175- Expected output: Master c4-component.md file176- Context: All c4-component-\*.md files177178## Phase 3: Container-Level Synthesis179180### 3.1 Analyze Components and Deployment Definitions181182- Review all c4-component-\*.md files183- Search for deployment/infrastructure definitions:184 - Dockerfiles185 - Kubernetes manifests (deployments, services, etc.)186 - Docker Compose files187 - Terraform/CloudFormation configs188 - Cloud service definitions (AWS Lambda, Azure Functions, etc.)189 - CI/CD pipeline definitions190191### 3.2 Map Components to Containers192193- Use Task tool with subagent_type="c4-architecture::c4-container"194- Prompt: |195 Synthesize components into containers based on deployment definitions.196197 Component documentation:198 [List of all c4-component-*.md file paths]199200 Deployment definitions found:201 [List of deployment config files: Dockerfiles, K8s manifests, etc.]202203 Create comprehensive C4 Container-level documentation following this structure:204 1. **Containers Section** (for each container):205 - Name: [Container name]206 - Description: [Short description of container purpose and deployment]207 - Type: [Web Application, API, Database, Message Queue, etc.]208 - Technology: [Primary technologies: Node.js, Python, PostgreSQL, etc.]209 - Deployment: [Docker, Kubernetes, Cloud Service, etc.]210 2. **Purpose Section** (for each container):211 - Detailed description of what this container does212 - How it's deployed213 - Its role in the system214 3. **Components Section** (for each container):215 - List all components deployed in this container216 - Link to component documentation217 4. **Interfaces Section** (for each container):218 - Document all container APIs and interfaces:219 - API/Interface name220 - Protocol (REST, GraphQL, gRPC, Events, etc.)221 - Description222 - Link to OpenAPI/Swagger/API Spec file223 - List of endpoints/operations224 5. **API Specifications**:225 - For each container API, create an OpenAPI 3.1+ specification226 - Save as: C4-Documentation/apis/[container-name]-api.yaml227 - Include:228 - All endpoints with methods (GET, POST, etc.)229 - Request/response schemas230 - Authentication requirements231 - Error responses232 6. **Dependencies Section** (for each container):233 - Containers used (other containers this depends on)234 - External systems (databases, third-party APIs, etc.)235 - Communication protocols236 7. **Infrastructure Section** (for each container):237 - Link to deployment config (Dockerfile, K8s manifest, etc.)238 - Scaling strategy239 - Resource requirements (CPU, memory, storage)240 8. **Container Diagram**:241 - Mermaid diagram showing all containers and their relationships242 - Show communication protocols243 - Show external system dependencies244245 Save the output as: C4-Documentation/c4-container.md246247- Expected output: c4-container.md with all containers and API specifications248- Context: All component documentation and deployment definitions249250## Phase 4: Context-Level Documentation251252### 4.1 Analyze System Documentation253254- Review container and component documentation255- Search for system documentation:256 - README files257 - Architecture documentation258 - Requirements documents259 - Design documents260 - Test files (to understand system behavior)261 - API documentation262 - User documentation263264### 4.2 Create Context Documentation265266- Use Task tool with subagent_type="c4-architecture::c4-context"267- Prompt: |268 Create comprehensive C4 Context-level documentation for the system.269270 Container documentation: C4-Documentation/c4-container.md271 Component documentation: C4-Documentation/c4-component.md272 System documentation: [List of README, architecture docs, requirements, etc.]273 Test files: [List of test files that show system behavior]274275 Create comprehensive C4 Context-level documentation following this structure:276 1. **System Overview Section**:277 - Short Description: [One-sentence description of what the system does]278 - Long Description: [Detailed description of system purpose, capabilities, problems solved]279 2. **Personas Section**:280 - For each persona (human users and programmatic "users"):281 - Persona name282 - Type (Human User / Programmatic User / External System)283 - Description (who they are, what they need)284 - Goals (what they want to achieve)285 - Key features used286 3. **System Features Section**:287 - For each high-level feature:288 - Feature name289 - Description (what this feature does)290 - Users (which personas use this feature)291 - Link to user journey map292 4. **User Journeys Section**:293 - For each key feature and persona:294 - Journey name: [Feature Name] - [Persona Name] Journey295 - Step-by-step journey:296 1. [Step 1]: [Description]297 2. [Step 2]: [Description]298 ...299 - Include all system touchpoints300 - For programmatic users (external systems, APIs):301 - Integration journey with step-by-step process302 5. **External Systems and Dependencies Section**:303 - For each external system:304 - System name305 - Type (Database, API, Service, Message Queue, etc.)306 - Description (what it provides)307 - Integration type (API, Events, File Transfer, etc.)308 - Purpose (why the system depends on this)309 6. **System Context Diagram**:310 - Mermaid C4Context diagram showing:311 - The system (as a box in the center)312 - All personas (users) around it313 - All external systems around it314 - Relationships and data flows315 - Use C4Context notation for proper C4 diagram316 7. **Related Documentation Section**:317 - Links to container documentation318 - Links to component documentation319320 Save the output as: C4-Documentation/c4-context.md321322 Ensure the documentation is:323 - Understandable by non-technical stakeholders324 - Focuses on system purpose, users, and external relationships325 - Includes comprehensive user journey maps326 - Identifies all external systems and dependencies327328- Expected output: c4-context.md with complete system context329- Context: All container, component, and system documentation330331## Configuration Options332333- `target_directory`: Root directory to analyze (default: current repository root)334- `exclude_patterns`: Patterns to exclude (default: node_modules, .git, build, dist, etc.)335- `output_directory`: Where to write C4 documentation (default: C4-Documentation/)336- `include_tests`: Whether to analyze test files for context (default: true)337- `api_format`: Format for API specs (default: openapi)338339## Success Criteria340341- ✅ Every subdirectory has a corresponding c4-code-\*.md file342- ✅ All code-level documentation includes complete function signatures343- ✅ Components are logically grouped with clear boundaries344- ✅ All components have interface documentation345- ✅ Master component index created with relationship diagram346- ✅ Containers map to actual deployment units347- ✅ All container APIs documented with OpenAPI/Swagger specs348- ✅ Container diagram shows deployment architecture349- ✅ System context includes all personas (human and programmatic)350- ✅ User journeys documented for all key features351- ✅ All external systems and dependencies identified352- ✅ Context diagram shows system, users, and external systems353- ✅ Documentation is organized in C4-Documentation/ directory354355## Output Structure356357```358C4-Documentation/359├── c4-code-*.md # Code-level docs (one per directory)360├── c4-component-*.md # Component-level docs (one per component)361├── c4-component.md # Master component index362├── c4-container.md # Container-level docs363├── c4-context.md # Context-level docs364└── apis/ # API specifications365 ├── [container]-api.yaml # OpenAPI specs for each container366 └── ...367```368369## Coordination Notes370371- **Bottom-up processing**: Process directories from deepest to shallowest372- **Incremental synthesis**: Each level builds on the previous level's documentation373- **Complete coverage**: Every directory must have code-level documentation before synthesis374- **Link consistency**: All documentation files link to each other appropriately375- **API documentation**: Container APIs must have OpenAPI/Swagger specifications376- **Stakeholder-friendly**: Context documentation should be understandable by non-technical stakeholders377- **Mermaid diagrams**: Use proper C4 Mermaid notation for all diagrams378379## Example Usage380381```bash382/c4-architecture:c4-architecture383```384385This will:3863871. Walk through all subdirectories bottom-up3882. Create c4-code-\*.md for each directory3893. Synthesize into components3904. Map to containers with API docs3915. Create system context with personas and journeys392393All documentation written to: C4-Documentation/394395## Limitations396- Use this skill only when the task clearly matches the scope described above.397- Do not treat the output as a substitute for environment-specific validation, testing, or expert review.398- Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.