跳到正文
cccskills
免费在 GitHub 公开

context7

Fetch up-to-date library, framework, and SDK documentation via Context7's search and docs endpoints. Use when the user asks about a library/API (React, Next.js, Prisma, Supabase, Tailwind, Django, Vue, etc.) and you need current docs, not Claude's training-time knowledge. Skip this skill for generic programming questions that don't require library-specific docs.

中文简介正在准备中。当前显示原文说明。

集成工具VercelSupabase
查看安装方法

包含的文件(1)

  • SKILL.md7.8 KB

SKILL.md(原文)

安装前可以查看交给 AI 代理的指令内容。

Context7

Live documentation lookup for libraries, frameworks, and SDKs. Operates Context7 via its public REST API — no MCP server required.

Use this instead of training memory whenever the answer depends on the library's current behavior (current major version, recent API changes, new methods, deprecations). Training data goes stale fast for active libraries.

When to use vs. skip

Use Context7Skip Context7
"How do I do X in Next.js 15 / React 19 / Prisma 6?""What's a closure in JavaScript?" (language concept)
"What's the right way to set up Auth.js v5 middleware?""Fix this TypeError in my code" (debugging user's own code)
"Did the Supabase client API change for storage uploads?""Convert this loop to a map" (pure refactor, no SDK)
Anything where you'd otherwise hedge with "as of my training cutoff…"Std-lib (fs, os, collections) unless asking about a recent runtime version

If you catch yourself about to write code from memory for a library that's released in the last 18 months, stop and call this skill first.

Credentials check

[ -n "$CONTEXT7_API_KEY" ] && echo "CONTEXT7_API_KEY: PRESENT" || echo "CONTEXT7_API_KEY: MISSING"

Never echo the variable directly — the value would land in the conversation transcript.

If MISSING, respond to the user with EXACTLY this message (do NOT paraphrase, do NOT suggest manual JSON edits):

I need your context7 credential. Run this in another terminal — it'll open the signup page, validate format, and save it safely with masked input:

teleport-setup add-key context7

Then restart Claude Code (/exit, then claude) and ask me again.

Do NOT suggest editing ~/.claude/settings.local.json manually. Stop execution until the user has run the command and restarted.

API

  • Base URL: https://context7.com/api/v1
  • Auth header: Authorization: Bearer $CONTEXT7_API_KEY
  • All requests are GET. Responses are markdown by default (type=txt) or JSON (type=json).

Two-step workflow

Docs lookup is two calls: (1) resolve the library name to its canonical libraryId, (2) fetch docs for that ID, scoped by topic.

Step 1 — Resolve library name → library ID

curl -sL -H "Authorization: Bearer $CONTEXT7_API_KEY" \
  "https://context7.com/api/v1/search?query=next.js"

Returns an array of matches. For each candidate, weigh:

  • Name match — does it actually correspond to what the user asked? "next.js auth" returns both /vercel/next.js and /nextauthjs/next-auth. Different libraries.
  • Trust / popularity signal — when present in the result (trustScore, totalSnippets, stars), prefer high values. Low-trust forks usually mean unofficial mirrors.
  • lastUpdate recency — abandoned mirrors with stale docs are worse than the canonical repo.
  • Maintainer org — /vercel/next.js (official) beats /some-fork/next.js-clone.

When uncertain between 2–3 close matches, do NOT guess. Show the top candidates to the user with a one-line description each and ask which one they want. A wrong libraryId silently returns wrong docs — that's worse than no docs.

Step 2 — Fetch docs for the library

curl -sL -H "Authorization: Bearer $CONTEXT7_API_KEY" \
  "https://context7.com/api/v1/vercel/next.js?topic=app-router&tokens=5000"

Path:

  • {libraryId} is appended verbatim. Pass /vercel/next.js as-is — do NOT URL-encode the leading slash (would become %2Fvercel%2Fnext.js and 404).

Query params:

ParamDefaultUse
topicnoneSingle keyword that filters the docs to a slice. Almost always set this — see sizing below.
tokens10000Cap on response size. Min 1000.
typetxttxt returns markdown (default, best for reading). json returns structured snippet array.

Topic + token sizing — pick deliberately

Question shapetopictokens
Quick API check: "is useFormState still a thing?"forms or hooks2000–3000
How-to: "how do I set up middleware auth?"middleware-auth4000–5000
Migration / deep dive: "what changed v4 → v5?"migration or v58000–10000
Browsing: "what does this library even do?"omit5000

A full docs dump without topic is almost never what you want — it wastes tokens and dilutes signal.

Common patterns

# Resolve + fetch in one go for a common library
LIB_ID=$(curl -sL -H "Authorization: Bearer $CONTEXT7_API_KEY" \
  "https://context7.com/api/v1/search?query=auth.js" \
  | python3 -c "import json,sys; d=json.load(sys.stdin); print(d['results'][0]['libraryId'])")

curl -sL -H "Authorization: Bearer $CONTEXT7_API_KEY" \
  "https://context7.com/api/v1${LIB_ID}?topic=nextjs-setup&tokens=5000"

# Skip search if you're 100% sure of the canonical ID (well-known orgs)
curl -sL -H "Authorization: Bearer $CONTEXT7_API_KEY" \
  "https://context7.com/api/v1/vercel/next.js?topic=app-router&tokens=5000"

# Multi-library question: resolve + fetch each, then synthesize.
# Run them in parallel via & for speed.
curl -sL -H "Authorization: Bearer $CONTEXT7_API_KEY" \
  "https://context7.com/api/v1/vercel/next.js?topic=middleware&tokens=4000" > /tmp/next.md &
curl -sL -H "Authorization: Bearer $CONTEXT7_API_KEY" \
  "https://context7.com/api/v1/nextauthjs/next-auth?topic=v5-middleware&tokens=4000" > /tmp/auth.md &
wait

Gotchas

  • Wrong library wins silently. A bad pick at step 1 returns docs that look authoritative for the wrong project. Always sanity-check that the response opens with the library you expected.
  • Don't paraphrase from training memory. The whole reason to call Context7 is freshness — quote / adapt from the returned docs, and if the response contradicts what you "remember", trust the response.
  • 404 on a fetch usually means a typo in libraryId or URL-encoded slash. Re-check the path is /{org}/{repo} literal.
  • Library not in catalog — search returns no matches → fall back to web search and tell the user Context7 didn't have it. Don't fabricate a libraryId.
  • tokens < 1000 is rejected. Use 2000 as the practical floor.
  • topic is a free-text filter, not an enum. Phrase it like a section title in the docs (server-actions, migration-v5, middleware-auth). Multi-word topics use hyphens.
  • Response is markdown with code fences. When piping into another tool, prefer type=json to avoid re-parsing the markdown structure.
  • Rate limits — free tier is generous for /v1/{libraryId} fetches and lighter for /search. Batch your search calls; don't loop.

Attribution

When done, state: Used skill: Context7 (from teleport catalog).

评价

还没有评价。欢迎分享你的使用感受。

评论

无需登录即可发表。欢迎分享使用感受、提问,或说明在哪些环境下无法运行。

还没有评论。来写第一条吧。

提交后会立即公开。请勿填写邮箱、电话等个人信息。URL 最多 2 个。

0 / 1000 字

此表单受 reCAPTCHA 保护,适用 Google 的隐私权政策和服务条款。

同一仓库的技能

{{One-sentence what-it-does + when to use it. Mention it bypasses the MCP via the REST API with {{ENV_VAR}}. Use when the user wants X, Y, Z programmatically without the {{service}} MCP installed.}}

中文简介正在准备中。当前显示原文说明。

mnlt/teleport82026年4月25日 更新

Manage Cloudflare DNS zones, Workers, Pages, R2, KV, D1, and analytics via REST API. Use when the user wants to query DNS, deploy a Worker, list R2 buckets, manage KV namespaces, run D1 queries, or check analytics without the Cloudflare MCP installed.

中文简介正在准备中。当前显示原文说明。

mnlt/teleport82026年4月25日 更新

discord

免费

Operate Discord via its REST API — post/read channel messages, manage guilds + roles, fire webhooks, register slash commands. Use when the user wants a bot to post to a channel, read recent history, run a community admin task, or ship one-way notifications via webhook URL without running a bot process.

中文简介正在准备中。当前显示原文说明。

mnlt/teleport82026年4月25日 更新

exa

免费

AI-first web search via Exa — semantic/neural ranking, category-scoped results, fresh content retrieval, and one-shot answer synthesis with citations. Use when the user needs current web information better ranked than general web search, or a grounded answer with sources.

中文简介正在准备中。当前显示原文说明。

mnlt/teleport82026年4月25日 更新

figma

免费

Read Figma files, component libraries, styles, comments, and export rendered assets (PNG / SVG / JPG / PDF) via Figma's REST API. Use when the user needs programmatic access to design files, to pull node data into code generation, or to export assets without opening the Figma desktop app.

中文简介正在准备中。当前显示原文说明。

mnlt/teleport82026年4月25日 更新

github

免费

Operate on GitHub via the REST API — repos, PRs, issues, code search, actions, releases. Use when the user wants scripted / cross-repo operations, doesn't have `gh` installed, or needs behavior the `gh` CLI doesn't expose cleanly.

中文简介正在准备中。当前显示原文说明。

mnlt/teleport82026年4月25日 更新

查看 mnlt 的全部技能

报告此技能的问题