The complete loop
Why this works well for agents
A discoverable contract. Query the running binary instead of guessing field names from an old example. The generated schema supports validation in other tools. Actionable feedback. An issue can locate a field such asnodes.scene.parts[2].shape and suggest cylinder. Layout feedback describes geometric problems; the agent can revise a specific object.
An editable result. Source repair returns YAML that can become the next input. The text is suitable for review and version control. Keep IDs stable across iterations.
A visual check. A score cannot prove that a person will understand a diagram. Open the PNG, or use a local SVG viewer. Preview a crowded edge without repeatedly examining the entire scene.
A local, reusable engine. CLI, MCP and the Go library expose the drawing pipeline. The engine does not require an account. AI-client hosting and data handling are separate.
The same loop from a terminal
Save the starter YAML asinput.yaml, then run each stage and inspect its result:
repair --write changes the source; keep a baseline first. validate returns 0 for clean, 2 for warnings, and 3 for errors. Render warnings do not necessarily produce a nonzero exit code. Treat each command’s contract separately.
A reliable handoff
Return the editable source path, SVG path, and a brief account of what was checked. Include remaining warnings. When snapshot generation is unavailable, say so and keep the SVG available for human inspection.Continue after a human edit
Choose one authoring file, such asdiagrams/first-architecture/input.yaml.
topology.yaml is an output copy, so keep the authoring path explicit in each handoff.
- Let the human finish editing in Studio and confirm the saved file contains the change.
- Read the authoring file from disk before the next tool call; do not reuse stale DSL from conversation history.
- Validate and render the latest source, then inspect the exported SVG before returning it.
API Gateway to Public API, the next agent edit
should preserve that label while adding a cache. Saving in Studio updates the
source, while publishing the updated SVG requires another render.
Use the same engine revision, source and resources for reproducible output. External images, fonts, renderer revisions and PNG backends can affect results. Repair is bounded and preserves some explicit routing intent; it is not a global layout guarantee.
Connect your first agent · MCP arguments · CLI contracts