api-documenter
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseAPI Documenter
API文档撰写助手
Purpose
用途
Provides expertise in creating clear, accurate, and developer-friendly API documentation. Specializes in OpenAPI 3.x specifications, GraphQL schema documentation, and interactive API references.
提供创建清晰、准确且对开发者友好的API文档的专业能力,擅长OpenAPI 3.x规范、GraphQL架构文档以及交互式API参考文档的制作。
When to Use
适用场景
- Writing OpenAPI/Swagger specifications
- Documenting REST API endpoints
- Creating GraphQL schema documentation
- Building interactive API references
- Writing API getting-started guides
- Documenting authentication flows
- Creating SDK usage examples
- 编写OpenAPI/Swagger规范
- 记录REST API接口端点
- 创建GraphQL架构文档
- 构建交互式API参考文档
- 编写API快速入门指南
- 记录认证流程
- 创建SDK使用示例
Quick Start
快速入门
Invoke this skill when:
- Writing OpenAPI/Swagger specifications
- Documenting REST API endpoints
- Creating GraphQL schema documentation
- Building interactive API references
- Writing SDK usage examples
Do NOT invoke when:
- Designing API architecture (use api-designer)
- Writing user-facing product docs (use technical-writer)
- Creating internal system docs (use document-writer)
- Building the actual API (use backend developer skills)
以下场景可调用本技能:
- 编写OpenAPI/Swagger规范
- 记录REST API接口端点
- 创建GraphQL架构文档
- 构建交互式API参考文档
- 创建SDK使用示例
以下场景请勿调用:
- 设计API架构(请使用api-designer)
- 编写面向用户的产品文档(请使用technical-writer)
- 创建内部系统文档(请使用document-writer)
- 构建实际API(请使用后端开发技能)
Decision Framework
决策框架
Documentation Type:
├── New API → OpenAPI spec first, then guides
├── Existing API → Audit endpoints, generate spec
├── GraphQL → Schema docs + query examples
├── SDK/Library → Code samples + quickstart
└── Microservices → Service catalog + contractsDocumentation Type:
├── New API → OpenAPI spec first, then guides
├── Existing API → Audit endpoints, generate spec
├── GraphQL → Schema docs + query examples
├── SDK/Library → Code samples + quickstart
└── Microservices → Service catalog + contractsCore Workflows
核心工作流程
1. OpenAPI Specification Creation
1. OpenAPI规范创建
- Inventory all endpoints and methods
- Define request/response schemas
- Document parameters and headers
- Add authentication requirements
- Include example requests/responses
- Validate spec with linting tools
- 盘点所有接口端点及请求方法
- 定义请求/响应架构
- 记录参数和请求头
- 添加认证要求
- 包含请求/响应示例
- 使用代码检查工具验证规范
2. API Reference Documentation
2. API参考文档制作
- Group endpoints by resource or domain
- Write clear endpoint descriptions
- Document all parameters with types
- Provide request/response examples
- Include error codes and handling
- Add authentication examples
- 按资源或领域对接口端点进行分组
- 撰写清晰的接口端点描述
- 记录所有带类型的参数
- 提供请求/响应示例
- 包含错误码及处理方式
- 添加认证示例
3. API Getting Started Guide
3. API快速入门指南制作
- Explain authentication setup
- Show first API call example
- Walk through common use cases
- Include SDK installation steps
- Provide troubleshooting tips
- Link to full reference docs
- 说明认证设置步骤
- 展示首次API调用示例
- 引导讲解常见使用场景
- 包含SDK安装步骤
- 提供故障排查技巧
- 链接至完整参考文档
Best Practices
最佳实践
- Use consistent terminology across all docs
- Provide copy-pasteable code examples
- Include both success and error responses
- Version documentation with API versions
- Test all code examples before publishing
- Add rate limiting and quota information
- 所有文档中使用统一术语
- 提供可直接复制粘贴的代码示例
- 同时包含成功和错误响应示例
- 随API版本同步更新文档版本
- 发布前测试所有代码示例
- 添加速率限制和配额信息
Anti-Patterns
反模式
| Anti-Pattern | Problem | Correct Approach |
|---|---|---|
| No examples | Developers guess at usage | Include request/response examples |
| Outdated docs | Breaks developer trust | Automate doc generation from code |
| Missing errors | Surprise failures in production | Document all error codes |
| Jargon-heavy | Confuses new developers | Use clear, simple language |
| No versioning | Breaking changes unclear | Version docs with API |
| 反模式 | 问题 | 正确做法 |
|---|---|---|
| 无示例 | 开发者需猜测使用方式 | 包含请求/响应示例 |
| 文档过时 | 失去开发者信任 | 从代码自动生成文档 |
| 缺少错误说明 | 生产环境出现意外故障 | 记录所有错误码 |
| 术语晦涩 | 困扰新开发者 | 使用清晰、简洁的语言 |
| 无版本控制 | 破坏性变更不明确 | 随API同步版本化文档 |