Diagram as code
Text formats that render flowcharts and other diagrams from Markdown, such as Mermaid.
Diagram as code means describing a flowchart, sequence, or architecture in text and rendering it as a picture. Mermaid is a common format, often embedded in Markdown. The text lives in the repo, reviews like any other change, and you do not have to keep a binary drawing in sync with the design.
This works well for diagrams that will change: a request path, a state machine, or a data flow you want next to the code. It works less well for dense visual design or for posters that need careful layout. Keep diagrams small enough to read in a pull request. A chart that does not fit on a page should be split.
Write the diagram for the next reader, not for the tool. Name the boxes in the language of the product, and avoid layout hacks that break when the renderer updates. If you generate diagrams from an agent, still read the text; a confident-looking chart can describe a system that does not exist.
A good test is whether you can edit the diagram in a plain text box and get a useful picture back. If you need a GUI to finish it, it may not belong in this format.