← 返回 Skills 市场
sunshine-del-ux

API Docs Generator

作者 Sunshine-del-ux · GitHub ↗ · v1.0.0
cross-platform ⚠ suspicious
437
总下载
0
收藏
2
当前安装
1
版本数
在 OpenClaw 中安装
/install api-docs-generator
功能描述
从代码注释自动生成 API 文档,支持 OpenAPI/Swagger 格式,输出 JSON 或 YAML。
使用说明 (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

安装

# 无需额外依赖
安全使用建议
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.
功能分析
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.
能力评估
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.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install api-docs-generator
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /api-docs-generator 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
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.
元数据
Slug api-docs-generator
版本 1.0.0
许可证
累计安装 2
当前安装数 2
历史版本数 1
常见问题

API Docs Generator 是什么?

从代码注释自动生成 API 文档,支持 OpenAPI/Swagger 格式,输出 JSON 或 YAML。 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 437 次。

如何安装 API Docs Generator?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install api-docs-generator」即可一键安装,无需额外配置。

API Docs Generator 是免费的吗?

是的,API Docs Generator 完全免费(开源免费),可自由下载、安装和使用。

API Docs Generator 支持哪些平台?

API Docs Generator 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 API Docs Generator?

由 Sunshine-del-ux(@sunshine-del-ux)开发并维护,当前版本 v1.0.0。

💬 留言讨论