auto-diagram
Analyze inspected source and generate a scoped architecture overview. Use when the user asks to "diagram this repo", "visualize…
Edit saved native Excalidraw diagrams with scoped file operations, or generate diagrams from specified components, a sample, or a description. Use for diagram edits, data flows, parameter traces, and PNG/SVG exports. For codebase discovery, use auto-diagram.
$ npx -y skills add edwingao28/excalidraw-toolkit --skill excalidraw --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/excalidrawContext preview
The summary Claude sees to decide when to auto-load this skill.
Edit saved native Excalidraw diagrams with scoped file operations, or generate diagrams from specified components, a sample, or a description. Use for diagram edits, data flows, parameter traces, and PNG/SVG exports. For codebase discovery, use auto-diagram.
name: excalidraw description: Edit saved native Excalidraw diagrams with scoped file operations, or generate diagrams from specified components, a sample, or a description. Use for diagram edits, data flows, parameter traces, and PNG/SVG exports. For codebase discovery, use auto-diagram.
For an existing saved diagram, use the file workflow below. For a new diagram, use the live canvas workflow that follows it.
Load the installed `scoped-edit` skill when the user asks to modify a saved `.excalidraw` file, including recoloring or relabeling it. The project installation places it in `.claude/skills/scoped-edit/SKILL.md` for Claude Code or `.agents/skills/scoped-edit/SKILL.md` for Codex. Its generated command prefix records the absolute Node and CLI paths; keep those paths unchanged.
Follow that skill's inspect → supported request → edited copy → receipt and PNG inspection workflow. `inspect` determines the available operations and target restrictions. Report missing installation or an unsupported operation explicitly. Preserve the saved scene and its original bytes; canvas clearing or regeneration does not implement a scoped edit. The remaining steps apply to new live diagrams.
---
You are **placing shapes on a 2D canvas** and **drawing arrows between them**.
(0,0) ────────── x increases ──────────► │ │ ┌──────────┐ ┌──────────┐ │ │ Box A │─────►│ Box B │ │ └──────────┘ └──────────┘ │ │ y ▼ increases ┌──────────┐ │ │ Box C │ ▼ └──────────┘
**Everything is (x, y, width, height).** That's it.
---
| Tool | What It Does | When to Use | |------|-------------|-------------| | `read_diagram_guide` | Returns color palette + sizing rules | **First call.** Read once, use throughout. | | `batch_create_elements` | Create many shapes + arrows at once | Main workhorse. Create your whole diagram in 1-2 calls. | | `get_canvas_screenshot` | Take a photo of the current canvas | **After every batch.** Verify it looks right. | | `clear_canvas` | Replace the current scene with an empty canvas | Only when the user explicitly requests replacement of the current canvas. | | `export_to_image` | Save as PNG or SVG | Final step if user wants an image file. |
Other useful tools: `describe_scene` (text description of canvas), `create_from_mermaid` (quick diagram from Mermaid syntax), `export_scene` (save as .excalidraw JSON file), `set_viewport` (zoom/pan to fit), `export_to_excalidraw_url` (shareable link).
---
A shape has: **type, position (x, y), size (width, height), colors, and label text.**
{
"type": "rectangle",
"id": "my-box",
"x": 100,
"y": 100,
"width": 180,
"height": 70,
"backgroundColor": "#a5d8ff",
"strokeColor": "#1971c2",
"roughness": 0,
"text": "My Service\nPort 8080"
}**Key points:**
---
New arrows connect shapes **by ID**. The MCP creation helper computes endpoint positions; inspect the resulting geometry and screenshot before considering the connection complete.
{
"type": "arrow",
"x": 0,
"y": 0,
"startElementId": "my-box",
"endElementId": "other-box",
"strokeColor": "#1971c2",
"text": "HTTP"
}**Key points:**
---
Read the codebase. Identify:
Record source paths and relevant line ranges or symbols for code-derived components and connections. Distinguish imports, observed call sites, and assumptions; an import or valid source reference alone does not prove a runtime interaction. State unresolved connections and the inspected scope. Proceed with a clear diagram request; ask only when a material ambiguity prevents selecting the content or target.
**When a sample diagram is provided** (ASCII art, text mockup, screenshot, etc.):
mcp__excalidraw__read_diagram_guide()
This returns the color palette, sizing rules, and layout best practices. Use it.
Call `query_elements` and `get_canvas_screenshot` before creating elements. Record existing IDs and choose an empty region for the new diagram. Use fresh IDs for this request and preserve u
Diagram with your agent. Stay in control. Use Claude Code or Codex to edit an existing Excalidraw diagram. Review what changed, keep drawing in the same workspace, and export a native file you can keep editing.
Analyze inspected source and generate a scoped architecture overview. Use when the user asks to "diagram this repo", "visualize…
Edit a saved .excalidraw diagram while preserving manual content, explain a scoped source flow, or compare a code change with…