Agent skill

API Documentation Generator

by davila7 in davila7/claude-code-templates

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

MITAuto-check passedDevelopment

Install API Documentation Generator

skills CLI
$ npx skills add davila7/claude-code-templates --skill api-documentation-generator -a claude-code

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

GitHub CLI
$ gh skill install davila7/claude-code-templates 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/davila7/claude-code-templates.git skills-src && mkdir -p .claude/skills && cp -r skills-src/cli-tool/components/skills/development/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
32k
Used in
7 other repos
Token cost
~2.8k tokens
SKILL.md length
772 words
Files
1
Skills in repo
477
Repo updated
First seen
Licence
MIT

At a glance

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

  • Works in 5 steps: Analyze the API Structure → Generate Endpoint Documentation → Add Usage Guidelines → …
  • Tasks that involve Technical documentation
  • SKILL.md covers Overview, When to Use This Skill, How It Works and Examples, plus 6 more sections
  • Reaches schema.getpostman.com

What it does

API Documentation Generator is an agent skill from davila7/claude-code-templates. Generate comprehensive, developer-friendly API documentation from code, including endpoints, parameters, examples, and best practices

Its SKILL.md is about 2.8k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Development, covering Technical documentation. It works with OpenAPI. The repository describes itself as: CLI tool for configuring and monitoring Claude Code. The licence is MIT.

When your agent uses it

  • Tasks that involve Technical documentation

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. Analyze the API Structure
  2. Generate Endpoint Documentation
  3. Add Usage Guidelines
  4. Document Error Handling
  5. Create Interactive Examples

What it can do on your machine

Read from SKILL.md and the folder at commit 4c82aba. 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

    No scripts in the folder and no shell commands in SKILL.md (its code samples are markdown, yaml and json).

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

  • Network

    Hosts in commands or code, which the agent is likely to contact:

    • schema.getpostman.com

    Also links to:

    • swagger.io
    • restfulapi.net
    • graphql.org
    • apiguide.com
    • learning.postman.com

    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 2.8k tokens when it runs. Until then it costs about 40 tokens; SKILL.md has 772 words of instructions outside code blocks.

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

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 davila7/claude-code-templates at commit 4c82aba, republished under its MIT licence (© davila7). 772 words, ~2,796 tokens.

