julianobarbosa/claude-code-skills/context7
Claude Code and agent skill by julianobarbosa/claude-code-skills
- community
Checking that the SKILL.md file is still in the repository.
Up-to-date, version-specific library documentation and working code examples sourced from real project repos via the Context7 documentation aggregation API — covers 1000+ libraries (React, Next.js, Vue, Kubernetes, Go, Python, TypeScript, Prisma, Tailwind, and more). USE WHEN looking up API signatures, framework docs, version-specific behavior, code examples, library configuration, migration guides, OR before writing code against a library you might be guessing about. NOT FOR refactoring existing code, debugging business logic, general programming concepts, or libraries Context7 doesn't index (use web search instead). Grounds answers in real source documentation to prevent hallucinated APIs.
Install
npx vskill@latest install julianobarbosa/claude-code-skills/context7SKILL.md
Context7
Query up-to-date, version-specific documentation and code examples directly from source libraries via Context7's documentation aggregation platform.
Why Context7
| Benefit | Description | |
|---|---|---|
| Current APIs | No hallucinated or outdated patterns - documentation comes from actual sources | |
| Version-Specific | Gets docs for exact library versions you're using | |
| Code Examples | Real, working code extracted from actual documentation | |
| Broad Coverage | 1000+ libraries including React, Next.js, Vue, Go, Python, Kubernetes, etc. |
Setup
Available CLI Tools
| Tool | Purpose | Short form (after bun link) | Long form | |
|---|---|---|---|---|
lookup | Resolve + query in one shot | c7-lookup <library> <query> | bun src/cli/lookup.ts <library> <query> | |
resolve | Find Context7 library ID | c7-resolve <library> [query] | bun src/cli/resolve.ts <library> [query] | |
query | Query docs by known ID | c7-query <library_id> <query> | bun src/cli/query.ts <library_id> <query> |
CLI Flags
All three CLIs accept the same flag set.
| Flag | Effect | |
|---|---|---|
--json | Emit JSON on stdout; suppress decorative output. Pipe to jq. | |
--quiet, -q | Suppress info/success logs (warn/error still print to stderr). | |
--no-cache | Skip the 24h disk cache (~/.cache/context7/resolved.json) for this call. | |
--clear-cache | Wipe the disk cache and exit. | |
--timeout <ms> | HTTP timeout in milliseconds. Default 30000. | |
--max-retries <n> | Retry budget for 429 Rate Limit responses (with Retry-After). Default 1. | |
--api-key <key> | Override CONTEXT7_API_KEY env var. | |
--version, -V | Print version and exit. | |
--help, -h | Print usage and exit. |
Quick Reference
Full Lookup (Recommended)
One command to resolve library and query documentation:
JSON output (for scripting / piping)
Step-by-Step (when needed)
Common Library IDs
| Library | Context7 ID | CLI Shortcut | |
|---|---|---|---|
| React | /facebook/react | react | |
| Next.js | /vercel/next.js | next.js, nextjs | |
| Vue | /vuejs/vue | vue | |
| Kubernetes | /kubernetes/kubernetes | kubernetes, k8s | |
| Go stdlib | /golang/go | go, golang | |
| Python | /python/cpython | python | |
| Node.js | /nodejs/node | node, nodejs | |
| TypeScript | /microsoft/typescript | typescript, ts | |
| Prisma | /prisma/prisma | prisma | |
| Tailwind | /tailwindlabs/tailwindcss | tailwind, tailwindcss |
Workflow Routing
| Workflow | Trigger | File | |
|---|---|---|---|
| ResolveLibrary | "find library ID", "resolve library" | Workflows/ResolveLibrary.md | |
| QueryDocs | "lookup docs", "get documentation", "code examples" | Workflows/QueryDocs.md | |
| FullLookup | "help me with [library]", "how do I use [feature]" | Workflows/FullLookup.md |
Gotchas
These are real Context7 API behaviors that bite if you don't know about them. Add to this list whenever a query goes wrong in a way that wasn't already documented.
- Library ID requires a leading slash.
/facebook/reactworks;facebook/reactfails with a cryptic "library not found." The error doesn't tell you the slash is missing. - The resolver is fuzzy and ranked, not deterministic.
resolve.ts <name>returns multiple candidates ordered by an LLM-powered ranker that takes your optional context query into account. A narrow context can promote a less-canonical fork above the official repo. Always inspect the top match before passing the ID toquery.ts. - Version pinning matters at major boundaries. Library IDs may include a version segment:
/vercel/next.js/14.2.0. The bare ID resolves to whatever Context7 currently treats as "latest stable," which can lag behind real releases — asking about Next.js "app router" without a pin can return Next 13 docs. Pin the version when the framework changed shape across majors. - Public rate limits are tight. Without
CONTEXT7_API_KEY, you'll hit limits in fewer queries than you expect. The "max 3 calls per question" tip in this skill is a defensive ceiling on Claude's behavior — it is not the real API budget. Set the API key fromcontext7.com/dashboardfor any sustained use. - Snippet truncation is silent. Long doc pages return excerpts, not full content. If a returned example references a function or symbol the snippet didn't define, do NOT guess what it does — re-query with a tighter, more specific question rather than fabricating the missing piece.
- The known-IDs cache can go stale. Common libraries (
react,next.js,kubernetes, etc.) shortcut to hardcoded IDs inTools/src/lib/context7.tsand skip the resolver entirely. If an upstream project renames its repo or moves orgs, the cached ID becomes wrong and queries silently miss. To force a fresh resolve, use an alias the cache doesn't know or pass--no-cache.
Common Errors
The CLIs use typed exit codes so callers (Claude included) can distinguish failure categories without parsing strings.
| Exit | Kind | Cause | Recovery | |
|---|---|---|---|---|
3 | auth | 401 — bad or missing CONTEXT7_API_KEY | Set the env var from context7.com/dashboard or pass --api-key <key>. | |
4 | not_found | 404 — library or doc path missing; or malformed ID (missing leading /) | Run c7-resolve <name> to get a valid ID; check the /org/project shape. | |
5 | rate_limit | 429 — public rate limit hit; auto-retries once if Retry-After is present | Set CONTEXT7_API_KEY for higher limits, or raise --max-retries. | |
6 | server | 5xx — transient Context7 server error | Wait briefly and retry. | |
7 | timeout | 408 — request aborted by client timeout | Raise --timeout (e.g. --timeout 60000) or check network. | |
2 | (arg) | Unknown flag, bad value, missing required flag arg | Run --help. | |
1 | (other) | Anything else, including 0-status network errors | Check stderr message; retry. |
Errors always print Error: <message> and a Hint: <remediation> line to stderr. With --json, stdout stays clean and parseable; stderr keeps the human-readable error.
Examples
Example 1: React Hooks Documentation
Output includes current React docs with cleanup pattern examples.
Example 2: Kubernetes Deployment Spec
Output includes current K8s API reference for Deployment.
Example 3: Next.js App Router
Output includes latest Next.js middleware documentation.
Example 4: Using in Claude Code Session
When you need documentation during a coding session:
Environment Variables
| Variable | Description | Default | |
|---|---|---|---|
CONTEXT7_API_KEY | API key for higher rate limits | None (uses public rate limits) |
Get your API key at context7.com/dashboard
Tips
- Be specific in your query for better results
- Max 3 calls per question - if you can't find it after 3 tries, use best available info
- Include version in query if you need specific version docs (e.g., "React 18 concurrent features")
- Combine with local context - use Context7 to verify APIs, then apply to your codebase
- Known IDs skip API - common libraries like
react,next.jsuse cached IDs to skip the resolve step
Project Structure
API Reference
The TypeScript client can also be imported programmatically:
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/context7/SKILL.md
Popularity
- Repository stars
- 84
- Repository forks
- 18
- 7-day trend score
- 22
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/julianobarbosa/claude-code-skills/context7)