c4-diagrams
Skill185 starsChanged 32 days agoMITView on GitHub
Use when explaining existing code architecture, visualizing a new system before detailed design, mapping software boundaries, or creating C4-style diagrams in ASCII or Mermaid.
5 other projects use a version of this.
Adopted by
Most recently taken up by
- rajanrx/skillstheir own version, first seen Nov 8, 2026
- BenIsenstein/skillstheir own version, first seen Nov 1, 2026
- intent-driven-dev/skillsword for word, first seen Aug 22, 2026
- resilens/agentskillstheir own version, first seen May 1, 2026
- ping13/skillstheir own version, first seen Jan 11, 2026
Other versions5 projects use a version of this.
Word for word · 1
- intent-driven-dev/skills★ 9100% same
Edited · 0
None found.
Wrote their own version · 4
- ping13/skills★ 4same name
- resilens/agentskills★ 4same name
- rajanrx/skills★ 2same name
- BenIsenstein/skills★ 1same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository9 other files it gives its agents.
- AGENTS.mdAGENTS.md
- acceptance-test-authoringSkill
- architectural-decision-recordsSkill
- gherkin-authoringSkill
- glossarySkill
- grill-meSkill
- openspec-git-disciplineSkill
- spec-as-sourceSkill
- test-driven-developmentSkill
The file
We split this skill into the rules it gives an agent
9 rules. 0 are common, 8 are distinctive, and 1 is very specific to this project.
0
Common
Most of the 4 edited versions we read keep these.
8
Distinctive
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 10
Use C4 diagrams to clarify software architecture before detailed design.
- Distinctive: line 14
Before diagramming, determine these choices.
- Distinctive: line 22
If the user asks to skip questions for speed, still preserve unresolved choices as explicit assumptions and keep the first diagram …
- Distinctive: line 31
Stop before detailed design unless the user approves the diagram and asks to continue.
- Distinctive: line 50
Keep labels concrete: actor, system, container, component, database, queue, external service.
- Distinctive: line 51
Do not mix levels accidentally: containers are runnable/deployable units.
- Distinctive: line 52
Always include assumptions when diagramming a future system or incomplete codebase.
- Distinctive: line 53
Always include open questions when boundaries, ownership, data flow, or deployment are uncertain.
- Very specific: line 57
Use templates.md in this skill directory for compact ASCII and Mermaid starting points.
“Common” is measured: kept by at least 6 in 10 of the 4 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
C4 Diagrams
Overview
Use C4 diagrams to clarify software architecture before detailed design. Focus on boundaries, responsibilities, actors, dependencies, and data flow; draw only the levels that add value.
First Gates
Before diagramming, determine these choices. If the user already specified one, honor it. If multiple choices are ambiguous, ask one concise combined question.
| Choice | Options | Default behavior |
| Purpose | Existing code, new system, design review | Existing code requires codebase exploration first; new systems require assumptions called out. |
| Format | ASCII, Mermaid | Ask the user. Mermaid means plain Mermaid syntax, not C4-specific Mermaid. |
| Rigor | Strict C4, lightweight C4-inspired, hybrid | Ask the user. Do not decide silently. |
If the user asks to skip questions for speed, still preserve unresolved choices as explicit assumptions and keep the first diagram lightweight.
Workflow
- Establish purpose, format, and rigor.
- For existing code, inspect entry points, runtime boundaries, integrations, and persistence before drawing. For a quick pass, inspect enough to identify language/framework, launch entry points, major directories, external integrations, and data stores; label anything else as unknown.
- Pick the smallest useful diagram set. Start with system context or container; add component, dynamic, or deployment only when it answers a real question.
- Draw the diagram using ASCII or plain Mermaid.
- Explain the diagram in 3-6 bullets: boundaries, responsibilities, key relationships, assumptions, and open questions.
- Stop before detailed design unless the user approves the diagram and asks to continue.
C4 Level Selection
| Level | Use when | Avoid when |
| System context | Identifying users, external systems, and scope | The scope is already obvious and local. |
| Container | Showing deployable/runnable units, data stores, APIs, CLIs, queues | You only need code-level call flow. |
| Component | Explaining internals of one container | The container has few meaningful internal parts. |
| Code | Rarely, for critical classes/modules | A normal component diagram would be enough. |
| Dynamic | Showing request, event, or workflow sequence | Static structure is the actual question. |
| Deployment | Showing infrastructure, nodes, networks, runtime placement | Deployment is unknown or irrelevant. |
For small systems, challenge requests for all four C4 levels and offer a smaller set. If the user still wants all four, produce them but mark low-value levels as lightweight sketches and explain why they may not be worth maintaining.
Output Rules
- Mermaid diagrams must use plain
flowchartorsequenceDiagramsyntax for portability. - ASCII diagrams should favor readable boxes and arrows over decorative complexity.
- Keep labels concrete: actor, system, container, component, database, queue, external service.
- Do not mix levels accidentally: containers are runnable/deployable units; components live inside one container.
- Always include assumptions when diagramming a future system or incomplete codebase.
- Always include open questions when boundaries, ownership, data flow, or deployment are uncertain.
Templates
Use templates.md in this skill directory for compact ASCII and Mermaid starting points.
Common Mistakes
| Mistake | Fix |
| Drawing all four C4 levels by default | Draw only levels that answer the current question. |
| Jumping into detailed design immediately | Validate context/container boundaries first. |
| Using C4-specific Mermaid syntax | Use plain Mermaid flowchart or sequenceDiagram. |
| Treating modules as containers | Containers are runnable/deployable units; modules are usually components. |
| Hiding uncertainty | State assumptions and open questions after the diagram. |
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

