DEV Community

tt-a1i
tt-a1i

Posted on Edited on AI-assisted

Mermaid Alternatives for AI Coding Agents: Why Typed JSON IR + Browser Checks Beat Syntax Prompting

Maintainer disclosure: I maintain Archify (tt-a1i/archify, Apache-2.0). This comparison covers real trade-offs with Mermaid, Excalidraw (including Excalidraw MCP), D2, LikeC4, and Eraser.io — including several scenarios where you should not pick Archify.

If you use Claude Code, Cursor, Codex CLI, OpenCode, or GitHub Copilot to explain a system, you have probably hit the "20-node Mermaid wall":

  • A 6-node flowchart in a Markdown README is fast and clean in Mermaid.
  • Past ~15–20 nodes, asking an LLM to hand-author graph syntax turns into edge crossings, clipped labels, and awkward text wrapping — and the final output is still a static SVG you cannot explore by clicking upstream dependencies or hiding noise.

So when teams go looking for Mermaid alternatives for AI coding agents, what actually works — and when does each tool win?

How the six main options divide the problem

Tool How the agent works with it What readers receive Best fit
Mermaid Generates concise Markdown DSL inside docs Inline static diagram in GitHub / Docs Small flows (<15 nodes) that live inside a README
Excalidraw (+ MCP) Pushes sketch primitives onto a live canvas Editable freehand whiteboard / image export Group brainstorming & rough spatial thinking
PlantUML / D2 Generates text DSL compiled in a CLI/docs pipeline Static SVG / PNG with clean Git line diffs Diagram-as-code workflows committed alongside docs
LikeC4 Maintains a typed C4 architecture model across a repo Multi-view C4 architecture site / views Teams standardizing strictly on C4 modeling in Git
Eraser.io DiagramGPT / hosted workspace canvas Cloud workspace with team sharing & permissions Organizations wanting a managed SaaS diagram hub
Archify Agent authors typed JSON IR (10 diagram types) or .archify.md (explainer) One standalone interactive HTML file (no server or account) Explaining complex plans, flows, or codebases with polish and interactivity

A detailed side-by-side matrix and scope boundary list is maintained at archify.si/compare.

Why typed JSON IR + browser checks change agent reliability

When an agent writes freehand Mermaid or raw SVG, syntax validity and readable geometry are coupled in one fragile step. With Archify:

  1. You never write or debug diagram syntax. Describe the topic in plain language — or point your agent at an existing plan, a tangled Mermaid draft, or a pinned repository revision. Note: converting a Mermaid draft is semantic re-authoring rather than lossless parsing of arbitrary Mermaid directives.
  2. Typed JSON IR separates semantics from low-level SVG drawing. The agent chooses among 10 native diagram types (architecture, workflow, sequence, dataflow, lifecycle, erd, class, tree, timeline, waterfall). While architecture diagrams may still use agent-authored placement coordinates (general-purpose auto-layout is outside documented scope), Archify handles automatic orthogonal routing and collision/clearance checks instead of asking an LLM to hand-code raw SVG paths.
  3. Validation checks the artifact before delivery. archify finalize runs schema checks, route/geometry collision checks, and a headless browser check by default for native diagrams (explainers run structural/delivery checks by default, with browser checks available via --browser-check).
  4. Output is a single zero-dependency HTML file. Open it offline in any browser to focus a node, highlight upstream/downstream reach, trace shortest paths, switch light/dark themes, or export PNG/SVG/WebM/PDF (where browser and local tooling support it).
  5. Beyond single charts: 4-style one-page explainers (.archify.md). When one diagram still leaves readers asking why, the agent generates a conclusion-first page pairing prose, tables, steps, and synced validated diagrams side by side — reading a step lights up the matching part of the diagram.

Important boundary: Automated validation checks schema structure and measured layout/routing constraints (with optional browser checks for explainers); it does not substitute for perceptual visual review, nor does it verify that every claim matches runtime reality in production. Human review still owns factual accuracy.

Beyond codebases: live no-signup examples

A repository is optional — people use the exact same workflow for everyday plans, protocol breakdowns, and codebase maps alike:

When to pick the other tools instead

  • Pick Mermaid if the diagram is small, belongs inline inside a GitHub Markdown file, and needs to be edited directly in text.
  • Pick Excalidraw (or Excalidraw MCP) if several teammates need to drag shapes together on an infinite whiteboard.
  • Pick PlantUML / D2 for strict text-diff CI pipelines, or LikeC4 if you want a repository-wide typed C4 DSL model.
  • Pick Eraser.io if you want a hosted multi-user SaaS workspace with role permissions.

Update (Dec 2026): Excalidraw MCP vs. Archify — Editable Canvas vs. Offline HTML Handoff

The official excalidraw/excalidraw-mcp server (https://mcp.excalidraw.com) streams hand-drawn Excalidraw elements directly into hosts that support MCP Apps, including Claude, ChatGPT, VS Code, and Goose. It provides smooth viewport camera control and interactive fullscreen canvas editing. Archify v3.3.3 (tt-a1i/archify, Apache-2.0) turns typed diagram data into a standalone HTML file you can hand to a reviewer.

Suppose you're adding a bank-transfer gateway to a payment service. In Excalidraw MCP, ask the agent to sketch the gateway beside the card and wallet gateways, then open fullscreen and adjust the labels and connections on the canvas. In Archify, ask the agent to add BankTransferGateway and its relationship to the PaymentGateway contract in the typed JSON, then regenerate and check the HTML. The live payments.class example shows that contract and its existing implementations. Class is one of Archify's 10 native diagram types. The live checkout-request.waterfall example shows where the payment step sits in an illustrative checkout request, a starting point if the new gateway changes request timing.

Dimension Excalidraw MCP (excalidraw/excalidraw-mcp) Archify (v3.3.3)
Authoring loop The agent streams elements into a freehand canvas in an MCP Apps host. The agent writes typed JSON and renders a standalone HTML diagram.
Revision workflow Move, connect, or relabel shapes in fullscreen, or ask the agent to revise the sketch. Edit the typed source, then regenerate and validate the HTML.
Layout & verification Arrange elements on the freehand canvas and inspect spacing visually. Deterministic edge routing with a real-browser check for overlap and truncation by default on native diagrams.
Reviewer experience Edit the live canvas in a compatible MCP host or open it in Excalidraw. Open zero-dependency standalone HTML offline with click-to-focus, dependency tracing, and themes. Export PNG, SVG, WebP, or 1080p Story video on supported diagrams and browsers.
Best fit Working through a design together while the diagram is still changing. Handing off a checked diagram that reviewers can explore in a browser offline.

Archify Payments Class Diagram

See the full comparison and the Archify GitHub repository.

Try it with your agent

Inspect the skill listing first (read-only):

npx -y skills@latest add https://archify.si --list --full-depth
Enter fullscreen mode Exit fullscreen mode

Install globally for Claude Code (or swap --agent to cursor, codex, opencode, or github-copilot, and omit --global for a project-local install; check existing skill folders first so unmanaged files are preserved):

npx -y skills@latest add https://archify.si --skill archify --agent claude-code --global --copy --yes
Enter fullscreen mode Exit fullscreen mode

Top comments (0)