c4-graph
Skill1 starsChanged 2 months agoApache-2.0View on GitHub
Use when drawing or converting a software architecture diagram following the C4 model — system context, container, or landscape — for GitLab markdown, VS Code preview, or a README, from a text description, a DOT digraph, or a draw.io file or model. Also use when the user mentions C4, mermaid architecture diagram, crossing arrows, diagram unreadable on dark theme, or asks to convert a .drawio file or a draw.io SVG export.
In this repository10 other files it gives its agents.
- bias-analysisSkill
- code-reviewSkill
- debugSkill
- evidence-based-analysisSkill
- git-conventionsSkill
- planSkill
- skillSkill
- software-engineerSkill
- tddSkill
- terseSkill
The file
We split this skill into the rules it gives an agent
2 rules. About 0 are common, 1 is distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
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 22
Read mermaid-rules.md first.
- Very specific: line 28
Keep sequence flows out of the C4 graph — separate mermaid sequenceDiagram blocks.
≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
C4 graph
When to use
- User asks for an architecture diagram, a C4 diagram, or a system landscape
- User wants a diagram that renders in GitLab markdown or VS Code preview
- User provides a DOT digraph, a draw.io file, or a pasted draw.io model to convert
- Arrows cross heavily, or a diagram is unreadable on a dark theme
Overview
Produce C4 diagrams as a mermaid flowchart TB inside markdown: dagre gives a layered (Sugiyama) layout that minimises crossing arrows, and GitLab plus VS Code render it natively. Native mermaid C4Context has no layout engine — notation appendix only, never the deliverable.
Reference: mermaid-rules.md. Read it before the first line of diagram code. Reference: inputs.md. Read it when converting from a source or validating output.
Rules
- Read mermaid-rules.md first; copy its init block and class definitions verbatim.
- Declare actors first, boundaries in flow order, data stores last inside their boundary — declaration order is the placement hint.
- Respect C4 levels — one level per diagram, 15 elements at most. Level 1 (System Context): persons and systems only, containers collapsed into their owning system. Level 2 (Container): one diagram per in-focus system — its containers plus direct neighbours. Over 15 elements or mixed levels: split per the Levels section of mermaid-rules.md, all diagrams in one markdown file, context first.
- Draw one-way arrows with verb labels ("Notifies", "Reads"); two-way traffic is two labelled arrows.
- In convert mode, extract per inputs.md; the output edge set must equal the source's. Report dangling edges, never drop them silently.
- Render the result before delivering when a renderer exists (inputs.md has the command); never ship an unrendered diagram.
- Keep sequence flows out of the C4 graph — separate mermaid
sequenceDiagramblocks.
Boundaries
This skill never lays out with native C4Context and never produces draw.io-editable files; when draw.io round-trip or Google Drive preview is required, say so plainly — that needs a different pipeline. Commits and MR text belong to git-conventions; multi-session planning to plan.
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.

