Agent skill

API Documentation Generator

by ArabelaTso in ArabelaTso/Skills-4-SE

Generate comprehensive API documentation from repository sources including OpenAPI specs, code comments, docstrings, and existing documentation.

Apache-2.0Auto-check passedDevelopment

Install API Documentation Generator

skills CLI
$ npx skills add ArabelaTso/Skills-4-SE --skill api-documentation-generator -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install ArabelaTso/Skills-4-SE api-documentation-generator --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/ArabelaTso/Skills-4-SE.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/api-documentation-generator .claude/skills/api-documentation-generator && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
api-documentation-generator
GitHub stars
253
Token cost
~3.2k tokens
SKILL.md length
355 words
Files
2 (incl. assets)
Skills in repo
150
Repo updated
First seen
Licence
Apache-2.0

At a glance

Generate comprehensive API documentation from repository sources including OpenAPI specs, code comments, docstrings, and existing documentation.

  • Works in 5 steps: Discover API Information Sources → Extract API Information → Organize Documentation Structure → …
  • Documenting APIs
  • SKILL.md covers Overview, Workflow and Error Codes
  • Calls curl

What it does

API Documentation Generator is an agent skill from ArabelaTso/Skills-4-SE. Generate comprehensive API documentation from repository sources including OpenAPI specs, code comments, docstrings, and existing documentation. Use when documenting APIs, creating API reference guides, or summarizing API functionality from codebases. Extracts endpoint details, request/response schemas, authentication methods, and generates code examples. Triggers when users ask to document APIs, generate API docs, create API reference, or summarize API endpoints from a repository.

Its SKILL.md is about 3.2k tokens, which your agent loads only when the skill is triggered. The skill folder holds 2 other files, including assets (for example `assets/api-doc-template.md`).

It sits in Development, covering Technical documentation. It works with OpenAPI. The repository describes itself as: A curated list of 180+ useful Claude Skills for Software Engineering and resources for customizing AI for SE workflows. The licence is Apache-2.0.

When your agent uses it

  • Documenting APIs
  • Creating API reference guides
  • Summarizing API functionality from codebases
  • Users ask to document APIs

Example prompts

  • “/api-documentation-generator”

Requirements

  • Python 3
  • A credential in YOUR_TOKEN

Workflow steps

5 steps, taken from the step headings in SKILL.md.

  1. Discover API Information Sources
  2. Extract API Information
  3. Organize Documentation Structure
  4. Generate Documentation Files
  5. Retrieve the User

What it can do on your machine

Read from SKILL.md and the folder at commit 4f38503. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • curl

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md. Its commands use curl, which can reach the network depending on how they are called.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

API Documentation Generator loads about 3.2k tokens when it runs. Until then it costs about 129 tokens; SKILL.md has 355 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~129
When it runs · the whole SKILL.md, loaded when a task matches
~3.2k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from ArabelaTso/Skills-4-SE at commit 4f38503, republished under its Apache-2.0 licence (© ArabelaTso). 355 words, ~3,238 tokens.

Download SKILL.mdSave it as .claude/skills/api-documentation-generator/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
api-documentation-generator
description
Generate comprehensive API documentation from repository sources including OpenAPI specs, code comments, docstrings, and existing documentation. Use when documenting APIs, creating API reference guides, or summarizing API functionality from codebases. Extracts endpoint details, request/response schemas, authentication methods, and generates code examples. Triggers when users ask to document APIs, generate API docs, create API reference, or summarize API endpoints from a repository.

API Documentation Generator

Overview

Analyze a repository to extract and generate comprehensive API documentation, including endpoints, request/response schemas, authentication, and usage examples organized in a clear, multi-file structure.

Workflow

1. Discover API Information Sources

Scan the repository to identify all sources of API information:

Primary sources (in priority order):

  1. OpenAPI/Swagger specifications (.yaml, .yml, .json)

    • Look in: root directory, /docs, /api, /spec, /openapi
    • Files named: openapi.yaml, swagger.json, api-spec.yaml, etc.
  2. Code files with docstrings/comments

    • Python: Flask/FastAPI route decorators, docstrings
    • JavaScript/TypeScript: Express routes, JSDoc comments
    • Java: Spring annotations, Javadoc
    • Go: HTTP handler comments
    • Ruby: Rails routes, YARD comments
  3. Existing documentation

    • Markdown files in /docs, /documentation, /api-docs
    • README files with API sections
    • Wiki pages or doc site content
  4. Configuration files

    • routes.rb, urls.py, routes.js
    • API gateway configurations

