/excalidraw-diagram:excalidraw-diagramfrom Excalidraw Diagram
Create Excalidraw diagrams for workflows, architectures, protocols, concepts, and system explanations. Use when a user wants a flowchart, architecture sketch, visual explanation, or diagram as a .excalidraw file plus PNG preview. Includes a local Playwright renderer for visual QA and reference files for palette, JSON structure, and reusable element patterns.
Ships in Excalidraw Diagram. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
用 Excalidraw 生成能够“解释问题”的图,而不是把文字机械摆成卡片。
当用户要你生成以下内容时使用本 skill:
.excalidraw 源文件,后续还要继续编辑默认产出两份文件:
*.excalidraw:可继续编辑的源文件*.png:本地渲染预览图不要只交付 JSON。 生成后必须本地渲染一次,并根据预览修正明显问题。
开始画图前按需读取:
| 任务 | 先读什么 |
|---|---|
| 所有任务 | references/color-palette.md |
| 需要写元素 JSON | references/element-templates.md |
| 不确定 Excalidraw 文件结构 | references/json-schema.md |
| 准备渲染和排查布局 | references/rendering-workflow.md |
先决定这张图属于哪一类:
如果是技术图,先查真实资料,再开画。不要用“Service A → Service B”这种空标签糊弄过去。
先确定这张图真正想表达什么:
形状必须服务含义。 不要默认所有节点都是同尺寸卡片。
不是每段文字都需要矩形包住。默认优先:
技术图至少加入一种真实证据:
这样图本身就能用于教学,而不是只做装饰。
先用一句话写清楚这张图想证明什么。
示例:
先把图拆成 3-6 个区块,再决定每块内部怎么画。大图一定要分区写,别一次性生成全部元素。
常见分区方式:
按概念选择模式:
| 概念 | 建议模式 |
|---|---|
| 顺序流程 | 时间线 / 横向流程 |
| 一对多分发 | 扇出 |
| 多对一聚合 | 汇聚 |
| 层级结构 | 树形 / 分区 |
| 对比分析 | 左右并列 |
| 循环反馈 | 回环箭头 |
.excalidraw写文件时遵守三条:
生成 JSON 后,必须执行本地渲染:
uv sync --project {baseDir}/scripts
uv run --project {baseDir}/scripts playwright install chromium
uv run --project {baseDir}/scripts python {baseDir}/scripts/render_excalidraw.py /absolute/path/to/diagram.excalidraw --output /absolute/path/to/diagram.png
然后读取 PNG,检查:
如果预览里出现以下任何问题,先修再交:
#FFFFFFroughness: 0references/color-palette.md 取,不临时发明新颜色渲染链路依赖 uv 和 Playwright。
brew install uv
uv sync --project {baseDir}/scripts
uv run --project {baseDir}/scripts playwright install chromium
uv:管理 Python 运行环境playwright:驱动无头 Chromium 把 .excalidraw 渲染成 PNG给用户交付时,尽量同时说明:
.excalidraw 与 .png 路径这样会让图只剩“排版”,没有论证。
如果没有真实事件、接口、数据格式,教学价值会很弱。
坐标在 JSON 里看着没问题,不代表视觉上真的成立。
颜色应该承担语义分层,而不是随机好看。
交付前确认:
.excalidrawreferences/color-palette.md (opens in a new tab)references/element-templates.md (opens in a new tab)references/json-schema.md (opens in a new tab)references/rendering-workflow.md (opens in a new tab)scripts/pyproject.toml (opens in a new tab)scripts/render_excalidraw.py (opens in a new tab)scripts/render_template.html (opens in a new tab)scripts/uv.lock (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub tunoc2c/workbuddy-skill-official --plugin excalidraw-diagram