Diagram
devant specialist (work-invoked): draw professional draw.io diagrams grounded in the real codebase — C4 architecture or UML activity flow — a committed JSON spec into `devant diagram-build`, per references/drawio-guide.md.From its SKILL.md
npx -y skills add mthanhlm/devant --skill diagramAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 1 stars1 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
3.8 KB, as published. Nobody here has run it
devant: diagram
Draw a diagram a developer AND a non-technical stakeholder can both read at a glance. Two kinds, each at one of two altitudes (guide §0): idea-level (a ~15-second pitch — the default for plan/design asks) or engineering-complete (every branch/loop/error path, opt-in).
- Architecture — C4: idea-level is Level 1 (System Context); engineering-complete is container/component.
- Activity flow — idea-level is a milestone flow; engineering-complete is a full UML activity diagram (loops as labelled back-edges).
The intent CLI is devant.
Do this
- Pick the altitude, then the kind (guide §0). Ambiguous altitude → default to idea-level and say so in one line; ambiguous kind → ask one line.
- Ground in the real code — never invent.
devant graph explore/searchfor the actual containers, modules, stores, and the real flow. A box that maps to nothing in the graph doesn't belong on the diagram. - The spec IS the source of truth — committed, not throwaway (dec-046).
- New diagram: write the logical spec (guide §6 — kind, title, nodes, edges with guards, loops
declared
"loop": true) todocs/diagrams/<name>.spec.json. - Existing diagram: read and PATCH the existing spec — never regenerate from scratch; the user's hand-tuning lives there and must survive.
- Then
devant diagram-build docs/diagrams/<name>.spec.json -o docs/diagrams/<name>.drawio. It emits the styled XML, lays out with real ELK, and runs the lint gate itself — exit 0 means clean by construction. Validation is fail-loud, never a silent guess. - Names:
architecture-<slug>/activity-<slug>. Update in place; no-v2copies. Local-only on request →.devant/docs/draw.io/(git-excluded). - No draw.io desktop CLI, no MCP — ever (dec-012).
- New diagram: write the logical spec (guide §6 — kind, title, nodes, edges with guards, loops
declared
- Escape hatch — raw mxGraph XML, only when the spec can't say it (swimlanes, fork/join bars,
C4 boundary boxes). ONLY THEN read
references/raw-xml-escape.md(§1–§5, §7), hand-author,devant layout <file> --preset <p>, and fix untildevant drawio-lint <file> --fixexits 0. This path pays the fix loop the spec path removed — take it deliberately, not by default. - Done = built clean (dec-045).
- Spec path:
diagram-buildexited 0 — that IS the lint gate; deliver. - Raw path: well-formed check
(
python3 -c "import xml.dom.minidom,sys; xml.dom.minidom.parse(sys.argv[1])" <file>),devant layout, thendevant drawio-lint <file> --fixuntil it exits 0. - Structural changes go through the spec; cosmetic hand-fixes on the generated file are fine — re-run the lint after one.
- Spec path:
- Visual pass — ON DEMAND, not a gate (dec-045). Run
devant drawio-preview <file>and Read the PNG with vision only when (a) the user asks to see/verify it, or (b) the lint needed manual fixing, or (c) the raw path was taken. At most one corrective round, then deliver. If the preview tool is missing, name the fix (/devant:onboardinstalls chrome-headless-shell) and let the user decide — never block delivery on an optional render. Delete the.preview.pngafter, unless asked to keep it.
Tell the user the .drawio opens in draw.io / diagrams.net / the VS Code Draw.io extension, the
spec sits beside it for future edits, and devant drawio-preview <file> -o <out.png> renders a
shareable PNG on demand.
Keep to the two kinds and the one style system. This skill draws; it does not design the
architecture (that's devant:design) or edit code.