English | ็ฎไฝไธญๆ
๐ Automatically fetch the latest library and framework documentation for Claude Code, say goodbye to outdated training data!
Context7 Auto Research is an intelligent Claude Code skill that automatically fetches the latest documentation from Context7 when you ask questions about libraries, frameworks, or APIs. No manual invocation needed - it's fully automated!
- โจ Auto-Trigger: Automatically activates when library/framework questions are detected
- ๐ฏ Smart Matching: Automatically selects the best documentation source based on trust score and version
- ๐ Real-Time Docs: Fetches the latest documentation via Context7 (synced from GitHub and other sources)
- ๐ Wide Support: Supports thousands of open-source libraries including React, Next.js, Prisma, Tailwind, and more
- ๐๏ธ Efficient Architecture: Uses dual-skill architecture to reduce token consumption
- ๐ Bilingual Support: Supports both English and Chinese trigger keywords
Set up in 5 minutes
The easiest way to install this skill is using the add-skill tool:
# Install to Claude Code
npx add-skill BenedictKing/context7-auto-research
# Or install globally to all detected agents (Claude Code, Cursor, Codex, etc.)
npx add-skill BenedictKing/context7-auto-research -gThe skill will be automatically installed to ~/.claude/skills/context7-auto-research and loaded by Claude Code.
If you prefer manual installation or want to customize the setup:
# Clone to Claude Code's skills directory
git clone https://github.com/BenedictKing/context7-auto-research.git ~/.claude/skills/context7-auto-research
# Or clone to your preferred location
git clone https://github.com/BenedictKing/context7-auto-research.git
cd context7-auto-researchVisit context7.com/dashboard to register and get a free API key.
๐ก You can use this skill without an API key, but with lower rate limits.
Create a .env file in the skill directory:
cd .claude/skills/context7-auto-research
cp .env.example .envEdit the .env file and add your API key:
CONTEXT7_API_KEY=your_actual_api_key_hereVerify your configuration:
# Search for React library
node .claude/skills/context7-auto-research/context7-api.js search "react" "useEffect hook"
# Get Next.js documentation
node .claude/skills/context7-auto-research/context7-api.js context "/vercel/next.js" "middleware"If you see JSON responses, your setup is successful!
The skill activates automatically - no manual invocation needed. Just ask Claude:
You: How do I configure middleware in Next.js 15?
Claude will automatically:
- Detect "Next.js 15" and "configure middleware"
- Use Task tool to call context7-fetcher sub-skill to search for Next.js
- Select the best matching version (v15.x)
- Use Task tool to call context7-fetcher to fetch middleware documentation
- Integrate documentation and provide accurate answers with code examples
Architecture Benefits:
- Main skill understands your intent and context
- Sub-skill executes API calls independently (using
context: fork) - Reduces token consumption and improves response speed
The skill automatically activates when detecting these keywords:
Implementation Queries
- Chinese: ๅฆไฝๅฎ็ฐใๆไนๅใๆไนๅ
- English: How do I, How to, Show me how to
Configuration & Setup
- Chinese: ้ ็ฝฎใ่ฎพ็ฝฎใๅฎ่ฃ ใๅๅงๅ
- English: configure, setup, install, initialize
Documentation Requests
- Chinese: ๆๆกฃใๅ่ใAPIใๆฅ็
- English: documentation, docs, reference, look up
Library/Framework Mentions
- Frontend: React, Vue, Angular, Svelte, Solid
- Full-stack: Next.js, Nuxt, Remix, Astro
- Backend: Express, Fastify, Koa, Hono
- ORM: Prisma, Drizzle, TypeORM
- Services: Supabase, Firebase, Clerk
- UI: Tailwind, shadcn/ui, Radix
- Plus any npm package or GitHub repository
This project uses a two-stage architecture:
User Query โ Main Skill (context7-auto-research)
โ Detect triggers + Analyze intent
Task Tool โ Sub-Skill (context7-fetcher)
โ Search library (independent context)
Main Skill โ Return search results
โ Select best match
Task Tool โ Sub-Skill (context7-fetcher)
โ Fetch docs (independent context)
Main Skill โ Return documentation
โ Integrate and generate response
User โ Accurate answer + Code examples
Why this design?
| Aspect | Main Skill | Sub-Skill |
|---|---|---|
| Context | Full conversation | Fork (independent) |
| Purpose | Intent analysis | API execution |
| Token usage | Higher | Lower |
| Execution | Sequential | Can be parallel |
Benefits:
- Main skill needs to understand user intent (requires context)
- API calls don't need conversation history (avoids wasting tokens)
- Separation improves efficiency and reduces costs
A: Yes! The skill works without an API key, just with lower rate limits.
A: Place it at .claude/skills/context7-auto-research/.env
A: When you ask questions about libraries/frameworks, Claude will automatically call the script to fetch documentation. You'll see up-to-date, accurate information in the responses.
A: All open-source libraries with documentation on GitHub, including:
- React, Vue, Angular, Svelte
- Next.js, Nuxt, Remix
- Prisma, Drizzle, TypeORM
- Express, Fastify, Koa
- Supabase, Firebase
- Tailwind, shadcn/ui
- And many more...
A: Mention the version number in your question, for example:
How do I use the use hook in React 19?
Show me Next.js 15 middleware examples
You: What's new in React 19's useEffect?
Claude: [Automatically calls Context7 API]
According to the latest React 19 documentation...
[Provides accurate React 19 information]
You: How do I set up environment variables in Next.js 15?
Claude: [Automatically calls Context7 API]
In Next.js 15, environment variables are configured by...
[Provides latest configuration methods and code examples]
You: Show me how to define a many-to-many relation in Prisma
Claude: [Automatically calls Context7 API]
Here's how to define many-to-many relations in Prisma...
[Provides Prisma schema examples]
- Check .claude/skills/context7-auto-research/SKILL.md for technical details
- Check .claude/skills/context7-fetcher.md for sub-skill architecture
- Start asking questions and let Claude automatically fetch the latest documentation!
This project uses a two-stage architecture:
- Requires conversation context
- Detects trigger words and user intent
- Selects best matching library and version
- Integrates documentation into responses
- Runs independently using
context: fork - Purely executes API calls
- Doesn't carry conversation history
- Reduces token consumption
Why this design?
- Main skill needs to understand user intent (requires context)
- API calls don't need conversation history (wastes tokens)
- Separation improves efficiency and reduces costs
# Ensure script has execute permissions
chmod +x .claude/skills/context7-auto-research/context7-api.js
# Ensure Node.js is installed
node --version # Should display version numberCheck if API key is correctly configured:
# View .env file
cat .claude/skills/context7-auto-research/.env
# Ensure correct format
CONTEXT7_API_KEY=your_key_here # โ
Correct
CONTEXT7_API_KEY = your_key_here # โ Wrong (has spaces)Rate limit reached. Wait for some time or upgrade your API key quota.
๐ Setup complete! Now you can enjoy automatic documentation research!