Excalidraw 标志

Excalidraw

社区
robonuggets
excalidraw

Draw professional diagrams on a live Excalidraw canvas via MCP. Use when asked to create architecture diagrams, flowcharts, system maps, comparison visuals, or any visual explanation. Covers setup, 10 visual techniques, design preferences, layout best practices, and the screenshot-iterate loop.

Add to TypingMind

概览

发布者robonuggets
代码仓库excalidraw-skill
技能名称excalidraw
星标数
87
复刻数
24
附带文件
仅含指令
链接
  • Markdown 格式的指令

    模型按需加载 SKILL.md 文件,因此只有在请求确实与该技能匹配时才会消耗 Token。

  • 兼容任何大语言模型

    AI 技能采用纯 Markdown,而非特定提供商的代码,因此可搭配 GPT、Claude、Gemini、Grok 或本地模型使用。

  • 指令自成一体

    模型所需的一切都包含在指令中,无需同步额外文件。

  • 开源

    由 robonuggets 发布于 GitHub。请在安装前查看技能的源文件。

安装

在 TypingMind 中安装 Excalidraw AI 技能,即可搭配任意大语言模型使用;也可以将其放入其他支持读取 SKILL.md 的智能体中。

1

安装到 TypingMind

TypingMind 可直接从 GitHub 文件夹安装技能:读取 SKILL.md,打包资源文件,并将结果保存在本地。

  1. 打开应用,前往“插件 → 技能”。
  2. 选择“从 GitHub 安装”。
  3. 粘贴下方的技能文件夹 URL 并确认。
    https://github.com/robonuggets/excalidraw-skill/tree/master/.claude/skills/excalidraw
  4. 请在每个需要使用该技能的聊天中启用它。
依次选择“插件 → 技能 → 添加技能 → 从 GitHub URL 导入”,然后粘贴文件夹 URL 并点击“继续”。
2

安装到其他智能体

任何支持 Agent Skills 格式的智能体都可以使用此技能,只需将文件夹复制到该智能体的技能目录中。

Claude Code — .claude/skills
git clone --depth 1 https://github.com/robonuggets/excalidraw-skill.git /tmp/excalidraw-skill
mkdir -p .claude/skills
cp -r /tmp/excalidraw-skill/.claude/skills/excalidraw .claude/skills/excalidraw
复制后,请重启 Claude Code,以加载新技能。

在 TypingMind 中使用此技能

在任意 TypingMind 聊天中启用 Excalidraw,后续即可交由模型处理。技能的名称和描述会放在系统提示词中,一旦请求匹配,模型就会自动加载完整指令,无需您手动调用,且在实际使用前不会消耗 Token。

一旦请求与技能匹配,模型就会自动加载 Excalidraw。

兼容任何 AI 模型

AI 技能是纯 Markdown 指令,而非特定提供商的代码,因此 Excalidraw 不局限于最初适配的模型。只需在 TypingMind 中安装一次,即可搭配 GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama 或您自行运行的本地模型使用,全程使用您自己的 API 密钥。

  • 仅在需要时加载

    系统提示词中仅包含技能名称和描述。首次遇到匹配的请求时才会加载完整指令,因此技能未使用时,这些指令不会消耗 Token。

  • 在聊天中切换模型

    技能是指令而非代码,因此切换模型不会导致技能失效,新模型会读取同一个 SKILL.md。

技能指令

这是模型会加载的 SKILL.md 内容。请在安装前阅读,因为技能就是模型将遵循的指令。

Excalidraw Diagramming Skill

Turn text descriptions into professional diagrams on a live Excalidraw canvas. Your agent draws, screenshots its own work, and iterates until it looks right.

Prerequisites: MCP Setup

Before using this skill, the Excalidraw MCP server must be installed and running.

One-time install

bash
git clone https://github.com/yctimlin/mcp_excalidraw && cd mcp_excalidraw
npm ci && npm run build

Add to Claude Code

bash
claude mcp add excalidraw -s user \
  -e EXPRESS_SERVER_URL=http://localhost:3000 \
  -- node /absolute/path/to/mcp_excalidraw/dist/index.js

