mapping-the-codebase
Skill1 starsChanged 3 months agoMITView on GitHub
Maps how a region of code fits together — its callers, owners, and boundaries — before it is changed. Use when code whose structure and callers have not been established for this task is about to be planned, changed, or debugged, or when asked how a change travels through the codebase. Skip only when a current boundary record covers the region and its inputs.
In this repository49 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- working-from-a-ticketSkill
- writing-specsSkill
- clarifying-intentSkill
- dispatching-parallel-agentsSkill
- handoffSkill
- prototypingSkill
- using-git-worktreesSkill
- using-sdlc-skillsSkill
- viewing-artifactsSkill
- writing-skillsSkill
- yagniSkill
- finishing-a-branchSkill
- release-readinessSkill
- architecture-decisionsSkill
- coding-standardsSkill
- data-modelSkill
- migration-strategySkill
- reviewing-plansSkill
- system-architectureSkill
- ui-ux-designSkill
- writing-plansSkill
- adding-observabilitySkill
- changing-a-live-schemaSkill
- executing-plansSkill
- rollout-controlsSkill
- subagent-driven-developmentSkill
- test-driven-developmentSkill
- complexity-auditSkill
- containing-an-incidentSkill
- debuggingSkill
- deprecating-an-apiSkill
- diagnosing-a-sessionSkill
- eliminating-correctionsSkill
- large-scale-changesSkill
- post-mortemSkill
- refactor-architectureSkill
- brainstormingSkill
- define-goalsSkill
- feasibility-checkSkill
- scopingSkill
- receiving-code-reviewSkill
- requesting-code-reviewSkill
- reviewing-a-prSkill
- security-auditsSkill
- verification-before-completionSkill
- verification-strategySkill
- visual-ui-verificationSkill
The file
We split this skill into the rules it gives an agent
7 rules. About 0 are common, 6 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈6
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 8
Before you touch unfamiliar code, map who calls it, what it owns, and where its boundaries are.
- Distinctive: line 15
Skip: only when a Step 3 boundary record for this region exists and is inside its freshness limit.
- Distinctive: line 20
Before reading anything, write the intended change, how far it could reach, and why the boundary you picked holds that reach.
- Distinctive: line 28
Start at the containing module and its neighbors: responsibilities, runtime entry points, callers, collaborators, data between them.
- Distinctive: line 36
Use the domain's vocabulary, never "service / handler / util".
- Very specific: line 43
Write the boundary record to .sdlc-skills/evidence/{{YYYY-MM-DD}}-{{topic}}/boundary-record.md unless the user names another path: what the …
- Distinctive: line 49
If implementation finds a caller or surface the map never covered, stop editing and return to Step 1 with it: recheck that the boundary …
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Mapping the Codebase
Before you touch unfamiliar code, map who calls it, what it owns, and where its boundaries are.
When to use
- You're about to plan, change, debug, or extend a part of the codebase you don't know well.
- Skip only when a Step 3 boundary record for this region exists and is inside its freshness limit.
Step 1: Set the boundary
- Before reading anything, write the intended change, how far it could reach, and why the boundary you picked holds that reach. For a compatibility-sensitive change, never stop at direct callers.
- Pin the repository or working state and the identity of every external input the reading depends on. Write what makes the reading stale.
Step 2: Map
- Start at the containing module and its neighbors: responsibilities, runtime entry points, callers, collaborators, data between them.
- As risk warrants, trace: generated code and build inputs; persistent state and migrations; public contracts and consumers; configuration, deployment, operational paths; the toolchain and the commands that build, run, and check it; tests, CI, proof surfaces; ownership and change history. Give an evidence-based reason for each surface on that list you leave out.
- Use the domain's vocabulary, never "service / handler / util".
- Attach each conclusion to current files, symbols, searches, commands, or revisions. Separate what you observed from what you inferred. Mark what is stale or unavailable.
Step 3: State the boundaries
- Write the boundary record to
.sdlc-skills/evidence/{{YYYY-MM-DD}}-{{topic}}/boundary-record.mdunless the user names another path: what the region owns, what it delegates, where its seams are, which downstream obligations a change must preserve. - Set a freshness limit. Once it has passed, or a pinned input has changed, revalidate the affected claims before relying on them.
- If implementation finds a caller or surface the map never covered, stop editing and return to Step 1 with it: recheck that the boundary holds the change's reach, map the surface from the code, and update the record before the next edit. Never extend the map from memory.
Gotchas
- A caller reached through configuration, reflection, a generated route, or a scheduler never appears in an import search, so a map built from imports draws a boundary that a runtime caller crosses.
- A boundary record carries no signal of its own staleness; past its freshness limit it reads exactly like a current one.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

