# Understand Codebase

> Use when: onboard onto an unfamiliar or large codebase by mapping its structure, dependencies, and business logic before editing.

- Skill: `kimtth/understand-codebase` (Agent Skill)
- Install (CLI): `npx skillmds@latest add kimtth/understand-codebase`
- Raw SKILL.md: https://api.skillmd.com/api/skills/kimtth/understand-codebase/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- License: MIT
- Author: kimtth (https://skillmd.com/u/kimtth)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/kimtth/understand-codebase

---


Goal: turn a codebase into a navigable knowledge graph you can explore, search, and explain — not a graph that just looks complex.

Use for:
- joining a large unfamiliar project and needing to know where to start
- learning how files, functions, and classes connect before changing one
- mapping code to business domains, flows, and process steps
- assessing which parts a change ripples into before committing

Workflow:
1. Scan the project: detect languages and frameworks, discover every file.
2. Extract structure deterministically (tree-sitter): imports, exports, function/class
   definitions, call sites, inheritance. Same input -> same edges every run.
3. Layer in semantics (LLM): plain-English summaries, architectural layer per node
   (API / Service / Data / UI / Utility), business domains and flows.
4. Build the graph — nodes are files/functions/classes, edges are dependencies.
5. Generate guided tours ordered by dependency so the codebase is learned in the right order.
6. Re-run incrementally: only re-analyze files whose fingerprint changed.

Outputs:
- structural + domain graph with nodes searchable by name and by meaning
- guided tours, layer view, and an onboarding guide for new contributors
- diff impact: which parts a current change affects

Rules:
- Keep structure deterministic; reserve the LLM for intent, summaries, and layering.
- Scope to a subdirectory for huge monorepos.
- Commit the graph so teammates skip the pipeline; refresh it on changed files.

