Agent skill
context7
Retrieve up-to-date documentation and code examples from Context7. Use when you need library/framework documentation or API examples.
Install this agent skill to your Project
npx add-skill https://github.com/MichaelFisher1997/opencode-config/tree/main/skill/context7
SKILL.md
Context7 Integration
Context7 is an MCP server that provides up-to-date documentation and code examples for programming libraries and frameworks.
When to Use Context7
Use Context7 when you need:
- Latest documentation for any programming library or framework
- Code examples and usage patterns
- API reference information
- Best practices for specific libraries
Before using Context7, you must:
- Call
context7_resolve-library-idto get the exact library ID - Then call
context7_query-docswith that library ID
Required Workflow
Step 1: Resolve Library ID
Use context7_resolve-library-id first:
context7_resolve-library-id({
libraryName: "react",
query: "How do I use React hooks?"
})
This returns the exact Context7-compatible library ID (e.g., /vercel/next.js/v14.3.0-canary.87).
Only skip this step if the user explicitly provides a library ID in the format /org/project or /org/project/version.
Step 2: Query Documentation
Use context7_query-docs with the resolved library ID:
context7_query-docs({
libraryId: "/vercel/next.js/v14.3.0-canary.87",
query: "How to implement server-side rendering with next 14?"
})
Important Rules
- NEVER use
context7_query-docswithout first callingcontext7_resolve-library-id(unless user provides library ID) - NEVER call these tools more than 3 times per question
- If you can't find what you need after 3 attempts, use the best information you have
- Don't include sensitive information (API keys, credentials, secrets) in queries
- Be specific and include relevant details in your query
Examples
Basic Example
# User asks: "How do I use React Query?"
1. Call context7_resolve-library-id:
- libraryName: "react-query"
- query: "How do I use React Query?"
2. Get result: /tanstack/react-query
3. Call context7_query-docs:
- libraryId: "/tanstack/react-query"
- query: "How do I use React Query? Include setup examples and basic usage patterns"
Version-Specific Example
# User asks: "What's new in Next.js 14?"
1. Call context7_resolve-library-id:
- libraryName: "next.js"
- query: "What's new in Next.js 14?"
2. Get result: /vercel/next.js/v14.3.0-canary.87
3. Call context7_query-docs:
- libraryId: "/vercel/next.js/v14.3.0-canary.87"
- query: "What's new in Next.js 14? List new features and breaking changes"
With User-Provided Library ID
# User asks: "Show me examples of /mongodb/docs aggregation"
1. Skip resolve-library-id (user provided ID)
2. Call context7_query-docs directly:
- libraryId: "/mongodb/docs"
- query: "Show me aggregation pipeline examples"
What Context7 Provides
- Code snippets
- API documentation
- Usage examples
- Best practices
- Version-specific information
- Multiple library versions (when available)
When NOT to Use Context7
Don't use Context7 for:
- Searching local codebase
- General web searches
- Running shell commands or local operations
- File operations (read/write files)
- Git operations
Keywords
Context7, documentation, library docs, API reference, code examples, framework documentation, react, next.js, mongodb, express, django, rails, programming libraries, npm packages
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
kernel
Remote browser automation using the Kernel CLI. Use when the agent needs to interact with cloud browsers for web automation, scraping, screenshots, or running browser-based tasks.
github
GitHub workflow best practices using gh CLI and git. Use when working with GitHub repositories, pull requests, issues, or GitHub interactions.
frontend-design
Create distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, artifacts, posters, or applications (examples include websites, landing pages, dashboards, React components, HTML/CSS layouts, or when styling/beautifying any web UI). Generates creative, polished code and UI design that avoids generic AI aesthetics.
convex
Umbrella skill for all Convex development patterns. Routes to specific skills like convex-functions, convex-realtime, convex-agents, etc.
edit-article
Edit and improve articles by restructuring sections, improving clarity, and tightening prose. Use when user wants to edit, revise, or improve an article draft.
handoff
Compact the current conversation into a handoff document for another agent to pick up.
Didn't find tool you were looking for?