context7
Context7
Use Context7 for version-specific docs and code examples. Prefer direct HTTP via curl
Required shell helper
Source the bash helper from this skill once per shell:
source "${SKILLS_DIR:-skills}/context7/scripts/context7.sh"
If SKILLS_DIR is unavailable, source the same file from your local skills/ checkout.
Then use context7 <subcommand> everywhere below.
Credential check policy: do not stop at echo $CONTEXT7_API_KEY in the parent shell. Always run the documented helper entrypoint first; it auto-loads a skill-local .env using the lookup order below. The API key is optional for basic usage, so only report a credential problem if the real command still fails or the user specifically needs higher-rate access.
Workflow
- If you do not know the library ID, search first.
- Inspect the top matches by
title,description, andtotalSnippets. - Fetch docs with
context7 docs <library-id> <query>. - Use
context7 json ...only when structured parsing is needed.
Quick start
# Find likely matches
context7 search react "hooks useState" \
| jq '.results[:5] | map({id, title, description, totalSnippets})'
# Grab the top library ID directly
context7 id react "hooks useState"
# Fetch readable docs
context7 docs /vercel/next.js "app router server actions"
# Fetch structured JSON when you need metadata/snippets
context7 json /fastapi/fastapi "dependency injection"
Credentials
- API key is optional but recommended for higher rate limits.
- Keep
.envbeside this skill. - Helper lookup order:
CONTEXT7_ENV_FILE$SKILLS_DIR/context7/.env- nearest ancestor
skills/context7/.env
- Tracked template:
.env.example - Header used when present:
CONTEXT7_API_KEY: <key>
Notes
- If you already know the library ID (
/org/project,/org/project/version, or/websites/...), skip search. - Prefer exact title/source matches; use higher
totalSnippetsas a tiebreaker, not the only signal. docsusestype=txtbecause it is easier to read in agent output.- Public endpoint works without an API key for basic usage; expect lower rate limits.
- Override
CONTEXT7_BASE_URLif you need to point at a different host. - The shell helper uses
--data-urlencodeto avoid broken queries from spaces or special characters. idusesjq; ifjqis unavailable, inspectsearchoutput manually.
Common examples
# React hooks
context7 id react "hooks useState"
context7 docs /websites/react_dev "useState"
# Next.js routing
context7 id nextjs "routing app router"
context7 docs /vercel/next.js "app router"
# FastAPI dependencies
context7 id fastapi "dependencies dependency injection"
context7 docs /fastapi/fastapi "dependency injection"
Validation
./scripts/test-context7-http.sh
Query templates
See assets/query-templates.json.
More from anntnzrb/agents
golang
Develop Go (Golang) applications using modern patterns, popular libraries, and idiomatic design. Activate when working with .go files, go.mod, go.sum, or user mentions Go, Golang, goroutines, channels, or Go libraries like gin, cobra, gorm.
17gleam
Develop with Gleam using idiomatic patterns, TDD, and type-driven design. Activate when working with .gleam files, gleam.toml, or user mentions Gleam, BEAM, or Erlang.
16agent-browser
Browser automation CLI for AI agents. Use when the user needs to interact with websites, including navigating pages, filling forms, clicking buttons, taking screenshots, extracting data, testing web apps, or automating any browser task. Triggers include requests to "open a website", "fill out a form", "click a button", "take a screenshot", "scrape data from a page", "test this web app", "login to a site", "automate browser actions", or any task requiring programmatic web interaction.
15ast-grep
Read-only structural code search with ast-grep/sg. Grep/rg/sed alternative for AST-aware CLI exploration, pattern search, and fast code discovery. Activates on ast-grep/sg, structural search, AST search, find usages, tree-sitter.
14summarize
Operate `@steipete/summarize` end-to-end via `bun x @steipete/summarize` for URL/file/media summarization, extract-only output, YouTube transcript and slide workflows, model/language/length tuning, CLI-backend routing (`--cli`), cache/config management, and `refresh-free` model maintenance. Use when users ask to summarize or extract content, transcribe audio/video, run slide extraction, tune summarize config/env keys, or troubleshoot summarize command failures.
14python
Develop Python applications using modern patterns, uv, functional-first design, and production-first practices. Use this whenever working with .py files, pyproject.toml, uv commands, pip/pip3, poetry, virtualenv/venv, inline script metadata, or Python tooling like pytest, mypy, ruff, asyncio, itertools, functools, or dataclasses. If the task involves running Python, managing Python dependencies, creating environments, or building Python packages, load this skill and prefer uv-oriented workflows.
13