Convert code into an architecture diagram.
The general case: point it at code and get a diagram of what is there rather than what you remember building.
What conversion means here
There is no mechanical mapping from code to architecture, because architecture is a set of judgements about which distinctions matter. What happens instead is a survey: manifests and deployment files establish what the project claims to be, entry points and the import graph establish what it actually connects to, and the result is a proposed set of components and edges. That is a reading rather than a translation, which is why the output is a first draft you correct rather than a build artifact.
Why the layout is not part of the guesswork
The model decides what the components are; it never decides where they go. The graph it emits has no coordinates, and ELK computes positions and orthogonal routing from it. That split is what makes the output usable: the part a language model is bad at, spatial arrangement, is handled by a solver that cannot produce overlaps.
Correcting it is editing the graph
The first draft will include something incidental or miss a relationship that lives in configuration rather than code. Removing a node or adding an edge re-solves the whole layout, so corrections cost nothing in alignment. That is the practical difference from a tool where your manual edits and the generator's next output fight each other.
What survives the conversion
| Comes through | Does not | |
|---|---|---|
| Components | Services, modules, packages with an entry point | Runtime-assembled components |
| Edges | Imports, client instantiation, configured addresses | Calls resolved dynamically |
| Data stores | Drivers and connection configuration | Stores reached through an abstraction only |
| External services | SDK imports and configured endpoints | Anything called by URL built at runtime |
| Responsibilities | Inferred from names and structure | Intent that is not written down |
| Infrastructure | What is in compose or manifests | Anything created in a console |
The command
Questions
Related
- Convert a Diagram into CodeThe direction almost nothing else does: the diagram stops being documentation and becomes the instruction.
- 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.