api-doc-gen

api-doc-gen is a skill for Claude Code, Codex from serejaris/kimi-skills. It costs 81 tokens per session (1,233 once invoked), scanned A, original, MIT.

A source-code scanner that creates API documentation in the OpenAPI 3.0 format. OpenAPI is a standard description of web endpoints that tools such as Swagger UI and Redoc can display.

In plain words
What is it for?
Use it to scan Flask, FastAPI, Django REST Framework, Express, Gin, and Echo applications and export JSON or YAML documentation.
Why use it?
It removes the need to document every route and parameter manually, reducing the gap between the code and its API documentation.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to scan Flask, FastAPI, Django REST Framework, Express, Gin, and Echo applications and export JSON or YAML documentation.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/serejaris/kimi-skills/api-doc-gen
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add serejaris/kimi-skills --skill api-doc-gen
Clone the repo
git clone --depth 1 https://github.com/serejaris/kimi-skills

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for api-doc-gen

README.md
[![agentmods](https://agentmods.dev/badge/skills/serejaris/kimi-skills/api-doc-gen/github.svg)](https://agentmods.dev/skills/serejaris/kimi-skills/api-doc-gen)
Your own site
<a href="https://agentmods.dev/skills/serejaris/kimi-skills/api-doc-gen"><img src="https://agentmods.dev/badge/skills/serejaris/kimi-skills/api-doc-gen/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for api-doc-gen

Your own site · 80×15
<a href="https://agentmods.dev/skills/serejaris/kimi-skills/api-doc-gen"><img src="https://agentmods.dev/badge/skills/serejaris/kimi-skills/api-doc-gen.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 81 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,233 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00081 $0.01233
Opus 5 $0.00041 $0.00616
Sonnet 5 $0.00016 $0.00247
Haiku 4.5 $0.00008 $0.00123

Measured 10d ago against content hash 844415f80ada, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, from the pricing page.

Security

Grade A, and why

api-doc-gen scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 10d ago.

The scan reads SKILL.md. This mod also ships 1 executable file (scripts/generate_api_doc.py), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/api-doc-gen/SKILL.md · 130 lines

How it starts

The opening of the file, as written. The whole thing — 130 lines — stays where its author put it; the contents beside it link to each section on GitHub.

api-doc-generator

从源代码中的路由/端点定义自动扫描并生成符合 OpenAPI 3.0.3 规范的 RESTful API 文档。

支持主流 Web 框架,自动检测框架类型,提取 HTTP 方法、路径、参数、请求体、响应模型和文档注释,输出可直接导入 Swagger UI / Redoc 的标准 OpenAPI 规范文件。

Quick Start

# 扫描源码目录,输出 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 输出格式:jsonyaml json
-o, --output 输出文件路径 stdout
--framework 强制指定框架(不自动检测) 自动检测
--title API 文档标题 API Documentation
--version API 版本号 1.0.0
--description API 描述文字
--server 服务器地址(可多次指定)

输出示例

{
  "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" }
        }
      }
    }
  }
}

Read the full file on GitHub · 130 lines

Files

What ships with it

2 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 10d ago First seen · 130 lines · 81 tokens per session scan A 844415f80ada

Subscribe to this mod's changes

api-doc-gen is a skill published in the GitHub repository serejaris/kimi-skills (6 stars, last pushed 1mo ago), licensed MIT. It adds 81 tokens to every session and 1,233 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories