← Back to Skills Marketplace
sunshine-del-ux

API Docs Generator

by Sunshine-del-ux · GitHub ↗ · v1.0.0
cross-platform ⚠ suspicious
437
Downloads
0
Stars
2
Active Installs
1
Versions
Install in OpenClaw
/install api-docs-generator
Description
从代码注释自动生成 API 文档,支持 OpenAPI/Swagger 格式,输出 JSON 或 YAML。
README (SKILL.md)

API Docs Generator

自动从源代码生成专业的 API 文档。支持 OpenAPI 3.0 和 Swagger 2.0 规范。

功能

  • 📝 自动解析代码注释
  • 🌐 OpenAPI 3.0 支持
  • 📄 Swagger 2.0 支持
  • 📋 Postman Collection 导出
  • 🔄 自动检测 API 路由
  • 📖 生成可交互文档

支持的框架

框架 支持
Express.js
FastAPI
Flask
Gin
Spring Boot
Rails

使用方法

基本用法

# 生成 OpenAPI 文档
api-docs-generator openapi --input ./src --output docs/openapi.json

# 生成 Swagger 文档
api-docs-generator swagger --input ./src --output docs/swagger.yaml

# 生成 Postman Collection
api-docs-generator postman --input ./src --output docs/collection.json

选项

选项 说明
--input, -i 源代码目录
--output, -o 输出文件路径
--format, -f 输出格式 (json/yaml)
--title API 标题
--version API 版本

输出示例

{
  "openapi": "3.0.0",
  "info": {
    "title": "My API",
    "version": "1.0.0",
    "description": "API description"
  },
  "paths": {
    "/api/users": {
      "get": {
        "summary": "Get all users",
        "description": "Returns a list of users",
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": { "$ref": "#/components/schemas/User" }
                }
              }
            }
          }
        }
      }
    }
  }
}

文档展示

生成的文档可以用于:

  • Swagger UI
  • Redoc
  • Postman
  • Apiary

变现思路

  1. 付费模板 - 专业化文档模板
  2. 企业服务 - 为企业定制 API 文档
  3. 集成服务 - 与 GitHub/GitLab 集成
  4. 培训服务 - API 文档编写培训

示例

Express.js 项目

api-docs-generator openapi \
  --input ./server \
  --output ./docs/openapi.json \
  --title "My API" \
  --version "1.0.0"

FastAPI 项目

api-docs-generator openapi \
  --input ./app \
  --output ./docs/api.yaml \
  --format yaml

安装

# 无需额外依赖
Usage Guidance
This package advertises a powerful automatic API-docs generator but includes only a tiny shell script that emits a static OpenAPI JSON — it does not implement the parsing, framework support, or route detection described. Treat it as a stub or placeholder rather than a working tool. Before installing or running it on real projects: (1) inspect the script (you already can — it's short) to confirm behavior; (2) do not run untrusted tools against sensitive repositories without sandboxing, because a real implementation that parses code might read secrets or upload data; (3) ask the publisher for the actual implementation or a source repo/release artifacts; (4) prefer skills with verifiable install instructions or known upstream releases. The current mismatch is a quality/accuracy concern (suspicious) rather than a clear malicious indicator, but exercise caution.
Capability Analysis
Type: OpenClaw Skill Name: api-docs-generator Version: 1.0.0 The skill is classified as suspicious due to significant deception. The `SKILL.md` heavily advertises a sophisticated API documentation generator that parses code, supports multiple frameworks, and generates various formats (OpenAPI, Swagger, Postman). However, the actual `api-docs-generator.sh` script is a dummy that simply outputs a hardcoded, static JSON string, completely lacking any of the advertised code parsing or generation functionality. This deliberate misrepresentation of capabilities is deceptive and could mislead an AI agent or user into believing complex operations are being performed when they are not. Furthermore, the script's argument parsing is flawed, causing it to incorrectly interpret command-line arguments (e.g., treating `--input` as the output file path), leading to functional errors.
Capability Assessment
Purpose & Capability
The SKILL.md describes automated parsing of source comments, route detection, support for many frameworks, OpenAPI/Swagger generation and Postman export. The only code file (api-docs-generator.sh) writes a hard-coded OpenAPI JSON and does not parse input sources or implement any framework-specific logic. The README examples call a command name (api-docs-generator) while the repo supplies api-docs-generator.sh — a naming/installation mismatch. This is disproportionate: the requested/installed artifacts do not match the advertised capability.
Instruction Scope
The SKILL.md gives CLI usage examples that would read a source directory and produce documentation, but it does not instruct the agent to read unrelated files, environment variables, or send data externally. However, because the actual script is a stub, the documentation examples are misleading; a user or agent expecting real parsing would be surprised. There are no instructions that clearly exfiltrate data.
Install Mechanism
No install specification or network downloads are present; the skill is instruction-only with a small bundled shell script. This is low install risk (nothing downloaded from external URLs).
Credentials
The skill declares no required environment variables, credentials, or config paths. The SKILL.md and the included script do not request secrets or unrelated credentials.
Persistence & Privilege
The skill does not request always:true or other elevated persistence. It does not modify other skills or system-wide configuration in the provided materials.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install api-docs-generator
  3. After installation, invoke the skill by name or use /api-docs-generator
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.0
- Initial release of api-docs-generator. - Automatically generates API documentation from code comments. - Supports OpenAPI 3.0 and Swagger 2.0 formats. - Outputs documentation in JSON or YAML. - Exports Postman Collections. - Framework support includes Express.js, FastAPI, Flask, Gin, Spring Boot, and Rails.
Metadata
Slug api-docs-generator
Version 1.0.0
License
All-time Installs 2
Active Installs 2
Total Versions 1
Frequently Asked Questions

What is API Docs Generator?

从代码注释自动生成 API 文档,支持 OpenAPI/Swagger 格式,输出 JSON 或 YAML。 It is an AI Agent Skill for Claude Code / OpenClaw, with 437 downloads so far.

How do I install API Docs Generator?

Run "/install api-docs-generator" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is API Docs Generator free?

Yes, API Docs Generator is completely free (open-source). You can download, install and use it at no cost.

Which platforms does API Docs Generator support?

API Docs Generator is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created API Docs Generator?

It is built and maintained by Sunshine-del-ux (@sunshine-del-ux); the current version is v1.0.0.

💬 Comments