Brand-locking diagrams for a static blog, and the three checks that catch a broken one
Tooling changes fast. Every command and check below is what actually ran on my machines in November 2026 — re-run them before trusting them.
Every post on this site has been text plus the occasional screenshot. That worked, but it left a gap: when I describe a pipeline, the reader gets a wall of prose where one picture would do. I resisted adding figures for a long time, because the failure modes are worse than no figure at all. A diagram in the wrong colors makes the page look assembled from spare parts. One without reserved dimensions can shove the text around as it loads. And a figure that quietly downloads a webfont or phones an analytics endpoint is a dependency you shipped yourself.
So before any diagram appears on this site, it now has to pass three gates. This post is the first one shipping with its own pipeline diagram inlined — the figure below went through the gates before you saw it.
The pipeline
The figures are generated by an agent skill that emits a single HTML file with hand-placed inline SVG — no chart library, no rendering service. Before writing a figure, the skill reads a brand profile I extracted from this site’s own CSS: paper #ffffff, ink #1a1d21, accent #0b5fff, and the system font stack. That last choice matters twice: the figure downloads no webfont, and it matches the page it lives on. (The skill technically allows one approved remote stylesheet — a Google Fonts file. The self-check itself runs without any network access; “zero network requests” describes the figures this site’s profile produces, because the font source is system. The format’s only permitted remote asset is never requested here.)
<rect width="100%" height="100%" fill="#ffffff"/>
<!-- Zone: gates band, painted before arrows and nodes -->
<rect x="500" y="76" width="240" height="396" rx="8" fill="rgba(11,95,255,0.03)" stroke="rgba(11,95,255,0.35)" stroke-width="1"/>
<text x="516" y="99" font-family="ui-monospace, SFMono-Regular, Menlo, Consolas, monospace" font-size="11" letter-spacing="1.5" fill="#0b5fff">THREE GATES, IN ORDER</text>
<!-- Arrows (painted before node labels) -->
<line x1="215" y1="193" x2="265" y2="193" stroke="#5b6470" stroke-width="1.5" marker-end="url(#arrow)"/>
<line x1="215" y1="357" x2="265" y2="357" stroke="#5b6470" stroke-width="1.5" marker-end="url(#arrow)"/>
<line x1="460" y1="270" x2="500" y2="270" stroke="#5b6470" stroke-width="1.5" marker-end="url(#arrow)"/>
<line x1="740" y1="193" x2="780" y2="193" stroke="#5b6470" stroke-width="1.5" marker-end="url(#arrow)"/>
<line x1="740" y1="357" x2="780" y2="357" stroke="#5b6470" stroke-width="1.5" marker-end="url(#arrow)"/>
<!-- Column A: inputs -->
<rect x="40" y="150" width="175" height="86" rx="6" fill="#f6f8fa" stroke="rgba(26,29,33,0.18)" stroke-width="1"/>
<text x="56" y="176" font-family="ui-sans-serif, system-ui, sans-serif" font-size="13" font-weight="600" fill="#1a1d21">Blog draft text</text>
<text x="56" y="196" font-family="ui-sans-serif, system-ui, sans-serif" font-size="11" fill="#5b6470">the post being written,</text>
<text x="56" y="212" font-family="ui-sans-serif, system-ui, sans-serif" font-size="11" fill="#5b6470">and the section that</text>
<text x="56" y="228" font-family="ui-sans-serif, system-ui, sans-serif" font-size="11" fill="#5b6470">needs a figure</text>
<rect x="40" y="314" width="175" height="86" rx="6" fill="#f6f8fa" stroke="rgba(26,29,33,0.18)" stroke-width="1"/>
<text x="56" y="340" font-family="ui-sans-serif, system-ui, sans-serif" font-size="13" font-weight="600" fill="#1a1d21">Brand profile</text>
<text x="56" y="360" font-family="ui-monospace, SFMono-Regular, Menlo, monospace" font-size="10.5" fill="#5b6470">paper #ffffff</text>
<text x="56" y="376" font-family="ui-monospace, SFMono-Regular, Menlo, monospace" font-size="10.5" fill="#5b6470">ink #1a1d21 · accent</text>
<text x="56" y="391" font-family="ui-monospace, SFMono-Regular, Menlo, monospace" font-size="10.5" fill="#5b6470">#0b5fff · system fonts</text>
<!-- Column B: generator -->
<rect x="265" y="170" width="195" height="200" rx="6" fill="#ffffff" stroke="rgba(26,29,33,0.28)" stroke-width="1.2"/>
<text x="281" y="200" font-family="ui-sans-serif, system-ui, sans-serif" font-size="13" font-weight="600" fill="#1a1d21">diagram-design skill</text>
<text x="281" y="226" font-family="ui-sans-serif, system-ui, sans-serif" font-size="11" fill="#5b6470">one HTML file, inline</text>
<text x="281" y="242" font-family="ui-sans-serif, system-ui, sans-serif" font-size="11" fill="#5b6470">SVG, hand-placed boxes</text>
<text x="281" y="272" font-family="ui-sans-serif, system-ui, sans-serif" font-size="11" fill="#5b6470">reads the brand profile,</text>
<text x="281" y="288" font-family="ui-sans-serif, system-ui, sans-serif" font-size="11" fill="#5b6470">never phones home: zero</text>
<text x="281" y="304" font-family="ui-sans-serif, system-ui, sans-serif" font-size="11" fill="#5b6470">network requests</text>
<text x="281" y="334" font-family="ui-sans-serif, system-ui, sans-serif" font-size="11" fill="#5b6470">English text only — the</text>
<text x="281" y="350" font-family="ui-sans-serif, system-ui, sans-serif" font-size="11" fill="#5b6470">site rejects CJK in dist</text>
<!-- Column C: gates -->
<rect x="516" y="110" width="208" height="86" rx="6" fill="#ffffff" stroke="rgba(26,29,33,0.28)" stroke-width="1.2"/>
<rect x="516" y="110" width="4" height="86" fill="#0b5fff"/>
<text x="534" y="134" font-family="ui-sans-serif, system-ui, sans-serif" font-size="12.5" font-weight="600" fill="#1a1d21">Gate 1 · machine checks</text>
<text x="534" y="154" font-family="ui-monospace, SFMono-Regular, Menlo, monospace" font-size="10" fill="#0b5fff">self_check --offline</text>
<text x="534" y="172" font-family="ui-sans-serif, system-ui, sans-serif" font-size="11" fill="#5b6470">no external requests, no</text>
<text x="534" y="188" font-family="ui-sans-serif, system-ui, sans-serif" font-size="11" fill="#5b6470">scripts, SVG contract intact</text>
<rect x="516" y="252" width="208" height="86" rx="6" fill="#ffffff" stroke="rgba(26,29,33,0.28)" stroke-width="1.2"/>
<rect x="516" y="252" width="4" height="86" fill="#0b5fff"/>
<text x="534" y="276" font-family="ui-sans-serif, system-ui, sans-serif" font-size="12.5" font-weight="600" fill="#1a1d21">Gate 2 · geometry</text>
<text x="534" y="296" font-family="ui-monospace, SFMono-Regular, Menlo, monospace" font-size="10" fill="#0b5fff">verify_geometry.py</text>
<text x="534" y="314" font-family="ui-sans-serif, system-ui, sans-serif" font-size="11" fill="#5b6470">no label clipped by a node</text>
<text x="534" y="330" font-family="ui-sans-serif, system-ui, sans-serif" font-size="11" fill="#5b6470">painted after it</text>
<rect x="516" y="394" width="208" height="64" rx="6" fill="#ffffff" stroke="rgba(26,29,33,0.28)" stroke-width="1.2"/>
<rect x="516" y="394" width="4" height="64" fill="#0b5fff"/>
<text x="534" y="418" font-family="ui-sans-serif, system-ui, sans-serif" font-size="12.5" font-weight="600" fill="#1a1d21">Gate 3 · human eye</text>
<text x="534" y="438" font-family="ui-sans-serif, system-ui, sans-serif" font-size="11" fill="#5b6470">headless screenshot, checked</text>
<text x="534" y="453" font-family="ui-sans-serif, system-ui, sans-serif" font-size="11" fill="#5b6470">for overlap and contrast</text>
<!-- Column D: ship -->
<rect x="780" y="150" width="145" height="86" rx="6" fill="#f6f8fa" stroke="rgba(26,29,33,0.18)" stroke-width="1"/>
<text x="794" y="176" font-family="ui-sans-serif, system-ui, sans-serif" font-size="13" font-weight="600" fill="#1a1d21">Inline SVG</text>
<text x="794" y="196" font-family="ui-sans-serif, system-ui, sans-serif" font-size="11" fill="#5b6470">fixed width/height —</text>
<text x="794" y="212" font-family="ui-sans-serif, system-ui, sans-serif" font-size="11" fill="#5b6470">no layout shift</text>
<rect x="780" y="314" width="145" height="86" rx="6" fill="#f6f8fa" stroke="rgba(26,29,33,0.18)" stroke-width="1"/>
<text x="794" y="340" font-family="ui-sans-serif, system-ui, sans-serif" font-size="13" font-weight="600" fill="#1a1d21">Post ships</text>
<text x="794" y="360" font-family="ui-sans-serif, system-ui, sans-serif" font-size="11" fill="#5b6470">zero-CJK guard +</text>
<text x="794" y="376" font-family="ui-sans-serif, system-ui, sans-serif" font-size="11" fill="#5b6470">contract tests run</text>
<text x="794" y="391" font-family="ui-sans-serif, system-ui, sans-serif" font-size="11" fill="#5b6470">on every deploy</text>
</svg>
Gate 1: a machine check that runs offline
The first gate is a static analysis script, self_check.py --offline, that ships inside the skill so the agent that wrote the figure can verify it without any network. It checks the single-file rules — no remote assets beyond that approved stylesheet, no executable attributes, no stray scripts — and it measures every text label against the width of the box it claims to fit in.
That last check is not decorative. The first version of the figure above carried this label on one line inside a 175px-wide box:
section that needs a figure
The check failed it with this log, quoted verbatim:
text 'section that needs a figure' is budgeted at 178px and overflows its 175px box by 19px
The arithmetic is simple once you know the checker budgets each character at 0.6em and compares the line’s endpoint against the box edge: the caption starts at x=56 with a budgeted width of 178px, so it would end at x=234 — 19px past the box’s right edge at 215. I split the caption onto shorter lines (the shipped figure reads “and the section that / needs a figure”) and re-ran: green. This is the kind of defect you can stare at in raw SVG for ten minutes and miss, because you read what you meant to write.
An offline check also keeps the figure honest about its cost: if a diagram can’t pass without fetching something, it doesn’t ship.
Gate 2: geometry that looks fine in source and wrong in pixels
The second gate is verify_geometry.py. Its documented job, straight from the script’s own docstring: verify that no diagram label mask is clipped by a node painted after it. SVG paints in document order, so a label drawn on an arrow can be covered by any node that comes later in the file — the source order shows the intent, the rendered pixels show the damage.
This particular figure has no labeled arrows, so the check passed trivially, in milliseconds. It exists for the flow diagrams that do carry connector labels, and it runs on every figure either way.
Gate 3: a human eye, because screenshots can mislead
The last gate is a headless-browser screenshot, reviewed by an actual person. Two things this gate has caught that the scripts can’t.
First, my headless setup forced prefers-color-scheme: dark, and the first screenshot came back rendered in dark mode — wrong for a figure drawn for a white page, in a way no text check would flag. The fix, in my setup, is one Chrome DevTools Protocol command before capturing:
Emulation.setEmulatedMedia { features: [{ name: "prefers-color-scheme", value: "light" }] }
It’s now a line in the runbook, right before the screenshot step.
Second, judgment calls. On the first screenshot of the figure above, the flow read wrong: the brand profile and the “post ships” step sat in the diagram but outside the arrow path, so a reader could miss that they’re part of the pipeline. I added the two missing connectors and re-ran all three gates. A screenshot plus thirty seconds of looking has caught both defects this pipeline has produced so far; I don’t trust it to catch everything, which is why it’s the last gate and not the only one.
One honest limitation: figures from this skill are not deterministic. Ask twice and the layout shifts. That’s acceptable here — these are final, publish-once figures, and the gates run on every one. For charts that regenerate weekly, I still use text-based diagramming (Mermaid) where diffs stay reviewable.
Shipping details that matter more than the figure
Two decisions at the page level carry most of the risk.
The SVG inlines directly into the post HTML with explicit width and height attributes. Inline means no extra request and no dependency on an image host. Whether the browser can reserve the figure’s space depends on the embedding and sizing context: with explicit dimensions — or an equivalent CSS aspect-ratio on a responsive figure — it reserves the box before the SVG renders. Without any reserved dimensions, a figure that loads after the surrounding text shifts that text when its box finally appears. How much that costs depends on where the figure sits; for a mid-article figure on a monetized page, reserving the space is the cheap insurance. (Layout shift is also a Core Web Vitals metric Google measures — and on a page with display ads, moving content means moving ad slots, which is its own headache.)
And every label is English, which isn’t a style preference. This site’s contract tests scan the built HTML for CJK codepoints — the check lives in tests/helpers.mjs and runs as part of pnpm test on every deploy; a hit fails the build. An inline SVG lands in that built HTML, so a figure full of Chinese labels would trip the guard. The constraint is enforced where it can’t be forgotten: at the gate, not in my memory.
Why three gates and not one
Each gate catches what the previous one structurally cannot. Gate 1 catches content the renderer would silently draw (overflow, external fetches). Gate 2 catches paint-order defects that look fine in source. Gate 3 catches everything that’s only visible in pixels — and things that are fine in pixels but wrong for a reader. Skipping any one of them doesn’t make the process faster; it moves the failure to the reader.
The figure above passed all three before this post went live. If you spot a label sitting on a border, an arrow that ends short, a caption that overflowed — one of the gates has a hole, and I want to know which.