agentleFS
HelwegHelweg/open-codebase-index/skill/SKILL.md

codebase-search

Skill230 starsChanged 5 months agoMITView on GitHub

Task-specific semantic code and documentation retrieval. Use compact context for unfamiliar repository orientation, direct lookup for known definitions, graph tools for relationships, and grep for exhaustive literal matches.

3 other projects use a version of this.

Adopted by

Most recently taken up by

  • Other versions3 projects use a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 3

    1. tmcfarlane/team-avatar★ 112same name
    2. FilenCloudDienste/filen-rs★ 104same name
    3. derheissenberg/applicaiton★ 2same name

    How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.

  • In this repository2 other files it gives its agents.

The file

We split this skill into the rules it gives an agent

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

  • 0

    Common

    Most of the 3 edited versions we read keep these.

  • 1

    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:

    Check index_status when readiness or freshness is unknown.

    line 36
  2. Very specific:

    Use codebase_peek for semantic locations or codebase_search for matching content when needed.

    line 40
  3. Very specific:

    Read known paths directly.

    line 41
  4. Distinctive:

    Check if indexed and ready.

    line 81

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

Codebase Search Skill

Important: Indexed Content

The indexed codebase contains two types of content:

  1. Project Source Code — all code files in the current workspace
  2. Knowledge Base Documentation — external documentation, usage guides, API references, and example programs added via add_knowledge_base (MCP/OpenCode) or knowledge_base_add (Pi).

When to Use What

ScenarioToolWhy
Unfamiliar repository layout or subsystemcodebase_contextCompact orientation before broad reads
Code/library/API questioncodebase_searchSearch local knowledge first
Just need file locationscodebase_peekMetadata only, saves ~90% tokens
Need to see actual codecodebase_searchReturns full code content
Find duplicates/patternsfind_similarGiven code snippet → similar code
Understand code flowcall_graphFind callers/callees of any function
Trace dependency pathscall_graph_pathFind a shortest known path between two symbols
Analyze PR blast radiuspr_impactFind affected symbols, communities, hub nodes, and risk
Don't know function/class namescodebase_contextNatural-language orientation with bounded evidence
Know a symbol and need its definitionimplementation_lookupAuthoritative source without a context prerequisite
Need ALL occurrencesgrepSemantic returns top N only
Access specific URLwebfetchDirect URL access, no codebase search needed
Local search failswebsearchFallback when codebase has no results
Local and web search failssuggest adding knowledge baseNotify user to add related folder

Task-specific Workflow

  1. Check index_status when readiness or freshness is unknown. Index only when missing, stale, or incompatible.
  2. For unfamiliar repository orientation, use one compact codebase_context first pass (tokenBudget: 600, limit: 5) and inspect its evidence before broad reads or searches.
  3. For known definitions, use implementation_lookup directly. For callers/callees or dependency paths, use call_graph or call_graph_path directly once endpoints are identified.
  4. For known or suspected edit targets, optionally use codebase_edit_context for bounded source plus direct graph evidence.
  5. Use codebase_peek for semantic locations or codebase_search for matching content when needed. Neither requires another context call when scope is already known.
  6. Read known paths directly; use grep for exact identifiers and exhaustive literal matches. Apply directory/file filters when the scope is known, rather than guessing a narrower scope.

For repository implementation questions, use local source evidence before web search. External library/API documentation questions may need web sources when the local index lacks relevant documentation. Avoid repeating retrieval when existing evidence already answers the task.

Tools

codebase_peek

Find WHERE code is. Returns metadata only (file, line, name, type).

codebase_peek(query="validation logic", chunkType="function", directory="src/utils")
codebase_peek(query="authentication flow", blameAuthor="jane@example.com")

codebase_search

Find code with full content. Use when you need to see implementation.

codebase_search(query="error handling middleware", fileType="ts", contextLines=2)
codebase_search(query="rate limiter", blameSince="2025-01-01", blameUntil="2025-01-31")

find_similar

Find code similar to a given snippet. Use for duplicate detection, pattern discovery, refactoring.

find_similar(code="function validate(input) { return input.length > 0; }", excludeFile="src/current.ts", blameSince="2025-01-01")

call_graph

Query callers or callees of a function/method.

call_graph(name="validateToken", direction="callers")

index_codebase

Manually trigger indexing. Required before first search.

index_status

Check if indexed and ready.

MCP/OpenCode knowledge-base tools

  • add_knowledge_base(path="/path/to/docs")
  • list_knowledge_bases
  • remove_knowledge_base(path="/path/to/docs")

Pi knowledge-base tools

  • knowledge_base_add(path="/path/to/docs")
  • knowledge_base_list
  • knowledge_base_remove(path="/path/to/docs")

Query Tips

Describe behavior, not syntax:

  • Good: "function that hashes passwords securely"
  • Bad: "hashPassword" (use grep for exact names)

Search across documentation:

  • Good: "how to configure WiFi in ESP-IDF"
  • Good: "GPIO initialization example"

Filters

FilterExample
chunkTypefunction, class, interface, type, method
directory"src/api", "tests"
fileType"ts", "py", "rs"
blameAuthor"jane@example.com" or "Jane Doe"
blameSha"abc1234"
blameSince"2025-01-01"
blameUntil"2025-01-31"

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.