Discovery approach:

bash
# Find OpenAPI specs
find . -name "openapi.*" -o -name "swagger.*" -o -name "*api-spec*"

# Find API route definitions
grep -r "@app.route\|@router\|app.get\|app.post" --include="*.py" --include="*.js"

# Find documentation
find . -path "*/docs/*" -name "*.md" -o -path "*/api/*" -name "*.md"
2. Extract API Information

Based on discovered sources, extract key information:

From OpenAPI Specs

Parse YAML/JSON to extract:

  • Base URL and server information
  • All paths and operations (GET, POST, PUT, PATCH, DELETE)
  • Request parameters (path, query, header, body)
  • Response schemas and status codes
  • Authentication/security schemes
  • Data models/schemas
  • Tags and operation groupings
From Code Comments/Docstrings

Look for patterns like:

Python (FastAPI/Flask):

python
@app.post("/users")
async def create_user(user: UserCreate):
    """
    Create a new user.

    Args:
        user: User creation data

    Returns:
        Created user object
    """

JavaScript (Express):

javascript
/**
 * GET /users
 * List all users
 * @param {number} page - Page number
 * @param {number} limit - Items per page
 * @returns {Array<User>} List of users
 */
app.get('/users', (req, res) => { ... })

Extract:

  • HTTP method and path
  • Description from docstring/comment
  • Parameters and types
  • Return types
  • Example usage if present
Show full SKILL.md (148 more words)Show less
From Existing Documentation

Parse markdown files to extract:

  • Endpoint descriptions
  • Request/response examples
  • Authentication details
  • Rate limiting information
  • Error codes
3. Organize Documentation Structure

Create a multi-file documentation structure organized by resource or API area:

docs/
├── README.md                 # Overview, authentication, getting started
├── endpoints/
│   ├── users.md             # User-related endpoints
│   ├── products.md          # Product-related endpoints
│   ├── orders.md            # Order-related endpoints
│   └── ...
├── models/
│   └── schemas.md           # Data models and schemas
├── errors.md                # Error codes and handling
└── examples.md              # Complete usage examples

Grouping strategy:

  • Group by resource (users, products, orders)
  • Group by OpenAPI tags if available
  • Group by URL prefix if no tags
  • Keep authentication, errors, and models separate
4. Generate Documentation Files

For each file, use the template from assets/api-doc-template.md as a guide.

README.md (Main Overview)
markdown
# API Documentation

## Overview
[Brief description of the API and its purpose]

## Base URL
https://api.example.com/v1

## Authentication
[Describe auth method: Bearer tokens, API keys, OAuth2]

## Quick Start
[Simple example showing how to make first API call]

## Endpoints

- [Users](endpoints/users.md) - User management endpoints
- [Products](endpoints/products.md) - Product catalog endpoints
- [Orders](endpoints/orders.md) - Order processing endpoints

## Resources

- [Data Models](models/schemas.md) - Request/response schemas
- [Errors](errors.md) - Error codes and handling
- [Examples](examples.md) - Complete usage examples

## Rate Limiting
[Rate limit details if applicable]

## Versioning
[API versioning strategy if applicable]
Endpoint Files (e.g., endpoints/users.md)

For each endpoint, document:

Endpoint header:

markdown
### POST /users

Create a new user account.

Request details:

markdown
**Request:**

- **Method:** `POST`
- **Path:** `/users`
- **Headers:**
  - `Content-Type: application/json`
  - `Authorization: Bearer YOUR_TOKEN`

**Body:**

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| name | string | Yes | User's full name |
| email | string | Yes | User's email address |
| role | string | No | User role (default: user) |

**Example:**

```json
{
  "name": "John Doe",
  "email": "john@example.com",
  "role": "admin"
}

**Response details:**
```markdown
**Response:**

- **Status:** `201 Created`
- **Headers:**
  - `Location: /users/123`

**Body:**

```json
{
  "id": 123,
  "name": "John Doe",
  "email": "john@example.com",
  "role": "admin",
  "created_at": "2024-01-15T10:30:00Z"
}

Error Responses:

  • 400 Bad Request - Invalid input data
  • 409 Conflict - Email already exists

**Code examples:**
```markdown
**Example Request:**

