api-doc-gen
从 Flask、FastAPI、Express 或 Gin 等 Web 框架的源代码中自动扫描路由定义,生成符合 OpenAPI 3.0 / Swagger 规范的标准化 API 文档文件。当用户需要生成 API 文档、提到 OpenAPI、Swagger、接口文档、路由扫描或从代码自动提取接口信息时触发。
Skill by serejaris
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/serejaris-api-doc-gen
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Use cases: documents, backend
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions: not checked yet.
What's inside
- Skill name
api-doc-gen- Description
- 从 Flask、FastAPI、Express 或 Gin 等 Web 框架的源代码中自动扫描路由定义,生成符合 OpenAPI 3.0 / Swagger 规范的标准化 API 文档文件。当用户需要生成 API 文档、提到 OpenAPI、Swagger、接口文档、路由扫描或从代码自动提取接口信息时触发。
- License
- MIT
- Instructions
- 125 lines in SKILL.md · view on GitHub
Before installing
- Ships executable scripts
Files (3)
- LICENSE
- SKILL.md
- generate_api_doc.py · scripts/
SKILL.md (first lines)
# api-doc-generator
从源代码中的路由/端点定义自动扫描并生成符合 [OpenAPI 3.0.3](https://spec.openapis.org/oas/v3.0.3) 规范的 RESTful API 文档。
支持主流 Web 框架,自动检测框架类型,提取 HTTP 方法、路径、参数、请求体、响应模型和文档注释,输出可直接导入 Swagger UI / Redoc 的标准 OpenAPI 规范文件。
## Quick Start
```bash
# 扫描源码目录,输出 JSON 格式 OpenAPI spec
python scripts/generate_api_doc.py ./src
# 指定输出格式和文件
python scripts/generate_api_doc.py ./src --format yaml --output api-spec.yaml
# 指定框架和 API 元信息
python scripts/generate_api_doc.py ./app --framework flask --title "My API" --version 2.0.0
# 添加服务器地址
python scripts/generate_api_doc.py ./routes --server http://localhost:3000 --server https://api.example.com
```
## 支持的框架
| 语言 | 框架 | 解析方式 |
|---|---|---|
| Python | Flask | AST 解析(装饰器 + 类型注解 + docstring) |
| Python | FastAPI | AST 解析(装饰器 + Pydantic 模型 + 类型注解) |
| Python | Django REST Framework | AST 解析(`@api_view` 装饰器) |
| JavaScript/TypeScript | Express.js | 正则匹配(`app.get()` / `router.get()` + JSDoc) |
| Go | Gin | 正则匹配(`r.GET()` / `group.GET()` + 注释) |
| Go | Echo | 正则匹配(`e.GET()` + 注释) |
## 提取能力
脚本会自动提取以下信息:
- **HTTP 方法**:GET / POST / PUT / DELETE / PATCH 等
- **路由路径**:自动转换各框架路径参数格式为 OpenAPI `{param}` 格式
- **路径参数**:从路由模式中提取(含类型推断)
- **查询参数**:从函数签名中提取(Python 框架)
- **请求体**:从类型注解和 Pydantic 模型中推断(FastAPI)
- **响应模型**:从 `response_model` 参数中提取(FastAPI)
- **接口描述**:从 docstring / JSDoc / 行注释中提取
- **标签分组**:按源文件模块名自动分组
## 路径参数格式转换
| 框架 | 源格式 | 转换结果 |
|---|---|---|
| Flask | `<int:user_id>` | `{user_id}` (type: integer) |
| FastAPI | `{user_id}` | `{user_id}` (保持不变) |
| Express | `:user_id` | `{user_id}` |
| Gin/Echo | `:user_id` | `{user_id}` |
## 参数说明
| 参数 | 说明 | 默认值 |
|---|---|---|
| `source_dir` | 要扫描的源码目录(必填) | - |
| `-f, --format` | 输出格式:`json` 或 `yaml` | `json` |
| `-o, --output` | 输出文件路径 | stdout |
| `--framework` | 强制指定框架(不自动检测) | 自动检测 |
| `--title` | API 文档标题 | `API Documentation` |
| `--version` | API 版本号 | `1.0.0` |
| `--description` | API 描述文字 | 空 |
| `--server` | 服务器地址(可多次指定) | 无 |
## 输出示例
```json
{
"openapi": "3.0.3",
"info": {
"title": "My API",
"version": "1.0.0"
},
"paths": {
"/users": {
"get": {
"summary": "List all users",
"operationId": "list_users",
"tags": ["users"],
"parameters": [
{
"name": "limit",
"in": "query",
"required": false,
"schema": { "type": "integer" }
}
],
"responses": {
"200": { "description": "Successful response" }
}
}
},
"/users/{user_id}": {
"get": {
"summary": "Get user by ID",
"operationId": "get_user",
"tags": ["users"],
"parameters": [
{
"name": "user_id",
"in": "path",
"required": true,
"schema": { "type": "integer" }
}
],
"responses": {
"200": { "description": "Successful response" }
}
}
}
}
}
```
## 前置条件From serejaris/kimi-skills, MIT.
More from serejaris/kimi-skills
- 0.543score
astro-observation-report
serejaris
Skill for writing gravitational-wave observational results papers for compact binary coalescence events (BNS, BBH, NSBH) detected by LIGO, Virgo, or KAGRA.
SkillCFreshness: C★ 9Claude Code +9 - 0.543score
anki-card-maker
serejaris
Extract key knowledge from study materials (text, Markdown, notes) and generate front-question + back-answer flashcards, producing an Anki-compatible CSV file…
SkillCFreshness: C★ 9Claude Code +9 - 0.538score
imf
serejaris
IMF provides global macroeconomic data through the World Economic Outlook database, including historical statistics and forecasts for GDP growth, inflation…
SkillCFreshness: C★ 9Claude Code +9 - 0.538score
about-me-avatar
serejaris
Generate a 1-bit monochrome pixel-art portrait from a user's About Me.
SkillCFreshness: C★ 9Claude Code +9 - 0.538score
audience-adaptive-comms
serejaris
Adapt stakeholder communication to the target audience (CEO, VP, Tech Lead, or Operations), adjusting detail level, language, and focus.
SkillCFreshness: C★ 9Claude Code +9 - 0.538score
scholar
serejaris
A freely accessible web search engine that indexes the full text or metadata of scholarly literature across an array of publishing formats and disciplines.
SkillCFreshness: C★ 9Claude Code +9 - 0.538score
adhd-assistant
thinktankmachine
ADHD-friendly life management assistant for daily planning, task breakdown, time management, and maintaining routines.
SkillCFreshness: C★ 9Claude Code +9 - 0.534score
audio_generation
serejaris
Generate audio in two ways: text-to-speech, or custom sound effects.
SkillCFreshness: C★ 9Claude Code +9 - 0.534score
world_bank_open_data
serejaris
World Bank Open Data is a free global development data platform with access to countries worldwide and 29,000+ indicators covering economic, social, and…
SkillCFreshness: C★ 9Claude Code +9 - 0.531score
yahoo_finance
serejaris
Yahoo Finance provides stock information for a given ticker symbol, including stock price and trading information, company information, financial metrics…
SkillCFreshness: C★ 9Claude Code +9 - 0.531score
sec_edgar
serejaris
SEC EDGAR provides comprehensive US public company filings and financial data, including company info, filings, XBRL facts, financial statements, insider…
SkillCFreshness: C★ 9Claude Code +9 - 0.530score
image_generation
serejaris
Create an image based on a text description using AI image generation.
SkillCFreshness: C★ 9Claude Code +9
Signals
- Stars
- 9
- Forks
- 3
- Open issues
- 0
- Last commit (this folder)
- Jul 17, 2026 (3 months ago)
From GitHub (fetched Oct 24, 2026).
Details
- License
- MIT
- Repository
- github.com/serejaris/kimi-skills
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
Same skill elsewhere
Copies of this SKILL.md published by others; search shows only one of them.
- 0.492score
api-doc-gen
haomingz
从 Flask、FastAPI、Express 或 Gin 等 Web 框架的源代码中自动扫描路由定义,生成符合 OpenAPI 3.0 / Swagger 规范的标准化 API 文档文件。当用户需要生成 API 文档、提到 OpenAPI、Swagger、接口文档、路由扫描或从代码自动提取接口信息时触发。
SkillDFreshness: D★ 22Claude Code +9 - 0.345score
api-doc-gen
nstung463
从 Flask、FastAPI、Express 或 Gin 等 Web 框架的源代码中自动扫描路由定义,生成符合 OpenAPI 3.0 / Swagger 规范的标准化 API 文档文件。当用户需要生成 API 文档、提到 OpenAPI、Swagger、接口文档、路由扫描或从代码自动提取接口信息时触发。
SkillBFreshness: B★ 5Claude Code +9
More from serejaris
- 0.543score
anki-card-maker
serejaris
Extract key knowledge from study materials (text, Markdown, notes) and generate front-question + back-answer flashcards, producing an Anki-compatible CSV file…
SkillCFreshness: C★ 9Claude Code +9 - 0.543score
astro-observation-report
serejaris
Skill for writing gravitational-wave observational results papers for compact binary coalescence events (BNS, BBH, NSBH) detected by LIGO, Virgo, or KAGRA.
SkillCFreshness: C★ 9Claude Code +9 - 0.538score
about-me-avatar
serejaris
Generate a 1-bit monochrome pixel-art portrait from a user's About Me.
SkillCFreshness: C★ 9Claude Code +9 - 0.538score
imf
serejaris
IMF provides global macroeconomic data through the World Economic Outlook database, including historical statistics and forecasts for GDP growth, inflation…
SkillCFreshness: C★ 9Claude Code +9 - 0.538score
scholar
serejaris
A freely accessible web search engine that indexes the full text or metadata of scholarly literature across an array of publishing formats and disciplines.
SkillCFreshness: C★ 9Claude Code +9 - 0.538score
audience-adaptive-comms
serejaris
Adapt stakeholder communication to the target audience (CEO, VP, Tech Lead, or Operations), adjusting detail level, language, and focus.
SkillCFreshness: C★ 9Claude Code +9
Cite this page
api-doc-gen skill. Agent Mart. https://agentmart.dev/skills/serejaris-api-doc-gen (last updated 2026-10-24)