agentleFS
pablodiazjorgepablodiazjorge/prompt-forge/.github/skills/explore-codebase/SKILL.md

explore-codebase

Skill2 starsChanged 5 months agoMITView on GitHub

Efficient codebase exploration patterns for AI coding agents. Use when entering a new project, understanding unfamiliar code, or when the user asks to "explore", "understand", "find where X is implemented", or "how does Y work". Reduces token waste by using strategic search instead of sequential file reading.

7 other projects use a version of this.

Adopted by

Most recently taken up by

The file

Files
SKILL.md

Codebase Exploration Playbook

Golden Rules

  1. First: check for errors — get_errors() before anything else. Fixing compile errors is priority zero.
  2. NEVER read files one by one — grep_search with regex alternation first
  3. semantic_search for concepts, grep_search for exact symbols
  4. file_search for globs to discover structure instantly
  5. Read 100+ lines at a time — fewer reads = fewer tokens
  6. Parallel reads — read 2-3 key files in one turn
  7. Avoid the "grep tax" — use familiar formats (Markdown/YAML), not obscure ones

Progressive Disclosure (Skill Pattern)

Top coding agents (Codex, Claude Code) use this — do the same:

  1. Metadata (~100 tokens): name + description loaded for ALL files
  2. Instructions (< 500 lines): body loaded when triggered
  3. Resources (on-demand): only files referenced via Markdown links

Strategy by Goal

GoalApproach
"Where is X?"grep_search → vscode_listCodeUsages → read defining file
"How does this work?"file_search("**/*.{ts,js}") → semantic_search("architecture") → read ONE key file deeply
"Find tests for Y"file_search("**/Y*.spec.ts") — glob is instant
"What deps?"read_file("package.json", 1, 100) — one read
"Are there errors?"get_errors() FIRST — then grep for error symbols
"Find all imports of X"grep_search("import.*X", isRegexp=true) across **/*.ts

Tool Quick Reference

ToolBest for
get_errors(filePaths)Always first — compile/lint errors
grep_search(query, isRegexp, includePattern)Text/regex: `functionclassinterface`
semantic_search(query)Natural language: "how does auth work"
file_search(query)Glob: **/*.spec.ts, **/*.component.ts
read_file(path, start, end)Read 100+ line chunks (parallel when possible)
vscode_listCodeUsages(symbol, lineContent)All references of a symbol
list_dir(path)Directory listing

Anti-Patterns

Don'tDo
Read 15 files sequentiallySearch first, read 2-3 key files in parallel
Read 20-line chunks100-200 lines at a time
Single-keyword searchesRegex alternation
Guess file locationsfile_search with globs
Use obscure formats for contextMarkdown/YAML — models know them best
Skip error checkingget_errors() as step 1

Token Economics

ApproachTokens
Sequential 15 files × 500 tokens~7,500
With this playbook~700
Savings~91%

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.