This source did not publish a separate summary. Review SKILL.md before using the skill.
SKILL.md
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)
## 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": "[email protected]",
"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
## Authentication
All API requests require authentication using Bearer tokens.
### Getting a Token
**Endpoint:** `POST /api/v1/auth/login`
**Request:**
\`\`\`json
{
"email": "[email protected]",
"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
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'