Docs · Claude Skill

API Documentation Skill

Generates clean API docs from your code. OpenAPI-compatible output, examples included.

Any stack

What it does

The API Documentation Skill produces complete, consistent API docs from route handlers, controllers, or OpenAPI fragments. Every endpoint gets a purpose, auth info, full request and response schemas, example curl + JSON, and an error table.

What it does when Claude uses it

Point Claude at a file or a route definition and it generates docs that follow a consistent structure: every field typed and described, ISO 8601 timestamps, consistent error envelope, deprecation notes where appropriate. Output is OpenAPI-friendly so it can be imported into Swagger or Redoc.

How to install

Which tool are you using?

Not sure? Claude.ai is the website. Claude Code is the command-line tool you install separately. Cursor is a code editor that reads .cursorrules.

  1. 01

    Download the skill file

    Click the Copy button on the code block below to grab the full contents of api-docs.md. Save it locally as api-docs.md.

  2. 02

    Create your skills folder

    Claude Code reads skills from ~/.claude/skills/. Create the folder if it does not exist.

    terminal
    mkdir -p ~/.claude/skills/
  3. 03

    Copy the file into the skills folder

    Move the file into your skills directory so Claude picks it up.

    terminal
    cp api-docs.md ~/.claude/skills/api-docs.md
  4. 04

    Verify installation

    Open Claude Code and run /skills list. You should see "api-docs" appear in the list.

    terminal
    /skills list
  5. 05

    Start using it

    Claude will now apply this skill automatically whenever the task matches the skill description. No extra prompting required.

The claude skill file

Copy the full contents below, or download the file directly.

api-docs.md
api-docs.md
---name: api-docsdescription: Use this skill when generating or updating API documentation. Produces OpenAPI-compatible docs with examples.--- # API Documentation Skill ## Structure per endpoint1. HTTP method + path2. One-line purpose3. Auth required? Scopes?4. Request: headers, path params, query params, body schema5. Response: status codes, body schema per status6. Example request (curl) + example response (JSON)7. Errors: list by status code with meaning ## Rules- Every field documented with type, required flag, description- Timestamps are ISO 8601 in UTC- IDs are strings, never ints- Errors return a consistent { code, message, details? } shape- Deprecations get a "Deprecated: use X instead" note

Example output

What Claude does before and after you install this claude skill.

Without this claude skill

Claude writes a one-paragraph blurb per endpoint with no schemas and no error codes. Useless for integrators.

With this claude skill

Claude produces a full reference: purpose, auth, params table, schemas, 200/400/401/403/500 responses, curl example, and an error table.

Customization tips

If your API uses a non-standard error envelope, update the Rules section. Teams that expose both public and internal endpoints can add a 'Visibility' field per endpoint. For GraphQL, adapt the Structure section to document queries, mutations, and subscriptions instead of REST verbs.

Related resources

Frequently asked questions

Does it output OpenAPI YAML?

By default it outputs Markdown reference docs. Ask for OpenAPI YAML explicitly and it will generate that shape.

Does it work for GraphQL?

Yes, but adapt the per-endpoint structure to query / mutation / subscription.

Can it document my existing code?

Paste the route handlers or controllers — Claude will infer request/response shapes.

Does it handle versioned APIs?

Yes. Add a version field per endpoint or group docs by version.

Is it compatible with Swagger UI?

Output OpenAPI YAML and point Swagger UI at it.

Want more like this?

Browse the full RohanKit library — free resources for Claude and Cursor.

Back to RohanKit