| name | description |
|---|---|
context7 |
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). |
Retrieves current, version-specific documentation for third-party libraries directly from official sources.
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
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.
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"Uses returned documentation to generate accurate, version-correct code.
- 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
See reference/troubleshooting.md for error handling, configuration, and common issues.