c4-architecture — Claude Code skill: what it does, how to install
Creates software architecture documentation and C4 model diagrams using Mermaid syntax from your codebase.
npx claude-code-templates@latest --skill creative-design/c4-architectureWhat c4-architecture does
This skill inspects your project to generate structured C4 architecture documentation. It produces Mermaid diagrams embedded in markdown files alongside explanatory text.
The workflow supports multiple abstraction tiers. It covers system context (C4Context), runtime containers (C4Container), internal components (C4Component), and deployment infrastructure (C4Deployment). Numbered message flows can also be mapped with C4Dynamic. Context and container views are treated as essential, while component breakdowns remain optional.
Diagrams follow strict formatting conventions. Every relation demands a concrete technology tag, and bidirectional links are rejected to prevent ambiguity.
What it helps with
- map system boundaries and external actors
- document container architecture across databases and services
- visualize sequential API request flows using dynamic diagrams
- outline production infrastructure and deployment nodes
Example prompts for the agent
- Generate a system context C4 diagram for this project in Mermaid format
- Document our backend containers and local storage setup
- Draw a C4Dynamic sequence for the authentication workflow
How to install c4-architecture
1claude-code-templates
npx claude-code-templates@latest --skill creative-design/c4-architecture2Skills CLI (Vercel)
npx skills add davila7/claude-code-templates --skill c4-architecture -a claude-code3Manually: put the files in place
~/.claude/skills/c4-architecture/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/c4-architecture/
Manually: put the files in place
.agents/skills/c4-architecture/SKILL.mdFor all projects use ~/.agents/skills/
Manually: put the files in place
.cursor/skills/c4-architecture/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install davila7/claude-code-templates c4-architecture2Manually: put the files in place
.github/skills/c4-architecture/SKILL.mdPlatform CLI
gemini skills install https://github.com/davila7/claude-code-templates --path cli-tool/components/skills/creative-design/c4-architectureManually: put the files in place
.devin/skills/c4-architecture/SKILL.mdThe legacy .windsurf/skills/ path still works
Claude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about c4-architecture
How do I install c4-architecture in Claude Code?
Run npx claude-code-templates@latest --skill creative-design/c4-architecture in your terminal. Alternatively, install it with npx skills add davila7/claude-code-templates --skill c4-architecture -a claude-code.
What does the c4-architecture skill do?
It inspects application code and writes architecture documentation using C4 Mermaid diagrams. The output includes contextual markdown files describing components and data flows.
Which C4 diagram levels are generated?
The skill handles Context, Container, Component, and Deployment diagrams. It also includes C4Dynamic diagrams for step-by-step request tracing.