drawio-syntax-metadata
Installation
SKILL.md
Draw.io Syntax: Metadata
Purpose
This skill teaches how to build multi-page Draw.io diagrams, manage layers, attach custom properties via <object> wrappers, define file-level variables, use the %placeholder% substitution system, add tooltips and links, and enable MathJax/LaTeX rendering. It covers everything OUTSIDE the individual cell creation covered by drawio-syntax-cells.
Critical Rules (Memorize These)
- ALWAYS use unique
idvalues on every<diagram>element. Duplicate diagram IDs corrupt the file. - NEVER nest
<diagram>elements inside each other. Every<diagram>is a direct child of<mxfile>. - ALWAYS set
placeholders="1"on the<object>wrapper to enable%variable%substitution. Without it, placeholder tokens render as literal text. - ALWAYS use single-quoted JSON for the
varsattribute on<mxfile>:vars='{"key":"value"}'. Double quotes around the attribute value break XML parsing. - NEVER omit the structural cells (
id="0"andid="1" parent="0") on ANY page. Every<root>MUST contain both. - ALWAYS keep cell IDs unique across ALL pages in the file, not just within a single page.
- ALWAYS use the full
<mxfile>wrapper when the diagram needs multi-page support, file-level variables, or MathJax. - NEVER put
idorvalueon the inner<mxCell>when using an<object>wrapper. These attributes belong on<object>.