Replace /absolute/path/to/ with wherever you cloned the repo.

Start the canvas (every session)

bash
cd /path/to/mcp_excalidraw
PORT=3000 npm run canvas

Then open http://localhost:3000 in your browser to see the live canvas.

Verify it works

Once Claude Code starts, you should see excalidraw/* tools in your tool list. Try: "Draw a simple flowchart with three boxes."


How It Works

You describe a diagram
  -> Agent plans the layout (coordinates, spacing, colors)
  -> batch_create_elements (draws everything in one call)
  -> get_canvas_screenshot (agent sees what it drew)
  -> Fixes any issues (overlap, truncation, bad arrows)
  -> Repeats until clean
  -> Exports (PNG, SVG, .excalidraw, or shareable URL)

The key insight: the agent can see its own canvas via screenshots. This creates a self-correcting feedback loop that produces clean diagrams without manual tweaking.


Workflow (ALWAYS follow this order)

  1. Read the design guide -- call read_diagram_guide first for color palette and sizing rules
  2. Plan the layout -- decide on structure based on content (vertical cards, horizontal flow, grid)
  3. Create 3 variations -- ALWAYS produce 3 different layout options before committing. Save each as a snapshot. Show a screenshot of each.
  4. Let the user choose -- present all 3 with a short description of each
  5. Refine the chosen version -- clean up based on feedback
  6. Final screenshot -- verify everything looks right before exporting

Variation Strategies

When creating 3 options, vary these dimensions:

  1. Layout direction -- vertical stack vs horizontal flow vs grid
  2. Shape variety -- all rectangles vs mixed (circles, diamonds, rectangles)
  3. Information density -- minimal (just labels) vs detailed (labels + descriptions + examples)
  4. Visual personality -- clean/professional vs playful/sketchy (roughness: 0 vs 1)

Design Principles

#1 Rule: Transparent Backgrounds (CRITICAL)

Always use "backgroundColor": "transparent" on shapes. This is the single biggest design improvement. Filled rectangles look flat and amateurish. Transparent boxes with colored strokes look professional, especially on dark canvases where the background shows through.

The only exceptions:

  • Badge circles (numbered steps) -- these get solid fills so the number is readable
  • Glow effect layers -- these use low-opacity fills behind the main shape
  • Scatter plot dots -- small data points that need to be visible

Everything else: transparent background, colored stroke only.

json
{"type": "rectangle", "x": 100, "y": 100, "width": 200, "height": 60,
 "backgroundColor": "transparent", "strokeColor": "#3b82f6", "roughness": 0,
 "text": "My Service"}

Dark Canvas First

Design for dark mode. Use bright stroke colors (#3b82f6, #22c55e, #a78bfa) against the dark canvas. Light gray text (#cbd5e1, #e2e8f0) for body copy. Muted gray (#64748b, #94a3b8) for secondary text and subtitles. Gold (#fbbf24) for footer taglines.

Language

  • Always use plain language -- no technical jargon unless explicitly asked
  • Write labels as if explaining to someone who's never coded
  • Descriptions should be conversational, not clinical

Color Palette

Each color has a stroke (for borders/outlines) and a fill (only for badges/dots). Use stroke colors on shapes with transparent backgrounds.

ColorStrokeFill (badges only)
Blue#3b82f6#3b82f6
Purple#8b5cf6#8b5cf6
Green#22c55e#22c55e
Orange/Amber#f59e0b#f59e0b
Red#ef4444#ef4444
Cyan#06b6d4#06b6d4
Pink#ec4899#ec4899
Lime#a3e635#a3e635
Gray (structure)#475569--
Gray (subtle)#334155--

Text colors:

RoleHex
Title / heading#e2e8f0
Body text#cbd5e1
Subtitle / secondary#64748b or #94a3b8
Footer tagline#fbbf24
Code / monospace#22c55e (prompt) or #94a3b8 (body)

Colored Dot Bullets

Instead of text bullet characters (•), use small filled ellipses next to free-standing text. This looks dramatically better:

json
{"type": "ellipse", "x": 105, "y": 345, "width": 12, "height": 12,
 "backgroundColor": "#3b82f6", "strokeColor": "#3b82f6", "roughness": 0},
{"type": "text", "x": 128, "y": 340, "width": 300, "height": 22,
 "text": "Think through problems", "fontSize": 16, "fontFamily": "excalifont", "strokeColor": "#cbd5e1"}

Use a different color for each bullet to add visual variety. Keep dots at 10-12px diameter.

Visual Elements

  • Emojis as icons -- use relevant emojis in labels (e.g., "🧠 Think", "⚡ Act")
  • Numbered badge circles -- solid-filled circles with numbers for step sequences
    • Use roughness: 0 for clean badge circles
    • Badge size: 40x40px, font size 20
  • Punchy footer tagline -- include a one-liner at the bottom in gold (#fbbf24) that captures the "so what"
  • Section divider lines -- thin dashed lines (strokeColor: "#334155", strokeStyle: "dashed") between sections
  • Separator lines inside cards -- thin solid lines below the title area to separate header from content

Font Rules

  • Helvetica ("helvetica") -- titles, headings, and labels (clean and professional)
  • Excalifont ("excalifont") -- descriptions, bullets, secondary text (friendly hand-drawn feel)
  • Monospace (3) -- code snippets, terminal prompts, file names
  • Do NOT use Lilita One (too cartoony) or Comic Shanns
ElementFontSize
Diagram titleHelvetica24-44px
Section headingHelvetica20-28px
Element labelHelvetica14-16px
Description / bulletsExcalifont13-16px
SubtitleExcalifont13-15px
Footer taglineExcalifont12-13px
Code textMonospace11-14px

Text Handling (CRITICAL -- prevent overflow)

  • Always pre-wrap text with manual \n line breaks -- never rely on auto-wrap
  • Max ~40 characters per line for description text at 14px font
  • Max ~35 characters per line for heading text at 22px font
  • 20px+ padding between text and box edges on all sides
  • For simple label-only boxes, size width to max(100, labelCharCount * 9)

Building Section by Section

For complex diagrams, build one section at a time using batch_create_elements. This prevents overwhelming the canvas and makes debugging easier. Take a screenshot after each section to verify before moving on.

Multi-Diagram Layouts

When placing multiple diagrams on one canvas, use a grid layout:

  • 2 diagrams: side by side, ~530px apart
  • 3 diagrams: row of 3, ~530px column spacing
  • 6 diagrams (3x2): columns at x=50, x=560, x=1080. Rows at y=20, y=460. Each cell ~480px wide, ~420px tall.

Namespace all element IDs by diagram number (e.g., d1-title, d2-hub, d3-s1) to avoid collisions.


10 Visual Techniques

These are the building blocks for every diagram. Combine them to create professional visuals.

1. Layered Glow Effect

Stack 2-3 rectangles at decreasing opacity behind a shape to create depth.

json
{"id": "glow-outer", "type": "rectangle", "x": 95, "y": 95, "width": 210, "height": 70,
 "backgroundColor": "#a5d8ff", "opacity": 20, "strokeColor": "transparent"},
{"id": "glow-inner", "type": "rectangle", "x": 98, "y": 98, "width": 204, "height": 64,
 "backgroundColor": "#a5d8ff", "opacity": 40, "strokeColor": "transparent"},
{"id": "main-box", "type": "rectangle", "x": 100, "y": 100, "width": 200, "height": 60,
 "text": "Core Service", "backgroundColor": "#a5d8ff", "strokeColor": "#1971c2"}

2. Color-Coded Zones

Low-opacity background rectangles group related elements. Use a free-standing text label at the top corner (never use text on the zone rectangle itself -- it centers and overlaps children).

json
{"id": "zone-bg", "type": "rectangle", "x": 50, "y": 50, "width": 500, "height": 300,
 "backgroundColor": "#e9ecef", "opacity": 30, "strokeColor": "#868e96"},
{"id": "zone-label", "type": "text", "x": 70, "y": 60, "width": 200, "height": 30,
 "text": "Backend Services", "fontSize": 18, "fontFamily": "helvetica"}

3. Bound Arrows with Labels

Arrows snap to shapes using element IDs. Labels describe the relationship.

json
{"id": "svc-a", "type": "rectangle", "x": 100, "y": 100, "width": 160, "height": 60,
 "backgroundColor": "transparent", "strokeColor": "#3b82f6", "roughness": 0, "text": "API Gateway"},
{"id": "svc-b", "type": "rectangle", "x": 400, "y": 100, "width": 160, "height": 60,
 "backgroundColor": "transparent", "strokeColor": "#22c55e", "roughness": 0, "text": "Database"},
{"type": "arrow", "x": 0, "y": 0, "startElementId": "svc-a", "endElementId": "svc-b", "text": "SQL"}

4. Line Styles as Meaning

  • Solid = synchronous / primary flow
  • Dashed (strokeStyle: "dashed") = asynchronous / secondary
  • Dotted (strokeStyle: "dotted") = optional / planned

5. Diamond Decision Nodes

Classic flowchart branching with Yes/No paths.

json
{"id": "decision", "type": "diamond", "x": 300, "y": 200, "width": 140, "height": 100,
 "backgroundColor": "transparent", "strokeColor": "#f59e0b", "roughness": 0, "text": "Auth OK?"},
{"id": "yes-path", "type": "rectangle", "x": 150, "y": 380, "width": 140, "height": 60,
 "backgroundColor": "transparent", "strokeColor": "#22c55e", "roughness": 0, "text": "Proceed"},
{"id": "no-path", "type": "rectangle", "x": 450, "y": 380, "width": 140, "height": 60,
 "backgroundColor": "transparent", "strokeColor": "#ef4444", "roughness": 0, "text": "Reject"},
{"type": "arrow", "x": 0, "y": 0, "startElementId": "decision", "endElementId": "yes-path",
 "strokeColor": "#22c55e", "text": "Yes"},
{"type": "arrow", "x": 0, "y": 0, "startElementId": "decision", "endElementId": "no-path",
 "strokeColor": "#ef4444", "text": "No"}

6. Mixed Shape Types

Use shape type to encode meaning:

  • Ellipse = actors, users, external systems
  • Rectangle = services, processes, components
  • Diamond = decisions, conditions

7. Numbered Badge Circles

Solid-filled circles with white numbers for step sequences:

json
{"id": "badge-1", "type": "ellipse", "x": 100, "y": 100, "width": 50, "height": 50,
 "backgroundColor": "#1971c2", "strokeColor": "#1971c2", "roughness": 0,
 "text": "1", "fontSize": 24, "textAlign": "center"}

8. Emoji Icons in Labels

Emojis render beautifully at any size. Use them to make labels scannable:

json
{"type": "rectangle", "x": 100, "y": 100, "width": 200, "height": 60,
 "backgroundColor": "transparent", "strokeColor": "#3b82f6", "roughness": 0,
 "text": "🧠 Claude thinks"}

9. Mermaid Conversion

Convert existing Mermaid diagrams to editable Excalidraw elements:

create_from_mermaid("graph TD\n  A[Start] --> B{Decision}\n  B -->|Yes| C[Do Thing]\n  B -->|No| D[Skip]")

After conversion, use set_viewport with scrollToContent: true to auto-fit the view.

10. Screenshot-Iterate Loop

The most important technique. After every batch of elements:

batch_create_elements -> get_canvas_screenshot -> evaluate -> fix -> re-screenshot

Never skip the screenshot step. Always verify before moving on.


Layout Rules

These prevent the most common diagram problems.

Spacing

  • Between shapes: 30-40px gap between connected cards/zones
  • Vertical tiers: 80-120px between rows (enough room for arrow labels)
  • Shape width: max(600, labelCharCount * 9) for boxes with heading + description; max(160, labelCharCount * 9) for simple label boxes
  • Shape height: 60px single-line, 80px two-line, 110px for step cards with descriptions
  • Zone padding: 50px on all sides around contained elements

Alignment

  • All same-role elements should share the same x or y coordinate
  • Center titles and footers relative to the card stack width
  • Badges aligned at the same x offset within their cards

Arrows

  • Always use startElementId / endElementId to bind arrows to shapes (auto-routes to edges)
  • Keep arrow labels under 12 characters
  • If an arrow crosses through an unrelated shape, add a waypoint to route around it

Curved arrows (smooth arc over obstacles):

json
{"type": "arrow", "x": 100, "y": 100, "points": [[0, 0], [50, -40], [200, 0]], "roundness": {"type": 2}}

Elbowed arrows (right-angle routing):

json
{"type": "arrow", "x": 100, "y": 100, "points": [[0, 0], [0, -50], [200, -50], [200, 0]], "elbowed": true}

Zone Labels (Critical)

Never put a text label on a large background rectangle. Excalidraw centers it in the middle of the zone, overlapping everything inside.

Instead, create a separate text element positioned at the top corner of the zone.

Custom Element IDs

Always assign custom id values (e.g., "id": "auth-svc") so arrows can reference them and you can update elements later by name.


Sizing Defaults

ElementWidthHeight
Step card (vertical)340-460px40-55px
Step card (horizontal)110-220px38-55px
Badge circle40px40px
Bullet dot10-12px10-12px
Hub node (ellipse)140px65px
Satellite node100-130px38-45px
Code block240-700px50px
Layer row460-600px45px
Inner service box90-100px28-32px

Quality Checklist

Run this after every batch_create_elements. Take a screenshot and check:

  1. Text truncation -- All label text fully visible? If not, increase shape width/height
  2. Text overflow -- Text staying within box edges with 20px+ padding on all sides?
  3. Overlap -- Any shapes sharing space? Background zones must contain children with padding
  4. Arrow crossing -- Do arrows cut through unrelated shapes? Route around with waypoints
  5. Arrow-label overlap -- Labels at midpoint overlapping shapes? Shorten label or adjust path
  6. Spacing -- At least 30px gap between elements
  7. Readability -- Font size 14+ for body, 22+ for headings, 36 for title
  8. Zone labels -- Not centered in background zones (use free-standing text instead)
  9. Alignment -- Same-role elements sharing coordinates?
  10. Font consistency -- Helvetica for headings, Excalifont for descriptions?

If anything fails: stop, fix it, re-screenshot, then continue.


Anti-Patterns (DO NOT do these)

  • Filled backgrounds on shapes -- use "backgroundColor": "transparent" always (except badges/dots)
  • Text bullet characters (•, -) -- use colored ellipse dots instead
  • Single-line text that overflows the box edge
  • Technical jargon without being asked for it
  • Skipping the 3-variation step
  • Forgetting to take a screenshot after building
  • Using only one font family throughout
  • Tiny fonts below 14px
  • Boxes narrower than 600px when they contain multi-line text
  • Forgetting to save snapshots before moving to the next variation
  • Building the entire diagram in one batch_create_elements call -- build section by section
  • Using the same stroke color for every element -- vary colors to encode meaning

What Works Well

  • Rectangles, ellipses, diamonds -- all shape types
  • Bound arrows with auto-routing
  • Arrow labels
  • Line styles (solid, dashed, dotted)
  • Full color palette with fills and strokes
  • Opacity for glow/shadow/zone effects
  • Font sizes from 14px to 36px+
  • Emoji icons (render great at any size, inside or outside shapes)
  • Mermaid-to-Excalidraw conversion
  • Export to .excalidraw, PNG, SVG, and shareable URL
  • Canvas screenshots for self-verification

Known Limitations

  • Images -- MCP tool doesn't expose file path or base64 params. Workaround: drag images into the browser at localhost:3000
  • Freedraw -- Needs point arrays the MCP tool can't accept. Workaround: draw freehand in browser
  • SVG import -- import_scene only accepts .excalidraw JSON, not raw SVGs. Workaround: paste SVGs in the browser (native Excalidraw feature)

Workflow: New Diagram

  1. clear_canvas to start fresh
  2. Call read_diagram_guide for the built-in design reference
  3. Plan your coordinate grid (sketch tiers and x-positions)
  4. Create 3 variations -- save each as a snapshot, screenshot each
  5. Present all 3, let user choose
  6. Refine the chosen version
  7. get_canvas_screenshot -- run the Quality Checklist
  8. Fix issues with update_element, re-screenshot
  9. Export when clean: export_to_image (PNG/SVG) or export_scene (.excalidraw)

Workflow: Refine Existing Diagram

  1. describe_scene to understand what's on the canvas (IDs, positions, labels)
  2. Identify elements by ID or label text (not coordinates)
  3. update_element to resize, recolor, or move
  4. get_canvas_screenshot to verify
  5. If an element won't update, try unlock_elements first

Workflow: Snapshots (Undo Safety)

  1. snapshot_scene with a name before risky changes
  2. Make changes, screenshot to evaluate
  3. restore_snapshot to roll back if needed

Workflow: Export

  • .excalidraw JSON (re-editable): export_scene
  • PNG image: export_to_image with format: "png"
  • SVG image: export_to_image with format: "svg"
  • Shareable URL: export_to_excalidraw_url (uploads to excalidraw.com)

Error Recovery

  • Elements not appearing? They may be off-screen. Use set_viewport with scrollToContent: true
  • Arrow not connecting? Verify element IDs exist with get_element
  • Canvas in a bad state? snapshot_scene first, then clear_canvas and rebuild
  • Element won't update? May be locked -- call unlock_elements first
  • Duplicate text elements appearing? The frontend auto-syncs and can re-inject bound texts. Fix: use query_elements to find text elements with a containerId, delete the extras

常见问题

Excalidraw AI 技能有什么作用?

Draw professional diagrams on a live Excalidraw canvas via MCP. Use when asked to create architecture diagrams, flowcharts, system maps, comparison visuals, or any visual explanation. Covers setup, 10 visual techniques, design preferences, layout best practices, and the screenshot-iterate loop.

为什么在 TypingMind 中使用 Excalidraw?

因为您只需安装一次,就能搭配任何模型使用。Excalidraw 采用纯 Markdown 格式,而非特定提供商专用的代码,因此同一技能可用于 GPT-5、Claude、Gemini、Grok 或本地模型。您甚至可以在聊天中途切换模型,而不会影响技能的正常使用。TypingMind 使用您自己的 API 密钥,因此您直接向提供商付费,而不是按席位订阅;您的技能和聊天记录也都保留在您自己的存储空间中。

如何在 TypingMind 中安装 Excalidraw?

在 TypingMind 中打开“插件 → 技能 → 从 GitHub 安装”,然后粘贴 https://github.com/robonuggets/excalidraw-skill/tree/master/.claude/skills/excalidraw。TypingMind 会读取其中的 SKILL.md,并将其安装为技能,供您在各个聊天中按需启用。

哪些 AI 模型可以使用 Excalidraw?

您在 TypingMind 中连接的任何模型都可以。AI 技能采用纯 Markdown 指令,而非特定提供商专用的代码,因此 GPT、Claude、Gemini、Grok 和本地模型都能在请求匹配时加载此技能。

Excalidraw 可以搭配多少个 AI 模型使用?

数量不限。只要模型支持技能,您就可以将它与 Excalidraw 搭配使用。GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llama 等模型都可以通过您自己的 API 密钥接入 TypingMind。

Excalidraw AI 技能免费吗?

robonuggets 已在 GitHub 上发布了该技能。请查看代码仓库了解许可条款。您只需向自己的 AI 提供商支付所用 Token 的费用。

什么是 AI 技能?

AI 技能是一组可复用的指令,用于教会 AI 模型完成某项特定任务。它遵循开放的 Agent Skills 格式:包含名称和描述的 SKILL.md 文件,以及模型可能需要的脚本、模板或参考文件。模型仅在您的请求与技能匹配时才会读取这些指令,因此已安装的技能在使用前不会产生任何费用。

AI 技能与插件或 MCP 服务器有何不同?

插件或 MCP 服务器为模型提供可调用的新工具,也就是在某处运行并返回结果的代码。AI 技能则为模型提供知识和流程:如何处理任务、遵循哪些步骤,以及怎样的输出才算优质。技能采用纯 Markdown 格式,因此不需要服务器、API 密钥或运行时环境,并且适用于任何模型。

查看全部

立即创建您自己的 AI 工作区

订阅我们的电子简报,获取新功能和后续赠奖活动的通知 👇