Find your next open-source project

Search by name, purpose, or keyword — or paste a GitHub repository URL
All skills

adopting-generated-api-types

Replace manual API calls and handwritten types with generated API functions and types.

When to use it

You're editing a frontend file that calls api.surveys.get() or api.get<T>(url) and want to switch it to generated functions.

For example

You say

Use the adopting-generated-api-types skill to migrate frontend/src/scenes/surveys/surveysLogic.ts from api.surveys.get() and the handwritten Survey type to generated functions and SurveyApi.

You get
  • Updated surveysLogic.ts
  • Generated imports swapped in
  • Dead Survey type removed

How it works

  • If no generated function exists, the backend endpoint needs @extend_schema first, then types are rebuilt with hogli build:openapi.
  • Generated types mark read-only fields and exact optionality, so call sites may need small adjustments.
  • Finish with pnpm --filter=@posthog/frontend typescript:check to confirm nothing broke.