regenerate-types

Regenerate TypeScript interfaces from api.yml after API changes.

6|Updated Feb 20, 2025
One-click install
npx skills add https://github.com/zerobias-org/module --skill regenerate-types
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: regenerate-types
Source: https://github.com/zerobias-org/module/tree/main/.claude/skills/regenerate-types
Command: npx skills add https://github.com/zerobias-org/module --skill regenerate-types

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

After any changes to api.yml, TypeScript interfaces MUST be regenerated before proceeding to implementation to avoid type drift and integration issues.

Core Features & Use Cases

  • Automatically regenerate TypeScript interfaces from api.yml after edits.
  • Enforce a clean generation state by requiring npm run clean before npm run generate.
  • Use Case: When an API specification changes, regenerate types to keep client code in sync with the API.

Quick Start

Edit api.yml and run npm run clean && npm run generate to regenerate the TypeScript interfaces.

Frequently Asked Questions about regenerate-types

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

FAQPage Schema
How do I regenerate TypeScript interfaces from an OpenAPI api.yml file?

To regenerate TypeScript interfaces from api.yml, edit the file and run npm run clean followed by npm run generate to ensure a clean generation state and sync client code with API schema changes.

Why do I need to regenerate TypeScript types after updating api.yml?

You need to regenerate TypeScript types after api.yml updates to avoid type drift and integration issues, ensuring that the client code remains in sync with the latest API specification changes before implementation.

What npm scripts are required to automate TypeScript code generation from OpenAPI?

Automating TypeScript code generation from OpenAPI requires the project to define npm run clean and npm run generate scripts, which execute sequentially to remove stale types and produce updated interfaces.

When should I run a clean generation state for TypeScript interfaces?

You should run a clean generation state for TypeScript interfaces immediately after completing api.yml edits, executing npm run clean before npm run generate to remove outdated generated files and prevent schema conflicts.

Can I use this code generation workflow without npm run clean defined in my project?

No, this code generation workflow requires npm run clean and npm run generate to be defined in your project, as it enforces a clean generation state by running the clean script before generating new TypeScript interfaces.

What happens if I skip type regeneration after modifying the OpenAPI schema?

Skipping type regeneration after modifying the OpenAPI schema results in type drift between the api.yml specification and the TypeScript client code, leading to integration issues and implementation errors.