Awesome-omni-skill excalidraw-agent
Integrate and automate Excalidraw in React and Next.js apps, convert Mermaid to .excalidraw scenes, merge/normalize .excalidrawlib libraries, and troubleshoot Excalidraw runtime issues. Use when users mention Excalidraw, Mermaid diagrams, .excalidraw or .excalidrawlib files, Excalidraw API props/methods, export/import flows, or host-app collaboration wiring.
git clone https://github.com/diegosouzapw/awesome-omni-skill
T=$(mktemp -d) && git clone --depth=1 https://github.com/diegosouzapw/awesome-omni-skill "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/development/excalidraw-agent" ~/.claude/skills/diegosouzapw-awesome-omni-skill-excalidraw-agent && rm -rf "$T"
skills/development/excalidraw-agent/SKILL.mdExcalidraw Agent
Overview
Use this skill to deliver end-to-end Excalidraw work in host apps: integration, API-driven scene updates, Mermaid conversion, library operations, export/import pipelines, collaboration patterns, and runtime diagnostics.
Prefer this workflow: triage the task, load only the relevant reference file, execute using deterministic scripts when possible, validate output, and report exact outcomes.
Core Workflow
- Triage the request type.
- Load only the required reference file(s) from
.references/ - Run environment check when scripts are involved:
scripts/check_env.sh
- Execute the task path.
- Validate the result (script checks + structural checks + behavior checks).
- Report what changed, what was verified, and remaining risks.
Task Triage
- Installation or framework embedding: load
references/excalidraw-install-and-integration.md - Props and imperative API usage: load
references/excalidraw-props-and-api.md - Serialization, restore, and export/import: load
references/excalidraw-utils-restore-export.md - Editor composition (
,MainMenu
,Sidebar
,WelcomeScreen
): loadFooterreferences/excalidraw-ui-composition.md - Mermaid conversion workflows: load
references/excalidraw-mermaid-conversion.md - Collaboration architecture and remote update behavior: load
references/excalidraw-collaboration-pattern.md - Account-linked import/publish via authenticated browser session: load
references/excalidraw-account-linking.md - Client setup/portability across Codex, Claude Code, Cursor, and Zed: load
references/excalidraw-client-compatibility.md - Runtime or build failures: load
references/excalidraw-troubleshooting.md - Skills protocol constraints and metadata behavior: load
references/agent-skills-protocol-notes.md
Hard Integration Requirements
Apply these on every Excalidraw integration unless the user explicitly asks otherwise:
- Import Excalidraw stylesheet:
import "@excalidraw/excalidraw/index.css";
- Render in a container with non-zero height and width.
- Use
callback for imperative control; do not use removed legacyexcalidrawAPI
API patterns.ref - For Next.js, disable SSR for Excalidraw rendering via dynamic import.
- If self-hosting fonts/assets, set
correctly.window.EXCALIDRAW_ASSET_PATH
Script Interfaces
Run scripts from this skill root or by absolute path.
scripts/check_env.shscripts/mermaid_to_scene.mjs --input <mmd|-> --output <scene.excalidraw> --font-size <n> --regenerate-ids <true|false> --pretty <true|false>scripts/scene_lint.mjs --input <scene.excalidraw> --strict-diagram <true|false>scripts/library_merge.mjs --base <a.excalidrawlib> --other <b.excalidrawlib> --output <merged.excalidrawlib> --default-status <published|unpublished>scripts/import_to_excalidraw.sh --input <path> --destination <plus|excalidraw> --kind <auto|scene|library> --mode <headed|headless> --session <name> --output-dir <path> --timeout-sec <n> --dry-run <true|false> --close-on-complete <true|false> --pwcli <path>scripts/self_test.sh
Deterministic Execution Notes
- Scripts resolve Excalidraw dependencies from
first, then from the skill directory.process.cwd() - Recommended runtime is Node + pnpm.
- For conversions and merges, run from a project directory where
and@excalidraw/excalidraw
are available, or install them in a temporary working directory first.@excalidraw/mermaid-to-excalidraw - If
cannot be loaded in the active Node runtime, scripts emit a warning and apply deterministic fallback normalization so workflows continue.@excalidraw/excalidraw - The account-link import script supports multiple agent environments by resolving Playwright in this order:
- explicit
or--pwcliPWCLI - known wrapper paths under
,~/.codex
,~/.claude
, and~/.cursor~/.config/zed - global
playwright-cli npx --yes --package @playwright/mcp playwright-cli
- explicit
- API-level account linking is not available in this skill. Account linking is implemented as authenticated UI import on
orexcalidraw.com
.plus.excalidraw.com
Multi-Agent Compatibility
- Core Agent Skills contract is
+ optionalSKILL.md
,references/
, andscripts/
.assets/
is optional metadata for Codex UX and can be ignored by other clients.agents/openai.yaml- This skill is designed to be portable: all operational instructions are rooted in
, script paths are skill-root relative, and account-link import can run with any Playwright CLI provider viaSKILL.md
.--pwcli - For client-specific setup and invocation patterns, load
.references/excalidraw-client-compatibility.md
Execution Paths
1) Embed Excalidraw in a Host App
- Load
.references/excalidraw-install-and-integration.md - Implement base integration for React/Next.js/Preact as needed.
- Confirm CSS import and non-zero container dimensions.
- Validate editor rendering and input behavior.
2) Implement API-Driven Scene or UI Behavior
- Load
.references/excalidraw-props-and-api.md - Use
callback to capture API instance.excalidrawAPI - Use
andupdateScene
semantics intentionally:captureUpdate- local undoable updates:
IMMEDIATELY - async grouped updates:
EVENTUALLY - remote/collab updates:
NEVER
- local undoable updates:
- Verify behavior via event subscriptions (
, pointer handlers).onChange
3) Convert Mermaid to .excalidraw
.excalidraw- Load
.references/excalidraw-mermaid-conversion.md - Run conversion:
node scripts/mermaid_to_scene.mjs --input diagram.mmd --output diagram.excalidraw --font-size 16 --regenerate-ids true --pretty true
- Validate output:
node scripts/scene_lint.mjs --input diagram.excalidraw --strict-diagram true
- If parser fallback behavior appears, report which nodes were downgraded.
- If import layout is unreadable (for example tall single-column collapse), simplify labels/graph, reconvert, and expect a manual arrangement pass in Excalidraw.
4) Merge and Normalize Libraries
- Load
.references/excalidraw-utils-restore-export.md - Merge:
node scripts/library_merge.mjs --base lib-a.excalidrawlib --other lib-b.excalidrawlib --output merged.excalidrawlib --default-status unpublished
- Confirm merged output contains normalized
and expected dedupe behavior.libraryItems
5) Build Collaboration Glue
- Load
.references/excalidraw-collaboration-pattern.md - Keep transport and persistence in host app; keep editor as client state surface.
- Apply remote updates with non-undo capture behavior.
- Verify collaborator map rendering and local-vs-remote conflict handling.
6) Troubleshoot Runtime Failures
- Load
.references/excalidraw-troubleshooting.md - Diagnose by category: SSR/build, CSS/layout, browser quirks, asset path, env flags.
- Validate fixed state with a minimal reproducible integration.
7) Link Generated Content to Excalidraw Account
- Load
.references/excalidraw-account-linking.md - Run import script in headed mode for interactive login:
bash scripts/import_to_excalidraw.sh --input diagram.excalidraw --destination plus --mode headed
- Complete manual login/MFA at checkpoint.
- Let script run deterministic import strategy sequence and UI assertions.
- Confirm persistence checkpoint for
destination.plus - Collect screenshot proof path and
output.RESULT_JSON
8) Configure Skill for a Specific Agent Client
- Load
.references/excalidraw-client-compatibility.md - Place or symlink the skill directory into the client's skill root.
- Validate script execution from that environment:
bash scripts/check_env.shbash scripts/import_to_excalidraw.sh --input assets/examples/scene-minimal.excalidraw --dry-run true
- If Playwright is not discovered automatically, set
explicitly.--pwcli - Confirm the client can load
and accessSKILL.md
andreferences/
.scripts/
Validation Checklist
- Skill metadata and structure validate cleanly.
- Script CLIs run with documented flags.
- Converted scenes parse and lint successfully.
- Merged libraries are normalized and readable by Excalidraw tooling.
- Recommendations reference the correct framework constraints (React/Next/Preact).
- Cross-client setup guidance is present and does not assume a single agent runtime.
Skill Maintenance
- Keep
concise and procedural.SKILL.md - Keep deep details in
.references/ - Keep references one hop from
.SKILL.md - Re-run validation after edits:
python <path-to-skill-creator>/scripts/quick_validate.py <path-to-skill-dir>skills-ref validate <path-to-skill-dir>