agentleFS
gclmgclm/super-stack/skills/planning/map-codebase/SKILL.md

map-codebase

Skill0 starsChanged 8 months agoMITView on GitHub

Inspect an existing project and produce a structured codebase map covering stack, architecture, conventions, integrations, testing, and risks.

7 other projects use a version of this.

Adopted by

Most recently taken up by

The file

Show its rules and text

We split this skill into the rules it gives an agent

23 rules. 0 are common, 15 are distinctive, and 8 are very specific to this project.

  • 0

    Common

    Most of the 6 edited versions we read keep these.

  • 15

    Distinctive

    This author's own choices. Worth a look.

  • 8

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use this skill when entering a brownfield project, inheriting an unfamiliar repository, or preparing to plan work against an existing …

    line 8
  2. Very specific:

    When ContextWeaver is available in the environment, use it as the primary evidence accelerator, not as a replacement for architectural …

    line 24
  3. Distinctive:

    if available, verify index scope before scanning deeply

    line 27
  4. Very specific:

    use search --format json and prompt-context --format json to collect candidate files and symbols

    line 28
  5. Very specific:

    prefer official distributed scripts from contextweaver install-skills when stable structured output is needed

    line 29
  6. Very specific:

    follow the decision rules in ~/.agents/skills/using-contextweaver/SKILL.md to choose read vs grep vs semantic retrieval

    line 30
  7. Distinctive:

    if unavailable, continue with normal repository-first scanning

    line 32
  8. Distinctive:

    If the baseline scan shows this is a multi-module or multi-app repository, do not assume the user wants a full-repository map unless they …

    line 44
  9. Distinctive:

    if the user already names the target module, service, app, or flow, continue with that boundary

    line 48
  10. Distinctive:

    if the repository is clearly multi-module and the target is still ambiguous, pause and ask one short question to confirm which module or …

    line 49
  11. Distinctive:

    only do a broad full-repository map without confirmation when the user explicitly asks for the whole repository or when the module boundary …

    line 50
  12. Distinctive:

    Use a layered entry strategy:

    line 58
  13. Distinctive:

    Test layout and commands

    line 69
  14. Distinctive:

    When the user already points to a module or objective, do not treat that as permission to skip the baseline layer.

    line 76
  15. Distinctive:

    When the repository is multi-module, keep the baseline layer narrow and only wide enough to identify the module boundary before deepening.

    line 77
  16. Distinctive:

    When the baseline is already clear, do not keep broadening the scan beyond the target layer.

    line 78
  17. Distinctive:

    prefer short concrete notes over long prose

    line 84
  18. Distinctive:

    if something is unknown, say it is unknown

    line 85
  19. Distinctive:

    when docs or planning files disagree with the repository, record that drift explicitly instead of smoothing it over

    line 87
  20. Very specific:

    If harness/state.md exists, update it with:

    line 91
  21. Very specific:

    If the mapping reveals durable repository-level drift, structural mismatch, or workflow implications worth preserving, append a concise …

    line 97
  22. Very specific:

    default to minimal output (summary.md + concerns.md)

    line 110
  23. Very specific:

    use full output only when repository-level onboarding or handoff needs a full map pack

    line 111

“Common” is measured: kept by at least 6 in 10 of the 6 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

Map Codebase

Use this skill when entering a brownfield project, inheriting an unfamiliar repository, or preparing to plan work against an existing codebase.

Read First

  • root AGENTS.md
  • nearby docs such as README*, docs/, architecture notes, and config files
  • docs/reference/conventions.md if it exists
  • harness/state.md if it exists
  • harness/history.md if it exists
  • references/layered-entry.md
  • references/output-shape.md
  • references/runtime-footprint.md when important evidence may live outside the repository
  • ~/.agents/skills/using-contextweaver/SKILL.md when ContextWeaver is available

Context Retrieval

When ContextWeaver is available in the environment, use it as the primary evidence accelerator, not as a replacement for architectural judgment.

  • first check whether contextweaver (or cw) is available
  • if available, verify index scope before scanning deeply
  • use search --format json and prompt-context --format json to collect candidate files and symbols
  • prefer official distributed scripts from contextweaver install-skills when stable structured output is needed
  • follow the decision rules in ~/.agents/skills/using-contextweaver/SKILL.md to choose read vs grep vs semantic retrieval
  • then confirm critical claims by opening repository files directly
  • if unavailable, continue with normal repository-first scanning

Goals

  • build a trustworthy map of how the project works
  • record evidence, not guesses
  • identify stack, architecture, boundaries, and risky areas
  • prepare material that later skills can use without re-exploring everything
  • surface mismatches between documented structure and actual repository structure

Multi-Module Guard

If the baseline scan shows this is a multi-module or multi-app repository, do not assume the user wants a full-repository map unless they clearly asked for that.

Use this rule:

  • if the user already names the target module, service, app, or flow, continue with that boundary
  • if the repository is clearly multi-module and the target is still ambiguous, pause and ask one short question to confirm which module or scope they want mapped first
  • only do a broad full-repository map without confirmation when the user explicitly asks for the whole repository or when the module boundary truly cannot be separated safely

The confirmation should be short and concrete, for example:

  • 这个仓库看起来是多模块的,你这次想先聚焦哪个模块?

Investigation Order

Use a layered entry strategy:

  1. Baseline layer
  2. Design layer
  3. Target layer

Within those layers, investigate in this order:

  1. Entry docs and top-level manifests
  2. Build and runtime config
  3. Source tree layout
  4. Test layout and commands
  5. Compare docs, scripts, and CI entrypoints against the real repository layout
  6. External integrations
  7. Host-runtime footprint outside the repo when relevant
  8. User-targeted deepening only after the baseline and nearby design are stable
  9. Hotspots, risks, and unclear areas

When the user already points to a module or objective, do not treat that as permission to skip the baseline layer. When the repository is multi-module, keep the baseline layer narrow and only wide enough to identify the module boundary before deepening. When the baseline is already clear, do not keep broadening the scan beyond the target layer.

Evidence Rules

  • cite actual files, directories, commands, and symbols
  • distinguish confirmed facts from inference
  • prefer short concrete notes over long prose
  • if something is unknown, say it is unknown
  • distinguish repository evidence from host-runtime evidence such as local config, logs, launch agents, or running processes
  • when docs or planning files disagree with the repository, record that drift explicitly instead of smoothing it over

State Updates

If harness/state.md exists, update it with:

  • status: mapped
  • current focus: codebase map completed
  • decision entry summarizing the repository scan

If the mapping reveals durable repository-level drift, structural mismatch, or workflow implications worth preserving, append a concise entry to harness/history.md.

Output

Tell the user:

  • what was mapped
  • the main architectural shape
  • the top concerns
  • the best next step, usually brainstorm or plan

Choose output depth using references/output-shape.md:

  • default to minimal output (summary.md + concerns.md)
  • use full output only when repository-level onboarding or handoff needs a full map pack

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.