Architecture Map
Produce / update <repo>/architecture-map/ — an interactive HTML-card + SVG viewer of
the architecture (the Claude Design template), backed by a single data file the agent owns.
Family
Pipeline: architecture-audit (verified nodes/edges) → architecture-map (this — the
interactive map) → architecture-grill (grow the map live while grilling a plan) →
architecture-cleanup (mark dead/removable code red on the map) → architecture-improve
(amber optimisation proposals). This skill maps how parts connect and what flows between them;
dead-code / orphan detection lives in architecture-cleanup, not here.
When NOT to use
SKIP for a one-off static diagram or a text architecture summary — run architecture-audit
directly. Reach for THIS skill only when you want a persistent, clickable map you revisit and plan on.
Two modes (same artifact)
- Kortlæg — audit an existing repo, fill the map.
- Planlæg — open the map, add
proposed nodes/edges while discussing a change.
Procedure
A. Gather the data (Kortlæg)
- Run the
architecture-audit skill's Map phase (Phase 0 scout + Phase 1
parallel readers). You want the structured per-subsystem result, not the Markdown
doc — each reader returns components (id, label, status, role, files path:line)
and A --> B: label edges.
- Transform that into the map data contract (
references/map-schema.md): subsystems,
nodes, edges. Set source: "audit" and stamp generatedAt with the current ISO time.
For each node, write the node-card fields so a non-technical reader gets it:
label = a descriptive plain-language name (what it does), NOT the raw function name.
tech = the technical identifier (function / endpoint / file).
engine = the motor category (llm, image, db, … — see
references/map-schema.md for the canonical 14-key enum; don't restate it here) + optional
engineLabel for the specific name (e.g. "OpenRouter · Claude Sonnet 4.6").
input / processing / output = plain language. Derive input from the node's
incoming edges, output from its outgoing edges, processing from role.
- Write it as a temp fresh JSON:
/tmp/arch-fresh.json.
B. Scaffold / update the folder
- If
<repo>/architecture-map/ does not exist, create it and copy the viewer assets:mkdir -p <repo>/architecture-map
cp <SKILL_DIR>/assets/index.html <SKILL_DIR>/assets/elk.bundled.js <repo>/architecture-map/
(The viewer renders nodes as HTML cards + SVG edges — the Claude Design template —
and uses ELK for auto-layout. elk.bundled.js is the only bundled dependency; the
viewer also pulls IBM Plex from Google Fonts and silently falls back to system fonts offline.)
- Write/merge the data with the helper (preserves notes + proposed across re-audits):
node <SKILL_DIR>/merge-map.mjs <repo>/architecture-map/map.js /tmp/arch-fresh.json > /tmp/map.js && mv /tmp/map.js <repo>/architecture-map/map.js
(First run: map.js is absent, the helper treats existing as empty.)
- Tell the user the open command:
open <repo>/architecture-map/index.html.
To preview the bare viewer before real data exists, copy the sample:
cp <SKILL_DIR>/assets/sample-map.js <repo>/architecture-map/map.js. Opening index.html
with no map.js shows a friendly empty-state instead of crashing.
C. Planlæg (grow during planning)
- When discussing a feature/refactor, edit
map.js directly: add nodes/edges with
proposed: true and status: "proposed", or add notes to existing nodes. Re-running
Kortlæg later will NOT wipe these — merge-map.mjs keeps them by id/key.
Verification
- After write, confirm
window.MAP_DATA is present and the JSON parses by round-tripping
through the helper:
node <SKILL_DIR>/merge-map.mjs <repo>/architecture-map/map.js /tmp/arch-fresh.json >/dev/null && echo OK.
- Confirm every node has an
engine from the category enum and plain-language
input/processing/output (the viewer falls back to other ⚙️ + role if missing).
- Open
index.html, confirm nodes render (icon + motor badge) and the console is clean.
Notes
file:// only (no server). Data lives in map.js (a window.MAP_DATA = {…} wrapper)
because browsers block fetch() of JSON over file://.
- Never hand-edit the vendored
elk.bundled.js. The look (cards, colours, panel,
edges) lives entirely in index.html — edit there to evolve the design template.
<SKILL_DIR> = this skill's canonical dir skills/architecture-map/.
1---2name: architecture-map3description: Architecture Map4---56# Architecture Map78Produce / update `<repo>/architecture-map/` — an interactive HTML-card + SVG viewer of9the architecture (the Claude Design template), backed by a single data file the agent owns.1011## Family1213Pipeline: **architecture-audit** (verified nodes/edges) → **architecture-map** (this — the14interactive map) → **architecture-grill** (grow the map live while grilling a plan) →15**architecture-cleanup** (mark dead/removable code red on the map) → **architecture-improve**16(amber optimisation proposals). This skill maps how parts connect and what flows between them;17**dead-code / orphan detection lives in `architecture-cleanup`**, not here.1819## When NOT to use2021SKIP for a one-off static diagram or a text architecture summary — run `architecture-audit`22directly. Reach for THIS skill only when you want a persistent, clickable map you revisit and plan on.2324## Two modes (same artifact)2526- **Kortlæg** — audit an existing repo, fill the map.27- **Planlæg** — open the map, add `proposed` nodes/edges while discussing a change.2829## Procedure3031### A. Gather the data (Kortlæg)321. Run the `architecture-audit` skill's **Map phase** (Phase 0 scout + Phase 133 parallel readers). You want the structured per-subsystem result, not the Markdown34 doc — each reader returns components (id, label, status, role, files `path:line`)35 and `A --> B: label` edges.362. Transform that into the map data contract (`references/map-schema.md`): subsystems,37 nodes, edges. Set `source: "audit"` and stamp `generatedAt` with the current ISO time.38 For each node, write the **node-card fields** so a non-technical reader gets it:39 - `label` = a **descriptive plain-language name** (what it does), NOT the raw function name.40 - `tech` = the technical identifier (function / endpoint / file).41 - `engine` = the motor **category** (`llm`, `image`, `db`, … — see42 `references/map-schema.md` for the canonical 14-key enum; don't restate it here) + optional43 `engineLabel` for the specific name (e.g. `"OpenRouter · Claude Sonnet 4.6"`).44 - `input` / `processing` / `output` = plain language. Derive `input` from the node's45 incoming edges, `output` from its outgoing edges, `processing` from `role`.463. Write it as a temp fresh JSON: `/tmp/arch-fresh.json`.4748### B. Scaffold / update the folder494. If `<repo>/architecture-map/` does not exist, create it and copy the viewer assets:50 ```bash51 mkdir -p <repo>/architecture-map52 cp <SKILL_DIR>/assets/index.html <SKILL_DIR>/assets/elk.bundled.js <repo>/architecture-map/53 ```54 (The viewer renders nodes as HTML cards + SVG edges — the Claude Design template —55 and uses ELK for auto-layout. `elk.bundled.js` is the only bundled dependency; the56 viewer also pulls IBM Plex from Google Fonts and silently falls back to system fonts offline.)575. Write/merge the data with the helper (preserves notes + proposed across re-audits):58 ```bash59 node <SKILL_DIR>/merge-map.mjs <repo>/architecture-map/map.js /tmp/arch-fresh.json > /tmp/map.js && mv /tmp/map.js <repo>/architecture-map/map.js60 ```61 (First run: `map.js` is absent, the helper treats existing as empty.)626. Tell the user the open command: `open <repo>/architecture-map/index.html`.63 To preview the bare viewer before real data exists, copy the sample:64 `cp <SKILL_DIR>/assets/sample-map.js <repo>/architecture-map/map.js`. Opening `index.html`65 with no `map.js` shows a friendly empty-state instead of crashing.6667### C. Planlæg (grow during planning)68- When discussing a feature/refactor, edit `map.js` directly: add nodes/edges with69 `proposed: true` and `status: "proposed"`, or add `notes` to existing nodes. Re-running70 Kortlæg later will NOT wipe these — `merge-map.mjs` keeps them by id/key.7172## Verification73- After write, confirm `window.MAP_DATA` is present and the JSON parses by round-tripping74 through the helper:75 `node <SKILL_DIR>/merge-map.mjs <repo>/architecture-map/map.js /tmp/arch-fresh.json >/dev/null && echo OK`.76- Confirm every node has an `engine` from the category enum and plain-language77 `input`/`processing`/`output` (the viewer falls back to `other` ⚙️ + `role` if missing).78- Open `index.html`, confirm nodes render (icon + motor badge) and the console is clean.7980## Notes81- `file://` only (no server). Data lives in `map.js` (a `window.MAP_DATA = {…}` wrapper)82 because browsers block `fetch()` of JSON over `file://`.83- Never hand-edit the vendored `elk.bundled.js`. The look (cards, colours, panel,84 edges) lives entirely in `index.html` — edit there to evolve the design template.85- `<SKILL_DIR>` = this skill's canonical dir `skills/architecture-map/`.