The YAML specification is the canonical representation for Draw.io Skill 2.2.0.
Mermaid, CSV, and imported .drawio files are convenience inputs. They should all normalize into this structure before rendering.
meta:
theme: tech-blue
layout: horizontal
nodes:
- id: api
label: API Gateway
type: service
- id: db
label: PostgreSQL
type: database
edges:
- from: api
to: db
type: data
label: Query
metaDiagram-wide settings.
meta:
theme: tech-blue
layout: horizontal
routing: orthogonal
profile: default
figureType: architecture
title: Example Diagram
source: generated
canvas: auto
Common fields:
theme: tech-blue, academic, academic-color, nature, dark, high-contrastlayout: horizontal, vertical, hierarchicalrouting: orthogonal, roundedprofile: default, academic-paper, engineering-reviewfigureType: architecture, roadmap, workflow when profile=academic-papersource: generated, replicated, or editedcanvas: auto or WIDTHxHEIGHT, such as 1200x800meta.canvas sets the minimum draw.io page size. Omit it or use auto for content-derived sizing. Use WIDTHxHEIGHT for reference-image replication when you are mapping visible elements from source-image coordinates. The renderer expands beyond the explicit canvas if native content exceeds the page, so shapes are not clipped.
modulesLogical containers for related nodes.
modules:
- id: backend
label: Backend
nodesRequired. Each node needs a stable id and label.
nodes:
- id: api
label: API Gateway
type: service
module: backend
position:
x: 160
y: 96
icon: aws.api-gateway
edgesOptional, but most diagrams use them.
edges:
- from: api
to: db
type: data
label: Query
labelPosition: center
Replicated diagrams usually include:
meta:
source: replicated
canvas: 1200x800
replication:
colorMode: preserve-original
background: "#FFF7ED"
palette:
- hex: "#FDBA74"
role: service fill
appliesTo: nodes
confidence: high
colorMode can be:
preserve-originaltheme-firstDo not replicate a reference by embedding the whole source image as the page. The final .drawio should be native editable content, and validation flags full-page embedded image cells.
Replicated diagrams may need more than color metadata. Use these fields when text placement matters:
type: text for standalone titles, captions, callouts, legends, and notes;bounds for exact top-left text-box geometry when the box itself is part of the design;type: formula or type: text with official math delimiters for dedicated formula annotations;labelPosition and labelOffset for edge labels that need to sit off the connector line;align, verticalAlign, and spacing* for visible typography and padding overrides.When both position and bounds are present, treat bounds as the fidelity-preserving geometry.
When type is omitted, labels can still map to:
databasedecisionterminalqueueuserdocumentformulaserviceFormula detection should only rely on:
$$...$$\(...\)`...`The compiler validates:
figureType when paper mode is enabledUse strict mode when warnings should fail the build.
The old A-H format is legacy guidance. The canonical mapping is now:
| Legacy idea | YAML location |
|---|---|
| layout | meta.layout |
| modules | modules[] |
| nodes | nodes[] |
| edges | edges[] |
| visual style | meta.theme and style overrides |
| export intent | local CLI or Desktop export path |