C4 Architecture Diagrams
Visualization skill, available on Zeplik
C4 Architecture Diagrams is a ready-to-run diagrams and visualization skill on Zeplik. Not for general diagrams (use diagram or mermaid-diagrams). Ask in plain language and Zeplik applies the skill's method for you inside the conversation, on whichever AI model you prefer. It returns a structured diagram you can keep and reuse: C4-model Mermaid diagram(s) -- declared C4 level, labeled elements and relationships, one abstraction per diagram (see artifact-templates/diagram.md).
The C4 Architecture Diagrams skill loads automatically when your request matches it, or you can invoke it directly by typing /c4-architecture in any chat. It works with attachments, connectors, and any model that supports the task, so you get the same expert method every time without setting anything up.
What the C4 Architecture Diagrams skill can do
- Generate C4 context diagrams showing systems and external actors
- Create container diagrams mapping apps, databases, and services
- Produce component and deployment diagrams when they add real value
- Deliver Mermaid diagrams as markdown artifacts with explanatory context
Try these prompts on Zeplik
Pick a prompt to open it in the Zeplik app. If you are not signed in yet, your prompt is waiting for you the moment you do.
How the C4 Architecture Diagrams skill works
/c4-architecture
Generate software architecture documentation using C4 model diagrams in Mermaid syntax. The user can paste code, describe their system, or upload architecture notes; deliver Mermaid C4 diagrams (with explanatory context) as chat artifacts ready to drop into markdown docs. For freeform diagrams that are not C4, use diagram or mermaid-diagrams instead.
Workflow
- Understand scope - Determine which C4 level(s) are needed based on audience
- Analyze the system - From the pasted code or description, identify components, containers, and relationships; ask for missing pieces
- Generate diagrams - Create Mermaid C4 diagrams at appropriate abstraction levels
- Document - Deliver diagrams as markdown artifacts with explanatory context
C4 Diagram Levels
Select the appropriate level based on the documentation need:
| Level | Diagram Type | Audience | Shows | When to Create |
|---|---|---|---|---|
| 1 | C4Context | Everyone | System + external actors | Always (required) |
| 2 | C4Container | Technical | Apps, databases, services | Always (required) |
| 3 | C4Component | Developers | Internal components | Only if adds value |
| 4 | C4Deployment | DevOps | Infrastructure nodes | For production systems |
| - | C4Dynamic | Technical | Request flows (numbered) | For complex workflows |
Key Insight: "Context + Container diagrams are sufficient for most software development teams." Only create Component/Code diagrams when they genuinely add value.
Quick Start Examples
System Context (Level 1)
C4Context
title System Context - Workout Tracker
Person(user, "User", "Tracks workouts and exercises")
System(app, "Workout Tracker", "Vue PWA for tracking strength and CrossFit workouts")
System_Ext(browser, "Web Browser", "Stores data in IndexedDB")
Rel(user, app, "Uses")
Rel(app, browser, "Persists data to", "IndexedDB")
Container Diagram (Level 2)
C4Container
title Container Diagram - Workout Tracker
Person(user, "User", "Tracks workouts")
Container_Boundary(app, "Workout Tracker PWA") {
Container(spa, "SPA", "Vue 3, TypeScript", "Single-page application")
Container(pinia, "State Management", "Pinia", "Manages application state")
ContainerDb(indexeddb, "IndexedDB", "Dexie", "Local workout storage")
}
Rel(user, spa, "Uses")
Rel(spa, pinia, "Reads/writes state")
Rel(pinia, indexeddb, "Persists", "Dexie ORM")
Component Diagram (Level 3)
C4Component
title Component Diagram - Workout Feature
Container(views, "Views", "Vue Router pages")
Container_Boundary(workout, "Workout Feature") {
Component(useWorkout, "useWorkout", "Composable", "Workout execution state")
Component(useTimer, "useTimer", "Composable", "Timer state machine")
Component(workoutRepo, "WorkoutRepository", "Dexie", "Workout persistence")
}
Rel(views, useWorkout, "Uses")
Rel(useWorkout, useTimer, "Controls")
Rel(useWorkout, workoutRepo, "Saves to")
Dynamic Diagram (Request Flow)
C4Dynamic
title Dynamic Diagram - User Sign In Flow
ContainerDb(db, "Database", "PostgreSQL", "User credentials")
Container(spa, "Single-Page App", "React", "Banking UI")
Container_Boundary(api, "API Application") {
Component(signIn, "Sign In Controller", "Express", "Auth endpoint")
Component(security, "Security Service", "JWT", "Validates credentials")
}
Rel(spa, signIn, "1. Submit credentials", "JSON/HTTPS")
Rel(signIn, security, "2. Validate")
Rel(security, db, "3. Query user", "SQL")
UpdateRelStyle(spa, signIn, $textColor="blue", $offsetY="-30")
Deployment Diagram
C4Deployment
title Deployment Diagram - Production
Deployment_Node(browser, "Customer Browser", "Chrome/Firefox") {
Container(spa, "SPA", "React", "Web application")
}
Deployment_Node(aws, "AWS Cloud", "us-east-1") {
Deployment_Node(ecs, "ECS Cluster", "Fargate") {
Container(api, "API Service", "Node.js", "REST API")
}
Deployment_Node(rds, "RDS", "db.r5.large") {
ContainerDb(db, "Database", "PostgreSQL", "Application data")
}
}
Rel(spa, api, "API calls", "HTTPS")
Rel(api, db, "Reads/writes", "JDBC")
Element Syntax
People and Systems
Person(alias, "Label", "Description")
Person_Ext(alias, "Label", "Description") # External person
System(alias, "Label", "Description")
System_Ext(alias, "Label", "Description") # External system
SystemDb(alias, "Label", "Description") # Database system
SystemQueue(alias, "Label", "Description") # Queue system
Containers
Container(alias, "Label", "Technology", "Description")
Container_Ext(alias, "Label", "Technology", "Description")
ContainerDb(alias, "Label", "Technology", "Description")
ContainerQueue(alias, "Label", "Technology", "Description")
Components
Component(alias, "Label", "Technology", "Description")
Component_Ext(alias, "Label", "Technology", "Description")
ComponentDb(alias, "Label", "Technology", "Description")
Boundaries
Enterprise_Boundary(alias, "Label") { ... }
System_Boundary(alias, "Label") { ... }
Container_Boundary(alias, "Label") { ... }
Boundary(alias, "Label", "type") { ... }
Relationships
Rel(from, to, "Label")
Rel(from, to, "Label", "Technology")
BiRel(from, to, "Label") # Bidirectional
Rel_U(from, to, "Label") # Upward
Rel_D(from, to, "Label") # Downward
Rel_L(from, to, "Label") # Leftward
Rel_R(from, to, "Label") # Rightward
Deployment Nodes
Deployment_Node(alias, "Label", "Type", "Description") { ... }
Node(alias, "Label", "Type", "Description") { ... } # Shorthand
Styling and Layout
Layout Configuration
UpdateLayoutConfig($c4ShapeInRow="3", $c4BoundaryInRow="1")
$c4ShapeInRow- Number of shapes per row (default: 4)$c4BoundaryInRow- Number of boundaries per row (default: 2)
Element Styling
UpdateElementStyle(alias, $fontColor="red", $bgColor="grey", $borderColor="red")
Relationship Styling
UpdateRelStyle(from, to, $textColor="blue", $lineColor="blue", $offsetX="5", $offsetY="-10")
Use $offsetX and $offsetY to fix overlapping relationship labels.
Best Practices
Essential Rules
- Every element must have: Name, Type, Technology (where applicable), and Description
- Use unidirectional arrows only - Bidirectional arrows create ambiguity
- Label arrows with action verbs - "Sends email using", "Reads from", not just "uses"
- Include technology labels - "JSON/HTTPS", "JDBC", "gRPC"
- Stay under 20 elements per diagram - Split complex systems into multiple diagrams
Clarity Guidelines
- Start at Level 1 - Context diagrams help frame the system scope
- One diagram per artifact - Keep diagrams focused on a single abstraction level
- Meaningful aliases - Use descriptive aliases (e.g.,
orderServicenots1) - Concise descriptions - Keep descriptions under 50 characters when possible
- Always include a title - "System Context diagram for [System Name]"
What to Avoid
See references/common-mistakes.md for detailed anti-patterns:
- Confusing containers (deployable) vs components (non-deployable)
- Modeling shared libraries as containers
- Showing message brokers as single containers instead of individual topics
- Adding undefined abstraction levels like "subcomponents"
- Removing type labels to "simplify" diagrams
Microservices Guidelines
Single Team Ownership
Model each microservice as a container (or container group):
C4Container
title Microservices - Single Team
System_Boundary(platform, "E-commerce Platform") {
Container(orderApi, "Order Service", "Spring Boot", "Order processing")
ContainerDb(orderDb, "Order DB", "PostgreSQL", "Order data")
Container(inventoryApi, "Inventory Service", "Node.js", "Stock management")
ContainerDb(inventoryDb, "Inventory DB", "MongoDB", "Stock data")
}
Multi-Team Ownership
Promote microservices to software systems when owned by separate teams:
C4Context
title Microservices - Multi-Team
Person(customer, "Customer", "Places orders")
System(orderSystem, "Order System", "Team Alpha")
System(inventorySystem, "Inventory System", "Team Beta")
System(paymentSystem, "Payment System", "Team Gamma")
Rel(customer, orderSystem, "Places orders")
Rel(orderSystem, inventorySystem, "Checks stock")
Rel(orderSystem, paymentSystem, "Processes payment")
Event-Driven Architecture
Show individual topics/queues as containers, NOT a single "Kafka" box:
C4Container
title Event-Driven Architecture
Container(orderService, "Order Service", "Java", "Creates orders")
Container(stockService, "Stock Service", "Java", "Manages inventory")
ContainerQueue(orderTopic, "order.created", "Kafka", "Order events")
ContainerQueue(stockTopic, "stock.reserved", "Kafka", "Stock events")
Rel(orderService, orderTopic, "Publishes to")
Rel(stockService, orderTopic, "Subscribes to")
Rel(stockService, stockTopic, "Publishes to")
Rel(orderService, stockTopic, "Subscribes to")
Suggested Output Naming
When the user keeps architecture docs in a repo, suggest docs/architecture/ with this naming convention:
c4-context.md- System context diagramc4-containers.md- Container diagramc4-components-{feature}.md- Component diagrams per featurec4-deployment.md- Deployment diagramc4-dynamic-{flow}.md- Dynamic diagrams for specific flows
Audience-Appropriate Detail
| Audience | Recommended Diagrams |
|---|---|
| Executives | System Context only |
| Product Managers | Context + Container |
| Architects | Context + Container + key Components |
| Developers | All levels as needed |
| DevOps | Container + Deployment |
References
references/c4-syntax.md- Complete Mermaid C4 syntaxreferences/common-mistakes.md- Anti-patterns to avoidreferences/advanced-patterns.md- Microservices, event-driven, deployment
Usage
/c4-architecture $ARGUMENTS
How to use the C4 Architecture Diagrams skill
Sign in to Zeplik
Create a free Zeplik account or sign in. New accounts start with free credits, so you can try the C4 Architecture Diagrams skill right away.
Describe your diagrams and visualization task
Ask in plain language, or type /c4-architecture to invoke the skill directly. Zeplik recognizes the C4 Architecture Diagrams skill and applies its method.
Review and refine the result
Zeplik returns a structured diagram you can edit, download, and reuse. Ask follow-ups to refine it.
Source and credit
- Author
- davila7
- License
- MIT
Adapted from the open-source davila7/claude-code-templates project and tuned to run natively on Zeplik. View source on GitHub.
Frequently asked questions
- What is the C4 Architecture Diagrams skill?
- C4 Architecture Diagrams is a ready-to-run diagrams and visualization skill on Zeplik. Not for general diagrams (use diagram or mermaid-diagrams). Ask in plain language and Zeplik applies the skill's method for you inside the conversation, on whichever AI model you prefer. It returns a structured diagram you can keep and reuse: C4-model Mermaid diagram(s) -- declared C4 level, labeled elements and relationships, one abstraction per diagram (see artifact-templates/diagram.md).
- How do I use C4 Architecture Diagrams on Zeplik?
- Sign in to Zeplik and ask in plain language, or type /c4-architecture in any chat to invoke it directly. The skill applies its method and returns a result you can refine in the same conversation.
- Which AI model does the C4 Architecture Diagrams skill use?
- Any model you choose. Zeplik works across every model in one chat, so the C4 Architecture Diagrams skill runs on your preferred model for the task.
- Where does the C4 Architecture Diagrams skill come from?
- The C4 Architecture Diagrams skill is adapted from the open-source davila7/claude-code-templates project (MIT) and tuned to run natively on Zeplik. The original source is linked on this page.
- How much does the C4 Architecture Diagrams skill cost?
- Using the skill is free to start. You only spend Zeplik credits when the assistant runs, and new accounts begin with free credits.
Related visualization skills
- D3.js VisualizationsUse when building bespoke interactive d3.js visualizations: networks, chord diagrams, maps, custom SVG with transitions and zoom. Not for quick standard charts (use create-viz).
- Diagram & Flowchart MakerProduce a downloadable, editable draw.io/diagrams.net XML file the user opens at app.diagrams.net. Use ONLY when the user explicitly wants an editable draw.io / diagrams.net / .drawio deliverable (a canvas file to open in the draw.io editor). For a diagram the user just wants to SEE inline in the chat — a flowchart, architecture, ER, sequence, or state diagram — use mermaid-diagrams (it renders as a real diagram in the message); this draw.io file does not render inline. Not for hand-drawn whiteboard looks (use excalidraw).
- Draw.io DiagramsUse when creating, editing, or laying out .drawio XML diagrams, including AWS architecture icons. Not for hand-drawn-style sketch diagrams (use excalidraw).
- Excalidraw DiagramsUse when creating, editing, or explaining .excalidraw JSON diagrams with a hand-drawn look. Not for Markdown text diagrams (use mermaid-diagrams).
- Math Animation StudioUse when building mathematical or educational animations with Manim (Python) -- scenes, mobjects, LaTeX. Not for data charts or plots (use create-viz).
- Mermaid Diagram MakerThe DEFAULT for any diagram the user wants to SEE inline in chat — flowcharts, flow diagrams, sequence, class, ER/database schema, C4 architecture, state, and gantt. Renders as a real diagram right in the message (Markdown-embeddable Mermaid), so use it for generic "make/draw a flowchart / architecture diagram / diagram of X" requests. Switch to the draw.io diagram skill only when the user explicitly asks for an editable draw.io / diagrams.net file.
More on Zeplik
Try C4 Architecture Diagrams on Zeplik
Every model, one chat. Bring the C4 Architecture Diagrams skill into your next conversation and let the assistant do the work.