Token导航 LogoToken导航TokenDH.com
研究检索可写文件github未标认证来源可访问clear审计异常

api-doc-generatorAPI DOC 生成器

Agent Skill

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

总安装

1,458

周安装

62

GitHub Stars

347

下载量

511
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

3

许可证

MIT

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

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

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/teachingai/full-stack-skills --skill api-doc-generator

简介

自动扫描代码中的 API 端点并生成标准化文档。

  • 提取请求路径、参数、响应结构和认证方式等信息。
  • 输出 Markdown 格式文档并存入项目 docs 目录。
  • 仅在被明确要求生成 API 文档时触发执行。适用宿主包括 Codex、Claude、Cursor、Gemini CLI,接入前应确认版本、权限和运行环境要求。
  • api-doc-generator 属于研究检索类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

How to use this skill

Scan code for API endpoints, extract interface details, and generate standardized documentation. Do NOT trigger for generic documentation requests without explicit API/interface mention.

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

Templates and References

  • templates/接口文档模板.md - Chinese API documentation template
  • templates/api-documentation-template-en.md - English API documentation template
  • examples/scan-and-generate-example.md - Complete workflow example

Ask user for preferred language (Chinese/English). If not specified, detect from project context.

Best Practices

  1. Extract all available information from code annotations and comments
  2. Follow the template structure strictly
  3. Include realistic response examples with proper JSON formatting
  4. Document common error scenarios and codes
  5. Organize interfaces by module or Controller class

Keywords

api documentation, api docs, generate api docs, scan interfaces, REST API, 接口文档, API文档, 生成接口文档, 扫描接口

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

04

需要参考平台分布和安装热度时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

能力 5

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Claude Code

30.13%
按下载量换算154

Antigravity

22.5%
按下载量换算115

Gemini CLI

17.28%
按下载量换算88

OpenCode

11.11%
按下载量换算57

trae

6.75%
按下载量换算34

Codex

3.28%
按下载量换算17

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

未通过

权限和风险

可写文件

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

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。

来源信息

继续浏览同类 Skills