Download SKILL.mdSave it as .claude/skills/api-documentation-generator/SKILL.md (or your agent's skills folder).
name
api-documentation-generator
description
Generate comprehensive, developer-friendly API documentation from code, including endpoints, parameters, examples, and best practices

API Documentation Generator

Overview

Automatically generate clear, comprehensive API documentation from your codebase. This skill helps you create professional documentation that includes endpoint descriptions, request/response examples, authentication details, error handling, and usage guidelines.

Perfect for REST APIs, GraphQL APIs, and WebSocket APIs.

When to Use This Skill

  • Use when you need to document a new API
  • Use when updating existing API documentation
  • Use when your API lacks clear documentation
  • Use when onboarding new developers to your API
  • Use when preparing API documentation for external users
  • Use when creating OpenAPI/Swagger specifications

How It Works

Step 1: Analyze the API Structure

First, I'll examine your API codebase to understand:

  • Available endpoints and routes
  • HTTP methods (GET, POST, PUT, DELETE, etc.)
  • Request parameters and body structure
  • Response formats and status codes
  • Authentication and authorization requirements
  • Error handling patterns
Step 2: Generate Endpoint Documentation

For each endpoint, I'll create documentation including:

Endpoint Details:

  • HTTP method and URL path
  • Brief description of what it does
  • Authentication requirements
  • Rate limiting information (if applicable)

Request Specification:

  • Path parameters
  • Query parameters
  • Request headers
  • Request body schema (with types and validation rules)

Response Specification:

  • Success response (status code + body structure)
  • Error responses (all possible error codes)
  • Response headers

Code Examples:

  • cURL command
  • JavaScript/TypeScript (fetch/axios)
  • Python (requests)
  • Other languages as needed
Step 3: Add Usage Guidelines

I'll include:

  • Getting started guide
  • Authentication setup
  • Common use cases
  • Best practices
  • Rate limiting details
  • Pagination patterns
  • Filtering and sorting options
Step 4: Document Error Handling

Clear error documentation including:

  • All possible error codes
  • Error message formats
  • Troubleshooting guide
  • Common error scenarios and solutions
Step 5: Create Interactive Examples

Where possible, I'll provide:

  • Postman collection
  • OpenAPI/Swagger specification
  • Interactive code examples
  • Sample responses

Examples

Example 1: REST API Endpoint Documentation
markdown
## Create User

Creates a new user account.

**Endpoint:** `POST /api/v1/users`

**Authentication:** Required (Bearer token)

**Request Body:**
\`\`\`json
{
  "email": "user@example.com",      // Required: Valid email address
  "password": "SecurePass123!",     // Required: Min 8 chars, 1 uppercase, 1 number
  "name": "John Doe",               // Required: 2-50 characters
  "role": "user"                    // Optional: "user" or "admin" (default: "user")
}
\`\`\`

**Success Response (201 Created):**
\`\`\`json
{
  "id": "usr_1234567890",
  "email": "user@example.com",
  "name": "John Doe",
  "role": "user",
  "createdAt": "2026-01-20T10:30:00Z",
  "emailVerified": false
}
\`\`\`

**Error Responses:**

- `400 Bad Request` - Invalid input data
  \`\`\`json
  {
    "error": "VALIDATION_ERROR",
    "message": "Invalid email format",
    "field": "email"
  }
  \`\`\`

- `409 Conflict` - Email already exists
  \`\`\`json
  {
    "error": "EMAIL_EXISTS",
    "message": "An account with this email already exists"
  }
  \`\`\`

- `401 Unauthorized` - Missing or invalid authentication token

**Example Request (cURL):**
\`\`\`bash
curl -X POST https://api.example.com/api/v1/users \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "email": "user@example.com",
    "password": "SecurePass123!",
    "name": "John Doe"
  }'
\`\`\`

**Example Request (JavaScript):**
\`\`\`javascript
const response = await fetch('https://api.example.com/api/v1/users', {
  method: 'POST',
  headers: {
    'Authorization': `Bearer ${token}`,
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    email: 'user@example.com',
    password: 'SecurePass123!',
    name: 'John Doe'
  })
});

const user = await response.json();
console.log(user);
\`\`\`

**Example Request (Python):**
\`\`\`python
import requests

response = requests.post(
    'https://api.example.com/api/v1/users',
    headers={
        'Authorization': f'Bearer {token}',
        'Content-Type': 'application/json'
    },
    json={
        'email': 'user@example.com',
        'password': 'SecurePass123!',
        'name': 'John Doe'
    }
)

user = response.json()
print(user)
\`\`\`
Example 2: GraphQL API Documentation
markdown
## User Query

Fetch user information by ID.

**Query:**
\`\`\`graphql
query GetUser($id: ID!) {
  user(id: $id) {
    id
    email
    name
    role
    createdAt
    posts {
      id
      title
      publishedAt
    }
  }
}
\`\`\`

**Variables:**
\`\`\`json
{
  "id": "usr_1234567890"
}
\`\`\`

**Response:**
\`\`\`json
{
  "data": {
    "user": {
      "id": "usr_1234567890",
      "email": "user@example.com",
      "name": "John Doe",
      "role": "user",
      "createdAt": "2026-01-20T10:30:00Z",
      "posts": [
        {
          "id": "post_123",
          "title": "My First Post",
          "publishedAt": "2026-01-21T14:00:00Z"
        }
      ]
    }
  }
}
\`\`\`

**Errors:**
\`\`\`json
{
  "errors": [
    {
      "message": "User not found",
      "extensions": {
        "code": "USER_NOT_FOUND",
        "userId": "usr_1234567890"
      }
    }
  ]
}
\`\`\`
Example 3: Authentication Documentation
markdown
## Authentication

All API requests require authentication using Bearer tokens.

### Getting a Token

**Endpoint:** `POST /api/v1/auth/login`

**Request:**
\`\`\`json
{
  "email": "user@example.com",
  "password": "your-password"
}
\`\`\`

**Response:**
\`\`\`json
{
  "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
  "expiresIn": 3600,
  "refreshToken": "refresh_token_here"
}
\`\`\`

### Using the Token

Include the token in the Authorization header:

\`\`\`
Authorization: Bearer YOUR_TOKEN
\`\`\`

### Token Expiration

Tokens expire after 1 hour. Use the refresh token to get a new access token:

**Endpoint:** `POST /api/v1/auth/refresh`

**Request:**
\`\`\`json
{
  "refreshToken": "refresh_token_here"
}
\`\`\`

Best Practices

✅ Do This
  • Be Consistent - Use the same format for all endpoints
  • Include Examples - Provide working code examples in multiple languages
  • Document Errors - List all possible error codes and their meanings
  • Show Real Data - Use realistic example data, not "foo" and "bar"
  • Explain Parameters - Describe what each parameter does and its constraints
  • Version Your API - Include version numbers in URLs (/api/v1/)
  • Add Timestamps - Show when documentation was last updated
  • Link Related Endpoints - Help users discover related functionality
  • Include Rate Limits - Document any rate limiting policies
  • Provide Postman Collection - Make it easy to test your API
❌ Don't Do This
  • Don't Skip Error Cases - Users need to know what can go wrong
  • Don't Use Vague Descriptions - "Gets data" is not helpful
  • Don't Forget Authentication - Always document auth requirements
  • Don't Ignore Edge Cases - Document pagination, filtering, sorting
  • Don't Leave Examples Broken - Test all code examples
  • Don't Use Outdated Info - Keep documentation in sync with code
  • Don't Overcomplicate - Keep it simple and scannable
  • Don't Forget Response Headers - Document important headers

Documentation Structure

Show full SKILL.md (309 more words)Show less
  1. Introduction

    • What the API does
    • Base URL
    • API version
    • Support contact
  2. Authentication

    • How to authenticate
    • Token management
    • Security best practices
  3. Quick Start

    • Simple example to get started
    • Common use case walkthrough
  4. Endpoints

    • Organized by resource
    • Full details for each endpoint
  5. Data Models

    • Schema definitions
    • Field descriptions
    • Validation rules
  6. Error Handling

    • Error code reference
    • Error response format
    • Troubleshooting guide
  7. Rate Limiting

    • Limits and quotas
    • Headers to check
    • Handling rate limit errors
  8. Changelog

    • API version history
    • Breaking changes
    • Deprecation notices
  9. SDKs and Tools

    • Official client libraries
    • Postman collection
    • OpenAPI specification

Common Pitfalls

Problem: Documentation Gets Out of Sync

Symptoms: Examples don't work, parameters are wrong, endpoints return different data Solution:

  • Generate docs from code comments/annotations
  • Use tools like Swagger/OpenAPI
  • Add API tests that validate documentation
  • Review docs with every API change
Problem: Missing Error Documentation

Symptoms: Users don't know how to handle errors, support tickets increase Solution:

  • Document every possible error code
  • Provide clear error messages
  • Include troubleshooting steps
  • Show example error responses
Problem: Examples Don't Work

Symptoms: Users can't get started, frustration increases Solution:

  • Test every code example
  • Use real, working endpoints
  • Include complete examples (not fragments)
  • Provide a sandbox environment
Problem: Unclear Parameter Requirements

Symptoms: Users send invalid requests, validation errors Solution:

  • Mark required vs optional clearly
  • Document data types and formats
  • Show validation rules
  • Provide example values

Tools and Formats

OpenAPI/Swagger

Generate interactive documentation:

yaml
openapi: 3.0.0
info:
  title: My API
  version: 1.0.0
paths:
  /users:
    post:
      summary: Create a new user
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateUserRequest'
Postman Collection

Export collection for easy testing:

json
{
  "info": {
    "name": "My API",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
  },
  "item": [
    {
      "name": "Create User",
      "request": {
        "method": "POST",
        "url": "{{baseUrl}}/api/v1/users"
      }
    }
  ]
}
  • @doc-coauthoring - For collaborative documentation writing
  • @copywriting - For clear, user-friendly descriptions
  • @test-driven-development - For ensuring API behavior matches docs
  • @systematic-debugging - For troubleshooting API issues

Additional Resources


Pro Tip: Keep your API documentation as close to your code as possible. Use tools that generate docs from code comments to ensure they stay in sync!

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

Files

Just SKILL.md in cli-tool/components/skills/development/api-documentation-generator of davila7/claude-code-templates.

Open the folder on GitHubat commit 4c82aba

Used in 7 other repositories

We found 16 copies of this SKILL.md (exact, near-identical or edited) in other folders, from 7 other GitHub owners. This page covers the copy in davila7/claude-code-templates, which our catalogue first saw on October 7, 2026.

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 skilldavila7/claude-code-templates32k7 repos~2.8kAutomated safety check: PassMIT
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
Code DocumenterJeffallan/claude-skills12k—~1.5kAutomated 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 13 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 yesterday
    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
  • Ukrainian-language skill for writing API documentation from source code: OpenAPI specs, endpoint pages, SDK examples, integration and authentication guides and error code references.

    42k GitHub stars~375 tokensUpdated 7 days ago
    DevelopmentAuto-check passed

More from davila7/claude-code-templates

All 477 skills in this repo
  • Perplexity Web Search

    davila7/claude-code-templates

    Runs web-grounded searches through Perplexity's Sonar models over OpenRouter for current events, recent literature and cited facts beyond the model's training cutoff.

    32k GitHub starsUsed in 12 repos~3.5k tokens
    Auto-check: notes
  • Neuropixels Data Analysis

    davila7/claude-code-templates

    Analyzes Neuropixels recordings from SpikeGLX or Open Ephys through preprocessing, drift correction, Kilosort4 spike sorting, quality metrics and curation.

    32k GitHub starsUsed in 10 repos~2.8k tokens
    Auto-check passed
  • Scientific Venue Templates

    davila7/claude-code-templates

    Supplies LaTeX templates and formatting rules for journals, conferences, posters, and grant proposals, then can check a draft against them.

    32k GitHub starsUsed in 9 repos~5.1k tokens
    Auto-check: notes
  • Brand Voice Content Creator

    davila7/claude-code-templates

    Analyzes a brand's existing writing to lock in a consistent voice, then builds SEO blog posts and platform-specific social content around it.

    32k GitHub starsUsed in 2 repos~1.9k tokens
    Auto-check passed
  • CAPA Officer

    davila7/claude-code-templates

    Guides corrective and preventive action (CAPA) work in a quality management system, from initiation and root cause analysis through effectiveness verification.

    32k GitHub starsUsed in 1 repo~2k tokens
    Auto-check passed
  • Fda Consultant Specialist

    davila7/claude-code-templates

    Senior FDA consultant and specialist for medical device companies including HIPAA compliance and requirement management.

    32k GitHub starsUsed in 1 repo~2.7k tokens
    Auto-check passed

Works with

Questions about API Documentation Generator

What does API Documentation Generator do?

Generate comprehensive, developer-friendly API documentation from code, including endpoints, parameters, examples, and best practices. API Documentation Generator is an agent skill from davila7/claude-code-templates.

When should I use API Documentation Generator?

API Documentation Generator fits situations like: tasks that involve Technical documentation.

How do I install API Documentation Generator in Claude Code?

Run `npx skills add davila7/claude-code-templates --skill api-documentation-generator -a claude-code`. Or copy the skill folder (cli-tool/components/skills/development/api-documentation-generator in davila7/claude-code-templates) 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 davila7/claude-code-templates --skill api-documentation-generator -a codex`. Or copy the skill folder (cli-tool/components/skills/development/api-documentation-generator in davila7/claude-code-templates) 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 davila7/claude-code-templates --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?

SKILL.md names no scripts, command-line tools or credentials: API Documentation Generator is instructions for the agent only. Our summary lists: Python 3; A credential in YOUR_TOKEN.

Does API Documentation Generator access the network?

SKILL.md names 6 domains. In commands or code: schema.getpostman.com; the agent is likely to contact it when it follows the instructions. As links in the text: swagger.io, restfulapi.net, graphql.org, apiguide.com and learning.postman.com. 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 MIT 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 2.8k tokens (SKILL.md is roughly 11k 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?

davila7 (a GitHub user) maintains it in davila7/claude-code-templates, which has 32,432 GitHub stars. The repository holds 477 skills in this directory. The repository was last updated on October 7, 2026.

Source: davila7/claude-code-templates on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.