lukendeasy/open-diagram
Developer ToolsPython library that draws dense architecture diagrams and checks each layout before export.
This project ships 2 agent skillsSkill list and install →What it does
open-diagram turns a short Python script, JSON description or Mermaid flowchart into a dense architecture diagram. Panels, tiles, rows, graphs, notes and links are the building blocks; the library measures every label using the font's own metrics, places blocks, then verifies the result. Collisions and lines crossing panels are reported by name, and save() writes an SVG plus PNG, prints a summary, and raises LayoutError with the full problem list README, quick start.
The audience is people and coding agents who need system maps, pipelines, layered stacks, data models or business processes without hand-tuning positions. Text is converted to shapes, so the SVG renders consistently in browsers, PowerPoint, Keynote or Figma even without the bundled Inter font.
Quick start
Install from PyPI (Python 3.9+; fontTools is installed with it):
pip install open-diagram
Write a script and run it:
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")
This produces quickstart.svg and quickstart.png; the PNG step needs Google Chrome, Chromium or Microsoft Edge, or a path set in the CHROME environment variable. The SVG is always written. The repository's examples can be run directly, for example python3 examples/pipeline.py example set.
Other entry points include open-diagram draw plan.json, open-diagram check docs/*.json and open-diagram describe plan.json for JSON, Mermaid or Python files command line. Mermaid flowcharts are re-laid out with the same measurement and checks; from_mermaid(text) is the Python equivalent.
Layout feedback and structured data
The value here is the layout report: errors point at the specific block or line and suggest fixes such as via_x/via_y routing, moving a block, or cross_ok=True. describe() returns a plain-language account of the picture, which is also embedded in the SVG for screen readers. Because JSON and Mermaid can be produced without Python, the same checks are usable by other tools or agents.
Use as an agent tool or in CI
An MCP server is available for Claude Desktop, Claude Code and Cursor. It accepts JSON and Mermaid only, never Python, and writes files only inside one output folder, with no hosted component. The README shows a uvx --from "open-diagram[mcp]" open-diagram-mcp setup MCP section. There is also an Agent Skill in skills/open-diagram/ that instructs agents to plan columns, write the script, run it, fix named problems and inspect the PNG skill folder.
A GitHub Action can redraw or check diagrams on every push and fail when a layout problem appears. For repositories, a small status file lets you change the state of a named panel or tile with one word stale diagrams.
Constraints
- Python 3.9+, a pip install, and fontTools. PNG output additionally requires Chrome, Chromium or Edge; SVG-only use does not.
save()and thedrawCLI exit or raise on layout errors, so build pipelines need to treat those failures as real failures rather than warnings.- Mermaid support covers flowcharts and graphs, including node shapes, chains,
&, edge labels and front-matter titles; dotted edges become planned links. Other Mermaid diagram types are not claimed. - Icons are Python-only and take a PNG or SVG file you supply; JSON, Mermaid and the MCP server do not accept icons. Cloud icon lists cover 30 services each for AWS, Azure and Google Cloud, with icon files hosted by a third party cloud icons.
- The project is MIT-licensed, but the bundled Inter font is under SIL OFL 1.1 and cloud icons keep their providers' terms license.
HotRepo's take
open-diagram appeared on HotRepo's new-project list for Python on 2026-11-23, adding 22 stars in the recorded one-hour window to reach 134 stars and 12 forks. That is a single short snapshot rather than an established trend, and the repository has no recorded all-language daily rank. The technical evidence is what stands out: layout validation is tied to font metrics and named error messages, and the same checks are exposed through Python, JSON, Mermaid, MCP and CI, which fits the stated goal of having an AI agent iterate on diagrams before a human views them.
Written by AI from the project's public information and HotRepo's records, updated . The project's own docs are the source of truth.
You might also like
- mermaid-js/mermaidGenerates flowcharts, sequence diagrams, Gantt charts and other diagrams from Markdown-like text, aimed at developers and technical writers.
- tt-a1i/archifyTurns an idea, plan, or codebase into a shareable interactive HTML diagram through your coding agent.
- cathrynlavery/diagram-designAn Agent Skill that turns plain-language requests into self-contained HTML/SVG diagrams in your brand.
- caru-ini/stack-diagramAn agent skill that turns a one-sentence stack description into an architecture diagram with official logos.
- wevm/ondinePrecompiles Mermaid diagrams to SVG at build time so sites ship a tiny runtime instead of a full parser.