Skip to content
⭐ Featureddocs

API Docs Generator

Generate OpenAPI 3 spec or markdown docs from your route handlers and types — Next.js, Express, Fastify, FastAPI.

/api-docs

Install this skill

  1. 1. Copy the SKILL.md content (button above)
  2. 2. Create a folder for the skill:
    # Mac/Linux
    mkdir -p ~/.claude/skills/api-docs
    
    # Windows (PowerShell)
    mkdir $env:USERPROFILE\.claude\skills\api-docs
  3. 3. Save the content as ~/.claude/skills/api-docs/SKILL.md
  4. 4. Restart Claude Code (or open a new session)
  5. 5. Type /api-docs to invoke it
openapiswaggerapidocumentation

/api-docs

Auto-document your REST API from the code.

Usage

/api-docs # detect framework, output to docs/openapi.yaml /api-docs --output api-spec.json # custom path + format /api-docs --format markdown # human-readable instead of OpenAPI

Frameworks supported

  • Next.js App Router (app/api/**/route.ts)
  • Next.js Pages Router (pages/api/**.ts)
  • Express (app.get('/users', ...))
  • Fastify (with schema definitions)
  • Hono
  • FastAPI (Python)

What it extracts

For each endpoint:

  • HTTP method + path
  • Path / query params with types
  • Request body shape (from Zod / Yup / TypeScript types)
  • Response shape (success + error)
  • Status codes used
  • Auth requirements (detects JWT / cookie / API key middleware)

Output

OpenAPI 3.1 YAML with:

  • info block from package.json
  • servers from env config
  • components.schemas deduplicated from shared types
  • tags grouped by route folder

Optionally renders to Swagger UI / Redoc HTML.

Rules

  • Don't invent endpoints that don't exist in code
  • If a response shape can't be inferred (returns unknown), mark explicitly with TODO
  • Sync only — never modify route handlers