Fetches up-to-date third-party library documentation via the Context7 v2 REST API. Use when working with external packages and needing current API references, code examples, migration guides, or resolving package errors (stack traces, version mismatches, deprecated methods).
Install
npx skillscat add edxeth/superlight-context7-skill Install via the SkillsCat registry.
Context7 Documentation Lookup
Retrieves current, version-specific documentation for third-party libraries directly from official sources.
When to Use
ALWAYS invoke before writing code for external libraries when:
- Implementing unfamiliar library APIs
- Debugging errors from external packages (stack traces, "method not found")
- Checking version-specific syntax or breaking changes
- Verifying deprecated/removed APIs
- Encountering unfamiliar
import/requirestatements
Protocol
Step 1: Search for Library ID
scripts/context7.sh search "<library>" "<intent>"Example:
scripts/context7.sh search "tanstack-query" "optimistic updates"Output: Library IDs like /tanstack/query, /vercel/next.js
Disambiguation: If multiple similar results appear, ask user which library they meant.
Step 2: Fetch Documentation
scripts/context7.sh docs "<library-id>" "<specific-question>"Examples:
scripts/context7.sh docs "/vercel/next.js" "middleware redirect authentication"
scripts/context7.sh docs "/tanstack/query" "useMutation optimistic update pattern v5"Step 3: Apply Context
Uses returned documentation to generate accurate, version-correct code.
Critical Rules
- Specific queries win - "useState hook array destructuring" beats "react hooks"
- Include version - Append version to query if user mentions one
- No guessing - If search returns nothing, ask user before proceeding
- Only run context7.sh - Do not run other bash commands with this skill
Resources
See reference/troubleshooting.md for error handling, configuration, and common issues.