/api-doc-generator:api-doc-generatorfrom API Doc Generator: OpenAPI from Your Code
Generates and maintains OpenAPI 3.1 specs from real code routes. Scans Express, Fastify, Koa, Hono, NestJS, Next.js, FastAPI, Flask, Spring, and Go routers, reads handler types and responses, and writes YAML/JSON specs.
Ships in API Doc Generator: OpenAPI from Your Code. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Scripts: ${CLAUDE_SKILL_DIR} is the folder that contains this file. If your agent does not define it, use the folder where this SKILL.md is located.
Write an OpenAPI 3.1 file from the real routes in the code and keep it in sync.
python3 ${CLAUDE_SKILL_DIR}/scripts/routes_scan.py <server-dir>
python3 ${CLAUDE_SKILL_DIR}/scripts/routes_scan.py <server-dir> --json routes.json
It lists method, path and file:line for Express, Fastify, Koa and Hono routers, NestJS controllers, Next.js route handlers (app/**/route.ts) and API routes (pages/api), FastAPI, Flask, Spring and Go (net/http, chi, gin, echo). Path parameters are normalised to {id}.
Limits to check by reading the code:
app.use('/api', router), APIRouter(prefix=...), Blueprint(url_prefix=...) and global prefixes (app.setGlobalPrefix) are not applied. Add them.pages/api handlers are listed as ANY; read the handler to see which methods it accepts.For every route, read the handler and what it calls to find:
If the project already declares schemas (Zod, Pydantic, DTO classes), mirror them exactly and reuse names in components/schemas. If a framework generates OpenAPI already (FastAPI's /openapi.json, @nestjs/swagger, zod-openapi, springdoc), say so and prefer improving the annotations over writing a separate file.
openapi: 3.1.0, info with title and version from package.json or pyproject.toml, servers with the base path.operationId per operation, in camelCase from the handler name. Group with tags by resource.components/schemas and use $ref. Mark required fields and nullable (3.1: type: [string, "null"]).securitySchemes and security that match the real auth.example per request and response body. Never put real customer data or secrets in examples.openapi.yaml at the repository root or next to the server code.Do not invent endpoints, fields or status codes. When something is unclear, write it with a description that says so and list it in your answer.
python3 ${CLAUDE_SKILL_DIR}/scripts/routes_scan.py <server-dir> --openapi openapi.yaml
It prints routes that are in the code but not in the spec and spec operations with no matching route, and exits with code 1 when they differ, so it can run in CI. The servers base path is taken into account. Then compare parameters and schemas of changed handlers by reading them.
Only when asked:
openapi-typescript plus openapi-fetch, orval, or openapi-generator), and ask before installing anything.prism mock openapi.yaml (Stoplight Prism) if the user wants one, again asking before installing.@redocly/cli or swagger-cli is already installed, run its lint command on the file.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub petrovicistefan/claude-code-plugins --plugin api-doc-generatorOther plugins' skills for the same job