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.
- If detailed examples are required, open
resources/implementation-playbook.md.
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."4version: 1.0.05author:6 name: "sickn33 / Antigravity Community"7 github: sickn338tags: [architecture, architecture]9category: architecture10platforms: [macos, linux, windows]11license: MIT12metadata:13 hermes:14 source: https://skillmd.com/skills/nous-hermeshub/c4-architecture-c4-architecture15 upstream: "antigravity-awesome-skills"16 risk: "unknown"17 date_added: "2026-02-27"18 original_author: "Antigravity Community"19---2021# C4 Architecture Documentation Workflow2223Generate comprehensive C4 architecture documentation for an existing repository/codebase using a bottom-up analysis approach.2425[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.]2627## Use this skill when2829- Working on c4 architecture documentation workflow tasks or workflows30- Needing guidance, best practices, or checklists for c4 architecture documentation workflow3132## Do not use this skill when3334- The task is unrelated to c4 architecture documentation workflow35- You need a different domain or tool outside this scope3637## Instructions3839- Clarify goals, constraints, and required inputs.40- Apply relevant best practices and validate outcomes.41- Provide actionable steps and verification.42- If detailed examples are required, open `resources/implementation-playbook.md`.4344## Overview4546This workflow creates comprehensive C4 architecture documentation following the [official C4 model](https://c4model.com/diagrams) by:47481. **Code Level**: Analyzing every subdirectory bottom-up to create code-level documentation492. **Component Level**: Synthesizing code documentation into logical components within containers503. **Container Level**: Mapping components to deployment containers with API documentation (shows high-level technology choices)514. **Context Level**: Creating high-level system context with personas and user journeys (focuses on people and software systems, not technologies)5253**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.5455All documentation is written to a new `C4-Documentation/` directory in the repository root.5657## Phase 1: Code-Level Documentation (Bottom-Up Analysis)5859### 1.1 Discover All Subdirectories6061- Use codebase search to identify all subdirectories in the repository62- Sort directories by depth (deepest first) for bottom-up processing63- Filter out common non-code directories (node_modules, .git, build, dist, etc.)64- Create list of directories to process6566### 1.2 Process Each Directory (Bottom-Up)6768For each directory, starting from the deepest:6970- Use Task tool with subagent_type="c4-architecture::c4-code"71- Prompt: |72 Analyze the code in directory: [directory_path]7374 Create comprehensive C4 Code-level documentation following this structure:75 1. **Overview Section**:76 - Name: [Descriptive name for this code directory]77 - Description: [Short description of what this code does]78 - Location: [Link to actual directory path relative to repo root]79 - Language: [Primary programming language(s) used]80 - Purpose: [What this code accomplishes]81 2. **Code Elements Section**:82 - Document all functions/methods with complete signatures:83 - Function name, parameters (with types), return type84 - Description of what each function does85 - Location (file path and line numbers)86 - Dependencies (what this function depends on)87 - Document all classes/modules:88 - Class name, description, location89 - Methods and their signatures90 - Dependencies91 3. **Dependencies Section**:92 - Internal dependencies (other code in this repo)93 - External dependencies (libraries, frameworks, services)94 4. **Relationships Section**:95 - Optional Mermaid diagram if relationships are complex9697 Save the output as: C4-Documentation/c4-code-[directory-name].md98 Use a sanitized directory name (replace / with -, remove special chars) for the filename.99100 Ensure the documentation includes:101 - Complete function signatures with all parameters and types102 - Links to actual source code locations103 - All dependencies (internal and external)104 - Clear, descriptive names and descriptions105106- Expected output: c4-code-<directory-name>.md file in C4-Documentation/107- Context: All files in the directory and its subdirectories108109**Repeat for every subdirectory** until all directories have corresponding c4-code-\*.md files.110111## Phase 2: Component-Level Synthesis112113### 2.1 Analyze All Code-Level Documentation114115- Collect all c4-code-\*.md files created in Phase 1116- Analyze code structure, dependencies, and relationships117- Identify logical component boundaries based on:118 - Domain boundaries (related business functionality)119 - Technical boundaries (shared frameworks, libraries)120 - Organizational boundaries (team ownership, if evident)121122### 2.2 Create Component Documentation123124For each identified component:125126- Use Task tool with subagent_type="c4-architecture::c4-component"127- Prompt: |128 Synthesize the following C4 Code-level documentation files into a logical component:129130 Code files to analyze:131 [List of c4-code-*.md file paths]132133 Create comprehensive C4 Component-level documentation following this structure:134 1. **Overview Section**:135 - Name: [Component name - descriptive and meaningful]136 - Description: [Short description of component purpose]137 - Type: [Application, Service, Library, etc.]138 - Technology: [Primary technologies used]139 2. **Purpose Section**:140 - Detailed description of what this component does141 - What problems it solves142 - Its role in the system143 3. **Software Features Section**:144 - List all software features provided by this component145 - Each feature with a brief description146 4. **Code Elements Section**:147 - List all c4-code-\*.md files contained in this component148 - Link to each file with a brief description149 5. **Interfaces Section**:150 - Document all component interfaces:151 - Interface name152 - Protocol (REST, GraphQL, gRPC, Events, etc.)153 - Description154 - Operations (function signatures, endpoints, etc.)155 6. **Dependencies Section**:156 - Components used (other components this depends on)157 - External systems (databases, APIs, services)158 7. **Component Diagram**:159 - Mermaid diagram showing this component and its relationships160161 Save the output as: C4-Documentation/c4-component-[component-name].md162 Use a sanitized component name for the filename.163164- Expected output: c4-component-<name>.md file for each component165- Context: All relevant c4-code-\*.md files for this component166167### 2.3 Create Master Component Index168169- Use Task tool with subagent_type="c4-architecture::c4-component"170- Prompt: |171 Create a master component index that lists all components in the system.172173 Based on all c4-component-\*.md files created, generate:174 1. **System Components Section**:175 - List all components with:176 - Component name177 - Short description178 - Link to component documentation179 2. **Component Relationships Diagram**:180 - Mermaid diagram showing all components and their relationships181 - Show dependencies between components182 - Show external system dependencies183184 Save the output as: C4-Documentation/c4-component.md185186- Expected output: Master c4-component.md file187- Context: All c4-component-\*.md files188189## Phase 3: Container-Level Synthesis190191### 3.1 Analyze Components and Deployment Definitions192193- Review all c4-component-\*.md files194- Search for deployment/infrastructure definitions:195 - Dockerfiles196 - Kubernetes manifests (deployments, services, etc.)197 - Docker Compose files198 - Terraform/CloudFormation configs199 - Cloud service definitions (AWS Lambda, Azure Functions, etc.)200 - CI/CD pipeline definitions201202### 3.2 Map Components to Containers203204- Use Task tool with subagent_type="c4-architecture::c4-container"205- Prompt: |206 Synthesize components into containers based on deployment definitions.207208 Component documentation:209 [List of all c4-component-*.md file paths]210211 Deployment definitions found:212 [List of deployment config files: Dockerfiles, K8s manifests, etc.]213214 Create comprehensive C4 Container-level documentation following this structure:215 1. **Containers Section** (for each container):216 - Name: [Container name]217 - Description: [Short description of container purpose and deployment]218 - Type: [Web Application, API, Database, Message Queue, etc.]219 - Technology: [Primary technologies: Node.js, Python, PostgreSQL, etc.]220 - Deployment: [Docker, Kubernetes, Cloud Service, etc.]221 2. **Purpose Section** (for each container):222 - Detailed description of what this container does223 - How it's deployed224 - Its role in the system225 3. **Components Section** (for each container):226 - List all components deployed in this container227 - Link to component documentation228 4. **Interfaces Section** (for each container):229 - Document all container APIs and interfaces:230 - API/Interface name231 - Protocol (REST, GraphQL, gRPC, Events, etc.)232 - Description233 - Link to OpenAPI/Swagger/API Spec file234 - List of endpoints/operations235 5. **API Specifications**:236 - For each container API, create an OpenAPI 3.1+ specification237 - Save as: C4-Documentation/apis/[container-name]-api.yaml238 - Include:239 - All endpoints with methods (GET, POST, etc.)240 - Request/response schemas241 - Authentication requirements242 - Error responses243 6. **Dependencies Section** (for each container):244 - Containers used (other containers this depends on)245 - External systems (databases, third-party APIs, etc.)246 - Communication protocols247 7. **Infrastructure Section** (for each container):248 - Link to deployment config (Dockerfile, K8s manifest, etc.)249 - Scaling strategy250 - Resource requirements (CPU, memory, storage)251 8. **Container Diagram**:252 - Mermaid diagram showing all containers and their relationships253 - Show communication protocols254 - Show external system dependencies255256 Save the output as: C4-Documentation/c4-container.md257258- Expected output: c4-container.md with all containers and API specifications259- Context: All component documentation and deployment definitions260261## Phase 4: Context-Level Documentation262263### 4.1 Analyze System Documentation264265- Review container and component documentation266- Search for system documentation:267 - README files268 - Architecture documentation269 - Requirements documents270 - Design documents271 - Test files (to understand system behavior)272 - API documentation273 - User documentation274275### 4.2 Create Context Documentation276277- Use Task tool with subagent_type="c4-architecture::c4-context"278- Prompt: |279 Create comprehensive C4 Context-level documentation for the system.280281 Container documentation: C4-Documentation/c4-container.md282 Component documentation: C4-Documentation/c4-component.md283 System documentation: [List of README, architecture docs, requirements, etc.]284 Test files: [List of test files that show system behavior]285286 Create comprehensive C4 Context-level documentation following this structure:287 1. **System Overview Section**:288 - Short Description: [One-sentence description of what the system does]289 - Long Description: [Detailed description of system purpose, capabilities, problems solved]290 2. **Personas Section**:291 - For each persona (human users and programmatic "users"):292 - Persona name293 - Type (Human User / Programmatic User / External System)294 - Description (who they are, what they need)295 - Goals (what they want to achieve)296 - Key features used297 3. **System Features Section**:298 - For each high-level feature:299 - Feature name300 - Description (what this feature does)301 - Users (which personas use this feature)302 - Link to user journey map303 4. **User Journeys Section**:304 - For each key feature and persona:305 - Journey name: [Feature Name] - [Persona Name] Journey306 - Step-by-step journey:307 1. [Step 1]: [Description]308 2. [Step 2]: [Description]309 ...310 - Include all system touchpoints311 - For programmatic users (external systems, APIs):312 - Integration journey with step-by-step process313 5. **External Systems and Dependencies Section**:314 - For each external system:315 - System name316 - Type (Database, API, Service, Message Queue, etc.)317 - Description (what it provides)318 - Integration type (API, Events, File Transfer, etc.)319 - Purpose (why the system depends on this)320 6. **System Context Diagram**:321 - Mermaid C4Context diagram showing:322 - The system (as a box in the center)323 - All personas (users) around it324 - All external systems around it325 - Relationships and data flows326 - Use C4Context notation for proper C4 diagram327 7. **Related Documentation Section**:328 - Links to container documentation329 - Links to component documentation330331 Save the output as: C4-Documentation/c4-context.md332333 Ensure the documentation is:334 - Understandable by non-technical stakeholders335 - Focuses on system purpose, users, and external relationships336 - Includes comprehensive user journey maps337 - Identifies all external systems and dependencies338339- Expected output: c4-context.md with complete system context340- Context: All container, component, and system documentation341342## Configuration Options343344- `target_directory`: Root directory to analyze (default: current repository root)345- `exclude_patterns`: Patterns to exclude (default: node_modules, .git, build, dist, etc.)346- `output_directory`: Where to write C4 documentation (default: C4-Documentation/)347- `include_tests`: Whether to analyze test files for context (default: true)348- `api_format`: Format for API specs (default: openapi)349350## Success Criteria351352- ✅ Every subdirectory has a corresponding c4-code-\*.md file353- ✅ All code-level documentation includes complete function signatures354- ✅ Components are logically grouped with clear boundaries355- ✅ All components have interface documentation356- ✅ Master component index created with relationship diagram357- ✅ Containers map to actual deployment units358- ✅ All container APIs documented with OpenAPI/Swagger specs359- ✅ Container diagram shows deployment architecture360- ✅ System context includes all personas (human and programmatic)361- ✅ User journeys documented for all key features362- ✅ All external systems and dependencies identified363- ✅ Context diagram shows system, users, and external systems364- ✅ Documentation is organized in C4-Documentation/ directory365366## Output Structure367368```369C4-Documentation/370├── c4-code-*.md # Code-level docs (one per directory)371├── c4-component-*.md # Component-level docs (one per component)372├── c4-component.md # Master component index373├── c4-container.md # Container-level docs374├── c4-context.md # Context-level docs375└── apis/ # API specifications376 ├── [container]-api.yaml # OpenAPI specs for each container377 └── ...378```379380## Coordination Notes381382- **Bottom-up processing**: Process directories from deepest to shallowest383- **Incremental synthesis**: Each level builds on the previous level's documentation384- **Complete coverage**: Every directory must have code-level documentation before synthesis385- **Link consistency**: All documentation files link to each other appropriately386- **API documentation**: Container APIs must have OpenAPI/Swagger specifications387- **Stakeholder-friendly**: Context documentation should be understandable by non-technical stakeholders388- **Mermaid diagrams**: Use proper C4 Mermaid notation for all diagrams389390## Example Usage391392```bash393/c4-architecture:c4-architecture394```395396This will:3973981. Walk through all subdirectories bottom-up3992. Create c4-code-\*.md for each directory4003. Synthesize into components4014. Map to containers with API docs4025. Create system context with personas and journeys403404All documentation written to: C4-Documentation/405406## Limitations407- Use this skill only when the task clearly matches the scope described above.408- Do not treat the output as a substitute for environment-specific validation, testing, or expert review.409- Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.