context7
SKILL.md
Context7
Use this skill to fetch current documentation through the Context7 CLI.
Workflow
- Resolve the library name to a Context7 library ID with
bunx ctx7 library. - Pick the best match:
- Prefer official docs and higher benchmark scores.
- If the top result looks wrong, inspect the next few entries before choosing.
- Use
--jsonwhen you want to filter results withjq.
- Fetch focused documentation with
bunx ctx7 docs <query>. - Answer from the retrieved docs, not from stale memory.
Commands
Search for a library
Use readable output when browsing candidates:
bunx ctx7 library react hooks
Use JSON output when you want to inspect fields or filter with jq:
bunx ctx7 library react hooks --json
The JSON array includes fields such as:
id: Context7 library ID to use withbunx ctx7 docstitle: Human-readable library namedescription: Summary of the library or docs sourcebenchmarkScore: Relevance/quality scoreversions: Available versions, when present
Fetch documentation
Use the chosen library ID and a task-focused query:
bunx ctx7 docs /facebook/react "useEffect examples"
Use JSON output when you need structured snippets:
bunx ctx7 docs /facebook/react "useEffect examples" --json
The JSON response includes:
codeSnippets: Code examples with titles, descriptions, languages, and code blocksinfoSnippets: Explanatory text snippets for the topic
Examples
React hooks documentation
# Find likely React library IDs
bunx ctx7 library react hooks
# Fetch current docs and examples
bunx ctx7 docs /facebook/react "useEffect examples"
Next.js routing documentation
# Search for the right Next.js docs source
bunx ctx7 library nextjs routing
# Fetch app router documentation
bunx ctx7 docs /vercel/next.js "app router"
FastAPI dependency injection
# Search for FastAPI docs
bunx ctx7 library fastapi dependencies
# Fetch dependency injection guidance
bunx ctx7 docs /fastapi/fastapi "dependency injection"
Tips
- Prefer
bunx ctx7 docsdefault output when you want readable text in the terminal. - Prefer
--jsonwhen you need to pipe intojqor inspect fields precisely. - Use specific queries such as
"server actions","dependency injection", or"useEffect cleanup"to improve relevance. - If a library has multiple plausible entries, prefer official docs over mirrors or secondary sources.
- If the user cares about a specific version, check whether
versionsare listed in the search results and choose the matching library entry.
Weekly Installs
2
Repository
baggiponte/skillsFirst Seen
Today
Security Audits
Installed on
amp2
cline2
opencode2
cursor2
kimi-cli2
codex2