dot-diagrams
Skill1 starsChanged 16 days agoMITView on GitHub
Conventions for Graphviz .dot diagrams and their SVG renders. Load before creating or changing any .dot file, however small the change and even in passing during an unrelated task, and when the user asks for a diagram, schema or sketch of an architecture, workflow or data flow.
In this repository15 other files it gives its agents.
- audit-skill-runSkill
- challenge-handoffSkill
- handoffSkill
- implem-brakeSkill
- resume-handoffSkill
- review-auto-loopSkill
- review-correctnessSkill
- review-docsSkill
- review-judgeSkill
- review-readabilitySkill
- review-testsSkill
- rust-project-maintenanceSkill
- settle-discussionSkill
- summarize-changeSkill
- web-searchSkill
The file
We split this skill into the rules it gives an agent
4 rules. About 0 are common, 1 is distinctive, and 3 are 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.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 24
After every change, run make, then:
- Distinctive: line 38
Untangle arrows first: keep them short and straight, with as few crossings as possible.
- Very specific: line 45
Leave a margin around the drawing with pad=0.2 on the graph.
- Very specific: line 58
Place boxes yourself: try a change and read what dot-check reports, rather than working out its effects in advance or running a scripted …
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 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
Dot diagrams
Build
- Edit the
.dotsource only, the SVG is a build output never edited by hand. Generate SVGs with
make, using the project's existing Makefile if any, otherwise one next to the.dotfiles:all: $(patsubst %.dot,%.svg,$(wildcard *.dot)) %.svg: %.dot dot -Tsvg $< -o $@- Gitignore the SVG, unless a Markdown file hosted on a public forge embeds it: then commit it, so the forge renders it inline.
Check
After every change, run make, then:
- Run
<skill-dir>/dot-check name.dot, where<skill-dir>is the directory you read this file from. It prints warnings, then the defects, then the crossings between arrows, then the SVG's size. Positions are in points from the SVG's top left corner. It exits with status 1 on defects. Set the layout engine and its options in the.dotfile, not on the build's command line. Look at the result: rasterize the SVG itself with
rsvg-convert --dpi-x=72 --dpi-y=72 name.svg -o <scratchpad>/name.png, notdot -Tpng, which draws with Graphviz's own renderer and fonts. When its look depends on the page embedding it (for example a slide), screenshot that page with a headless browser instead. The PNG is for your own check, show the user the SVG. Zoom on dense areas and crop: images are scaled down before you see them, and a gap of a few points disappears in a full view.rsvg-convertzooms and crops in one command, with a negative offset and a page size in pixels after the zoom. At 72 dpi, a point is a pixel before the zoom: a position (x, y) printed bydot-checklands at (z·x, z·y)px in a render zoomed z times. For example, this takes the 60 × 40pt area around (188, 167) of a 4× render:rsvg-convert --dpi-x=72 --dpi-y=72 -z 4 --left=-632px --top=-588px --page-width=240px --page-height=160px name.svg -o <scratchpad>/crop.png
Show the user a diagram once dot-check reports no defects, or say which remain and why.
Layout and text
- Readability over completeness: show the main flow and leave details to the prose. Split into several diagrams rather than cramming one.
- Untangle arrows first: keep them short and straight, with as few crossings as possible. Curve an arrow when that untangles the drawing.
- Align boxes on shared rows and columns, as far as the other aims allow.
- Draw the nodes the user agreed on. When the layout would read better with nodes added, merged or duplicated, propose it rather than doing it.
- Labels are a few words. Label an edge only when its meaning is not obvious.
- Give each node role its own style. Add a legend only as a last resort.
- Draw boxes with rounded corners: set
node [shape=box, style=rounded]once at the top of the file. A node or role that sets its ownstylereplaces the whole list, so repeatroundedin it, as instyle="rounded,filled". - Draw boxes as rectangles clearly wider than tall, about twice or more. Give a box room for its arrows by widening it or aiming them with ports.
- Leave a margin around the drawing with
pad=0.2on the graph. - Set
fontname="DejaVu Sans,sans-serif"at the top of the file ongraph,nodeandedge, unless the user or the page embedding the diagram needs another font: the graph's font does not carry over to nodes and edges. Keep text sizes the same across the project's diagrams.
Graphviz behavior
- To fix an arrow end that stops short at a rounded corner or at the fold of a
note, widen the box withwidth, or aim that end at the middle of the side facing the arrow with a compass port (tailport=e,headport=w). Aim an arrowhead meeting its box at a shallow angle the same way, at the left or right side when the arrow runs more across than up or down, at the top or bottom otherwise, then move the boxes farther apart ifdot-checkstill reports it. In adotlayout, a port also reroutes the arrow, and can bend it. Corner ports (ne,sw, ...) sit on the square corner, off the drawn line. A port shared by two arrows stacks their heads. sameheadandsametailonconstraint=falseedges can start or end an arrow away from its node.- In a
dotlayout, an edge label often touches its arrow or one nearby: pad it with a borderless HTML table, as inlabel=<<table border="0" cellpadding="2"><tr><td>start</td></tr></table>>. dotchooses the order within each row itself:rank=samefixes a row, butgroup,weightand invisible edges only nudge the order. When the drawing needs the order within rows set too, pin positions by hand withneato:layout=neato,inputscale=72for positions in points,pos="x,y!"on every node,splines=line, notsplines=true, whose arrows detour around boxes and out of frames. Then:- A frame hugs its nodes, ignores
margin, and its title lands on them: pad it with two invisible corner nodes,[shape=point, style=invis, width=0, pos="x,y!"], the same distance beyond its outer boxes on every side: 8pt, or 16pt when an arrow crosses the frame. Add 20pt more at the top when the frame has a title.width=0keeps them from taking the size set by the frame'snode [width=...]. - Nested frames are not drawn: declare the inner frame on its own, and place its nodes inside the outer one.
lheadandltailare ignored, and an arrow runs straight between its nodes: to put an arrow's end on a frame's line or at a given spot on a box's side, place a node[shape=point, style=invis, width=0]there and attach the end to it; to bend an arrow, split it into arrows through such nodes, withdir=noneon all but the last. Setheadclip=falseon each arrow ending at such a node andtailclip=falseon each one leaving it: Graphviz stops arrows short of even awidth=0point.- A
labelorxlabelis drawn against its arrow, and across it when the arrow slopes: place it withtaillabel,labelangleandlabeldistanceinstead.
- A frame hugs its nodes, ignores
- Place boxes yourself: try a change and read what
dot-checkreports, rather than working out its effects in advance or running a scripted search over positions.
Source
- Comment groups of nodes and layout tricks. No dead code, no attribute set to its default value.
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.

