skills/document-skills/api-doc-generator/SKILL.md
Generate API documentation by scanning Controller classes, extracting endpoint URLs, HTTP methods, parameters, and response structures, then producing standardized docs from templates. Use when the user explicitly mentions generating API documentation, creating API docs, scanning interfaces, or documenting REST APIs. Do not trigger for generic documentation requests without explicit API mention.
npx skillsauth add teachingai/agent-skills api-doc-generatorInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Scan code for API endpoints, extract interface details, and generate standardized documentation. Do NOT trigger for generic documentation requests without explicit API/interface mention.
./docs directory in the current projectCRITICAL: Before generating any documentation, you MUST scan the code to find API interfaces.
Identify Target:
@RestController, @Controller with @RequestMappingcontroller or web packageController.java or Controller.ktScan for Controllers:
@RestController or @ControllerCheck for Interfaces:
@GetMapping, @PostMapping, @PutMapping, @DeleteMapping@RequestMapping with method specificationValidation:
未找到任何接口,无法生成接口文档。请确认:
1. 项目中是否存在 Controller 类
2. Controller 类中是否有 @GetMapping、@PostMapping 等注解的方法
3. 是否指定了正确的扫描路径
Output: List of Controller classes and total number of interfaces found.
CRITICAL: For each interface, extract complete information including URL, method, parameters, and response.
For each API interface found, extract:
Basic Information:
Request Information:
/user/{id})
Response Information:
R<T>, ApiResponse<T>)Additional Information:
@ApiOperation, @Operation, or method comments@Api, @Tag annotations@Deprecated annotationOutput: Structured data for each interface with all extracted information.
CRITICAL: Generate documentation following the standard template format.
Select Template Language:
templates/接口文档模板.mdtemplates/api-documentation-template-en.mdLoad Template:
Organize by Module:
Generate Interface List Table:
Generate Interface Definitions: For each interface, generate:
Add Standard Sections:
Format Documentation:
Output: Complete API documentation in Markdown format.
CRITICAL: Save documentation to the ./docs directory in the current project.
Determine Output Path:
./docs/api-documentation.md./docs/{module-name}-api-documentation.mdCreate Directory:
./docs directory existsSave File:
Inform User:
Output: Documentation file saved to ./docs/api-documentation.md (or custom path).
Controller Identification:
@RestController or @Controller@RequestMapping at class level*.controller.*, *.web.*, *.api.*Method Identification:
@GetMapping, @PostMapping, @PutMapping, @DeleteMapping, @PatchMapping@RequestMapping(method = RequestMethod.GET) etc.Parameter Extraction:
@PathVariable: Path parameters@RequestParam: Query parameters@RequestBody: Request body@RequestHeader: Request headersResponse Extraction:
@ResponseBody annotationR<T>, Page<T>)Similar to Java, but check for:
String?, Int?)templates/接口文档模板.md - Chinese API documentation templatetemplates/api-documentation-template-en.md - English API documentation templateexamples/scan-and-generate-example.md - Complete workflow exampleAsk user for preferred language (Chinese/English). If not specified, detect from project context.
api documentation, api docs, generate api docs, scan interfaces, REST API, 接口文档, API文档, 生成接口文档, 扫描接口
development
Guidance for Next.js using the official docs at nextjs.org/docs. Use when the user needs Next.js concepts, configuration, routing, data fetching, or API reference details.
tools
Provides comprehensive guidance for Flask framework including routing, templates, forms, database integration, extensions, and deployment. Use when the user asks about Flask, needs to create web applications, implement routes, or build Python web services.
development
Provides comprehensive guidance for FastAPI framework including routing, request validation, dependency injection, async operations, OpenAPI documentation, and database integration. Use when the user asks about FastAPI, needs to create REST APIs, or build high-performance Python web services.
development
Provides comprehensive guidance for Django framework including models, views, templates, forms, admin, REST framework, and deployment. Use when the user asks about Django, needs to create web applications, implement models and views, or build Django REST APIs.