agentsclimarketplace

Excalidraw diagram

Skill gilbertsahumada/excalidraw-diagram-plugin/skills/excalidraw-diagram

Create Excalidraw diagram JSON files that make visual arguments. Use when the user wants to visualize workflows, architectures, or concepts.From its SKILL.md

Install
npx -y skills add gilbertsahumada/excalidraw-diagram-plugin --skill excalidraw-diagram

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

2 things to look at

  • no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
  • 2 stars2 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

SKILL.md

33.6 KB, as published. Nobody here has run it

Excalidraw Diagram Creator

Generate .excalidraw JSON files that argue visually, not just display information.

Setup: If the user asks you to set up this skill (renderer, dependencies, etc.), see README.md for instructions.

Customization

All colors and brand-specific styles live in one file: references/color-palette.md. Read it before generating any diagram and use it as the single source of truth for all color choices — shape fills, strokes, text colors, evidence artifact backgrounds, everything.

To make this skill produce diagrams in your own brand style, edit color-palette.md. Everything else in this file is universal design methodology and Excalidraw best practices.


Core Philosophy

Diagrams should ARGUE, not DISPLAY.

A diagram isn't formatted text. It's a visual argument that shows relationships, causality, and flow that words alone can't express. The shape should BE the meaning.

The Isomorphism Test: If you removed all text, would the structure alone communicate the concept? If not, redesign.

The Education Test: Could someone learn something concrete from this diagram, or does it just label boxes? A good diagram teaches—it shows actual formats, real event names, concrete examples.


Depth Assessment (Do This First)

Before designing, determine what level of detail this diagram needs:

Simple/Conceptual Diagrams

Use abstract shapes when:

  • Explaining a mental model or philosophy
  • The audience doesn't need technical specifics
  • The concept IS the abstraction (e.g., "separation of concerns")

Comprehensive/Technical Diagrams

Use concrete examples when:

  • Diagramming a real system, protocol, or architecture
  • The diagram will be used to teach or explain (e.g., YouTube video)
  • The audience needs to understand what things actually look like
  • You're showing how multiple technologies integrate

For technical diagrams, you MUST include evidence artifacts (see below).


Research Mandate (For Technical Diagrams)

Before drawing anything technical, research the actual specifications.

If you're diagramming a protocol, API, or framework:

  1. Look up the actual JSON/data formats
  2. Find the real event names, method names, or API endpoints
  3. Understand how the pieces actually connect
  4. Use real terminology, not generic placeholders

Bad: "Protocol" → "Frontend" Good: "AG-UI streams events (RUN_STARTED, STATE_DELTA, A2UI_UPDATE)" → "CopilotKit renders via createA2UIMessageRenderer()"

Research makes diagrams accurate AND educational.


Evidence Artifacts

Evidence artifacts are concrete examples that prove your diagram is accurate and help viewers learn. Include them in technical diagrams.

