Agent skill · writing content · aiskillstore
openapi-spec-generation
Generate and maintain OpenAPI 3.1 specifications from code, design-first specs, and validation patterns. Use when creating API documentation, generating SDKs, or ensuring API contract compliance.
Why this skill is useful
Provides detailed templates and patterns for generating and validating OpenAPI 3.1 specifications that the AI wouldn't reliably generate on its own.
What it needs
About 7k tokens when loaded. Last updated 2026-08-07. 405 stars on the source repository.
What this skill does
OpenAPI Spec Generation Comprehensive patterns for creating, maintaining, and validating OpenAPI 3.1 specifications for RESTful APIs. When to Use This Skill Creating API documentation from scratch Generating OpenAPI specs from existing code Designing API contracts (design-first approach) Validating API implementations against specs Generating client SDKs from specs Setting up API documentation portals Core Concepts 1. OpenAPI 3.1 Structure 2. Design Approaches Approach Description Best For ---------- ------------- ---------- Design-First Write spec before code New APIs, contracts Code-First Generate spec from code Existing APIs Hybrid Annotate code, generate spec Evolving APIs Templates Template 1: Complete API Specification Template 2: Code-First Generation (Python/FastAPI) Template 3: Code-First (TypeScript/Express with tsoa) `typescript // tsoa generates OpenAPI from TypeScript decorators import { Controller, Get, Post, Patch, Delete, Route, Path, Query, Body, Response, SuccessResponse, Tags, Security, Example, } from "tsoa"; // Models interface User { / Unique identifier / id: string; / User email address / email: string; / Display name / name: string; status: UserStatus; role: UserRole; / Avatar URL / avatar?: string; / Custom metadata / metadata?: Record<string, unknown>; createdAt: Date; updatedAt?: Date; } enum UserStatus { Active = "active", Inactive = "inactive", Suspended = "suspended", Pending = "pending", } enum UserRole { User = "user", Moderator = "moderator", Admin = "admin", } interface CreateUserRequest { email: string; name: string; role?: UserRole; metadata?: Record<string, unknown>; } interface UpdateUserRequest { name?: string; status?: UserStatus; role?: UserRole; metadata?: Record<string, unknown>; } interface Pagination { page: number; limit: number; total: number; totalPages: number; hasNext: boolean; hasPrev: boolean; } interface UserListResponse { data: User[]; pagination: Pagination; } interface ErrorResponse { code: string; message: str …
How to use it
Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:
@skills aiskillstore/openapi-spec-generation--4c630c