lookup
Looks up current library documentation, API references and code examples through Context7 (ctx7 CLI or the Context7 MCP server). Use when: 'look up the docs for X', 'how do I migrate to X v2', or whenever a question names a library, framework, SDK, CLI tool, or cloud service, including API syntax, configuration, setup, and version-migration questions. The update action checks the CLI and upstream skill content for drift. For CLI/MCP setup, auth, and Windows gotchas, run /context7:setup.
- License 许可
- MIT
- 最近更新
- 2026-11-15
- Stars
- ★ 30
- Forks
- 7
01 前言 Front Matter
- shell
- bash
- metadata
- { "synced": 1793664000000, "summary": "Look up current library docs, API references, and examples via Context7", "workflow-stage": "research", "upstream-version": "upstash/context7@ceaf5f91f48949eaa6e4da5e66f3f59d1b44556d" }
- description
- Looks up current library documentation, API references and code examples through Context7 (ctx7 CLI or the Context7 MCP server). Use when: 'look up the docs for X', 'how do I migrate to X v2', or whenever a question names a library, framework, SDK, CLI tool, or cloud service, including API syntax, configuration, setup, and version-migration questions. The update action checks the CLI and upstream skill content for drift. For CLI/MCP setup, auth, and Windows gotchas, run /context7:setup.
- allowed-tools
- [ "Bash(ctx7 --version*)" ]
- argument-hint
- [lookup <library> <query>|update]
- user-invocable
- true
- disable-model-invocation
- false
02 资源文件 6
- 参考文档context/cli.md7.6 KB
- 参考文档context/lookup.md6.1 KB
- 参考文档context/mcp.md4.3 KB
- 参考文档context/update.md5.1 KB
- 脚本scripts/update.sh8.4 KB
- 脚本scripts/update.test.sh5.3 KB
03 SKILL.md 正文
Arguments. [lookup <library> <query>|update]. A bare argument is lookup, e.g. /context7:lookup react "useEffect cleanup".
Pre-computed context
Installed CLI version: !ctx7 --version 2>/dev/null || echo "not installed (run: npm install -g ctx7@latest)"
MCP availability: if mcp__context7__resolve-library-id and mcp__context7__query-docs are in your tool list, the MCP path is configured.
Actions
| Action | When | Loads |
|---|---|---|
lookup <library> <query> (default) |
A question about a library | context/lookup.md: query writing, result selection, version-specific IDs, common mistakes |
update |
CLI upgrade and upstream drift check | context/update.md: merge strategy, what to preserve, baseline refresh |
Verify library behavior against Context7 before stating it; training data lags library releases. CLI install, CONTEXT7_API_KEY auth and MCP wiring belong to /context7:setup.
Lookup
Resolve the name to a Context7 library ID, then fetch docs with that ID:
ctx7 library "<name>" "<question>"
MSYS_NO_PATHCONV=1 ctx7 docs "<libraryId>" "<question>"
Or through the MCP server, when configured: mcp__context7__resolve-library-id, then
mcp__context7__query-docs with the resolved ID.
-
Pointer: for each MCP tool's parameters, fetch Context7: MCP Tools live.
-
Always resolve first; the docs step rejects anything but a resolved ID, unless the user supplied one in
/org/projectform. -
One concept per query; run a separate lookup per independent topic, and at most 3 lookup commands per topic. When Context7 does not cover it, answer from training knowledge and say so.
-
Never put API keys, passwords or other credentials in a query: it is sent to the Context7 backend.
-
Keep the two steps above as the default.
ctx7 search "<question>"is an option for a question that spans several libraries or names none, only whenctx7 --helplists it. When to choose it and where its behavior is read: context/cli.md.
Both paths read the same backend. Prefer the MCP server for conversational lookups: it returns more per call (measured ratio in context/mcp.md), clean markdown, needs no MSYS_NO_PATHCONV, and is discoverable from your tool list. Use the CLI to pipe or save output (grep, jq, > docs.md), in scripts and loops, for --json extraction, or when no MCP server is configured or mcp.context7.com is blocked. Flags and errors: context/cli.md.
Update
bash "${CLAUDE_PLUGIN_ROOT}/skills/lookup/scripts/update.sh" # report only
bash "${CLAUDE_PLUGIN_ROOT}/skills/lookup/scripts/update.sh" --fix # also upgrade the CLI
The script reports installed vs latest ctx7 and diffs upstream find-docs and context7-cli against the vendor/ baselines. It exits 0 for no drift, 1 for drift and 2 when a check could not run; a ctx7 that is not installed is reported, not counted as drift. It never rewrites this skill: the update is advisory, the user approves every port, and this skill's own additions (Windows prefix, CLI-vs-MCP guidance, action dispatch) are kept. Read vendor/ only during update, never for a lookup. Protocol: context/update.md.
Spoke paths
The context/ files write this skill's directory as <skill-dir>, which is ${CLAUDE_SKILL_DIR}.
Put that path in place of the placeholder before running a command or writing it into a brief;
never hand a ${…} token from those files to the Bash tool.
- Pointer: when deciding where a
${…}reference resolves and what the Bash tool's environment carries, fetch Where each variable resolves live.
Gotchas
- Windows Git Bash rewrites
ctx7 docs /org/projectintoC:/Program Files/Git/org/project. Always prefixctx7 docs, andctx7 search --library /org/project, withMSYS_NO_PATHCONV=1;ctx7 libraryis unaffected. Detail: context/cli.md.- Pointer: for how an MSYS2-based shell rewrites a
/org/projectargument, see MSYS2: Automatic Unix ⟶ Windows Path Conversion.
- Pointer: for how an MSYS2-based shell rewrites a
- For more content per call, use the MCP server. Which flags
ctx7 docstakes is Context7 CLI § Query Library Documentation. - Never run
ctx7 setup, orctx7 skills installif a guide names it: this plugin owns the lookup surface, and a second copy of Upstash'sfind-docsfragments lookups and drifts on its own. - This skill retrieves library docs only. Architecture decisions and other questions that need cross-checked sources go to a research workflow.
04 同仓库更多 Skills
track
Backlog reads through the bound tracker: search open and closed items, view one item with its comments and state history. Use when another skill searches or reads tracker items.
reviewer-media
Reviewer media for one pull request: decides whether it needs a narrated walkthrough, builds the storyboard from /review:explain-change's digest, has /explainer-video:produce render it and hands the manifest to /source-control:pull-request media. Use when asked for 'reviewer media', 'a walkthrough video for this PR', 'a produced video of this change', or when pull-request ready or monitor hands a PR over.
route
Model and effort per agent role (orchestrator, worker, verifier, retrieval) for a multi-agent run, resolved through the bundled defaults and the user, team and personal override config layers into fenced JSON with single-agent and fan-out variants and the layer behind each value. Use when asked 'which model for the subagents', 'route the roles' or 'model routing', or before a skill passes a role's model on a spawn.
route
Model and effort per agent role (orchestrator, worker, verifier, retrieval) for a multi-agent run, resolved through the bundled defaults and the user, team and personal override config layers into fenced JSON with single-agent and fan-out variants and the layer behind each value. Use when asked 'which model for the subagents', 'route the roles' or 'model routing', or before a skill passes a role's model on a spawn.
principles
Module-design vocabulary for architecture findings, and the checks built on it. Use when: 'what is a deep module', 'what is a seam', 'deep vs shallow module', 'what is the deletion test', 'leverage and locality', 'module design vocabulary', 'which word do we use for X in architecture findings'. Scanning a codebase for friction is /architecture:improve.
write
Structured five-field bug report (title, steps to reproduce, expected vs actual, justified severity, suggested fix location) from an informal description, read-only. Use when the user names a defect they observed, or asks for one written up ('report a bug', 'file a bug', 'write this up as a bug').