excalidraw-diagram
Generate Excalidraw diagrams from text content. Supports three output modes - Obsidian (.md), Standard (.excalidraw), and Animated (.excalidraw with animation order). Triggers on "Excalidraw", "diagram", "standard excalidraw", "animate".
git clone --depth 1 https://github.com/breferrari/obsidian-mind /tmp/excalidraw-diagram && cp -r /tmp/excalidraw-diagram/.claude/skills/excalidraw-diagram ~/.claude/skills/excalidraw-diagramSKILL.md
# Excalidraw Diagram Generator
Create Excalidraw diagrams from text content with multiple output formats.
## Output Modes
Select output mode based on the user's trigger words:
| Trigger Words | Output Mode | File Format | Use Case |
|---------------|-------------|-------------|----------|
| `Excalidraw`, `diagram`, `flowchart`, `mind map` | **Obsidian** (default) | `.md` | Open directly in Obsidian |
| `standard excalidraw` | **Standard** | `.excalidraw` | Open/edit/share on excalidraw.com |
| `animate`, `animated excalidraw` | **Animated** | `.excalidraw` | Drag to excalidraw-animate to generate animation |
## Workflow
1. **Detect output mode** from trigger words (see Output Modes table above)
2. Analyze content - identify concepts, relationships, hierarchy
3. Choose diagram type (see Diagram Types below)
4. Generate Excalidraw JSON (add animation order if Animated mode)
5. Output in correct format based on mode
6. **Automatically save to current working directory**
7. Notify user with file path and usage instructions
## Output Formats
### Mode 1: Obsidian Format (Default)
**Output strictly in the following structure, with no modifications:**
```markdown
---
excalidraw-plugin: parsed
tags: [excalidraw]
---
==⚠ Switch to EXCALIDRAW VIEW in the MORE OPTIONS menu of this document. ⚠== You can decompress Drawing data with the command palette: 'Decompress current Excalidraw file'. For more info check in plugin settings under 'Saving'
# Excalidraw Data
## Text Elements
%%
## Drawing
\`\`\`json
{complete JSON data}
\`\`\`
%%
```
**Key points:**
- Frontmatter must include `tags: [excalidraw]`
- Warning message must be included in full
- JSON must be wrapped in `%%` markers
- No `excalidraw-*` plugin settings in frontmatter other than `excalidraw-plugin: parsed` (the `tags: [excalidraw]` entry above is separate and still required)
- **File extension**: `.md`
### Mode 2: Standard Excalidraw Format
Output pure JSON file, openable on excalidraw.com:
```json
{
"type": "excalidraw",
"version": 2,
"source": "https://excalidraw.com",
"elements": [...],
"appState": {
"gridSize": null,
"viewBackgroundColor": "#ffffff"
},
"files": {}
}
```
**Key points:**
- `source` uses `https://excalidraw.com` (not the Obsidian plugin)
- Pure JSON, no Markdown wrapping
- **File extension**: `.excalidraw`
### Mode 3: Animated Excalidraw Format
Same as Standard format, but each element adds a `customData.animate` field to control animation order:
```json
{
"id": "element-1",
"type": "rectangle",
"customData": {
"animate": {
"order": 1,
"duration": 500
}
},
...other standard fields
}
```
**Animation order rules:**
- `order`: Playback order (1, 2, 3...) — lower numbers appear first
- `duration`: Drawing duration for the element (milliseconds), default 500
- Elements with the same `order` appear simultaneously
- Recommended order: title → main framework → connection lines → detail text
**Usage:**
1. Generate the `.excalidraw` file
2. Drag to https://dai-shi.github.io/excalidraw-animate/
3. Click Animate to preview, then export as SVG or WebM
**File extension**: `.excalidraw`
---
## Diagram Types & Selection Guide
Choose the appropriate diagram type to maximize clarity and visual impact.
| Type | Use Case | Approach |
|------|----------|----------|
| **Flowchart** | Step-by-step processes, workflows, task sequences | Connect steps with arrows, clearly show process flow |
| **Mind Map** | Concept expansion, topic categorization, brainstorming | Radiate outward from a central core |
| **Hierarchy** | Org charts, content levels, system decomposition | Build level nodes top-down or left-to-right |
| **Relationship** | Dependencies, influences, interactions between elements | Use lines between shapes to show relationships, with arrows and labels |
| **Comparison** | Side-by-side analysis of two or more approaches | Two columns or table format, with comparison dimensions labeled |
| **Timeline** | Event progression, project milestones, evolution | Use time as axis, mark key dates and events |
| **Matrix** | Two-dimensional categorization, priority grids, positioning | Establish X and Y dimensions, place items on coordinate plane |
| **Freeform** | Scattered content, brainstorming, initial information gathering | No structural constraints, freely place blocks and arrows |
## Design Rules
### Text & Format
- **All text elements must use** `fontFamily: 5` (Excalifont handwriting font)
- **Double quote replacement**: replace `"` with `『』`
- **Parentheses replacement**: replace `()` with `「」`
- **Font size rules** (hard minimums — below these values, text is unreadable at normal zoom):
- Title: 20-28px (minimum 20px)
- Subtitle: 18-20px
- Body/labels: 16-18px (minimum 16px)
- Minor annotations: 14px (only for unimportant auxiliary notes, use sparingly)
- **Never go below 14px**
- **Line height**: all text uses `lineHeight: 1.25`
- **Text centering**: standalone text elements have no auto-centering — manually calculate x coordinate:
- Estimate text width: `estimatedWidth = text.length * fontSize * 0.5`
- Centering formula: `x = centerX - estimatedWidth / 2`
- Example: text "Hello" (5 chars, fontSize 20) centered at x=300 → `estimatedWidth = 5 * 20 * 0.5 = 50` → `x = 300 - 25 = 275`
### Layout & Design
- **Canvas range**: keep all elements within 0-1200 x 0-800 area
- **Minimum shape size**: rectangles/ellipses with text must be at least 120x60px
- **Element spacing**: minimum 20-30px gap to prevent overlap
- **Clear hierarchy**: use different colors and shapes to distinguish information levels
- **Graphic elements**: use rectangles, circles, arrows etc. to organize information
- **No Emoji**: do not use any Emoji symbols in diagram text — use simple shapes (circles, squares, arrows) or color coding instead
### Color Palette
**Text colors (strokeColor for text):**
| Purpose | Hex | Description |
|---------|-----|-------------|
| Title |Proactively scans for achievements and wins that aren't in the brag doc yet. Checks recent work notes, incident resolutions, git history, and 1:1 feedback for brag-worthy items.
Load all vault context about a specific topic — person, project, incident, team, or concept. Gathers notes, backlinks, mentions, timeline, and produces a synthesized briefing.
Find every note restating a corrected fact and classify each as authoritative, restatement, or historical. Discovery and judgement only — never edits. Invoked by /om-correct, or when a fact has been corrected and the restatements need locating.
Scan recent or specified notes for missing wikilinks. Finds mentions of people, projects, teams, competencies, and incidents that should be linked but aren't. Suggests missing bidirectional links for user approval.
Bulk create or update person notes from Slack profiles. Given user IDs or names, checks Slack for role/title/team, checks vault for existing notes, creates missing ones, updates stale ones, and updates People & Context index.
Verify every factual claim in a review draft against vault sources. Returns verified/unverified/flagged claims.
Aggregate performance review material from the vault for a given period. Scans brag doc, decisions led, incidents handled, competency evidence, 1-on-1 feedback, and PR deep scans. Invoke via /om-review-brief or when the user asks for review prep.
Deep reconstruction of Slack conversations. Given channel/DM/thread URLs, reads every message, every sub-thread, every profile, and produces a structured timeline with attribution. Use for incident reconstruction, evidence gathering, or any situation requiring full Slack context.