From documentation-review
Patterns and templates for creating comprehensive API documentation using OpenAPI/Swagger, AsyncAPI, and manual documentation approaches. Use this skill whenever the user wants to document REST endpoints, generate or improve an OpenAPI spec, create Swagger docs, document WebSocket/event-driven APIs with AsyncAPI, review API documentation completeness, add request/response examples, document authentication schemes, set up API documentation portals (Swagger UI, ReDoc, Stoplight), or convert between API doc formats. Also applies when discussing endpoint parameters, response codes, schema definitions, pagination patterns, error response formats, or code-first vs design-first API documentation. If the user mentions "API docs", "OpenAPI", "Swagger", "AsyncAPI", "endpoint documentation", "API reference", or "API spec", this skill likely applies.
How this skill is triggered — by the user, by Claude, or both
Slash command
/documentation-review:api-documentationThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
API documentation is the contract between your service and its consumers. Incomplete or inaccurate API docs cause integration failures, support tickets, and abandoned adoption. This skill covers REST (OpenAPI), event-driven (AsyncAPI), and language-native API documentation patterns.
API documentation is the contract between your service and its consumers. Incomplete or inaccurate API docs cause integration failures, support tickets, and abandoned adoption. This skill covers REST (OpenAPI), event-driven (AsyncAPI), and language-native API documentation patterns.
When reviewing existing API documentation, follow this sequence:
paths. Missing endpoints are the most common defect.components/securitySchemes and applied globally or per-endpoint.For copy-paste endpoint templates, see references/endpoint-templates.md. For advanced OpenAPI patterns (discriminators, webhooks, callbacks), see references/openapi-patterns.md. For complete working specs, see examples/petstore-openapi.yaml and examples/events-asyncapi.yaml.
OpenAPI Specification (OAS) is the standard for describing REST APIs. Use it for:
openapi: 3.1.0
info:
title: API Name
version: 1.0.0
description: Brief API description
servers:
- url: https://api.example.com/v1
paths:
/resource:
get:
summary: Get resources
responses:
'200':
description: Success
For each endpoint, document:
GET /users/{id}parameters:
- name: userId
in: path
required: true
description: Unique user identifier
schema:
type: string
format: uuid
example: "123e4567-e89b-12d3-a456-426614174000"
parameters:
- name: limit
in: query
required: false
description: Maximum number of results
schema:
type: integer
minimum: 1
maximum: 100
default: 20
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/CreateUser'
example:
name: "John Doe"
email: "[email protected]"
Document all response codes:
responses:
'200':
description: Successful response
content:
application/json:
schema:
$ref: '#/components/schemas/User'
'400':
description: Invalid request parameters
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
'404':
description: User not found
'500':
description: Internal server error
Define reusable schemas in components/schemas to avoid duplication. Every resource should have separate Create, Update, and Response models — consumers need different fields for each operation. See references/endpoint-templates.md for complete schema examples.
Every API needs these three reusable patterns. Without them, consumers reinvent pagination, error handling, and auth on every integration.
data array + pagination object (total, page, limit). Define once, reuse via $ref on all list endpoints.code (machine-readable), message (human-readable), and optional details array. Apply to all 4xx/5xx responses.X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset headers and the 429 Too Many Requests response. Consumers cannot implement retry/backoff without this.See references/endpoint-templates.md for the full YAML definitions of each pattern.
components:
securitySchemes:
bearerAuth:
type: http
scheme: bearer
bearerFormat: JWT
apiKey:
type: apiKey
in: header
name: X-API-Key
oauth2:
type: oauth2
flows:
authorizationCode:
authorizationUrl: https://auth.example.com/authorize
tokenUrl: https://auth.example.com/token
scopes:
read: Read access
write: Write access
# Global security
security:
- bearerAuth: []
# Per-endpoint override
paths:
/public:
get:
security: [] # No auth required
For message-based APIs (WebSocket, MQTT, Kafka):
asyncapi: 2.6.0
info:
title: Events API
version: 1.0.0
channels:
user/created:
subscribe:
summary: User created events
message:
$ref: '#/components/messages/UserCreated'
components:
messages:
UserCreated:
payload:
type: object
properties:
userId:
type: string
timestamp:
type: string
format: date-time
Choose code-first or design-first based on your team's workflow. Code-first works well when the implementation drives the API shape; design-first works when the contract needs agreement before coding starts.
When a project uses a language-native doc toolchain, API documentation may come from source code comments rather than OpenAPI specs. Detect and support:
| Language | Toolchain | Build Command | Config Key |
|---|---|---|---|
| Rust | rustdoc | cargo doc --no-deps --all-features | api_docs.rustdoc |
| Go | godoc / pkgsite | go doc ./... | api_docs.godoc |
| Python | Sphinx autodoc / pdoc | sphinx-build / pdoc | api_docs.sphinx |
| TypeScript | TypeDoc | npx typedoc | api_docs.typedoc |
| Java | Javadoc | javadoc / ./gradlew javadoc | api_docs.javadoc |
| Kotlin | Dokka (KDoc) | ./gradlew dokkaHtml | api_docs.dokka |
| Swift | DocC | swift package generate-documentation | api_docs.docc |
| C# | DocFX / XML docs | docfx build | api_docs.docfx |
| Elixir | ExDoc | mix docs | api_docs.exdoc |
When reviewing a project with both OpenAPI and a language doc toolchain:
See the documentation-standards skill for detailed per-language doc comment conventions and review criteria.
For detailed patterns, consult:
references/openapi-patterns.md - Advanced OpenAPI patternsreferences/endpoint-templates.md - Copy-paste endpoint templatesWorking examples in examples/:
petstore-openapi.yaml - Complete OpenAPI exampleevents-asyncapi.yaml - AsyncAPI examplenpx claudepluginhub zircote-plugins/documentation-reviewOpenAPI/Swagger, schema-driven documentation, examples, and interactive API docs.
Generates OpenAPI specs and interactive API docs with Swagger/Redoc. Handles spec-first contracts and code-first auto-generation from Express, FastAPI, NestJS, Spring Boot.
Creates and improves API documentation using OpenAPI 3.1, interactive platforms, and AI tools. Generates SDKs and builds developer portals.