API Documentation Skill
Generates clean API docs from your code. OpenAPI-compatible output, examples included.
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.
- 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.
- 02
Create your skills folder
Claude Code reads skills from ~/.claude/skills/. Create the folder if it does not exist.
terminalshellmkdir -p ~/.claude/skills/ - 03
Copy the file into the skills folder
Move the file into your skills directory so Claude picks it up.
terminalshellcp api-docs.md ~/.claude/skills/api-docs.md - 04
Verify installation
Open Claude Code and run /skills list. You should see "api-docs" appear in the list.
terminalshell/skills list - 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.
---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" noteExample output
What Claude does before and after you install this claude skill.
Claude writes a one-paragraph blurb per endpoint with no schemas and no error codes. Useless for integrators.
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
README Writer
Writes complete, professional README files with setup instructions, usage examples, and badges.
API Designer
Designs RESTful APIs with proper resource naming, status codes, and error handling patterns.
Next.js Full Stack Skill
App router patterns, server components, API routes, and Next.js 14+ conventions baked into every response.
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.