
Context7
Pull current library and framework docs into the agent session instead of guessing from stale training data.
Overview
Context7 is an agent skill most often used in Build (also Validate, Ship) that retrieves current library documentation through the Context7 API.
Install
npx skills add https://github.com/intellectronica/agent-skills --skill context7What is this skill?
- Two-step workflow: search libs by name and topic, then fetch context by library ID
- curl + jq examples against Context7 v2 search and context endpoints
- Returns snippet counts, titles, and IDs for relevance-ranked doc retrieval
- Explicitly intended to replace outdated model knowledge for API usage
- Topic query parameter improves ranking for feature-specific lookups
- 2-step Context7 workflow: libs search then context fetch
- v2 API endpoints for search and context
Adoption & trust: 7.4k installs on skills.sh; 270 GitHub stars; 2/3 security scanners passed (skills.sh audits).
What problem does it solve?
You need trustworthy, current library docs and examples while coding, but the agent’s training data may be wrong or out of date.
Who is it for?
Solo builders shipping features against fast-moving JS, Python, or web frameworks who want doc-grounded agent answers.
Skip if: Teams that already embed full vendor docs in the repo or block outbound network calls from the agent sandbox.
When should I use this skill?
Looking up documentation for any programming library or framework, finding code examples, verifying library function usage, or obtaining current API information that may have changed since training.
What do I get? / Deliverables
The agent returns ranked library matches and fetched documentation snippets you can apply immediately in implementation or review.
- Ranked library search result
- Fetched documentation context payload for a library ID
Recommended Skills
Journey fit
Spans multiple journey phases - primary shelf plus alternate fits below.
Canonical shelf is Build → integrations because the skill wires the agent to the Context7 HTTP API during implementation work. Documentation lookup is an external service hook the agent invokes while integrating or coding against third-party libraries.
Where it fits
Compare two HTTP client libraries with topic-ranked Context7 snippets before committing to a stack.
Fetch current OAuth callback docs while wiring a third-party sign-in provider.
Confirm ORM migration APIs after a major version bump mentioned in release notes.
Double-check deprecated endpoint usage against live docs before tagging a release.
How it compares
Use instead of asking the model to recall API details from memory when you need version-accurate library behavior.
Common Questions / FAQ
Who is context7 for?
Context7 is for solo and indie developers using Claude Code, Cursor, Codex, or similar agents who integrate third-party libraries and need live documentation retrieval during coding sessions.
When should I use context7?
Use it when looking up documentation for any programming library or framework, finding code examples for specific APIs, verifying correct usage of library functions, or checking APIs that may have changed since model training—especially during Build integrations, Validate spikes,
Is context7 safe to install?
The skill instructs outbound HTTPS calls to context7.com; review the Security Audits panel on this Prism page and your agent’s network policy before enabling it in production environments.
SKILL.md
READMESKILL.md - Context7
# Context7 ## Overview This skill enables retrieval of current documentation for software libraries and components by querying the Context7 API via curl. Use it instead of relying on potentially outdated training data. ## Workflow ### Step 1: Search for the Library To find the Context7 library ID, query the search endpoint: ```bash curl -s "https://context7.com/api/v2/libs/search?libraryName=LIBRARY_NAME&query=TOPIC" | jq '.results[0]' ``` **Parameters:** - `libraryName` (required): The library name to search for (e.g., "react", "nextjs", "fastapi", "axios") - `query` (required): A description of the topic for relevance ranking **Response fields:** - `id`: Library identifier for the context endpoint (e.g., `/websites/react_dev_reference`) - `title`: Human-readable library name - `description`: Brief description of the library - `totalSnippets`: Number of documentation snippets available ### Step 2: Fetch Documentation To retrieve documentation, use the library ID from step 1: ```bash curl -s "https://context7.com/api/v2/context?libraryId=LIBRARY_ID&query=TOPIC&type=txt" ``` **Parameters:** - `libraryId` (required): The library ID from search results - `query` (required): The specific topic to retrieve documentation for - `type` (optional): Response format - `json` (default) or `txt` (plain text, more readable) ## Examples ### React hooks documentation ```bash # Find React library ID curl -s "https://context7.com/api/v2/libs/search?libraryName=react&query=hooks" | jq '.results[0].id' # Returns: "/websites/react_dev_reference" # Fetch useState documentation curl -s "https://context7.com/api/v2/context?libraryId=/websites/react_dev_reference&query=useState&type=txt" ``` ### Next.js routing documentation ```bash # Find Next.js library ID curl -s "https://context7.com/api/v2/libs/search?libraryName=nextjs&query=routing" | jq '.results[0].id' # Fetch app router documentation curl -s "https://context7.com/api/v2/context?libraryId=/vercel/next.js&query=app+router&type=txt" ``` ### FastAPI dependency injection ```bash # Find FastAPI library ID curl -s "https://context7.com/api/v2/libs/search?libraryName=fastapi&query=dependencies" | jq '.results[0].id' # Fetch dependency injection documentation curl -s "https://context7.com/api/v2/context?libraryId=/fastapi/fastapi&query=dependency+injection&type=txt" ``` ## Tips - Use `type=txt` for more readable output - Use `jq` to filter and format JSON responses - Be specific with the `query` parameter to improve relevance ranking - If the first search result is not correct, check additional results in the array - URL-encode query parameters containing spaces (use `+` or `%20`) - No API key is required for basic usage (rate-limited)