api-doc-generator
FeaturedGenerate API documentation from source code, supporting REST APIs, GraphQL, and various documentation formats.
API & Backend 670 stars
170 forks Updated 6 days ago CC0-1.0
Install
Quality Score: 92/100
Stars 20%
Recency 20%
Frontmatter 20%
Documentation 15%
Issue Health 10%
License 10%
Description 5%
Skill Content
# API Doc Generator
> 根据代码生成 API 文档,支持 REST API、GraphQL 及多种文档格式。
>
> Generate API documentation from source code, supporting REST APIs, GraphQL, and various documentation formats.
## When to Use
当用户请求以下操作时使用此 skill:
- 生成 API 文档 / Generate API documentation
- 创建接口文档 / Create interface documentation
- 编写 API 说明 / Write API descriptions
- 生成 OpenAPI/Swagger 规范 / Generate OpenAPI/Swagger specs
## Instructions
### 分析步骤 / Analysis Steps
1. **识别 API 类型** - REST、GraphQL、RPC 等
2. **提取端点信息** - URL、方法、参数
3. **分析数据结构** - 请求/响应格式
4. **识别认证方式** - API Key、OAuth、JWT 等
5. **生成文档** - 按照标准格式输出
### 文档内容 / Documentation Content
每个 API 端点应包含:
- **端点路径** - URL 和 HTTP 方法
- **描述** - 功能说明
- **参数** - 路径参数、查询参数、请求体
- **响应** - 成功和错误响应示例
- **认证** - 认证要求
### 输出格式 / Output Formats
支持以下文档格式:
- Markdown(默认)- 使用 `templates/api-doc.md` 模板
- OpenAPI 3.0 YAML
- API Blueprint
Use `templates/api-doc.md` for Markdown output format.
### 标准模板 / Standard Template
```markdown
## API 文档 / API Documentation
### 端点概览 / Endpoint Overview
| 方法 | 路径 | 描述 |
|------|------|------|
| GET | /api/resource | 获取资源列表 |
### 详细说明 / Details
#### [方法] /path
**描述**: ...
**请求参数**:
| 参数 | 类型 | 必需 | 描述 |
|------|------|------|------|
**请求示例**:
```json
{}
```
**响应示例**:
```json
{}
```
```
## Examples
### 输入 / Input
```python
from fastapi import FastAPI, HTTPException
from pydantic import BaseModel
app = FastAPI()
class User(BaseModel):
id: int
name: str
email: str
@app.get("/users/{user_id}")
async def ge...
Details
- Author
- JackyST0
- Repository
- JackyST0/awesome-agent-skills
- Created
- 9 months ago
- Last Updated
- 6 days ago
- Language
- JavaScript
- License
- CC0-1.0
Integrates with
Similar Skills
Semantically similar based on skill content — not just same category
API & Backend Listed
api-doc-generator
从代码生成API文档和OpenAPI规范,支持多种后端框架。 使用场景:为REST API项目生成OpenAPI 3.0规范、创建或更新API接口文档。
1 Updated 1 weeks ago
10CG Code & Development Solid
doc-generator
从源代码生成全面且准确的 API 文档。适用于创建或更新 API 文档、生成 OpenAPI 规范,或在用户提到 API 文档、端点或说明时使用。
47,500 Updated yesterday
luongnv89 API & Backend Listed
api-doc-gen
从 Flask、FastAPI、Express 或 Gin 等 Web 框架的源代码中自动扫描路由定义,生成符合 OpenAPI 3.0 / Swagger 规范的标准化 API 文档文件。当用户需要生成 API 文档、提到 OpenAPI、Swagger、接口文档、路由扫描或从代码自动提取接口信息时触发。
13 Updated 4 months ago
serejaris