See it as a diagram
Everything below, as a diagram you can edit. Describe yours and see it in seconds.
No account needed · Editable canvas, not a picture
Why a rules file and not a better prompt
A prompt says what you want this time. A rules file says how the tools behave, which is the same every time and which nobody wants to retype. Claude Code reads CLAUDE.md, several clients follow the AGENTS.md convention, and Cursor has project rules. What they share is the property that matters: the file is loaded at the start of a session, before the model has done anything expensive.
The rules that pay off are the ones that prevent a mistake with a cost: a duplicate diagram, a spent credit, a replaced canvas, a false claim of freshness in a pull request description. Style preferences do not belong there, because the design guide the tools expose already carries the drawing standard and it is maintained on the tool side rather than yours.
Keep one copy. A rules file per client that says slightly different things is how a team ends up with two behaviours and no explanation. Write it once and point the other files at it.
Six rules that pay for themselves
Read the design guide before drawing. One call, and it is the difference between a diagram that matches the rest of the workspace and one that announces it was made by a machine.
Never generate a second diagram of something that already exists. The list tool is one call and returns names, ids, node counts and last-updated dates, most recent first, so checking is cheaper than the duplicate.
Never call create_diagram twice for one request. Generation waits about 35 seconds and then continues in the background, returning an id, so the correct follow-up is polling and the incorrect one costs a credit and leaves two diagrams to reconcile.
Edit instead of redrawing when the change can be named. Default the scope to overview, and ask before producing a detailed diagram that itemises everything.
Do not refresh a repository-linked project that someone hand-tuned without asking, because a sync regenerates from source and replaces canvas edits.
Before telling anyone a diagram is current, check the status tool and quote the commit. "Synced today at commit 4f1c9a2b" is checkable; "the diagram is up to date" is a claim nobody can verify.
Two numbers belong in the same file as context rather than as rules. Syncs are rate limited to ten in ten minutes per account, and a sync of a single link is deduplicated, so an instruction to refresh every project in the workspace produces a queue rather than twenty simultaneous generations. Writing that down is what stops the next person adding a retry loop around the rate-limit message.
## Diagrams (Datadef MCP) - Call get_design_guide before the first canvas_* call in a session. - Check list_diagrams before creating anything. Do not create a second diagram of a system that already has one. - create_diagram waits ~35s. If it returns an id and no image, poll get_diagram every 30s. Never call create_diagram twice for one request. - Prefer edit_diagram over regenerating. Default scope is "overview"; ask before using "detailed". - Never call repo_refresh on a hand-tuned project without asking: a sync regenerates from source and replaces canvas edits. - Before claiming a diagram is current, call repo_status and quote the commit and sync time.
Rules that do not survive contact
Do not encode layout in the rules file. Node counts, coordinates, spacing and colour rules go stale against a tool that maintains its own standard, and an agent following your outdated copy produces diagrams that look subtly wrong next to generated ones. Point at the design guide instead.
Do not ask for tighter polling than every 30 seconds. It does not make generation faster, and it burns the session context on status text.
Do not name tools the way prose names them. Every canvas primitive is exposed to clients with a canvas_ prefix, so a rule that says run layout_canvas points at a tool that does not exist; the callable name is canvas_layout_canvas. The server rewrites bare references inside its own tool descriptions for exactly this reason, and a rules file you wrote by hand gets no such treatment. The cheapest way to avoid the class of error is to generate the tool names from the live surface, which tools/list returns without a key.
Do not write rules that require the agent to know something it cannot check. "Only refresh diagrams nobody is editing" reads well and is unenforceable; "ask before refreshing a project with daily sync turned off" points at a flag the status call actually returns.
Where each client reads them
Claude Code takes CLAUDE.md, clients following the AGENTS.md convention take AGENTS.md, and Cursor takes project rules. The exact paths move faster than the conventions do, so take yours from that client's own documentation on the day you set it up rather than from a blog post. What does not move is the shape of the answer: keep the real content in one file and reference it from the others, so three copies cannot drift into three behaviours.
One more placement note: rules about diagrams belong in the repository whose diagram it is. A rule in a personal configuration file works for you and for nobody else on the team, which is how a workspace ends up with one person producing consistent diagrams and everyone else producing something else.
The test for a rule
FAQ
Where do you put instructions for an agent about a diagram tool?
What is the most common mistake an agent makes with a diagram server?
Should the rules file describe the diagram style we want?
How do you stop an agent overwriting a diagram someone tuned by hand?
Do rules files replace reviewing what the agent produced?