
Codebase Documenter
Generate structured REST API reference docs with auth, errors, rate limits, and endpoint sections from an existing backend.
Overview
Codebase Documenter is an agent skill for the Build phase that produces structured API reference documentation from your project's endpoints and auth model.
Install
npx skills add https://github.com/ailabs-393/ai-labs-claude-skills --skill codebase-documenterWhat is this skill?
- Full API doc skeleton: overview, base URL, version, and table of contents
- Authentication section with header examples and token acquisition flow
- Standard error JSON shape with status codes and remediation table
- Rate limiting section placeholder aligned with public API norms
- Per-resource endpoint chapters with request/response examples
- Template includes dedicated sections for authentication, error handling, rate limiting, and endpoints
Adoption & trust: 1.1k installs on skills.sh; 399 GitHub stars; 3/3 security scanners passed (skills.sh audits).
What problem does it solve?
Your API works in code but integrators lack a consistent reference for auth, errors, rate limits, and endpoint examples.
Who is it for?
Solo builders documenting a versioned REST API alongside implementation in the same repo.
Skip if: Architecture decision records, README-only projects, or OpenAPI-only pipelines where you already auto-generate specs without narrative docs.
When should I use this skill?
User asks to document API endpoints, create API reference material, or describe authentication and error formats for an HTTP service.
What do I get? / Deliverables
You get a filled or ready-to-fill API markdown doc with authentication, error catalog, and resource sections you can publish or drop into your docs site.
- API reference markdown with TOC and endpoint sections
- Authentication and error-handling documentation blocks
- Example request/response snippets per resource
Recommended Skills
Journey fit
How it compares
Human-readable API reference template, not an OpenAPI generator or MCP documentation server.
Common Questions / FAQ
Who is codebase-documenter for?
Indie API and SaaS builders who need customer-facing HTTP documentation matching their real auth and error formats.
When should I use codebase-documenter?
Use it during Build docs work when endpoints exist or are nearly final and you need auth, error, rate-limit, and resource sections documented in one place.
Is codebase-documenter safe to install?
Review the Security Audits panel on this page; the skill is a documentation template and does not mandate network calls—avoid pasting live secrets into example curl blocks.
SKILL.md
READMESKILL.md - Codebase Documenter
# API Documentation ## Overview This document provides comprehensive documentation for all API endpoints in [Project Name]. **Base URL:** `https://api.example.com/v1` **API Version:** v1 **Last Updated:** [Date] ## Table of Contents - [Authentication](#authentication) - [Error Handling](#error-handling) - [Rate Limiting](#rate-limiting) - [Endpoints](#endpoints) - [Resource 1](#resource-1) - [Resource 2](#resource-2) ## Authentication ### Authentication Method This API uses [JWT/API Keys/OAuth/etc.] for authentication. **How to authenticate:** 1. [Step 1 to get credentials] 2. [Step 2 to use credentials] **Example authentication header:** ``` Authorization: Bearer YOUR_API_TOKEN_HERE ``` **Getting your API token:** ```bash # Example command or process to obtain token curl -X POST https://api.example.com/v1/auth/login \ -H "Content-Type: application/json" \ -d '{"email": "user@example.com", "password": "password123"}' ``` **Response:** ```json { "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...", "expiresAt": "2024-12-31T23:59:59Z" } ``` ## Error Handling ### Error Response Format All errors follow this format: ```json { "error": { "code": "ERROR_CODE", "message": "Human-readable error message", "details": { "field": "Additional context about the error" } } } ``` ### Common Error Codes | Status Code | Error Code | Description | Solution | |------------|------------|-------------|----------| | 400 | `INVALID_REQUEST` | Request validation failed | Check request format and required fields | | 401 | `UNAUTHORIZED` | Authentication required or failed | Provide valid authentication token | | 403 | `FORBIDDEN` | Insufficient permissions | Check user permissions and role | | 404 | `NOT_FOUND` | Resource doesn't exist | Verify resource ID and URL | | 429 | `RATE_LIMIT_EXCEEDED` | Too many requests | Wait before retrying (check Retry-After header) | | 500 | `INTERNAL_ERROR` | Server error | Contact support if persistent | ### Error Examples **401 Unauthorized:** ```json { "error": { "code": "UNAUTHORIZED", "message": "Invalid or expired authentication token" } } ``` **400 Invalid Request:** ```json { "error": { "code": "INVALID_REQUEST", "message": "Validation failed", "details": { "email": "Invalid email format", "age": "Must be a positive number" } } } ``` ## Rate Limiting **Rate limits:** - **Authenticated requests:** 1000 requests per hour - **Unauthenticated requests:** 100 requests per hour **Rate limit headers:** ``` X-RateLimit-Limit: 1000 X-RateLimit-Remaining: 999 X-RateLimit-Reset: 1640995200 ``` **When rate limited:** - Status code: `429 Too Many Requests` - Response includes `Retry-After` header (seconds until reset) ## Endpoints --- ## [Resource 1 - e.g., Users] ### List [Resources] Retrieve a paginated list of [resources]. **Endpoint:** ``` GET /api/v1/[resources] ``` **Authentication:** Required **Query Parameters:** | Parameter | Type | Required | Default | Description | |-----------|------|----------|---------|-------------| | `page` | integer | No | 1 | Page number for pagination | | `limit` | integer | No | 20 | Number of items per page (max 100) | | `sort` | string | No | `created_at` | Sort field (e.g., `name`, `created_at`) | | `order` | string | No | `desc` | Sort order (`asc` or `desc`) | | `filter` | string | No | - | Filter by [field] | **Example Request:** ```bash curl -X GET "https://api.example.com/v1/users?page=1&limit=10&sort=created_at&order=desc" \ -H "Authorization: Bearer YOUR_API_TOKEN" ``` **Example Response:** ```json { "data": [ { "id": "usr_123abc", "name": "John Doe", "email": "john@example.com", "role": "admin", "created_at": "2024-01-15T10:30:00Z", "updated_at": "2024-01-15T10:30:00Z" }, { "id": "usr_456def", "name": "Jane Smith", "email": "jane@example.com", "role": "user", "created_at": "202