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