mapping-the-codebase
Skill1 starsChanged 4 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 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 repository40 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- 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
- executing-plansSkill
- subagent-driven-developmentSkill
- test-driven-developmentSkill
- complexity-auditSkill
- containing-an-incidentSkill
- debuggingSkill
- diagnosing-a-sessionSkill
- post-mortemSkill
- refactor-architectureSkill
- define-goalsSkill
- feasibility-checkSkill
- scopingSkill
- receiving-code-reviewSkill
- requesting-code-reviewSkill
- security-auditsSkill
- verification-before-completionSkill
- verification-strategySkill
- visual-ui-verificationSkill
The file
We split this skill into the rules it gives an agent
6 rules. About 0 are common, 5 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈5
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, understand its shape.
- Distinctive: line 13
Skip: only when a Step 3 boundary record for this region exists and is inside its freshness limit.
- Distinctive: line 19
Before reading anything, write the intended change, how far it could reach, and why the boundary you picked holds that reach.
- Distinctive: line 27
Start at the containing module and its neighbors: responsibilities, runtime entry points, callers, collaborators, data between them.
- Distinctive: line 34
Use the domain's vocabulary, never "service / handler / util".
- Very specific: line 40
Write the boundary record to .sdlc-skills/evidence/{{YYYY-MM-DD}}-{{topic}}/boundary-record.md unless the user names another path: what the …
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 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, understand its shape. The failure this prevents is editing a region by pattern-matching on syntax while missing how it actually fits together — who calls it, what it owns, where the boundaries are.
When to use
- You're about to 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; one changed line can still alter a public, data, security, or release path.
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. 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; tests, CI, proof surfaces; ownership and change history. Per surface excluded from that list → an evidence-based reason.
- Use the domain's vocabulary, never "service / handler / util".
- Attach each conclusion to current files, symbols, searches, commands, or revisions. Separate observed from inferred. Mark 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. Past it, or a pinned input changed → revalidate affected claims before relying on them.
- Implementation finds a caller or surface the map never covered → stop and reorient. 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.

