/zazencodes-skills:diagram-vizfrom zazencodes-skills
Draws architecture diagrams, block diagrams, timelines, and how-something-works flows as styled PNG images using HTML/CSS and headless Chrome. Not for data charts or ASCII.
Ships in zazencodes-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Explanatory diagrams in the ZazenCodes style: HTML and CSS on a fixed 1280×720 frame, rendered to PNG with headless Chrome. The look is quiet gunmetal boxes on a dark page, a brand-coloured outline only on the entities that matter, thin grey arrows, and every element named in plain text. Draw it in this HTML. Mermaid, Graphviz, chart libraries and image generators cannot produce this style.
Requirements: macOS, Google Chrome, and the fonts Inter and JetBrainsMono Nerd Font installed (brew install --cask font-inter font-jetbrains-mono-nerd-font).
The target look is examples/harness.png (block diagram) and examples/timeline.png (timeline), each beside the HTML that made it. View the matching PNG and read its HTML before you draw.
<skill> below is this skill's directory.
Work in this order. Colour comes last.
<skill>/template.html to <name>.html where the user wants the image (the current project if they named no place). Set the <title> and <h1>, set the .dg height to what the diagram uses (at most 480px), and place components inside .dg with absolute left, top, width and height in whole px, following Geometry. A short diagram is fine: the frame centres it, so don't stretch boxes to fill the space.<skill>/scripts/render.sh <name>.html <name>.png. It writes a 2560×1440 PNG, then checks the layout. If something is wrong it exits 1 and lists the faults: text that wraps where it must not, content overflowing a box, text colliding with text, lines or boxes, arrows touching boxes, and anything outside the canvas or frame. It also fails if Chrome, Inter or JetBrainsMono Nerd Font is missing. Fix every fault and render again.Deliver both files, the PNG and its HTML source.
| The diagram shows | Form | Components |
|---|---|---|
| What talks to what | Boxes joined by arrows | .box, .arr, .varr, .cap |
| What a thing is made of or holds | Its parts or contents as chips inside it | .chips |
| A thing's parts, each with a description | Rows stacked inside its box | .rows |
| What belongs together | Dashed outline with a caption | .group, .cap |
| A whole that is the sum of parts | Bracket under the parts, "A = B + C" below | .bracket, .sum |
| The things one entity uses | Column of boxes on a spine | .spine, .item |
| Steps in order | Boxes left to right with arrows | .box, .arr.r |
| When things happened | Axis with dated events | .axis, .ev |
Forms combine: the harness example uses five of them.
The template defines these as CSS variables at the top of its component block. Use no other colours.
| Token | Hex | Job |
|---|---|---|
--zc-bg | #1b2023 | Page |
--zc-surface-code | #262c2f | Box fill |
--zc-border | #414a4f | Box and chip borders |
--zc-rule | #4e575c | Group outline, spine, bracket, timeline axis |
--zc-heading | #ffffff | Box titles, event names |
--zc-body | #f4f5f6 | Chip text, sums |
--zc-muted | #c6cccf | Sublabels, captions, arrows |
--zc-h2 | #C6AEFF | Accent 1, purple: the subject (.a1) |
--zc-h4 | #FFA557 | Accent 2, orange: its main counterpart (.a2) |
--zc-pink | #FF2E88 | Accent 3, pink: a third identity, only when one is needed (.a3) |
An accent marks identity and nothing else: a 2px outline on a key box, or the timeline dots. Assign accents in order: purple, then orange, then pink. A diagram with one accent uses purple.
Text is heading, body or muted, never an accent colour. Arrows and lines stay neutral.
scripts/check_palette.py validated these accents on the page and box colours. Each has at least 4:1 contrast. Every pair stays apart under normal vision (OKLab ΔE ≥ 15) and under protanopia and deuteranopia (ΔE ≥ 8):
| Pair | Normal | Worst colour-blind | Result |
|---|---|---|---|
| purple + orange | 22.5 | 22.4 | pass |
purple + pink #FF2E88 | 26.0 | 17.4 | pass |
orange + pink #FF2E88 | 24.7 | 16.6 | pass |
purple + lifted pink #FF80B5 | 14.8 | 10.5 | fail: never use #FF80B5 |
purple + cyan #06D6E8 | 18.1 | 3.2 | fail: no cyan |
If the brand palette changes, re-run the check with the new values and update this table: python3 <skill>/scripts/check_palette.py --bg "#1b2023" --surface "#262c2f" "#C6AEFF" "#FFA557" "#FF2E88". It exits 1 when a pair fails.
The .dg canvas is 1136px wide: a 1280px slide with 72px margins.
.t is 21px bold and the sublabel .s 16px muted, directly under it; a further detail line is another .s with margin-top: 14px. A one-line box is 46px tall and uses .t.small (19px). A key box adds .a1, .a2 or .a3.top and height; boxes in a column share left..arr is horizontal (heads .r, .l), .varr vertical (heads .d, .u); set the length with width or height. Leave 6px between the arrow element's ends and the boxes it joins. Give an arrow a .cap label when its ends don't already say what flows, and centre the label over the arrow's span with about 8px between text and line. Two opposite flows between the same boxes are two arrows, about 60px apart and centred on the boxes' shared middle, with one label above the top arrow and one below the bottom arrow. A double-headed .arr.l.r is for a two-way link that needs no label..chips div. They wrap onto a new row with 10px gaps..rows div. Each row is a plain <div> holding a .t.small title and an .s description, both on one line. Rows are 47px tall and 10px apart, and the titles share a column as wide as the longest..sum caption sits 8px under it at the same width..item boxes are 224×42px on a 52px pitch, their left 12px past the spine's left; for a list at the right edge that is left: 912px. The .spine is 2px wide, starts 20px below the first item's top, and is (n − 1) × 52 + 2 px tall for n items. The ticks draw themselves. An arrow into the spine needs no label. ..axis runs across the middle of the canvas. Each .ev sets only left, the date's position, rounded to whole px: x = 92 + (date − first) / (last − first) × 952, measured in days. This keeps every label inside the canvas..up, then alternate .down and .up. Events on the same side must sit at least 184px apart; if two are closer, move one to the other side..d, a name .m and a note .n. Write the date at the precision the story needs: "Sep 2024", or "24 Feb 2025" when days matter. Put the name in .m and any status ("research preview", "generally available") in the note. A note may run to two lines of about 26 characters each.Put the diagram on the slide itself. The slide's # heading replaces the template's <h1>. Paste your page's second <style> block, the components and their colours, as <style scoped>, then the .dg div. The diagram is drawn for the page colour #1b2023, as on ZazenCodes slides, and the deck's own render command renders it.
agents/openai.yaml (opens in a new tab)examples/harness.html (opens in a new tab)examples/harness.png (opens in a new tab)examples/timeline.html (opens in a new tab)examples/timeline.png (opens in a new tab)scripts/check_palette.py (opens in a new tab)scripts/layout_check.js (opens in a new tab)scripts/render.sh (opens in a new tab)template.html (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
13 skills in this plugin
/adrRead and write Architecture Decision Records in docs/adr/. Use for /adr, when decisions are made, and before changing areas covered by ADRs./ascii-vizAnswer with ASCII diagrams and charts. Use for /ascii-viz, $ascii-viz or requests for ASCII visuals; stays active for the conversation./codex-image-genGenerate or edit raster images via Codex CLI and save them to a path. Use for image generation or editing unless another image backend is specified./gemini-web-researchDelegate substantial web research to Gemini CLI or agy only when explicitly requested. Not for ordinary research or quick searches.npx claudepluginhub zazencodes/skills --plugin zazencodes-skillsOther plugins' skills for the same job