generate-api
Regenerate the frontend TypeScript API client after backend API changes (FastAPI endpoints, request/response models). Exports the OpenAPI schema and runs orval.
SKILL.md.claude/skills/generate-api/SKILL.md
GitHubAfter any change to backend REST endpoints or their request/response models:
- Run
bash scripts/generate-api.shfrom the repo root (exportsopenapi.jsonviascripts/export_openapi.py, then runs orval →frontend/src/lib/api/index.ts). - Check
git diff frontend/src/lib/api/— confirm the generated changes match the backend change you made. - Run
cd frontend && bun run checkto catch type breakage in frontend code that consumes the regenerated client. - Fix any frontend call sites broken by the API change.
Note: frontend/src/lib/api/index.ts is generated — never edit it by hand (it is also excluded from eslint/prettier). The custom fetch wrapper lives in frontend/src/lib/api/fetcher.ts and is hand-maintained.