# open-diagram > Python building blocks for dense architecture diagrams that check their own layout. open-diagram is a pure-Python library (MIT license) that turns a short Python script, a JSON description or a Mermaid flowchart into a dense architecture diagram as SVG and PNG. It measures every label from the font before placing anything, and reports layout problems as plain sentences that name the parts involved, so an AI agent can fix them without looking at the picture. Install: `pip install open-diagram`. MCP server: `uvx open-diagram mcp`. ## Docs - [Docs](https://open-diagram.dev/docs.html): every block, JSON key, Mermaid rule, command and agent tool, and how to fix each layout problem - [README](https://github.com/lukendeasy/open-diagram#readme): install and quick start - [Agent Skill](https://github.com/lukendeasy/open-diagram/blob/main/skills/open-diagram/SKILL.md): step-by-step instructions for agents drawing diagrams - [AGENTS.md](https://github.com/lukendeasy/open-diagram/blob/main/AGENTS.md): for agents changing the library itself - [PyPI](https://pypi.org/project/open-diagram/) ## Pages - [open-diagram: diagrams that check their own layout](https://open-diagram.dev/): Write a few lines of Python, JSON or Mermaid, and get a diagram checked for overlaps and text that does not fit. - [Make a diagram](https://open-diagram.dev/make.html): Write a few lines of Python, JSON or Mermaid, or let your coding agent do it. - [How it checks itself](https://open-diagram.dev/checks.html): open-diagram measures every label, then names each layout problem in plain words. - [See what it draws](https://open-diagram.dev/gallery.html): Cloud templates for AWS, Azure and Google Cloud, and examples in Python, JSON and Mermaid. - [Try it in your browser](https://open-diagram.dev/try.html): Edit a diagram as JSON or Mermaid and see the picture, its layout problems and its description as you type. - [Documentation](https://open-diagram.dev/docs.html): Learn to draw diagrams in Python, JSON or Mermaid, and fix what the checks report. - [Quick start · Docs](https://open-diagram.dev/docs/start.html): Install open-diagram and draw your first diagram. - [Python · Docs](https://open-diagram.dev/docs/python.html): Build a diagram from blocks, place them, and set its colors and sizes with a theme. - [JSON · Docs](https://open-diagram.dev/docs/json.html): Describe a diagram as plain data, from any language or agent. - [Mermaid · Docs](https://open-diagram.dev/docs/mermaid.html): Draw a Mermaid flowchart you already have, and see what changes. - [Command line · Docs](https://open-diagram.dev/docs/cli.html): Draw, check and describe diagrams from a terminal or a CI job. - [AI agents · Docs](https://open-diagram.dev/docs/agents.html): Let Claude Code, Claude Desktop, Cursor or Amp draw diagrams and fix their layout problems. - [Templates · Docs](https://open-diagram.dev/docs/templates.html): Start from a finished cloud diagram, keep its shape, and replace its words. - [Layout problems · Docs](https://open-diagram.dev/docs/problems.html): What each problem message means, and how to fix it. - [About](https://open-diagram.dev/about.html): The people who make open-diagram. ## Diagram examples - [Architecture diagram examples drawn with open-diagram](https://open-diagram.dev/diagrams.md): Architecture diagram examples and cloud templates drawn with open-diagram, each redrawn by the current release and checked for layout problems. - [Systems map diagram with live and planned parts, from Python](https://open-diagram.dev/diagrams/systems-map.md): A systems map of an invented video platform, drawn from one Python script, with statuses, owners, a group, rollout steps and lanes. - [Business process map of a furniture store, drawn from Python](https://open-diagram.dev/diagrams/business-process-map.md): A business process map of an invented furniture store, from order to doorstep, drawn from Python with statuses, owners and rollout steps. - [Layered architecture diagram with a side panel, from Python](https://open-diagram.dev/diagrams/layered-architecture.md): A layered architecture diagram of a web product, from the people who use it down to its data, with a side panel, drawn from Python. - [CI/CD release pipeline diagram, drawn from Python](https://open-diagram.dev/diagrams/ci-cd-release-pipeline.md): A CI/CD release pipeline diagram, pull request to production with a rollback lane, drawn from Python; a GitHub Action can check it on every push. - [Card payment flow diagram, drawn from Python](https://open-diagram.dev/diagrams/card-payment-flow.md): A card payment flow diagram, from tap to approval and settlement, drawn from Python, with numbered steps and return paths in lanes. - [Email delivery flow diagram, written as JSON](https://open-diagram.dev/diagrams/email-delivery-flow.md): An email delivery flow diagram, from mail app to inbox with a bounce path, written as JSON so any language or AI agent can produce it. - [Sign-up flow diagram drawn from a Mermaid flowchart](https://open-diagram.dev/diagrams/signup-flow-from-mermaid.md): A sign-up flow drawn from a Mermaid flowchart file. What open-diagram keeps, what it changes, and how to get right-angle lines. - [Release cycle diagram as a ring, written as JSON](https://open-diagram.dev/diagrams/release-cycle-ring-diagram.md): A release cycle drawn as a ring, with product goals in the middle, written as JSON. How the ring layout places panels and joins them. - [Incident response process diagram, drawn from Python](https://open-diagram.dev/diagrams/incident-response-process.md): An incident response process diagram, from the first alert to the lessons learned, drawn from Python with owners, statuses and line labels. - [Smart home system diagram, from sensor to phone, in Python](https://open-diagram.dev/diagrams/smart-home-system.md): A smart home system diagram, from room sensors to a phone app, drawn from Python, with a planned overnight update path and statuses. - [Concept map of how git stores a project, drawn from Python](https://open-diagram.dev/diagrams/concept-map.md): A concept map of how git stores a project, its objects and the links between them, with one worked example, drawn from Python or JSON. - [AWS architecture diagram with VPC and subnets, from JSON](https://open-diagram.dev/diagrams/aws-architecture.md): An AWS architecture diagram template with an account, a VPC and subnets around API Gateway, Lambda, RDS and S3, as JSON with AWS icons. - [AWS ETL data pipeline diagram template, as JSON](https://open-diagram.dev/diagrams/aws-etl-pipeline.md): An AWS ETL data pipeline diagram template in six numbered sections, from MWAA orchestration to QuickSight dashboards, as JSON with AWS icons. - [Azure web app architecture diagram template, as JSON](https://open-diagram.dev/diagrams/azure-web-app.md): An Azure web app architecture diagram template, Front Door to App Service with SQL, Redis cache, Key Vault and Blob Storage, as JSON. - [Google Cloud event pipeline diagram template, as JSON](https://open-diagram.dev/diagrams/gcp-event-pipeline.md): A Google Cloud event pipeline diagram template, from Pub/Sub through Cloud Run to BigQuery and Vertex AI, as JSON with Google Cloud icons. ## Compared - [Architecture diagram tools compared: code, text and editors](https://open-diagram.dev/compare.md): Nine tools that draw architecture diagrams, compared on input, layout, layout checks, output, MCP server, license and price, with sources. - [open-diagram vs Mermaid for architecture diagrams](https://open-diagram.dev/compare/mermaid.md): Mermaid draws many kinds of diagram from text. open-diagram draws dense architecture diagrams, checks their layout, and reads Mermaid flowcharts. - [open-diagram vs D2 for architecture diagrams](https://open-diagram.dev/compare/d2.md): D2 is a diagram language with three layout engines and many export formats. open-diagram draws from Python, JSON or Mermaid and checks its layout. - [open-diagram vs draw.io for architecture diagrams](https://open-diagram.dev/compare/drawio.md): draw.io is a free editor where you place every shape by hand. open-diagram draws architecture diagrams from text or code and checks their layout. - [open-diagram vs Excalidraw for architecture diagrams](https://open-diagram.dev/compare/excalidraw.md): Excalidraw is a whiteboard for hand-drawn sketches. open-diagram draws dense architecture diagrams from text or code and checks their layout for free. - [open-diagram vs archify for architecture diagrams](https://open-diagram.dev/compare/archify.md): archify and open-diagram both check their own layout. archify builds interactive HTML pages through an agent; open-diagram writes SVG and PNG files. - [open-diagram vs the Python diagrams library by mingrammer](https://open-diagram.dev/compare/mingrammer-diagrams.md): Both draw architecture from Python. mingrammer's diagrams uses cloud icons and Graphviz; open-diagram uses boxes of text and checks its layout. - [open-diagram vs PlantUML for architecture diagrams](https://open-diagram.dev/compare/plantuml.md): PlantUML draws UML and other diagrams from text. open-diagram draws dense architecture diagrams from Python, JSON or Mermaid and checks the layout. - [open-diagram vs Eraser for architecture diagrams](https://open-diagram.dev/compare/eraser.md): Eraser is a hosted app with diagram-as-code and AI diagrams. open-diagram is a free library that draws architecture diagrams and checks their layout. ## Layout problems - [Layout problems open-diagram reports, and how to fix each one](https://open-diagram.dev/problems.md): Ten layout problems the open-diagram check reports, what each message means, and the change that fixes it. - [Diagram boxes too close or overlapping: how to fix it](https://open-diagram.dev/problems/boxes-too-close.md): What it means when the open-diagram check says two blocks are only a few px apart or overlap, and how to give them room. - [Diagram line crosses a box: how to fix it](https://open-diagram.dev/problems/line-crosses-a-box.md): What it means when the open-diagram check says a line crosses a box, and how to send the line around it through a lane or other sides. - [Line label covers a box in a diagram: how to fix it](https://open-diagram.dev/problems/line-label-covers-a-box.md): What it means when the open-diagram check says a line's label sits on a box, and how to fix it by shortening the label or widening the gap. - [Arrow leaves or enters a box on the wrong side: how to fix it](https://open-diagram.dev/problems/arrow-on-the-wrong-side.md): What it means when the open-diagram check says a line leaves or enters a box facing away, and how auto sides or a lane fix it. - [Line label covers a group title: how to fix it](https://open-diagram.dev/problems/label-covers-group-title.md): What it means when the open-diagram check says a line's label sits on the title of a group, and how to move the line or the group. - [Diagram group covers a box that is not in it: how to fix it](https://open-diagram.dev/problems/group-covers-a-box.md): What it means when the open-diagram check says a group overlaps a box that is not in it, and how to add the box or move it out. - [Graph label touches a node: how to fix it](https://open-diagram.dev/problems/graph-label-touches-a-node.md): What it means when the open-diagram check says a graph label touches a node, and how to spread the nodes or shorten the label. - [Graph line runs through a node: how to fix it](https://open-diagram.dev/problems/graph-line-through-a-node.md): What it means when the open-diagram check says a graph line runs through a node, and how to move a node so the straight line is clear. - [Text does not fit in a diagram box: how to fix it](https://open-diagram.dev/problems/text-does-not-fit.md): What it means when the open-diagram check says a block needs more px than it was given, and how to shorten the words or widen the block. - [Diagram text too small: how to fix it](https://open-diagram.dev/problems/text-too-small.md): What it means when the open-diagram check says the smallest text is below the theme's minimum, and how to fix it with shorter words. ## Guides - [How-to guides for open-diagram](https://open-diagram.dev/guides.md): Step-by-step guides for open-diagram: AI agents, the GitHub Action, statuses, Mermaid, JSON, right-angle lines, cloud icons and sharing. - [Draw architecture diagrams with Claude Code and an MCP server](https://open-diagram.dev/guides/draw-diagrams-with-claude-code.md): Add the open-diagram MCP server and agent skill to Claude Code, then let Claude write, check, fix and draw diagrams with 0 layout problems. - [Set up a diagram MCP server in Cursor, Claude Desktop and Amp](https://open-diagram.dev/guides/mcp-server-in-cursor-claude-desktop-and-amp.md): Setup lines for the open-diagram MCP server in Claude Desktop, Cursor and Amp, with the versions tested and the apps not yet tested. - [Keep architecture diagrams current with a GitHub Action](https://open-diagram.dev/guides/keep-diagrams-current.md): Add the open-diagram GitHub Action so every push checks or redraws your diagrams and fails when a layout problem appears. - [Show live and planned work on an architecture diagram](https://open-diagram.dev/guides/show-live-and-planned-work.md): Mark each part of an architecture diagram as live, being built, in trial, planned or retiring, and update the states from one small file. - [Convert a Mermaid flowchart to a checked SVG and PNG](https://open-diagram.dev/guides/convert-mermaid.md): Turn a Mermaid flowchart into a checked SVG and PNG with one command, and see what carries over, what changes and what is not read. - [Draw diagrams without Python: write JSON from any language](https://open-diagram.dev/guides/json-from-any-language.md): Draw checked architecture diagrams without writing Python: build the JSON in JavaScript, C# or any language, then run one command. - [Describe an architecture diagram as plain text for alt text](https://open-diagram.dev/guides/describe-a-diagram-as-text.md): Print what an open-diagram picture says as plain text, for alt text, screen readers and checking a picture against the request. - [Draw right-angle lines in diagrams from Python, JSON or Mermaid](https://open-diagram.dev/guides/right-angle-lines.md): Draw diagram lines as straight runs that turn at right angles, with one setting in Python, JSON or Mermaid, for the whole picture or one line. - [AWS, Azure and Google Cloud icons in architecture diagrams](https://open-diagram.dev/guides/cloud-icons.md): Draw AWS, Azure and Google Cloud diagrams with each provider's own icons, from a template or the cloud-icons skill, and the terms the icons carry. - [Put architecture diagrams in slides, docs and GitHub READMEs](https://open-diagram.dev/guides/diagrams-in-slides-docs-and-readmes.md): Put open-diagram's SVG and PNG files in slides, documents and GitHub READMEs, and redraw them when the diagram changes. ## Prompts - [What an AI agent drew from one prompt](https://open-diagram.dev/prompts.md): Each page records one real run of an AI agent drawing a diagram from one prompt with open-diagram, with the check's messages quoted exactly. - [Systems map from one prompt: what an AI agent drew](https://open-diagram.dev/prompts/systems-map-live-and-planned.md): One recorded run of an AI agent drawing a live-and-planned systems map with open-diagram. The first draft had 0 layout problems. - [Mermaid flowchart to slide diagram: what an AI agent drew](https://open-diagram.dev/prompts/mermaid-flowchart-to-slide.md): One recorded run of an AI agent turning a pasted Mermaid flowchart into a slide diagram with open-diagram, in three drafts. - [Release cycle ring diagram from one prompt: what an AI agent drew](https://open-diagram.dev/prompts/release-cycle-ring.md): One recorded run of an AI agent drawing a release cycle as a ring, goals in the middle, with open-diagram. Two drafts, 0 layout problems. - [Business process diagram with owners: what an AI agent drew](https://open-diagram.dev/prompts/business-process-with-owners.md): One recorded run of an AI agent drawing an order-to-delivery process with an owner on every step, using open-diagram. Two drafts. - [Layered stack diagram with retiring parts: what an AI agent drew](https://open-diagram.dev/prompts/stack-layers-retiring.md): One recorded run of an AI agent drawing a software stack as layers, with retiring parts marked, using open-diagram. Two drafts. ## For AI agents - [open-diagram for AI agents](https://open-diagram.dev/for-agents.md): Each way an AI coding agent can use open-diagram: the MCP server, the agent skill, the command line, the Python library and llms.txt. - [open-diagram MCP tools: names, arguments and results](https://open-diagram.dev/for-agents/mcp-tools.md): The five tools of the open-diagram MCP server, with each argument, its type and default, what each tool returns, and which one writes files. - [The open-diagram format guide, as the MCP server returns it](https://open-diagram.dev/for-agents/format-guide.md): The format guide that the open-diagram MCP server's format_guide tool returns: a JSON example, every key, Mermaid rules and fixes. - [open-diagram layout problem messages and their fixes](https://open-diagram.dev/for-agents/layout-problem-messages.md): Every layout problem message open-diagram reports, in the exact words of the code, with what it means and how to fix it. - [An AGENTS.md block for drawing diagrams with open-diagram](https://open-diagram.dev/for-agents/agents-md-block.md): A block to paste into your project's AGENTS.md or CLAUDE.md, so a coding agent draws diagrams with open-diagram and fixes each layout problem. ## Markdown The links in the sections from Diagram examples on are Markdown copies. Each page also has a web page at the same address ending in .html. All docs and pages in one file: https://open-diagram.dev/llms-full.txt