/excalidraw-diagrams:excalidraw-diagramsfrom excalidraw-diagrams
Generates Excalidraw diagrams from source documents using a Python generator with layout validation, SVG preview, and fact cross-checking. Useful for creating architecture, network, or flow diagrams from design docs.
Ships in excalidraw-diagrams. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Generate .excalidraw scenes with a script, not by hand. The script sizes boxes from their text, binds arrows, and fails the build when the layout breaks. The diagram never holds a fact that its source document lacks.
Reference run: a 13-frame production platform diagram in an Obsidian vault, built from its design document.
references/design-rules.md. Get the user's go before building.examples/example_frames.py to frames_a.py. One function per frame: f0(doc), f1(doc), and so on. Use only the helpers in scripts/xl.py (its docstring lists them).python3 <skill>/scripts/build.py frames_a,frames_b out.excalidraw. Fix every ERROR and rebuild. The build exits 1 on errors but still writes the file.<skill>/scripts/preview.sh out.excalidraw prev, then Read each PNG in prev/png. Checks do not replace looking. Fix what is cramped, empty, or wrong.python3 <skill>/scripts/crosscheck.py out.excalidraw source.md lists facts the source lacks. python3 <skill>/scripts/validate.py out.excalidraw checks structure. Each leftover is either added to the source or removed from the diagram..trash/ with the reason in the filename (vault rule: never rm). Tell the user the generator ran once and later edits happen by hand in Obsidian.from xl import *
def f3(doc):
f = doc.frame('3 Network and addressing') # the name is the frame title
f.header('Which VLAN holds what, and which addresses are public?')
z = f.zone(60, 110, 1000, 100, 'DMZ tier', 'dmz') # create the zone before its nodes
a, b = f.row(80, 190, 40, [
dict(w=300, tier='dmz', title='hpx01 .2', detail='active; terminates TLS', tag=PRO),
dict(w=300, tier='dmz', title='hpx02 .3', detail='standby', tag=PRO)])
f.zone_h(z, a.b + 30 - 110) # size the zone after the content
f.horiz(a, b, label='VRRP') # gap must exceed the label width
f.fit() # frame height from content
return f
Arrow kinds: data solid, ctl dashed blue, plan dotted grey, drop dashed red. Tags: DEC PRO TOA OPN LAT PLN VER LIVE.
text property renders a blank box. The helpers draw text as separate, grouped elements.finalize() moves frames into a two-column grid. Never mix global coordinates in.zone_h.chars x 9.6 + 12 px. Keep the gap wider than that plus 4 px, split long labels over two lines, or pick another segment with label_at=i.mid) so lines do not cross. Enter header boxes at ob=0.8 so arrows miss the zone title.horiz and vert for aligned boxes. For targets of other heights set oa=(target.cy - a.y)/a.h.text() wraps a long tag and breaks the height math. Keep tags short.elbowed: false, bound at both ends). Moving a box later means fixing its arrow by hand.qlmanage crops non-square SVG, so render.py pads to a square. ImageMagick failed on fonts and PIL is missing. Do not retry them.| Item | Value |
|---|---|
| Frame | 2400 px wide, two columns at x 0 and 2700, 300 px between rows, 60 px margins |
| Frame content | Question line at the top (24 px), one question per frame, readable alone |
| Text | Zone title 22, box title 20 sans, detail 16 mono, tags and arrow labels 16 sans |
| Colors | One per tier: ext, rtr, dmz, apps, data, k8s, sto, tool, phys, other, prod. A legend frame explains them |
| Strokes | Solid 3 for built things, dashed 2 for later phase or other environments |
| Status tags | decided green, proposed and to assign amber, open red, later phase grey |
| Frame 0 | Legend: tier colors, line styles, tags, how to read, source of truth path |
Details and the frame types that worked (overview, physical, network, firewall, NAT, ingress, platform, data, storage, monitoring, flows, failures) are in references/design-rules.md.
Read the vault's own notes on Excalidraw first (look in its CLAUDE.md and any agent-docs folder). The plugin rewrites the file when it is opened, so re-read before any later edit. Follow the vault's CLAUDE.md for writing rules and for how to retire an old file.
scripts/xl.py: builder, layout checks, grid placementscripts/build.py: runs frame modules, checks, writes the scenescripts/render.py, scripts/preview.sh: SVG and PNG preview, tiles with TILE=1300scripts/validate.py: structure check (bindings, indices, frames, fonts)scripts/crosscheck.py: facts on the diagram versus the source docexamples/example_frames.py: two small frames that use every helperreferences/scene-format.md: element fields, bindings, plugin behaviorreferences/design-rules.md: goals template, frame types, spacing, colorsreferences/lessons.md: what went wrong in the reference run and the fixexamples/example_frames.py (opens in a new tab)references/design-rules.md (opens in a new tab)references/lessons.md (opens in a new tab)references/scene-format.md (opens in a new tab)scripts/build.py (opens in a new tab)scripts/crosscheck.py (opens in a new tab)scripts/preview.sh (opens in a new tab)scripts/render.py (opens in a new tab)scripts/validate.py (opens in a new tab)scripts/xl.py (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub widnyana/eyay-toolkits --plugin excalidraw-diagramsOther plugins' skills for the same job