AS
AgSkills.dev
MARKETPLACE

search-router

Choose the right search tool for each query type

3.3k
256

Preview

SKILL.md
name
search-router
description
Choose the right search tool for each query type
user-invocable
false

Search Tool Router

Use the most token-efficient search tool for each query type.

When to Use

  • Searching for code patterns
  • Finding where something is implemented
  • Looking for specific identifiers
  • Understanding how code works

Decision Tree

Query Type?
β”œβ”€β”€ CODE EXPLORATION (symbols, call chains, data flow)
β”‚   β†’ TLDR Search - 95% token savings
β”‚   DEFAULT FOR ALL CODE SEARCH - use instead of Grep
β”‚   Examples: "spawn_agent", "DataPoller", "redis usage"
β”‚   Command: tldr search "query" .
β”‚
β”œβ”€β”€ STRUCTURAL (AST patterns)
β”‚   β†’ AST-grep (/ast-grep-find) - ~50 tokens output
β”‚   Examples: "def foo", "class Bar", "import X", "@decorator"
β”‚
β”œβ”€β”€ SEMANTIC (conceptual questions)
β”‚   β†’ TLDR Semantic - 5-layer embeddings (P6)
β”‚   Examples: "how does auth work", "find error handling patterns"
β”‚   Command: tldr semantic search "query"
β”‚
β”œβ”€β”€ LITERAL (exact text, regex)
β”‚   β†’ Grep tool - LAST RESORT
β”‚   Only when TLDR/AST-grep don't apply
β”‚   Examples: error messages, config values, non-code text
β”‚
└── FULL CONTEXT (need complete understanding)
    β†’ Read tool - 1500+ tokens
    Last resort after finding the right file

Token Efficiency Comparison

ToolOutput SizeBest For
TLDR~50-500DEFAULT: Code symbols, call graphs, data flow
TLDR Semantic~100-300Conceptual queries (P6, embedding-based)
AST-grep~50 tokensFunction/class definitions, imports, decorators
Grep~200-2000LAST RESORT: Non-code text, regex
Read~1500+Full understanding after finding the file

Examples

# CODE EXPLORATION β†’ TLDR (DEFAULT) tldr search "spawn_agent" . tldr search "redis" . --layer call_graph # STRUCTURAL β†’ AST-grep /ast-grep-find "async def $FUNC($$$):" --lang python # SEMANTIC β†’ TLDR Semantic tldr semantic search "how does authentication work" # LITERAL β†’ Grep (LAST RESORT - prefer TLDR) Grep pattern="check_evocation" path=opc/scripts # FULL CONTEXT β†’ Read (after finding file) Read file_path=opc/scripts/z3_erotetic.py

Optimal Flow

1. AST-grep: "Find async functions" β†’ 3 file:line matches
2. Read: Top match only β†’ Full understanding
3. Skip: 4 irrelevant files β†’ 6000 tokens saved

Related Skills

  • /tldr-search - DEFAULT - Code exploration with 95% token savings
  • /ast-grep-find - Structural code search
  • /morph-search - Fast text search
GitHub Repository
parcadei/Continuous-Claude-v3
Stars
3,398
Forks
256
Open Repository
Install Skill
Download ZIP1 files