excalidraw-ai
Generate Excalidraw diagrams by writing JSON directly. No templates needed - you have full control over every element.
When to Use This Skill
Use this skill when you need to:
- Create architecture diagrams, flowcharts, or mind maps
- Visualize system designs, data flows, or processes
- Generate diagrams from code analysis or documentation
- Create custom diagrams with precise control over layout and styling
Excalidraw JSON Schema
An Excalidraw file is a JSON object with this structure:
{
"type": "excalidraw",
"version": 2,
"source": "https://excalidraw.com",
"elements": [ /* array of element objects */ ],
"appState": {
"viewBackgroundColor": "#ffffff",
"gridSize": null
},
"files": {}
}
Element Types
Rectangle
{
"id": "unique-id-1",
"type": "rectangle",
"x": 100,
"y": 100,
"width": 200,
"height": 100,
"strokeColor": "#1971c2",
"backgroundColor": "#a5d8ff",
"fillStyle": "solid",
"strokeWidth": 2,
"strokeStyle": "solid",
"roughness": 1,
"opacity": 100,
"groupIds": [],
"angle": 0,
"seed": 12345,
"isDeleted": false
}
Ellipse
{
"id": "unique-id-2",
"type": "ellipse",
"x": 100,
"y": 100,
"width": 150,
"height": 100,
"strokeColor": "#7c3aed",
"backgroundColor": "#ede9fe",
"fillStyle": "solid",
"strokeWidth": 2,
"roughness": 1
}
Diamond
{
"id": "unique-id-3",
"type": "diamond",
"x": 100,
"y": 100,
"width": 120,
"height": 120,
"strokeColor": "#dc2626",
"backgroundColor": "#fee2e2",
"fillStyle": "solid"
}
Text
{
"id": "unique-id-4",
"type": "text",
"x": 110,
"y": 140,
"width": 180,
"height": 25,
"text": "Your Label Here",
"fontSize": 20,
"fontFamily": 1,
"textAlign": "center",
"verticalAlign": "middle",
"strokeColor": "#1e1e1e",
"backgroundColor": "transparent"
}
Arrow
{
"id": "unique-id-5",
"type": "arrow",
"x": 300,
"y": 150,
"width": 100,
"height": 50,
"strokeColor": "#1971c2",
"strokeWidth": 2,
"points": [[0, 0], [100, 50]],
"startBinding": {
"elementId": "source-element-id",
"focus": 0.5,
"gap": 5
},
"endBinding": {
"elementId": "target-element-id",
"focus": 0.5,
"gap": 5
},
"startArrowhead": null,
"endArrowhead": "arrow"
}
Line
{
"id": "unique-id-6",
"type": "line",
"x": 100,
"y": 100,
"width": 200,
"height": 0,
"strokeColor": "#868e96",
"strokeWidth": 1,
"points": [[0, 0], [200, 0]],
"startArrowhead": null,
"endArrowhead": null
}
Element Properties Reference
| Property |
Type |
Description |
id |
string |
Unique identifier (use UUID or similar) |
type |
string |
rectangle, ellipse, diamond, text, arrow, line |
x, y |
number |
Position coordinates |
width, height |
number |
Dimensions |
strokeColor |
string |
Border/stroke color (hex) |
backgroundColor |
string |
Fill color (hex) or "transparent" |
fillStyle |
string |
"solid", "hachure", "cross-hatch" |
strokeWidth |
number |
Line thickness (1, 2, 4) |
strokeStyle |
string |
"solid", "dashed", "dotted" |
roughness |
number |
0 = sharp, 1 = normal, 2 = sketchy |
opacity |
number |
0-100 |
angle |
number |
Rotation in radians |
groupIds |
array |
Group element IDs together |
seed |
number |
Random seed for hand-drawn effect |
Text Properties
| Property |
Type |
Description |
text |
string |
The text content |
fontSize |
number |
Font size in pixels |
fontFamily |
number |
1 = Virgil (hand-drawn), 2 = Helvetica, 3 = Cascadia |
textAlign |
string |
"left", "center", "right" |
verticalAlign |
string |
"top", "middle" |
Arrow Properties
| Property |
Type |
Description |
points |
array |
Array of [x, y] coordinates relative to element origin |
startBinding |
object |
Connection to source element |
endBinding |
object |
Connection to target element |
startArrowhead |
string |
null, "arrow", "bar", "dot", "triangle" |
endArrowhead |
string |
null, "arrow", "bar", "dot", "triangle" |
Color Palette Reference
Component-Based Colors (Recommended for Architecture Diagrams)
| Component Type |
Stroke |
Background |
Use For |
| Database |
#7c3aed |
#ede9fe |
PostgreSQL, MySQL, MongoDB |
| Cache |
#dc2626 |
#fee2e2 |
Redis, Memcached |
| Queue |
#16a34a |
#dcfce7 |
Kafka, RabbitMQ, SQS |
| Load Balancer |
#0891b2 |
#cffafe |
Nginx, HAProxy, ALB |
| Gateway |
#475569 |
#f1f5f9 |
API Gateway, Kong |
| CDN |
#06b6d4 |
#e0f2fe |
CloudFront, Fastly |
| Auth |
#e11d48 |
#ffe4e6 |
OAuth, IAM, Cognito |
| Storage |
#d97706 |
#fef3c7 |
S3, Blob Storage |
| Service |
#2563eb |
#dbeafe |
Backend services, APIs |
| Container |
#0284c7 |
#bae6fd |
Docker, Kubernetes |
| Function |
#f59e0b |
#fef3c7 |
Lambda, Serverless |
| Monitoring |
#84cc16 |
#ecfccb |
Prometheus, Grafana |
| Web App |
#4f46e5 |
#e0e7ff |
React, Vue, Frontend |
| Mobile |
#6366f1 |
#eef2ff |
iOS, Android |
Theme Colors
Modern (Default)
- Primary:
#1971c2 / #e7f5ff
- Neutral:
#64748b / #f1f5f9
Sketchy (Hand-drawn)
- Primary:
#495057 / #f8f9fa
- Use
roughness: 2 and fontFamily: 3
Technical
- Primary:
#2f9e44 / #ebfbee
- Use
strokeStyle: "dashed" for connections
Icon Libraries (305 Components Total)
Professional icons are available in .excalidrawlib files in the assets/ directory:
| Library |
Components |
Content |
aws-architecture-icons.excalidrawlib |
248 |
AWS service icons (Lambda, S3, EC2, RDS, DynamoDB, SQS, etc.) |
system-design.excalidrawlib |
24 |
System design elements (server, database, storage, etc.) |
drwnio.excalidrawlib |
18 |
Draw.io style icons |
system-design-template.excalidrawlib |
8 |
Pre-built templates (steps, flow, db, etc.) |
software-architecture.excalidrawlib |
7 |
Software architecture components |
Using Library Components
Library files contain element arrays that can be embedded directly into your diagram. Each library item is an array of Excalidraw elements that form a component.
To use: Parse the library JSON, find the component you need, adjust positions, and include in your diagram's elements array.
Layout Guidelines
Architecture Diagram Layout
Organize components in layers (top to bottom):
Layer 1: Client/External (y: 100)
Layer 2: Edge/CDN (y: 280)
Layer 3: Gateway/Load Balancer (y: 460)
Layer 4: Services (y: 640)
Layer 5: Data/Cache (y: 820)
Layer 6: Infrastructure (y: 1000)
Spacing recommendations:
- Horizontal spacing between components: 240px
- Vertical spacing between layers: 180px
- Component width: 180-220px
- Component height: 80-100px
Flowchart Layout
Arrange left-to-right or top-to-bottom:
- Step spacing: 200px
- Use rectangles for processes
- Use diamonds for decisions
- Use ellipses for start/end
Mind Map Layout
Radial layout from center:
- Center node at (400, 300)
- Child nodes at radius 250px
- Distribute evenly using angle calculations
Complete Example
{
"type": "excalidraw",
"version": 2,
"source": "https://excalidraw.com",
"elements": [
{
"id": "api-gateway",
"type": "rectangle",
"x": 100,
"y": 100,
"width": 180,
"height": 80,
"strokeColor": "#475569",
"backgroundColor": "#f1f5f9",
"fillStyle": "solid",
"strokeWidth": 2,
"roughness": 0,
"opacity": 100,
"groupIds": ["group-1"],
"seed": 1234
},
{
"id": "api-gateway-label",
"type": "text",
"x": 140,
"y": 130,
"width": 100,
"height": 25,
"text": "API Gateway",
"fontSize": 16,
"fontFamily": 1,
"textAlign": "center",
"strokeColor": "#1e1e1e",
"groupIds": ["group-1"]
},
{
"id": "redis",
"type": "diamond",
"x": 100,
"y": 280,
"width": 180,
"height": 100,
"strokeColor": "#dc2626",
"backgroundColor": "#fee2e2",
"fillStyle": "solid",
"strokeWidth": 2,
"roughness": 0,
"seed": 5678
},
{
"id": "redis-label",
"type": "text",
"x": 155,
"y": 320,
"width": 70,
"height": 20,
"text": "Redis",
"fontSize": 16,
"fontFamily": 1,
"textAlign": "center",
"strokeColor": "#1e1e1e"
},
{
"id": "arrow-1",
"type": "arrow",
"x": 190,
"y": 180,
"width": 0,
"height": 100,
"strokeColor": "#64748b",
"strokeWidth": 2,
"points": [[0, 0], [0, 100]],
"startBinding": {"elementId": "api-gateway", "focus": 0.5, "gap": 5},
"endBinding": {"elementId": "redis", "focus": 0.5, "gap": 5},
"endArrowhead": "arrow"
}
],
"appState": {
"viewBackgroundColor": "#ffffff",
"gridSize": null
},
"files": {}
}
Output
Save your diagram as a .excalidraw or .json file. It can be:
- Imported directly into excalidraw.com
- Embedded in documentation or web apps
- Converted to PNG/SVG using Excalidraw's export features
Tips for AI Agents
- Generate unique IDs: Use UUIDs or sequential IDs for each element
- Group related elements: Use
groupIds to keep shapes and their labels together
- Use bindings for arrows: Connect arrows to elements using
startBinding and endBinding
- Apply consistent styling: Use the color palette for component types
- Calculate text positions: Center text within shapes by adjusting x/y based on text length
- Set seed values: Use
seed: hash(id) for consistent hand-drawn rendering
Converted and distributed by TomeVault — claim your Tome and manage your conversions.
1---2name: jiatastic-open-python-skills-excalidraw-ai3description: excalidraw-ai4---56# excalidraw-ai78Generate Excalidraw diagrams by writing JSON directly. No templates needed - you have full control over every element.910## When to Use This Skill1112Use this skill when you need to:13- Create architecture diagrams, flowcharts, or mind maps14- Visualize system designs, data flows, or processes15- Generate diagrams from code analysis or documentation16- Create custom diagrams with precise control over layout and styling1718## Excalidraw JSON Schema1920An Excalidraw file is a JSON object with this structure:2122```json23{24 "type": "excalidraw",25 "version": 2,26 "source": "https://excalidraw.com",27 "elements": [ /* array of element objects */ ],28 "appState": {29 "viewBackgroundColor": "#ffffff",30 "gridSize": null31 },32 "files": {}33}34```3536### Element Types3738#### Rectangle39```json40{41 "id": "unique-id-1",42 "type": "rectangle",43 "x": 100,44 "y": 100,45 "width": 200,46 "height": 100,47 "strokeColor": "#1971c2",48 "backgroundColor": "#a5d8ff",49 "fillStyle": "solid",50 "strokeWidth": 2,51 "strokeStyle": "solid",52 "roughness": 1,53 "opacity": 100,54 "groupIds": [],55 "angle": 0,56 "seed": 12345,57 "isDeleted": false58}59```6061#### Ellipse62```json63{64 "id": "unique-id-2",65 "type": "ellipse",66 "x": 100,67 "y": 100,68 "width": 150,69 "height": 100,70 "strokeColor": "#7c3aed",71 "backgroundColor": "#ede9fe",72 "fillStyle": "solid",73 "strokeWidth": 2,74 "roughness": 175}76```7778#### Diamond79```json80{81 "id": "unique-id-3",82 "type": "diamond",83 "x": 100,84 "y": 100,85 "width": 120,86 "height": 120,87 "strokeColor": "#dc2626",88 "backgroundColor": "#fee2e2",89 "fillStyle": "solid"90}91```9293#### Text94```json95{96 "id": "unique-id-4",97 "type": "text",98 "x": 110,99 "y": 140,100 "width": 180,101 "height": 25,102 "text": "Your Label Here",103 "fontSize": 20,104 "fontFamily": 1,105 "textAlign": "center",106 "verticalAlign": "middle",107 "strokeColor": "#1e1e1e",108 "backgroundColor": "transparent"109}110```111112#### Arrow113```json114{115 "id": "unique-id-5",116 "type": "arrow",117 "x": 300,118 "y": 150,119 "width": 100,120 "height": 50,121 "strokeColor": "#1971c2",122 "strokeWidth": 2,123 "points": [[0, 0], [100, 50]],124 "startBinding": {125 "elementId": "source-element-id",126 "focus": 0.5,127 "gap": 5128 },129 "endBinding": {130 "elementId": "target-element-id",131 "focus": 0.5,132 "gap": 5133 },134 "startArrowhead": null,135 "endArrowhead": "arrow"136}137```138139#### Line140```json141{142 "id": "unique-id-6",143 "type": "line",144 "x": 100,145 "y": 100,146 "width": 200,147 "height": 0,148 "strokeColor": "#868e96",149 "strokeWidth": 1,150 "points": [[0, 0], [200, 0]],151 "startArrowhead": null,152 "endArrowhead": null153}154```155156### Element Properties Reference157158| Property | Type | Description |159|----------|------|-------------|160| `id` | string | Unique identifier (use UUID or similar) |161| `type` | string | `rectangle`, `ellipse`, `diamond`, `text`, `arrow`, `line` |162| `x`, `y` | number | Position coordinates |163| `width`, `height` | number | Dimensions |164| `strokeColor` | string | Border/stroke color (hex) |165| `backgroundColor` | string | Fill color (hex) or `"transparent"` |166| `fillStyle` | string | `"solid"`, `"hachure"`, `"cross-hatch"` |167| `strokeWidth` | number | Line thickness (1, 2, 4) |168| `strokeStyle` | string | `"solid"`, `"dashed"`, `"dotted"` |169| `roughness` | number | 0 = sharp, 1 = normal, 2 = sketchy |170| `opacity` | number | 0-100 |171| `angle` | number | Rotation in radians |172| `groupIds` | array | Group element IDs together |173| `seed` | number | Random seed for hand-drawn effect |174175### Text Properties176177| Property | Type | Description |178|----------|------|-------------|179| `text` | string | The text content |180| `fontSize` | number | Font size in pixels |181| `fontFamily` | number | 1 = Virgil (hand-drawn), 2 = Helvetica, 3 = Cascadia |182| `textAlign` | string | `"left"`, `"center"`, `"right"` |183| `verticalAlign` | string | `"top"`, `"middle"` |184185### Arrow Properties186187| Property | Type | Description |188|----------|------|-------------|189| `points` | array | Array of [x, y] coordinates relative to element origin |190| `startBinding` | object | Connection to source element |191| `endBinding` | object | Connection to target element |192| `startArrowhead` | string | `null`, `"arrow"`, `"bar"`, `"dot"`, `"triangle"` |193| `endArrowhead` | string | `null`, `"arrow"`, `"bar"`, `"dot"`, `"triangle"` |194195## Color Palette Reference196197### Component-Based Colors (Recommended for Architecture Diagrams)198199| Component Type | Stroke | Background | Use For |200|----------------|--------|------------|---------|201| **Database** | `#7c3aed` | `#ede9fe` | PostgreSQL, MySQL, MongoDB |202| **Cache** | `#dc2626` | `#fee2e2` | Redis, Memcached |203| **Queue** | `#16a34a` | `#dcfce7` | Kafka, RabbitMQ, SQS |204| **Load Balancer** | `#0891b2` | `#cffafe` | Nginx, HAProxy, ALB |205| **Gateway** | `#475569` | `#f1f5f9` | API Gateway, Kong |206| **CDN** | `#06b6d4` | `#e0f2fe` | CloudFront, Fastly |207| **Auth** | `#e11d48` | `#ffe4e6` | OAuth, IAM, Cognito |208| **Storage** | `#d97706` | `#fef3c7` | S3, Blob Storage |209| **Service** | `#2563eb` | `#dbeafe` | Backend services, APIs |210| **Container** | `#0284c7` | `#bae6fd` | Docker, Kubernetes |211| **Function** | `#f59e0b` | `#fef3c7` | Lambda, Serverless |212| **Monitoring** | `#84cc16` | `#ecfccb` | Prometheus, Grafana |213| **Web App** | `#4f46e5` | `#e0e7ff` | React, Vue, Frontend |214| **Mobile** | `#6366f1` | `#eef2ff` | iOS, Android |215216### Theme Colors217218**Modern (Default)**219- Primary: `#1971c2` / `#e7f5ff`220- Neutral: `#64748b` / `#f1f5f9`221222**Sketchy (Hand-drawn)**223- Primary: `#495057` / `#f8f9fa`224- Use `roughness: 2` and `fontFamily: 3`225226**Technical**227- Primary: `#2f9e44` / `#ebfbee`228- Use `strokeStyle: "dashed"` for connections229230## Icon Libraries (305 Components Total)231232Professional icons are available in `.excalidrawlib` files in the `assets/` directory:233234| Library | Components | Content |235|---------|------------|---------|236| `aws-architecture-icons.excalidrawlib` | 248 | AWS service icons (Lambda, S3, EC2, RDS, DynamoDB, SQS, etc.) |237| `system-design.excalidrawlib` | 24 | System design elements (server, database, storage, etc.) |238| `drwnio.excalidrawlib` | 18 | Draw.io style icons |239| `system-design-template.excalidrawlib` | 8 | Pre-built templates (steps, flow, db, etc.) |240| `software-architecture.excalidrawlib` | 7 | Software architecture components |241242### Using Library Components243244Library files contain element arrays that can be embedded directly into your diagram. Each library item is an array of Excalidraw elements that form a component.245246To use: Parse the library JSON, find the component you need, adjust positions, and include in your diagram's elements array.247248## Layout Guidelines249250### Architecture Diagram Layout251252Organize components in layers (top to bottom):253254```255Layer 1: Client/External (y: 100)256Layer 2: Edge/CDN (y: 280)257Layer 3: Gateway/Load Balancer (y: 460)258Layer 4: Services (y: 640)259Layer 5: Data/Cache (y: 820)260Layer 6: Infrastructure (y: 1000)261```262263**Spacing recommendations:**264- Horizontal spacing between components: 240px265- Vertical spacing between layers: 180px266- Component width: 180-220px267- Component height: 80-100px268269### Flowchart Layout270271Arrange left-to-right or top-to-bottom:272- Step spacing: 200px273- Use rectangles for processes274- Use diamonds for decisions275- Use ellipses for start/end276277### Mind Map Layout278279Radial layout from center:280- Center node at (400, 300)281- Child nodes at radius 250px282- Distribute evenly using angle calculations283284## Complete Example285286```json287{288 "type": "excalidraw",289 "version": 2,290 "source": "https://excalidraw.com",291 "elements": [292 {293 "id": "api-gateway",294 "type": "rectangle",295 "x": 100,296 "y": 100,297 "width": 180,298 "height": 80,299 "strokeColor": "#475569",300 "backgroundColor": "#f1f5f9",301 "fillStyle": "solid",302 "strokeWidth": 2,303 "roughness": 0,304 "opacity": 100,305 "groupIds": ["group-1"],306 "seed": 1234307 },308 {309 "id": "api-gateway-label",310 "type": "text",311 "x": 140,312 "y": 130,313 "width": 100,314 "height": 25,315 "text": "API Gateway",316 "fontSize": 16,317 "fontFamily": 1,318 "textAlign": "center",319 "strokeColor": "#1e1e1e",320 "groupIds": ["group-1"]321 },322 {323 "id": "redis",324 "type": "diamond",325 "x": 100,326 "y": 280,327 "width": 180,328 "height": 100,329 "strokeColor": "#dc2626",330 "backgroundColor": "#fee2e2",331 "fillStyle": "solid",332 "strokeWidth": 2,333 "roughness": 0,334 "seed": 5678335 },336 {337 "id": "redis-label",338 "type": "text",339 "x": 155,340 "y": 320,341 "width": 70,342 "height": 20,343 "text": "Redis",344 "fontSize": 16,345 "fontFamily": 1,346 "textAlign": "center",347 "strokeColor": "#1e1e1e"348 },349 {350 "id": "arrow-1",351 "type": "arrow",352 "x": 190,353 "y": 180,354 "width": 0,355 "height": 100,356 "strokeColor": "#64748b",357 "strokeWidth": 2,358 "points": [[0, 0], [0, 100]],359 "startBinding": {"elementId": "api-gateway", "focus": 0.5, "gap": 5},360 "endBinding": {"elementId": "redis", "focus": 0.5, "gap": 5},361 "endArrowhead": "arrow"362 }363 ],364 "appState": {365 "viewBackgroundColor": "#ffffff",366 "gridSize": null367 },368 "files": {}369}370```371372## Output373374Save your diagram as a `.excalidraw` or `.json` file. It can be:375- Imported directly into [excalidraw.com](https://excalidraw.com)376- Embedded in documentation or web apps377- Converted to PNG/SVG using Excalidraw's export features378379## Tips for AI Agents3803811. **Generate unique IDs**: Use UUIDs or sequential IDs for each element3822. **Group related elements**: Use `groupIds` to keep shapes and their labels together3833. **Use bindings for arrows**: Connect arrows to elements using `startBinding` and `endBinding`3844. **Apply consistent styling**: Use the color palette for component types3855. **Calculate text positions**: Center text within shapes by adjusting x/y based on text length3866. **Set seed values**: Use `seed: hash(id)` for consistent hand-drawn rendering387388---389> Converted and distributed by [TomeVault](https://tomevault.io/claim/jiatastic) — claim your Tome and manage your conversions.390<!-- tomevault:4.0:skill_md:2026-04-11 -->