All skills
adopting-generated-api-types
Replace manual API calls and handwritten types with generated API functions and types.
- Part of PostHog/posthog
- 181 installs
- Developer Tools · Frontend
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.
More Frontend skills
See all- bmad-agent-ux-designer17.7kActs as Sally the UX designer and UI specialist for design guidance.
- daisyui13.9kWrites HTML and JSX markup using daisyUI components whenever you build a page or interface.
- nextjs-developer6.2kBuilds Next.js apps with App Router, server components, route handlers, middleware and Vercel deployment.
- react-expert5.9kCreates React components and hooks, fixes rendering issues and handles state, forms and performance.
Also in this pack
- react-doctor511Diagnoses and fixes React codebase health issues, including performance problems, security gaps and code quality.
- hogli267Explains the PostHog developer CLI and repo tooling for running, building, testing, and linting.
- clickhouse-migrations266Writes and modifies ClickHouse database migrations following project rules.
- survey-sdk-audit255Audits survey SDK features and version requirements, then implements survey changes across backend, UI, and SDKs.