Architecture diagram workflow for the portfolio site — JSON graph definitions → SVG rendering → colour palette management.
Define a graph in JSON (nodes, edges, semantic tags), render it to SVG with automatic left-to-right layout and orthogonal arrow routing, inject it into project markdown, and rebuild the site. An interactive colour picker widget lets you adjust the 11-tag palette visually.
| Component | Description |
|---|---|
| diagram-workflow skill | End-to-end: define JSON → render SVG → inject into markdown → rebuild |
| diagram-colour-picker skill | Interactive widget for adjusting the colour palette |
diagram-render.ts |
Build-time SVG layout engine (importable module + CLI) |
convert-diagrams.ts |
Batch-convert hand-crafted SVG diagrams to JSON definitions |
colour-picker-widget.html |
Self-contained HTML widget with live swatch preview |
{
"title": "Caption text below the diagram",
"nodes": [
{
"id": "unique-id",
"label": "Display name",
"sub": "Subtitle line",
"tag": "web",
"column": 0, "row": 0,
"children": [
{ "id": "child-id", "label": "Child", "sub": "detail", "tag": "scripting" }
]
}
],
"edges": [
{ "from": "source-id", "to": "target-id", "label": "optional", "accent": true }
]
}| Tag | Colour | Use for |
|---|---|---|
web |
blue | frontends, browsers, UIs |
backend |
blue | servers, APIs, runtimes |
state |
grey | databases, stores, config |
artifacts |
amber | builds, files, models |
processing |
dark grey | engines, pipelines, transforms |
scripting |
light grey | scripting, plugins, extensions |
infra |
blue | containers, VMs, infrastructure |
external |
green | external services, APIs |
input |
green | user input, sources, triggers |
output |
orange | results, exports, destinations |
monitor |
purple | monitoring, logging, observability |
prefers-color-scheme (light as default for rsvg-convert)# Render a single diagram
bun scripts/diagram-render.ts _diagrams/my-project.json _diagrams/my-project.svg
# Batch-convert existing hand-crafted SVGs to JSON
bun scripts/convert-diagrams.ts
# Regenerate all after palette change
for f in _diagrams/*.json; do
bun scripts/diagram-render.ts "$f" "_diagrams/$(basename $f .json).svg"
done