Token导航 LogoToken导航TokenDH.com
研究检索需要联网github未标认证来源可访问许可证需确认审计通过

write-api-referencewrite API reference 搜索

Agent Skill

用于辅助 API 设计、接口文档、请求响应结构和服务集成说明。它适合让 Agent 梳理 endpoint、生成 OpenAPI 草稿、检查字段命名、整理错误码或辅助前后端联调。使用时需要确认真实业务语义、鉴权方式、分页和错误处理规则;涉及生成接口文档时,应避免凭空补字段,最好从现有代码、schema 或接口样例中提取事实。

总安装

12,842

周安装

546

GitHub Stars

139,187

下载量

4,499
CodexClaudeCursorGemini CLI

安装说明

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

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

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

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/vercel/next.js --skill write-api-reference

简介

write-api-reference 用于辅助 API 设计、接口文档和请求响应结构说明。

  • 适合梳理 endpoint、生成 OpenAPI 草稿或检查字段命名规范。
  • 可结合现有代码或接口样例提取事实,避免凭空补字段。
  • 使用时需确认业务语义、鉴权方式和错误处理规则。
  • 涉及接口文档生成时,应优先参考已有 schema 或代码实现。

SKILL.md

Writing API Reference Pages

Goal

Produce an API reference page that documents a single API surface (function, component, file convention, directive, or config option). The page should be concise, scannable, and example-driven.

Each page documents one API. If the API has sub-methods (like cookies.set()), document them on the same page. If two APIs are independent, they get separate pages.

Structure

Identify which category the API belongs to, then follow the corresponding template.

Categories

  1. Function (cookies, fetch, generateStaticParams): signature, params/returns, methods table, examples
  2. Component (Link, Image, Script): props summary table, individual prop docs, examples
  3. File convention (page, layout, route): definition, code showing the convention, props, behavior, examples
  4. Directive (use client, use cache): definition, usage, serialization/boundary rules, reference
  5. Config option (basePath, images, etc.): definition, config code, behavioral sections

Template

---
title: {API name}
description: {API Reference for the {API name} {function|component|file convention|directive|config option}.}
---

{One sentence defining what it does and where it's used.}

// Minimal working usage

// Same example in JS


## Reference

{For functions: methods/params table, return type.}
{For components: props summary table, then `#### propName` subsections.}
{For file conventions: `### Props` with `#### propName` subsections.}
{For directives: usage rules and serialization constraints.}
{For config: options table or individual option docs.}

### {Subsection name}

{Description + code example + table of values where applicable.}

## Good to know

- {Default behavior or implicit effects.}
- {Caveats, limitations, or version-specific notes.}
- {Edge cases the developer should be aware of.}

## Examples

### {Example name}

{Brief context, 1-2 sentences.}

// Complete working example

// Same example in JS


## Version History

| Version  | Changes         |
| -------- | --------------- |
| `vX.Y.Z` | {What changed.} |

Category-specific notes:

  • Functions: Lead with the function signature and await if async. Document methods in a table if the return value has methods (like cookies). Document options in a separate table if applicable.
  • Components: Start with a props summary table (| Prop | Example | Type | Required |). Then document each prop under #### propName with description, code example, and value table where useful.
  • File conventions: Show the default export signature with TypeScript types. Document each prop (params, searchParams, etc.) under #### propName with a route/URL/value example table.
  • Directives: No ## Reference section. Use ## Usage instead, showing correct placement. Document serialization constraints and boundary rules.
  • Config options: Show the next.config.ts snippet. Use subsections for each behavioral aspect.

Rules

  1. Lead with what it does. First sentence defines the API. No preamble.
  2. Show working code immediately. A minimal usage example appears right after the opening sentence, before ## Reference.
  3. Use switcher for tsx/jsx pairs. Always include both. Always include filename="path/to/file.ext".
  4. Use highlight={n} for key lines. Highlight the line that demonstrates the API being documented.
  5. Tables for simple APIs, subsections for complex ones. If a prop/param needs only a type and one-line description, use a table row. If it needs a code example or multiple values, use a #### subsection.
  6. Behavior section uses `> Good to know:or## Good to know`. Use the blockquote format for brief notes (1-3 bullets). Use the heading format for longer sections. Not "Note:" or "Warning:".
  7. Examples section uses ### Example Name subsections. Each example solves one specific use case.
  8. Version History table at the end. Include when the API has changed across versions. Omit for new APIs.
  9. No em dashes. Use periods, commas, or parentheses instead.
  10. Mechanical, observable language. Describe what happens, not how it feels. "Returns an object" not "gives you an object".
  11. Link to related docs with relative paths. Use /docs/app/... format.
  12. No selling or justifying. No "powerful", "easily", "simply". State what the API does.
Don'tDo
"This powerful function lets you easily manage cookies""cookies is an async function that reads HTTP request cookies in Server Components"
"You can conveniently access...""Returns an object containing..."
"The best way to handle navigation""<Link> extends the HTML <a> element to provide prefetching and client-side navigation"

Workflow

  1. Ask for reference material. Ask the user if they have any RFCs, PRs, design docs, or other context that should inform the doc.
  2. Identify the API category (function, component, file convention, directive, config).
  3. Research the implementation. Read the source code to understand params, return types, edge cases, and defaults.
  4. Check e2e tests. Search test/ for tests exercising the API to find real usage patterns, edge cases, and expected behavior.
  5. Check existing related docs for linking opportunities and to avoid duplication.
  6. Write using the appropriate category template. Follow the rules above.
  7. Review against the rules. Verify: one sentence opener, immediate code example, correct switcher/filename usage, tables vs subsections, "Good to know" format, no em dashes, mechanical language.

References

Read these pages in docs/01-app/03-api-reference/ before writing. They demonstrate the patterns above.

  • 04-functions/cookies.mdx - Function with methods table, options table, and behavior notes
  • 03-file-conventions/page.mdx - File convention with props subsections and route/URL/value tables
  • 02-components/link.mdx - Component with props summary table and detailed per-prop docs
  • 01-directives/use-client.mdx - Directive with usage section and serialization rules
  • 04-functions/fetch.mdx - Function with troubleshooting section and version history

适合场景

01

用户想查找某类 Agent Skill 时

02

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

03

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

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

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

能力 4

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

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

平台分布

Codex

36.56%
按下载量换算1,645

Claude

28.39%
按下载量换算1,277

Cursor

18.76%
按下载量换算844

Gemini CLI

8.7%
按下载量换算391

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

需要联网

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

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills