Search Tools

parcadei/Continuous-Claude-v3/.claude/skills/search-tools

作者 parcadeid07ff4b06b62f43771bc0c927d0211b734d6149e無授權條款3.9K 個星標收錄於 2026年10月9日更新於 2026年10月9日儲存庫8 個月前更新

Search Tool Hierarchy

AI 產生的概覽

指導代理在語意、結構、文字與字面程式碼搜尋工具之間做出選擇。

功能
此技能提供決策樹與比較表,用來選擇程式碼搜尋方式:LEANN 用於語意或概念查詢,AST-grep 用於結構模式,Morph 用於快速文字搜尋,內建 Grep 工具則用於字面模式。它列出每種工具的範例查詢,並提供 LEANN 的搜尋、列出索引與重建索引命令列。它產出的是指引,而不是檔案或程式碼。
適用情境
當代理需要搜尋程式碼庫,且必須判斷哪種搜尋方式適合當前查詢時使用。它適合關於程式碼如何運作的概念性問題、關於函式或用法的結構查詢,以及純文字或正規表示式查找。
執行需求
僅為說明文件,不附帶指令碼。LEANN 需要已建立的索引;AST-grep 需要 MCP 伺服器;Morph 需要 API 金鑰,並以 Grep 作為備援;內建 Grep 工具無需額外條件。

Search Tool Hierarchy

When searching code, use this decision tree:

Decision Tree

Need CONCEPTUAL/SEMANTIC search?  (how does X work, find patterns, understand architecture)  → Use LEANN (/leann-search) - embedding-based semantic search  → PreToolUse hook auto-redirects semantic Grep queries
Need to understand code STRUCTURE?  (find function calls, class usages, refactor patterns)  → Use AST-grep (/ast-grep-find)
Need to find TEXT in code?  → Use Morph (/morph-search) - 20x faster  → If no Morph API key: fall back to Grep tool
Simple one-off search?  → Use built-in Grep tool directly

Tool Comparison

ToolBest ForRequires
LEANNSemantic search: "how does caching work", "error handling patterns", conceptual queriesIndex built
AST-grepStructural patterns: "find all calls to foo()", refactoring, find usages by typeMCP server
MorphFast text search: "find files mentioning error", grep across codebaseAPI key
GrepLiteral patterns, class/function names, regexNothing (built-in)

Examples

LEANN (semantic/conceptual):

  • "how does authentication work"
  • "find error handling patterns"
  • "where is rate limiting implemented"

AST-grep (structural):

  • "Find all functions that return a Promise"
  • "Find all React components using useState"
  • "Refactor all imports of X to Y"

Morph (text search):

  • "Find all files mentioning 'authentication'"
  • "Search for TODO comments"

Grep (literal):

  • class ProviderAdapter
  • def __init__
  • Regex patterns

LEANN Commands

bash
# Search with semantic queryleann search opc-dev "how does blackboard communication work" --top-k 5
# List available indexesleann list
# Rebuild index (when code changes)leann build opc-dev --docs dir1 dir2 --no-recompute --no-compact --force

來源與署名

來源:parcadei/Continuous-Claude-v3位於.claude/skills/search-tools提交d07ff4b

授權條款: 無授權條款

內容歸原作者所有。SourceWeft 從公開儲存庫中收錄這些內容。

檢舉或申請下架