This Skill guides the Agent to generatestandard Draw.io format diagrams(.drawio file), supporting two modes:Generation from scratch(model architecture, algorithm flow, etc.) andstyle transfer(reference image + content → generate a new diagram in the style of the reference image).
Step 0: Task identification
| Condition | Action |
|---|---|
| User providesreference image, and wants to draw a new diagram 'in the style of this image' | Execute reference/style-migration.md |
| Other cases (generation from scratch) | Execute reference/generation.md |
When to use
Generation from scratch:
- The user needs to generate an architecture diagram for a deep learning model (such as Transformer, CNN, RNN, etc.)
- The user needs to draw an algorithm flowchart, data flow diagram, or system architecture diagram
- The user needs to visualize a specific concept (such as receptive field, attention mechanism, feature extraction process, etc.)
- The user mentions needs such as 'draw a diagram', 'generate an architecture diagram', 'visualize the model structure', 'draw a flowchart', etc.
Style transfer:
- The user provides a reference image and wants to 'draw in this style' or 'draw following this layout/color scheme'
General specifications (shared by both modes)
1. XML format strictness
- ✅ All tags must be correctly closed:
<mxCell>corresponds to</mxCell>, and must never be written as</mCell> - ✅ Use
vertex="1"to mark nodes,edge="1"to mark connections - ✅ Each element must have a unique
id, incrementing from 0 - ✅ Special characters must be escaped:
&→&,<→<,>→>
2. Standard file structure
<mxfile host="app.diagrams.net">
<diagram name="图表名称" id="图表id">
<mxGraphModel dx="1200" dy="800" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="宽度" pageHeight="高度" background="#F5F5DC">
<root>
<mxCell id="0"/>
<mxCell id="1" parent="0"/>
<!-- 所有图形元素从 id="2" 开始 -->
</root>
</mxGraphModel>
</diagram>
</mxfile>
3. Common styles
- 2D node:
rounded=1;whiteSpace=wrap;html=1;fillColor=#颜色;strokeColor=#333333;strokeWidth=1;fontSize=11 - 3D node (recommended for neural network layers):
shape=cube;whiteSpace=wrap;html=1;boundedLbl=1;backgroundOutline=1;darkOpacity=0.05;darkOpacity2=0.1;size=20;fillColor=#颜色;strokeColor=#333333;strokeWidth=1.5 - Connection:
edgeStyle=orthogonalEdgeStyle;rounded=0;html=1;strokeColor=#000000;strokeWidth=2;endArrow=classic - Dashed line (residual):
dashed=1
4. Output requirements
- Diagram description (2-3 lines)
- Usage guide: open in Draw.io, export PNG/SVG/PDF, figure captions and paper citation examples
Reference resources
- Draw.io:https://app.diagrams.net/
- Official documentation:https://www.drawio.com/doc/