{"id":"search-tools","name":"search-tools","summary":"検索ツールの階層","body":"# Search Tool Hierarchy\n\nWhen searching code, use this decision tree:\n\n## Decision Tree\n\n```\nNeed CONCEPTUAL/SEMANTIC search?\n  (how does X work, find patterns, understand architecture)\n  → Use LEANN (/leann-search) - embedding-based semantic search\n  → PreToolUse hook auto-redirects semantic Grep queries\n\nNeed to understand code STRUCTURE?\n  (find function calls, class usages, refactor patterns)\n  → Use AST-grep (/ast-grep-find)\n\nNeed to find TEXT in code?\n  → Use Morph (/morph-search) - 20x faster\n  → If no Morph API key: fall back to Grep tool\n\nSimple one-off search?\n  → Use built-in Grep tool directly\n```\n\n## Tool Comparison\n\n| Tool | Best For | Requires |\n|------|----------|----------|\n| **LEANN** | Semantic search: \"how does caching work\", \"error handling patterns\", conceptual queries | Index built |\n| **AST-grep** | Structural patterns: \"find all calls to `foo()`\", refactoring, find usages by type | MCP server |\n| **Morph** | Fast text search: \"find files mentioning error\", grep across codebase | API key |\n| **Grep** | Literal patterns, class/function names, regex | Nothing (built-in) |\n\n## Examples\n\n**LEANN** (semantic/conceptual):\n- \"how does authentication work\"\n- \"find error handling patterns\"\n- \"where is rate limiting implemented\"\n\n**AST-grep** (structural):\n- \"Find all functions that return a Promise\"\n- \"Find all React components using useState\"\n- \"Refactor all imports of X to Y\"\n\n**Morph** (text search):\n- \"Find all files mentioning 'authentication'\"\n- \"Search for TODO comments\"\n\n**Grep** (literal):\n- `class ProviderAdapter`\n- `def __init__`\n- Regex patterns\n\n## LEANN Commands\n\n```bash\n# Search with semantic query\nleann search opc-dev \"how does blackboard communication work\" --top-k 5\n\n# List available indexes\nleann list\n\n# Rebuild index (when code changes)\nleann build opc-dev --docs dir1 dir2 --no-recompute --no-compact --force\n```","author":"@parcadei","ownerProfile":null,"authorContacts":null,"sourceUrl":"https://github.com/parcadei/Continuous-Claude-v3/tree/main/.claude/skills/archive/search-tools","license":"MIT","category":"coding","lang":"en","tokens":476,"stars":0,"calls30d":1,"claimed":false,"visibility":"public","origin":"crawler","version":"0.1.0","createdAt":"2026-08-22","updatedAt":"2026-08-22","files":[],"requires":{"mcp":[],"tools":[]},"safety":{"flags":[],"scannedAt":"2026-08-22","hasScripts":false,"networkEndpoints":[]}}