Help us improve
Share bugs, ideas, or general feedback.
From research
A skill for retrieving the latest library documentation using Context7. Use when the user asks about how to use a library, requests code examples, or instructs to "use context7". Prevents hallucinations based on outdated training data and provides up-to-date API information.
npx claudepluginhub dotneet/claude-code-toolkit --plugin researchHow this skill is triggered — by the user, by Claude, or both
Slash command
/research:skills/context7The summary Claude sees in its skill listing — used to decide when to auto-load this skill
Context7 is a service that provides LLMs with the latest library documentation. It prevents hallucinations from outdated training data or non-existent APIs, enabling retrieval of version-specific accurate documentation and code examples.
Fetches up-to-date documentation from Context7 for libraries and frameworks like React, Next.js, Prisma. Use for setup questions, API references, and code examples.
Fetches current library documentation, API references, and code examples via Context7 REST API. Use for any library (React, Next.js, Vue, Django, etc.).
Fetches current library documentation via Context7 REST API for npm/PyPI packages. Use when the user needs official APIs, code examples, or migration guidance.
Share bugs, ideas, or general feedback.
Context7 is a service that provides LLMs with the latest library documentation. It prevents hallucinations from outdated training data or non-existent APIs, enabling retrieval of version-specific accurate documentation and code examples.
Use this skill in the following cases:
First, obtain the Context7 ID for the target library.
API call:
curl "https://context7.com/api/v2/libs/search?libraryName=LIBRARY_NAME&query=CONTEXT_QUERY" \
-H "Authorization: Bearer $CONTEXT7_API_KEY"
Example:
# Search for React library
curl "https://context7.com/api/v2/libs/search?libraryName=react&query=hooks" \
-H "Authorization: Bearer $CONTEXT7_API_KEY"
Criteria for selecting from response:
trustScore: Trust score (higher is better)totalSnippets: Number of available documents (more means richer information)versions: Verify that the required version is includedUse the resolved library ID to retrieve specific documentation.
API call:
curl "https://context7.com/api/v2/context?libraryId=LIBRARY_ID&query=SPECIFIC_QUERY" \
-H "Authorization: Bearer $CONTEXT7_API_KEY"
Example:
# Retrieve information about React's useEffect
curl "https://context7.com/api/v2/context?libraryId=/facebook/react&query=useEffect cleanup function" \
-H "Authorization: Bearer $CONTEXT7_API_KEY"
Query best practices:
Respond to the user's question based on the retrieved documentation.
Information to include in the response:
User: "How do I write a cleanup function with React's useEffect?"
Execution steps:
libraryName=react, query=useEffect cleanuplibraryId=/facebook/react, query=useEffect cleanup functionUser: "Use context7 to show me how to implement authentication middleware with Next.js App Router"
Execution steps:
libraryName=next.js, query=middleware authenticationlibraryId=/vercel/next.js, query=middleware authentication route protectionUser: "How to create a button component using TailwindCSS and shadcn/ui"
Execution steps:
| Error | Solution |
|---|---|
| 404 (Not Found) | Search again with a different library name (e.g., "nextjs" → "next.js") |
| 429 (Rate Limit) | Wait a moment and retry |
| Empty response | Retry with a more general query |
For detailed API specifications, see references/api_reference.md.