excalidraw

Generate Excalidraw diagrams as .excalidraw files. Use when asked to create diagrams, flowcharts, architecture sketches, wireframes, or visual explanations. Outputs valid .excalidraw JSON files with hand-drawn style.

16 stars

Best use case

excalidraw is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Generate Excalidraw diagrams as .excalidraw files. Use when asked to create diagrams, flowcharts, architecture sketches, wireframes, or visual explanations. Outputs valid .excalidraw JSON files with hand-drawn style.

Teams using excalidraw should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/excalidraw/SKILL.md --create-dirs "https://raw.githubusercontent.com/diegosouzapw/awesome-omni-skill/main/skills/development/excalidraw/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/excalidraw/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How excalidraw Compares

Feature / AgentexcalidrawStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Generate Excalidraw diagrams as .excalidraw files. Use when asked to create diagrams, flowcharts, architecture sketches, wireframes, or visual explanations. Outputs valid .excalidraw JSON files with hand-drawn style.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# Excalidraw Diagram Generator

Generate hand-drawn Excalidraw diagrams and save them as `.excalidraw` files.

## Workflow

1. Read `colors.md` from this skill directory to get the current color theme
2. Decide if the diagram benefits from icons (see **Icons** section below)
3. If yes, read `icons.md` from this skill directory for icon recipes
4. Plan the diagram: elements, layout, colors, labels, arrows, and icon placements
5. Spawn a **subagent** (Task tool, `subagent_type: "general-purpose"`) with:
   - The full element format reference below
   - The colors from `colors.md`
   - Icon recipes from `icons.md` (if applicable)
   - A detailed description of the diagram to draw (element positions, labels, connections, colors, icon placements)
   - The output file path (ask the user or default to `diagram.excalidraw` in the current directory)
