Skip to main content
Skills/Engineering & Code/api-doc-writer

API Documentation Writer Skill

Generates comprehensive API documentation from source code, route handlers, and type definitions.

A reusable skill package for Claude Code and Cowork.

When to use this skill

  • Documenting REST or GraphQL API endpoints
  • Generating OpenAPI/Swagger specs from code
  • Writing developer-facing API references
  • Keeping API docs in sync with implementation

What this skill does

Scans route handlers, controllers, and type definitions to extract endpoint signatures, request/response schemas, authentication requirements, and error codes. Produces structured API documentation with examples, organized by resource.

How it works

  1. 1Scan codebase for route handlers, controllers, and API definitions
  2. 2Extract endpoint details: method, path, params, request/response schemas, auth
  3. 3Generate documentation with curl examples, error codes, and rate limits
  4. 4Organize by resource and add table of contents with cross-references

Full Skill Definition

---
name: api-doc-writer
description: "Generates comprehensive API documentation from source code, route handlers, and type definitions."
---

# Api Doc Writer

## Overview

You are a technical writer specializing in API documentation and developer experience.

## Purpose

Generate comprehensive, accurate API documentation from source code — including endpoint signatures, request/response schemas, authentication, and usage examples.

## When to Use

When a user needs to document REST or GraphQL API endpoints, generate OpenAPI specs, or keep API docs in sync with implementation.

## Documentation Process

## Step 1: Scan & Inventory

Read route handlers, controllers, and type definitions. Build an inventory of all endpoints with method, path, params, and auth requirements.

## Step 2: Extract Schemas

For each endpoint, extract request body shape, query parameters, path parameters, response schema, and possible error codes. Use TypeScript types, Zod schemas, or inline annotations.

## Step 3: Write Documentation

For each endpoint, produce:
- **Method + Path** (e.g., `POST /api/users`)
- **Description** of what it does
- **Authentication** requirements
- **Request** body/params with types
- **Response** shape with example
- **Error codes** and meanings
- **curl example**

## Step 4: Organize & Cross-Reference

Group endpoints by resource. Add a table of contents. Cross-reference related endpoints (e.g., "See also: GET /api/users/:id"). Note rate limits and pagination patterns.

## Error Handling

## Framework Unknown

Ask about the web framework (Express, Next.js, FastAPI, Django) and routing conventions before scanning.

## Incomplete Type Information

When types are missing or `any` is used, document what you can observe and flag gaps: "Response shape inferred from usage — verify with team."

## Auth Documentation

Never include real API keys or tokens in examples. Use placeholders like `YOUR_API_KEY`. Document auth requirements without exposing secrets.

Summary

Generates comprehensive API documentation from source code, route handlers, and type definitions. Install this skill by placing the package in ~/.claude/skills/api-doc-writer/ for personal use, or .claude/skills/api-doc-writer/ for project-specific use.

FAQs

What frameworks does it support?

It works with Express, Next.js API routes, FastAPI, Django REST, Flask, and any framework with readable route definitions.

Does it generate OpenAPI specs?

It produces Markdown documentation by default. You can customize the Core Logic to output OpenAPI/Swagger YAML instead.

Can it document GraphQL APIs?

Yes. It reads schema definitions and resolvers to produce query/mutation documentation with type details.

Download & install

Install paths

Claude Code — personal (all projects)

~/.claude/skills/api-doc-writer/SKILL.md

Claude Code — project-specific

.claude/skills/api-doc-writer/SKILL.md

Cowork — skill plugin

Upload .skill.zip via Cowork plugin manager

Compatible with Claude Code, Cowork, and any SKILL.md-compatible agent platform.

Skills in the registry are community starter templates provided as-is. skill.design and Designless do not guarantee accuracy, completeness, or fitness for any purpose. Always review, customize, and validate skills for your specific use case before deploying to production. You are responsible for the behavior of skills you install and use.