OpenClaw skill
ec-excalidraw
An OpenClaw skill that embeds an Excalidraw canvas directly into conversations. It enables users and AI agents to collaboratively draw, edit, and interact with diagrams in real-time. Diagrams can be exported in PNG or SVG format.
Files
Review the files below to add this skill to your agents.
Security notice: review the SKILL.md file and repository content first before using any third-party skill.
SKILL.md content
---
name: excalidraw
description: Generate hand-drawn style diagrams, flowcharts, and architecture diagrams as PNG images from Excalidraw JSON
---
# Excalidraw Diagram Generator
Generate beautiful hand-drawn style diagrams rendered as PNG images.
## Workflow
1. **Generate JSON** — Write Excalidraw element array based on what the user wants
2. **Save to file** — Write JSON to `/tmp/<name>.excalidraw`
3. **Render** — `node ~/clawd/skills/excalidraw/scripts/render.js /tmp/<name>.excalidraw /tmp/<name>.png`
4. **Deliver based on context:**
### If chatting (Telegram/Discord/Slack/etc):
Send the PNG directly in chat via message tool:
```bash
message(action="send", filePath="/tmp/<name>.png", caption="Description")
```
**NEVER create a separate .excalidraw file for the user. Always render to PNG and send inline.**
### If creating a Google Doc:
1. Upload PNG to Google Drive
2. Insert image INTO the document using Docs API
3. Do NOT create a separate file or link - embed the image directly
### If user explicitly asks for the .excalidraw file:
Only then provide the raw .excalidraw JSON file for editing in Excalidraw app.
## Quick Reference
```bash
node <skill_dir>/scripts/render.js input.excalidraw output.png
```
## Element Types
| Type | Shape | Key Props |
|------|-------|-----------|
| `rectangle` | Box | x, y, width, height |
| `ellipse` | Oval | x, y, width, height |
| `diamond` | Decision | x, y, width, height |
| `arrow` | Arrow | connects shapes (see Arrow Binding below) |
| `line` | Line | x, y, points: [[0,0],[dx,dy]] |
| `text` | Label | x, y, text, fontSize, fontFamily (1=hand, 2=sans, 3=code) |
### Styling (all shapes)
```json
{
"strokeColor": "#1e1e1e",
"backgroundColor": "#a5d8ff",
"fillStyle": "hachure",
"strokeWidth": 2,
"roughness": 1,
"strokeStyle": "solid"
}
```
**fillStyle**: `hachure` (diagonal lines), `cross-hatch`, `solid`
**roughness**: 0=clean, 1=hand-drawn (default), 2=very sketchy
## Arrow Binding (IMPORTANT)
**Always use `from`/`to` bindings for arrows.** The renderer auto-calculates edge intersection points — no manual coordinate math needed.
### Simple arrow (straight, between two shapes)
```json
{"type":"arrow","id":"a1","from":"box1","to":"box2","strokeColor":"#1e1e1e","strokeWidth":2,"roughness":1}
```
That's it. No x, y, or points needed. The renderer computes start/end at shape edges.
### Multi-segment arrow (routed path with waypoints)
For arrows that need to go around obstacles, use `absolutePoints` with intermediate waypoints:
```json
{
"type":"arrow","id":"a2","from":"box3","to":"box1",
"absolutePoints": true,
"points": [[375,500],[30,500],[30,127],[60,127]],
"strokeColor":"#1e1e1e","strokeWidth":2,"roughness":1
}
```
- First point = near source shape edge (will snap to actual edge)
- Last point = near target shape edge (will snap to actual edge)
- Middle points = absolute waypoint coordinates for routing
### Arrow labels
Place a separate text element near the arrow midpoint:
```json
{"type":"text","id":"label","x":215,"y":98,"width":85,"height":16,"text":"sends data","fontSize":10,"fontFamily":1,"strokeColor":"#868e96"}
```
### Arrow styles
- `"strokeStyle":"dashed"` — dashed line
- `"startArrowhead": true` — bidirectional arrow
## Template: Flowchart with Bindings
```json
{
"type": "excalidraw",
"version": 2,
"elements": [
{"type":"rectangle","id":"start","x":150,"y":50,"width":180,"height":60,"strokeColor":"#1e1e1e","backgroundColor":"#b2f2bb","fillStyle":"hachure","strokeWidth":2,"roughness":1},
{"type":"text","id":"t1","x":200,"y":65,"width":80,"height":30,"text":"Start","fontSize":20,"fontFamily":1,"strokeColor":"#1e1e1e"},
{"type":"arrow","id":"a1","from":"start","to":"decision","strokeColor":"#1e1e1e","strokeWidth":2,"roughness":1},
{"type":"diamond","id":"decision","x":140,"y":170,"width":200,"height":120,"strokeColor":"#1e1e1e","backgroundColor":"#ffec99","fillStyle":"hachure","strokeWidth":2,"roughness":1},
{"type":"text","id":"t2","x":185,"y":215,"width":110,"height":30,"text":"Condition?","fontSize":18,"fontFamily":1,"strokeColor":"#1e1e1e","textAlign":"center"},
{"type":"arrow","id":"a2","from":"decision","to":"process","strokeColor":"#1e1e1e","strokeWidth":2,"roughness":1},
{"type":"rectangle","id":"process","x":150,"y":350,"width":180,"height":60,"strokeColor":"#1e1e1e","backgroundColor":"#a5d8ff","fillStyle":"hachure","strokeWidth":2,"roughness":1},
{"type":"text","id":"t3","x":190,"y":365,"width":100,"height":30,"text":"Process","fontSize":20,"fontFamily":1,"strokeColor":"#1e1e1e"}
]
}
```
## Layout Guidelines
- **Node size**: 140-200 × 50-70 px
- **Diamond**: 180-200 × 100-120 px (taller for text)
- **Vertical spacing**: 60-100 px between nodes
- **Horizontal spacing**: 80-120 px between nodes
- **Text**: Position inside shape manually (offset ~15-30px from top-left of shape)
- **Arrow labels**: Place as separate text elements near midpoint of arrow path
## Color Palette
**Fills**: `#a5d8ff` (blue), `#b2f2bb` (green), `#ffec99` (yellow), `#ffc9c9` (red), `#d0bfff` (purple), `#f3d9fa` (pink), `#fff4e6` (cream)
**Strokes**: `#1e1e1e` (dark), `#1971c2` (blue), `#2f9e44` (green), `#e8590c` (orange), `#862e9c` (purple)
**Labels**: `#868e96` (gray, for annotations)
## Tips
- Every element needs a unique `id` (required for binding!)
- Use `from`/`to` on arrows — don't calculate coordinates manually
- `roughness:0` for clean diagrams, `1` for sketchy feel
- Text `fontFamily:1` for hand-drawn, `3` for code
- Group related elements spatially, color-code by type
- For nested layouts, use a large background rectangle as a container
How this skill works
- Generates Excalidraw diagrams (.excalidraw files) from natural language descriptions
- Uses the Excalidraw+ AI generation feature via their API
- Returns a JSON object with type 'excalidraw' and data as base64 encoded .excalidraw file
When to use it
- When an agent needs to generate an Excalidraw diagram from a natural language prompt
- When an agent needs to embed the generated Excalidraw diagram in a Markdown response
Best practices
- Self-host a collab server and set EXCALIDRAW_COLLAB_SERVER_BASE for privacy
- Ensure OpenClaw instance allows embedding external iframes
- Provide roomLink to load existing canvases
Example use cases
- Creating new Excalidraw diagrams from text prompts: Uses the create_excalidraw tool to generate a new interactive Excalidraw canvas based on a natural language description of the desired diagram.
- Embedding Excalidraw diagrams in chat: Uses the get_excalidraw_embed tool to obtain and display an embeddable iframe of an Excalidraw diagram directly in the conversation.
- Updating existing Excalidraw diagrams: Uses the update_excalidraw tool to modify an existing diagram's scene based on new instructions, enabling iterative refinements.
- Listing available Excalidraw diagrams: Uses the list_excalidraws tool to retrieve a list of all user-owned Excalidraw canvases with their IDs and titles.
FAQs
What is the ec-excalidraw skill?
ec-excalidraw is a skill for OpenClaw that allows agents to create Excalidraw diagrams. Excalidraw is a virtual whiteboard for sketching hand-drawn like diagrams.
Who is the author of the ec-excalidraw skill?
henrino3
What tool does the ec-excalidraw skill provide?
generate_diagram
What argument does the generate_diagram tool take?
description (str): The description of the diagram to generate.
What does the generate_diagram tool return?
A shareable link to the generated Excalidraw diagram.
How can agents use the ec-excalidraw skill?
Agents call the generate_diagram tool with a natural language description of the desired diagram.
More similar skills to explore
- achurch
An OpenClaw skill for church administration that handles member management, event scheduling, sermon retrieval, and donation processing. It provides tools to list members, add new members, schedule events, fetch sermons, and record donations.
- agent-config
An OpenClaw skill that enables agents to manage their configuration by loading from files, environment variables, or remote sources. It supports retrieving, setting, and validating configuration values. The skill allows for hot-reloading of configurations.
- agent-council
An OpenClaw skill named agent-council that enables the primary agent to summon a council of specialized sub-agents for deliberating on tasks. The council members discuss the query from unique perspectives, propose solutions, and vote to select the best response. The skill outputs the winning proposal with supporting rationale from the council.
- agent-identity-kit
An OpenClaw skill that equips agents with tools to craft, manage, and evolve digital identities, including generating personas, bios, avatars, and communication styles. It supports creating detailed agent personas with name, background, goals, personality traits; crafting bios for specific platforms; designing avatars; tuning voice and style; and adapting identities to new contexts.
- agenticflow-skill
An OpenClaw skill that provides tools for interacting with Agentic Flow. The tools enable agents to create agentic flows with defined tasks, execute existing flows, and retrieve flow status and outputs.
- agentlens
AgentLens is an OpenClaw skill that enables agents to inspect the internal cognition and actions of other agents. It provides visibility into reasoning traces (thoughts), tool calls and arguments, retrieved memories, and response generation. The skill supports analysis in multi-agent conversations via the "inspect" action targeting a specific agent.