home / skills / questnova502 / claude-skills-sync / context7
This skill retrieves up-to-date library documentation via Context7 to answer API questions, patterns, and code examples accurately.
npx playbooks add skill questnova502/claude-skills-sync --skill context7Review the files below or copy the command above to add this skill to your agents.
---
name: context7
description: "Fetch up-to-date library documentation via Context7 REST API. Use when needing current API docs, framework patterns, or code examples for any library. Lightweight alternative to Context7 MCP with no persistent context overhead. By Netresearch."
---
# Context7 Documentation Lookup Skill
Fetch current library documentation, API references, and code examples without MCP context overhead.
## When to Use This Skill
When the user asks about library APIs or framework patterns, use this skill to fetch current documentation.
When encountering import statements (`import`, `require`, `from`), use this skill to provide accurate API information.
When the user asks about specific library versions or "How do I use X library?", use this skill to get official patterns.
## Core Workflow
To answer questions about library documentation, follow these steps:
1. Search for the library ID using `scripts/context7.sh search`
2. Fetch documentation using `scripts/context7.sh docs`
3. Apply returned documentation to provide accurate, version-specific answers
## Running Scripts
### Searching for Libraries
To find a library ID for documentation lookup:
```bash
scripts/context7.sh search "library-name"
```
This returns library IDs in the format `/vendor/library` (e.g., `/facebook/react`).
### Fetching Documentation
To fetch documentation for a specific library:
```bash
scripts/context7.sh docs "<library-id>" "[topic]" "[mode]"
```
Parameters:
- `library-id` (required): From search result (e.g., `/facebook/react`)
- `topic` (optional): Focus area (e.g., `hooks`, `routing`, `authentication`)
- `mode` (optional): `code` for API references (default) or `info` for conceptual guides
### Examples
To get React hooks documentation:
```bash
scripts/context7.sh search "react"
scripts/context7.sh docs "/facebook/react" "hooks" "code"
```
To get Next.js routing guide:
```bash
scripts/context7.sh search "nextjs"
scripts/context7.sh docs "/vercel/next.js" "routing" "info"
```
## Documentation Modes
When fetching API references, examples, or code patterns, use `code` mode (default).
When fetching conceptual guides, tutorials, or explanations, use `info` mode.
## Environment Configuration
To use authenticated requests (optional), set the `CONTEXT7_API_KEY` environment variable:
```bash
export CONTEXT7_API_KEY="your-api-key"
```
---
> **Contributing:** https://github.com/netresearch/context7-skill
This skill fetches up-to-date library documentation, API references, and code examples via the Context7 REST API. It provides a lightweight, on-demand alternative to heavier documentation contexts by returning version-specific docs and patterns with minimal overhead. Use it when you need accurate, current information about a library or framework.
The skill searches for a library ID, then requests documentation for the chosen library and topic through Context7 endpoints. It supports two modes: 'code' for API references and examples, and 'info' for conceptual guides and tutorials. Optional API key support allows authenticated requests for protected or extended content.
Do I need an API key to use the skill?
No, many endpoints work without authentication, but set CONTEXT7_API_KEY for private or extended access.
What is the difference between 'code' and 'info' modes?
'Code' returns API references and example snippets; 'info' returns conceptual guides, tutorials, and higher-level explanations.