Convert an architecture diagram into code.
The direction almost nothing else does: the diagram stops being documentation and becomes the instruction.
What actually happens
The canvas is converted into a markdown specification listing every component, its tier, the notes attached to it, and every relationship with direction. That document, along with your DESIGN.md if you have one and the README for orientation, becomes the context for a real coding turn. The agent implements against the drawing rather than against a paragraph you would otherwise have written twice.
Why a specification rather than code generation
Generating code directly from boxes produces scaffolding that matches the diagram's shape and none of your conventions, which is why that approach has never stuck. Converting to a specification and running a normal agentic coding turn means the result goes through the same review path as any other change and can take your existing patterns into account.
Reviewable diffs, not a dump
What comes back is a diff you approve or reject, and the agent can run propose-only until you tell it to apply. A diagram that silently rewrote your repository would be a worse idea than not having the feature.
The diagram stays the source
Because the specification is generated from the graph each time, changing the diagram and re-running produces an updated instruction rather than a divergent second document. That is the part that makes the loop worth using more than once.
What the specification carries
| From the diagram | In the specification |
|---|---|
| Every component | A named element with its tier |
| Node notes | The responsibility of that component |
| Every edge with direction | A stated relationship |
| Edge labels | What crosses that relationship |
| Tier membership | Layering constraints |
| Attached documentation | Prose context for that component |
| Your DESIGN.md | Carried along as the authoritative spec |
| README | Orientation about existing conventions |
The flow
Questions
Related
- Convert Code to a DiagramThe general case: point it at code and get a diagram of what is there rather than what you remember building.
- Convert Terraform to an Architecture DiagramTerraform records dependencies explicitly through references, so the edges are read rather than inferred. It is one of the most reliable sources there is.
- Convert Mermaid to ExcalidrawUseful when a Mermaid diagram has outgrown what Mermaid's layout can render legibly.
- Convert SQL to an ER DiagramForeign keys already encode the relationships and their cardinality. The diagram renders what the schema is enforcing anyway.