with one click
api-documentation-generator
自动生成 API 文档。从代码中提取 API 定义,生成 OpenAPI/Swagger 规范和交互式文档。
Menu
自动生成 API 文档。从代码中提取 API 定义,生成 OpenAPI/Swagger 规范和交互式文档。
Guidelines for applying Disney's 12 principles of animation to web interfaces. Use when implementing motion, reviewing animation quality, or designing micro-interactions. Triggers on tasks involving CSS animations, transitions, motion libraries, or UX feedback.
Plan, validate, and use 1Password CLI setup for secret injection and auth. Use when tasks need 1Password CLI usage, secret references, op run/read/inject, or provisioning secrets via env vars/.env files and scripts.
Apply 37signals/DHH Rails conventions when writing Ruby on Rails code. Use when building Rails applications, reviewing Rails code, or making architectural decisions. Covers various aspects of Rails application architecture, design and dependencies.
Implement 3D elements and effects using Three.js and React Three Fiber
Expert 4PL and supply chain guidance for logistics operations. Use when discussing supply chain strategy, warehouse management, transportation planning, inventory optimization, 3PL partner management, logistics KPIs, or business strategy for logistics companies. Tailored for the eddication.io platform including DriverConnect driver tracking, job dispatch, and CRM operations.
Apply timeless programming wisdom from "97 Things Every Programmer Should Know" when writing, reviewing, or refactoring code. Use for design decisions, code quality checks, professional development guidance, testing strategies, and workflow optimization.
| name | api-documentation-generator |
| description | 自动生成 API 文档。从代码中提取 API 定义,生成 OpenAPI/Swagger 规范和交互式文档。 |
| trigger | 当用户需要生成或更新 API 文档时使用 |
自动化 API 文档生成工具,从代码中提取 API 定义并生成标准化文档。
# 生成完整 API 文档
/api-documentation-generator
# 生成特定路由的文档
/api-documentation-generator --routes /api/users
# 生成 OpenAPI 规范
/api-documentation-generator --format openapi
# 生成 Postman Collection
/api-documentation-generator --format postman
# 生成 TypeScript 类型定义
/api-documentation-generator --types
# 更新现有文档
/api-documentation-generator --update
# 生成客户端 SDK
/api-documentation-generator --sdk typescript
openapi: 3.0.0
info:
title: AI Innovation Hub API
version: 1.0.0
description: Enterprise AI platform API
servers:
- url: https://api.aizcspace.com
description: Production
- url: http://localhost:8051
description: Development
paths:
/api/models:
get:
summary: List AI models
tags: [Models]
parameters:
- name: page
in: query
schema:
type: integer
default: 1
- name: limit
in: query
schema:
type: integer
default: 20
responses:
'200':
description: Successful response
content:
application/json:
schema:
type: object
properties:
data:
type: array
items:
$ref: '#/components/schemas/Model'
pagination:
$ref: '#/components/schemas/Pagination'
components:
schemas:
Model:
type: object
properties:
id:
type: string
name:
type: string
description:
type: string
category:
type: string
enum: [LLM, Vision, Audio]
securitySchemes:
bearerAuth:
type: http
scheme: bearer
bearerFormat: JWT
# AI Innovation Hub API Documentation
## Authentication
All API requests require authentication using JWT tokens.
```bash
curl -H "Authorization: Bearer YOUR_TOKEN" \
https://api.aizcspace.com/api/models
GET /api/models
Retrieve a paginated list of AI models.
Query Parameters:
page (integer, optional): Page number (default: 1)limit (integer, optional): Items per page (default: 20)category (string, optional): Filter by categoryResponse:
{
"data": [
{
"id": "model-123",
"name": "GPT-4",
"description": "Advanced language model",
"category": "LLM"
}
],
"pagination": {
"page": 1,
"limit": 20,
"total": 100
}
}
Error Responses:
401 Unauthorized: Invalid or missing token403 Forbidden: Insufficient permissions500 Internal Server Error: Server error
## 配置
在 `.claude/settings.json` 中配置文档生成:
```json
{
"apiDocGenerator": {
"format": "openapi",
"outputDir": "docs/api",
"includeExamples": true,
"generateTypes": true,
"languages": ["typescript", "python"],
"excludeRoutes": ["/internal/*"],
"customTemplates": {
"markdown": "templates/api-doc.md"
}
}
}
## {{method}} {{path}}
{{description}}
**Authentication:** {{authType}}
**Parameters:**
{{#parameters}}
- `{{name}}` ({{type}}, {{required}}): {{description}}
{{/parameters}}
**Request Body:**
```json
{{requestExample}}
Response:
{{responseExample}}
Error Codes: {{#errors}}
{{code}}: {{message}}
{{/errors}}
## 最佳实践
1. **保持同步**: 代码变更后立即更新文档
2. **详细示例**: 提供真实的请求/响应示例
3. **错误文档**: 完整记录所有错误码
4. **版本管理**: 维护 API 版本历史
5. **交互测试**: 提供可测试的文档界面
## 输出格式
生成的文档包括:
- `openapi.yaml`: OpenAPI 3.0 规范
- `README.md`: API 概览和快速开始
- `endpoints/`: 各端点详细文档
- `types/`: TypeScript 类型定义
- `examples/`: 示例代码
- `postman/`: Postman Collection
## 集成
与其他 Skills 配合使用:
- `api-integration`: API 集成最佳实践
- `typescript-standards`: 类型定义规范
- `doc-coauthoring`: 文档协作编写
- `code-review-checklist`: API 设计审查