```bash
curl -X POST "https://api.example.com/v1/users" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -d '{
    "name": "John Doe",
    "email": "john@example.com"
  }'
python
import requests

response = requests.post(
    "https://api.example.com/v1/users",
    headers={"Authorization": "Bearer YOUR_TOKEN"},
    json={
        "name": "John Doe",
        "email": "john@example.com"
    }
)

user = response.json()
print(f"Created user: {user['id']}")

#### Data Models File (`models/schemas.md`)

Document all data structures:

```markdown
# Data Models

## User

| Field | Type | Description |
|-------|------|-------------|
| id | integer | Unique identifier |
| name | string | User's full name |
| email | string | User's email address |
| role | string | User role (admin, user, guest) |
| created_at | datetime | Account creation timestamp |
| updated_at | datetime | Last update timestamp |

**Example:**

```json
{
  "id": 123,
  "name": "John Doe",
  "email": "john@example.com",
  "role": "user",
  "created_at": "2024-01-15T10:30:00Z",
  "updated_at": "2024-01-15T10:30:00Z"
}

#### Error Reference (`errors.md`)

```markdown
# Error Handling

All errors follow this format:

```json
{
  "error": {
    "code": "ERROR_CODE",
    "message": "Human-readable message"
  }
}

Error Codes

StatusCodeDescription
400BAD_REQUESTInvalid request data
401UNAUTHORIZEDMissing/invalid auth
403FORBIDDENInsufficient permissions
404NOT_FOUNDResource not found
409CONFLICTResource conflict
422VALIDATION_ERRORValidation failed
429RATE_LIMIT_EXCEEDEDToo many requests
500INTERNAL_ERRORServer error

### 5. Include Code Examples

For major use cases, provide complete code examples:

```markdown
# Examples

## Creating and Managing Users

### 1. Create a User

