agentleFS
PeanutGTPeanutGT/NutsSkills/skills/repo-map/SKILL.md

repo-map

Skill3 starsChanged 21 days agoApache-2.0View on GitHub

Use when starting work in an unfamiliar or large repository, before broad grep/glob/read exploration, or when you need to know where a function, class, or module is defined and which files use it. Builds a compact map of files, public symbols, and imports so you open only the files that matter.

13 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

3 rules. 0 are common, 0 are distinctive, and 3 are very specific to this project.

  • 0

    Common

    Most of the 12 edited versions we read keep these.

  • 0

    Distinctive

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Before a change that may touch several files (pairs with plan)

    line 22
  2. Very specific:

    Do not re-verify what --find already showed with a second repo-wide grep.

    line 39
  3. Very specific:

    Add .nuts/ to .gitignore if the user does not want the map committed.

    line 55

“Common” is measured: kept by at least 6 in 10 of the 12 edited versions of this file we could read. “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

Repo map

Core rule: Know the structure before you read the code. Open a file only when the map or --find points to it.

The map lists every source file with its public symbols, signatures, imports, and reverse imports in roughly 1/20 to 1/30 of the size of the source. It pays off for structure questions; for a question with a distinctive keyword, one targeted grep is just as cheap.

When to use

  • First task in an unfamiliar repo: "how is this project organized?", "where would X live?"
  • "What calls Y?", "where is Z defined?" when you know a symbol name
  • Before a change that may touch several files (pairs with plan)

Skip it for a one-file change when you already know the file, and when a single grep on a distinctive word (an error message, a config key) answers the question.

Process

  1. Know a symbol name? Use --find first (run from the repo root; SKILL_DIR is this skill's folder):
    python SKILL_DIR/scripts/repo_map.py . --find run_for_take
    Output: file:line signature, then referenced at: with every line that mentions the name in the defining file and in files that import it. This is usually the whole answer to "what calls Y?".
  2. Need the big picture? Build the map:
    python SKILL_DIR/scripts/repo_map.py .
    It writes .nuts/repo-map.md. Do not read it whole on a large repo: grep it for a folder or keyword (grep -n "^## src/billing" .nuts/repo-map.md) and read only those sections. Rebuild after large changes.
  3. Open only the candidate files, and only the relevant line ranges when files are long.
  4. Fall back to grep for things the map cannot show: private names, string literals, config keys, dynamic dispatch.
  5. Do not re-verify what --find already showed with a second repo-wide grep.

What the map contains

## shop/cart.py (16 lines)
- def load_items(path)
- def total(path, *, rounding=2)
imports: shop/models.py
used by: tests/test_cart.py
  • Python is parsed with ast (classes, methods, functions, signatures, relative and absolute imports).
  • JS/TS: exported functions, classes, consts, interfaces/types; relative imports are resolved to files.
  • Go, Rust, Java, Kotlin, C#, Ruby, PHP, Swift: top-level types and public functions by pattern. Imports are not resolved for these.
  • Private names (leading _) are hidden. Vendored and build folders (node_modules, dist, .venv, …) are skipped.

Rules

  • Add .nuts/ to .gitignore if the user does not want the map committed. Ask before editing .gitignore.
  • The map is a guide, not truth: confirm by opening the file before you edit or cite a line.

Done when

  • The map was built or refreshed this session
  • Files were opened because the map pointed to them, not by blind search

Related: plan, debug, nutshell.

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.