| name | Context7 Usage |
| description | This skill should be used when the user asks to "check documentation", "latest API", "library docs", "context7", or needs up-to-date library documentation. Provides Context7 MCP usage patterns. |
| version | 0.1.0 |
Provide patterns for effective use of Context7 MCP for retrieving up-to-date library documentation.
Resolve package name to Context7-compatible library ID
Library name to search for
Must call before get-library-docs unless ID is known
Returns list of matching libraries with IDs, trust scores, snippet counts
Fetch documentation for a specific library
Library ID from resolve-library-id
Optional topic to focus on (e.g., "hooks", "routing")
Max tokens to retrieve (default: 5000)
Retrieve up-to-date documentation snippets with code examples
Call resolve-library-id with library name
resolve-library-id libraryName="react"
Name similarity to query
Trust score (7-10 preferred)
Code snippet count (higher is better)
Description relevance
Call get-library-docs with selected ID
get-library-docs context7CompatibleLibraryID="/facebook/react" topic="hooks"
Common Context7-compatible library IDs for frequently used packages
React: /facebook/react
Next.js: /vercel/next.js
TypeScript: /microsoft/typescript
Node.js: /nodejs/node
Express: /expressjs/express
NixOS/nixpkgs: /nixos/nixpkgs
Home Manager: /nix-community/home-manager
Recommended token limits based on query type
Quick lookup (specific API/function): 2000-3000 tokens
Standard queries: 5000 tokens (default)
Comprehensive topics: 8000-10000 tokens
Use topic parameter to narrow documentation focus and reduce token usage
For authentication-related documentation
topic="authentication"
For React hooks documentation
topic="hooks"
For routing documentation
topic="routing"
Omit topic parameter for general overview and getting started documentation
get-library-docs context7CompatibleLibraryID="/facebook/react"
Use topic parameter with specific API names for focused reference documentation
For specific React hook
topic="useState"
For specific Next.js API
topic="getServerSideProps"
For specific TypeScript utility type
topic="Partial"
Verify codebase usage against latest documentation by combining Serena and Context7
1. Use Serena to find current library usage in codebase
find_symbol name_path_pattern="useState"
2. Use Context7 to get latest documentation
get-library-docs context7CompatibleLibraryID="/facebook/react" topic="useState"
3. Compare current usage with documented best practices
Plan dependency updates with API migration by checking latest documentation
1. Use Context7 to check latest API changes
get-library-docs context7CompatibleLibraryID="/vercel/next.js" topic="migration"
2. Use Serena to find all usages of changed APIs
find_referencing_symbols name_path="getStaticProps"
3. Plan migration based on documentation
<best_practices>
Always resolve library ID before fetching documentation
Prefer libraries with trust scores 7-10 for better documentation quality
Use specific topics to reduce token usage and increase relevance
Check snippet count as indicator of documentation completeness
Use versioned IDs when available for specific version documentation
</best_practices>
<anti_patterns>
Calling get-library-docs without resolving library ID first
Always call resolve-library-id to get the correct Context7-compatible library ID
Requesting maximum tokens for simple queries
Use specific topics and appropriate token limits (2000-3000 for quick lookups, 5000 for standard queries)
Using libraries with low trust scores or snippet counts
Prefer libraries with trust scores 7-10 and higher snippet counts for better documentation quality
Using incorrect or outdated library names (e.g., "react-query" vs "tanstack/query")
Try alternative names or broader search terms if library not found
Always resolve library ID before fetching documentation
Verify trust score is 7 or higher before using library documentation
Use specific topics to reduce token usage
Check snippet count for documentation quality indicators
Use versioned IDs when available for specific versions
Combine with Serena for codebase verification workflows