Use case

Keeping architecture diagrams current.

Every architecture diagram is accurate on the day it is drawn. The question is what happens in month four.

Download for macOS
v0.1.33 · .dmg · Apple Silicon & Intel
Signed & notarized by Apple · opens without a Gatekeeper warning
sha256 698955a0187bc039f4c74f5d05a9f10fbb27376a45788a0a241d1326b73873c7
Download for Windows instead
$curl -fsSL https://lucidtrain.com/install.sh | sh

Why diagrams rot

Not because people do not care, but because updating a hand-drawn diagram costs an hour and updating the code costs the sprint. When the artifact and the system are maintained separately, and one of them is checked by tests and the other is not, only one of them stays true. Nothing about discipline changes that arithmetic.

Generate rather than maintain

If the diagram is derived from the code, refreshing it is a command instead of an hour, and the arithmetic changes. This is the same reason generated API documentation is current and hand-written API documentation is not; the mechanism is unremarkable and it works.

Where to put it

An exported SVG committed to the repository beside the README, regenerated when the architecture changes. Not in a wiki, where it will be found by nobody and updated by no one. In the repository it is beside the thing it describes and it shows up in diffs, which is the closest thing to a review this artifact will ever get.

The honest limitation

Regenerating is cheap, and cheap is not automatic. Something still has to trigger it, and in practice that is a person or a scheduled job rather than a guarantee. This makes staying current realistic rather than solved, which is a meaningful improvement and not the same as a solution.

Refresh

shell
$ cd repo
$ lucid
# Regenerate the architecture diagram and export it to docs/architecture.svg
FAQ

Questions

Can this run in CI?

The desktop app is interactive, so the honest answer is that regeneration is a person running a command. Committing the exported SVG means the diff shows when the architecture changed, which is most of the benefit.

Will the diagram change every time even if the code did not?

Layout is deterministic for a given graph, so an unchanged architecture produces an unchanged diagram. That is what makes a diff meaningful rather than noise.

What about the intended architecture?

Keep that as a separate, hand-maintained diagram. Conflating the target state with the current state is how both become useless.

Related