Search
Search web, library docs, and GitHub code using progressive escalation.
Quick Start
Decision Tree:
- Library/framework docs? → Context7
get-library-docs
- Code examples/patterns? → GitHub Grep
grep_searchGitHub
- Web info/tutorials? → Tavily
tavily_search (fallback chain: Exa → Z.AI webSearchPrime)
- Error screenshot/diagram? → Z.AI Vision
diagnose_error_screenshot / understand_technical_diagram
- Multiple sources needed? → Run tools in parallel
Default Workflow:
- Start simple:
search_depth: "basic", maxResults: 5
- If insufficient: Escalate to Level 2 (expand query, increase results)
- If repeated problem: Escalate to Level 3 (parallel queries, extraction, crawling)
Agent Roles
If you are the main agent (orchestrator):
- External questions → Fire 3-5
librarian agents in parallel with different angles
- Local codebase patterns → Fire
explore in background
- Quick web lookups → Do Tavily yourself (faster than delegation overhead)
- Build confidence → Fire multiple librarians: 2 for docs, 2 for real-world examples, 2 to find edge cases/gotchas
- Collect results with
background_output, synthesize, cross-validate
If you are the librarian (subagent):
- You are the WORKHORSE - do NOT be lazy or return minimal results
- Fire 3-5 parallel tool calls depending on request complexity (see TYPE A/B/C/D in your system prompt)
- Vary your queries - different angles, not the same pattern repeated
- Always cite with permalinks - every claim needs
[Source](url#L10-L20) format
- Rate your confidence - end with:
CONFIDENCE: HIGH/MEDIUM/LOW and why
Subagent Calling Example
// GOOD: Fire multiple librarians with different angles for comprehensive coverage
background_task({
agent: "librarian",
prompt: `Find OFFICIAL documentation for Next.js 15 App Router authentication.
FIRST: MUST load and read 'search' skill before starting
LEVEL: 3 (deep research - parallel queries, thorough extraction)
FOCUS: Official Next.js and next-auth docs only
TOOLS: Context7 for Next.js, next-auth docs
FORMAT: Use markdown tables for comparisons, code blocks for snippets
OUTPUT: Official recommended approach with doc permalinks
END WITH: CONFIDENCE rating (HIGH/MEDIUM/LOW) and reasoning`
})
background_task({
agent: "librarian",
prompt: `Find REAL-WORLD implementations of Next.js 15 authentication.
FIRST: MUST load and read 'search' skill before starting
LEVEL: 3 (deep research - multiple pattern variations, cross-repo)
FOCUS: Production codebases on GitHub
TOOLS: grep_searchGitHub with queries: "getServerSession(", "auth(", language: TypeScript
FORMAT: For each example: repo name, permalink, architecture notes
OUTPUT: 3-5 code examples with GitHub permalinks, note patterns/variations
END WITH: CONFIDENCE rating (HIGH/MEDIUM/LOW) and reasoning`
})
background_task({
agent: "librarian",
prompt: `Find EDGE CASES and GOTCHAS for Next.js 15 authentication.
FIRST: MUST load and read 'search' skill before starting
LEVEL: 3 (deep research - cross-reference multiple sources)
FOCUS: Issues, discussions, Stack Overflow
TOOLS: zai-zread_search_doc for repo issues/discussions (thorough), tavily_search for blog posts/SO
FORMAT: Problem → Evidence → Solution table
OUTPUT: Common pitfalls, breaking changes, migration issues
END WITH: CONFIDENCE rating (HIGH/MEDIUM/LOW) and reasoning`
})
// Then collect and cross-validate:
// - Do real-world examples match official docs?
// - Are there gotchas the docs don't mention?
// - Synthesize into recommendation with overall confidence
// BAD: No skill loading, no structure
background_task({
agent: "librarian",
prompt: "How does Next.js auth work?" // Missing FIRST step, no level, no format = lazy results
})
Tools Overview
Tavily (Web Search)
| Tool |
When to Use |
Key Params |
tavily_search |
General web search, tutorials, blog posts, news |
search_depth: "basic"/"advanced", maxResults: 5-20, time_range: "day"/"week"/"month"/"year", include_domains: filter to specific sites |
tavily_extract |
Get full content from specific URLs (after search) |
extract_depth: "basic"/"advanced", query: rerank chunks by relevance |
tavily_crawl |
Crawl multiple pages from a docs site |
max_depth: 1-3, limit: max pages, select_paths: regex to include, instructions: natural language filter |
tavily_map |
Discover site structure before crawling |
max_depth: 1-3, limit: max URLs to return |
Web Fallback Providers
| Tool |
When to Use |
Key Params |
websearch_web_search_exa |
Secondary fallback when Tavily quota/execution fails |
numResults (default: 8), type: "auto"/"fast"/"deep"/"neural" |
webSearchPrime (via zai-web-search-prime MCP) |
Tertiary fallback when Exa also fails or returns empty/low-value results |
search_query (required), search_engine (fixed: "search-prime", set by MCP), count: 1-50, search_recency_filter, search_domain_filter |
Context7 (Library Docs)
| Tool |
When to Use |
Key Params |
resolve-library-id |
Get library ID (required first) |
libraryName: package name |
get-library-docs |
Fetch official docs |
mode: "code" for API/params, "info" for concepts; topic: specific area |
GitHub Grep (Code Search)
| Tool |
When to Use |
Key Params |
grep_searchGitHub |
Find real code patterns across GitHub |
query: literal code pattern, language: ["TypeScript"], repo: "owner/repo", path: "/api/", useRegexp: true for regex |
Critical: GitHub Grep searches literal code patterns, not keywords!
- ✅ Good:
useState(, getServerSession, (?s)try {.*await
- ❌ Bad:
react tutorial, how to authenticate
Z.AI Zread (Semantic GitHub Search)
| Tool |
When to Use |
Key Params |
zai-zread_search_doc |
Semantic search for issues/PRs/docs when keyword search fails |
repo_name: "owner/repo", query: natural language question, language: "en"/"zh" |
Use when: Code/keyword search misses context, need discussion threads, searching for "why" not "what".
Z.AI Vision (Visual Content)
| Tool |
When to Use |
Key Params |
zai-vision_diagnose_error_screenshot |
Analyze error screenshots, stack traces |
image_source: file path or URL, prompt: describe what help you need, context: when error occurred |
zai-vision_understand_technical_diagram |
Interpret architecture/flow/UML/ER diagrams |
image_source: file path or URL, prompt: what to extract, diagram_type: "architecture"/"flowchart"/"uml"/"er-diagram" (optional) |
zai-vision_analyze_data_visualization |
Understand charts/graphs/dashboards |
image_source: file path or URL, prompt: what insights needed, analysis_focus: "trends"/"anomalies"/"comparisons" |
zai-vision_ui_to_artifact |
Generate code from UI screenshots |
image_source: file path or URL, output_type: "code"/"prompt"/"spec"/"description", prompt: specific requirements |
Use when: User provides screenshot, error image, architecture diagram, or UI mockup.
GitHub CLI (Repo Search)
# Repository structure
gh api "repos/{owner}/{repo}/git/trees/{branch}?recursive=1"
# Search issues
gh api -X GET search/issues -f q="repo:{owner}/{repo} is:issue {keywords}"
# Read file directly
webfetch("https://raw.githubusercontent.com/{owner}/{repo}/{branch}/{path}")
Progressive Escalation Levels
Level 1: Simple Search (Default)
When: Quick lookups, straightforward questions, first encounter
- Tavily:
search_depth: "basic", maxResults: 5
- Context7:
mode: "code" for API, mode: "info" for concepts
- GitHub Grep: literal code patterns with language filter
- Parallel execution when appropriate
Sufficient? → Done. Insufficient? → Level 2
Level 2: Enhanced Search
When: Initial results incomplete, need more examples, outdated results
- Expand query: Add synonyms, context (keep <400 chars)
- Increase:
maxResults: 10-15, search_depth: "advanced"
- Filter domains:
include_domains: ["stackoverflow.com", "github.com"]
- Time filter:
time_range: "year" for recent info
- Two-step extraction: Search → Filter by score (>0.5) → Extract top URLs
- Discussions/docs gap: Use
search_doc or gh api search/issues when keyword/code search misses context
Sufficient? → Done. Insufficient? → Level 3
Level 3: Deep Research
When: Problem encountered 2+ times, complex topic, building knowledge base
- Parallel queries: 3-5 query variations with synonyms
- Systematic extraction: Top 5-10 URLs with
extract_depth: "advanced"
- Website exploration:
tavily_map → tavily_crawl
- GitHub deep dive: Multiple pattern variations, regex, cross-repo comparison
- Cross-reference: Verify across multiple sources
Key Tips (Reminders)
Query Formulation
- 400 char limit - Break complex queries into sub-queries
- Natural language works better - Full sentences > keywords
- Be specific - Include technology, use case, context
- For full guide: See
references/query-guide.md
Score-Based Filtering
- Tavily results include
score (0-1)
- >0.5 typically good - Adjust based on distribution
- Filter before extracting to save credits
Two-Step Extraction Pattern
1. Search with search_depth: "advanced"
2. Filter URLs by score (>0.5)
3. Extract top 2-5 URLs with extract_depth: "basic"
4. Upgrade to "advanced" only if needed
GitHub Grep Patterns
# API usage
Query: getServerSession
Language: ['TypeScript'], Path: '/api/'
# Multiline with regex
Query: (?s)useEffect\(\(\) => {.*cleanup
useRegexp: true
Cost Optimization
basic = 1 credit, advanced = 2 credits
- Prefer two-step extraction over
include_raw_content: true
- Use
tavily_map before tavily_crawl
Quota Management:
- Default to Tavily for important/critical searches (better relevance when quota available)
- If Tavily fails due to quota/rate limit (429), fail over immediately to Exa (no retry)
- For other transient Tavily failures (timeout/5xx), do one jittered retry (~300-800ms)
- Fallback to Exa (
websearch_web_search_exa) when Tavily still fails after that retry
- If Exa fails due to quota/rate limit, fail over immediately to Z.AI
webSearchPrime (no retry)
- For other transient Exa failures (timeout/5xx), do one jittered retry (~300-800ms), then fail over to Z.AI
- If Exa is empty/low-quality, fallback to Z.AI
webSearchPrime
- Don't loop retries across providers; fail over immediately to next provider
For advanced techniques: See references/advanced-techniques.md
Common Patterns
| Pattern |
Level 1 |
Level 2 |
Level 3 |
| Error resolution |
Exact error + SO domain |
Remove quotes, add context |
Extract top answers, cross-ref docs |
| Best practices |
"Tech best practices 2024" |
Domain filter + extract |
Parallel aspect searches |
| API reference |
Context7 with topic |
+ Tavily + GitHub Grep |
Crawl official docs |
| Code patterns |
GitHub Grep literal |
+ language/path filters |
Regex + cross-repo |
For workflow examples: See references/examples/example-workflows.md
References
references/reference-parameters.md - Complete parameter reference for all tools
references/query-guide.md - Query structuring, 400 char limit, expansion strategies
references/advanced-techniques.md - Two-step extraction, post-processing, cost optimization
references/examples/example-workflows.md - Practical workflow examples
Output
Search results are used directly in context. No files saved unless requested. For comprehensive research with evidence cards, use the research skill.
Converted and distributed by TomeVault — claim your Tome and manage your conversions.
1---2name: lukasstrickler-ai-dev-atelier-search3description: Search4---56# Search78Search web, library docs, and GitHub code using progressive escalation.910## Quick Start1112**Decision Tree:**13- **Library/framework docs?** → Context7 `get-library-docs`14- **Code examples/patterns?** → GitHub Grep `grep_searchGitHub`15- **Web info/tutorials?** → Tavily `tavily_search` (fallback chain: Exa → Z.AI `webSearchPrime`)16- **Error screenshot/diagram?** → Z.AI Vision `diagnose_error_screenshot` / `understand_technical_diagram`17- **Multiple sources needed?** → Run tools in parallel1819**Default Workflow:**201. Start simple: `search_depth: "basic"`, `maxResults: 5`212. If insufficient: Escalate to Level 2 (expand query, increase results)223. If repeated problem: Escalate to Level 3 (parallel queries, extraction, crawling)2324## Agent Roles2526**If you are the main agent (orchestrator):**27- **External questions** → Fire 3-5 `librarian` agents in parallel with different angles28- **Local codebase patterns** → Fire `explore` in background29- **Quick web lookups** → Do Tavily yourself (faster than delegation overhead)30- **Build confidence** → Fire multiple librarians: 2 for docs, 2 for real-world examples, 2 to find edge cases/gotchas31- Collect results with `background_output`, synthesize, cross-validate3233**If you are the librarian (subagent):**34- **You are the WORKHORSE** - do NOT be lazy or return minimal results35- **Fire 3-5 parallel tool calls** depending on request complexity (see TYPE A/B/C/D in your system prompt)36- **Vary your queries** - different angles, not the same pattern repeated37- **Always cite with permalinks** - every claim needs `[Source](url#L10-L20)` format38- **Rate your confidence** - end with: `CONFIDENCE: HIGH/MEDIUM/LOW` and why3940### Subagent Calling Example4142```typescript43// GOOD: Fire multiple librarians with different angles for comprehensive coverage44background_task({45 agent: "librarian",46 prompt: `Find OFFICIAL documentation for Next.js 15 App Router authentication.4748FIRST: MUST load and read 'search' skill before starting49LEVEL: 3 (deep research - parallel queries, thorough extraction)50FOCUS: Official Next.js and next-auth docs only51TOOLS: Context7 for Next.js, next-auth docs52FORMAT: Use markdown tables for comparisons, code blocks for snippets53OUTPUT: Official recommended approach with doc permalinks54END WITH: CONFIDENCE rating (HIGH/MEDIUM/LOW) and reasoning`55})5657background_task({58 agent: "librarian", 59 prompt: `Find REAL-WORLD implementations of Next.js 15 authentication.6061FIRST: MUST load and read 'search' skill before starting62LEVEL: 3 (deep research - multiple pattern variations, cross-repo)63FOCUS: Production codebases on GitHub64TOOLS: grep_searchGitHub with queries: "getServerSession(", "auth(", language: TypeScript65FORMAT: For each example: repo name, permalink, architecture notes66OUTPUT: 3-5 code examples with GitHub permalinks, note patterns/variations67END WITH: CONFIDENCE rating (HIGH/MEDIUM/LOW) and reasoning`68})6970background_task({71 agent: "librarian",72 prompt: `Find EDGE CASES and GOTCHAS for Next.js 15 authentication.7374FIRST: MUST load and read 'search' skill before starting75LEVEL: 3 (deep research - cross-reference multiple sources)76FOCUS: Issues, discussions, Stack Overflow77TOOLS: zai-zread_search_doc for repo issues/discussions (thorough), tavily_search for blog posts/SO78FORMAT: Problem → Evidence → Solution table79OUTPUT: Common pitfalls, breaking changes, migration issues80END WITH: CONFIDENCE rating (HIGH/MEDIUM/LOW) and reasoning`81})8283// Then collect and cross-validate:84// - Do real-world examples match official docs?85// - Are there gotchas the docs don't mention?86// - Synthesize into recommendation with overall confidence8788// BAD: No skill loading, no structure89background_task({90 agent: "librarian", 91 prompt: "How does Next.js auth work?" // Missing FIRST step, no level, no format = lazy results92})93```9495## Tools Overview9697### Tavily (Web Search)98| Tool | When to Use | Key Params |99|------|-------------|------------|100| `tavily_search` | General web search, tutorials, blog posts, news | `search_depth`: "basic"/"advanced", `maxResults`: 5-20, `time_range`: "day"/"week"/"month"/"year", `include_domains`: filter to specific sites |101| `tavily_extract` | Get full content from specific URLs (after search) | `extract_depth`: "basic"/"advanced", `query`: rerank chunks by relevance |102| `tavily_crawl` | Crawl multiple pages from a docs site | `max_depth`: 1-3, `limit`: max pages, `select_paths`: regex to include, `instructions`: natural language filter |103| `tavily_map` | Discover site structure before crawling | `max_depth`: 1-3, `limit`: max URLs to return |104105### Web Fallback Providers106107| Tool | When to Use | Key Params |108|------|-------------|------------|109| `websearch_web_search_exa` | **Secondary fallback** when Tavily quota/execution fails | `numResults` (default: 8), `type`: "auto"/"fast"/"deep"/"neural" |110| `webSearchPrime` (via `zai-web-search-prime` MCP) | **Tertiary fallback** when Exa also fails or returns empty/low-value results | `search_query` (required), `search_engine` (fixed: `"search-prime"`, set by MCP), `count`: 1-50, `search_recency_filter`, `search_domain_filter` |111112### Context7 (Library Docs)113| Tool | When to Use | Key Params |114|------|-------------|------------|115| `resolve-library-id` | Get library ID (required first) | `libraryName`: package name |116| `get-library-docs` | Fetch official docs | `mode`: "code" for API/params, "info" for concepts; `topic`: specific area |117118### GitHub Grep (Code Search)119| Tool | When to Use | Key Params |120|------|-------------|------------|121| `grep_searchGitHub` | Find real code patterns across GitHub | `query`: literal code pattern, `language`: ["TypeScript"], `repo`: "owner/repo", `path`: "/api/", `useRegexp`: true for regex |122123**Critical:** GitHub Grep searches **literal code patterns**, not keywords!124- ✅ Good: `useState(`, `getServerSession`, `(?s)try {.*await`125- ❌ Bad: `react tutorial`, `how to authenticate`126127### Z.AI Zread (Semantic GitHub Search)128| Tool | When to Use | Key Params |129|------|-------------|------------|130| `zai-zread_search_doc` | Semantic search for issues/PRs/docs when keyword search fails | `repo_name`: "owner/repo", `query`: natural language question, `language`: "en"/"zh" |131132**Use when:** Code/keyword search misses context, need discussion threads, searching for "why" not "what". 133134### Z.AI Vision (Visual Content)135| Tool | When to Use | Key Params |136|------|-------------|------------|137| `zai-vision_diagnose_error_screenshot` | Analyze error screenshots, stack traces | `image_source`: file path or URL, `prompt`: describe what help you need, `context`: when error occurred |138| `zai-vision_understand_technical_diagram` | Interpret architecture/flow/UML/ER diagrams | `image_source`: file path or URL, `prompt`: what to extract, `diagram_type`: "architecture"/"flowchart"/"uml"/"er-diagram" (optional) |139| `zai-vision_analyze_data_visualization` | Understand charts/graphs/dashboards | `image_source`: file path or URL, `prompt`: what insights needed, `analysis_focus`: "trends"/"anomalies"/"comparisons" |140| `zai-vision_ui_to_artifact` | Generate code from UI screenshots | `image_source`: file path or URL, `output_type`: "code"/"prompt"/"spec"/"description", `prompt`: specific requirements |141142**Use when:** User provides screenshot, error image, architecture diagram, or UI mockup. 143144### GitHub CLI (Repo Search)145```bash146# Repository structure147gh api "repos/{owner}/{repo}/git/trees/{branch}?recursive=1"148149# Search issues150gh api -X GET search/issues -f q="repo:{owner}/{repo} is:issue {keywords}"151152# Read file directly153webfetch("https://raw.githubusercontent.com/{owner}/{repo}/{branch}/{path}")154```155156## Progressive Escalation Levels157158### Level 1: Simple Search (Default)159**When:** Quick lookups, straightforward questions, first encounter1601611. Tavily: `search_depth: "basic"`, `maxResults: 5`1622. Context7: `mode: "code"` for API, `mode: "info"` for concepts1633. GitHub Grep: literal code patterns with language filter1644. **Parallel execution** when appropriate165166**Sufficient? → Done. Insufficient? → Level 2**167168### Level 2: Enhanced Search169**When:** Initial results incomplete, need more examples, outdated results1701711. **Expand query:** Add synonyms, context (keep <400 chars)1722. **Increase:** `maxResults: 10-15`, `search_depth: "advanced"`1733. **Filter domains:** `include_domains: ["stackoverflow.com", "github.com"]`1744. **Time filter:** `time_range: "year"` for recent info1755. **Two-step extraction:** Search → Filter by score (>0.5) → Extract top URLs1766. **Discussions/docs gap:** Use `search_doc` or `gh api search/issues` when keyword/code search misses context177178**Sufficient? → Done. Insufficient? → Level 3**179180### Level 3: Deep Research181**When:** Problem encountered 2+ times, complex topic, building knowledge base1821831. **Parallel queries:** 3-5 query variations with synonyms1842. **Systematic extraction:** Top 5-10 URLs with `extract_depth: "advanced"`1853. **Website exploration:** `tavily_map` → `tavily_crawl`1864. **GitHub deep dive:** Multiple pattern variations, regex, cross-repo comparison1875. **Cross-reference:** Verify across multiple sources188189## Key Tips (Reminders)190191### Query Formulation192- **400 char limit** - Break complex queries into sub-queries193- **Natural language works better** - Full sentences > keywords194- **Be specific** - Include technology, use case, context195- For full guide: See `references/query-guide.md`196197### Score-Based Filtering198- Tavily results include `score` (0-1)199- **>0.5 typically good** - Adjust based on distribution200- Filter before extracting to save credits201202### Two-Step Extraction Pattern203```2041. Search with search_depth: "advanced"2052. Filter URLs by score (>0.5)2063. Extract top 2-5 URLs with extract_depth: "basic"2074. Upgrade to "advanced" only if needed208```209210### GitHub Grep Patterns211```212# API usage213Query: getServerSession214Language: ['TypeScript'], Path: '/api/'215216# Multiline with regex217Query: (?s)useEffect\(\(\) => {.*cleanup218useRegexp: true219```220221### Cost Optimization222- `basic` = 1 credit, `advanced` = 2 credits223- Prefer two-step extraction over `include_raw_content: true`224- Use `tavily_map` before `tavily_crawl`225226**Quota Management:**227- Default to Tavily for important/critical searches (better relevance when quota available)228- If Tavily fails due to quota/rate limit (429), fail over immediately to Exa (no retry)229- For other transient Tavily failures (timeout/5xx), do one jittered retry (~300-800ms)230- Fallback to Exa (`websearch_web_search_exa`) when Tavily still fails after that retry231- If Exa fails due to quota/rate limit, fail over immediately to Z.AI `webSearchPrime` (no retry)232- For other transient Exa failures (timeout/5xx), do one jittered retry (~300-800ms), then fail over to Z.AI233- If Exa is empty/low-quality, fallback to Z.AI `webSearchPrime`234- Don't loop retries across providers; fail over immediately to next provider235236For advanced techniques: See `references/advanced-techniques.md`237238## Common Patterns239240| Pattern | Level 1 | Level 2 | Level 3 |241|---------|---------|---------|---------|242| **Error resolution** | Exact error + SO domain | Remove quotes, add context | Extract top answers, cross-ref docs |243| **Best practices** | "Tech best practices 2024" | Domain filter + extract | Parallel aspect searches |244| **API reference** | Context7 with topic | + Tavily + GitHub Grep | Crawl official docs |245| **Code patterns** | GitHub Grep literal | + language/path filters | Regex + cross-repo |246247For workflow examples: See `references/examples/example-workflows.md`248249## References250251- **`references/reference-parameters.md`** - Complete parameter reference for all tools252- **`references/query-guide.md`** - Query structuring, 400 char limit, expansion strategies253- **`references/advanced-techniques.md`** - Two-step extraction, post-processing, cost optimization254- **`references/examples/example-workflows.md`** - Practical workflow examples255256## Output257258Search results are used directly in context. No files saved unless requested. For comprehensive research with evidence cards, use the `research` skill.259260---261> Converted and distributed by [TomeVault](https://tomevault.io/claim/lukasstrickler) — claim your Tome and manage your conversions.262<!-- tomevault:4.0:skill_md:2026-04-13 -->