codegen-over-complex-types

Generate TypeScript types from OpenAPI, GraphQL, or database schemas.

Updated Jul 17, 2017
One-click install
npx skills add https://github.com/luyi985/lyi-bash --skill codegen-over-complex-types
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: codegen-over-complex-types
Source: https://github.com/luyi985/lyi-bash/tree/main/ai/skills/codegen-over-complex-types
Command: npx skills add https://github.com/luyi985/lyi-bash --skill codegen-over-complex-types

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Complex type-level code grows unmaintainable when schemas drift; this Skill generates types from external schemas to keep your code in sync with APIs, databases, and protocols.

Core Features & Use Cases

  • Generate TypeScript types from OpenAPI, GraphQL, or database schemas.
  • Keeps type definitions synchronized with evolving sources to reduce drift and manual maintenance.
  • Useful in projects with frequent schema changes, microservices, and API-driven architectures.

Quick Start

Integrate a codegen step to generate types from your OpenAPI or GraphQL schema and wire them into your build process.

Frequently Asked Questions about codegen-over-complex-types

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

FAQPage Schema
How do I generate TypeScript types from an OpenAPI schema automatically?

To generate TypeScript types from an OpenAPI schema, integrate a codegen tool like openapi-typescript into your build pipeline to produce and commit aligned types. This requires a source schema and a configured codegen step to output synchronized typings automatically.

What is the best way to keep TypeScript types synchronized with evolving GraphQL schemas?

The best way to keep TypeScript types synchronized with evolving GraphQL schemas is using a codegen tool like graphql-codegen in your build pipeline. This automatically generates types from the source schema, preventing drift between runtime data and type definitions.

Why does generating types from schemas help prevent type drift in microservices?

Generating types from schemas prevents type drift in microservices by keeping type definitions synchronized with evolving external sources. This automatic generation reduces manual maintenance and ensures applications stay in sync with APIs, databases, and protocols during frequent schema changes.

Does this codegen approach work with database schemas or only API definitions?

This codegen approach works with database schemas, OpenAPI, and GraphQL definitions. It generates TypeScript types automatically from any external source schema to prevent drift between runtime data and type definitions across services and applications.

Do I need a specific codegen tool to generate types from external schemas?

Yes, you need a codegen tool like openapi-typescript or graphql-codegen integrated into your build pipeline. The Skill requires a source schema and a compatible codegen tool to produce, align, and commit the generated TypeScript types during the build process.