From excalidraw-diagram
Generate and modify Excalidraw diagrams from natural language and code analysis using skeleton JSON and a Node.js converter
How this skill is triggered — by the user, by Claude, or both
Slash command
/excalidraw-diagram:excalidrawThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
Generate `.excalidraw` diagram files from natural language descriptions or code analysis. Uses a skeleton JSON intermediate format and a zero-dependency Node.js converter script.
Generate .excalidraw diagram files from natural language descriptions or code analysis. Uses a skeleton JSON intermediate format and a zero-dependency Node.js converter script.
| Action | How |
|---|---|
| Create a diagram | Generate skeleton JSON, pipe to converter |
| Modify a diagram | Read existing file, generate additions skeleton with --modify |
| Change layout | Set "layout" in skeleton: grid, top-down, left-right |
| Change theme | Set "theme" in skeleton: default, blueprint, warm, monochrome |
CONVERTER_PATH="${CLAUDE_PLUGIN_ROOT}/scripts/convert.js"
Write skeleton JSON to a temp file, then run the converter:
# Write skeleton to temp file
cat > /tmp/excalidraw-skeleton.json << 'SKELETON_EOF'
{
"type": "excalidraw-skeleton",
"version": 1,
"theme": "default",
"layout": "top-down",
"elements": [
{ "type": "ellipse", "id": "start", "label": "Start", "color": "green", "width": 120, "height": 60 },
{ "type": "rectangle", "id": "process", "label": "Process Data", "color": "blue" },
{ "type": "diamond", "id": "decision", "label": "Valid?", "color": "orange", "width": 140, "height": 100 },
{ "type": "rectangle", "id": "success", "label": "Save Result", "color": "green" },
{ "type": "rectangle", "id": "error", "label": "Handle Error", "color": "red" },
{ "type": "arrow", "from": "start", "to": "process" },
{ "type": "arrow", "from": "process", "to": "decision" },
{ "type": "arrow", "from": "decision", "to": "success", "label": "Yes" },
{ "type": "arrow", "from": "decision", "to": "error", "label": "No" }
]
}
SKELETON_EOF
# Convert
node "${CLAUDE_PLUGIN_ROOT}/scripts/convert.js" /tmp/excalidraw-skeleton.json ./diagram.excalidraw
# Write additions skeleton
cat > /tmp/excalidraw-additions.json << 'SKELETON_EOF'
{
"type": "excalidraw-skeleton",
"version": 1,
"elements": [
{ "type": "rectangle", "id": "cache", "label": "Redis Cache", "color": "red", "x": 500, "y": 200, "width": 180, "height": 70 },
{ "type": "arrow", "from": "cache", "to": "db", "label": "Fallback", "style": "dashed" }
],
"remove": ["legacy-adapter"]
}
SKELETON_EOF
# Modify
node "${CLAUDE_PLUGIN_ROOT}/scripts/convert.js" --modify ./architecture.excalidraw /tmp/excalidraw-additions.json ./architecture-updated.excalidraw
echo '{"type":"excalidraw-skeleton","version":1,"layout":"grid","elements":[{"type":"rectangle","id":"a","label":"Service A","color":"blue"},{"type":"rectangle","id":"b","label":"Service B","color":"green"},{"type":"arrow","from":"a","to":"b"}]}' | node "${CLAUDE_PLUGIN_ROOT}/scripts/convert.js" --stdin ./quick-diagram.excalidraw
rectangle — Default shape, good for services/processesdiamond — Decision points, conditionalsellipse — Start/end states, external entitiesfrom/to — Connect shapes by ID (converter handles binding)label — Text on the arrowstyle — solid, dashed, dottedstartArrowhead/endArrowhead — null, arrow, bar, circle, triangle, diamondSemantic names: blue, red, green, orange, violet, yellow, cyan, teal, pink, grape, gray, black, white, bronze
Or use hex: "#ff6600"
grid — Default, rows and columnstop-down / tree / flowchart — Hierarchy flows downwardleft-right / pipeline / flow — Flows left to rightdefault — Colorful with white backgroundblueprint — Dark background, light strokes, no fillswarm — Warm-toned backgroundsmonochrome — All grayWhen generating diagrams from a codebase:
Grep to find import statements, map dependencies between modules.Glob to find package.json files, understand module boundaries.Example analysis patterns:
# Find all imports in a directory
Grep: import.*from (in src/**/*.ts)
# Find package boundaries
Glob: **/package.json
# Find API routes
Grep: (router\.(get|post|put|delete)|app\.(get|post|put|delete))
# Find React components
Grep: export.*function.*\(|export.*const.*=.*=>
After running the converter, it outputs JSON to stdout:
{"success": true, "outputPath": "/absolute/path/to/diagram.excalidraw", "elementCount": 12, "message": "Wrote 12 elements to ..."}
Always report the file path to the user and suggest opening with excalidraw.com.
npx claudepluginhub fakoli/fakoli-plugins --plugin excalidraw-diagramGenerates Excalidraw JSON architecture diagrams from codebase analysis, including components, data flows, and groupings. Activates on diagram or visualization requests.
Generates .excalidraw architecture diagrams from codebase analysis, identifying components, services, databases, and data flows, with optional PNG/SVG export via Playwright.
Generates architecture diagrams on a live Excalidraw canvas from text, components, or samples for data flows, call chains, and exports to PNG/SVG/Excalidraw.