agentleFS
joshuadavidthomasjoshuadavidthomas/agent-skills/researching-codebases/SKILL.md

researching-codebases

Skill49 starsChanged 6 months agoMITView on GitHub

Use when answering complex questions about a codebase that require exploring multiple areas or understanding how components connect - coordinates parallel sub-agents to locate, analyze, and synthesize findings

The file

We split this skill into the rules it gives an agent

12 rules. About 0 are common, 8 are distinctive, and 4 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈8

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 4

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Before decomposing a new research question, consider checking for related past research:

    line 27
  2. Very specific:

    Run list-research.py script to see recent research docs

    line 29
  3. Very specific:

    Run search-research.py script with relevant keywords

    line 30
  4. Very specific:

    If related research exists, run read-research.py script to load it

    line 31
  5. Distinctive:

    If the user references specific files, read them FULLY before spawning agents.

    line 38
  6. Distinctive:

    Do I need locations, analysis, or examples?

    line 45
  7. Very specific:

    Run gather-metadata.py script to get date, repo, branch, commit, cwd.

    line 73
  8. Distinctive:

    Add query (from user's question) and tags (from content)

    line 74
  9. Distinctive:

    Create directory if it doesn't exist

    line 76
  10. Distinctive:

    Spawning agents before reading context: Read any files the user mentions first.

    line 85
  11. Distinctive:

    Over-documenting simple answers: Not every question needs a saved research doc.

    line 89
  12. Distinctive:

    Sequential when parallel works: If tasks are independent, spawn them together.

    line 91

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

Researching Codebases

Coordinate parallel sub-agents to answer complex codebase questions.

When to Use

  • Questions spanning multiple files or components
  • "How does X work?" requiring tracing through code
  • Finding patterns or examples across the codebase
  • Understanding architectural decisions or data flow

When NOT to Use

  • Simple "where is X?" - use code-locator directly
  • Single file questions - just read the file
  • External/web research only - use web-searcher directly

Workflow

0. Check past research (optional)

Before decomposing a new research question, consider checking for related past research:

  1. Run list-research.py script to see recent research docs
  2. Run search-research.py script with relevant keywords
  3. If related research exists, run read-research.py script to load it
  4. Build on previous findings instead of starting fresh

See research-tools.md for script usage.

1. Read mentioned files first

If the user references specific files, read them FULLY before spawning agents. This gives you context for decomposition.

2. Decompose the question

Break the query into parallel research tasks. Consider:

  • Which areas of the codebase are relevant?
  • Do I need locations, analysis, or examples?
  • See agent-selection.md for agent capabilities

3. Spawn parallel agents

Launch multiple agents concurrently for independent tasks. Use the task tool with appropriate subagent_type.

Wait for ALL agents to complete before synthesizing.

4. Synthesize and respond

Combine findings into a coherent answer:

  • Direct answer to the question
  • Key file:line references
  • Connections between components
  • Open questions if any areas need more investigation

5. Offer to save (optional)

For substantial research, ask:

Want me to save this to a research doc? (project: .research/ or global: ~/.research/)

Skip this for quick answers.

When saving:

  1. Run gather-metadata.py script to get date, repo, branch, commit, cwd.
  2. Add query (from user's question) and tags (from content)
  3. Format YAML frontmatter per output-format.md
  4. Create directory if it doesn't exist
  5. Use filename: {filename_date}_topic-slug.md

Agent Reference

See agent-selection.md for when to use each agent.

Common Mistakes

Spawning agents before reading context: Read any files the user mentions first.

Not waiting for all agents: Synthesize only after ALL agents complete.

Over-documenting simple answers: Not every question needs a saved research doc.

Sequential when parallel works: If tasks are independent, spawn them together.

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.