Guide · Agent skill
How to use the API Documentation Generator agent skill
Updated · written with AI from the project's own documentation and checked against our catalogue data
The doc-generator skill is a set of written instructions that tells an AI agent how to document an HTTP API by reading its source code. It is useful for backend developers and teams who need endpoint docs, an OpenAPI/Swagger draft, or copy-paste request examples. By the end of this guide you will know what the skill does, how to install it, how to ask for it in plain language, and what to check before publishing the output.
Quick start
- 1Download the ZIP. Download the doc-generator ZIP from this page.
- 2Unzip into a skills folder. Unzip it into ~/.claude/skills/ for personal use or into your project's .claude/skills/ folder.
- 3Or upload it in the Claude apps. Go to Settings → Capabilities → Skills and upload the ZIP.
- 4Point the agent at your code. Ask for documentation of specific files, routes or controllers in plain language.
- 5Request the output you need. Ask for endpoint docs, an OpenAPI spec, cURL or Python examples, or an authentication guide.
- 6Review and test the output. Check parameters, responses and examples against your code and a real test request before publishing.
What is an agent skill and what does doc-generator do?
An agent skill is a folder containing a SKILL.md file. The file gives an AI agent a name, a description of when to use it, and detailed instructions. When a request matches the description, the agent follows those instructions. This skill has no scripts and no extra tools; it is a single instruction file that sets a consistent documentation template.
Once installed, the agent can read your API source code and produce structured documentation: endpoint descriptions, parameter tables, sample success and error responses, and cURL, JavaScript and Python usage examples. The skill also covers OpenAPI/Swagger specs, SDK usage examples, integration guides, error code references and authentication guides.
- Endpoint description and parameter table (name, type, required, description)
- 200 success and 404 error sample responses in JSON
- cURL, JavaScript and Python examples per endpoint
- OpenAPI/Swagger specification
- Error code reference and authentication guide
Install the doc-generator skill
Download the ZIP of the skill from this page and unzip it. You can install it for yourself across all projects or for one project only.
For a personal install, unzip it into ~/.claude/skills/. For a single project, unzip it into the project's .claude/skills/ folder. Alternatively, in the Claude apps go to Settings → Capabilities → Skills and upload the ZIP there.
- Personal: ~/.claude/skills/
- Project only: .claude/skills/ inside your project
- Claude apps: Settings → Capabilities → Skills, then upload the ZIP
Trigger the skill with natural requests
You do not need a special command. The skill's description mentions creating or updating API docs, generating OpenAPI specs, and requests about API documentation, endpoints or instructions. Ask in plain language that names the code and the goal.
Good requests name the source files or endpoints and say what output you want, for example an OpenAPI draft or a cURL example for one route.
- "Document the endpoints in src/routes/users.ts as API docs."
- "Generate an OpenAPI spec for this Express API."
- "Write cURL and Python examples for POST /api/v1/orders."
- "Create an authentication guide for our API."
What each endpoint entry looks like
The skill uses a fixed template for every endpoint. Knowing it helps you check the output. Each entry has a heading with the method and path, a short description, a parameters table, a success response and an error response, and examples in three languages.
The template in the skill shows GET /api/v1/users/:id as an example, with a 200 success response, a 404 USER_NOT_FOUND response, and a cURL call that sends an Authorization Bearer header.
## GET /api/v1/users/:id
### 描述
简要说明这个端点做什么
### 参数
| 名称 | 类型 | 必填 | 说明 |
|------|------|------|------|
| id | string | 是 | 用户 ID |
### 响应
**200 成功**
```json
{
"id": "usr_123",
"name": "John Doe",
"email": "john@example.com",
"created_at": "2025-01-15T10:30:00Z"
}
```
**404 未找到**
```json
{
"error": "USER_NOT_FOUND",
"message": "User does not exist"
}
```Check the output before you publish it
The examples are generated from reading code, not from calling a live service. Sample responses, field values and URLs may not match real behaviour, so treat them as drafts.
Review every generated sample against your code and a real request before sharing docs with external users. Replace placeholder tokens and example domains with your real values.
- Compare parameter tables with your validation code.
- Run the cURL example against a test environment.
- Confirm error codes exist in your code.
- Remove invented URLs or sample fields.
Safety notes: scripts and network
The skill runs no scripts and uses no network access, according to its listing. It requires nothing beyond the agent itself. It only reads the code you give it and writes documentation text.
Because it does not contact your service, it cannot confirm that a route, field or status code is real. Review generated content before publishing, especially if it includes credentials or internal URLs.
- Runs scripts: no
- Uses network: no
- Requires: nothing listed
What people use it for
- Writing endpoint reference pages for a REST API that changes often.
- Drafting an OpenAPI/Swagger spec for an existing service.
- Giving external developers copy-paste cURL and Python examples.
- Producing an error code reference from your error handlers.
- Writing an authentication guide for API consumers.
Frequently asked questions
How do I install the doc-generator skill?
Download the ZIP from this page and unzip it into ~/.claude/skills/ for personal use, or into a project's .claude/skills/ folder. You can also upload the ZIP in the Claude apps under Settings → Capabilities → Skills.
What do I need to use doc-generator?
The listing states that nothing extra is required. It runs no scripts and uses no network access, so it works by reading the code you provide and producing documentation text.
Is the doc-generator skill free?
The repository is published under the MIT licence. This page does not list pricing, so check the source repository for licence terms before reuse.
Can doc-generator create an OpenAPI or Swagger spec?
Yes. The skill lists OpenAPI/Swagger specifications among the outputs it can produce. Review the generated spec against your actual routes and validation rules before using it.
Why do my generated examples not match the live API?
The skill generates examples from reading source code and does not call your service. Sample responses and URLs can differ from real behaviour, so test them in a development environment.
Does doc-generator work for libraries or CLIs?
No. The template is built around HTTP endpoints, so it is not suited to libraries or command-line tools. Use it for projects that expose an HTTP API.
New agent skills, repos and AI tools — every week
The best new skills and open-source projects, the fastest-growing repos, and one free prompt. Five minutes to read. Unsubscribe anytime.
Our verdict
Use doc-generator if you have a backend HTTP API and want a consistent first draft of endpoint docs, examples and an OpenAPI spec from your code. Skip it if your project has no HTTP endpoints, or if you need docs verified against a live service; in that case, write or test the docs manually, or pair the draft with real request testing.
Download the skill