diagram-conventions
Skill7 starsChanged 5 days agoMITView on GitHub
Diagrams in committed files: format and diagram type. TRIGGER when: drawing boxes and arrows (components, call flow, state machine, sequence, ER, topology); typing ASCII box art (`┌`, `─`, `│`, `+--+`) outside a mermaid block; adding a diagram to a document; committing a `.png`/`.svg`/`.drawio`/`.excalidraw` diagram; user asks for a diagram, a schéma or "draw me". SKIP when: a screenshot, a photograph or a plot of real data.
2 other projects use a version of this.
Adopted by
Most recently taken up by
- leroyguillaume/claudeword for word, first seen Nov 29, 2026
- maro114510/skillstheir own version, first seen Nov 1, 2026
Other versions2 projects use a version of this.
Word for word · 1
- leroyguillaume/claude★ 7100% same
Edited · 0
None found.
Wrote their own version · 1
- maro114510/skills★ 3same 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 repository54 other files it gives its agents.
- adr-conventionsSkill
- api-conventionsSkill
- architecture-conventionsSkill
- argocd-conventionsSkill
- ci-conventionsSkill
- config-conventionsSkill
- contributing-conventionsSkill
- councilSkill
- cryptography-conventionsSkill
- dependency-update-conventionsSkill
- docker-conventionsSkill
- documentation-conventionsSkill
- frontend-conventionsSkill
- github-actions-conventionsSkill
- github-issue-conventionsSkill
- github-pr-conventionsSkill
- github-repo-settingsSkill
- gitlab-ci-conventionsSkill
- helm-conventionsSkill
- herdr-core-delegationSkill
- herdr-delegationSkill
- herdr-tui-delegationSkill
- kopf-conventionsSkill
- kubernetes-operator-conventionsSkill
- logging-conventionsSkill
- logo-conventionsSkill
- mise-conventionsSkill
- ollama-conventionsSkill
- openssf-conventionsSkill
- pr-conventionsSkill
- pre-commit-conventionsSkill
- project-metadata-conventionsSkill
- python-async-conventionsSkill
- python-conventionsSkill
- readme-conventionsSkill
- release-script-conventionsSkill
- release-supply-chain-conventionsSkill
- renovate-ci-conventionsSkill
- rest-conventionsSkill
- rust-build-conventionsSkill
- rust-conventionsSkill
- rust-http-conventionsSkill
- security-policy-conventionsSkill
- signal-handling-conventionsSkill
- sql-conventionsSkill
- starlight-conventionsSkill
- systemd-conventionsSkill
- system-user-conventionsSkill
- task-conventionsSkill
- terraform-conventionsSkill
- topic-splittingSkill
- ui-copy-conventionsSkill
- web-layout-conventionsSkill
- yaml-conventionsSkill
The file
Files
Diagram conventions
In a committed markdown file, a diagram is Mermaid, in a fenced ```mermaid block, inline in the file that needs it. That is the default, and it takes a concrete reason — not a preference — to land anything else there.
Three reasons, and they are the whole rule:
- It renders. GitHub, GitLab, most IDE previews and the docs generators all draw Mermaid natively. Nothing to install, no build step, no CI job.
- It diffs. A reviewer sees
A --> BbecomeA --> Cin the same patch as the code that moved. A picture shows a changed hash and nothing else. - It is editable by whoever touches it next. Which is the actual failure of every other option: the person who has to update the diagram is never the person who has the source file, the licence, or the will.
Those three reasons are about a file somebody else will read and maintain. They say nothing about a throwaway drawing in a conversation — hence the next section.
In chat, draw whatever is quickest to read
An answer in the terminal is not a committed file: ASCII art is welcome there. Nobody has to maintain it, it will never wrap in a proportional font, and half the time a five-line box sketch lands faster than a Mermaid block the user has to render somewhere to see:
client ──HTTP──> gateway ──gRPC──> worker
│
└──> cache (read-through)Mermaid in chat is fine too, especially when the same diagram is about to be written into a file. Pick per message; there is no rule to follow here beyond "is this readable in a terminal".
The moment it goes into a file, it becomes Mermaid. Committed ASCII art is
out: it misaligns in a proportional font,
it cannot be edited without rebuilding the whole box, and it carries no
semantics — a reader cannot tell a queue from a database from a decision. If
you are counting spaces to line up a │ in a file, stop and write Mermaid.
When Mermaid is not the right tool
Mermaid draws graphs. It does not draw everything, and forcing it to is how you
get a flowchart pretending to be a floor plan. Reach for Excalidraw or an
image when the content is genuinely one of these:
- A freeform sketch — a whiteboard-shaped explanation where the spatial arrangement, the annotation and the scribbled aside are the content.
- A UI wireframe or a screen flow. Boxes on a canvas, at scale, with the layout carrying meaning.
- Something physical or spatial — a rack, a floor plan, a wiring layout, a network drawn geographically.
- An annotated screenshot of a real UI, a dashboard, a trace viewer.
- A photograph, or a generated plot of real data. Those were never diagrams; they are images and they stay images.
Two things this list is not. It is not "Mermaid was awkward, so I exported a
PNG" — a component graph, a sequence, a state machine and an ER model all have
a Mermaid type that fits, and the awkwardness is usually the diagram trying to
answer two questions at once. And it is not a licence to skip Mermaid in
markdown: even in a .md file the preference stands, and the picture has to
earn its place against the three reasons above.
Committing one
- Ship the editable source, in the repo. An Excalidraw export with the
scene embedded —
name.excalidraw.svgorname.excalidraw.png— is one file that both renders on GitHub and re-opens in Excalidraw for editing. Prefer that over a bare.excalidraw(which renders nowhere) or a bare export (which edits nowhere). For anything else, the source sits beside the export and both move in the same change. - Store it in the repository, next to the document that uses it, and link
it relatively (
diagrams/reconcile-flow.excalidraw.svg) — never by a path climbing out of the project root. - Never an externally hosted image — a wiki, a Confluence page, a shared drive, an image CDN. A dead diagram waiting to happen, and invisible to anyone reading the repo offline or from a clone.
- Write real alt text: what the diagram shows, not
"diagram". It is what a screen reader, a plain-text diff and a failed image load all get. - Prefer SVG over PNG where the tool offers it — it scales, it stays legible on a high-DPI screen, and it is text on disk.
Pick the type that answers the question
| The question | The diagram |
| what are the pieces and what talks to what | flowchart |
| in what order, and who waits for whom | sequenceDiagram |
| what states can this be in, and what moves it | stateDiagram-v2 |
| what are the entities and how do they relate | erDiagram |
| what runs where — nodes, zones, boundaries | flowchart with subgraph |
| what happens over calendar time | gantt, and only when dates are real |
A component graph plus one sequence diagram for the interesting flow covers most projects. One diagram that shows the actual mechanism beats five decorative ones; a diagram that only restates the section heading should be deleted rather than improved.
Making one worth reading
- Label every edge. An unlabelled arrow says "these two things know about
each other", which the reader had already guessed. Put the protocol, the
direction, and whether it is synchronous on it:
-->|"gRPC, streaming"|,-->|"register, TCP 9345"|,-.->|"async, at-least-once"|. - Name nodes exactly as the repository names them. A box called
workerwhen the directory issrc/reconciler/costs the reader the one mapping the diagram existed to give them. - Group with
subgraphfor real boundaries only — a process, a host, a cluster, a trust boundary. Not for tidiness. - Quote every label:
id["text"]. It is what lets a label carry a colon, a comma, a slash or brackets without a parse error, and<br/>is how it gets a second line. - Direction:
TBfor a hierarchy or a stack,LRfor a pipeline. Choose once and let Mermaid lay it out; hand-placing nodes in a graph the renderer could lay out itself is ASCII art with extra steps. - Keep it renderable by the plain renderer. No
%%{init}%%theme blocks, no fonts, no colour carrying meaning on its own — a reader in dark mode, in a terminal preview, or in a diff viewer has to get the same information. Colour may reinforce a grouping, never be it: when it earns its place, one or two MermaidclassDefs applied withclass, with a stroke that reads on light and dark backgrounds — never a per-nodestyleline. - A dozen or so boxes is the ceiling. Past that, the diagram has stopped answering one question. Split it, or raise the altitude.
Keeping it honest
A diagram is documentation, so every rule about documentation applies to it:
- It describes the present. No "will be", no "planned", no greyed-out box
for the component nobody has built. See
architecture-conventions. - It moves in the same change as the code it describes. A stale diagram is worse than none: it lies with authority and it lies in a form people trust more than prose. This is the cost an image carries and Mermaid does not — the update has to go through a tool, so it is the one that quietly rots.
- Everything in it exists under that name in the repo.
Where diagrams belong
ARCHITECTURE.md— the component graph and the flow that matters. This is the usual home; seearchitecture-conventions.- An ADR — only when the decision is a shape, and then usually two small
diagrams: what it looks like under the option taken, and under the one
rejected. Mermaid, always: an ADR is immutable, so a diagram nobody can edit
is one nobody can ever fix. See
adr-conventions. README.md— normally not. A README carries commands, and a diagram there is a sign the description is drifting into design; link toARCHITECTURE.mdinstead. Seereadme-conventions.- A merge request description — freely, when it helps a reviewer see the change. It is not committed prose and does not have to survive.
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.

