Every architecture diagram you have ever shipped started as a sketch and ended as a lie. A box drifted over a label. An arrow crossed straight through a panel. Two panels sat 9 pixels apart and nobody noticed until the slide was on the screen. The tools never said anything, because the tools never checked.

open-diagram checks. It is a small Python library that draws architecture diagrams from a short script — panels, tiles, lines, groups — and then inspects its own layout before it writes the file. If two panels collide, or a line runs through a box, or text drops below a readable size, the build fails and names the problem: ‘Storage’ and ‘Recommendations’ overlap; move one. The SVG is still written so you can look at it, but nothing ships silently broken.

It is also the week’s breakout open-source AI project. Created on November 18, it collected 387 GitHub stars in six days — the fourth most-starred new AI project of the week — with nine releases already and a 0.6.1 on PyPI. The reason is not the diagrams. It is who draws them: the library is built to be written by an AI agent. It ships a Claude Code skill, an MCP server, and a plain-text description of every picture it draws, so an agent can compare what it drew against what you asked for without ever looking at the image. I ran it end to end on a small CPU-only VM: the quickstart, a deliberately broken diagram, a real RAG pipeline, Mermaid and JSON inputs, and the MCP server. Every command and every number below is measured.

What you’ll need#

  • Python 3.9 or newer. I used Python 3.12. No GPU, no Docker, no account.
  • About 10 MB of disk for the library and its single dependency, fontTools. The bundled Inter font ships inside the package.
  • Google Chrome, Chromium, or Microsoft Edge — only if you want PNGs. The SVG is always written; PNG export needs a browser, and the library says so plainly instead of failing. Set the CHROME environment variable if your browser is not in the usual place.
  • No API key, no account, no network after the install. The total cost is $0, and the library is MIT licensed.
  • About 15 minutes.

One honest caveat up front: this is a young project — six days old, version 0.6.1, one main author. The API is stable enough to teach, the test suite passes, and the docs are thorough, but expect the surface to move. Pin the version, as every command below does.

Step 1: Install open-diagram#

The package is open-diagram on PyPI, version 0.6.1 at the time of writing. Its only runtime dependency is fontTools, which pip installs for you.

python3 -m venv .venv && source .venv/bin/activate
python -m pip install open-diagram==0.6.1

Verify the install:

python -c "import open_diagram; print(open_diagram.__version__)"

On my machine this printed:

0.6.1

The install also gives you two commands: open-diagram, the CLI, and — after you install the optional MCP extra in step 6 — open-diagram-mcp, the MCP server.

Step 2: Your first diagram#

The quickstart below is the project’s own example, verbatim from its README. Three panels — a web app, a search API, a search index — placed left to right with two links between them. Save it as quickstart.py:

from open_diagram import Diagram, Panel, Tile

d = Diagram("How a search request is answered", tag="EXAMPLE")
app = d.add(Panel("Web app", ["Search box", "Results page", "Filters"], footer="Owner: Web team"))
api = d.right_of(app, Panel("Search API", [Tile("Checks access"), Tile("Caches results", status="building")],
                            footer="Owner: Platform team"), align="center")
index = d.right_of(api, Panel("Search index", ["Product text", Tile("Spelling fixes", status="planned")],
                              status="planned"), align="center")
d.link(app, api)
d.link(api, index, kind="planned", label="new")
d.save("quickstart")   # writes quickstart.svg and quickstart.png

Run it:

python quickstart.py

On my machine — a VM with no Chrome installed — this printed:

PNG skipped: Chrome, Chromium or Edge was not found (set the CHROME environment variable to its path)
wrote quickstart.svg: 1081 x 316 px; smallest text 10.5 px; 0 layout problem(s)

Three things to notice. First, the PNG was skipped, not failed: the SVG is the primary output and it is always written. Second, the summary reports the canvas size and the smallest text size, so you know at a glance whether anything is unreadable. Third, 0 layout problem(s) — the build checked itself and found nothing wrong. The output file is 111 KB of SVG, and here it is:

The quickstart diagram: three panels for a web app, a search API, and a search index, connected by solid and dotted arrows
The quickstart diagram, drawn by the code above — the exact file this tutorial ran. The dotted arrow is a planned connection; the dashed tile is work in progress. Diagram: lukendeasy/open-diagram (MIT).

Read the picture back. The tag="EXAMPLE" becomes the pill in the top left. The footer strings become the “Owner:” lines. status="building" gives a tile a dashed amber border; status="planned" on a panel gives it a dotted border and a Planned pill. kind="planned" on a link makes it dotted and labels it. Statuses are shown by color and by word, and the key at the top lists only the statuses and line kinds the picture actually uses. Nothing here is decoration you have to maintain — it all falls out of the labels you already wrote.

