Skip to main content
skill CX Codex

doc-generator · luongnv89 — Claude Code skill: API docs from source code

Reads your source and writes endpoint docs: OpenAPI specs, request examples, error codes. Useful when the API grew faster than the README.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add luongnv89/claude-howto --skill doc-generator -a claude-code
Open on GitHub

What doc-generator does

The doc-generator skill walks your code and produces documentation per endpoint. Each entry follows a template: a short description, a parameter table, success and error response samples, plus ready calls in cURL, JavaScript and Python. It also covers OpenAPI/Swagger specs, SDK usage examples, integration guides, an error code reference and an authentication section.

Install with npx skills add luongnv89/claude-howto --skill doc-generator -a claude-code; the skill file lands at ~/.claude/skills/doc-generator/SKILL.md. The same repository ships variants for Codex, Cursor, GitHub Copilot, Gemini CLI and OpenCode — only the platform flag changes. GitHub Copilot uses gh skill install instead.

Output quality tracks your code. If routes carry no types or request validation, expect to hand-check the parameter tables afterwards. That is the part worth reviewing before you commit generated docs.

What it helps with

  • generate an OpenAPI spec from existing routes
  • document parameters and responses for every endpoint
  • add cURL, JavaScript and Python call samples
  • build an error code reference for the API
  • write an authentication guide for outside developers

Example prompts for the agent

  • generate endpoint docs from the routes in src/routes
  • build an OpenAPI spec for our API with response examples
  • refresh the error code reference from the current code

How to install doc-generator

1Skills CLI (Vercel)

npx skills add luongnv89/claude-howto --skill doc-generator -a claude-code

2Manually: put the files in place

~/.claude/skills/doc-generator/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/doc-generator/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about doc-generator

How do I install doc-generator in Claude?

Run npx skills add luongnv89/claude-howto --skill doc-generator -a claude-code. The skill file goes to ~/.claude/skills/doc-generator/SKILL.md.

What does doc-generator do?

It turns source code into API documentation: endpoint descriptions, parameters, response samples, cURL, JavaScript and Python calls, and OpenAPI/Swagger specs.

Which platforms does doc-generator support?

It installs into Claude, Codex, Cursor, GitHub Copilot, Gemini CLI and OpenCode. The install command stays the same, only the platform flag changes.

Source text

SKILL.md · MIT
---
name: doc-generator
description: Generate comprehensive, accurate API documentation from source code. Use when creating or updating API documentation, generating OpenAPI specs, or when users mention API docs, endpoints, or documentation.
---

# API Documentation Generator Skill

## Generates

- OpenAPI/Swagger specifications
- API endpoint documentation
- SDK usage examples
- Integration guides
- Error code references
- Authentication guides

## Documentation Structure

### For Each Endpoint

````markdown
## GET /api/v1/users/:id

### Description
Brief explanation of what this endpoint does

### Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| id | string | Yes | User ID |

### Response

**200 Success**
```json
{
  "id": "usr_123",
  "name": "John Doe",
  "email": "[email protected]",
  "created_at": "2025-01-15T10:30:00Z"
}
```

**404 Not Found**
```json
{
  "error": "USER_NOT_FOUND",
  "message": "User does not exist"
}
```

### Examples

**cURL**
```bash
curl -X GET "https://api.example.com/api/v1/users/usr_123" \
  -H "Authorization: Bearer YOUR_TOKEN"
```

**JavaScript**
```javascript
const user = await fetch('/api/v1/users/usr_123', {
  headers: { 'Authorization': 'Bearer token' }
}).then(r => r.json());
```

**Python**
```python
response = requests.get(
    'https://api.example.com/api/v1/users/usr_123',
    headers={'Authorization': 'Bearer token'}
)
user = response.json()
```
````

---

**Last Updated**: August 4, 2026
**Claude Code Version**: 2.1.220
**Sources**:
- https://code.claude.com/docs/en/skills
**Compatible Models**: Claude Fable 5, Claude Opus 5, Claude Sonnet 5, Claude Sonnet 4.6, Claude Opus 4.8, Claude Haiku 4.5

© luongnv89 · MIT · luongnv89/claude-howto

Similar skills

Everything for Writing and docs →

doc-generator by other authors comes first.

From the same set7

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor