Token导航 LogoToken导航

Agent Skill · 研究检索

api-doc-generator(API DOC 生成器)

用于辅助 API 设计、接口文档、请求响应结构和服务集成说明。它适合让 Agent 梳理 endpoint、生成 OpenAPI 草稿、检查字段命名、整理错误码或辅助前后端联调。使用时需要确认真实业务语义、鉴权方式、分页和错误处理规则;涉及生成接口文档时,应避免凭空补字段,最好从现有代码、schema 或接口样例中提取事实。

api-doc-generator 是研究检索类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为可写文件;许可证为 MIT,暂无第三方扫描结果,按安装量在研究检索类的 73,674 个 Skill 里排第 57,864。

总安装 423周安装 18GitHub Stars 公开资料未说明下载 148核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
MIT

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:api-doc-generator(API DOC 生成器)
来源仓库:https://github.com/teachingai/agent-skills
仓库路径:skills/api-doc-generator
安装命令:
npx skills add teachingai/agent-skills --skill "api-doc-generator"
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

AgentSkills.tonpx skills
npx skills add teachingai/agent-skills --skill "api-doc-generator"

这个 Skill 是做什么的

研究检索类 Skill 主要解决「找资料、核对事实、把来源整理清楚」的问题,通常会让助手先检索再总结。

api-doc-generator 能根据代码注释或接口定义自动生成 OpenAPI 规范的文档草稿。适合前后端协作场景,帮助统一接口描述、参数说明和错误码约定,减少沟通成本。支持 Swagger UI 可视化展示,便于测试和分享,同时可导出 Markdown 或 HTML 格式存档。

安装前需确保项目存在清晰的接口契约(如 JSDoc、Python docstring),否则生成结果可能不完整。强烈建议人工复核自动生成的字段类型和示例值,避免因反射解析错误导致客户端调用失败。

来源仓库内路径:skills/api-doc-generator

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add teachingai/agent-skills --skill "api-doc-generator";命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要可写文件,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

api-doc-generator 怎么安装?

在终端执行 npx skills add teachingai/agent-skills --skill "api-doc-generator"。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

api-doc-generator 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

api-doc-generator 需要什么权限?

权限级别是可写文件。该 Skill 可能写入或修改本地文件,使用前需要确认目标目录和修改范围。

api-doc-generator 是免费的吗?

来源标注的许可证是 MIT。本站不代收任何费用,也不托管安装包;能否商用、要不要署名,以许可证原文为准。

api-doc-generator 用的人多吗?

公开数据是累计安装 423 次,近一周安装 18 次,下载 148 次。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

api-doc-generator 安全吗?

没有查到第三方扫描结果,安全性无法从公开资料判断,安装前请自行审查源码、依赖和命令行为。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 许可证明确为 MIT,商用和分发边界好判断。

先想清楚的地方

  • 没有第三方扫描结果,安全性只能靠自己读源码判断。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理研究检索类任务、又不想每次都手写提示词的人。

不太适合

  • 要求有安全扫描结论才肯安装的团队。
  • 需要厂商级技术支持和 SLA 的生产系统。

研究检索类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
find-skills

寻找技能 · Codex、Claude

31,199,81316,486操作浏览器MIT有提醒
self-improving-agent

自我改进 Agent · OpenClaw

16,464,0023,396接触敏感数据MIT-0通过
soultrace

灵魂追踪 · Codex、Claude

7,588,94412需要联网未明确有提醒
self-improving

自我完善 · OpenClaw

6,829,2841,046需要联网MIT-0通过
microsoft-foundry

微软代工厂 · Codex、Claude

6,614,144764调用外部服务未明确有提醒
api-doc-generator

API DOC 生成器 · 本页

423—可写文件MIT未收录

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

When to use this skill

CRITICAL: This skill should ONLY be triggered when the user explicitly mentions generating API documentation, creating API docs, scanning interfaces, or documenting APIs.

ALWAYS use this skill when the user mentions:

  • Generating API documentation (explicitly mentions "API documentation" or "API docs")
  • Creating API documentation from code
  • Scanning interfaces to generate documentation
  • Documenting REST APIs
  • 生成接口文档 (explicitly mentions "接口文档")
  • 扫描接口生成文档 (scan interfaces to generate documentation)
  • 创建API文档 (create API documentation)

Trigger phrases include:

  • "生成接口文档" (generate API documentation) - must include "接口文档"
  • "扫描接口生成文档" (scan interfaces to generate documentation)
  • "创建API文档" (create API documentation)
  • "为接口生成文档" (generate documentation for interfaces)
  • "接口文档生成" (API documentation generation)

DO NOT trigger this skill for:

  • Generic documentation requests without mentioning API/interfaces
  • Code comments generation
  • README file generation
  • Other types of documentation (user guides, technical specs, etc.)
  • "生成文档" without "接口" or "API" (too generic)

