AgentSkillsCN

context7

当用户询问库的文档资料、需要代码示例、想要了解 API 使用模式、正在学习新框架、需要语法参考,或需要借助库特有的信息进行故障排除时,可选用此技能。

SKILL.md
--- frontmatter
name: context7
description: Read when users ask about library documentation, need code examples, want API usage patterns, are learning a new framework, need syntax reference, or troubleshooting with library-specific information

Context7 Documentation Fetcher

Fetch library documentation and code examples.

Usage

bash
bash ~/.cursor/skills/context7/scripts/fetch.sh <library-name> <query> [page]

Library name format: Prefer GitHub repo format (owner/repo) for precision. Examples:

  • facebook/react (more specific than just react)
  • vercel/next.js
  • prisma/prisma
  • expressjs/express

Tips for Best Results

  • Use specific, detailed queries rather than vague terms
  • Include relevant context in the query (e.g., "useState hook with TypeScript" instead of just "state")

Examples:

bash
bash ~/.cursor/skills/context7/scripts/fetch.sh facebook/react "useState hook"
bash ~/.cursor/skills/context7/scripts/fetch.sh vercel/next.js "dynamic routes with parameters"
bash ~/.cursor/skills/context7/scripts/fetch.sh prisma/prisma "filtering and sorting query results"
bash ~/.cursor/skills/context7/scripts/fetch.sh facebook/react "useState hook" 2

The script returns code examples, API signatures, and important notes.