Types of evidence artifacts (choose what's relevant to your diagram):

Artifact TypeWhen to UseHow to Render
Code snippetsAPIs, integrations, implementation detailsDark rectangle + syntax-colored text (see color palette for evidence artifact colors)
Data/JSON examplesData formats, schemas, payloadsDark rectangle + colored text (see color palette)
Event/step sequencesProtocols, workflows, lifecyclesTimeline pattern (line + dots + labels)
UI mockupsShowing actual output/resultsNested rectangles mimicking real UI
Real input contentShowing what goes IN to a systemRectangle with sample content visible
API/method namesReal function calls, endpointsUse actual names from docs, not placeholders

Example: For a diagram about a streaming protocol, you might show:

  • The actual event names from the spec (not just "Event 1", "Event 2")
  • A code snippet showing how to connect
  • What the streamed data actually looks like

Example: For a diagram about a data transformation pipeline:

  • Show sample input data (actual format, not "Input")
  • Show sample output data (actual format, not "Output")
  • Show intermediate states if relevant

The key principle: show what things actually look like, not just what they're called.


Multi-Zoom Architecture

Comprehensive diagrams operate at multiple zoom levels simultaneously. Think of it like a map that shows both the country borders AND the street names.

Level 1: Summary Flow

A simplified overview showing the full pipeline or process at a glance. Often placed at the top or bottom of the diagram.

Example: Input → Processing → Output or Client → Server → Database

Level 2: Section Boundaries

Labeled regions that group related components. These create visual "rooms" that help viewers understand what belongs together.

Example: Grouping by responsibility (Backend / Frontend), by phase (Setup / Execution / Cleanup), or by team (User / System / External)

Level 3: Detail Inside Sections

Evidence artifacts, code snippets, and concrete examples within each section. This is where the educational value lives.

Example: Inside a "Backend" section, you might show the actual API response format, not just a box labeled "API Response"

For comprehensive diagrams, aim to include all three levels. The summary gives context, the sections organize, and the details teach.

Bad vs Good

Bad (Displaying)Good (Arguing)
5 equal boxes with labelsEach concept has a shape that mirrors its behavior
Card grid layoutVisual structure matches conceptual structure
Icons decorating textShapes that ARE the meaning
Same container for everythingDistinct visual vocabulary per concept
Everything in a boxFree-floating text with selective containers

Simple vs Comprehensive (Know Which You Need)

Simple DiagramComprehensive Diagram
Generic labels: "Input" → "Process" → "Output"Specific: shows what the input/output actually looks like
Named boxes: "API", "Database", "Client"Named boxes + examples of actual requests/responses
"Events" or "Messages" labelTimeline with real event/message names from the spec
"UI" or "Dashboard" rectangleMockup showing actual UI elements and content
~30 seconds to explain~2-3 minutes of teaching content
Viewer learns the structureViewer learns the structure AND the details

Simple diagrams are fine for abstract concepts, quick overviews, or when the audience already knows the details. Comprehensive diagrams are needed for technical architectures, tutorials, educational content, or when you want the diagram itself to teach.


Container vs. Free-Floating Text

Not every piece of text needs a shape around it. Default to free-floating text. Add containers only when they serve a purpose.

Use a Container When...Use Free-Floating Text When...
It's the focal point of a sectionIt's a label or description
It needs visual grouping with other elementsIt's supporting detail or metadata
Arrows need to connect to itIt describes something nearby
The shape itself carries meaning (decision diamond, etc.)Typography alone creates sufficient hierarchy
It represents a distinct "thing" in the systemIt's a section title, subtitle, or annotation

Typography as hierarchy: Use font size, weight, and color to create visual hierarchy without boxes. A 28px title doesn't need a rectangle around it.

The container test: For each boxed element, ask "Would this work as free-floating text?" If yes, remove the container.

Text inside a shape MUST be centered

When you DO put text inside a rectangle/ellipse/diamond, it must be centered both horizontally AND vertically. Top-aligned text inside a tall rectangle looks broken.

Pattern: text bbox SMALLER than container, manually y-centered, bound via containerId.

// rectangle (container) — 240×80
{
  "type": "rectangle",
  "id": "tile_a",
  "x": 100, "y": 100, "width": 240, "height": 80,
  "boundElements": [{"id": "tile_a_text", "type": "text"}],
  ...
}
// text — own bbox sized for the text content, y-offset to vertically center
//   text dims via estimate_text_size("STDIO transport", fontSize=16, fontFamily=3) → e.g. (135, 23)
//   y = container.y + (container.h - text.h) / 2 = 100 + (80 - 23)/2 = 128
{
  "type": "text",
  "id": "tile_a_text",
  "x": 100, "y": 128, "width": 240, "height": 23,
  "containerId": "tile_a",
  "text": "STDIO transport",
  "textAlign": "center",
  "verticalAlign": "middle",
  "fontSize": 16, "fontFamily": 3,
  ...
}

Why this pattern (and not text bbox = container bbox):

  • Excalidraw's render engine glues the text glyph to the TOP of its own bbox when bbox.height >> text content height — verticalAlign: middle does not save you. So the text's own height MUST be close to the actual rendered text height.
  • Use estimate_text_size(text, font_size, font_family) from references/layout.py to compute the right (width, height) for the text bbox.
  • Then offset y = container.y + (container.h - text.h) / 2 to center vertically.
  • textAlign: "center" + matching width = container's width handles horizontal centering.
  • containerId + boundElements keeps the logical binding so move/resize stays consistent.

If a shape has multiple text elements (e.g. title + body), only one can be the container's bound text. The others belong free-floating below the shape, not inside it.


Design Process (Do This BEFORE Generating JSON)

Step 0: Assess Depth Required

Before anything else, determine if this needs to be:

  • Simple/Conceptual: Abstract shapes, labels, relationships (mental models, philosophies)
  • Comprehensive/Technical: Concrete examples, code snippets, real data (systems, architectures, tutorials)

If comprehensive: Do research first. Look up actual specs, formats, event names, APIs.

Step 1: Understand Deeply

Read the content. For each concept, ask:

  • What does this concept DO? (not what IS it)
  • What relationships exist between concepts?
  • What's the core transformation or flow?
  • What would someone need to SEE to understand this? (not just read about)

Step 2: Map Concepts to Patterns

For each concept, find the visual pattern that mirrors its behavior:

If the concept...Use this pattern
Spawns multiple outputsFan-out (radial arrows from center)
Combines inputs into oneConvergence (funnel, arrows merging)
Has hierarchy/nestingTree (lines + free-floating text)
Is a sequence of stepsTimeline (line + dots + free-floating labels)
Loops or improves continuouslySpiral/Cycle (arrow returning to start)
Is an abstract state or contextCloud (overlapping ellipses)
Transforms input to outputAssembly line (before → process → after)
Compares two thingsSide-by-side (parallel with contrast)
Separates into phasesGap/Break (visual separation between sections)
Has N items with shared attributesGrid (card grid or data table — see below)
Needs structured data displayTable (grid_table with colored headers)

When to use Grid layouts

Grids are the right pattern when you have 3+ items that share the same attributes and the viewer needs to scan/compare them. Two flavors:

Card grid (card_grid() from references/charts.py): styled cards in rows × cols. Each card has a colored header, body text, and optional accent stripe. Use for:

  • Feature comparisons (3-5 products/tools side by side)
  • Pattern catalogs (like prompt engineering patterns)
  • Multi-concept overviews where each concept deserves its own visual region

Data table (grid_table() from references/charts.py): header row + body rows with cell borders. Use for:

  • Structured specs (model comparison, API endpoints, config options)
  • Any content that is naturally tabular (rows × columns of data)

Grid helpers accept stroke_style ("solid", "dashed", "dotted") and custom colors for headers/cells.

When NOT to use grids: if items have parent-child relationships (use tree), if items form a sequence (use timeline/assembly), or if there are only 2 items (use side-by-side).

Step 3: Ensure Variety

For multi-concept diagrams: each major concept must use a different visual pattern. Uniform card grids for an entire diagram are still wrong — but a grid section alongside timeline, fan-out, and evidence sections is excellent.

Step 4: Sketch the Flow

Before JSON, mentally trace how the eye moves through the diagram. There should be a clear visual story.

Step 5: Generate JSON

Only now create the Excalidraw elements. See below for how to handle large diagrams.

Step 6: Render & Validate (MANDATORY)

After generating the JSON, you MUST run the render-view-fix loop until the diagram looks right. This is not optional — see the Render & Validate section below for the full process.


Large / Comprehensive Diagram Strategy

For comprehensive or technical diagrams, you MUST build the JSON one section at a time. Do NOT attempt to generate the entire file in a single pass. This is a hard constraint — Claude Code has a ~32,000 token output limit per response, and a comprehensive diagram easily exceeds that in one shot. Even if it didn't, generating everything at once leads to worse quality. Section-by-section is better in every way.

The Section-by-Section Workflow

Phase 1: Build each section

  1. Create the base file with the JSON wrapper (type, version, appState, files) and the first section of elements.
  2. Add one section per edit. Each section gets its own dedicated pass — take your time with it. Think carefully about the layout, spacing, and how this section connects to what's already there.
  3. Use descriptive string IDs (e.g., "trigger_rect", "arrow_fan_left") so cross-section references are readable.
  4. Namespace seeds by section (e.g., section 1 uses 100xxx, section 2 uses 200xxx) to avoid collisions.
  5. Update cross-section bindings as you go. When a new section's element needs to bind to an element from a previous section (e.g., an arrow connecting sections), edit the earlier element's boundElements array at the same time.

Phase 2: Review the whole

After all sections are in place, read through the complete JSON and check:

  • Are cross-section arrows bound correctly on both ends?
  • Is the overall spacing balanced, or are some sections cramped while others have too much whitespace?
  • Do IDs and bindings all reference elements that actually exist?

Fix any alignment or binding issues before rendering.

Phase 3: Render & validate

Now run the render-view-fix loop from the Render & Validate section. This is where you'll catch visual issues that aren't obvious from JSON — overlaps, clipping, imbalanced composition.

Section Boundaries

Plan your sections around natural visual groupings from the diagram plan. A typical large diagram might split into:

  • Section 1: Entry point / trigger
  • Section 2: First decision or routing
  • Section 3: Main content (hero section — may be the largest single section)
  • Section 4-N: Remaining phases, outputs, etc.

Each section should be independently understandable: its elements, internal arrows, and any cross-references to adjacent sections.

What NOT to Do

  • Don't generate the entire diagram in one response. You will hit the output token limit and produce truncated, broken JSON. Even if the diagram is small enough to fit, splitting into sections produces better results.
  • Don't use a coding agent to generate the JSON. The agent won't have sufficient context about the skill's rules, and the coordination overhead negates any benefit.
  • Don't write a Python generator script. The templating and coordinate math seem helpful but introduce a layer of indirection that makes debugging harder. Hand-crafted JSON with descriptive IDs is more maintainable.

Visual Pattern Library

Fan-Out (One-to-Many)

Central element with arrows radiating to multiple targets. Use for: sources, PRDs, root causes, central hubs.

        ○
       ↗
  □ → ○
       ↘
        ○

Convergence (Many-to-One)

Multiple inputs merging through arrows to single output. Use for: aggregation, funnels, synthesis.

  ○ ↘
  ○ → □
  ○ ↗

Tree (Hierarchy)

Parent-child branching with connecting lines and free-floating text (no boxes needed). Use for: file systems, org charts, taxonomies.

  label
  ├── label
  │   ├── label
  │   └── label
  └── label

Use line elements for the trunk and branches, free-floating text for labels.

Spiral/Cycle (Continuous Loop)

Elements in sequence with arrow returning to start. Use for: feedback loops, iterative processes, evolution.

  □ → □
  ↑     ↓
  □ ← □

Cloud (Abstract State)

Overlapping ellipses with varied sizes. Use for: context, memory, conversations, mental states.

Assembly Line (Transformation)

Input → Process Box → Output with clear before/after. Use for: transformations, processing, conversion.

  ○○○ → [PROCESS] → □□□
  chaos              order

Side-by-Side (Comparison)

Two parallel structures with visual contrast. Use for: before/after, options, trade-offs.

Gap/Break (Separation)

Visual whitespace or barrier between sections. Use for: phase changes, context resets, boundaries.

Lines as Structure

Use lines (type: line, not arrows) as primary structural elements instead of boxes:

  • Timelines: Vertical or horizontal line with small dots (10-20px ellipses) at intervals, free-floating labels beside each dot
  • Tree structures: Vertical trunk line + horizontal branch lines, with free-floating text labels (no boxes needed)
  • Dividers: Thin dashed lines to separate sections
  • Flow spines: A central line that elements relate to, rather than connecting boxes
Timeline:           Tree:
  ●─── Label 1        │
  │                   ├── item
  ●─── Label 2        │   ├── sub
  │                   │   └── sub
  ●─── Label 3        └── item

Lines + free-floating text often creates a cleaner result than boxes + contained text.


Shape Meaning

Choose shape based on what it represents—or use no shape at all:

Concept TypeShapeWhy
Labels, descriptions, detailsnone (free-floating text)Typography creates hierarchy
Section titles, annotationsnone (free-floating text)Font size/weight is enough
Markers on a timelinesmall ellipse (10-20px)Visual anchor, not container
Start, trigger, inputellipseSoft, origin-like
End, output, resultellipseCompletion, destination
Decision, conditiondiamondClassic decision symbol
Process, action, steprectangleContained action
Abstract state, contextoverlapping ellipseFuzzy, cloud-like
Hierarchy nodelines + text (no boxes)Structure through lines

Rule: Default to no container. Add shapes only when they carry meaning. Aim for <30% of text elements to be inside containers.


Color as Meaning

Colors encode information, not decoration. Every color choice should come from references/color-palette.md — the semantic shape colors, text hierarchy colors, and evidence artifact colors are all defined there.

Key principles:

  • Each semantic purpose (start, end, decision, AI, error, etc.) has a specific fill/stroke pair
  • Free-floating text uses color for hierarchy (titles, subtitles, details — each at a different level)
  • Evidence artifacts (code snippets, JSON examples) use their own dark background + colored text scheme
  • Always pair a darker stroke with a lighter fill for contrast

Do not invent new colors. If a concept doesn't fit an existing semantic category, use Primary/Neutral or Secondary.

Light vs Dark mode

Most native Excalidraw users work on dark canvas. Default light-mode colors (e.g. #3b82f6 bright blue) wash out against #0f172a background. Switch to the dark palette in color-palette.md when:

  • User says "dark mode" / "dark canvas" / "dark theme"
  • User shares a reference with dark viewBackgroundColor
  • Output target is video/slides on dark theme

To switch a diagram to dark mode:

  1. Set appState.viewBackgroundColor: "#0f172a" (instead of #ffffff)
  2. Use dark palette for all shape fills/strokes (inverted: dark fill + bright stroke)
  3. Use light text colors: titles #f1f5f9, body #94a3b8
  4. Evidence artifacts can use deeper bg #020617 and brighter green #4ade80

Don't mix: a diagram is fully light OR fully dark, not both.


Modern Aesthetics

For clean, professional diagrams:

Roughness

  • roughness: 0 — Clean, crisp edges. Use for modern/technical diagrams.
  • roughness: 1 — Hand-drawn, organic feel. Use for brainstorming/informal diagrams.

Default to 0 for most professional use cases. Use roughness: 1 when you want warmth or an informal feel.

Fill Style (visual texture inside shapes)

  • fillStyle: "solid" — Flat color. Default for clean diagrams.
  • fillStyle: "hachure" — Diagonal hatching lines. Adds hand-drawn texture. Good for supporting shapes.
  • fillStyle: "cross-hatch" — Cross-hatched grid pattern. Creates visual weight. Good for hero/emphasis shapes.

Use fill styles for visual hierarchy within a diagram: hero shapes get cross-hatch, supporting shapes get hachure, background/subtle shapes get solid. Don't use the same fill style for everything.

Stroke Style (lines and arrows)

  • strokeStyle: "solid" — Default. Primary flow and connections.
  • strokeStyle: "dashed" — Optional paths, async flow, feedback loops, "maybe" relationships.
  • strokeStyle: "dotted" — Weak connections, annotations, secondary detail.

Mix stroke styles in one diagram to create visual depth: primary flow = solid, feedback = dashed, annotations = dotted.

Arrow Heads

  • endArrowhead: "arrow" — Filled triangle (default). Shows direction.
  • endArrowhead: "bar" — Flat bar. Shows termination/boundary.
  • endArrowhead: "dot" — Circle. Shows connection point.
  • endArrowhead: "triangle" — Open triangle. Lighter directional hint.
  • endArrowhead: null — No head. For structural lines.

Use startArrowhead for bidirectional arrows.

Stroke Width

  • strokeWidth: 1 — Thin, elegant. Good for lines, dividers, subtle connections.
  • strokeWidth: 2 — Standard. Good for shapes and primary arrows.
  • strokeWidth: 3 — Bold. Use sparingly for emphasis (main flow line, key connections).

Opacity

Always use opacity: 100 for all elements. Use color, size, and stroke width to create hierarchy instead of transparency.

Small Markers Instead of Shapes

Instead of full shapes, use small dots (10-20px ellipses) as:

  • Timeline markers
  • Bullet points
  • Connection nodes
  • Visual anchors for free-floating text

Layout Principles

Hierarchy Through Scale

  • Hero: 300×150 - visual anchor, most important
  • Primary: 180×90
  • Secondary: 120×60
  • Small: 60×40

Whitespace = Importance

The most important element has the most empty space around it (200px+).

Flow Direction

Guide the eye: typically left→right or top→bottom for sequences, radial for hub-and-spoke.

Connections Required

Position alone doesn't show relationships. If A relates to B, there must be an arrow.


Text Rules

CRITICAL: The JSON text property contains ONLY readable words.

{
  "id": "myElement1",
  "text": "Start",
  "originalText": "Start"
}

Settings: fontSize: 16, fontFamily: 3, textAlign: "center", verticalAlign: "middle"


JSON Structure

{
  "type": "excalidraw",
  "version": 2,
  "source": "https://excalidraw.com",
  "elements": [...],
  "appState": {
    "viewBackgroundColor": "#ffffff",
    "gridSize": 20
  },
  "files": {}
}

Element Templates

See references/element-templates.md for copy-paste JSON templates for each element type (text, line, dot, rectangle, arrow). Pull colors from references/color-palette.md based on each element's semantic purpose.


Tooling

Use these helpers instead of computing coordinates and merging JSON by hand.

Coordinate helpers — references/layout.py

Pure-Python helpers for common patterns. Import or run inline:

  • fan_out(center, n, radius, angle_span, start_angle) — radial points around a hub
  • timeline(y, x_start, x_end, n) — evenly-spaced markers on a horizontal line
  • tree(root_xy, n_branches, level_height, branch_width) — trunk + branch coordinates
  • side_by_side(left_x, right_x, y, width, height) — parallel column layout
  • section(index, y_start, content_height) — title/divider/content y-coords for a numbered section
  • stack(start_xy, item_sizes, direction, gap) — stack elements with consistent gap

Use these for any pattern with >2 elements. Hand-computed coords drift; helpers don't.

Pre-render lint — references/lint.py

Run before every render to catch issues that the render-validate loop would otherwise burn iterations on:

cd .claude/skills/excalidraw-diagram/references && uv run python lint.py path/to/file.excalidraw

Checks: bbox overlap, text-overflow inside containers, arrows pointing into nothing, container ratio (>30% triggers warning), required fields. Exit 0 if clean.

Section-by-section merging — references/append_section.py

For comprehensive diagrams, build sections in separate files and merge:

uv run python append_section.py base.excalidraw new_section.json

Auto-namespaces seeds, renames colliding IDs (and updates internal references), reports next available y. Avoids hand-merging large JSON.

Charts & visual helpers — references/charts.py

Pure-Python helpers that emit Excalidraw element dicts:

  • bar_chart(x, y, w, h, data, ...) — single-series vertical bars
  • line_chart(x, y, w, h, data, ...) — connected polyline + dot markers
  • grouped_bar_chart(x, y, w, h, data, ...) — multi-series side-by-side bars + legend
  • pie_slice_approximation(cx, cy, r, data, ...) — horizontal stacked-bar (Excalidraw can't render arcs)
  • card_grid(x, y, cards, cols, ...) — styled card grid (header strip + body)
  • grid_table(x, y, headers, rows, ...) — data table with colored header
  • code_block(x, y, code, language, theme_name, ...) — syntax-highlighted code via Pygments. One text element per token, each colored by its Pygments token type. Supports 500+ languages, light + dark themes. Cascadia mono required for alignment (fontFamily=3).
from charts import code_block

elements.extend(code_block(
    x=80, y=200,
    code='def hello():\n    print("hi")\n',
    language="python",       # or "json", "yaml", "typescript", "rust", "bash", ...
    font_size=14,
    theme_name="dark",       # "dark" or "light"
    seed_base=910000,
))

Use code_block instead of plain dark rect + green text whenever the diagram contains real source code. It produces ~40-100 text elements per block but renders with proper IDE-like coloring.

  • file_tree(x, y, tree, font_size, theme_name, ...) — directory structure as a diagram. Takes a nested list of (name, payload) tuples. Trailing / on a name marks it as a folder (payload = list of children); no slash marks it as a file (payload = inline comment string or None). Renders with proper ├──/│ /└── connectors, three colored spans per row (branch · name · comment), comments aligned in a fixed column.
from charts import file_tree

elements.extend(file_tree(
    x=80, y=80,
    tree=[
        ("project/", [
            ("src/", [
                ("main.py", "# entry point"),
                ("util.py", None),
            ]),
            ("README.md", "# docs"),
        ]),
    ],
    font_size=14,
    theme_name="dark",
))

Prefer file_tree over hand-drawing a tree with rectangles + connectors when you want a code-listing style structure (e.g., showing repo layout in onboarding diagrams).

Examples gallery — examples/

Six pattern starters. Copy and modify rather than build from scratch:

  • examples/fan-out.excalidraw
  • examples/timeline.excalidraw
  • examples/tree.excalidraw
  • examples/side-by-side.excalidraw
  • examples/assembly-line.excalidraw
  • examples/convergence.excalidraw

Render & Validate (MANDATORY)

You cannot judge a diagram from JSON alone. After generating or editing the Excalidraw JSON, you MUST render it to PNG, view the image, and fix what you see — in a loop until it's right. This is a core part of the workflow, not a final check.

How to Render

cd .claude/skills/excalidraw-diagram/references && uv run python render_excalidraw.py <path-to-file.excalidraw>

This outputs a PNG next to the .excalidraw file. Then use the Read tool on the PNG to actually view it.

The Loop

After generating the initial JSON, run this cycle:

0. Lint first — Before rendering, run uv run python lint.py <file> from the references directory. Fix any reported issues (overlaps, text overflow, dangling arrows, excessive containers) before burning a render cycle. Lint exits 0 when clean.

1. Render & View — Run the render script, then Read the PNG.

2. Audit against your original vision — Before looking for bugs, compare the rendered result to what you designed in Steps 1-4. Ask:

  • Does the visual structure match the conceptual structure you planned?
  • Does each section use the pattern you intended (fan-out, convergence, timeline, etc.)?
  • Does the eye flow through the diagram in the order you designed?
  • Is the visual hierarchy correct — hero elements dominant, supporting elements smaller?
  • For technical diagrams: are the evidence artifacts (code snippets, data examples) readable and properly placed?

3. Check for visual defects:

  • Text clipped by or overflowing its container
  • Text or shapes overlapping other elements
  • Arrows crossing through elements instead of routing around them
  • Arrows landing on the wrong element or pointing into empty space
  • Labels floating ambiguously (not clearly anchored to what they describe)
  • Uneven spacing between elements that should be evenly spaced
  • Sections with too much whitespace next to sections that are too cramped
  • Text too small to read at the rendered size
  • Overall composition feels lopsided or unbalanced

4. Fix — Edit the JSON to address everything you found. Common fixes:

  • Widen containers when text is clipped
  • Adjust x/y coordinates to fix spacing and alignment
  • Add intermediate waypoints to arrow points arrays to route around elements
  • Reposition labels closer to the element they describe
  • Resize elements to rebalance visual weight across sections

5. Re-render & re-view — Run the render script again and Read the new PNG.

6. Repeat — Keep cycling until the diagram passes both the vision check (Step 2) and the defect check (Step 3). Typically takes 2-4 iterations. Don't stop after one pass just because there are no critical bugs — if the composition could be better, improve it.

When to Stop

The loop is done when:

  • The rendered diagram matches the conceptual design from your planning steps
  • No text is clipped, overlapping, or unreadable
  • Arrows route cleanly and connect to the right elements
  • Spacing is consistent and the composition is balanced
  • You'd be comfortable showing it to someone without caveats

First-Time Setup

If the render script hasn't been set up yet:

cd .claude/skills/excalidraw-diagram/references
uv sync
uv run playwright install chromium

Quality Checklist

Depth & Evidence (Check First for Technical Diagrams)

  1. Research done: Did you look up actual specs, formats, event names?
  2. Evidence artifacts: Are there code snippets, JSON examples, or real data?
  3. Multi-zoom: Does it have summary flow + section boundaries + detail?
  4. Concrete over abstract: Real content shown, not just labeled boxes?
  5. Educational value: Could someone learn something concrete from this?

Conceptual

  1. Isomorphism: Does each visual structure mirror its concept's behavior?
  2. Argument: Does the diagram SHOW something text alone couldn't?
  3. Variety: Does each major concept use a different visual pattern?
  4. No uniform containers: Avoided card grids and equal boxes?

Container Discipline

  1. Minimal containers: Could any boxed element work as free-floating text instead?
  2. Lines as structure: Are tree/timeline patterns using lines + text rather than boxes?
  3. Typography hierarchy: Are font size and color creating visual hierarchy (reducing need for boxes)?

Structural

  1. Connections: Every relationship has an arrow or line
  2. Flow: Clear visual path for the eye to follow
  3. Hierarchy: Important elements are larger/more isolated

Technical

  1. Text clean: text contains only readable words
  2. Font: fontFamily: 3
  3. Roughness: roughness: 0 for clean/modern (unless hand-drawn style requested)
  4. Opacity: opacity: 100 for all elements (no transparency)
  5. Container ratio: <30% of text elements should be inside containers

Visual Validation (Render Required)

  1. Rendered to PNG: Diagram has been rendered and visually inspected
  2. No text overflow: All text fits within its container
  3. No overlapping elements: Shapes and text don't overlap unintentionally
  4. Even spacing: Similar elements have consistent spacing
  5. Arrows land correctly: Arrows connect to intended elements without crossing others
  6. Readable at export size: Text is legible in the rendered PNG
  7. Balanced composition: No large empty voids or overcrowded regions

Keep looking

Skills are one crate of 609,689. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.