Agent skill
c7
Fetches up-to-date library documentation from Context7 and saves to /tmp/context7/. Use when needing current API docs, code examples, library references, SDK documentation, or checking latest library versions. Triggers: context7, c7, library docs, fetch docs, current documentation, api reference.
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/other/other/c7
SKILL.md
c7 - Context7 Documentation Fetcher
Fetch-only skill. Does NOT read docs into context.
Usage
Fetch documentation
scripts/c7.sh <library-name> "<query>"
Example:
scripts/c7.sh nextjs "app router middleware"
List cached docs
scripts/c7.sh --list
Force re-fetch (bypass cache)
scripts/c7.sh --force <library-name> "<query>"
Workflow
-
Run
scripts/c7.sh <library> "<query>" -
Handle output:
CACHED: <path> (Xh old)→ Use AskUserQuestion: "Documentation for X is already cached (Y hours old). Use cached version or fetch fresh?"- If re-fetch → run with
--force - If use cached → inform user of location, done
- If re-fetch → run with
- Success (path printed) → inform user: "Documentation saved to "
NOT_FOUND:→ Use AskUserQuestion: "Library not found in Context7. How should I proceed?" with options like retry with different name, skip, etc.RATE_LIMITED:→ inform user rate limit hit, stopAPI_ERROR:→ inform user of error, stop
-
Done. Do NOT read the file into context.
Exit Codes
| Code | Output | Action |
|---|---|---|
| 0 | filepath | Success - report location |
| 0 | CACHED: path | Ask user: use cache or re-fetch? |
| 1 | NOT_FOUND: | Ask user for alternatives |
| 2 | RATE_LIMITED: | Inform user, stop |
| 3 | API_ERROR: | Inform user, stop |
| 4 | FUZZY_MATCH: | Ask user: "Context7 matched X instead of Y. Use this or try different name?" |
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?