/c4-architecture:c4-architecturefrom c4-architecture
Generates C4 architecture models using Structurizr DSL, creating system context, container, component, and deployment diagrams from codebase analysis.
Ships in c4-architecture. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Generate C4 architecture models using the Structurizr DSL and optionally render them as images.
Analyse the codebase to identify architectural elements:
Configuration & Build Files
package.json, pom.xml, build.gradle, go.mod, Cargo.toml, requirements.txtdocker-compose.yml, Dockerfile, kubernetes/*.yml.env, configuration files, infrastructure-as-codeIdentify Elements
Map Relationships
Write a workspace.dsl file following the Structurizr DSL syntax.
For the full DSL language reference, read: references/structurizr-dsl-reference.md
For a working example, read: examples/example-workspace.dsl
Structure the workspace as follows:
workspace "[System Name]" "[Brief description]" {
model {
// 1. Define people (actors)
// 2. Define software systems
// - Nest containers inside the primary system
// - Nest components inside containers (if needed)
// 3. Define relationships between elements
}
views {
// 4. Create views at each required C4 level
// 5. Apply styling via themes or element/relationship styles
}
}
Naming Conventions:
webApp, apiGateway, userDb"Web Application", "API Gateway""Spring Boot REST API", "PostgreSQL 15"Relationship Guidelines:
user -> webApp "Browses products using" "HTTPS""REST/JSON", "JDBC", "AMQP"Generate appropriate views based on the level of detail needed:
systemLandscape)systemContext)container)component)deployment)Always use autoLayout unless the user provides explicit layout preferences.
Use tags and styles to make diagrams readable:
styles {
element "Person" {
shape Person
background #08427B
color #ffffff
}
element "Software System" {
background #1168BD
color #ffffff
}
element "Container" {
background #438DD5
color #ffffff
}
element "Component" {
background #85BBF0
color #000000
}
element "Database" {
shape Cylinder
}
element "External" {
background #999999
color #ffffff
}
}
All export and rendering is done via Docker. Requires Docker to be installed and running.
Export DSL to C4-PlantUML:
mkdir -p ./diagrams
docker run --rm -v $PWD:/usr/local/structurizr structurizr/structurizr \
export -workspace /usr/local/structurizr/workspace.dsl -format plantuml/c4plantuml -output /usr/local/structurizr/diagrams
Render PlantUML to PNG:
docker run --rm -v $PWD/diagrams:/data plantuml/plantuml -tpng /data/*.puml
Render PlantUML to SVG:
docker run --rm -v $PWD/diagrams:/data plantuml/plantuml -tsvg /data/*.puml
Other supported export formats: plantuml, mermaid, json.
Prerequisite: Docker (docker pull structurizr/structurizr && docker pull plantuml/plantuml)
Before presenting the workspace to the user, verify:
autoLayout is applied to all viewsWhat SKILL.md sets; muted values are Claude Code's defaults
Generated from the plugin's indexed repository (bitsmuggler/c4-skill) — no native marketplace selected
npx claudepluginhub p/bitsmuggler-c4-architectureOther plugins' skills for the same job