Other agents
Any agent with a shell can run diago. It reads a spec file and writes a diagram to stdout, so
there is nothing to connect: the agent needs diago on its PATH and an instruction that says
when to use it.
The instruction block
Section titled “The instruction block”Put this in your project’s AGENTS.md, CLAUDE.md, GEMINI.md or .cursor/rules:
## Diagrams
Use diago (https://diago.dev) to show structure: components and how they connect, a requestpath, task order, a data model, states, or a change to any of these.
- Write each diagram as a JSON spec file, with an explicit, stable `id` on every node and edge. Spec reference: https://diago.dev/docs/reference/flow-spec/ (and sequence-spec, class-spec).- Run `diago check -strict <spec>` and fix every finding before showing anything.- In a terminal, show `diago render -format text <spec>` in a fenced `text` block, at most 100 columns wide; elsewhere, also render SVG, or PNG with `-format png` (needs resvg).- When something changes, copy the spec to a new version, keep the ids of everything that stays, and show `diago diff old.json new.json -format text`.- Never fall back to Mermaid or hand-drawn ASCII; if `diago` is missing, say that `go install github.com/oxforge/diago/cmd/diago@latest` installs it.The block asks for stable ids so that a later revision can be shown as a
diff, and for check -strict so the agent fixes its own spec before you
see it. The spec references are the flow,
sequence and class pages.
In Claude Code, the plugin does this and more without an
instruction block.
Docs for agents
Section titled “Docs for agents”The site publishes its documentation as plain text for an agent to read:
- https://diago.dev/llms.txt is an index: it points to the two files below.
- https://diago.dev/llms-full.txt holds every docs page in full, in one file.
- https://diago.dev/llms-small.txt is a shorter version of it.
Why a CLI and not an MCP server
Section titled “Why a CLI and not an MCP server”Agents run diago as a binary rather than through an MCP server, for three reasons:
- A spec lives in a file, so a revision is a small edit, and
diago diff old.json new.jsoncosts two paths. An MCP tool takes the whole spec as arguments on every render, and both specs for a diff, which the agent pays for in output tokens. - Images go to disk and never pass through the agent’s context.
- Every agent with a shell can run it. An MCP server would serve only hosts without one.