context7

📁 edxeth/superlight-context7-skill 📅 Jan 16, 2026
4
总安装量
2
周安装量
#50298
全站排名
安装命令
npx skills add https://github.com/edxeth/superlight-context7-skill --skill context7

Agent 安装分布

opencode 2
claude-code 2
github-copilot 2
roo 2
codex 2
droid 2

Skill 文档

Context7 Documentation Lookup

Retrieves current, version-specific documentation for third-party libraries directly from official sources.

When to Use

ALWAYS invoke before writing code for external libraries when:

  • Implementing unfamiliar library APIs
  • Debugging errors from external packages (stack traces, “method not found”)
  • Checking version-specific syntax or breaking changes
  • Verifying deprecated/removed APIs
  • Encountering unfamiliar import/require statements

Protocol

Step 1: Search for Library ID

scripts/context7.sh search "<library>" "<intent>"

Example:

scripts/context7.sh search "tanstack-query" "optimistic updates"

Output: Library IDs like /tanstack/query, /vercel/next.js

Disambiguation: If multiple similar results appear, ask user which library they meant.

Step 2: Fetch Documentation

scripts/context7.sh docs "<library-id>" "<specific-question>"

Examples:

scripts/context7.sh docs "/vercel/next.js" "middleware redirect authentication"
scripts/context7.sh docs "/tanstack/query" "useMutation optimistic update pattern v5"

Step 3: Apply Context

Uses returned documentation to generate accurate, version-correct code.

Critical Rules

  1. Specific queries win – “useState hook array destructuring” beats “react hooks”
  2. Include version – Append version to query if user mentions one
  3. No guessing – If search returns nothing, ask user before proceeding
  4. Only run context7.sh – Do not run other bash commands with this skill

Resources

See reference/troubleshooting.md for error handling, configuration, and common issues.