generate-sdk

Regenerate TypeScript API clients from a live OpenAPI specification.

9|2|Updated Nov 29, 2024
One-click install
npx skills add https://github.com/bbvch-ai/aihub-core --skill generate-sdk-bbvch-ai
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: generate-sdk
Source: https://github.com/bbvch-ai/aihub-core/tree/main/.claude/skills/generate-sdk
Command: npx skills add https://github.com/bbvch-ai/aihub-core --skill generate-sdk-bbvch-ai

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Manually keeping the frontend TypeScript API client in sync with backend API changes is time-consuming and error-prone, often leading to type mismatches and broken functionality when endpoints or DTOs are updated.

Core Features & Use Cases

  • Automated API Server Validation: Checks that the local API server is running before generation to avoid failed runs.
  • Full SDK Regeneration: Fetches the live OpenAPI spec and regenerates all TypeScript client files including types, SDK methods, schemas, and transformers.
  • Auto-Linting and Validation: Automatically lints generated code for formatting issues and checks for TypeScript compilation errors.
  • Use Case: When a backend developer adds a new user management endpoint or updates a request DTO, this skill automatically updates the frontend client so frontend developers have access to the new types and methods without manual work.

Quick Start

Use the generate-sdk skill to update the frontend TypeScript API client after making changes to backend API endpoints or DTOs.

Frequently Asked Questions about generate-sdk

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

FAQPage Schema
How do I generate a TypeScript API client from an OpenAPI spec?

To generate a TypeScript API client from an OpenAPI spec, you need a running local API server, openapi-ts configuration, and pnpm tooling to fetch the live spec and regenerate client files automatically.

What is the best way to sync frontend TypeScript types with FastAPI backend changes?

The best way to sync frontend TypeScript types with FastAPI backend changes is to automatically regenerate the SDK from the live OpenAPI specification, eliminating manual synchronization work between backend and frontend development teams.

Do I need a running local API server to regenerate the frontend SDK?

Yes, you need a running local API server to regenerate the frontend SDK because the process validates the server is active before fetching the live OpenAPI spec to avoid failed generation runs.

Can I automatically lint and validate generated TypeScript client files?

Yes, you can automatically lint and validate generated TypeScript client files because the regeneration process applies auto-linting for formatting issues and checks for TypeScript compilation errors after generating the SDK.

When should I regenerate the frontend TypeScript API client?

You should regenerate the frontend TypeScript API client when a backend developer adds new endpoints, modifies Pydantic DTOs, or updates route parameters in the FastAPI backend to prevent type mismatches and broken functionality.