api-doc-gen

Generate OpenAPI 3.0 specs by scanning source code for routes and endpoints.

12|2|Updated Apr 21, 2026
One-click install
npx skills add https://github.com/haomingz/kimi-skills --skill api-doc-gen-haomingz
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: api-doc-gen
Source: https://github.com/haomingz/kimi-skills/tree/main/skills/api-doc-gen
Command: npx skills add https://github.com/haomingz/kimi-skills --skill api-doc-gen-haomingz

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

自动化从代码中提取路由信息并生成符合 OpenAPI 3.0 规范的文档,减少手动编写文档的时间和错误。 该技能支持多种语言的 Web 框架,通过静态分析路由、参数、请求体与响应模型,生成可直接导入 Swagger UI / Redoc 的规范。

Core Features & Use Cases

  • 自动检测并解析主流 Web 框架中的路由定义(Python 的 Flask/FastAPI/Django、JS/TS 的 Express、Go 的 Gin/Echo),输出标准化的 OpenAPI 规格。
  • 提取路径参数、查询参数、请求体和响应模型,并自动生成合理的参数说明和示例。
  • 使用场景包括从现有源码快速产出 API 文档、保持文档与实现同步、为 API 门户和客户端提供可直接消费的规格。

Quick Start

运行该工具对源码目录进行扫描,输出一个符合 OpenAPI 3.0 的文档文件(JSON 或 YAML)。

Frequently Asked Questions about api-doc-gen

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I auto-generate OpenAPI documentation from existing source code?

To auto-generate OpenAPI documentation from source code, you scan your project directory to statically extract routes, parameters, request bodies, and responses, assembling a compliant OpenAPI 3.0 JSON or YAML specification.

Can I generate Swagger docs for Flask, Express, and Go Gin projects?

Yes, you can generate Swagger docs for Flask, Express, and Go Gin projects. The tool statically analyzes Python, JavaScript/TypeScript, and Go web frameworks to extract endpoints and output an OpenAPI specification.

Does generating OpenAPI specs from code require installing external dependencies?

Generating OpenAPI specs from code requires no external dependencies. The tool runs using only the Python standard library to scan source files and produce a JSON or YAML specification.

What is the best way to extract route parameters and response models for API documentation?

The best way to extract route parameters and response models for API documentation is static code analysis. This approach parses your web framework definitions to automatically capture paths and schemas without running the application.

Can I add server metadata to the OpenAPI spec generated from my codebase?

Yes, you can add optional server metadata to the OpenAPI spec generated from your codebase. The tool includes this metadata alongside the extracted paths and parameters in the final JSON or YAML output.