All skills
Skillintermediate
generate spec
Generate an OpenAPI 3.1 specification from existing API routes and handlers.
Claude Code Knowledge Pack7/10/2026
Overview
Generate an OpenAPI 3.1 specification from existing API routes and handlers.
Steps
- Scan the project for API route definitions:
- For each endpoint, extract:
- Generate the OpenAPI spec:
- Add authentication schemes:
- Add examples for each endpoint.
- Validate the generated spec:
- Save as openapi.yaml or openapi.json.
Format
openapi: "3.1.0"
info:
title:
version: <version>
Rules
- Use OpenAPI 3.1 unless the project requires 3.0 compatibility.
- Every endpoint must have at least one response defined.
- Use $ref for reusable schemas instead of inline definitions.