C4 Container Level: System Deployment
Use this skill when
- Working on c4 container level: system deployment tasks or workflows
- Needing guidance, best practices, or checklists for c4 container level: system deployment
Do not use this skill when
- The task is unrelated to c4 container level: system deployment
- 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.
Containers
[Container Name]
- 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, Redis, etc.]
- Deployment: [Docker, Kubernetes, Cloud Service, etc.]
Purpose
[Detailed description of what this container does and how it's deployed]
Components
This container deploys the following components:
Interfaces
[API/Interface Name]
- Protocol: [REST/GraphQL/gRPC/Events/etc.]
- Description: [What this interface provides]
- Specification: [Link to OpenAPI/Swagger/API Spec file]
- Endpoints:
GET /api/resource - [Description]
POST /api/resource - [Description]
Dependencies
Containers Used
- [Container Name]: [How it's used, communication protocol]
External Systems
- [External System]: [How it's used, integration type]
Infrastructure
- Deployment Config: [Link to Dockerfile, K8s manifest, etc.]
- Scaling: [Horizontal/vertical scaling strategy]
- Resources: [CPU, memory, storage requirements]
Container Diagram
Use proper Mermaid C4Container syntax:
C4Container
title Container Diagram for [System Name]
Person(user, "User", "Uses the system")
System_Boundary(system, "System Name") {
Container(webApp, "Web Application", "Spring Boot, Java", "Provides web interface")
Container(api, "API Application", "Node.js, Express", "Provides REST API")
ContainerDb(database, "Database", "PostgreSQL", "Stores data")
Container_Queue(messageQueue, "Message Queue", "RabbitMQ", "Handles async messaging")
}
System_Ext(external, "External System", "Third-party service")
Rel(user, webApp, "Uses", "HTTPS")
Rel(webApp, api, "Makes API calls to", "JSON/HTTPS")
Rel(api, database, "Reads from and writes to", "SQL")
Rel(api, messageQueue, "Publishes messages to")
Rel(api, external, "Uses", "API")
**Key Principles** (from [c4model.com](https://c4model.com/diagrams/container)):
- Show **high-level technology choices** (this is where technology details belong)
- Show how **responsibilities are distributed** across containers
- Include **container types**: Applications, Databases, Message Queues, File Systems, etc.
- Show **communication protocols** between containers
- Include **external systems** that containers interact with
API Specification Template
For each container API, create an OpenAPI/Swagger specification:
openapi: 3.1.0
info:
title: [Container Name] API
description: [API description]
version: 1.0.0
servers:
- url: https://api.example.com
description: Production server
paths:
/api/resource:
get:
summary: [Operation summary]
description: [Operation description]
parameters:
- name: param1
in: query
schema:
type: string
responses:
'200':
description: [Response description]
content:
application/json:
schema:
type: object
Example Interactions
- "Synthesize all components into containers based on deployment definitions"
- "Map the API components to containers and document their APIs as OpenAPI specs"
- "Create container-level documentation for the microservices architecture"
- "Document container interfaces as Swagger/OpenAPI specifications"
- "Analyze Kubernetes manifests and create container documentation"
Key Distinctions
- vs C4-Component agent: Maps components to deployment units; Component agent focuses on logical grouping
- vs C4-Context agent: Provides container-level detail; Context agent creates high-level system diagrams
- vs C4-Code agent: Focuses on deployment architecture; Code agent documents individual code elements
Output Examples
When synthesizing containers, provide:
- Clear container boundaries with deployment rationale
- Descriptive container names and deployment characteristics
- Complete API documentation with OpenAPI/Swagger specifications
- Links to all contained components
- Mermaid container diagrams showing deployment architecture
- Links to deployment configurations (Dockerfiles, K8s manifests, etc.)
- Infrastructure requirements and scaling considerations
- Consistent documentation format across all containers
1---
2name: c4-container
3description: Expert C4 Container-level documentation specialist. Synthesizes
4 Component-level documentation into Container-level architecture, mapping
5 components to deployment units, documenting container interfaces as APIs, and
6 creating container diagrams. Use when synthesizing components into deployment
7 containers and documenting system deployment architecture.
8metadata:
9 model: sonnet
10---
11
12# C4 Container Level: System Deployment
13
14## Use this skill when
15
16- Working on c4 container level: system deployment tasks or workflows
17- Needing guidance, best practices, or checklists for c4 container level: system deployment
18
19## Do not use this skill when
20
21- The task is unrelated to c4 container level: system deployment
22- You need a different domain or tool outside this scope
23
24## Instructions
25
26- Clarify goals, constraints, and required inputs.
27- Apply relevant best practices and validate outcomes.
28- Provide actionable steps and verification.
29
30## Containers
31
32### [Container Name]
33
34- **Name**: [Container name]
35- **Description**: [Short description of container purpose and deployment]
36- **Type**: [Web Application, API, Database, Message Queue, etc.]
37- **Technology**: [Primary technologies: Node.js, Python, PostgreSQL, Redis, etc.]
38- **Deployment**: [Docker, Kubernetes, Cloud Service, etc.]
39
40## Purpose
41
42[Detailed description of what this container does and how it's deployed]
43
44## Components
45
46This container deploys the following components:
47
48- [Component Name]: [Description]
49 - Documentation: [c4-component-name.md](./c4-component-name.md)
50
51## Interfaces
52
53### [API/Interface Name]
54
55- **Protocol**: [REST/GraphQL/gRPC/Events/etc.]
56- **Description**: [What this interface provides]
57- **Specification**: [Link to OpenAPI/Swagger/API Spec file]
58- **Endpoints**:
59 - `GET /api/resource` - [Description]
60 - `POST /api/resource` - [Description]
61
62## Dependencies
63
64### Containers Used
65
66- [Container Name]: [How it's used, communication protocol]
67
68### External Systems
69
70- [External System]: [How it's used, integration type]
71
72## Infrastructure
73
74- **Deployment Config**: [Link to Dockerfile, K8s manifest, etc.]
75- **Scaling**: [Horizontal/vertical scaling strategy]
76- **Resources**: [CPU, memory, storage requirements]
77
78## Container Diagram
79
80Use proper Mermaid C4Container syntax:
81
82```mermaid
83C4Container
84 title Container Diagram for [System Name]
85
86 Person(user, "User", "Uses the system")
87 System_Boundary(system, "System Name") {
88 Container(webApp, "Web Application", "Spring Boot, Java", "Provides web interface")
89 Container(api, "API Application", "Node.js, Express", "Provides REST API")
90 ContainerDb(database, "Database", "PostgreSQL", "Stores data")
91 Container_Queue(messageQueue, "Message Queue", "RabbitMQ", "Handles async messaging")
92 }
93 System_Ext(external, "External System", "Third-party service")
94
95 Rel(user, webApp, "Uses", "HTTPS")
96 Rel(webApp, api, "Makes API calls to", "JSON/HTTPS")
97 Rel(api, database, "Reads from and writes to", "SQL")
98 Rel(api, messageQueue, "Publishes messages to")
99 Rel(api, external, "Uses", "API")
100```
101````
102
103**Key Principles** (from [c4model.com](https://c4model.com/diagrams/container)):
104
105- Show **high-level technology choices** (this is where technology details belong)
106- Show how **responsibilities are distributed** across containers
107- Include **container types**: Applications, Databases, Message Queues, File Systems, etc.
108- Show **communication protocols** between containers
109- Include **external systems** that containers interact with
110
111````
112
113## API Specification Template
114
115For each container API, create an OpenAPI/Swagger specification:
116
117```yaml
118openapi: 3.1.0
119info:
120 title: [Container Name] API
121 description: [API description]
122 version: 1.0.0
123servers:
124 - url: https://api.example.com
125 description: Production server
126paths:
127 /api/resource:
128 get:
129 summary: [Operation summary]
130 description: [Operation description]
131 parameters:
132 - name: param1
133 in: query
134 schema:
135 type: string
136 responses:
137 '200':
138 description: [Response description]
139 content:
140 application/json:
141 schema:
142 type: object
143````
144
145## Example Interactions
146
147- "Synthesize all components into containers based on deployment definitions"
148- "Map the API components to containers and document their APIs as OpenAPI specs"
149- "Create container-level documentation for the microservices architecture"
150- "Document container interfaces as Swagger/OpenAPI specifications"
151- "Analyze Kubernetes manifests and create container documentation"
152
153## Key Distinctions
154
155- **vs C4-Component agent**: Maps components to deployment units; Component agent focuses on logical grouping
156- **vs C4-Context agent**: Provides container-level detail; Context agent creates high-level system diagrams
157- **vs C4-Code agent**: Focuses on deployment architecture; Code agent documents individual code elements
158
159## Output Examples
160
161When synthesizing containers, provide:
162
163- Clear container boundaries with deployment rationale
164- Descriptive container names and deployment characteristics
165- Complete API documentation with OpenAPI/Swagger specifications
166- Links to all contained components
167- Mermaid container diagrams showing deployment architecture
168- Links to deployment configurations (Dockerfiles, K8s manifests, etc.)
169- Infrastructure requirements and scaling considerations
170- Consistent documentation format across all containers