agentleFS
augments-labsaugments-labs/sdlc-skills/skills/common/mapping-the-codebase/SKILL.md

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.

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
  1. Distinctive:

    Before you touch unfamiliar code, map who calls it, what it owns, and where its boundaries are.

    line 8
  2. Distinctive:

    Skip: only when a Step 3 boundary record for this region exists and is inside its freshness limit.

    line 15
  3. Distinctive:

    Before reading anything, write the intended change, how far it could reach, and why the boundary you picked holds that reach.

    line 20
  4. Distinctive:

    Start at the containing module and its neighbors: responsibilities, runtime entry points, callers, collaborators, data between them.

    line 28
  5. Distinctive:

    Use the domain's vocabulary, never "service / handler / util".

    line 36
  6. Very specific:

    Write the boundary record to .sdlc-skills/evidence/{{YYYY-MM-DD}}-{{topic}}/boundary-record.md unless the user names another path: what the …

    line 43
  7. Distinctive:

    If implementation finds a caller or surface the map never covered, stop editing and return to Step 1 with it: recheck that the boundary …

    line 49

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

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

  1. 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.
  2. 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

  1. Start at the containing module and its neighbors: responsibilities, runtime entry points, callers, collaborators, data between them.
  2. 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.
  3. Use the domain's vocabulary, never "service / handler / util".
  4. 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

  1. Write the boundary record to .sdlc-skills/evidence/{{YYYY-MM-DD}}-{{topic}}/boundary-record.md unless the user names another path: what the region owns, what it delegates, where its seams are, which downstream obligations a change must preserve.
  2. Set a freshness limit. Once it has passed, or a pinned input has changed, revalidate the affected claims before relying on them.
  3. 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.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.