Step 3: Break it on purpose — the layout check#

The check is the whole point of the library, so test it before you trust it. Place two panels at the same coordinates:

from open_diagram import Diagram, Panel, LayoutError

d = Diagram("Collision test")
a = d.add(Panel("Storage", ["Files"]), x=0, y=0)
b = d.add(Panel("Recommendations", ["Models"]), x=0, y=0)
try:
    d.save("collision")
    print("NO ERROR RAISED")
except LayoutError as e:
    print(e)

This is what came back on my machine:

PNG skipped: Chrome, Chromium or Edge was not found (set the CHROME environment variable to its path)
wrote collision.svg: 640 x 287 px; smallest text 12 px; 1 layout problem(s)
LayoutError: 1 layout problem(s):
  - 'Storage' and 'Recommendations' overlap; move one (right_of() and below() keep a gap)
The drawing was still written, so you can look at it: collision.svg

That is the entire value proposition in one error message. It names both blocks, says what is wrong, and tells you how to fix it — right_of() and below() place blocks next to each other with the theme’s gap, so the collision cannot happen by accident. And it still writes the SVG, so you can see the mess instead of guessing at it.

The checks go further than overlap. The library measures every label from the font file before placing it, so boxes fit their words; it flags panels closer than 16 px, lines that cross panels, labels that land on boxes, and text under 10 px. The README’s example of a line problem reads: line ‘Where videos come from’ -> ‘Storage’ crosses ‘Processing’; route it with via_x/via_y, move a block, or pass cross_ok=True. Every problem comes with the fix attached. That is what “checks its own layout” means in practice: not a warning, but a named problem with a named remedy.

How open-diagram turns a script into a picture: measure from the font, place, check overlaps and gaps, then draw
How the library works, drawn by the library itself: script to measure to place to check to draw, with every problem reported by name. Diagram: lukendeasy/open-diagram (MIT).

Step 4: A real diagram, end to end#

A quickstart proves the install; a real diagram proves the tool. Here is a local RAG pipeline — ingest, store, serve — the kind of picture that ends up in a design doc or a README. Save it as rag_pipeline.py:

from open_diagram import Diagram, Panel, Tile

d = Diagram("Local RAG pipeline: question in, cited answer out", tag="EXAMPLE")
ingest = d.add(Panel("Ingest", ["Load PDFs", "Split 512-token chunks", "Embed with local model"],
                      footer="Owner: Data team"))
store = d.right_of(ingest, Panel("Store", [Tile("Vector index"), Tile("Chunk text", status="building")],
                                  footer="Owner: Platform team"), align="center")
serve = d.right_of(store, Panel("Serve", ["Retrieve top 8", "Rerank", "Draft with citations"],
                                footer="Owner: App team"), align="center")
d.link(ingest, store)
d.link(store, serve)
d.save("rag_pipeline")
print(d.describe())

Run it:

python rag_pipeline.py

Output:

PNG skipped: Chrome, Chromium or Edge was not found (set the CHROME environment variable to its path)
wrote rag_pipeline.svg: 1447 x 316 px; smallest text 10.5 px; 0 layout problem(s)
Local RAG pipeline: question in, cited answer out
States shown: Live, Being built. Solid lines: data flows today.

Blocks, left to right:
- Ingest: Load PDFs; Split 512-token chunks; Embed with local model. Owner: Data team
- Store: Vector index; Chunk text (being built). Owner: Platform team
- Serve: Retrieve top 8; Rerank; Draft with citations. Owner: App team
Lines:
- Ingest -> Store
- Store -> Serve

Two things matter here. First, the diagram passed its own checks — 0 layout problems — on the first run, which is the library’s design goal: a first attempt that comes out clean because the layout is computed, not eyeballed. Second, describe() returns the picture as plain text. That text is also embedded in the SVG as its description, so screen readers can read the diagram, and — more importantly for 2026 — an AI agent can compare the description against the request without ever opening the image. If the agent drew the wrong thing, the text says so.

For a sense of scale, the project’s own systems-map example — a fictional video platform from upload to screen, with columns, a group, a data map, and lanes — renders at 1988 × 877 px with 0 layout problems. That is the cover image of this article: a dense, real diagram, drawn by this library, not a mockup.

Step 5: Bring your own format — Mermaid, JSON, and the CLI#

Python is the native input, but it is not the only one. The CLI, open-diagram, reads Mermaid flowcharts and JSON as well. The repo ships both: examples/signup_flow.mmd and examples/email_delivery.json. Draw them:

open-diagram draw examples/signup_flow.mmd -o signup
open-diagram draw examples/email_delivery.json -o email_delivery

Both worked on my machine:

wrote signup.svg: 991 x 595 px; smallest text 10.5 px; 0 layout problem(s)
wrote email_delivery.svg: 1270 x 486 px; smallest text 10.5 px; 0 layout problem(s)

