
Api Documenter
- 659 installs
- 65 repo stars
- Updated June 21, 2026
- charon-fan/agent-playbook
api-documenter is a Claude Code skill that generates and validates OpenAPI 3.0 specifications for developers who need REST API documentation before shipping SDKs or public docs.
About
api-documenter is an agent-playbook skill for producing OpenAPI 3.0 and Swagger-compatible API documentation from existing REST services. It follows RESTful conventions with clear resource naming, complete request and response schemas, authentication requirements, and standardized error formats. Bundled Python scripts generate specs via generate_openapi.py and validate them with validate_openapi.py against openapi.yaml. Developers invoke api-documenter when they need machine-readable API contracts for SDK generation, partner integrations, or developer portals.
- OpenAPI 3.0.3 generation following RESTful resource naming and complete request/response shapes
- Documents authentication requirements and standardized error response formats
- Python scripts: generate_openapi.py and validate_openapi.py for spec creation and linting
- Ships reference OpenAPI YAML examples for health checks and minimal APIs
- Part of the agent-playbook collection with natural-language triggers like “Document this API”
Api Documenter by the numbers
- 659 all-time installs (skills.sh)
- Ranked #338 of 1,901 Documentation skills by installs in the Skillselion catalog
- Security screen: LOW risk (skills.sh audit)
- Data as of Jul 28, 2026 (Skillselion catalog sync)
npx skills add https://github.com/charon-fan/agent-playbook --skill api-documenterAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 659 |
|---|---|
| repo stars | ★ 65 |
| Security audit | 3 / 3 scanners passed |
| Last updated | June 21, 2026 |
| Repository | charon-fan/agent-playbook ↗ |
How do you generate OpenAPI 3.0 docs from a REST API?
Generate and validate OpenAPI 3.0 specs so your API is documented before you ship SDKs or public docs.
Who is it for?
Backend developers documenting REST APIs who need generated and validated OpenAPI 3.0 specs with Python helper scripts.
Skip if: GraphQL-only APIs or teams that already maintain hand-written specs with no generation or validation gap.
When should I use this skill?
The user asks to document an API, create an OpenAPI spec, or generate Swagger-compatible REST documentation.
What you get
An OpenAPI 3.0 YAML spec with validated request, response, auth, and error schemas ready for SDK or portal publishing.
- openapi.yaml
- validated OpenAPI 3.0 specification
By the numbers
- Includes 2 Python scripts: generate_openapi.py and validate_openapi.py
Files
API Documenter
Specialist in creating comprehensive API documentation using OpenAPI/Swagger specifications.
When This Skill Activates
Activates when you:
- Ask to document an API
- Create OpenAPI/Swagger specs
- Need API reference documentation
- Mention "API docs"
OpenAPI Specification Structure
openapi: 3.0.3
info:
title: API Title
version: 1.0.0
description: API description
servers:
- url: https://example.com/api/v1
paths:
/users:
get:
summary: List users
operationId: listUsers
tags:
- users
parameters: []
responses:
'200':
description: Successful response
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/User'
components:
schemas:
User:
type: object
properties:
id:
type: string
name:
type: stringEndpoint Documentation
For each endpoint, document:
Required Fields
- summary: Brief description
- operationId: Unique identifier
- description: Detailed explanation
- tags: For grouping
- responses: All possible responses
Recommended Fields
- parameters: All parameters with details
- requestBody: For POST/PUT/PATCH
- security: Authentication requirements
- deprecated: If applicable
Example
/users/{id}:
get:
summary: Get a user by ID
operationId: getUserById
description: Retrieves a single user by their unique identifier
tags:
- users
parameters:
- name: id
in: path
required: true
schema:
type: string
description: The user ID
responses:
'200':
description: User found
content:
application/json:
schema:
$ref: '#/components/schemas/User'
'404':
description: User not found
content:
application/json:
schema:
$ref: '#/components/schemas/Error'Schema Documentation
Best Practices
1. Use references for shared schemas 2. Add descriptions to all properties 3. Specify format for strings (email, uuid, date-time) 4. Add examples for complex schemas 5. Mark required fields
Example
components:
schemas:
User:
type: object
required:
- id
- email
properties:
id:
type: string
format: uuid
description: Unique user identifier
example: "550e8400-e29b-41d4-a716-446655440000"
email:
type: string
format: email
description: User's email address
example: "user@example.com"
createdAt:
type: string
format: date-time
description: Account creation timestampAuthentication Documentation
Document auth requirements:
security:
- bearerAuth: []
components:
securitySchemes:
bearerAuth:
type: http
scheme: bearer
bearerFormat: JWT
description: Use your JWT token from /auth/loginError Responses
Standard error format:
components:
schemas:
Error:
type: object
properties:
error:
type: string
description: Error message
code:
type: string
description: Application-specific error code
details:
type: object
description: Additional error detailsCommon HTTP status codes:
- 200: Success
- 201: Created
- 204: No Content
- 400: Bad Request
- 401: Unauthorized
- 403: Forbidden
- 404: Not Found
- 409: Conflict
- 422: Unprocessable Entity
- 500: Internal Server Error
Scripts
Generate OpenAPI spec from code:
python scripts/generate_openapi.pyValidate OpenAPI spec:
python scripts/validate_openapi.py openapi.yamlReferences
references/openapi-template.yaml- OpenAPI templatereferences/examples/- API documentation examples- OpenAPI Specification
API Documenter
A Claude Code skill for OpenAPI/Swagger API documentation.
Installation
This skill is part of the agent-playbook collection.
Usage
You: Document this API
You: Create OpenAPI spec
You: Generate API documentationOpenAPI Specification
The skill generates OpenAPI 3.0 specifications following:
- RESTful conventions
- Clear resource naming
- Complete request/response documentation
- Authentication requirements
- Error response formats
Scripts
Generate OpenAPI spec:
python scripts/generate_openapi.pyValidate OpenAPI spec:
python scripts/validate_openapi.py openapi.yamlResources
openapi: 3.0.3
info:
title: Sample API
version: 0.1.0
paths:
/health:
get:
responses:
'200':
description: OK
OpenAPI Examples
This directory contains small OpenAPI examples for reference.
openapi: 3.0.3
info:
title: Example API
version: 1.0.0
paths: {}
#!/usr/bin/env python3
# Template generator for OpenAPI schema.
from pathlib import Path
import argparse
import re
import textwrap
from urllib.parse import urlparse
RESOURCE_RE = re.compile(r"^[a-z][a-z0-9-]*$")
VERSION_RE = re.compile(r"^\d+\.\d+\.\d+([+-][0-9A-Za-z.-]+)?$")
def validate_resource_name(name: str) -> str:
value = name.strip().lower()
if not RESOURCE_RE.fullmatch(value):
raise argparse.ArgumentTypeError(
"--name must start with a lowercase letter and contain only lowercase letters, numbers, and hyphens"
)
return value
def validate_version(version: str) -> str:
if not VERSION_RE.fullmatch(version):
raise argparse.ArgumentTypeError("--version must be a semantic version such as 1.0.0")
return version
def validate_base_url(url: str) -> str:
parsed = urlparse(url)
if parsed.scheme not in {"http", "https"} or not parsed.netloc:
raise argparse.ArgumentTypeError("--base-url must be an absolute http(s) URL")
return url.rstrip("/")
def write_output(path: Path, content: str, force: bool) -> bool:
if path.exists() and not force:
print(f"{path} already exists (use --force to overwrite)")
return False
path.parent.mkdir(parents=True, exist_ok=True)
path.write_text(content, encoding="utf-8")
return True
def main() -> int:
parser = argparse.ArgumentParser(description="Generate a starter OpenAPI schema.")
parser.add_argument("--output", default="openapi.yaml", help="Output file path")
parser.add_argument("--name", default="example", type=validate_resource_name, help="Resource name")
parser.add_argument("--version", default="1.0.0", type=validate_version, help="API version")
parser.add_argument(
"--base-url", default="https://example.com", type=validate_base_url, help="Server base URL"
)
parser.add_argument("--force", action="store_true", help="Overwrite existing file")
args = parser.parse_args()
schema_name = "".join(part.capitalize() for part in args.name.split("-"))
content = textwrap.dedent(
f"""\
openapi: 3.0.3
info:
title: {args.name} API
version: {args.version}
description: API description for {args.name}
servers:
- url: {args.base_url}
paths:
/{args.name}:
get:
summary: List {args.name}
responses:
"200":
description: OK
content:
application/json:
schema:
type: object
properties:
items:
type: array
items:
$ref: "#/components/schemas/{schema_name}"
components:
schemas:
{schema_name}:
type: object
properties:
id:
type: string
name:
type: string
securitySchemes:
bearerAuth:
type: http
scheme: bearer
security:
- bearerAuth: []
"""
).strip() + "\n"
output = Path(args.output)
if not write_output(output, content, args.force):
return 1
print(f"Wrote {output}")
return 0
if __name__ == "__main__":
raise SystemExit(main())
#!/usr/bin/env python3
# Template validator for OpenAPI schema.
from pathlib import Path
import argparse
import re
DEFAULT_REQUIRED = [
"openapi:",
"info:",
"servers:",
"paths:",
"components:",
"securitySchemes:",
]
def main() -> int:
parser = argparse.ArgumentParser(description="Validate a generated artifact.")
parser.add_argument("--input", default="openapi.yaml", help="Input file path")
parser.add_argument(
"--require",
action="append",
default=[],
help="Additional required section heading",
)
args = parser.parse_args()
path = Path(args.input)
if not path.exists():
print(f"Missing file: {path}")
return 1
text = path.read_text(encoding="utf-8", errors="ignore")
required = DEFAULT_REQUIRED + args.require
missing = [token for token in required if not re.search(rf"^\s*{re.escape(token)}", text, re.MULTILINE)]
if missing:
print("Missing required sections: " + ", ".join(missing))
return 1
if not re.search(r"^openapi:\s*3\.\d+\.\d+\s*$", text, re.MULTILINE):
print("Invalid or missing OpenAPI 3.x version")
return 1
if not re.search(r"^\s{2}- url:\s+https?://\S+\s*$", text, re.MULTILINE):
print("Missing absolute http(s) server URL")
return 1
if not re.search(r"^\s{2}/[A-Za-z0-9._~!$&'()*+,;=:@%-]+:", text, re.MULTILINE):
print("No path entries found under paths")
return 1
refs = re.findall(r'\$ref:\s+"?#/components/schemas/([^"\s]+)"?', text)
schemas = set(re.findall(r"^\s{4}([A-Za-z][A-Za-z0-9_]*):\s*$", text, re.MULTILINE))
missing_refs = [ref for ref in refs if ref not in schemas]
if missing_refs:
print("Missing referenced schemas: " + ", ".join(sorted(set(missing_refs))))
return 1
print(f"Validated {path}")
return 0
if __name__ == "__main__":
raise SystemExit(main())
Related skills
FAQ
What OpenAPI version does api-documenter produce?
api-documenter generates OpenAPI 3.0 specifications with RESTful conventions, complete request and response documentation, authentication requirements, and error response formats suitable for SDK and portal publishing.
How does api-documenter validate generated specs?
api-documenter includes python scripts/validate_openapi.py to check openapi.yaml output. Generation runs through python scripts/generate_openapi.py before validation and publication.
Is Api Documenter safe to install?
skills.sh reports 3 of 3 security scanners passed. Review the Security Audits panel on this page before installing in production.