Visual Architecture
Create architecture artifacts with the bundled Python renderer instead of hand-writing SVG. v1.8 adds a public TypeScript-monorepo case study path on top of the v1.7 extraction engine: source-backed case-study docs, generated artifacts, README quick-starts, and gallery conversion proof.
Use this when the user needs a trustworthy system map, agent workflow, sequence, data-flow, lifecycle/state diagram, repo-evidence diagram, or PR delta review sketch that should stay local, deterministic, and reviewable.
Workflow
- Either extract a TypeScript-aware starter spec from a repo or create a JSON file with
mode, title, nodes, and edges.
- Supported modes:
architecture, workflow, sequence, dataflow, lifecycle, pr-delta.
- Supported themes:
classic for documentation, showcase for README/release proof images.
- Snap intended node positions to the renderer grid mentally before writing them:
- horizontal grid: 120px
- vertical grid: 80px
- For repo-aware drafts, extract and layout first:
python3 skills/visual-architecture/scripts/render_architecture.py extract-repo . --output repo-map.json --title "Generated Repo Map"
python3 skills/visual-architecture/scripts/render_architecture.py layout repo-map.json repo-map.layout.json --mode architecture
- Validate first:
python3 skills/visual-architecture/scripts/render_architecture.py validate input.json --json
- Deliver the final artifact with a receipt:
python3 skills/visual-architecture/scripts/render_architecture.py deliver input.json output.html --json
Use .svg for a static docs artifact or .html for a self-contained presentation artifact.
For PR delta review, either extract a PR concern map from git refs or compare two specs:
python3 skills/visual-architecture/scripts/render_architecture.py extract-pr --base origin/master --head HEAD --output pr-delta.json
python3 skills/visual-architecture/scripts/render_architecture.py compare base.json head.json pr-delta.html --spec pr-delta.json --json
- If
rsvg-convert is available and you need a bitmap preview, run:
rsvg-convert -o output.png output.svg
JSON Input Structure
{
"title": "Service Map",
"mode": "architecture",
"theme": "classic",
"summary": "One local request path with async work and model access.",
"nodes": [
{
"id": "web",
"label": "Web App",
"subtitle": "User interface",
"kind": "service",
"x": 120,
"y": 160
},
{
"id": "api",
"label": "API",
"subtitle": "Business logic",
"kind": "service",
"x": 360,
"y": 160
}
],
"edges": [
{
"from": "web",
"to": "api",
"kind": "primary-data",
"label": "HTTP"
}
]
}
Node Kinds
service: rounded rectangle
llm: double-border rounded rectangle
agent: hexagon
memory: cylinder
Each node requires:
id: unique string
label: primary title
kind: one of the node kinds above
x, y: grid-aligned center coordinates
Optional:
subtitle: smaller secondary label
show_grid: set true to display the editing grid in the exported SVG
theme: set showcase on the top-level spec for dark public-facing artifacts
evidence: object or list with source, optional line/lines, commit, confidence, and note
Edge Kinds
primary-data: blue solid arrow
memory-write: green dashed arrow
control: slate dashed arrow
Each edge requires:
from: source node id
to: target node id
Optional:
label: rendered on the route with a shielding background rect
source_side, target_side: force edge anchors (left, right, top, bottom)
via: array of orthogonal turn points, each with x and y
label_segment: zero-based segment index to place the label on
label_offset: [dx, dy] shift for fine label placement
Renderer Guarantees
- Validate rejects unsupported node/edge kinds and unknown edge endpoints before rendering
- Deliver writes the artifact atomically and emits a JSON receipt with SHA-256 hashes
- Validation receipts include a quality score for spacing, density, route crossings, and visual overlap
extract-repo, layout, extract-pr, and bundle turn repo evidence into checked artifacts without hand-placing every node
--min-quality can fail delivery or bundle export when the artifact is not presentation-grade
- The generated gallery can load spec/receipt JSON and show story steps plus source evidence
- Evidence badges render as
SRC n on nodes with source-backed evidence
- PR delta compare writes added/removed node and edge facts into the receipt
- Route arrows orthogonally only
- Render in this order: background, arrows, nodes, labels
- Keep label shields behind arrow text for readability
- Stay restrained: clean strokes, no decorative effects, and hide the editing grid unless explicitly requested
Usage Notes
- Prefer this skill when the user wants architecture diagrams, routing maps, or system relationship visuals.
- Choose semantic kinds first, then place nodes on the grid, then add only the edges needed to explain flow.
- Keep diagrams sparse. If a diagram feels crowded, split it into two files instead of forcing a dense composite.
- Prefer
deliver for handoff. A passing render without a receipt is a draft.
- Do not claim repository evidence unless the spec names source files, commits, or confidence explicitly.
Example
Use examples/service-map.json as a generic architecture starting point. Use examples/agent-runtime.json, examples/sequence-cache-miss.json, examples/dataflow-analytics.json, and examples/lifecycle-agent-task.json for the non-architecture modes. Use examples/repo-evidence-map.json for source-pinned evidence, and examples/pr-delta-before.json plus examples/pr-delta-head.json for generated PR deltas.
1---2name: visual-architecture3description: Create deterministic, local-first architecture artifacts from typed JSON or TypeScript-aware repo extraction: validate specs, render SVG/HTML diagrams, and emit source-backed receipts agents can cite.4---5# Visual Architecture67Create architecture artifacts with the bundled Python renderer instead of hand-writing SVG. v1.8 adds a public TypeScript-monorepo case study path on top of the v1.7 extraction engine: source-backed case-study docs, generated artifacts, README quick-starts, and gallery conversion proof.89Use this when the user needs a trustworthy system map, agent workflow, sequence, data-flow, lifecycle/state diagram, repo-evidence diagram, or PR delta review sketch that should stay local, deterministic, and reviewable.1011## Workflow12131. Either extract a TypeScript-aware starter spec from a repo or create a JSON file with `mode`, `title`, `nodes`, and `edges`.14 - Supported modes: `architecture`, `workflow`, `sequence`, `dataflow`, `lifecycle`, `pr-delta`.15 - Supported themes: `classic` for documentation, `showcase` for README/release proof images.162. Snap intended node positions to the renderer grid mentally before writing them:17 - horizontal grid: 120px18 - vertical grid: 80px193. For repo-aware drafts, extract and layout first:2021```bash22python3 skills/visual-architecture/scripts/render_architecture.py extract-repo . --output repo-map.json --title "Generated Repo Map"23python3 skills/visual-architecture/scripts/render_architecture.py layout repo-map.json repo-map.layout.json --mode architecture24```25264. Validate first:2728```bash29python3 skills/visual-architecture/scripts/render_architecture.py validate input.json --json30```31325. Deliver the final artifact with a receipt:3334```bash35python3 skills/visual-architecture/scripts/render_architecture.py deliver input.json output.html --json36```3738Use `.svg` for a static docs artifact or `.html` for a self-contained presentation artifact.3940For PR delta review, either extract a PR concern map from git refs or compare two specs:4142```bash43python3 skills/visual-architecture/scripts/render_architecture.py extract-pr --base origin/master --head HEAD --output pr-delta.json44python3 skills/visual-architecture/scripts/render_architecture.py compare base.json head.json pr-delta.html --spec pr-delta.json --json45```46476. If `rsvg-convert` is available and you need a bitmap preview, run:4849```bash50rsvg-convert -o output.png output.svg51```5253## JSON Input Structure5455```json56{57 "title": "Service Map",58 "mode": "architecture",59 "theme": "classic",60 "summary": "One local request path with async work and model access.",61 "nodes": [62 {63 "id": "web",64 "label": "Web App",65 "subtitle": "User interface",66 "kind": "service",67 "x": 120,68 "y": 16069 },70 {71 "id": "api",72 "label": "API",73 "subtitle": "Business logic",74 "kind": "service",75 "x": 360,76 "y": 16077 }78 ],79 "edges": [80 {81 "from": "web",82 "to": "api",83 "kind": "primary-data",84 "label": "HTTP"85 }86 ]87}88```8990## Node Kinds9192- `service`: rounded rectangle93- `llm`: double-border rounded rectangle94- `agent`: hexagon95- `memory`: cylinder9697Each node requires:98- `id`: unique string99- `label`: primary title100- `kind`: one of the node kinds above101- `x`, `y`: grid-aligned center coordinates102103Optional:104- `subtitle`: smaller secondary label105- `show_grid`: set true to display the editing grid in the exported SVG106- `theme`: set `showcase` on the top-level spec for dark public-facing artifacts107- `evidence`: object or list with `source`, optional `line`/`lines`, `commit`, `confidence`, and `note`108109## Edge Kinds110111- `primary-data`: blue solid arrow112- `memory-write`: green dashed arrow113- `control`: slate dashed arrow114115Each edge requires:116- `from`: source node id117- `to`: target node id118119Optional:120- `label`: rendered on the route with a shielding background rect121- `source_side`, `target_side`: force edge anchors (`left`, `right`, `top`, `bottom`)122- `via`: array of orthogonal turn points, each with `x` and `y`123- `label_segment`: zero-based segment index to place the label on124- `label_offset`: `[dx, dy]` shift for fine label placement125126## Renderer Guarantees127128- Validate rejects unsupported node/edge kinds and unknown edge endpoints before rendering129- Deliver writes the artifact atomically and emits a JSON receipt with SHA-256 hashes130- Validation receipts include a quality score for spacing, density, route crossings, and visual overlap131- `extract-repo`, `layout`, `extract-pr`, and `bundle` turn repo evidence into checked artifacts without hand-placing every node132- `--min-quality` can fail delivery or bundle export when the artifact is not presentation-grade133- The generated gallery can load spec/receipt JSON and show story steps plus source evidence134- Evidence badges render as `SRC n` on nodes with source-backed evidence135- PR delta compare writes added/removed node and edge facts into the receipt136- Route arrows orthogonally only137- Render in this order: background, arrows, nodes, labels138- Keep label shields behind arrow text for readability139- Stay restrained: clean strokes, no decorative effects, and hide the editing grid unless explicitly requested140141## Usage Notes142143- Prefer this skill when the user wants architecture diagrams, routing maps, or system relationship visuals.144- Choose semantic kinds first, then place nodes on the grid, then add only the edges needed to explain flow.145- Keep diagrams sparse. If a diagram feels crowded, split it into two files instead of forcing a dense composite.146- Prefer `deliver` for handoff. A passing render without a receipt is a draft.147- Do not claim repository evidence unless the spec names source files, commits, or confidence explicitly.148149## Example150151Use `examples/service-map.json` as a generic architecture starting point. Use `examples/agent-runtime.json`, `examples/sequence-cache-miss.json`, `examples/dataflow-analytics.json`, and `examples/lifecycle-agent-task.json` for the non-architecture modes. Use `examples/repo-evidence-map.json` for source-pinned evidence, and `examples/pr-delta-before.json` plus `examples/pr-delta-head.json` for generated PR deltas.