返回 Skill 列表
extension
分类: 开发与工程无需 API Key

context7-latest-usage

获取最新的、基于文档的库/框架的API详细信息和最佳实践,使用Context7 MCP工具`resolve-library-id`和`get-library-docs`。当用户询问某个包的“最新用法/最新写法/最佳实践”或如何使用库实现某个功能并希望获得基于最新文档的指导时,请使用此方法。

person作者: jakexiaohubgithub

Context7 Latest Usage

Workflow

1) Clarify the target library and environment

  • Extract the library/framework name and ecosystem (npm/pip/cargo/go/etc).
  • Extract language + runtime (e.g., Node.js 20, Python 3.12) and any required version constraints.
  • Extract the user’s intent (which feature/task they want to build).
  • If any of these are missing or ambiguous, ask a brief clarification question before calling Context7.

2) Resolve the library identifier (Context7)

  • Call Context7 MCP tool resolve-library-id with the library name (and ecosystem if supported).
  • If multiple candidates are plausible, pick the best match and confirm with the user.

3) Fetch the newest relevant docs (Context7)

  • Call Context7 MCP tool get-library-docs for the resolved id, scoped to the user’s task.
  • Prefer latest stable docs; include migration notes if the user is upgrading.
  • If the docs are large, fetch only the sections needed (install, quickstart, the specific API symbols, config, and pitfalls).

4) Produce the response in a fixed format

Return exactly:

  1. Up-to-date API / best practices: concise bullet summary grounded in the fetched docs
  2. Copy-paste snippet: tailored to the user’s language/runtime/version, includes minimal setup
  3. Sources: Context7-provided citations/links for every important claim (especially API signatures, defaults, and behavior)

5) Failure handling (no guessing)

  • If Context7 MCP tools are unavailable or any call fails, say so clearly and ask the user to enable Context7 MCP or paste/link the docs.
  • Do not provide “latest API” claims without sources from Context7 output.