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
title: Example Diagram
source: authored
Common fields:
theme: tech-blue, academic, academic-color, nature, dark, high-contrastlayout: horizontal, vertical, hierarchicalrouting: orthogonal, roundedprofile: default, academic-paper, engineering-reviewsource: authored or replicatedmodulesLogical 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
replication:
colorMode: preserve-original
background: "#FFF7ED"
palette:
- hex: "#FDBA74"
role: service fill
appliesTo: nodes
confidence: high
colorMode can be:
preserve-originaltheme-firstWhen type is omitted, labels can still map to:
databasedecisionterminalqueueuserdocumentformulaserviceFormula detection should only rely on:
$$...$$\(...\)`...`The compiler validates:
Use 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 |