generate-api

Regenerates the frontend TypeScript API client from the FastAPI OpenAPI schema using orval.

1|Updated Jun 8, 2026
One-click install
npx skills add https://github.com/jpalczewski/kajet-turbo --skill generate-api-jpalczewski
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: generate-api
Source: https://github.com/jpalczewski/kajet-turbo/tree/main/.claude/skills/generate-api
Command: npx skills add https://github.com/jpalczewski/kajet-turbo --skill generate-api-jpalczewski

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? After changing backend FastAPI endpoints or request/response models, the frontend TypeScript client becomes stale and must be regenerated manually, risking type mismatches and broken call sites. ## Core Features & Use Cases - OpenAPI Export: Runs scripts/export_openapi.py to dump the backend's openapi.json schema. - Client Generation: Runs orval to regenerate frontend/src/lib/api/index.ts from the schema. - Verification Workflow: Checks the git diff of generated code and runs bun run check to catch type breakage in frontend consumers. - Use Case: After adding a new REST endpoint to the FastAPI backend, regenerate the typed client and immediately find every frontend call site that needs updating. ## Quick Start Regenerate the frontend API client after my backend endpoint changes and verify the frontend still type-checks.

Frequently Asked Questions about generate-api

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

FAQPage Schema
How do I regenerate a TypeScript API client from a FastAPI backend?▼

Export the OpenAPI schema from FastAPI, then run orval against it to generate the typed client. In this project, `bash scripts/generate-api.sh` performs both steps and writes the result to `frontend/src/lib/api/index.ts`.

How to keep frontend types in sync with backend API changes?▼

Regenerate the client from the OpenAPI schema after every endpoint or model change, then run the frontend type checker. The `bun run check` step surfaces any call sites broken by the regenerated types.

Can I edit the generated orval API client file by hand?▼

No, `frontend/src/lib/api/index.ts` is generated and excluded from eslint/prettier, so manual edits are overwritten on the next run. Hand-maintained customizations belong in the separate `frontend/src/lib/api/fetcher.ts` wrapper.

Why does the frontend break after changing a FastAPI endpoint?▼

Changing request or response models alters the OpenAPI schema, so the previously generated TypeScript types no longer match. Regenerating the client and running the type checker reveals every affected call site.

When should I not regenerate the API client?▼

Skip regeneration when changes touch only backend internals that do not alter endpoints or request/response models, since the OpenAPI schema and generated client remain unchanged.