diagramsmith

mcp
Security Audit
Fail
Health Warn
  • License — License: MIT
  • Description — Repository has a description
  • Active repo — Last push 0 days ago
  • Low visibility — Only 6 GitHub stars
Code Fail
  • spawnSync — Synchronous process spawning in docs/demo/make_media.mjs
  • fs.rmSync — Destructive file system operation in docs/demo/make_media.mjs
  • process.env — Environment variable access in skills/diagramsmith/tools/browser.mjs
Permissions Pass
  • Permissions — No dangerous permissions requested

No AI report is available for this listing yet.

SUMMARY

Diagrams from any AI agent, drawn locally: Mermaid, hand-drawn whiteboard style and interactive HTML explorers. Agent skill, Claude plugin, MCP server and CLI. No account, no API key.

README.md

diagramsmith

tests

Draw Mermaid and Excalidraw-style diagrams locally, and explore them as a self-contained interactive page.

diagramsmith demo: an interactive checkout diagram, hover, details panel, guided tour, nested payment diagram and two style switches

Real output, recorded 2026-12-01.

Ask an agent for a diagram

User: How does our checkout work? Draw it for me.

Agent: I read the services and drew the checkout platform: storefront, gateway, cart, checkout, payments, inventory, orders and fulfilment, with the payment service as a nested diagram. I'm rendering the interactive explorer to diagrams/checkout-platform.html. Open it to pan, zoom, click a node for details, press Tour for the guided walk, and use Style to change the look.

The explorer is one HTML file with no CDN and no server: pan and zoom, search, click a node for a details panel, nested drill-down, a guided tour, a presenter mode, a live 7-style switcher and export to SVG, PNG or an editable .excalidraw.

What it looks like

Checkout platform drawn in the sketch preset: hand-drawn boxes and soft pastels The same checkout platform in the blueprint preset: white linework on engineering blue The same checkout platform in the clean preset: crisp lines and a modern palette
Sketch (default): hand-drawn whiteboard. Blueprint: white linework on engineering blue. Clean: crisp lines for docs and READMEs.
Mermaid sequence diagram of an OAuth sign-in with PKCE

Mermaid sequence: an OAuth sign-in with PKCE. Diagram styles change the colours and fonts only, not the Mermaid layout.

Interactive explorer with the payment service selected, its connection highlighted and its details panel open

The interactive page: select a node, see what it sends and receives, and open the diagram hidden inside it.

Install the skill

For any AI coding agent with skills:

npx skills add Zune2004/diagramsmith
gh skill install Zune2004/diagramsmith diagramsmith

On first use, if node <skill-dir>/tools/diagram.mjs doctor reports missing packages, run the first-run setup once:

node <skill-dir>/tools/setup.mjs

Claude Code plugin

/plugin marketplace add Zune2004/diagramsmith
/plugin install diagramsmith@diagramsmith

Gemini CLI extension

gemini extensions install https://github.com/Zune2004/diagramsmith

Manual copy paths

Copy the skills/diagramsmith folder to your agent's skills directory:

Agent User-level path Project-level path
Claude Code ~/.claude/skills/diagramsmith .claude/skills/diagramsmith
OpenAI Codex CLI ~/.agents/skills/diagramsmith .agents/skills/diagramsmith
Gemini CLI ~/.agents/skills/diagramsmith .agents/skills/diagramsmith
GitHub Copilot CLI ~/.agents/skills/diagramsmith .github/skills/diagramsmith
Cursor ~/.agents/skills/diagramsmith .agents/skills/diagramsmith
opencode ~/.agents/skills/diagramsmith .opencode/skills/diagramsmith
Kilo Code ~/.agents/skills/diagramsmith .kilo/skills/diagramsmith
Cline ~/.agents/skills/diagramsmith .agents/skills/diagramsmith
Amp ~/.agents/skills/diagramsmith .agents/skills/diagramsmith
Goose ~/.agents/skills/diagramsmith .agents/skills/diagramsmith

Aider (no skills)

In .aider.conf.yml:

read: [skills/diagramsmith/SKILL.md]

Chat apps (MCP)

Run diagramsmith as a stdio MCP server with "command": "npx" and "args": ["-y", "diagramsmith", "mcp"]. Rendered files are written to DIAGRAMSMITH_OUT if set, or ~/diagrams by default (<home>/diagrams). The four tools are render_mermaid, render_diagram, render_interactive and list_styles.

If you want to pre-install packages or check your browser beforehand, run npx -y diagramsmith doctor (or node <package-dir>/skills/diagramsmith/tools/setup.mjs).

Claude Desktop (claude_desktop_config.json):

{
  "mcpServers": {
    "diagramsmith": {
      "command": "npx",
      "args": ["-y", "diagramsmith", "mcp"]
    }
  }
}

Cursor (~/.cursor/mcp.json or .cursor/mcp.json):

{
  "mcpServers": {
    "diagramsmith": {
      "command": "npx",
      "args": ["-y", "diagramsmith", "mcp"]
    }
  }
}

VS Code (.vscode/mcp.json):

{
  "servers": {
    "diagramsmith": {
      "command": "npx",
      "args": ["-y", "diagramsmith", "mcp"]
    }
  }
}

Windsurf (~/.codeium/windsurf/mcp_config.json):

{
  "mcpServers": {
    "diagramsmith": {
      "command": "npx",
      "args": ["-y", "diagramsmith", "mcp"]
    }
  }
}

