跳到正文
Skillpedia
通用编程14k · #11268

get-api-docs

它能做什么

这项技能使用 chub 工具,获取软件库和在线服务的最新文档。适合要求 AI 编写使用 API 或 SDK 的代码的人。

适用场景

  • ✓当你要求 AI 使用 OpenAI 或 Stripe 等 API 的时候。
  • ✓当你要求编写使用某个特定 SDK 或库的代码的时候。
  • ✓当你希望智能体查阅最新文档,而不是进行网络搜索的时候。

技能链接

https://github.com/andrewyng/context-hub/blob/main/cli/skills/get-api-docs/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/andrewyng/context-hub/blob/main/cli/skills/get-api-docs/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“我想使用 Stripe API 编写创建支付链接的代码,并参考最新的文档。”

每周 5 个新技能,1 分钟读完。

工作原理

智能体会安装或运行 chub 工具,搜索匹配的文档,并在编写代码之前阅读文档。它也可以对所使用的文档留下反馈。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

Get API Docs via chub

When you need documentation for a library or API, fetch it with the chub CLI rather than guessing from training data. This gives you the current, correct API.

Step 1 - Ensure chub exists and get the latest instructions for using it

Run

chub --help

If this results in an error showing that chub does not exist, then install it first, and run it again. If the environment has node, npm, network access, and package-manager permission, install it as follows:

npm install -g @aisuite/chub

Step 2 — Find the right documents

If there is a conflict, follow the instructions from the output of chub --help since that will be the latest guidance. However, a key command for searching for the right documentation is chub search:

chub search "<keywords>" --json

Pick the best-matching id from the results (e.g. openai/chat, anthropic/sdk, stripe/api). If nothing matches, try some broader terms.

Step 3 — Fetch the docs

Again, follow the latest instructions from chub --help instead of this if there is a conflict. But a key command for fetching the relevant docs is:

chub get <id> --lang py    # or --lang js, --lang ts

Remember to include the --lang parameter.

Step 4 — Use the docs and leave feedback

Read the fetched content and use it to write accurate code or answer the question. Do not rely on memorized API shapes — use what the docs say.

Finally, after completing the task, if you discovered something not in the doc — a gotcha, workaround, version quirk, or project-specific detail — save it so future sessions start smarter:

chub annotate <id> "Webhook verification requires raw body — do not parse before verifying"

Annotations are local, persist across sessions, and appear automatically on future chub get calls. Keep notes concise and actionable. Don't repeat what's already in the doc.

Additionally, to help all developers, give feedback on the documentation using chub feedback, following the instructions in chub --help . Do not include secrets, source code, private architecture details, or other sensitive information in feedback comments.

常见问题

我需要安装什么吗?

智能体会检查 chub 工具,如果缺少且设置允许,它会将其安装。

这比网络搜索更好吗?

这项技能称,它能找到比通用网络搜索更准确、更新的文档。

它可以获取哪些语言的文档?

根据你选择的语言,可以获取 Python、JavaScript 或 TypeScript 的文档。

详情

作者的原始描述

Use this skill to get documentation for third-party APIs, SDKs or libraries before writing code that uses them to ensure you have the latest, most accurate documentation. This is a better way to find documentation than doing web search. This includes when a user asks for tasks like "use the OpenAI API", "call the Stripe API", "use the Anthropic SDK", "query Pinecone", or any other time the user asks you to write code against an external service and you need current API reference. Fetch the docs with chub before answering, rather than relying on your pre-trained knowledge, which may be outdated

repo: andrewyng/context-hub

热度

GitHub 星标
14k
排名
#11268
许可证
MIT
更新时间
2026/5/31

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能