---
name: API Documentation
slug: api-documentation
category: Writing
description: API Documentation generates markdown API references from source code. Use it to document endpoints, parameters, request and response schemas, or produce OpenAPI/Swagger specs.
github: "https://github.com/huangjia2019/claude-code-engineering/tree/main/04-Skills/projects/02-progressive-skill"
language: JavaScript
stars: 1077
forks: 379
install: "npx degit https://github.com/huangjia2019/claude-code-engineering/tree/main/04-Skills/projects/02-progressive-skill ~/.claude/skills/02-progressive-skill"
installs_to: ~/.claude/skills/02-progressive-skill
source_path: 04-Skills/projects/02-progressive-skill/SKILL.md
collection_size: 13
category_size: 1012
collection_url: "https://dirskills.com/collections/huangjia2019/claude-code-engineering"
added: 2026-08-21T05:13:25.857Z
last_synced: 2026-08-21T05:13:25.857Z
canonical_url: "https://dirskills.com/skills/api-documentation"
---

# API Documentation

API Documentation generates markdown API references from source code. Use it to document endpoints, parameters, request and response schemas, or produce OpenAPI/Swagger specs.

**Install:**

```bash
npx degit https://github.com/huangjia2019/claude-code-engineering/tree/main/04-Skills/projects/02-progressive-skill ~/.claude/skills/02-progressive-skill
```

## README

# API Documentation Generator

Generate comprehensive API documentation from source code.

## Quick Reference

For common documentation patterns, see `PATTERNS.md`.

## Documentation Standards

See `STANDARDS.md` for our documentation conventions.

## Process

### Step 1: Identify API Endpoints

Look for:
- Route definitions (Express, FastAPI, etc.)
- Controller methods
- Handler functions

### Step 2: Extract Information

For each endpoint, extract:
- HTTP method (GET, POST, PUT, DELETE, etc.)
- Path/route
- Parameters (path, query, body)
- Request/response schemas
- Authentication requirements

### Step 3: Generate Documentation

Use the template in `templates/endpoint.md` for consistent formatting.

### Step 4: Create Overview

Generate an index of all endpoints with the template in `templates/index.md`.

## Output Formats

### Markdown (Default)
Generate markdown documentation suitable for README or docs site.

### OpenAPI/Swagger
If requested, generate OpenAPI 3.0 spec. See `templates/openapi.yaml` for structure.

## Examples

See `EXAMPLES.md` for sample inputs and outputs.

## Scripts

To auto-detect routes in common frameworks:
```bash
python scripts/detect_routes.py <source_directory>
```

To validate generated OpenAPI spec:
```bash
./scripts/validate_openapi.sh <spec_file>
```