The CLI has five commands — draw, check, describe, png, and new — and the one you will use most in CI is check. It builds each file in memory, lists the layout problems, and exits 1 if there are any:

open-diagram check examples/signup_flow.mmd examples/email_delivery.json
echo "exit=$?"
examples/signup_flow.mmd: 0 layout problem(s)
examples/email_delivery.json: 0 layout problem(s)
exit=0

That makes diagrams testable artifacts. Put open-diagram check diagrams/*.json in CI and a broken diagram fails the build like a broken test — which is exactly the failure mode this library exists to prevent. describe prints the plain-text description for any file, and new lists the bundled cloud templates — aws_etl, aws_architecture, azure_web_app, gcp_event_pipeline — or writes one out to start from:

open-diagram new aws_etl
open-diagram check aws_etl.json

The template it writes is a 3.6 KB JSON file: an AWS data-ingestion setup with MWAA orchestration, Lambda extractors, and real service icons, ready for you to relabel. The cloud icons are a separate story — the project keeps a versioned icon library with attribution rules, so icons come from fixed file versions rather than drifting URLs.

Step 6: Hand it to your coding agent#

Diagrams are the classic thing agents get almost right: the boxes are there, the labels are close, and something overlaps something else in a way nobody notices until the review. open-diagram is built for that workflow. Install the MCP extra:

python -m pip install "open-diagram[mcp]"

Then register the server with Claude Code, using the command from the project’s README:

claude mcp add open-diagram -- uvx --python 3.12 --from "open-diagram[mcp]" open-diagram-mcp

I verified the server itself rather than the Claude Code wiring: it starts over stdio and answers the MCP handshake. Send it an initialize request and it replies as open-diagram 0.6.1, listing its tools and its own workflow — call format_guide once, write the diagram as JSON or Mermaid (or start from a template), call check and fix every problem it names until it reports 0, then call draw and compare the description with what was asked. The loop is the point: the agent does not need eyes, because the checker is the eyes. The repo also ships an agent skill (skills/open-diagram/SKILL.md) that explains what each layout problem means and how to fix it, for agents that work from files rather than MCP.

That is why this project is trending now, in a week when agent skills are the fastest-growing category on GitHub. Diagram tools that hand the agent a canvas and hope are everywhere. A diagram tool that hands the agent a verifier is the new part.

When to use this vs alternatives#

The project ships its own comparison, drawing the same photo-upload flow in each tool with default settings. The table below is from that page, and the headline finding is simple: only open-diagram and archify check every layout.

ToolInputChecks layoutOutputMCPLicense
open-diagramPython, JSON, MermaidYesSVG, PNGYesMIT
MermaidTextNoSVG, PNG, PDFYesMIT
D2TextNoSVG, PNG, PDF, PPT, GIFNoMPL-2.0
draw.ioEditorOnly in its MCP viewerPNG, SVG, PDF and moreYesApache-2.0
ExcalidrawEditorOnly in its paid MCP serverPNG, SVGYesMIT
archifyJSONYesInteractive HTML pageNoApache-2.0

Choose open-diagram when the diagram is generated — by a script, by CI, or by an agent — and nobody will eyeball it before it ships. The layout check is the feature; everything else is table stakes. Choose Mermaid when you need the widest rendering support: it is embedded in GitHub, GitLab, Notion, and a dozen other surfaces, and open-diagram itself reads Mermaid files, so the two are complements rather than rivals. Choose D2 when you need PowerPoint or GIF output, or its particular aesthetic. Choose draw.io or Excalidraw when a human is drawing by hand and wants a canvas, not a script. Choose archify when you want an interactive HTML page with evidence links back to your repo — it checks layout too, but it has no MCP server, so an agent cannot drive it the same way.

Two limits to know before you commit. First, PNG output needs a browser installed; on a headless server, budget for that or ship SVG only — SVG is the better artifact anyway, since text stays selectable and the description stays embedded. Second, this is a diagram library, not a diagram editor: there is no drag-and-drop canvas, and every change goes through the script. If your team edits diagrams by mouse, that is a real workflow cost.

The takeaway#

Architecture diagrams rot because nobody checks them. open-diagram makes the check part of the build: a one-line install, a ten-line script, and a LayoutError that names the problem and the fix. The quickstart, the RAG pipeline, the Mermaid import, and the JSON import all rendered with zero layout problems on the first run on a small CPU-only VM — and the one diagram I broke on purpose failed loudly, by name, with the drawing still written so I could see it. Add the MCP server and the check becomes something an agent can run in a loop, which is why 387 stars arrived in six days. If your diagrams live in a repo, put open-diagram check in CI and stop reviewing pixels by eye.