/architecture-map:architecture-mapfrom architecture-map
Builds an interactive, data-driven map of a codebase's architecture with files drawn to scale and dependency rules enforced. Supports comparing current vs proposed structures.
Ships in architecture-map. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description, though model invocation is off: only you can start it.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
The map is a site plan of a codebase: each file is a bar drawn to scale, each folder a frame, each dependency a line. It exists to answer one question about the structure. It stays trustworthy because everything on it is either measured (the graph) or declared (the config); nothing is drawn by hand.
Four words carry the tool:
The architecture style lives entirely in the config: bands express layers or rings, columns express modules or features, overrides express any "A must not depend on B". The same base draws a layered monolith, ports and adapters, feature slices, or a tree with no stated rule at all.
To calibrate, build the demo and open it before writing anything:
bun ${CLAUDE_PLUGIN_ROOT}/skills/architecture-map/scripts/build.ts \
--graph ${CLAUDE_PLUGIN_ROOT}/skills/architecture-map/examples/demo.graph.json \
--config ${CLAUDE_PLUGIN_ROOT}/skills/architecture-map/examples/demo.config.json \
--out /tmp/map-demo/map.html --preview /tmp/map-demo/preview.html
examples/demo.config.json is a complete config to copy from: two views, layers, a
contract, an override, moves, files to create, files to split, shared opinions.
Write the question the map answers in one sentence, then the views that answer it:
| The reader asks | Views |
|---|---|
| What depends on what? | the tree as it is, no rules |
| Where do we break our own rules? | the tree as it is, with the rules the project already claims |
| What would this reorganisation fix, and cost? | the tree as it is, plus one view per proposal |
A proposed view is a hypothesis: say so on the page with note.
Done when the question and the list of views are written and match what the user asked for.
Run the extractor for the language from the repository, then keep graph.json beside the config:
bun ${CLAUDE_PLUGIN_ROOT}/skills/architecture-map/scripts/extract-python.ts path/to/package --out graph.json
bun ${CLAUDE_PLUGIN_ROOT}/skills/architecture-map/scripts/extract-js.ts . --alias '@/=src/' --out graph.json
bun ${CLAUDE_PLUGIN_ROOT}/skills/architecture-map/scripts/from-pairs.ts pairs.tsv --root src --out graph.json # any other language
Each script documents its options under --help. For a language with no extractor, get file-to-file dependencies
from the ecosystem's own tool and shape them into pairs; from-pairs.ts does the rest.
Done when the file and link counts are stated, the links of three files are checked against their source, and every line the extractor printed about unparsed files or unresolved imports is explained.
Build once with no config to see the raw shape, then write map.config.json. Every key is in
references/config.md; read it before writing rules or moves.
moves for where each file goes, new for files to create, splits for files to cut later, and a
role sentence for every proposed folder. A proposal moves files and keeps their names, so it previews a
mechanical move.strings: every word of the page, in the reader's language.Done when build.ts prints no note: line, every band and every proposed folder has a role, and the page's words
are in the reader's language.
bun ${CLAUDE_PLUGIN_ROOT}/skills/architecture-map/scripts/build.ts --graph graph.json --config map.config.json \
--out dist/map.html --preview dist/preview.html
Serve dist/ over a local HTTP server and open preview.html. Look at it in light, in dark and at phone width;
switch views; open one file and one folder.
Done when the console is clean, links are drawn at rest, files glide on a view switch, and the headline numbers equal the build report.
The build report is the finding. State it as measured fact before sharing the page:
Publish dist/map.html with the Artifact tool. The page is private until its owner shares it.
A view with "feedback": true collects one opinion per folder from each reader. It needs two capabilities declared
at publish; load the artifact-capabilities skill first, then pass:
{"db": {"rules": [{"path": "opinions", "read": "view", "write": "owner"},
{"path": "opinions/{self}", "write": "interact"}]},
"user": {"scopes": ["profile"]}}
Each reader writes only opinions/<their id>; everyone admitted reads all of them. Readers need Contributor access to
write. Verify once after the first publish: write a probe document as the owner, read it at the view level, confirm
a write at the interact level is refused, delete the probe. Read the opinions back later with the artifact's data
tool, collection opinions.
Handed over as a file instead, the page works the same and the opinion block states that it is unavailable.
The look is a drafting sheet: tracing paper in light, cyanotype in dark, verdicts in pencil. Keep its grammar (bars to
scale, frames for folders, colour only for verdicts) and change its skin through the css and fonts keys, which
override the tokens declared at the top of assets/template.html. Edit the template itself
for a new behaviour, then rebuild the example to check it still draws.
assets/template.html (opens in a new tab)examples/demo.config.json (opens in a new tab)examples/demo.graph.json (opens in a new tab)references/config.md (opens in a new tab)scripts/build.integration.test.ts (opens in a new tab)scripts/build.ts (opens in a new tab)scripts/extract-js.test.ts (opens in a new tab)scripts/extract-js.ts (opens in a new tab)scripts/extract-python.test.ts (opens in a new tab)scripts/extract-python.ts (opens in a new tab)scripts/files.integration.test.ts (opens in a new tab)scripts/files.ts (opens in a new tab)scripts/from-pairs.test.ts (opens in a new tab)scripts/from-pairs.ts (opens in a new tab)scripts/glob.test.ts (opens in a new tab)scripts/glob.ts (opens in a new tab)scripts/map.test.ts (opens in a new tab)scripts/map.ts (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub bengous/claude-code-plugins --plugin architecture-map