Token导航 LogoToken导航TokenDH.com
前端设计敏感数据github未标认证来源可访问许可证需确认审计通过

api-documentationAPI 文档

Agent Skill

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

总安装

15,652

周安装

436

GitHub Stars

公开资料未说明

下载量

5,142
CodexClaudeCursorGemini CLI

安装说明

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

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

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

命令行安装

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

skills.shnpx skills
npx skills add https://github.com/danhvb/my-ba-skills --skill 'API Documentation'

简介

API文档技能用于辅助API设计、接口文档编写和服务集成说明,帮助梳理endpoint和生成OpenAPI草稿。

  • 适用于前后端联调、第三方服务集成和公共API开发的场景。
  • 可检查字段命名规范、整理错误码和处理规则,但需避免凭空补充字段信息。
  • 使用时需要确认真实业务语义、鉴权方式和分页规则,建议从现有代码中提取事实。
  • api-documentation 属于前端设计类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

API Documentation Skill

Purpose

Define integration requirements and document API specifications to ensure smooth communication between systems (e.g., Frontend to Backend, or Service to Service).

When to Use

  • Designing new API endpoints (e.g., FRS for Backend).
  • Integrating with 3rd party services (e.g., Stripe, SendGrid).
  • Documenting public APIs for partners.
  • Defining payload structures for developers.

Key API Concepts for BAs

1. Protocols

  • REST (Representational State Transfer): Most common. Resource-based.
  • SOAP: Older, XML-based. Heavy enterprise use.
  • GraphQL: Flexible, query-based. Client asks for exactly what it needs.

2. HTTP Methods (Verbs)

  • GET: Retrieve data (Read).
  • POST: Create new data (Create).
  • PUT: Update/Replace full data (Update).
  • PATCH: Update partial data (Update).
  • DELETE: Remove data (Delete).

3. Status Codes

  • 200 OK: Success.
  • 201 Created: Success (new resource made).
  • 400 Bad Request: Client error (invalid input).
  • 401 Unauthorized: Authentication missing/failed.
  • 403 Forbidden: Authentication passed, but permission denied.
  • 404 Not Found: Resource doesn't exist.
  • 500 Internal Server Error: Backend crashed.

Documentation Structure (Swagger/OpenAPI Style)

Required Sections per Endpoint

  1. Title & Method: GET /api/v1/users/{userId}
  2. Summary: One-line description of what it does.
  3. Parameters:

- Path Params: Required ID in URL (e.g., {userId}). - Query Params: Filter/Sort limits (e.g., ?limit=10&role=admin). - Body: JSON payload (for POST/PUT). - Headers: Auth tokens, Content-Type.

  1. Response Examples:

- Success (200) JSON body. - Error (4xx/5xx) JSON body.

  1. Business Rules: Constraints, logic, side effects.

API Specification Template (Simple)

Endpoint: Create New Order

Method: POST URL: /api/v1/orders Description: Creates a new customer order and reserves inventory.

Request Headers:

  • Authorization: Bearer <token>
  • Content-Type: application/json

Request Body (JSON):

{
  "customerId": "uuid-string",
  "items": [
    {
      "productId": "uuid-string",
      "quantity": 2
    }
  ],
  "shippingAddress": {
    "street": "123 Main St",
    "city": "Startown"
  }
}

Constraints:

  • quantity must be > 0.
  • customerId must be active.
  • Max 20 items per order.

Success Response (201 Created):

{
  "orderId": "ord-12345",
  "status": "PENDING",
  "totalAmount": 150.00,
  "createdAt": "2026-01-21T10:00:00Z"
}

Error Responses:

  • 400 Bad Request: "Invalid Quantity" or "Product Out of Stock".
  • 401 Unauthorized: Token expired.

Mapping Integrations (Data Mapping)

When connecting System A to System B, create a Mapping Table:

Source Field (System A)TypeTransformationDestination Field (System B)TypeNotes
first_nameStrConcatFullNameStrA.first + " " + A.last
last_nameStr(above)--
dobDateFormat YYYY-MM-DDBirthDateStrB requires string format
statusEnumMap 'Active'->1IsActiveBoolLogic mapping

Tools

  • Swagger / OpenAPI: Standard for dev docs.
  • Postman: Testing API calls.
  • Stoplight: Visual API design.
  • Lark Docs / Markdown: Writing specs for BRD/FRS.

Best Practices

  • Be Consistent: Use ISO 8601 for dates (YYYY-MM-DDThh:mm:ssZ).
  • Authentication: Explicitly state how auth works (API Key vs OAuth).
  • Pagination: Don't return 1 million records. Specify default limits (limit=20).
  • Error Messages: Define clear human-readable error messages.

Reference

  • RESTful API Design Guide.
  • OpenAPI Specification (OAS).

适合场景

01

用户想查找某类 Agent Skill 时

02

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

03

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

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

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

能力 4

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

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

平台分布

Codex

35.32%
按下载量换算1,816

Claude

30.95%
按下载量换算1,591

Cursor

17.07%
按下载量换算878

Gemini CLI

9.45%
按下载量换算486

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

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

来源信息

继续浏览同类 Skills