skills/drawio-skill/SKILL.md
Use when user requests diagrams, flowcharts, architecture charts, or visualizations. Also use proactively when explaining systems with 3+ components, complex data flows, or relationships that benefit from visual representation. Generates .drawio XML files and exports to PNG/SVG/PDF locally using the native draw.io desktop CLI. Supports modern "Premium Architecture" styles with card-based designs and layered layouts.
npx skillsauth add airclear/skills drawio-skillInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Generate .drawio XML files and export to PNG/SVG/PDF/JPG locally using the native draw.io desktop app CLI.
Supported formats: PNG, SVG, PDF, JPG — no browser automation needed.
PNG, SVG, and PDF exports support --embed-diagram (-e) — the exported file contains the full diagram XML, so opening it in draw.io recovers the editable diagram. Use double extensions (name.drawio.png) to signal embedded XML.
Explicit triggers: user says "diagram", "visualize", "flowchart", "draw", "architecture diagram", "process flow", "ER diagram", "UML", "sequence diagram", "class diagram", "neural network", "model architecture"
Proactive triggers:
Skip when: a simple list or table suffices, or user is in a quick Q&A flow
The draw.io desktop app must be installed and the CLI accessible:
# macOS (Homebrew — recommended)
brew install --cask drawio
draw.io --version
# macOS (full path if not in PATH)
/Applications/draw.io.app/Contents/MacOS/draw.io --version
# Windows
"C:\Program Files\draw.io\draw.io.exe" --version
# Linux
draw.io --version
Install draw.io desktop if missing:
brew install --cask drawio or download from https://github.com/jgraph/drawio-desktop/releases.deb/.rpm from https://github.com/jgraph/drawio-desktop/releasesBefore starting the workflow, assess whether the user's request is specific enough. If key details are missing, ask 1-3 focused questions:
Skip clarification if the request already specifies these details or is clearly simple (e.g., "draw a flowchart of X").
draw.io --version succeeds; note platform for correct CLI path.drawio XML file to disk (output dir same as user's working dir)After exporting the draft PNG, use the agent's vision capability (e.g., Claude's image input) to read the image and check for these issues before showing the user. If the agent does not support vision, skip self-check and show the PNG directly:
| Check | What to look for | Auto-fix action |
|-------|-----------------|-----------------|
| Overlapping shapes | Two or more shapes stacked on top of each other | Shift shapes apart by ≥200px |
| Clipped labels | Text cut off at shape boundaries | Increase shape width/height to fit label |
| Missing connections | Arrows that don't visually connect to shapes | Verify source/target ids match existing cells |
| Off-canvas shapes | Shapes at negative coordinates or far from the main group | Move to positive coordinates near the cluster |
| Edge-shape overlap | An edge/arrow visually crosses through an unrelated shape | Add waypoints (<Array as="points">) to route around the shape, or increase spacing between shapes |
| Stacked edges | Multiple edges overlap each other on the same path | Distribute entry/exit points across the shape perimeter (use different exitX/entryX values) |
After self-check, show the exported image and ask the user for feedback.
Targeted edit rules — for each type of feedback, apply the minimal XML change:
| User request | XML edit action |
|-------------|----------------|
| Change color of X | Find mxCell by value matching X, update fillColor/strokeColor in style |
| Add a new node | Append a new mxCell vertex with next available id, position near related nodes |
| Remove a node | Delete the mxCell vertex and any edges with matching source/target |
| Move shape X | Update x/y in the mxGeometry of the matching mxCell |
| Resize shape X | Update width/height in the mxGeometry of the matching mxCell |
| Add arrow from A to B | Append a new mxCell edge with source/target matching A and B ids |
| Change label text | Update the value attribute of the matching mxCell |
| Change layout direction | Full regeneration — rebuild XML with new orientation |
Rules:
{name}.png each iteration — do not create v1, v2, v3 files.drawio file in draw.io desktop for fine-grained adjustmentsOnce the user approves:
.drawio source file and exported image(s).drawio file in draw.io desktop for fine-tuning — open diagram.drawio (macOS), xdg-open (Linux), start (Windows)<?xml version="1.0" encoding="UTF-8"?>
<mxfile host="drawio" version="26.0.0">
<diagram name="Page-1">
<mxGraphModel>
<root>
<mxCell id="0" />
<mxCell id="1" parent="0" />
<!-- user shapes start at id="2" -->
</root>
</mxGraphModel>
</diagram>
</mxfile>
Rules:
id="0" and id="1" are required root cells — never omit themid="2" and increment sequentiallyparent="1" (unless inside a container — then use container's id)html=1 in style for proper rendering-- inside XML comments — it's illegal per XML spec and causes parse errors&, <, >, "
 for line breaks inside value attributes (not literal \n). Example: value="Line 1
Line 2"| Style keyword | Use for |
|--------------|---------|
| rounded=0 | plain rectangle (default) |
| rounded=1 | rounded rectangle — services, modules |
| ellipse; | circles/ovals — start/end, databases |
| rhombus; | diamond — decision points |
| shape=mxgraph.aws4.resourceIcon; | AWS icons |
| shape=cylinder3; | cylinder — databases |
| swimlane; | group/container with title bar |
<!-- Rectangle / rounded box -->
<mxCell id="2" value="Label" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;" vertex="1" parent="1">
<mxGeometry x="100" y="100" width="160" height="60" as="geometry" />
</mxCell>
<!-- Cylinder (database) -->
<mxCell id="3" value="DB" style="shape=cylinder3;whiteSpace=wrap;html=1;fillColor=#f5f5f5;strokeColor=#666666;fontColor=#333333;" vertex="1" parent="1">
<mxGeometry x="350" y="100" width="120" height="80" as="geometry" />
</mxCell>
<!-- Diamond (decision) -->
<mxCell id="4" value="Check?" style="rhombus;whiteSpace=wrap;html=1;fillColor=#fff2cc;strokeColor=#d6b656;" vertex="1" parent="1">
<mxGeometry x="100" y="220" width="160" height="80" as="geometry" />
</mxCell>
For architecture diagrams with nested elements, use draw.io's parent-child containment — do not just place shapes on top of larger shapes.
| Type | Style | When to use |
|------|-------|-------------|
| Group (invisible) | group;pointerEvents=0; | No visual border needed, container has no connections |
| Swimlane (titled) | swimlane;startSize=30; | Container needs a visible title bar, or container itself has connections |
| Custom container | Add container=1;pointerEvents=0; to any shape | Any shape acting as a container without its own connections |
Key rules:
pointerEvents=0; to container styles that should not capture connections between childrenparent="containerId" and use coordinates relative to the container<!-- Swimlane container -->
<mxCell id="svc1" value="User Service" style="swimlane;startSize=30;fillColor=#dae8fc;strokeColor=#6c8ebf;" vertex="1" parent="1">
<mxGeometry x="100" y="100" width="300" height="200" as="geometry"/>
</mxCell>
<!-- Child inside container — coordinates relative to parent -->
<mxCell id="api1" value="REST API" style="rounded=1;whiteSpace=wrap;html=1;" vertex="1" parent="svc1">
<mxGeometry x="20" y="40" width="120" height="60" as="geometry"/>
</mxCell>
<mxCell id="db1" value="Database" style="shape=cylinder3;whiteSpace=wrap;html=1;" vertex="1" parent="svc1">
<mxGeometry x="160" y="40" width="120" height="60" as="geometry"/>
</mxCell>
CRITICAL: Every edge mxCell must contain a <mxGeometry relative="1" as="geometry" /> child element. Self-closing edge cells (<mxCell ... edge="1" ... />) are invalid and will not render. Always use the expanded form.
<!-- Directed arrow — always include rounded, orthogonalLoop, jettySize for clean routing -->
<mxCell id="10" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;" edge="1" parent="1" source="2" target="3">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<!-- Arrow with label + explicit entry/exit points to control direction -->
<mxCell id="11" value="HTTP/REST" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" edge="1" parent="1" source="2" target="4">
<mxGeometry relative="1" as="geometry" />
</mxCell>
<!-- Arrow with waypoints — use when edge must route around other shapes -->
<mxCell id="12" value="" style="edgeStyle=orthogonalEdgeStyle;rounded=1;orthogonalLoop=1;jettySize=auto;html=1;" edge="1" parent="1" source="3" target="5">
<mxGeometry relative="1" as="geometry">
<Array as="points">
<mxPoint x="500" y="50" />
</Array>
</mxGeometry>
</mxCell>
Edge style rules:
flowAnimation=1; to any edge style to show a moving dot animation along the arrow. Works in SVG export and draw.io desktop — ideal for data-flow and pipeline diagrams. Example: style="edgeStyle=orthogonalEdgeStyle;flowAnimation=1;rounded=1;..."rounded=1;orthogonalLoop=1;jettySize=auto — these enable smart routing that avoids overlapslabelBackgroundColor=#FFFFFF; to edges with labels to prevent the connection line from crossing through the text.strokeWidth=1.5 for standard flows and strokeWidth=2 for primary/critical paths to create visual hierarchy.exitX/exitY/entryX/entryY on every edge when a node has 2+ connections — distributes lines across the shape perimeter<Array as="points"> waypoints when an edge must detour around an intermediate shapeWhen multiple edges connect to the same shape, assign different entry/exit points to prevent stacking:
| Position | exitX/entryX | exitY/entryY | Use when | |----------|-------------|-------------|----------| | Top center | 0.5 | 0 | connecting to node above | | Top-left | 0.25 | 0 | 2nd connection from top | | Top-right | 0.75 | 0 | 3rd connection from top | | Right center | 1 | 0.5 | connecting to node on right | | Bottom center | 0.5 | 1 | connecting to node below | | Left center | 0 | 0.5 | connecting to node on left |
Rule: if a shape has N connections on one side, space them evenly (e.g., 3 connections on bottom → exitX = 0.25, 0.5, 0.75)
| Color name | fillColor | strokeColor | Use for |
|-----------|-----------|-------------|---------|
| Zone Gray | #F8F9FA | #D5D5D5 | Background layers/swimlanes (dashed=1; arcSize=2) |
| Active Blue | #DAE8FC | #6C8EBF | Core application/service nodes (shadow=1) |
| Pure White | #FFFFFF | #3788E4 | Premium card nodes (strokeWidth: 1 or 2) |
| Success Green| #D5E8D4 | #82B366 | Databases, validated states, storage |
| Error Red | #F8CECC | #B85450 | Alerts, anomaly flows, external risks |
| Neutral Gray | #F5F5F5 | #B3B3B3 | External systems, legacy components |
To achieve an "industrial-grade" architectural look, apply these refined patterns:
| Feature | Style Attribute / Pattern | Effect |
|---------|---------------------------|--------|
| Zone Background | fillColor=#F8F9FA;dashed=1;arcSize=2; | Subtle, non-distracting logical grouping |
| Zone Title | fontSize=18;fontStyle=1;fontColor=#333333; | High-level navigation (place at top-left of zone) |
| Premium Card | rounded=1;arcSize=12;shadow=1;fillColor=#FFFFFF; | Modern "floating" UI feel |
| Typography | value="<b>TITLE</b><br><font size="1" color="#666666">(Desc)</font>" | Clear information hierarchy |
| Edge Masking | labelBackgroundColor=#FFFFFF; | Mandatory for edge labels to prevent line-text overlap |
| Semantic Flow | strokeColor=#3788E4;strokeWidth=1.5; | Use color-coded lines (Blue: Logic, Green: Data, Red: Alert) |
Spacing — scale with complexity:
| Diagram complexity | Nodes | Horizontal gap | Vertical gap | |-------------------|-------|----------------|--------------| | Simple | ≤5 | 200px | 150px | | Medium | 6–10 | 280px | 200px | | Complex | >10 | 350px | 250px |
Routing corridors: between shape rows/columns, leave an extra ~80px empty corridor where edges can route without crossing shapes. Never place a shape in a gap that edges need to traverse.
Grid alignment: snap all x, y, width, height values to multiples of 10 — this ensures shapes align cleanly on draw.io's default grid and makes manual editing easier.
General rules:
swimlane cells for logical grouping with visible bordersexitX=0.5;exitY=1;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0exitX=1 left side, exitX=0 right side), eliminating all line crossingsexitX=1 or exitX=0) never cross vertical nodes in the same row; use them for peer-to-peer and publish connectionsAvoiding edge-shape overlap:
# macOS — Homebrew (draw.io in PATH)
draw.io -x -f png -e -s 2 -o diagram.drawio.png input.drawio
# macOS — full path (if not in PATH)
/Applications/draw.io.app/Contents/MacOS/draw.io -x -f png -e -s 2 -o diagram.drawio.png input.drawio
# Windows
"C:\Program Files\draw.io\draw.io.exe" -x -f png -e -s 2 -o diagram.drawio.png input.drawio
# Linux (headless — requires xvfb-run)
xvfb-run -a draw.io -x -f png -e -s 2 -o diagram.drawio.png input.drawio
# SVG export
draw.io -x -f svg -o diagram.svg input.drawio
# PDF export
draw.io -x -f pdf -o diagram.pdf input.drawio
Key flags:
-x — export mode (required)-f — format: png, svg, pdf, jpg-e — embed diagram XML in output (PNG, SVG, PDF only) — exported file remains editable in draw.io-s — scale: 1, 2, 3 (2 recommended for PNG)-o — output file path (use .drawio.png double extension when embedding)-b — border width around diagram (default: 0, recommend 10)-t — transparent background (PNG only)--page-index 0 — export specific page (default: all)When the draw.io desktop CLI is unavailable, generate a browser-editable URL by deflate-compressing and base64-encoding the XML:
# Encode .drawio XML into a diagrams.net URL
python3 -c "
import zlib, base64, urllib.parse, sys
xml = open(sys.argv[1]).read()
compressed = zlib.compress(xml.encode('utf-8'), 9)
encoded = base64.urlsafe_b64encode(compressed).decode('utf-8')
print('https://viewer.diagrams.net/?tags=%7B%7D&lightbox=1&edit=_blank#R' + urllib.parse.quote(encoded, safe=''))
" input.drawio
This produces a client-side URL that opens the diagram in the browser for viewing and editing. No data is uploaded to any server — the entire diagram XML is encoded in the URL fragment (after #), which is never sent to the server. Useful when the user cannot install the desktop app.
When tools are unavailable, degrade gracefully:
| Scenario | Behavior |
|----------|----------|
| draw.io CLI missing, Python available | Use browser fallback (diagrams.net URL) |
| draw.io CLI missing, Python missing | Generate .drawio XML only; instruct user to open in draw.io desktop or diagrams.net manually |
| Vision unavailable for self-check | Skip self-check (step 5); proceed directly to showing user the exported PNG |
| Export fails (Chromium/display issues) | On Linux, retry with xvfb-run -a; if still failing, deliver .drawio XML and suggest manual export |
# Try short command first
if command -v draw.io &>/dev/null; then
DRAWIO="draw.io"
elif [ -f "/Applications/draw.io.app/Contents/MacOS/draw.io" ]; then
DRAWIO="/Applications/draw.io.app/Contents/MacOS/draw.io"
else
echo "draw.io not found — install from https://github.com/jgraph/drawio-desktop/releases"
fi
| Mistake | Fix |
|---------|-----|
| Missing id="0" and id="1" root cells | Always include both at the top of <root> |
| Shapes not connected | source and target on edge must match existing shape id values |
| Export command not found on macOS | Try full path /Applications/draw.io.app/Contents/MacOS/draw.io |
| Linux: blank/error output headlessly | Prefix command with xvfb-run -a |
| PDF export fails | Ensure Chromium is available (draw.io bundles it on desktop) |
| Background color wrong in CLI export | Known CLI bug; add --transparent flag or set background via style |
| Overlapping shapes | Scale spacing with complexity (200–350px); leave routing corridors |
| Edges crossing through shapes | Add waypoints, distribute entry/exit points, or increase spacing |
| Special characters in value | Use XML entities: & < > " |
| Iteration loop never ends | After 5 rounds, suggest user open .drawio in draw.io desktop for fine-tuning |
| Self-closing edge mxCell | Always use expanded form with <mxGeometry> child — self-closing edges won't render |
| -- inside XML comments | Illegal per XML spec — use single hyphens or rephrase |
| Arrowhead overlaps bend | Final edge segment before target must be ≥20px — increase spacing or add waypoints |
| Literal \n in label text | Use 
 for line breaks in value attributes |
When the user requests a specific diagram type, apply the matching preset below for shapes, styles, and layout conventions.
| Element | Style | Notes |
|---------|-------|-------|
| Table | shape=table;startSize=30;container=1;collapsible=1;childLayout=tableLayout;fixedRows=1;rowLines=0;fontStyle=1;strokeColor=#6c8ebf;fillColor=#dae8fc; | Each table is a container |
| Row (column) | shape=tableRow;horizontal=0;startSize=0;swimlaneHead=0;swimlaneBody=0;fillColor=none;collapsible=0;dropTarget=0;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;fontSize=12; | Child of table, parent=tableId |
| PK column | Bold text: fontStyle=1 on the row | Mark with PK prefix or key icon |
| FK relationship | Dashed edge: dashed=1;endArrow=ERmandOne;startArrow=ERmandOne; | Use ER notation arrows |
| Layout | TB, tables spaced 300px apart | Group related tables vertically |
| Element | Style | Notes |
|---------|-------|-------|
| Class box | swimlane;fontStyle=1;align=center;startSize=26;html=1; | 3-section: title / attributes / methods |
| Separator | line;strokeWidth=1;fillColor=none;align=left;verticalAlign=middle;spacingTop=-1;spacingLeft=3;spacingRight=10;rotatable=0;labelPosition=left;points=[];portConstraint=eastwest; | Between sections |
| Inheritance | endArrow=block;endFill=0; | Hollow triangle arrow |
| Implementation | endArrow=block;endFill=0;dashed=1; | Dashed + hollow triangle |
| Composition | endArrow=diamondThin;endFill=1; | Filled diamond |
| Aggregation | endArrow=diamondThin;endFill=0; | Hollow diamond |
| Layout | TB, classes 250px apart | Interfaces above implementations |
| Element | Style | Notes |
|---------|-------|-------|
| Actor/Object | shape=umlLifeline;perimeter=lifelinePerimeter;whiteSpace=wrap;html=1;container=1;collapsible=0;recursiveResize=0;outlineConnect=0;portConstraint=eastwest; | Lifeline with dashed vertical line |
| Sync message | html=1;verticalAlign=bottom;endArrow=block; | Solid line, filled arrowhead |
| Async message | html=1;verticalAlign=bottom;endArrow=open;dashed=1; | Dashed line, open arrowhead |
| Return message | html=1;verticalAlign=bottom;endArrow=open;dashed=1;strokeColor=#999999; | Grey dashed |
| Activation box | shape=umlFrame;whiteSpace=wrap; on the lifeline | Narrow rectangle on lifeline |
| Layout | LR, lifelines spaced 200px apart | Time flows top to bottom |
| Element | Style | Notes |
|---------|-------|-------|
| Layer/Tier | rounded=1;dashed=1;fillColor=#F8F9FA;strokeColor=#D5D5D5;arcSize=2; | Use as large background boxes for layers |
| Zone Title | text;strokeColor=none;fillColor=none;fontSize=18;fontStyle=1; | Place inside zone at (x+20, y+10) |
| Service Card | rounded=1;fillColor=#FFFFFF;strokeColor=#3788E4;shadow=1;arcSize=12;strokeWidth=1.5; | The "Industrial" standard for services |
| Database | shape=cylinder3;fillColor=#D5E8D4;strokeColor=#82B366;shadow=1; | Solid green accent for persistence |
| Data Flow | edgeStyle=orthogonalEdgeStyle;rounded=1;strokeWidth=2;strokeColor=#3788E4; | Bold blue for primary flows |
| External Sys | rounded=1;dashed=1;fillColor=#F5F5F5;strokeColor=#B3B3B3; | Desaturated for third-party systems |
For neural network architecture diagrams — ideal for papers targeting NeurIPS, ICML, ICLR.
| Element | Style | Notes |
|---------|-------|-------|
| Layer block | rounded=1;whiteSpace=wrap;html=1; + type color | Main building block |
| Input/Output | fillColor=#d5e8d4;strokeColor=#82b366; | Green |
| Conv / Pooling | fillColor=#dae8fc;strokeColor=#6c8ebf; | Blue |
| Attention / Transformer | fillColor=#e1d5e7;strokeColor=#9673a6; | Purple |
| RNN / LSTM / GRU | fillColor=#fff2cc;strokeColor=#d6b656; | Yellow |
| FC / Linear | fillColor=#ffe6cc;strokeColor=#d79b00; | Orange |
| Loss / Activation | fillColor=#f8cecc;strokeColor=#b85450; | Red/Pink |
| Skip connection | dashed=1;endArrow=block;curved=1; | Dashed curved arrow |
| Tensor shape label | Add shape annotation as secondary label: value="Conv2D
(B, 64, 32, 32)" | Use 
 for multi-line |
| Layout | TB (data flows top→bottom), layers 150px apart | Group encoder/decoder as swimlanes |
Tensor shape convention: annotate each layer with input/output tensor dimensions in (B, C, H, W) or (B, T, D) format. Place dimensions as the second line of the label using 
.
| Element | Style | Notes |
|---------|-------|-------|
| Start/End | ellipse;whiteSpace=wrap;html=1;fillColor=#d5e8d4;strokeColor=#82b366; | Green oval |
| Process | rounded=0;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf; | Blue rectangle |
| Decision | rhombus;whiteSpace=wrap;html=1;fillColor=#fff2cc;strokeColor=#d6b656; | Yellow diamond |
| I/O | shape=parallelogram;perimeter=parallelogramPerimeter;whiteSpace=wrap;html=1;fillColor=#ffe6cc;strokeColor=#d79b00; | Orange parallelogram |
| Subprocess | rounded=0;whiteSpace=wrap;html=1;fillColor=#e1d5e7;strokeColor=#9673a6; + double border | Purple |
| Yes/No labels | value="Yes" / value="No" on decision edges | Always label decision branches |
| Layout | TB, 200px vertical gap | Decisions branch LR, merge back to center |
tools
天帆 (Vela) 需求入库 - 将需求录入 product/01_inbox/,自动分配编号、创建目录结构、更新索引。 触发场景:用户说"入库"、"新增需求"、"记录需求"、"需求入库"、"把这个需求录进去"、"登记需求"、"需求登记", 或者用户附带了一个需求文件并说"入库"/"录入"/"记录"。 即使用户只说"入库"或"把刚才说的需求录进去"也应触发此 Skill。 注意:用户可能在多轮对话中先描述需求,最后才说"入库",需要回溯对话提取需求内容。
data-ai
天帆 (Vela) AI 原生产研平台 - 项目初始化。当用户想要初始化新项目、创建项目目录结构、搭建 AI-Native SDLC 项目骨架时使用。 关键词触发:初始化项目、新建项目、vela init、项目骨架、创建项目结构、project init、scaffold project、AI 原生项目。 即使用户只说"帮我建个新项目"或"按 vela 结构初始化"也应触发此 Skill。
testing
This skill should be used when the user explicitly says "Nothing style", "Nothing design", "/nothing-design", or directly asks to use/apply the Nothing design system. NEVER trigger automatically for generic UI or design tasks. It provides guidance and templates for generating diagrams using the minimalist, industrial aesthetic of the Nothing design language.
testing
Generate editorial-style diagrams in the Anthropic blog visual style as .drawio files. Use this skill whenever the user wants to create a diagram, flowchart, architecture diagram, comparison chart, swimlane, or any visual that should look like Anthropic's blog article illustrations. Trigger on prompts like "draw a diagram", "create a flowchart", "visualize this process", "make an architecture diagram", "画流程图", "画架构图", "帮我画", or any request to turn text/process descriptions into a visual — even if the user doesn't say "Anthropic style" explicitly. This skill produces the calm, editorial, publication-quality look characteristic of Anthropic's technical blog.