Use when adding new error messages to React, or seeing "unknown error code" warnings.
npx skills add jeric-n/context7-skill --skill "context7-skill"
Install specific skill from multi-skill repository
# Description
Fetch up-to-date documentation for any library using the Context7 API. Use when the user needs accurate, current docs for a framework, library, or SDK (e.g., React, Next.js, Langchain). Two-step process: first search for the library, then fetch context.
# SKILL.md
name: context7-skill
description: Fetch up-to-date documentation for any library using the Context7 API. Use when the user needs accurate, current docs for a framework, library, or SDK (e.g., React, Next.js, Langchain). Two-step process: first search for the library, then fetch context.
license: MIT
Context7 Documentation Fetcher
Retrieves accurate, up-to-date documentation from Context7 for any library or framework.
When to Use
- User asks about a specific library's API or usage
- You need current documentation (your training data may be outdated)
- User mentions a framework like React, Next.js, Vue, Langchain, etc.
Prerequisites
Ensure CONTEXT7_API_KEY environment variable is set.
Workflow
Step 1: Search for the Library
Find the library ID by searching. Replace <skill-dir> with the path to where this skill is installed:
- Project-wide: .gemini/skills/context7-skill or .opencode/skills/context7-skill
- Global: ~/.gemini/skills/context7-skill or ~/.config/opencode/skills/context7-skill
node <skill-dir>/scripts/index.js search "<library-name>" "<your-question>"
Example (global install):
node ~/.gemini/skills/context7-skill/scripts/index.js search "react" "hooks"
This returns matching libraries with their IDs (e.g., /facebook/react).
Step 2: Fetch Documentation Context
Use the library ID to get relevant documentation:
node <skill-dir>/scripts/index.js context "<library-id>" "<your-question>"
Example (global install):
node ~/.gemini/skills/context7-skill/scripts/index.js context "/facebook/react" "how to use useState hook"
Tips
- Be specific with your query to get more relevant results
- Use the exact library ID from the search results
- If results seem outdated, try a more specific version like
/vercel/next.js/v15.1.8
# Supported AI Coding Agents
This skill is compatible with the SKILL.md standard and works with all major AI coding agents:
Learn more about the SKILL.md standard and how to use these skills with your preferred AI coding agent.