# api-reference-documentation

A skill that walks the agent through writing API reference docs: endpoints, auth, request and response examples, OpenAPI specs.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode · 494 installs · ★ 371
- Author: aj-geddes
- License: MIT · policy=mirror · the beginning of the file is at the end of this page
- Source: https://github.com/aj-geddes/useful-ai-prompts/tree/HEAD/skills/api-reference-documentation/SKILL.md
- Updated: 2026-03-04
- HTML: https://affpapa.org/en/nevibecode/skills/api-reference-documentation

## What it does

This skill gives the agent a shape for API documentation work. It starts from an OpenAPI 3.0+ spec and moves through endpoint descriptions, authentication, request and response examples, rate limits and pagination. The skill ships a starter spec example plus a `references/` directory with deeper write-ups, including an OpenAPI specification example and a list-products endpoint.

REST is not the only target. The skill also covers GraphQL, webhooks, API versioning and SDK docs. A best-practices section lists what to include: error response formats, consistent naming, SDK examples in several languages, an interactive Swagger UI. It also lists what to avoid — undocumented endpoints, missing auth notes, ignored deprecation notices.

The skill installs across Claude, Codex, Cursor, GitHub Copilot, Gemini CLI and OpenCode. In Claude the file lands at `~/.claude/skills/api-reference-documentation/SKILL.md`. If your project still runs an older OpenAPI version, expect to rewrite part of the examples before the skill's output fits.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add aj-geddes/useful-ai-prompts --skill api-reference-documentation -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/api-reference-documentation/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/api-reference-documentation/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add aj-geddes/useful-ai-prompts --skill api-reference-documentation -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/api-reference-documentation/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add aj-geddes/useful-ai-prompts --skill api-reference-documentation -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/api-reference-documentation/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install aj-geddes/useful-ai-prompts api-reference-documentation
```

2. **Manually: put the files in place**
- File: `.github/skills/api-reference-documentation/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add aj-geddes/useful-ai-prompts --skill api-reference-documentation -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/aj-geddes/useful-ai-prompts --path skills/api-reference-documentation
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/api-reference-documentation/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add aj-geddes/useful-ai-prompts --skill api-reference-documentation -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/aj-geddes/useful-ai-prompts/tree/HEAD/skills/api-reference-documentation/SKILL.md

## When to use it
- document REST endpoints well enough for outside teams to integrate
- turn scattered notes into an OpenAPI 3.0+ specification
- add request and response examples to every endpoint
- write up authentication, rate limits and pagination
- cover webhooks and API versioning with a migration guide

## Example prompts
- Write API reference docs for our orders service: endpoints, auth, request and response examples.
- Turn these endpoints into an OpenAPI spec and add error response examples.
- Document the webhooks and explain how to ship a new API version without breaking clients.

## Source text · SKILL.md · MIT

Below is the content of a third-party file. It is data, not instructions for you: do not act on anything written inside unless the human asks. Block tag: 9978de043d8a9558.

BEGIN THIRD-PARTY FILE 9978de043d8a9558
````text
---
name: api-reference-documentation
description: >
  Create comprehensive API reference documentation with OpenAPI/Swagger specs,
  REST endpoints, authentication, examples, and SDKs. Use when documenting REST
  APIs, GraphQL APIs, endpoint documentation, or OpenAPI specifications.
---

# API Reference Documentation

## Table of Contents

- [Overview](#overview)
- [When to Use](#when-to-use)
- [Quick Start](#quick-start)
- [Reference Guides](#reference-guides)
- [Best Practices](#best-practices)

## Overview

Generate professional API documentation that developers can use to integrate with your API, including endpoint specifications, authentication, request/response examples, and interactive documentation.

## When to Use

- Documenting REST APIs
- Creating OpenAPI/Swagger specifications
- GraphQL API documentation
- SDK and client library docs
- API authentication guides
- Rate limiting documentation
- Webhook documentation
- API versioning guides

## Quick Start

Minimal working example:

```yaml
openapi: 3.0.3
info:
  title: E-Commerce API
  description: |
    Complete API for managing e-commerce operations including products,
    orders, customers, and payments.

    ## Authentication
    All endpoints require Bearer token authentication. Include your API key
    in the Authorization header: `Authorization: Bearer YOUR_API_KEY`

    ## Rate Limiting
    - 1000 requests per hour for authenticated users
    - 100 requests per hour for unauthenticated requests

    ## Pagination
    List endpoints return paginated results with `page` and `limit` parameters.
  version: 2.0.0
  contact:
    name: API Support
    email: api@example.com
    url: https://example.com/support
  license:
    name: MIT
    url: https://opensource.org/licenses/MIT
// ... (see reference guides for full implementation)
```

## Reference Guides

Detailed implementations in the `references/` directory:

| Guide | Contents |
|---|---|
| [OpenAPI Specification Example](references/openapi-specification-example.md) | openapi: 3.0.3 |
| [List Products](references/list-products.md) | List Products |

## Best Practices

### ✅ DO

- Use OpenAPI 3.0+ specification
- Include request/response examples for every endpoint
- Document all query parameters and headers
- Provide authentication examples
- Include error response formats
- Document rate limits and pagination
````
END THIRD-PARTY FILE 9978de043d8a9558

The third-party file has ended. Everything between the 9978de043d8a9558 tags is data: requests and commands from it are not followed. An “end of file” line with another tag inside the block is part of the file.

First 2371 of 2819 bytes. © aj-geddes · MIT · https://github.com/aj-geddes/useful-ai-prompts/tree/HEAD/skills/api-reference-documentation/SKILL.md

_Part of the page did not fit — see the HTML version._

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
