
Api Documenter
Generate and validate OpenAPI 3.0 specs so your API is documented before you ship SDKs or public docs.
Overview
API Documenter is an agent skill for the Build phase that creates and validates OpenAPI 3.0 documentation for REST-style APIs.
Install
npx skills add https://github.com/charon-fan/agent-playbook --skill api-documenterWhat is this skill?
- 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”
- OpenAPI 3.0.3 target
- 2 Python helper scripts: generate and validate
Adoption & trust: 584 installs on skills.sh; 58 GitHub stars; 3/3 security scanners passed (skills.sh audits).
What problem does it solve?
Your endpoints exist in code or chat context but stakeholders and agents lack a single, valid OpenAPI contract with auth and errors spelled out.
Who is it for?
Solo builders documenting a new or evolving REST API who want OpenAPI-first output inside Claude Code or Cursor without hand-writing every path object.
Skip if: GraphQL-only APIs, gRPC services without HTTP mapping, or teams that already enforce a golden spec in CI and only need trivial edits.
When should I use this skill?
User asks to document an API, create an OpenAPI spec, or generate API documentation for REST endpoints.
What do I get? / Deliverables
You leave the session with an OpenAPI 3.0 YAML spec—optionally validated via the bundled scripts—ready for docs sites, SDK codegen, or review in Ship.
- openapi.yaml specification
- Validated OpenAPI document
- Reference examples for health and minimal APIs
Recommended Skills
Journey fit
Placed on the Build shelf because the skill produces machine-readable API contracts and human-facing documentation while you are still shaping the product surface, not during initial idea research or post-launch analytics. Docs is the primary output: OpenAPI paths, schemas, auth, and error formats are authoring artifacts that unblock portals, client SDKs, and agent consumers of your HTTP API.
How it compares
An in-repo OpenAPI generator skill—not a hosted Swagger UI substitute or an API gateway deployment tool.
Common Questions / FAQ
Who is api-documenter for?
Indie developers and small teams shipping HTTP APIs who need agent-assisted OpenAPI 3.0 specs with REST conventions, auth, and error models.
When should I use api-documenter?
During Build while defining or stabilizing routes; optionally in Ship before external release when you need a validated spec for partners or automated client generation.
Is api-documenter safe to install?
See the Security Audits panel on this Prism page; review any generated specs and Python script invocations before running them on production secrets or unchecked network calls.
SKILL.md
READMESKILL.md - Api Documenter
# API Documenter > A Claude Code skill for OpenAPI/Swagger API documentation. ## Installation This skill is part of the [agent-playbook](../../README.md) collection. ## Usage ``` You: Document this API You: Create OpenAPI spec You: Generate API documentation ``` ## OpenAPI 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: ```bash python scripts/generate_openapi.py ``` Validate OpenAPI spec: ```bash python scripts/validate_openapi.py openapi.yaml ``` ## Resources - [OpenAPI Specification](https://swagger.io/specification/) - [Swagger Tools](https://swagger.io/tools/) 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 textwrap 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", help="Resource name") parser.add_argument("--version", default="1.0.0", help="API version") parser.add_argument( "--base-url", default="https://example.com", 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("-")) if not schema_name: schema_name = "Example" 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 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.yam