Every architecture map comes from a script → render → look loop: Python writes SVG/HTML, headless Chrome renders PNG at 2x, and you open each PNG before anyone sees it. The script is the source of truth; the PNG is what gets shown everywhere.
| Map | For | Script | Output |
|---|---|---|---|
| LLD | everything that exists and who talks to whom | docs/architecture/draw.py | v1.svg + v1.png |
| Flow map | one flow per image, arrows numbered in order | docs/architecture/draw_flows.py | flows/N-name.png |
| HLD | the first look for someone new (top of the README) | docs/assets/build.py | hld-light.png |
| Banner | the top of the README | docs/assets/build.py | banner.png |
Steps
-
Inventory. Read the code and docs and list the system's pieces: who is outside (people, clients), what you deploy and its parts, the managed services, the outside APIs you only call, and the flows (each one a sequence of calls). Done when every piece and flow traces to a file or config you read.
-
Copy the templates the first time:
templates/architecture/*→docs/architecture/,templates/assets/build.py→docs/assets/. Done when the files are in place and the example still renders. -
Write the maps. LLD and flow maps: replace the example block in
draw.pyand the flows indraw_flows.py, by the rules inLLD.md. HLD and banner: edit the CONFIG block inbuild.py, byREADME-IMAGES.md. Reusebox(),arrow(),legend(),devices(),glyph(). Done when every piece and flow from step 1 is on a map. -
Render with
docs/architecture/render.sh. Done when it exits 0. -
Look. Open every PNG. Each label and arrow needs clear space: a pill only on its own arrow, an arrow touching only its two ends, each arrowhead visible. Something crosses? Move the grid and go back to step 4. Done when every PNG is clean.
-
Place the PNGs:
- README: banner → badges → one sentence →
hld-light.pngat 720 px. - ARCHITECTURE.md:
v1.pngat the top, then## Flowswith eachflows/*.pngat 760 px. - Artifact, slide, doc: the same PNG files as images.
Done when every place shows the current PNG. When the system changes (a new service, a new flow), change the script, run steps 4–6, and update every place in the same change.
- README: banner → badges → one sentence →


