understand-codebase-architecture
Generates a self-contained HTML report that maps codebase architecture with drill-down navigation.
Install
mkdir -p .claude/skills/understand-codebase-architecture && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/14511" && unzip -o skill.zip -d .claude/skills/understand-codebase-architecture && rm skill.zipInstalls to .claude/skills/understand-codebase-architecture
Activation
This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.
Build an interactive onboarding map of a codebase's architecture as a self-contained HTML report — click a box to drill into a subsystem, breadcrumbs to climb back, detail behind clicks so nothing overloads. Use when the user wants the generated visual artifact: a "map", "diagram", "visualise the architecture", "onboard me to", or "lay of the land" for how a codebase fits together. A bare "explain/help me understand X" usually wants a chat answer, not a file — only reach for this skill when the user wants the interactive map, and confirm first if the intent is unclear. By default it is served live behind a tiny local server, so the user can ask the map questions in the browser and get answers back in the session; it falls back to a plain static file only when needed. Describes architecture, does not judge or improve it (use improve-codebase-architecture for that).Key capabilities
- →Build an interactive HTML report of codebase architecture
- →Visualize subsystems and their connections
- →Drill into subsystem details
- →Serve the map live via a local server
- →Answer questions about the map in session
How it works
The skill explores the codebase to identify major parts, connections, and code locations, then authors a model.json file. This model is used by a bundled runtime to generate a self-contained HTML report, which is served live locally.
Inputs & outputs
When to use understand-codebase-architecture
- →Onboarding new developers to a large codebase
- →Visualizing module dependencies
- →Documenting system hierarchy
About this skill
Understand Codebase Architecture
Build a live, interactive map of how an unfamiliar codebase fits together — the major parts, how they connect, where each one's code lives — served locally so the user can ask the map questions and you answer back in this session.
You are the cartographer. These files are a framework, not a template: they say what a good map is and how it goes wrong, and leave the how to you. Lean on that — a map you designed for this system beats one stamped from a mould, and it gets better as you do.
This is the descriptive counterpart to improve-codebase-architecture. Describe the system; don't grade it or propose refactors unless asked.
Vocabulary
Plain and structural: system → subsystem → module. Boxes are parts; lines are connections, labelled with verbs ("reads", "publishes to", "claims"). Each part has a one-line responsibility; everything longer lives behind a click. Use the project's own nouns, never invented ones.
Process
1 · Scope. Confirm the user wants the artifact, not a chat answer — a bare "explain X" usually wants prose; only build the map when they want the interactive thing (ask if unsure), and stop if there's no repo to explore. If the target is vague, ask up to ~3 quick questions via the question tool (breadth · purpose · depth).
2 · Ground in the real vocabulary. It lives in several places — CONTEXT.md and docs/adr/, the README and workspace/manifest files (package names, boundaries), git log over the area, and the code itself as ground truth. The map's names come from there, not from you.
3 · Explore. Use Explore subagents (one per candidate subsystem when the repo is large) to find the entry points, the major parts, how they connect, and where each lives. Read into the logic-heavy parts — a multi-step generation, an algorithm, a branchy state machine — not just up to their boundary. Depth starts here: the map is worth most where the logic is.
4 · Find the shape. Decide the one organizing idea that makes this system obvious — its flow, its spine, its lifecycle, its layers — and commit to it. It will be drawn as a map (placed parts + connectors), never a stacked list.
5 · Build. You author a model.json — the data, the shape, the depth — and the bundled runtime draws everything. Write the model (schema + layouts in RUNTIME.md) guided by the craft in HTML-REPORT.md, then build a self-contained file into the OS temp dir ($TMPDIR, then /tmp, or %TEMP%): node <skill-dir>/scripts/build-map.mjs model.json "$TMPDIR/architecture-map-<timestamp>.html". You don't write the map's HTML/CSS/JS — the runtime gives every map the same chrome (cards, connectors, drill-down, breadcrumb, history, chat). Don't open it yet.
6 · Serve it live — the default. Start the bundled bridge and open the served http://127.0.0.1:<port> URL it prints — never the file:// path (the chat is dead there), then enter the listen loop so the user can ask the map questions and you answer here. See LIVE-BRIDGE.md. Fall back to a plain static file only when Node is unavailable or the user wants a shareable artifact — and say the chat won't work then.
7 · Tend it. Answer questions (over the bridge or in chat), fix parts the user flags, and drill a leaf deeper when asked.
What's bundled, and what isn't
Bundled code is the deterministic machinery so you never re-write it: the runtime that draws every map (assets/map.js + map.css), the build step (scripts/build-map.mjs), and the live bridge (server + watcher in scripts/). What is not bundled — and is the judgement this skill exists to exercise — is everything in the model.json: which parts matter, the shape that makes the system obvious, and how deep to go. The chrome stays constant so maps are consistent; the thinking is yours, and it sharpens as the model does.
When not to use it
- →The user wants a chat answer instead of an interactive map
- →There is no repository to explore
Limitations
- →Requires a codebase repository to explore
- →Does not judge or improve the architecture
- →Falls back to a static file if Node is unavailable, losing chat functionality
How it compares
This skill generates a live, interactive, and explorable HTML map of a codebase's architecture, offering a dynamic understanding compared to static diagrams or prose explanations.
Compared to similar skills
understand-codebase-architecture side by side with the closest alternatives in the catalog.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| understand-codebase-architecture (this skill) | 0 | 2mo | Review | Intermediate |
| mcaf-architecture-overview | 0 | 6mo | No flags | Intermediate |
| wiki-architect | 11 | 3mo | No flags | Advanced |
| specification-writing | 2 | 2mo | No flags | Intermediate |
Try saying
Example prompts that trigger this skill in your AI assistant.
You might also like
mcaf-architecture-overview
Zendevve
Create or update `docs/Architecture/Overview.md` (architecture diagrams): maintain Mermaid diagrams for system/modules, interfaces/contracts, and key classes/types; document dependency rules; link to ADRs/features. Use when onboarding, refactoring, or adding modules/boundaries.
wiki-architect
microsoft
Analyzes code repositories and generates hierarchical documentation structures with onboarding guides. Use when the user wants to create a wiki, generate documentation, map a codebase structure, or understand a project's architecture at a high level.
specification-writing
EpicenterHQ
Write technical specifications that give agents enough context to implement features while leaving room for autonomous research and decision-making. Use when planning features, documenting architecture decisions, or creating implementation guides.
c4-context
sickn33
Expert C4 Context-level documentation specialist. Creates high-level system context diagrams, documents personas, user journeys, system features, and external dependencies. Synthesizes container and component documentation with system documentation to create comprehensive context-level architecture. Use when creating the highest-level C4 system context documentation.
Generate RFC
wsxjs
Instructions for generating detailed RFC documentation in Chinese with Mermaid diagrams
adr
Cosmian
Create an Architectural Decision Record (ADR) under documentation/docs/adr/. Use when making or documenting an architectural decision.