One diagram that renders everywhere your docs go
Technical writers and DevRel teams publish the same explanation to a docs site, a README, a PDF, and a support thread — and every medium breaks images and Mermaid differently. mdd output is plain aligned Unicode inside the Markdown, so the diagram survives every downstream format unchanged.
A concept diagram in a Git tutorial
The classic Git data-flow explanation as it appears in a tutorial. Paste the Markdown anywhere — the diagram is the text.
<!-- mdd:begin id=git-flow src=docs/git-flow.diagram.json -->
```
┌──────────────┐
│ Working Tree │
└───────┬──────┘
git add
│
┌───────▼───────┐
│ Staging Index │
└───────┬───────┘
git commit
│
┌──────▼─────┐
│ Local Repo │
└──────┬─────┘
git push
│
┌────────▼────────┐
│ origin (remote) │
└─────────────────┘
```
[diagram source](docs/git-flow.diagram.json)
<!-- mdd:end -->The model your agent edits
{
"version": 1,
"boxes": [
{
"id": "working",
"label": "Working Tree",
"row": 0,
"connections": [
{
"to": "index",
"arrow": "to",
"label": "git add"
}
]
},
{
"id": "index",
"label": "Staging Index",
"row": 1,
"connections": [
{
"to": "local",
"arrow": "to",
"label": "git commit"
}
]
},
{
"id": "local",
"label": "Local Repo",
"row": 2,
"connections": [
{
"to": "remote",
"arrow": "to",
"label": "git push"
}
]
},
{
"id": "remote",
"label": "origin (remote)",
"row": 3
}
]
}Your agent draws it, you review it
- Model the concept as JSON — or draw it in the mdd editor and export.
- Splice it into the tutorial with mdd render.
- Publish the same Markdown to the docs site, README, PDF, or chat — the diagram needs no renderer.
- When the product changes, your agent updates the JSON and every copy of the ASCII regenerates from one source.
A prompt to hand your agent
This tutorial's diagrams are maintained with mdd. To change one, edit its .diagram.json source (e.g. docs/git-flow.diagram.json), then run: npx mdd render --json docs/git-flow.diagram.json --file docs/tutorial.md --id git-flow.
Why mdd here
Every other diagram format makes the tutorial hostage to a renderer: Mermaid needs a plugin, images need a build step and break in dark mode, and both are invisible in terminals and chat. mdd's diagram is the Markdown — it renders wherever text renders, and the JSON source keeps it editable without redrawing.
More use cases
- AGENTS.md architecture maps — An architecture map in your agent context file: ASCII for humans, JSON ground truth for the agent.
- Diagrams in code comments — Header-comment state machines and layouts, computed from JSON and spliced behind // or #.
- Runbook flowcharts — Decision flows and failure maps readable in any terminal, drafted and updated by your incident tooling.
- Design docs, RFCs & ADRs — RFC and ADR system diagrams that stay legible in diffs across every revision round.
- ASCII sequence diagrams — Auth flows and call chains as plain text: message order in the JSON is the layout.
- Data pipeline lineage maps — A curated lineage map your agent keeps current as pipeline models change.
- Multi-agent orchestration maps — Agent hand-offs, tool wiring, and memory flow — documentation the agents themselves can update.
- Docs-as-code threat models — Data-flow diagrams with trust boundaries, drafted from the code and reviewed in the diff.
- web editor docs