Token导航 LogoToken导航TokenDH.com
研究检索需要联网github未标认证来源可访问clear审计提醒

context7Context7 文档搜索

Agent Skill

context7 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

2,640

周安装

110

GitHub Stars

公开资料未说明

下载量

880
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

3

许可证

MIT

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:context7(Context7 文档搜索)
来源仓库:https://github.com/dotneet/claude-code-marketplace
仓库路径:skills/context7
安装命令:
npx skills add https://github.com/dotneet/claude-code-marketplace --skill context7
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/dotneet/claude-code-marketplace --skill context7

简介

context7 提供最新的库文档检索服务,防止 LLM 产生过时或不存在的 API 信息。

  • 适合在 Codex、Claude、Cursor、Gemini CLI 中需要获取版本特定的准确文档和代码示例时使用。
  • 通过 GitHub 安装,当用户明确要求使用 context7 或询问特定库的 API 使用方法时自动激活。
  • 使用前需确认网络连接正常,并能访问 context7 服务以获取实时文档数据。
  • 适用于需要精确技术参考和避免幻觉风险的 AI 辅助开发场景,提升代码准确性。

SKILL.md

Context7

Overview

Context7 is a service that provides LLMs with the latest library documentation. It prevents hallucinations from outdated training data or non-existent APIs, enabling retrieval of version-specific accurate documentation and code examples.

When to Use

Use this skill in the following cases:

  1. Explicit instruction: When the user instructs "use context7" or "check the latest documentation"
  2. Library usage questions: When asked about how to use a specific library's API, hooks, or functions
  3. Code example requests: When asked for code examples using a specific library
  4. Version-specific information: When library information for a specific version is needed
  5. Uncertain API information: When your knowledge might be outdated and latest information verification is needed

Workflow

Step 1: Resolve Library ID

First, obtain the Context7 ID for the target library.

API call:

curl "https://context7.com/api/v2/libs/search?libraryName=LIBRARY_NAME&query=CONTEXT_QUERY" \
  -H "Authorization: Bearer $CONTEXT7_API_KEY"

Example:

# Search for React library
curl "https://context7.com/api/v2/libs/search?libraryName=react&query=hooks" \
  -H "Authorization: Bearer $CONTEXT7_API_KEY"

Criteria for selecting from response:

  • trustScore: Trust score (higher is better)
  • totalSnippets: Number of available documents (more means richer information)
  • versions: Verify that the required version is included

Step 2: Retrieve Documentation

Use the resolved library ID to retrieve specific documentation.

API call:

curl "https://context7.com/api/v2/context?libraryId=LIBRARY_ID&query=SPECIFIC_QUERY" \
  -H "Authorization: Bearer $CONTEXT7_API_KEY"

Example:

# Retrieve information about React's useEffect
curl "https://context7.com/api/v2/context?libraryId=/facebook/react&query=useEffect cleanup function" \
  -H "Authorization: Bearer $CONTEXT7_API_KEY"

Query best practices:

  • Use specific queries ("useEffect cleanup function" rather than "hooks")
  • Be clear about the purpose ("authentication middleware", "form validation", etc.)

Step 3: Respond to User

Respond to the user's question based on the retrieved documentation.

Information to include in the response:

  • Retrieved code examples
  • API explanations
  • Documentation source URLs (for reference)

Examples

Example 1: React Hook Usage

User: "How do I write a cleanup function with React's useEffect?"

Execution steps:

  1. Library search: libraryName=react, query=useEffect cleanup
  2. Documentation retrieval: libraryId=/facebook/react, query=useEffect cleanup function
  3. Respond with the latest code examples and best practices

Example 2: Next.js Routing

User: "Use context7 to show me how to implement authentication middleware with Next.js App Router"

Execution steps:

  1. Library search: libraryName=next.js, query=middleware authentication
  2. Documentation retrieval: libraryId=/vercel/next.js, query=middleware authentication route protection
  3. Respond with the latest App Router compatible middleware implementation

Example 3: Multiple Libraries Combination

User: "How to create a button component using TailwindCSS and shadcn/ui"

Execution steps:

  1. Resolve IDs for each library
  2. Retrieve documentation for both
  3. Respond with a combined implementation example

Error Handling

ErrorSolution
404 (Not Found)Search again with a different library name (e.g., "nextjs" → "next.js")
429 (Rate Limit)Wait a moment and retry
Empty responseRetry with a more general query

Resources

For detailed API specifications, see references/api_reference.md.

  • Endpoint details
  • Response field descriptions
  • Rate limit information
  • Error code list

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

04

需要参考平台分布和安装热度时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

能力 5

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Claude Code

30.37%
按下载量换算267

OpenCode

23.59%
按下载量换算208

Codex

17.22%
按下载量换算152

Antigravity

11.92%
按下载量换算105

Gemini CLI

8.96%
按下载量换算79

windsurf

3.47%
按下载量换算31

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

可疑

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。

来源信息

继续浏览同类 Skills