No agent

Terminal or npx:

npx diagramsmith mermaid     flow.mmd         -o flow.svg
npx diagramsmith excalidraw  spec.json        -o diagram.png
npx diagramsmith interactive spec.json        -o explorer.html --styles all
npx diagramsmith presets     -o style-gallery.html
npx diagramsmith style       list
npx diagramsmith style       set blueprint
npx diagramsmith check
npx diagramsmith doctor

If you cloned the repository directly, run the first-run setup once and invoke the CLI directly:

node skills/diagramsmith/tools/setup.mjs
node skills/diagramsmith/tools/diagram.mjs mermaid     skills/diagramsmith/tools/examples/auth-flow.mmd         -o auth-flow.svg
node skills/diagramsmith/tools/diagram.mjs excalidraw  skills/diagramsmith/tools/examples/payments-detail.json  -o payments.png
node skills/diagramsmith/tools/diagram.mjs interactive skills/diagramsmith/tools/examples/interactive-demo.json -o demo.html --styles all

What it is good for

  • A system overview with zones and one nested zoom: the checkout platform above is ten services, two zones and a payment diagram inside a node.
  • A flow with branches, retries or a failure path, where a picture beats a paragraph.
  • A request lifecycle or auth sequence, as a Mermaid block next to the code it describes.
  • Explaining a design to a person: an interactive page they can pan, search, click and present.
  • Diagrams in a README, issue or PR, where plain Mermaid renders without any tool.

When to use something else

  • Plain Mermaid code blocks render natively on GitHub, GitLab and many editors. If that is all you need, you need no tool.
  • Live hand-editing on a canvas: use Excalidraw itself, or its MCP server, when you want to draw with a mouse rather than describe the diagram.
  • Pixel-precise diagrams with fixed positions and connectors: draw.io.

Commands and exit codes

Command What it does Exit codes
diagramsmith --version Print the version. 0
diagramsmith mermaid <file.mmd> [-o out.svg|out.png] Render Mermaid (needs the optional mermaid-cli and Chrome/Edge). 0 ok, 1 error, 2 no browser (prints a Mermaid block to paste instead)
diagramsmith excalidraw <spec.json|file.excalidraw> [-o out.svg|out.png] Auto-layout a spec and render it, plus an editable .excalidraw. 0 ok, 1 error (invalid spec, duplicate id, PNG too large)
diagramsmith interactive <spec.json|file.mmd> [-o out.html] Build the self-contained HTML explorer and self-test it in headless Chrome. 0 ok, 1 error; --strict also exits 1 when the self-test finds a problem
diagramsmith presets [-o style-gallery.html] Render the same sample in all 7 presets. 0 ok, 1 error
diagramsmith style <list|options|show|set|reset> List presets and options, or save a default style. 0 ok, 1 error
diagramsmith check [--strict] Self-test every renderer. 0 all good, 1 something failed
diagramsmith doctor Check Node, dependencies and Chrome/Edge. 0 all good, 1 something needs fixing
diagramsmith mcp Run the stdio MCP server. Runs until stdin closes; JSON-RPC errors are reported in-band

Limits to know

  • Rendering is local: no account, no API key, no telemetry. Diagrams are not sent anywhere; the renderer starts a local 127.0.0.1 server only.
  • It needs Node.js 20 or newer and Google Chrome or Microsoft Edge (override with CHROME_PATH or PUPPETEER_EXECUTABLE_PATH). On first install, the npm packages are a few hundred MB; the browser is reused, not downloaded.
  • A PNG export of a very large diagram (for example 300 nodes) can be too large. Use SVG, a lower --scale, or split the diagram.
  • For Mermaid, a style preset changes colours and fonts only. The hand-drawn look comes from the Excalidraw-style renderer.
  • The interactive page needs a current browser (Chrome, Edge, Firefox 113+ or Safari 16.4+); it unpacks its payload in the browser.
  • interactive pre-renders every combination of up to 3 collapsible zones, so more zones or many --styles make a bigger HTML file.

The 7 style presets

Preset Look
sketch (default) Hand-drawn whiteboard with soft pastels
clean Crisp straight lines and a modern UI palette
blueprint White technical linework on engineering blue, monospace labels, sharp corners
midnight Dark canvas with bright neon accents
mono Black-and-white with hatching for print
corporate Muted tones, thin sharp lines, roomy spacing
playful Chunky sketchy lines and bright colours on a warm page

Customize any part with npx diagramsmith style options and npx diagramsmith style set <preset> [key=value ...] [--project], or pass --preset <name> on a single render.

Privacy

Rendering is local: no account, no API key, no telemetry; your diagrams are not sent anywhere (the renderer starts a local 127.0.0.1 server only).

Licence

MIT. See LICENSE and THIRD_PARTY.md.

Development

Install the renderer dependencies once:

npm ci --prefix skills/diagramsmith/tools

Run the tests and the renderer self-test:

node --test --test-concurrency=4 tests/*.test.mjs
node skills/diagramsmith/tools/diagram.mjs check

Regenerate every picture above, including the GIF (needs Chrome or Edge and ffmpeg on PATH):

node docs/demo/make_media.mjs

The example spec is docs/demo/checkout-platform.json; the Mermaid sequence is docs/demo/oauth-sequence.mmd.

Reviews (0)

No results found