excalidraw-generator
Generate professional diagrams as valid Excalidraw JSON files — flowcharts, architecture, ER diagrams, mind maps, sequence diagrams, wireframes, C4 models, and more. Understands text, code, schemas, or verbal descriptions. Don't use for draw.io/Mermaid output, polished production slide decks, or pixel-perfect brand graphics.
What this skill does
# Excalidraw Diagram Generator
Generate professional diagrams as valid Excalidraw JSON. Every diagram goes through four phases: **Understand** the request, **Propose** options, **Generate** the JSON, and **Validate** before writing the file.
This SKILL.md is intentionally compact to fit the agent's context budget (token-efficient body). Long-form details live in `references/` — read the linked file when you need depth.
## When to Use
Use when the user asks for a diagram, flowchart, architecture sketch, ER/class/sequence diagram, mind map, wireframe, or C4 model and wants the output as an Excalidraw file (or embedded in Markdown via the `excalidraw` fenced block).
## Environment Check
If the Agent tool is available, use the subagent review loop described in `references/style-and-iteration.md` (Subagent Architecture). It provides fresh-context validation and avoids single-pass context overflow.
If the Agent tool is unavailable (e.g., Claude.ai), execute every phase inline and self-review against the 10 checks (less rigorous, but functional).
## Core Workflow
### Phase 1: Understand
Confirm what to draw before generating anything.
- **Clear description** ("draw a flowchart of user authentication"): restate your understanding in one sentence and propose the visualization type.
- **Ambiguous input**: ask targeted questions — main entities/nodes, relationships, flow direction, style preference.
- **Code, data, schemas, or files**: extract structure (code → class/dependency/architecture; SQL → ER; JSON/YAML → architecture/deployment; steps → flowchart/sequence; org data → org chart/tree).
### Phase 2: Propose
Present a plan with selectable options:
1. **Diagram type** — see `references/diagram-types.md` for the catalogue. If multiple fit, present numbered options.
2. **Key elements** — list the nodes/shapes you'll include.
3. **Layout** — propose 2–3 choices (e.g., `(A) Top-to-bottom`, `(B) Left-to-right`, `(C) Radial`).
4. **Style** — see `references/style-and-iteration.md`. Pick rendering style (clean/hand-drawn/sketchy) and color scheme that fits the diagram's purpose. No fixed palette.
5. **Complexity** — small (<10 elements), medium (10–30), large (30+).
Wait for confirmation. If the user says "just do it" or the request is straightforward, use sensible defaults (hand-drawn, roughness 1, Virgil font, best-fit layout) and proceed.
### Phase 3: Generate
Write a `.excalidraw` file (raw JSON, no wrapper) in the current working directory. Use kebab-case names (`auth-flow.excalidraw`). The required envelope:
```json
{
"type": "excalidraw",
"version": 2,
"source": "https://excalidraw.com",
"elements": [],
"appState": { "theme": "light", "viewBackgroundColor": "#ffffff" },
"files": {}
}
```
Set `theme` and `viewBackgroundColor` to whatever suits the diagram. For full element schema and field defaults, see `references/excalidraw-format.md`.
**Embedding in Markdown**: if the user asks to embed the diagram in a `.md` file, write the `.excalidraw` first, then a companion `.md` that references it via a fenced block tagged `excalidraw` containing the same JSON.
### Phase 4: Validate
Before writing the file, run all 10 checks on the in-memory JSON. Fix and re-check until all pass. Full check definitions and fix recipes are in `references/validation-checks.md`. Quick summary:
1. **Valid JSON** — top-level keys present.
2. **Required fields** — every element has the full field list (id, type, geometry, styling, `boundElements`, `seed`, etc.). Text adds `text/fontSize/fontFamily/textAlign/verticalAlign/containerId/originalText/lineHeight/autoResize`. Arrows add `points/startBinding/endBinding/startArrowhead/endArrowhead`.
3. **Unique IDs** — no duplicates.
4. **Two-way text bindings** — `containerId` ↔ `boundElements` `{type:"text"}`.
5. **Two-way arrow bindings** — `startBinding/endBinding` ↔ `boundElements` `{type:"arrow"}`.
6. **Arrow points** — `points` length ≥ 2 and `points[0] === [0,0]`.
7. **No unintentional overlaps** — bounding boxes don't overlap by more than 10px (unless grouped or inside a frame).
8. **Semantic completeness** — every entity/relationship the user mentioned is represented.
9. **Readable text** — `fontSize ≥ 16`, visible `strokeColor`, `lineHeight: 1.25` (never 1.35), `autoResize: true`.
10. **Shape-to-text size fit** — see below; this is the #1 failure mode.
#### Check 10 — shape sizing (always verify)
For every text element with `containerId`:
1. `line_count = text.split('\n').length`
2. `min_text_height = line_count * fontSize * 1.25`
3. `min_shape_height = min_text_height + 40` (20px padding top/bottom)
4. The container shape's `height` must be `>= min_shape_height`.
5. The container shape's `width` must be `>= longest_line_pixel_width + 20`.
Boundary/container labels (e.g., "System Boundary") must be standalone text with `containerId: null`, positioned near the top-left of the container — never bound to it.
**Fix**: increase the shape's height/width to fit the text and shift elements below it to keep spacing. Always set `lineHeight: 1.25` and `autoResize: true` on text. Never patch individual outputs — fix this skill's instructions if a new failure pattern emerges.
After all checks pass, emit the validation summary (10/10 passed, element counts, binding counts, "all shapes sized to fit", any auto-fixes applied).
## Step Completion Reports
After each phase, output a status block. Templates and check labels for each phase live in `references/step-reports.md`. Result line is `PASS | FAIL | PARTIAL`.
## Expected Output
For "draw a flowchart of the user login process": file `login-flow.excalidraw` containing valid Excalidraw JSON, plus a validation summary in the response. Example fragment:
```json
{
"type": "excalidraw", "version": 2, "source": "https://excalidraw.com",
"elements": [
{"id": "start-1", "type": "ellipse", "x": 300, "y": 40, "width": 120, "height": 56,
"boundElements": [{"id": "txt-start", "type": "text"}]},
{"id": "txt-start", "type": "text", "text": "Start", "fontSize": 18, "fontFamily": 1,
"containerId": "start-1", "lineHeight": 1.25, "autoResize": true}
],
"appState": {"theme": "light", "viewBackgroundColor": "#ffffff"}, "files": {}
}
```
Expected response includes:
```
Validation: 10/10 checks passed
- Elements: 6 shapes, 6 text labels, 5 arrows
- Bindings: 6 text bindings, 10 arrow bindings (all two-way)
- Text fits: all shapes sized to fit their bound text
- No overlaps, no missing fields
```
## Edge Cases
- **30+ elements** — spawn the subagent review loop in `references/style-and-iteration.md`; cap at 3 fix cycles.
- **Text-heavy nodes** — apply Check 10 strictly; bigger shapes, never smaller text.
- **Ambiguous relationships** — ask before guessing; saves a regeneration cycle.
- **"Just do it"** — defaults (hand-drawn, roughness 1, Virgil, best-fit layout); skip the proposal.
- **Iteration on an existing file** — read the file, preserve unchanged IDs, modify only the requested parts, rewrite.
See `references/style-and-iteration.md` for extended edge cases, iteration patterns, and style variants.
## Acceptance Criteria
- [ ] Output file is valid JSON with top-level `type`, `version`, `elements`, `appState`, `files`.
- [ ] Every element has all required fields (per `references/validation-checks.md` Check 2).
- [ ] Text elements have `fontSize >= 16`, `lineHeight: 1.25`, `autoResize: true`.
- [ ] All element IDs are unique.
- [ ] Text-to-shape bindings are two-way (`containerId` ↔ `boundElements`).
- [ ] Arrow bindings are two-way (`startBinding`/`endBinding` ↔ `boundElements`).
- [ ] Every arrow has `points[0] === [0,0]` and length ≥ 2.
- [ ] No bounding boxes overlap by more than 10px (outside groups/frames).
- [ ] Every entity/relationship from the user's request is represented.
- [ ] Every container shape is sized to fit its bound text (Check 10).
- [ ] Validation report (10/10 summary) is included in the response.
## Supported Diagram TRelated in Ads & Marketing
ads
IncludedMulti-platform paid advertising audit and optimization skill. Analyzes Google, Meta, YouTube, LinkedIn, TikTok, Microsoft, and Apple Ads. 250+ checks with scoring, parallel agents, industry templates, and AI creative generation.
banana
IncludedAI image generation Creative Director powered by Google Gemini Nano Banana models. Use this skill for ANY request involving image creation, editing, visual asset production, or creative direction. Triggers on: generate an image, create a photo, edit this picture, design a logo, make a banner, visual for my anything, and all /banana commands. Handles text-to-image, image editing, multi-turn creative sessions, batch workflows, and brand presets.
rpg-migration-analyzer
IncludedAnalyzes legacy RPG (Report Program Generator) programs from AS/400 and IBM i systems for migration to modern Java applications. Extracts business logic from RPG III/IV/ILE source code, identifies data structures (D-specs), file operations (F-specs), program dependencies (CALLB/CALLP), and converts RPG constructs to Java equivalents. Generates migration reports, complexity estimates, and Java implementation strategies with POJO classes, JPA entities, and service methods. Use when modernizing AS/400 or IBM i legacy systems, analyzing RPG source files (.rpg, .rpgle, .RPGLE), converting RPG to Java, mapping data specifications to Java classes, planning legacy system migration, or when user mentions RPG analysis, Report Program Generator, RPG III/IV/ILE, AS/400 modernization, IBM i migration, packed decimal conversion, or mainframe application rewrite.
brand-library-architect
IncludedBuild a complete brand library for a product — visual asset render pipeline, brand documentation set (BRAND, COPY, MANIFESTO, BIOS, FAQ, GLOSSARY, TONE, PRICING), open-source convention files (README, CONTRIBUTING, SECURITY, CODE_OF_CONDUCT), and a self-contained press kit. This skill should be used when the user asks to "build a brand library / brand kit / press kit / brand assets" for a product, "set up a brand library workflow," "create a positioning manifesto plus visual identity," or any combination of brand documentation + visual asset pipeline. Apply phase-by-phase or run end-to-end. Templates are product-agnostic and use {{TOKEN}} placeholders the skill prompts the user to fill.
writing-tech-post
IncludedAuthors engineering blog posts end-to-end: launch deep-dives, incident postmortems, architecture migrations, performance case studies, tutorials, AI/agent system writeups, security disclosures, and research-to-product translations. Picks the correct archetype, plans the abstraction ladder, enforces an evidence cadence (diagrams, benchmarks, profiles, traces, code, ablations), tunes voice against publisher house styles (Datadog, Vercel, GitHub, AWS, Meta, Cloudflare, Jane Street), and runs a pre-publish gate for narrative momentum and disclosure ethics. Use when drafting a new engineering post, restructuring a draft that feels flat, deciding which evidence form belongs where, validating that depth and product context are balanced, or preparing a postmortem, migration, or performance narrative for external publication. Do not use for API reference documentation, README authoring, marketing copy, release notes, generic SEO content, ghost-written executive thought leadership, or non-engineering long-form essays.
blog-google
IncludedGoogle API integration for blog performance: PageSpeed Insights, CrUX Core Web Vitals with 25-week history, Search Console performance, URL Inspection, Indexing API, GA4 organic traffic, NLP entity analysis for E-E-A-T, YouTube video search for embedding, and Google Ads Keyword Planner. Progressive feature availability based on credential tier (API key, OAuth/service account, GA4, Ads). Shares config with claude-seo at ~/.config/claude-seo/google-api.json. Use when user says "google data", "page speed", "core web vitals", "search console", "indexation", "GA4", "keyword research", "nlp entities", "blog performance", "youtube search", "google api setup".