c4-structurizr is a Codex skill for producing a compact, evidence-backed C4 architecture model for one focal system. It creates seven Structurizr-styled C4-PlantUML diagrams, renders them with Java PlantUML, and verifies that every output is traceable to the source code rather than generated from vague assumptions.
Most generated architecture diagrams are either too generic or too disconnected from the code. This skill takes the opposite approach: it first inventories the actors, systems, containers, components, external dependencies, stores, queues, and deployment targets found in the repository. It then maps those elements into seven focused views and renders them through a consistent custom style.
The result is useful for onboarding documents, architecture reviews, AI-system reviews, design discussions, and technical reports where the diagram must explain the real system rather than a stylized abstraction.
By default, the skill produces these seven views:
system-landscapesystem-contextcontainercomponentdynamic-flowdeploymentcritical-path
Each diagram is a PlantUML source file. The renderer writes SVG output beside the diagram sources. Optional PNG previews can be generated for visual inspection.
The skill follows this sequence:
- Resolve the target repository and focal system.
- Read the repository structure, manifests, configuration, infrastructure files, tests, and existing documentation.
- Inventory people, systems, containers, components, external systems, stores, queues, and relationships.
- Detect AI workflow semantics when the repository contains agents, prompts, model adapters, executors, context stores, trace stores, or related runtime boundaries.
- Select and generate the seven views.
- Render the diagrams with the bundled renderer.
- Verify that all SVG outputs are nonblank and consistent with the evidence.
It is intentionally conservative. If the repository does not provide enough evidence for a view or relationship, the skill should report the gap instead of inventing an architecture.
Copy the folder into your Codex skills directory:
~/.codex/skills/c4-structurizr
The skill has no external Python dependencies. It uses the Python standard library for the renderer.
To render diagrams, you need one of the following:
- Java plus
plantuml.jar - A
plantumlexecutable available onPATH
The renderer looks for plantuml.jar in these places:
- The
--plantuml-jarargument - The
PLANTUML_JARenvironment variable - Common
docs/architecture/tools/andtools/locations near the diagram directory
If neither Java nor a PlantUML executable is available, the skill can still generate PlantUML sources, but rendering will fail until a renderer is available.
The normal Codex request is simple:
Use c4-structurizr to analyze this repository and generate the seven C4 views.
For manual rendering:
python "<skill-directory>/scripts/render_c4.py" --source "docs/architecture/structurizr/plantuml"Useful options:
| Option | Purpose |
|---|---|
--source <dir> |
Directory containing the diagram .puml files |
--plantuml-jar <path> |
Use a specific plantuml.jar |
--plantuml <exe> |
Use a specific PlantUML executable |
--output-dir <dir> |
Write rendered files to a separate directory |
--preview |
Also generate PNG previews in _preview/ |
--check-only |
Run PlantUML syntax validation without writing outputs |
--verbose |
Print the exact rendering command |
The default diagram workspace is:
docs/architecture/structurizr/plantuml/
system-landscape.puml
system-context.puml
container.puml
component.puml
dynamic-flow.puml
deployment.puml
critical-path.puml
c4-style.puml
The shared C4-PlantUML assets are staged in:
docs/architecture/tools/c4-plantuml/
This separation keeps generated diagrams readable while preserving consistent styling and reusable C4 macros.
- Use one focal system per diagram set.
- Derive entities from evidence in the repository.
- Prefer domain and technology terms already used by the project.
- Keep relationships explicit and traceable.
- Do not invent stores, queues, services, or trust boundaries.
- Use the shared style instead of one-off diagram colors.
- Mark AI elements only when the repository actually contains AI runtime behavior.
MIT