Search Tools

parcadei/continuous-claude-v3/.claude/skills/archive/search-tools

作者 parcadeid07ff4b06b62无许可证3.9K 个星标收录于 2026年10月8日更新于 2026年10月8日仓库8个月前更新

Search Tool Hierarchy

AI 生成的概览

指导智能体在语义、结构、文本和字面代码搜索工具之间进行选择。

功能
该技能提供决策树和对比表,用于选择代码搜索方式:LEANN 用于语义或概念查询,AST-grep 用于结构模式,Morph 用于快速文本搜索,内置 Grep 工具用于字面模式。它列出了每种工具的示例查询,并展示 LEANN 命令行在搜索、列出和重建索引方面的用法。它产出的是指导,而不是文件或代码。
适用场景
当智能体需要搜索代码库并必须判断哪种搜索方式适合当前查询时使用,例如关于某功能如何工作的概念性问题、结构性重构模式或简单的字面查找。在需要理解语义搜索钩子或回退行为时也适用。
运行要求
不包含脚本,仅为说明性指令。按其指导操作可能需要 LEANN 工具及已构建的索引、AST-grep MCP 服务器、Morph API 密钥或内置 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/archive/search-tools提交d07ff4b

许可证: 无许可证

内容归原作者所有。SourceWeft 从公开仓库中收录这些内容。

举报或申请下架