How to use this skill

CRITICAL: This skill should ONLY be triggered when the user explicitly mentions generating API documentation. Do NOT trigger for generic documentation requests without API context.

Workflow Overview

This skill follows a systematic 4-step workflow:

  1. Scan Code - Check current project or specified objects for Controller classes and API interfaces
  2. Extract Information - Scan interfaces to collect request URL, method, parameters, and response information
  3. Generate Documentation - Create API documentation following the standard template
  4. Save Output - Save documentation to ./docs directory in the current project

Step-by-Step Process

Step 1: Scan Code for Interfaces

CRITICAL: Before generating any documentation, you MUST scan the code to find API interfaces.

  1. Identify Target:

- Ask user if they want to scan the entire project or specific Controller classes - If no target specified, scan the entire project for Controller classes - Common Controller patterns: - Java: @RestController, @Controller with @RequestMapping - Spring Boot: Classes in controller or web package - Files ending with Controller.java or Controller.kt

  1. Scan for Controllers:

- Search for Controller classes in the project - Identify all classes annotated with @RestController or @Controller - List all found Controller classes

  1. Check for Interfaces:

- For each Controller class, scan for methods annotated with: - @GetMapping, @PostMapping, @PutMapping, @DeleteMapping - @RequestMapping with method specification - Count total number of API interfaces found

  1. Validation:

- If no interfaces found, STOP and inform user: 未找到任何接口,无法生成接口文档。请确认: 1. 项目中是否存在 Controller 类 2. Controller 类中是否有 @GetMapping、@PostMapping 等注解的方法 3. 是否指定了正确的扫描路径 - If interfaces found, proceed to Step 2

Output: List of Controller classes and total number of interfaces found.

Step 2: Extract Interface Information

CRITICAL: For each interface, extract complete information including URL, method, parameters, and response.

For each API interface found, extract:

  1. Basic Information:

- Interface Name: Method name or description from annotation - Request Method: GET, POST, PUT, DELETE, PATCH - Request URL: Full path including class-level and method-level mappings - Controller Class: Full class name with package - Method Name: Java/Kotlin method name

  1. Request Information:

- Path Parameters: Parameters in URL path (e.g., /user/{id}) - Parameter name, type, required flag, description - Query Parameters: Parameters in query string - Parameter name, type, required flag, default value, description - Request Body (for POST/PUT): - Body type (JSON, Form-data, etc.) - Field definitions: name, type, required flag, description - Nested object structures - Request Headers: - Common headers: Authorization, Shop-Id, Tenant-Id - Custom headers if any

  1. Response Information:

- Response Type: Return type of the method - Response Structure: - Standard response wrapper (e.g., R<T>, ApiResponse<T>) - Data object structure - Response Fields: - Field name, type, description - Nested object fields - Response Examples: Generate example JSON responses - Error Responses: Common error codes and messages

  1. Additional Information:

- Description: From @ApiOperation, @Operation, or method comments - Tags: From @Api, @Tag annotations - Deprecated: Check for @Deprecated annotation - Security: Authentication/authorization requirements

Output: Structured data for each interface with all extracted information.

Step 3: Generate Documentation

CRITICAL: Generate documentation following the standard template format.

  1. Select Template Language:

- Ask user for preferred language: Chinese or English - If not specified, detect from project context (code comments, package names, etc.) - Available templates: - Chinese: templates/接口文档模板.md - English: templates/api-documentation-template-en.md

  1. Load Template:

- Load the appropriate template based on language selection - Use it as the base structure

  1. Organize by Module:

- Group interfaces by Controller class or business module - Create sections for each module

  1. Generate Interface List Table:

- For Chinese template: Create "接口一览表" with columns: - 序号 (Sequence number) - 接口地址 (Interface URL) - 请求方式 (Request Method) - 说明 (Description) - 完成情况 (Status) - For English template: Create "API Interface List" with columns: - No. (Sequence number) - Interface URL - Method - Description - Status

  1. Generate Interface Definitions: For each interface, generate:

- Interface Name: Clear, descriptive name - Interface Address: Full URL with method - Description: - Corresponding Controller class and method - Business functionality description - Business rules if any - Request Section: - Method and URL - Headers table - Path Parameters table - Query Parameters table - Request Body (if applicable) with field definitions - Response Section: - Response structure description - Response fields table - Response example (JSON) - Error response examples

  1. Add Standard Sections:

- For Chinese template: - 统一响应结构: Standard response format - 分页响应格式: Pagination response format - 错误码约定: Error code conventions - 请求头规范: Request header specifications - 注意事项: Important notes - For English template: - Standard Response Structure: Standard response format - Pagination Response Format: Pagination response format - Error Code Conventions: Error code conventions - Request Header Specifications: Request header specifications - Important Notes: Important notes

  1. Format Documentation:

