<< All versions

Skill v1.0.0

currentAutomated scan100/100
helweg/open-codebase-index/skill
──Details
PublishedOctober 25, 2026 at 09:16 PM
Content Hashsha256:874f5de80503de5c...
Git SHAbe56035e9607
──Files
Files (1 file, 5.1 KB)
SKILL.md5.1 KBactive
SKILL.md · 117 lines · 5.1 KB

version: "1.0.0" name: codebase-search description: 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.


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"
All versions