Skill library / Claude Code

API Documentation skill for Claude Code

API docs drift the moment code changes. This skill has Claude Code read your handlers and types directly and regenerate accurate reference docs, with request and response examples that actually match.

Customise this skill free →

What it's good for

How the skill works

  1. Locate route definitions and their request/response types
  2. For each endpoint record method, path, auth, params and status codes
  3. Write a curl example and a sample JSON response
  4. Note errors and edge cases from the handler code
  5. Update docs/api.md, preserving any hand-written sections

Built-in rules

Example

You: “Document the /orders endpoints”
Result: docs/api.md updated with 5 endpoints, params tables, curl examples and error codes.

SKILL.md template

Save as api-documentation/SKILL.md.

---
name: api-documentation
description: "Generates and updates API reference docs from route handlers and types, including endpoints, parameters, responses and examples. Use when the user asks to document an API, endpoint or update the API docs."
---

# API Documentation

## Workflow
1. Locate route definitions and their request/response types
2. For each endpoint record method, path, auth, params and status codes
3. Write a curl example and a sample JSON response
4. Note errors and edge cases from the handler code
5. Update docs/api.md, preserving any hand-written sections

## Rules
- Document only what the code does, not what it should do
- Never include real secrets or tokens in examples
- Mark deprecated endpoints clearly

How to install in Claude Code

Unzip into .claude/skills/ in your project (or ~/.claude/skills/ for all projects) and invoke it with /skill-name.

Pro tip

Add a scripts/ helper that lists routes so the skill doesn't need to search the whole repo each time.

Want it tailored to how you work?

Answer a few questions and get a customised version with examples, a Cursor rule and GPT/Gem instructions, emailed free.

Make my version →

FAQ

How do I install the api documentation skill in Claude Code?

Unzip into .claude/skills/ in your project (or ~/.claude/skills/ for all projects) and invoke it with /skill-name.

Is it free?

Yes. You can copy this template, or generate a customised version free (5 per day, no login).

Does it work on other platforms?

Yes. The SKILL.md follows the open Agent Skills standard, and every generated package also includes a Cursor rule and ChatGPT/Gemini instructions.

Related skills