InstructionMITv1.0.0awesome-copilot
draw.io Diagram Standards
Use when creating, editing, or reviewing draw.io diagrams and mxGraph XML in .drawio, .drawio.svg, or .drawio.png files.
At a glance
- Kind
- Instruction · Ananke
prompt - Reference
awesome-copilot/draw-io·ananke://prompt/awesome-copilot/draw-io@1.0.0- Applies to
**/*.drawio,**/*.drawio.svg,**/*.drawio.png- Files
- 1 · 5.9 KB
- How it's used
- Instructions apply automatically to files matching their applyTo glob in GitHub Copilot. For Claude Code, reference the file from CLAUDE.md.
Where it fits
- Task
- Visualise systems
- Lifecycle phase
- DesignVerification
- Role
- Reviewer
- Platform
- Ananke PlexusGitHub Copilot
- Needs
- Nothing (text only)
Facets suggested from the item's own text and tags, not yet reviewed. Facets say where an item is relevant, not that it will run in your setup. How facets work
Checked by Dex
Verified, not self-reported: dex-trove 0.3.16 installed this item into each layout and checked that the tool can load it. Dex collects no download or usage data.
- GitHub Copilot ✓ loads
Upstream metadata
Self-reported by the item's author; Dex shows it as written.
applyTo | **/*.drawio,**/*.drawio.svg,**/*.drawio.png |
|---|
Documentation
View upstream ↗Contents
Skill: Load
.github/skills/draw-io/SKILL.mdfor full workflow, XML recipes, and troubleshooting before generating or editing any.drawiofile.
Required Workflow
Follow these steps for every draw.io task:
- Identify the diagram type (flowchart / architecture / sequence / ER / UML / network / BPMN)
- Select the matching template from
.github/skills/draw-io/templates/and adapt it, or start from the minimal skeleton - Plan the layout on paper before writing XML — define tiers, actors, or entities first
- Generate valid mxGraph XML following the rules below
- Validate using
python .github/skills/draw-io/scripts/validate-drawio.py <file> - Confirm the file renders by opening it in VS Code with the draw.io extension (
hediet.vscode-drawio)
XML Structure Rules (Non-Negotiable)
<!-- Set modified to the current ISO 8601 timestamp when generating a new file -->
<mxfile host="Electron" modified="" version="26.0.0">
<diagram id="unique-id" name="Page Name">
<mxGraphModel ...>
<root>
<mxCell id="0" /> <!-- REQUIRED: always first -->
<mxCell id="1" parent="0" /> <!-- REQUIRED: always second -->
<!-- all other cells go here -->
</root>
</mxGraphModel>
</diagram>
</mxfile>
id="0"andid="1"must be present and must be the first two cells — no exceptions- Every cell
idmust be unique within the diagram - Every vertex (
vertex="1") must have a child<mxGeometry x y width height as="geometry"> - Every edge (
edge="1") must havesource/targetpointing to existing vertex ids — exception: floating edges (sequence diagram lifelines) use<mxPoint as="sourcePoint">and<mxPoint as="targetPoint">inside<mxGeometry>instead ofsource/targetattributes - Every cell except id=0 must have
parentpointing to an existing id - Children of a container (swimlane) use coordinates relative to their parent, not the canvas
Mandatory Style Conventions
Semantic Color Palette — Use consistently across the project
| Role | fillColor | strokeColor |
|---|---|---|
| Primary / Info (default) | #dae8fc | #6c8ebf |
| Success / Start / Positive | #d5e8d4 | #82b366 |
| Warning / Decision | #fff2cc | #d6b656 |
| Error / End / Danger | #f8cecc | #b85450 |
| Neutral / Interface | #f5f5f5 | #666666 |
| External / Partner | #e1d5e7 | #9673a6 |
Always include on vertex shapes
whiteSpace=wrap;html=1;
Use html=1 whenever a label contains HTML tags (<b>, <i>, <br>)
Standard connectors
edgeStyle=orthogonalEdgeStyle;html=1;
Diagram-Type Quick Reference
| Type | Container | Key shapes | Connector style |
|---|---|---|---|
| Flowchart | None | ellipse (start/end), rounded=1 (process), rhombus (decision) | orthogonalEdgeStyle |
| Architecture | swimlane per tier | rounded=1 services, cloud/DB shapes | orthogonalEdgeStyle with labels |
| Sequence | None | mxgraph.uml.actor, dashed lifeline edges | endArrow=block (sync), endArrow=open;dashed=1 (return) |
| ER Diagram | shape=table;childLayout=tableLayout | shape=tableRow, shape=partialRectangle | entityRelationEdgeStyle;endArrow=ERmany;startArrow=ERone |
| UML Class | swimlane per class | text rows for attributes/methods | endArrow=block;endFill=0 (inherit), dashed=1 (realize) |
Layout Best Practices
- Align all coordinates to the 10 px grid (values divisible by 10)
- Horizontal: 40–60 px gap between same-row shapes
- Vertical: 80–120 px gap between tier rows
- Standard shape size:
120 × 60px (process),200 × 100px (decision diamond) - Default canvas: A4 landscape
1169 × 827px - Maximum 40 cells per page — split into multiple pages for larger diagrams
- Add a title text cell at top of every page:
style="text;strokeColor=none;fillColor=none;fontSize=18;fontStyle=1;align=center;"
File and Naming Conventions
- Extension:
.drawiofor version-controlled diagrams,.drawio.svgfor files embedded in Markdown - Naming:
kebab-case— e.g.order-flow.drawio,database-schema.drawio - Location:
docs/orarchitecture/alongside the code they document - Multi-page: use one
<diagram>element per logical view within the same<mxfile>
Validation Checklist (run before every commit)
-
<mxCell id="0" />and<mxCell id="1" parent="0" />are the first two cells - All cell ids are unique within their diagram
- All edge
source/targetids resolve to existing vertices - All vertex cells have
<mxGeometry as="geometry"> - All cells (except id=0) have a valid
parent - XML is well-formed — no unclosed tags, no bare
&,<,>in attribute values - Semantic color palette used consistently
- Title cell present on every page
# Run automated validation
python .github/skills/draw-io/scripts/validate-drawio.py <file.drawio>
Reference Files
| File | Use For |
|---|---|
.github/skills/draw-io/SKILL.md | Full agent workflow, recipes, troubleshooting |
.github/skills/draw-io/references/drawio-xml-schema.md | Complete mxCell attribute reference |
.github/skills/draw-io/references/style-reference.md | All style keys, shape names, edge types |
.github/skills/draw-io/references/shape-libraries.md | Shape library catalog with style strings |
.github/skills/draw-io/templates/ | Ready-to-use .drawio templates per diagram type |
.github/skills/draw-io/scripts/validate-drawio.py | XML structure validator |
.github/skills/draw-io/scripts/add-shape.py | CLI: add a shape to an existing diagram |