418 OneWave-AI

api-documentation-writer Skill

生成全面的 API 文档,包括端点描述、请求/响应示例、认证指南、错误码和 SDK。可创建 OpenAPI/Swagger 规范、REST API 文档及开发者友好的参考资料。适用于用户需要编写 API 文档、技术参考或开发者文档的场景。

安装方式:把技能目录放入 ~/.claude/skills/(Claude Code)或在 claude.ai 设置中启用;也可复制右侧安装命令一键添加。

查看源码

技能指令原文(SKILL.md)

API Documentation Writer

Generate comprehensive, developer-friendly API documentation.

Contents

  • references/documentation-structure.md — every section to cover (overview, auth, endpoints, errors, rate limits, SDKs, webhooks, GraphQL)
  • references/output-template.md — canonical REST Markdown template with worked examples
  • references/best-practices.md — best practices, developer-experience tips, and the output quality checklist

Workflow

  1. Gather API information. Determine the API type (REST, GraphQL, WebSocket, gRPC), authentication method (API key, OAuth, JWT), base URL and versioning strategy, available endpoints and their purposes, request/response formats, and any rate limiting or usage restrictions.
  1. Build the documentation structure. Cover every section in references/documentation-structure.md, ordering the most common operations first.
  1. Generate the output. Follow references/output-template.md for REST APIs; adapt to schema, query, mutation, and subscription examples for GraphQL. Replace all placeholders with realistic example data and show both request and response.
  1. Document errors and rate limits. Include the standard error response format, common error codes, troubleshooting guidance, limits, headers to check, and how to handle 429 responses.
  1. Provide code samples in multiple languages (curl, JavaScript, Python) and link SDKs, Postman collections, or OpenAPI specs where available.
  1. Verify quality against the checklist in references/best-practices.md before delivering.

Example Triggers

  • "Write API documentation for my REST endpoints"
  • "Create OpenAPI spec for my API"
  • "Document this GraphQL schema"
  • "Generate developer docs for my webhook API"
  • "Write authentication guide for API"

配合站内内容