openapi-codegen

Generate type-safe API clients from OpenAPI specifications using openapi-typescript and openapi-fetch.

3|1|Updated Mar 11, 2026
One-click install
npx skills add https://github.com/jon23d/skillz --skill openapi-codegen
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: openapi-codegen
Source: https://github.com/jon23d/skillz/tree/main/skills/openapi-codegen
Command: npx skills add https://github.com/jon23d/skillz --skill openapi-codegen

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill automates the creation and maintenance of type-safe API clients, ensuring consistency between backend API contracts and frontend implementations, thereby reducing integration errors and improving developer velocity.

Core Features & Use Cases

  • Spec-First Contract Design: Enforces the OpenAPI specification as the single source of truth for API contracts.
  • Automated Code Generation: Generates TypeScript types and a typed fetch client from OpenAPI specifications.
  • Monorepo Integration: Provides a structure for managing API clients within a monorepo.
  • Use Case: When a new backend endpoint is added or an existing one is modified, this Skill ensures the frontend client is automatically updated and type-checked against the new contract.

Quick Start

Use the openapi-codegen skill to generate the API client types from the OpenAPI specification located at ./apps/api/openapi.yaml.

Frequently Asked Questions about openapi-codegen

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I generate type-safe API clients from OpenAPI specs in a TypeScript monorepo?

Generate type-safe API clients by automating TypeScript type and typed fetch client creation directly from OpenAPI specifications. This enforces spec-first contract design, ensuring consistency between backend APIs and frontend implementations within a monorepo.

What is spec-first contract design and how does it improve frontend backend integration?

Spec-first contract design enforces the OpenAPI specification as the single source of truth for API contracts. It improves integration by automatically updating and type-checking frontend clients against new or modified backend endpoints, reducing integration errors.

How do I automate TypeScript type generation when my OpenAPI specification changes?

Automate TypeScript type generation by using openapi-typescript and openapi-fetch to generate types and a typed fetch client from your OpenAPI specification. When a backend endpoint changes, the frontend client is automatically updated and type-checked.

Does openapi-codegen work with existing OpenAPI specifications in a monorepo?

Yes, it works with existing OpenAPI specifications in a monorepo by providing a structured approach to managing API clients. You can generate client types directly from your specification file, such as one located at ./apps/api/openapi.yaml.

What's the best way to enforce end-to-end type safety for API clients using OpenAPI?

The best way to enforce end-to-end type safety is integrating openapi-typescript and openapi-fetch for codegen-driven development. This approach generates typed fetch clients and TypeScript types directly from OpenAPI specifications, ensuring strict contract adherence.

Why should I use codegen-driven development for API client maintenance?

Use codegen-driven development to maintain type-safe API clients and ensure consistency between backend contracts and frontend implementations. It reduces integration errors and improves developer velocity by automating client updates when API specifications change.