```bash
curl -X POST "https://api.example.com/v1/users" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -d '{"name": "John Doe", "email": "john@example.com"}'
python
import requests

# Create user
response = requests.post(
    "https://api.example.com/v1/users",
    headers={"Authorization": "Bearer YOUR_TOKEN"},
    json={"name": "John Doe", "email": "john@example.com"}
)

user_id = response.json()["id"]
2. Retrieve the User
python
# Get user details
response = requests.get(
    f"https://api.example.com/v1/users/{user_id}",
    headers={"Authorization": "Bearer YOUR_TOKEN"}
)

user = response.json()
print(f"User: {user['name']} ({user['email']})")

### 6. Handle Special Cases

#### No OpenAPI Spec Available

When no OpenAPI spec exists:
1. Thoroughly scan code files for route definitions
2. Extract information from docstrings and comments
3. Infer request/response structure from code
4. Note assumptions and recommend validation

#### Multiple API Versions

When multiple versions exist:
1. Document each version separately
2. Note differences between versions
3. Indicate which version is recommended
4. Document migration path if applicable

#### Incomplete Information

When information is missing:
1. Document what's known
2. Mark unknown sections with `[To be documented]`
3. Provide best-effort inferences with `(inferred from code)`
4. Suggest improvements to add missing details

#### GraphQL APIs

For GraphQL:
1. Extract schema from `.graphql` files or introspection
2. Document queries, mutations, and subscriptions
3. Include example queries with variables
4. Document input types and return types

### 7. Quality Checks

Before finalizing documentation:

- ✅ All endpoints documented with HTTP method and path
- ✅ Request parameters clearly specified (type, required/optional)
- ✅ Response schemas documented with examples
- ✅ Authentication method explained
- ✅ Error responses documented
- ✅ Code examples provided for main operations
- ✅ Files organized logically by resource
- ✅ Links between files work correctly
- ✅ Consistent formatting throughout
- ✅ Base URL and versioning strategy documented

## Example Workflows

### Example 1: Repository with OpenAPI Spec

**User request:**
> "Generate API documentation for this repository"

**Response approach:**

1. Search for OpenAPI spec files
2. Find `openapi.yaml` in `/docs` directory
3. Parse the spec to extract all endpoints, schemas, and auth
4. Organize by tags into separate files
5. Generate README with overview and navigation
6. Create endpoint files for each tag
7. Create schemas.md with all data models
8. Create errors.md with error codes
9. Add code examples in curl and Python

### Example 2: Flask API Without Spec

**User request:**
> "Document the API endpoints in this Flask application"

**Response approach:**

1. Search for Flask route decorators (`@app.route`, `@blueprint.route`)
2. Extract endpoints from route definitions
3. Parse docstrings for descriptions and parameter info
4. Infer request/response types from function signatures and code
5. Organize endpoints by blueprint or URL prefix
6. Generate documentation files
7. Note inferred information with disclaimers
8. Suggest creating OpenAPI spec for better docs

### Example 3: Multiple Sources

**User request:**
> "Summarize the API documentation from all available sources"

**Response approach:**

1. Find OpenAPI spec for base structure
2. Find existing markdown docs for additional context
3. Scan code for endpoints not in spec
4. Merge information from all sources
5. Prioritize OpenAPI spec for conflicts
6. Add code-derived info where spec is incomplete
7. Generate unified documentation
8. Note sources for each piece of information

## Tips for Effective Documentation

**Be comprehensive but concise:**
- Include all necessary details
- Avoid redundancy across files
- Use tables for structured data
- Use code blocks for examples

**Use consistent formatting:**
- Same structure for all endpoint docs
- Consistent naming (camelCase vs snake_case)
- Consistent status code documentation
- Consistent example format

**Make it navigable:**
- Clear table of contents in README
- Links between related sections
- Organized by resource or feature area
- Separate concerns (auth, errors, models)

**Provide context:**
- Explain what each endpoint does and why
- Show realistic use cases
- Include complete working examples
- Document edge cases and limitations

**Keep it current:**
- Extract from source of truth (code or spec)
- Note generated date
- Provide instructions for regenerating
- Flag areas needing manual review

## Template

Use the template in [assets/api-doc-template.md](assets/api-doc-template.md) as a starting point for each documentation file. Adapt the structure based on the specific API being documented.

© ArabelaTso, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 1 other file (assets) in skills/api-documentation-generator of ArabelaTso/Skills-4-SE.

  • SKILL.md
  • assets/api-doc-template.md

Open the folder on GitHubat commit 4f38503

Compare with similar skills

API Documentation Generator next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

API Documentation Generator compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
API Documentation Generator this skillArabelaTso/Skills-4-SE253—~3.2kAutomated safety check: PassApache-2.0
Nacos API Doc Updatenacos-group/nacos-group.github.io115—~3.3kAutomated safety check: PassApache-2.0
API Documentation Generatorluongnv89/claude-howto42k—~429Automated safety check: PassMIT
Dashclaw Shipucsandman/DashClaw310—~7.2kAutomated safety check: PassMIT
Agentic Workflows API Documentation Lungoagntcy/coffeeAgntcy112—~2.6kAutomated safety check: PassApache-2.0
API Documentation Generatordavila7/claude-code-templates32k8 repos~2.8kAutomated safety check: PassMIT

Similar skills

  • Nacos API Doc Update

    nacos-group/nacos-group.github.io

    Updates Nacos API documentation from Swagger api.json. An agent skill from nacos-group/nacos-group.github.io.

    115 GitHub stars~3.3k tokensUpdated 14 days ago
    DevelopmentAuto-check passed
  • API Documentation Generator

    luongnv89/claude-howto

    Generate comprehensive, accurate API documentation from source code. Use when creating or updating API documentation, generating OpenAPI specs, or when users…

    42k GitHub stars~429 tokensUpdated 7 days ago
    DevelopmentAuto-check passed
  • Dashclaw Ship

    ucsandman/DashClaw

    The single command that gets a DashClaw change ON MAIN AND LIVE — it resolves everything blocking production, never defers, and never hands back a checklist.

    310 GitHub stars~7.2k tokensUpdated yesterday
    DevelopmentAuto-check passed
  • Authors and maintains the human-facing Agentic Workflows API documentation for the lungo subproject at coffeeAGNTCY/coffeeagents/lungo/docs/workflow-instanceapi.md.

    112 GitHub stars~2.6k tokensUpdated today
    DevelopmentAuto-check passed
  • API Documentation Generator

    davila7/claude-code-templates

    Generate comprehensive, developer-friendly API documentation from code, including endpoints, parameters, examples, and best practices

    32k GitHub starsUsed in 8 repos~2.8k tokens
    DevelopmentAuto-check passed
  • Code Documenter

    Jeffallan/claude-skills

    Generates and validates docstrings, OpenAPI specs, JSDoc annotations and user guides, running every code example through a real compiler or linter before reporting coverage.

    12k GitHub stars~1.5k tokensUpdated 4 days ago
    DevelopmentAuto-check passed

More from ArabelaTso/Skills-4-SE

All 150 skills in this repo
  • Framework Migration Assistant

    ArabelaTso/Skills-4-SE

    Automatically migrate Python web applications between frameworks (Flask → FastAPI, Django → FastAPI).

    253 GitHub stars~1.9k tokensUpdated 1 mo ago
    Auto-check passed
  • Metamorphic Test Generator

    ArabelaTso/Skills-4-SE

    Generate test cases using metamorphic testing by applying transformations based on metamorphic properties.

    253 GitHub stars~798 tokensUpdated 1 mo ago
    Auto-check passed
  • Reproduction Trace Instrumenter

    ArabelaTso/Skills-4-SE

    Instruments programs to capture execution traces specifically for reproducing reported bugs, enabling consistent replay and diagnosis of failures.

    253 GitHub stars~2.4k tokensUpdated 1 mo ago
    Auto-check passed
  • Spring Mvc To Boot Migrator

    ArabelaTso/Skills-4-SE

    Automatically migrate Spring MVC applications to Spring Boot.

    253 GitHub stars~2.2k tokensUpdated 1 mo ago
    Auto-check passed
  • State Snapshot Instrumenter

    ArabelaTso/Skills-4-SE

    Instrument programs (Python, C/C++, Java) to capture snapshots of key program states at runtime, including variables, memory, and call stacks.

    253 GitHub stars~2.2k tokensUpdated 1 mo ago
    Auto-check passed

Works with

Questions about API Documentation Generator

What does API Documentation Generator do?

Generate comprehensive API documentation from repository sources including OpenAPI specs, code comments, docstrings, and existing documentation. API Documentation Generator is an agent skill from ArabelaTso/Skills-4-SE. Generate comprehensive API documentation from repository sources including OpenAPI specs, code comments, docstrings, and existing documentation.

When should I use API Documentation Generator?

API Documentation Generator fits situations like: documenting APIs; creating API reference guides; summarizing API functionality from codebases; users ask to document APIs.

How do I install API Documentation Generator in Claude Code?

Run `npx skills add ArabelaTso/Skills-4-SE --skill api-documentation-generator -a claude-code`. Or copy the skill folder (skills/api-documentation-generator in ArabelaTso/Skills-4-SE) into .claude/skills/api-documentation-generator in your project. Claude Code loads it when a task matches its description.

How do I install API Documentation Generator in Codex?

Run `npx skills add ArabelaTso/Skills-4-SE --skill api-documentation-generator -a codex`. Or copy the skill folder (skills/api-documentation-generator in ArabelaTso/Skills-4-SE) into .agents/skills/api-documentation-generator in your project. Codex loads it when a task matches its description.

Can I use API Documentation Generator in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add ArabelaTso/Skills-4-SE --skill api-documentation-generator -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/api-documentation-generator, .gemini/skills/api-documentation-generator, .github/skills/api-documentation-generator and .opencode/skills/api-documentation-generator in your project.

What does API Documentation Generator need to run?

Going by SKILL.md and its folder, API Documentation Generator needs the command-line tools its instructions call (curl). Our summary lists: Python 3; A credential in YOUR_TOKEN.

Does API Documentation Generator access the network?

SKILL.md contains no URLs. Its commands use curl, which can reach the network depending on how they are called. This is read from the text; nothing was executed.

Is API Documentation Generator safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does API Documentation Generator use?

API Documentation Generator is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does API Documentation Generator use?

About 3.2k tokens (SKILL.md is roughly 13k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to API Documentation Generator?

Skills that share tags, products or a category with API Documentation Generator: Nacos API Doc Update (nacos-group/nacos-group.github.io, 115 stars), API Documentation Generator (luongnv89/claude-howto, 42k stars), Dashclaw Ship (ucsandman/DashClaw, 310 stars) and Agentic Workflows API Documentation Lungo (agntcy/coffeeAgntcy, 112 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains API Documentation Generator?

ArabelaTso (a GitHub user) maintains it in ArabelaTso/Skills-4-SE, which has 253 GitHub stars. The repository holds 150 skills in this directory. The repository was last updated on August 21, 2026.

Source: ArabelaTso/Skills-4-SE on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.