| name | research |
| description | 深度研究技术问题和代码库。使用 GitHub 代码搜索查找真实代码示例,使用 Exa 获取官方文档和最新网络内容。当需要查找代码模式、API 文档、最佳实践或解决技术问题时使用此技能。 |
Research Skill
深度研究技术问题的专业技能工具集。
可用工具
searchGitHub
Search GitHub repositories for actual code patterns.
Basic Usage
CRITICAL: Search for literal code, not keywords.
✅ Good queries:
query: "useState("
language: ["TypeScript", "TSX"]
query: "(?s)try {.*await"
useRegexp: true
language: ["TypeScript"]
query: "betterAuth({"
language: ["TypeScript"]
❌ Bad queries:
query: "react hooks tutorial"
query: "best practices"
query: "how to use useState"
Advanced Usage
1. Regex for flexible patterns
{
query: "(?s)useState\\(.*loading",
useRegexp: true,
language: ["TSX"]
}
Note: Prefix with (?s) to match across multiple lines.
2. Filter by repository
{
query: "getServerSession",
repo: "vercel/",
language: ["TypeScript"]
}
3. Filter by file path
{
query: "export default {",
path: "next.config.js",
}
4. Case sensitivity
{
query: "CORS(",
matchCase: true,
language: ["Python"]
}
Hidden Tricks
Trick 1: Find specific library usage in popular projects
{
query: "figma: {",
repo: "better-auth/",
language: ["TypeScript"]
}
Trick 2: Search for error handling patterns
{
query: "(?s)try {.*catch.*error",
useRegexp: true,
language: ["TypeScript"]
}
Trick 3: Find configuration patterns
{
query: "export default {",
path: "*.config.ts",
}
Trick 4: Find how others handle edge cases
{
query: "if (!data)",
language: ["TypeScript"],
repo: "vercel/"
}
Watch Out For
⚠️ Pitfall 1: Using keywords instead of code
- Don't search for "react hooks best practices"
- Search for
"useState(" instead
⚠️ Pitfall 2: Forgetting regex anchors
- Use
(?s) for multiline matching
- Escape special chars:
\\{ not {
⚠️ Pitfall 3: Too broad search
"export" will return millions of results
- Be specific:
"export const auth ="
⚠️ Pitfall 4: Ignoring language filter
- Always specify language to reduce noise
- Use
["TypeScript", "TSX"] for React projects
get_code_context_exa
Get official documentation and high-quality examples for libraries/APIs.
Basic Usage
✅ Good queries:
{
query: "Next.js 15 server actions best practices",
tokensNum: 5000
}
{
query: "Better Auth Figma OAuth integration guide",
tokensNum: 3000
}
{
query: "Drizzle ORM PostgreSQL schema migration",
tokensNum: 8000
}
Advanced Usage
1. Adjust token count based on depth
{ query: "React useEffect cleanup", tokensNum: 2000 }
{ query: "Next.js 15 full authentication flow", tokensNum: 8000 }
{ query: "Stripe webhook handling complete guide", tokensNum: 20000 }
2. Include version/year for latest docs
{
query: "Next.js 15 2025 app router",
tokensNum: 5000
}
3. Focus on specific aspects
{
query: "React hooks performance optimization patterns",
tokensNum: 5000
}
Hidden Tricks
Trick 1: Compare official docs across versions
{ query: "Next.js 14 server components", tokensNum: 3000 }
{ query: "Next.js 15 server components", tokensNum: 3000 }
Trick 2: Get migration guides
{
query: "migrate from Next.js 14 to 15 breaking changes",
tokensNum: 8000
}
Trick 3: Find official examples
{
query: "Vercel Next.js 15 official examples repository",
tokensNum: 5000
}
Watch Out For
⚠️ Pitfall 1: Too generic queries
- "React" → Too broad
- "React Server Components rendering patterns 2025" → Specific
⚠️ Pitfall 2: Wrong token count
- Too low (< 2000): May miss critical details
- Too high (> 20000): Wastes time and tokens
- Default 5000 is usually good
⚠️ Pitfall 3: Outdated docs
- ALWAYS include year: "2025" or "latest"
- Check account for "Today's date" in context
web_search_exa
Real-time web search for articles, blog posts, discussions.
Basic Usage
✅ Good use cases:
{
query: "Next.js 15 performance improvements 2025",
numResults: 8
}
{
query: "Drizzle vs Prisma 2025 comparison",
numResults: 5
}
{
query: "Better Auth 2.0 release notes",
numResults: 3
}
Advanced Usage
1. Adjust result count
{ query: "React 19 new features", numResults: 3 }
{ query: "Next.js deployment best practices", numResults: 10 }
2. Search type
{ query: "...", type: "fast" }
{ query: "...", type: "deep" }
{ query: "...", type: "auto" }
3. Livecrawl for latest content
{
query: "Next.js 15 RC release notes",
livecrawl: "preferred",
numResults: 3
}
Hidden Tricks
Trick 1: Find GitHub discussions
{
query: "site:github.com better-auth figma OAuth issue",
numResults: 5
}
Trick 2: Official docs only
{
query: "site:nextjs.org server actions",
numResults: 3
}
Trick 3: Find real-world war stories
{
query: "debugging Next.js server actions production",
type: "deep",
numResults: 8
}
Watch Out For
⚠️ Pitfall 1: Generic queries
- "Next.js tutorial" → Low quality
- "Next.js 15 server actions error handling patterns" → High quality
⚠️ Pitfall 2: Too many results
-
10 results is usually noise
- 3-5 results is often enough
⚠️ Pitfall 3: Not using site: filter
- Use
site: to focus on authoritative sources
Token/Result Guidelines
searchGitHub
- No limit on results, but first 10-20 are usually enough
- Use specific queries to reduce noise
get_code_context_exa
| Use Case | Tokens |
|---|
| Quick API reference | 1000-3000 |
| Comprehensive guide | 5000-10000 |
| Deep documentation | 15000-30000 |
| Exhaustive research | 30000-50000 |
web_search_exa
| Use Case | Results |
|---|
| Quick fact check | 1-3 |
| Standard research | 5-8 |
| Comprehensive | 8-10 |
| Avoid > 10 | Too noisy |
Common Patterns
Pattern 1: "How do I use X?"
get_code_context_exa: Get official docs (5000 tokens)
searchGitHub: Find real usage (3-5 examples)
web_search_exa: Find best practices (5 results)
Pattern 2: "Why is X not working?"
web_search_exa: Search exact error (deep, 5 results)
searchGitHub: Find how others fixed it (regex search)
get_code_context_exa: Check official troubleshooting (3000 tokens)
Pattern 3: "X vs Y?"
web_search_exa: Find comparisons (8 results)
searchGitHub: Check real adoption (compare result counts)
get_code_context_exa: Read both official docs (5000 tokens each)
Pattern 4: "Latest version of X?"
get_code_context_exa: "X 2025 latest docs" (5000 tokens)
web_search_exa: "X release notes" (livecrawl: preferred, 3 results)
searchGitHub: Find recent usage patterns
Quick Troubleshooting
No results from searchGitHub?
- Check: Are you using code, not keywords?
- Try: Simplify your query
- Example:
"useState(" not "react useState hook"
Outdated docs from get_code_context_exa?
- Check: Did you include year in query?
- Try: Add "2025" or "latest" to query
Too many irrelevant results from web_search_exa?
- Check: Is query too generic?
- Try: Use
site: filter for authoritative sources
- Reduce: numResults to 3-5