Excalidraw Studio
Generate Excalidraw-format diagrams from natural language descriptions. Outputs .excalidraw JSON files that can be opened directly in Excalidraw (web, VS Code extension, or Obsidian plugin).
Workflow
Step 1: Understand the Request
Analyze the user's description to determine:
- Diagram type — Use the decision matrix below
- Key elements — Entities, steps, concepts, actors
- Relationships — Flow direction, connections, hierarchy
- Complexity — Number of elements (target: under 20 for clarity)
Step 2: Choose the Diagram Type and Visual Mode
Diagram type:
Visual mode — decide upfront and apply consistently to all elements:
Step 3: Extract Structured Information
Extract the key components based on diagram type. For each type, identify:
- Nodes/entities — What are the boxes/shapes?
- Connections — What connects to what, and with what label?
- Hierarchy — What contains what, what comes before what?
- Decision points — Where does the flow branch?
For detailed extraction guidelines per diagram type, read references/element-types.md.
Step 4: Generate the Excalidraw JSON
CRITICAL: Read references/excalidraw-schema.md before generating your first diagram. It contains the correct element format, text container model, and binding system.
Key rules for generation:
-
Text inside shapes — Use
boundElementson the shape and a separate text element withcontainerId. Never use alabelshorthand: -
Arrow labels — Also use
boundElements+ separate text element withcontainerId. Never use alabelshorthand on arrows: -
Arrow bindings — Use
startBinding/endBinding(notstart/end). Connected shapes must list the arrow in theirboundElements: -
Element order for z-index — Always declare shapes first, arrows second, text elements last. This guarantees text renders on top and is never obscured by arrows or other shapes.
-
Positioning — Use grid-aligned coordinates (multiples of 20px when
gridSize: 20). Leave 200-300px horizontal gap, 100-150px vertical gap between elements. -
Unique IDs — Every element must have a unique
id. Use descriptive IDs like"step-1","decision-valid","arrow-1-to-2","text-step-1". -
Colors — Use a consistent palette:
Step 5: Save and Present
-
Save as
<descriptive-name>.excalidraw -
Provide a summary:
Templates
Pre-built templates are available in assets/ for quick starting points. Use these when the diagram type matches — they provide correct structure and styling:
Read a template when creating that diagram type for the first time. Use its structure as a base, then modify elements to match the user's request.
Icon Libraries
For professional architecture diagrams with service icons (AWS, GCP, Azure, etc.), icon libraries can be set up. Read references/icon-libraries.md when:
- User requests an AWS/cloud architecture diagram
- User mentions wanting specific service icons
- You need to check if icon libraries are available
Best Practices
Element Count
If the user's request exceeds maximum, suggest breaking into multiple diagrams:
"Your request includes 15 components. For clarity, I recommend: (1) High-level architecture diagram with 6 main components, (2) Detailed sub-diagrams for each subsystem. Want me to start with the high-level view?"
Layout
- Flow direction: Left-to-right for processes, top-to-bottom for hierarchies
- Spacing: 200-300px horizontal, 100-150px vertical between elements
- Grid alignment: Position on multiples of 20px for clean alignment
- Margins: Minimum 50px from canvas edge
- Text sizing: 28-36px titles, 18-22px labels, 14-16px annotations
- Font: Use
fontFamily: 5(Excalifont) for hand-drawn consistency. Fallback to1(Virgil) if 5 is not supported. - Background zones: For architecture diagrams, add semi-transparent dashed zone rectangles (
opacity: 35,strokeStyle: "dashed",roughness: 0) as the first elements in the array to create visual grouping regions. Seereferences/excalidraw-schema.md→ Background Zones. - Element order: zones first → shapes → arrows → text elements (ensures correct z-index and text always renders on top)
Common Mistakes to Avoid
- ❌ Using
label: { text: "..." }shorthand on shapes or arrows — not supported by the Excalidraw parser - ❌ Putting
textdirectly on shape elements withoutcontainerId - ❌ Using
start/endfor arrow bindings — usestartBinding/endBindingwithelementId/focus/gap - ❌ Forgetting to add arrows to their connected shapes'
boundElementsarrays - ❌ Omitting
originalText,lineHeight,autoResize, orbackgroundColor: "transparent"from text elements inside containers - ❌ Omitting required base properties (
angle,strokeStyle,opacity,groupIds,frameId,index,isDeleted,seed,version,versionNonce,updated,link,locked) — elements will not render - ❌ Missing
"files": {}at the top level of the JSON - ❌ Using
roundness: { "type": 3 }on ellipses — ellipses must useroundness: null - ❌ Missing
lastCommittedPoint,startArrowhead,endArrowheadon arrows - ❌ Declaring text elements before arrows — text renders underneath and gets obscured
- ❌ Floating arrows without bindings (won't move with shapes)
- ❌ Overlapping elements (increase spacing)
- ❌ Inconsistent color usage (define palette upfront)
- ❌ Too many elements on one diagram (break into sub-diagrams)
Validation Checklist
Before delivering the diagram, verify:
- All elements have unique IDs
- Every element has ALL required base properties:
angle,strokeStyle,opacity,groupIds,frameId,index,isDeleted,link,locked,seed,version,versionNonce,updated -
indexvalues are assigned in order ("a0","a1", …) with text elements getting higher values than shapes/arrows - Top-level JSON includes
"files": {} - Shapes with text use
boundElements+ separate text element withcontainerId - Text elements inside containers have
containerId,originalText,lineHeight: 1.25,autoResize: true,roundness: null,backgroundColor: "transparent" - Arrows use
startBinding/endBinding(withelementId,focus,gap) when connecting shapes, pluslastCommittedPoint: null,startArrowhead: null,endArrowhead: "arrow" - Connected shapes list the arrow in their
boundElementsarrays - Element order: shapes → arrows → text elements (text always on top)
- Ellipses use
roundness: null(not{ "type": 3 }) - Coordinates prevent overlapping (check spacing)
- Text is readable (font size 16+)
- Colors follow consistent scheme
- File is valid JSON
- Element count is reasonable (<20 for clarity)
Troubleshooting
Limitations
- Complex curves are simplified to straight/basic curved lines
- Hand-drawn roughness is set to default (1)
- No embedded images in auto-generation (use icon libraries for service icons)
- Maximum recommended: 20 elements per diagram for clarity
- No automatic collision detection — use spacing guidelines