6. The subagent produces the JSON elements array and writes the `.excalidraw` file
7. Tell the user the output path — they can open it at [excalidraw.com](https://excalidraw.com) or in VS Code with the Excalidraw extension

## Icons (Optional)

**Include icons when:**
- Architecture diagrams with distinct component types (frontend, API, database, cache, etc.)
- Nodes that would otherwise all look like identical rectangles
- The user explicitly asks for icons or visual distinction

**Skip icons when:**
- Simple flowcharts or sequence diagrams where shape/color already conveys meaning
- Wireframes or UI mockups
- Very small diagrams (fewer than 4 nodes)

When using icons, describe each icon placement in the subagent prompt: which icon type, where it goes (inline in a shape or standalone), and the base coordinates.

## Subagent Prompt Template

Include everything between the `---` markers in the subagent prompt:

---

You are an Excalidraw JSON generator. Your job is to produce a valid `.excalidraw` file.

### Output Format

Write a JSON file with this envelope structure:

```json
{
  "type": "excalidraw",
  "version": 2,
  "source": "https://excalidraw.com",
  "elements": [ ... ],
  "appState": {
    "gridSize": null,
    "viewBackgroundColor": "#ffffff"
  },
  "files": {}
}
```

### Element Format

#### Required Fields (all elements)
`type`, `id` (unique string), `x`, `y`, `width`, `height`

#### Defaults (skip these)
strokeColor="#1e1e1e", backgroundColor="transparent", fillStyle="solid", strokeWidth=2, roughness=1, opacity=100

#### Element Types

**Rectangle**: `{ "type": "rectangle", "id": "r1", "x": 100, "y": 100, "width": 200, "height": 100 }`
- `roundness: { "type": 3 }` for rounded corners
- `backgroundColor: "#a5d8ff"`, `fillStyle: "solid"` for filled

**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 }`

**Labeled shape (PREFERRED)**: Add `label` to any shape for auto-centered text.
`{ "type": "rectangle", "id": "r1", "x": 100, "y": 100, "width": 200, "height": 80, "label": { "text": "Hello", "fontSize": 20 } }`
- Works on rectangle, ellipse, diamond

**Labeled arrow**: `"label": { "text": "connects" }` on an arrow element.

**Standalone text** (titles, annotations only):
`{ "type": "text", "id": "t1", "x": 150, "y": 138, "text": "Hello", "fontSize": 20 }`
- x is the LEFT edge. To center at cx: set x = cx - (text.length × fontSize × 0.5) / 2

**Arrow**: `{ "type": "arrow", "id": "a1", "x": 300, "y": 150, "width": 200, "height": 0, "points": [[0,0],[200,0]], "endArrowhead": "arrow" }`
- points: [dx, dy] offsets from element x,y
- endArrowhead: null | "arrow" | "bar" | "dot" | "triangle"

#### Arrow Bindings
`"startBinding": { "elementId": "r1", "fixedPoint": [1, 0.5] }`
fixedPoint: top=[0.5,0], bottom=[0.5,1], left=[0,0.5], right=[1,0.5]

### Sizing Rules

**Font sizes:**
- Minimum fontSize: **16** for body text, labels
- Minimum fontSize: **20** for titles and headings
- Minimum fontSize: **14** for secondary annotations only (sparingly)
- NEVER use fontSize below 14

**Element sizing:**
- Minimum shape size: 120×60 for labeled rectangles/ellipses
- Leave 20-30px gaps between elements minimum
- Prefer fewer, larger elements over many tiny ones

**Canvas layout:**
- Plan layout to fit roughly 800×600 for standard diagrams
- Leave padding around edges (start content at x:50-100, y:50-100)

### Drawing Order
- Array order = z-order (first = back, last = front)
- Background zones first, then shapes, then text/labels, then arrows
- Icons and decorative art/illustrations LAST

### Group IDs (for icons)
- Each icon is made of multiple primitive elements that share a `groupIds` entry
- Convention: `"groupIds": ["ico_{type}_{n}"]` — e.g., `["ico_database_1"]`, `["ico_cloud_2"]`
- All parts of one icon get the same groupId so they move/select together
- Icon parts use `strokeWidth: 1` (thinner than normal shapes)

### Rules
- Do NOT use emoji in text — they don't render in Excalidraw's Virgil font
- Make sure text is readable (never use same text color as background)
- Use colors consistently — one fill per semantic role
- Check that elements don't overlap unintentionally
- Arrow labels need space — keep labels short or make arrows wider
- Center titles relative to the diagram content

### Quick Example

```json
{
  "type": "excalidraw",
  "version": 2,
  "source": "https://excalidraw.com",
  "elements": [
    {"type":"rectangle","id":"b1","x":100,"y":100,"width":200,"height":100,"roundness":{"type":3},"backgroundColor":"#a5d8ff","fillStyle":"solid","label":{"text":"Start","fontSize":20}},
    {"type":"rectangle","id":"b2","x":450,"y":100,"width":200,"height":100,"roundness":{"type":3},"backgroundColor":"#b2f2bb","fillStyle":"solid","label":{"text":"End","fontSize":20}},
    {"type":"arrow","id":"a1","x":300,"y":150,"width":150,"height":0,"points":[[0,0],[150,0]],"endArrowhead":"arrow","startBinding":{"elementId":"b1","fixedPoint":[1,0.5]},"endBinding":{"elementId":"b2","fixedPoint":[0,0.5]}}
  ],
  "appState": {"gridSize":null,"viewBackgroundColor":"#ffffff"},
  "files": {}
}
```

---

After the format reference, append:
- The colors from `colors.md`
- The icon recipes from `icons.md` (if the diagram uses icons)
- Your detailed diagram description (including icon placements if applicable)
- The output file path
- "Write the .excalidraw file using the Write tool. Output ONLY the file — no explanation needed."

## Full Examples

See `reference.md` in this skill directory for complete diagram examples (photosynthesis, storyboard, etc.).
Include relevant examples in the subagent prompt when the user's request is similar.

Related Skills

excalidraw-agent

16
from diegosouzapw/awesome-omni-skill

Integrate and automate Excalidraw in React and Next.js apps, convert Mermaid to .excalidraw scenes, merge/normalize .excalidrawlib libraries, and troubleshoot Excalidraw runtime issues. Use when users mention Excalidraw, Mermaid diagrams, .excalidraw or .excalidrawlib files, Excalidraw API props/methods, export/import flows, or host-app collaboration wiring.

authoring-excalidraw-files

16
from diegosouzapw/awesome-omni-skill

Generate architecture diagrams as .excalidraw files. Use when the user asks to create architecture diagrams, system diagrams, visualize codebase structure, infrastructure diagrams, or generate excalidraw files.

bgo

10
from diegosouzapw/awesome-omni-skill

Automates the complete Blender build-go workflow, from building and packaging your extension/add-on to removing old versions, installing, enabling, and launching Blender for quick testing and iteration.

Coding & Development

fastapi-python-expert

16
from diegosouzapw/awesome-omni-skill

Use this agent when you need to design, implement, or optimize FastAPI backend applications. This includes API endpoint creation, database integration, authentication/authorization implementation, cloud deployment strategies, business logic architecture, performance optimization, and following FastAPI best practices.

fastapi-project

16
from diegosouzapw/awesome-omni-skill

Scaffold and evolve FastAPI projects with uv-based tooling, structured settings, and production-ready observability, resilience, availability, and security patterns aligned with python.instructions.md.

fastapi-pro

16
from diegosouzapw/awesome-omni-skill

Build high-performance async APIs with FastAPI, SQLAlchemy 2.0, and Pydantic V2. Master microservices, WebSockets, and modern Python async patterns. Use PROACTIVELY for FastAPI development, async optimization, or API architecture.

fastapi-patterns

16
from diegosouzapw/awesome-omni-skill

FastAPI patterns with Pydantic, async operations, and dependency injection

fastapi

16
from diegosouzapw/awesome-omni-skill

FastAPI Python framework. Covers REST APIs, validation, dependencies, security. Keywords: Pydantic, async, OAuth2, JWT.

fastapi-expert

16
from diegosouzapw/awesome-omni-skill

Use when building high-performance async Python APIs with FastAPI and Pydantic V2. Invoke for async SQLAlchemy, JWT authentication, WebSockets, OpenAPI documentation.

fastapi-development

16
from diegosouzapw/awesome-omni-skill

Modern Python API development with FastAPI covering async patterns, Pydantic validation, dependency injection, and production deployment

fastapi-best-practices

16
from diegosouzapw/awesome-omni-skill

FastAPI best practices e convenções baseadas em produção real. Aplicar em todos os projetos FastAPI.

faion-software-developer

16
from diegosouzapw/awesome-omni-skill

Full-stack development: Python, JavaScript, Go, APIs, testing, frontend.