context7
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.
More from baggiponte/skills
codebase-librarian
Create a comprehensive inventory of a codebase. Map structure, entry points, services, infrastructure, domain models, and data flows. Pure documentation—no opinions or recommendations. Use when onboarding to an unfamiliar codebase, documenting existing architecture before changes, preparing for architecture reviews or migration planning, or creating a reference for the team. Triggers on requests like "map this codebase", "document the architecture", "create an inventory", or "what does this codebase contain".
20code-refactor
Systematic refactoring of codebase components through a structured 3-phase process. Use when asked to refactor, restructure, or improve specific components, modules, or areas of code. Produces research documentation, change proposals with code samples, and test plans. Triggers on requests like "refactor the authentication module", "restructure the data layer", "improve the API handlers", or "clean up the payment service".
12architecture-design-critique
Perform a codebase-wide architectural review through a Ports & Adapters (hexagonal architecture) lens. Assess boundary violations, coupling issues, and dependency direction. Produces a prioritized improvement roadmap. Use when reviewing architecture for testability/portability, assessing technical debt, planning refactoring efforts, or evaluating codebase health. Triggers on requests like "review the architecture", "assess coupling", "hexagonal analysis", "check boundary violations", or "architecture critique".
9build-python-dockerfiles
Build production-ready Dockerfiles for Python projects that use uv. Use when creating or refactoring Dockerfiles for reproducible installs, cache-efficient builds, bytecode compilation, small runtime images, and non-root execution. Follows the production patterns from Hynek Schlawack's article "Production-ready Python Docker Containers with uv" while staying flexible about base images and app type. Supports packaged and unpackaged applications, including web apps, workers, and CLI services. Triggers on requests like "write a Dockerfile for this Python project", "optimize this uv Dockerfile", "containerize this FastAPI/Django/Flask app", "containerize this worker", or "split this into build and runtime stages".
3oracle
Submit an implementation plan to GPT 5.2-xhigh for review by a senior engineer persona. The Oracle provides direct, honest critique focused on simplicity and pragmatic excellence. Use when you have a detailed implementation plan and want a second opinion before coding. Triggers on "review my plan", "get Oracle feedback", "consult the Oracle", "plan review", or when you want senior engineer critique on an implementation approach.
2spark-context-curator
Ultra-fast, read-only codebase exploration and context curation for GPT-5.3 Codex Spark. Use when you need deep repository understanding without modifying anything: architecture mapping, flow tracing, ownership discovery, incident/code-review prep, or implementation planning. Triggers on requests like \"explore this codebase\", \"curate context\", \"map where X happens\", \"investigate before editing\", or \"read-only deep dive\".
2