Excalidraw Diagrams
Create hand-drawn style diagrams, flowcharts, architecture diagrams, and mind maps using the Excalidraw format. Diagrams are rendered interactively in the Canvas panel.
When to Use This Skill
Use create_excalidraw_diagram when the user wants to visualize structure, flow, or relationships — not raw numbers.
| Use this skill for... |
Use visualization skill for... |
| System architecture diagram |
Sales figures by quarter |
| Flowchart or decision tree |
Survey response percentages |
| Sequence / interaction diagram |
Stock price over time |
| Mind map or concept map |
Market share breakdown |
| Shapes, boxes, arrows, labels |
Any x/y or segment/value data |
Diagram Type
Choose based on user intent. For Swimlane, Class, Sequence, ER, and DFD diagrams, read diagram-patterns.md before generating.
| Intent |
Type |
Pattern |
| Process steps, workflow, decisions |
Flowchart |
Rectangles + diamonds + arrows (see Example) |
| System components, dependencies |
Architecture |
Zone rectangles + boxes + arrows |
| Concept hierarchy, brainstorming |
Mind Map |
Center node + radial branch arrows |
| Entity connections, associations |
Relationship |
Boxes + labeled arrows |
| Cross-functional workflow, actor responsibilities |
Swimlane |
diagram-patterns.md |
| OOP class structure, inheritance |
Class Diagram |
diagram-patterns.md |
| Object interactions over time |
Sequence Diagram |
diagram-patterns.md |
| Database entities and relationships |
ER Diagram |
diagram-patterns.md |
| Data transformation, data movement |
DFD |
diagram-patterns.md |
Available Tools
- create_excalidraw_diagram(elements, title, background_color): Generate a diagram from Excalidraw element JSON
Color Palette
Use these colors consistently across all diagrams.
Primary Colors (strokes, arrows, text)
| Name |
Hex |
Use |
| Blue |
#4a9eed |
Primary actions, links |
| Amber |
#f59e0b |
Warnings, highlights |
| Green |
#22c55e |
Success, positive |
| Red |
#ef4444 |
Errors, negative |
| Purple |
#8b5cf6 |
Accents, special items |
| Cyan |
#06b6d4 |
Info, secondary |
Fill Colors (shape backgrounds)
| Color |
Hex |
Good For |
| Light Blue |
#a5d8ff |
Input, sources, primary nodes |
| Light Green |
#b2f2bb |
Success, output, completed |
| Light Orange |
#ffd8a8 |
Warning, pending, external |
| Light Purple |
#d0bfff |
Processing, middleware |
| Light Red |
#ffc9c9 |
Error, critical |
| Light Yellow |
#fff3bf |
Notes, decisions |
| Light Teal |
#c3fae8 |
Storage, data |
Background Zone Colors (use with opacity: 35 for layer grouping)
| Color |
Hex |
Good For |
| Blue zone |
#dbe4ff |
UI / frontend layer |
| Purple zone |
#e5dbff |
Logic / agent layer |
| Green zone |
#d3f9d8 |
Data / tool layer |
Element Format
Required Fields (all elements)
type, id (unique string), x, y, width, height
Defaults (skip if using these values)
strokeColor="#1e1e1e", backgroundColor="transparent", fillStyle="solid", strokeWidth=2, roughness=1, opacity=100
Shape Types
Rectangle
{ "type": "rectangle", "id": "r1", "x": 100, "y": 100, "width": 200, "height": 80,
"roundness": { "type": 3 }, "backgroundColor": "#a5d8ff", "fillStyle": "solid" }
roundness: { type: 3 } for rounded corners
Ellipse
{ "type": "ellipse", "id": "e1", "x": 100, "y": 100, "width": 150, "height": 150 }
Diamond
{ "type": "diamond", "id": "d1", "x": 100, "y": 100, "width": 150, "height": 150 }
Label on shape (PREFERRED — no separate text element needed)
{ "type": "rectangle", "id": "r1", "x": 100, "y": 100, "width": 200, "height": 80,
"label": { "text": "My Label", "fontSize": 20 } }
- Works on rectangle, ellipse, diamond
- Text auto-centers; container auto-resizes to fit
- Also works on arrows:
"label": { "text": "connects" }
Standalone Text (titles, annotations only)
{ "type": "text", "id": "t1", "x": 150, "y": 50, "text": "Title", "fontSize": 24 }
x is the LEFT edge. To center at position cx: set x = cx - text.length × fontSize × 0.25
Arrow
{ "type": "arrow", "id": "a1", "x": 300, "y": 150, "width": 150, "height": 0,
"points": [[0,0],[150,0]], "endArrowhead": "arrow",
"startBinding": { "elementId": "r1", "fixedPoint": [1, 0.5] },
"endBinding": { "elementId": "r2", "fixedPoint": [0, 0.5] } }
points: [dx, dy] offsets from element x, y
endArrowhead: null | "arrow" | "bar" | "dot" | "triangle"
strokeStyle: "solid" | "dashed" | "dotted"
fixedPoint for bindings: top [0.5,0], bottom [0.5,1], left [0,0.5], right [1,0.5]
Pseudo-Elements (not drawn — control behavior)
cameraUpdate — sets the viewport
{ "type": "cameraUpdate", "width": 800, "height": 600, "x": 0, "y": 0 }
x, y: top-left corner of visible area (scene coordinates)
- Must be 4:3 ratio: 400×300, 600×450, 800×600, 1200×900, 1600×1200
- ALWAYS place a
cameraUpdate as the first element to frame the diagram
- No
id needed
delete — removes elements by ID
{ "type": "delete", "ids": "r1,a1,t2" }
- Comma-separated element IDs to remove
- Use when updating an existing diagram to remove elements before adding replacements
- Never reuse a deleted ID — assign new IDs to replacements
Camera Sizing Guide
The diagram displays at ~700px width. Use these standard sizes:
| Size |
Width × Height |
Use When |
| S |
400 × 300 |
2–3 elements, close-up |
| M |
600 × 450 |
Small diagram section |
| L |
800 × 600 |
Standard (default) |
| XL |
1200 × 900 |
Large overview |
| XXL |
1600 × 1200 |
Very complex diagrams |
Font size rules:
- Body text / labels: minimum 16
- Titles / headings: minimum 20
- Annotations: minimum 14 (use sparingly)
- At XL/XXL camera: increase minimums by ~4px
Element sizing rules:
- Labeled rectangles/ellipses: minimum 120 × 60
- Leave 20–30px gaps between elements
Updating an Existing Diagram
When the user asks to modify a diagram, you will receive the current elements in context. Respond with the complete updated elements array:
- Keep the same
id for unchanged elements
- Modify fields on elements you want to change
- Omit elements you want to remove
- Add new elements with unique IDs not used before
Example: Flowchart
[
{ "type": "cameraUpdate", "width": 800, "height": 600, "x": 0, "y": 0 },
{ "type": "rectangle", "id": "el-1",
"x": 300, "y": 60, "width": 160, "height": 60,
"strokeColor": "#4a9eed", "backgroundColor": "#a5d8ff",
"fillStyle": "solid", "roundness": { "type": 3 },
"label": { "text": "Start", "fontSize": 18 } },
{ "type": "diamond", "id": "el-2",
"x": 280, "y": 170, "width": 200, "height": 90,
"strokeColor": "#f59e0b", "backgroundColor": "#fff3bf",
"fillStyle": "solid",
"label": { "text": "Decision?", "fontSize": 16 } },
{ "type": "arrow", "id": "el-3",
"x": 380, "y": 120, "width": 0, "height": 50,
"points": [[0,0],[0,50]], "endArrowhead": "arrow",
"startBinding": { "elementId": "el-1", "fixedPoint": [0.5, 1] },
"endBinding": { "elementId": "el-2", "fixedPoint": [0.5, 0] } },
{ "type": "rectangle", "id": "el-4",
"x": 300, "y": 320, "width": 160, "height": 60,
"strokeColor": "#22c55e", "backgroundColor": "#b2f2bb",
"fillStyle": "solid", "roundness": { "type": 3 },
"label": { "text": "End", "fontSize": 18 } },
{ "type": "arrow", "id": "el-5",
"x": 380, "y": 260, "width": 0, "height": 60,
"points": [[0,0],[0,60]], "endArrowhead": "arrow",
"startBinding": { "elementId": "el-2", "fixedPoint": [0.5, 1] },
"endBinding": { "elementId": "el-4", "fixedPoint": [0.5, 0] } }
]
Common Mistakes to Avoid
- Camera must use exact 4:3 ratios — non-4:3 viewports cause distortion
- Always start with cameraUpdate — without it the viewport is unpredictable
- No comments in element arrays —
elements must be valid JSON. Never add // or /* */ comments inside the array; they break JSON parsing
- Text contrast — never use light gray on white. Minimum text color on white:
#757575. For text on light fills use dark variants (#15803d not #22c55e)
- Arrow labels need space — long labels overflow short arrows; keep labels short or widen arrows
- No emoji — Excalidraw's font does not render emoji
- Element overlap — check that labels, boxes, and zone overlays don't stack on each other (minimum 20px gap)
- Camera padding — leave padding inside the camera frame; don't match camera size exactly to content size
UI Guidance (from tools-config)
Element Format:
- Required: type, x, y, id
- Shapes (rectangle/ellipse/diamond): add width, height
- Arrows/lines: add width, height, points [[0,0],[dx,dy]]
- Text: add text, fontSize
- Use label field on shapes for centered text
- Connect shapes with arrow elements using points routing
1---2name: excalidraw3description: Create hand-drawn style diagrams and flowcharts using Excalidraw4type: tool5metadata:6 source: https://skillmd.com/skills/bouclem/excalidraw7---89# Excalidraw Diagrams1011Create hand-drawn style diagrams, flowcharts, architecture diagrams, and mind maps using the Excalidraw format. Diagrams are rendered interactively in the Canvas panel.1213## When to Use This Skill1415Use `create_excalidraw_diagram` when the user wants to visualize **structure, flow, or relationships** — not raw numbers.1617| Use this skill for... | Use visualization skill for... |18|-----------------------|--------------------------------|19| System architecture diagram | Sales figures by quarter |20| Flowchart or decision tree | Survey response percentages |21| Sequence / interaction diagram | Stock price over time |22| Mind map or concept map | Market share breakdown |23| Shapes, boxes, arrows, labels | Any x/y or segment/value data |2425## Diagram Type2627Choose based on user intent. For Swimlane, Class, Sequence, ER, and DFD diagrams, read [diagram-patterns.md](diagram-patterns.md) before generating.2829| Intent | Type | Pattern |30|--------|------|---------|31| Process steps, workflow, decisions | Flowchart | Rectangles + diamonds + arrows (see Example) |32| System components, dependencies | Architecture | Zone rectangles + boxes + arrows |33| Concept hierarchy, brainstorming | Mind Map | Center node + radial branch arrows |34| Entity connections, associations | Relationship | Boxes + labeled arrows |35| Cross-functional workflow, actor responsibilities | Swimlane | [diagram-patterns.md](diagram-patterns.md) |36| OOP class structure, inheritance | Class Diagram | [diagram-patterns.md](diagram-patterns.md) |37| Object interactions over time | Sequence Diagram | [diagram-patterns.md](diagram-patterns.md) |38| Database entities and relationships | ER Diagram | [diagram-patterns.md](diagram-patterns.md) |39| Data transformation, data movement | DFD | [diagram-patterns.md](diagram-patterns.md) |4041## Available Tools4243- **create_excalidraw_diagram(elements, title, background_color)**: Generate a diagram from Excalidraw element JSON4445## Color Palette4647Use these colors consistently across all diagrams.4849### Primary Colors (strokes, arrows, text)50| Name | Hex | Use |51|------|-----|-----|52| Blue | `#4a9eed` | Primary actions, links |53| Amber | `#f59e0b` | Warnings, highlights |54| Green | `#22c55e` | Success, positive |55| Red | `#ef4444` | Errors, negative |56| Purple | `#8b5cf6` | Accents, special items |57| Cyan | `#06b6d4` | Info, secondary |5859### Fill Colors (shape backgrounds)60| Color | Hex | Good For |61|-------|-----|----------|62| Light Blue | `#a5d8ff` | Input, sources, primary nodes |63| Light Green | `#b2f2bb` | Success, output, completed |64| Light Orange | `#ffd8a8` | Warning, pending, external |65| Light Purple | `#d0bfff` | Processing, middleware |66| Light Red | `#ffc9c9` | Error, critical |67| Light Yellow | `#fff3bf` | Notes, decisions |68| Light Teal | `#c3fae8` | Storage, data |6970### Background Zone Colors (use with `opacity: 35` for layer grouping)71| Color | Hex | Good For |72|-------|-----|----------|73| Blue zone | `#dbe4ff` | UI / frontend layer |74| Purple zone | `#e5dbff` | Logic / agent layer |75| Green zone | `#d3f9d8` | Data / tool layer |7677## Element Format7879### Required Fields (all elements)80`type`, `id` (unique string), `x`, `y`, `width`, `height`8182### Defaults (skip if using these values)83`strokeColor="#1e1e1e"`, `backgroundColor="transparent"`, `fillStyle="solid"`, `strokeWidth=2`, `roughness=1`, `opacity=100`8485### Shape Types8687**Rectangle**88```json89{ "type": "rectangle", "id": "r1", "x": 100, "y": 100, "width": 200, "height": 80,90 "roundness": { "type": 3 }, "backgroundColor": "#a5d8ff", "fillStyle": "solid" }91```92- `roundness: { type: 3 }` for rounded corners9394**Ellipse**95```json96{ "type": "ellipse", "id": "e1", "x": 100, "y": 100, "width": 150, "height": 150 }97```9899**Diamond**100```json101{ "type": "diamond", "id": "d1", "x": 100, "y": 100, "width": 150, "height": 150 }102```103104**Label on shape (PREFERRED — no separate text element needed)**105```json106{ "type": "rectangle", "id": "r1", "x": 100, "y": 100, "width": 200, "height": 80,107 "label": { "text": "My Label", "fontSize": 20 } }108```109- Works on rectangle, ellipse, diamond110- Text auto-centers; container auto-resizes to fit111- Also works on arrows: `"label": { "text": "connects" }`112113**Standalone Text** (titles, annotations only)114```json115{ "type": "text", "id": "t1", "x": 150, "y": 50, "text": "Title", "fontSize": 24 }116```117- `x` is the LEFT edge. To center at position `cx`: set `x = cx - text.length × fontSize × 0.25`118119**Arrow**120```json121{ "type": "arrow", "id": "a1", "x": 300, "y": 150, "width": 150, "height": 0,122 "points": [[0,0],[150,0]], "endArrowhead": "arrow",123 "startBinding": { "elementId": "r1", "fixedPoint": [1, 0.5] },124 "endBinding": { "elementId": "r2", "fixedPoint": [0, 0.5] } }125```126- `points`: `[dx, dy]` offsets from element `x, y`127- `endArrowhead`: `null` | `"arrow"` | `"bar"` | `"dot"` | `"triangle"`128- `strokeStyle`: `"solid"` | `"dashed"` | `"dotted"`129- `fixedPoint` for bindings: top `[0.5,0]`, bottom `[0.5,1]`, left `[0,0.5]`, right `[1,0.5]`130131### Pseudo-Elements (not drawn — control behavior)132133**cameraUpdate** — sets the viewport134```json135{ "type": "cameraUpdate", "width": 800, "height": 600, "x": 0, "y": 0 }136```137- `x, y`: top-left corner of visible area (scene coordinates)138- **Must be 4:3 ratio**: 400×300, 600×450, 800×600, 1200×900, 1600×1200139- ALWAYS place a `cameraUpdate` as the **first element** to frame the diagram140- No `id` needed141142**delete** — removes elements by ID143```json144{ "type": "delete", "ids": "r1,a1,t2" }145```146- Comma-separated element IDs to remove147- Use when updating an existing diagram to remove elements before adding replacements148- Never reuse a deleted ID — assign new IDs to replacements149150## Camera Sizing Guide151152The diagram displays at ~700px width. Use these standard sizes:153154| Size | Width × Height | Use When |155|------|---------------|----------|156| S | 400 × 300 | 2–3 elements, close-up |157| M | 600 × 450 | Small diagram section |158| **L** | **800 × 600** | **Standard (default)** |159| XL | 1200 × 900 | Large overview |160| XXL | 1600 × 1200 | Very complex diagrams |161162**Font size rules:**163- Body text / labels: **minimum 16**164- Titles / headings: **minimum 20**165- Annotations: minimum 14 (use sparingly)166- At XL/XXL camera: increase minimums by ~4px167168**Element sizing rules:**169- Labeled rectangles/ellipses: minimum 120 × 60170- Leave 20–30px gaps between elements171172## Updating an Existing Diagram173174When the user asks to modify a diagram, you will receive the current elements in context. Respond with the complete updated elements array:175- Keep the same `id` for unchanged elements176- Modify fields on elements you want to change177- Omit elements you want to remove178- Add new elements with unique IDs not used before179180## Example: Flowchart181182```json183[184 { "type": "cameraUpdate", "width": 800, "height": 600, "x": 0, "y": 0 },185 { "type": "rectangle", "id": "el-1",186 "x": 300, "y": 60, "width": 160, "height": 60,187 "strokeColor": "#4a9eed", "backgroundColor": "#a5d8ff",188 "fillStyle": "solid", "roundness": { "type": 3 },189 "label": { "text": "Start", "fontSize": 18 } },190 { "type": "diamond", "id": "el-2",191 "x": 280, "y": 170, "width": 200, "height": 90,192 "strokeColor": "#f59e0b", "backgroundColor": "#fff3bf",193 "fillStyle": "solid",194 "label": { "text": "Decision?", "fontSize": 16 } },195 { "type": "arrow", "id": "el-3",196 "x": 380, "y": 120, "width": 0, "height": 50,197 "points": [[0,0],[0,50]], "endArrowhead": "arrow",198 "startBinding": { "elementId": "el-1", "fixedPoint": [0.5, 1] },199 "endBinding": { "elementId": "el-2", "fixedPoint": [0.5, 0] } },200 { "type": "rectangle", "id": "el-4",201 "x": 300, "y": 320, "width": 160, "height": 60,202 "strokeColor": "#22c55e", "backgroundColor": "#b2f2bb",203 "fillStyle": "solid", "roundness": { "type": 3 },204 "label": { "text": "End", "fontSize": 18 } },205 { "type": "arrow", "id": "el-5",206 "x": 380, "y": 260, "width": 0, "height": 60,207 "points": [[0,0],[0,60]], "endArrowhead": "arrow",208 "startBinding": { "elementId": "el-2", "fixedPoint": [0.5, 1] },209 "endBinding": { "elementId": "el-4", "fixedPoint": [0.5, 0] } }210]211```212213## Common Mistakes to Avoid214215- **Camera must use exact 4:3 ratios** — non-4:3 viewports cause distortion216- **Always start with cameraUpdate** — without it the viewport is unpredictable217- **No comments in element arrays** — `elements` must be valid JSON. Never add `//` or `/* */` comments inside the array; they break JSON parsing218- **Text contrast** — never use light gray on white. Minimum text color on white: `#757575`. For text on light fills use dark variants (`#15803d` not `#22c55e`)219- **Arrow labels need space** — long labels overflow short arrows; keep labels short or widen arrows220- **No emoji** — Excalidraw's font does not render emoji221- **Element overlap** — check that labels, boxes, and zone overlays don't stack on each other (minimum 20px gap)222- **Camera padding** — leave padding inside the camera frame; don't match camera size exactly to content size223224## UI Guidance (from tools-config)225226**Element Format:**227- Required: type, x, y, id228- Shapes (rectangle/ellipse/diamond): add width, height229- Arrows/lines: add width, height, points [[0,0],[dx,dy]]230- Text: add text, fontSize231- Use label field on shapes for centered text232- Connect shapes with arrow elements using points routing