Install
openclaw skills install @agenticweb4/architect-4cCreate C4 context, container, component, and code diagrams with Mermaid.
openclaw skills install @agenticweb4/architect-4cUse Simon Brown's C4 model to describe architecture through Context, Container, Component, and Code. Inputs may include discussions, design material, source code, and runtime configuration.
These points summarize the model described on the C4 website.
Choose diagrams for the audience. Context and container diagrams suffice for most teams. Add other views as needed. See the diagram guidance.
Treat the target system as a whole. Show its purpose, direct users, and external collaborators. Leave internal services, databases, and code for later levels. External means outside the current system boundary, including other systems in the same company.
Expand one system to show applications and data stores, their responsibilities, technologies, and communication. A container is a runtime boundary for executing code or storing data, such as a web application, background process, or database. Docker, virtual machines, folders, and libraries alone do not establish container boundaries.
Expand one container into units of functionality with explicit interfaces and collaboration. Components execute within their container, are typically not independently deployed, and need not match folders.
Expand one significant component into relevant classes, interfaces, functions, or data structures. Keep only details needed for the question, preferably generated from source or tooling. Code is level four. Dynamic and deployment diagrams are supporting views.
Load only the needed view references. Before drawing, read the shared diagram and visual guidelines.
| Diagram | Main question | Template and checks |
|---|---|---|
| L1 System context | How does the system collaborate with its environment? | Context |
| L2 Container | How do applications and data stores communicate? | Container |
| L3 Component | How are responsibilities organized inside one container? | Component |
| L4 Code | How is one component implemented? | Code |
| Dynamic | How does one scenario execute? | Dynamic interaction |
| Deployment | Where do instances run in one environment? | Deployment |
A system landscape uses Context's people and systems across a wider scope. For native Mermaid C4 notation, see the syntax reference.
docs/architecture/.