- Use proper Markdown formatting - Ensure tables are properly formatted - Include code blocks for JSON examples - Add proper headings hierarchy

Output: Complete API documentation in Markdown format.

Step 4: Save Documentation

CRITICAL: Save documentation to the ./docs directory in the current project.

  1. Determine Output Path:

- Default: ./docs/api-documentation.md - If multiple modules: ./docs/{module-name}-api-documentation.md - Ask user if they want a custom filename

  1. Create Directory:

- Check if ./docs directory exists - If not, create it automatically

  1. Save File:

- Write the generated documentation to the file - Use UTF-8 encoding - Ensure proper line endings

  1. Inform User:

- Tell user where the file was saved - Show the file path - Optionally display a preview of the documentation

Output: Documentation file saved to ./docs/api-documentation.md (or custom path).

Code Scanning Guidelines

Java/Spring Boot Projects

Controller Identification:

  • Look for classes annotated with @RestController or @Controller
  • Check for @RequestMapping at class level
  • Common package patterns: *.controller.*, *.web.*, *.api.*

Method Identification:

  • Methods annotated with:

- @GetMapping, @PostMapping, @PutMapping, @DeleteMapping, @PatchMapping - @RequestMapping(method = RequestMethod.GET) etc.

Parameter Extraction:

  • @PathVariable: Path parameters
  • @RequestParam: Query parameters
  • @RequestBody: Request body
  • @RequestHeader: Request headers
  • Parameter types from method signature

Response Extraction:

  • Return type from method signature
  • @ResponseBody annotation
  • Generic types (e.g., R<T>, Page<T>)
  • Response entity structure
Kotlin/Spring Boot Projects

Similar to Java, but check for:

  • Kotlin data classes for request/response
  • Nullable types (String?, Int?)
  • Kotlin-specific annotations

Documentation Template Structure

The generated documentation follows this structure (available in both Chinese and English):

Chinese Template (templates/接口文档模板.md):

  1. 文档概览 (Document Overview)

- Version history table - Responsibility table

  1. 接口一览表 (Interface List Table)

- Summary table of all interfaces

  1. 接口定义 (Interface Definitions)

- Detailed definition for each interface - Request and Response sections - Field definitions and examples

  1. 统一响应结构 (Standard Response Structure)

- Standard response format - Pagination format - Error codes

  1. 请求头规范 (Request Header Specifications)
  2. 注意事项 (Important Notes)

English Template (templates/api-documentation-template-en.md):

  1. Document Overview

- Version history table - Responsibility table

  1. API Interface List

- Summary table of all interfaces

  1. Interface Definitions

- Detailed definition for each interface - Request and Response sections - Field definitions and examples

  1. Standard Response Structure

- Standard response format - Pagination format - Error codes

  1. Request Header Specifications
  2. Important Notes

Template Selection:

  • Ask user for preferred language (Chinese/English)
  • If not specified, detect from project context
  • Both templates follow the same structure, only language differs

Best Practices

  1. Complete Information: Extract all available information from code, including annotations and comments
  2. Standard Format: Follow the template structure strictly
  3. Clear Descriptions: Use meaningful descriptions from code comments or annotations
  4. Examples: Include realistic response examples
  5. Error Handling: Document common error scenarios
  6. Grouping: Organize interfaces by module or Controller class
  7. Validation: Verify all extracted information is accurate

Reference Documentation

  • Templates:

- templates/接口文档模板.md - Standard API documentation template (Chinese) - templates/api-documentation-template-en.md - Standard API documentation template (English)

  • Example: examples/scan-and-generate-example.md - Complete workflow example showing how to scan and generate API documentation

Keywords

English keywords: api documentation, api docs, generate api documentation, create api docs, scan interfaces, document apis, rest api documentation, interface documentation, api doc generator, scan controllers, extract api information

Chinese keywords (中文关键词): 接口文档, API文档, 生成接口文档, 创建接口文档, 扫描接口, 接口文档生成, API文档生成, 接口文档生成器, 扫描Controller, 提取接口信息, 接口文档模板

IMPORTANT: All keywords must include "接口文档" (API documentation) or "API" to avoid false triggers. Generic terms like "生成文档" (generate documentation) without "接口" or "API" should NOT trigger this skill.

平台分布

Claude Code

29.76%
按下载量换算44

qoder

21.67%
按下载量换算32

Antigravity

18.52%
按下载量换算27

Codex

13.41%
按下载量换算20

windsurf

9.11%
按下载量换算13

Gemini CLI

3.77%
按下载量换算6

安全审计

暂无安全审计结果可展示。

权限和风险

可写文件

该 Skill 可能写入或修改本地文件,使用前需要确认目标目录和修改范围。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。目前只有一个公开来源,建议同时核对源仓库。

继续浏览同类 Skills