Compare Array Bundle Size
PostHog/posthog-js
Quickly compare the posthog-js array.js bundle size in the current working tree against a git baseline using the repository's esbuild proxy.
A skill your agent uses when migrating frontend code from manual API client calls (api.get, api.create, api.surveys.get, api.dashboards.list, new ApiRequest()) and handwritten TypeScript interfaces…
$ npx skills add PostHog/posthog-foss --skill adopting-generated-api-types -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install PostHog/posthog-foss adopting-generated-api-types --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/PostHog/posthog-foss.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.agents/skills/adopting-generated-api-types .claude/skills/adopting-generated-api-types && rm -rf skills-srcUse ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.
Claude Code skills documentation · loads skills from .claude/skills/
Install the "adopting-generated-api-types" agent skill from https://github.com/PostHog/posthog-foss/tree/master/.agents/skills/adopting-generated-api-types into .claude/skills/adopting-generated-api-types/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "adopting-generated-api-types", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/PostHog/posthog-foss/tree/master/.agents/skills/adopting-generated-api-typesType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add PostHog/posthog-foss --skill adopting-generated-api-types -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install PostHog/posthog-foss adopting-generated-api-types --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/PostHog/posthog-foss.git skills-src && mkdir -p .agents/skills && cp -r skills-src/.agents/skills/adopting-generated-api-types .agents/skills/adopting-generated-api-types && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "adopting-generated-api-types" agent skill from https://github.com/PostHog/posthog-foss/tree/master/.agents/skills/adopting-generated-api-types into .agents/skills/adopting-generated-api-types/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "adopting-generated-api-types", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add PostHog/posthog-foss --skill adopting-generated-api-types -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install PostHog/posthog-foss adopting-generated-api-types --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/PostHog/posthog-foss.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/.agents/skills/adopting-generated-api-types .cursor/skills/adopting-generated-api-types && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "adopting-generated-api-types" agent skill from https://github.com/PostHog/posthog-foss/tree/master/.agents/skills/adopting-generated-api-types into .cursor/skills/adopting-generated-api-types/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "adopting-generated-api-types", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/PostHog/posthog-foss.git --path .agents/skills/adopting-generated-api-types--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add PostHog/posthog-foss --skill adopting-generated-api-types -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install PostHog/posthog-foss adopting-generated-api-types --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/PostHog/posthog-foss.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/.agents/skills/adopting-generated-api-types .gemini/skills/adopting-generated-api-types && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "adopting-generated-api-types" agent skill from https://github.com/PostHog/posthog-foss/tree/master/.agents/skills/adopting-generated-api-types into .gemini/skills/adopting-generated-api-types/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "adopting-generated-api-types", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install PostHog/posthog-foss adopting-generated-api-typesInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add PostHog/posthog-foss --skill adopting-generated-api-types -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/PostHog/posthog-foss.git skills-src && mkdir -p .github/skills && cp -r skills-src/.agents/skills/adopting-generated-api-types .github/skills/adopting-generated-api-types && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "adopting-generated-api-types" agent skill from https://github.com/PostHog/posthog-foss/tree/master/.agents/skills/adopting-generated-api-types into .github/skills/adopting-generated-api-types/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "adopting-generated-api-types", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add PostHog/posthog-foss --skill adopting-generated-api-types -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install PostHog/posthog-foss adopting-generated-api-types --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/PostHog/posthog-foss.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/.agents/skills/adopting-generated-api-types .opencode/skills/adopting-generated-api-types && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "adopting-generated-api-types" agent skill from https://github.com/PostHog/posthog-foss/tree/master/.agents/skills/adopting-generated-api-types into .opencode/skills/adopting-generated-api-types/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "adopting-generated-api-types", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
adopting-generated-api-typesA skill your agent uses when migrating frontend code from manual API client calls (api.get, api.create, api.surveys.get, api.dashboards.list, new ApiRequest()) and handwritten TypeScript interfaces…
Adopting Generated API Types is an agent skill from PostHog/posthog-foss, published by the product's own GitHub organization. Use when migrating frontend code from manual API client calls (api.get, api.create, api.surveys.get, api.dashboards.list, new ApiRequest()) and handwritten TypeScript interfaces to generated API functions and types. Triggers on files importing from lib/api, files with api.get<, api.create<, api.<entity.<method, manual interface definitions that duplicate backend serializers, or any frontend file that constructs API URLs by hand. Covers the full replacement workflow — finding the generated equivalent, swapping…
Its SKILL.md is about 2.4k tokens, which your agent loads only when the skill is triggered. The skill folder holds 3 other files, including reference files (for example `references/migration-patterns.md` and `references/type-compatibility.md`).
It sits in Frontend & Design. It works with TypeScript and PostHog. The repository describes itself as: PostHog FOSS is a read-only mirror of PostHog, with all proprietary code removed. NOTE: This repo is synced automatically from the main PostHog repo. Please raise any issues and… The licence is MIT.
9 steps, taken from the step headings in SKILL.md.
Read from SKILL.md and the folder at commit 2c48221. It shows what the files ask for, not the result of running them.
Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.
From allowed-tools in the SKILL.md frontmatter.
Shell commands in SKILL.md call:
pnpmFrom the folder's file list and the shell code blocks in SKILL.md.
No URLs in SKILL.md. Its commands use pnpm, which can reach the network depending on how they are called.
From URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Adopting Generated API Types loads about 2.4k tokens when it runs, and up to ~5.4k if it reads all its reference files. Until then it costs about 156 tokens; SKILL.md has 725 words of instructions outside code blocks.
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
The automated check found no risky patterns in SKILL.md.
Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.
The full file from PostHog/posthog-foss at commit 2c48221, republished under its MIT licence (© PostHog). 725 words, ~2,382 tokens.
.claude/skills/adopting-generated-api-types/SKILL.md (or your agent's skills folder). This skill also uses 2 other files; get the full folder from GitHub.PostHog generates TypeScript API client functions and types from Django serializers via the OpenAPI pipeline:
Django serializer → drf-spectacular → OpenAPI JSON → Orval → TypeScript (api.ts + api.schemas.ts + api.zod.ts)Generated files live in:
frontend/src/generated/core/api.ts, api.schemas.ts, and api.zod.tsproducts/<product>/frontend/generated/api.ts, api.schemas.ts, and api.zod.tsGenerated types use the Api suffix (DashboardApi, SurveyApi). Handwritten types never do.
This skill guides replacing manual API calls and handwritten types with generated equivalents.
The legacy frontend/src/lib/api.ts (~6000 lines) has three layers, all migration targets:
Domain-specific convenience methods on the api object:
api.surveys.get(id)
api.surveys.create(data)
api.dashboards.list()
api.cohorts.update(id, data)
api.actions.create(data)These are the most widely used pattern — every entity has its own namespace with CRUD plus custom methods (e.g., api.surveys.getResponsesCount(), api.dashboards.streamTiles()).
api.get<SomeType>(`api/projects/${id}/surveys/`)
api.create<SomeType>(`api/projects/${id}/surveys/`, data)
api.update<SomeType>(url, data)
api.put<SomeType>(url, data)
api.delete(url)const url = new ApiRequest().surveys().assembleFullUrl()
const response = await api.get(url)
// or directly:
await new ApiRequest().survey(surveyId).withAction('summarize_responses').create({ data })All three patterns should be replaced with generated functions where available.
api.<entity>.<method>() (e.g., api.surveys.get())api.get<T>(...), api.create<T>(...), etc.new ApiRequest() to build URLs~/types for API response shapesLook at the existing call and extract:
Generated function names follow the {resource}{Action} convention:
surveysList — GET /api/projects/{id}/surveys/
surveysCreate — POST /api/projects/{id}/surveys/
surveysRetrieve — GET /api/projects/{id}/surveys/{id}/
surveysPartialUpdate — PATCH /api/projects/{id}/surveys/{id}/
surveysDestroy — DELETE /api/projects/{id}/surveys/{id}/Where to search:
frontend/src/generated/core/api.tsproducts/<product>/frontend/generated/api.tsSearch strategies:
api.ts filesget*Url helper functions — every generated function has a URL builder above itapi.schemas.ts for the type name with Api suffixIf no generated function exists, the backend endpoint may lack @extend_schema or @validated_request. Fix the backend first using the improving-drf-endpoints skill, then run hogli build:openapi.
Custom actions (like api.surveys.summarize_responses()) may not have generated equivalents if the backend @action lacks @extend_schema. Check generated files first; if missing, fix the backend.
Compare the handwritten type with the generated Api type. Key differences:
readonly modifiers — generated types mark read-only fieldsrequired= preciselynull types are explicitSee type-compatibility.md for details.
See migration-patterns.md for detailed before/after examples covering:
api.surveys.get() → surveysRetrieve())api.get<T>(url) → generated function)Update downstream references from the handwritten type to the generated one:
// Before
function renderSurvey(survey: Survey): JSX.Element { ... }
// After
function renderSurvey(survey: SurveyApi): JSX.Element { ... }After migrating all usages of a handwritten type:
~/types or the local filepnpm --filter=@posthog/frontend typescript:check to verify no breakage| Scenario | Action |
|---|---|
| Generated function exists | Replace manual call with generated function |
| Generated type exists but function doesn't | Use the generated type as the generic parameter on the manual call, file a follow-up to add @extend_schema |
| Neither exists | Keep the manual pattern, fix the backend serializer/viewset first |
| Custom action without generated equivalent | Keep the api.<entity>.<method>() call, fix the backend @action annotation first |
| Generated type has different shape than handwritten | Adapt call sites to the generated shape — the serializer is the source of truth |
| Code mutates the response object | Use a local mutable copy: const mutable = { ...response } and mutate that |
| Need both read and write types | Use FooApi for reads, derive write types via Parameters<typeof fooCreate>[1] or use PatchedFooApi |
// Core generated functions — import from api.ts
import { domainsList, domainsCreate, domainsRetrieve } from '~/generated/core/api'
// Core generated types — import type from api.schemas.ts
import type { OrganizationDomainApi } from '~/generated/core/api.schemas'
// Core generated Zod schemas — import from api.zod.ts
import { DomainsCreateBody } from '~/generated/core/api.zod'
// Product generated functions — NO tilde prefix, use 'products/' path
import { surveysList, surveysRetrieve } from 'products/surveys/frontend/generated/api'
import type { SurveyApi } from 'products/surveys/frontend/generated/api.schemas'
import { SurveysCreateBody } from 'products/surveys/frontend/generated/api.zod'
// Within a product, relative imports also work
import { logsAlertsCreate } from '../generated/api'
import type { LogsAlertConfigurationApi } from '../generated/api.schemas'
import { LogsAlertsCreateBody } from '../generated/api.zod'Path rules:
~/generated/core/... (tilde prefix)products/<product>/frontend/generated/... (no tilde)../generated/... or ./generated/...Use import type for types to enable proper tree-shaking.
Generated functions wrap the same api module via api-orval-mutator.ts:
surveysList(projectId, params)
→ apiMutator(url, { method: 'GET' })
→ api.get(url)Switching to generated functions does not change HTTP behavior — same cookies, same CSRF, same error handling. The only difference is type safety and URL construction.
pnpm --filter=@posthog/frontend typescript:checkhogli test <test_file>improving-drf-endpoints to fix serializers that produce poor typesdocs/published/handbook/engineering/type-system.mdfrontend/src/lib/api-orval-mutator.tshogli build:openapi© PostHog, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
SKILL.md and 2 other files (references) in .agents/skills/adopting-generated-api-types of PostHog/posthog-foss.
Open the folder on GitHubat commit 2c48221
Adopting Generated API Types next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Adopting Generated API Types this skillPostHog/posthog-foss | 721 | — | ~2.4k | Automated safety check: Pass | MIT | |
| Compare Array Bundle SizePostHog/posthog-js | 613 | — | ~599 | Automated safety check: Pass | Custom licence | |
| Integration Astro Staticwill-be-done/will-be-done | 152 | — | ~636 | Automated safety check: Pass | AGPL-3.0 | |
| South Admin CRUD Generatorsouthliu/south-admin-react | 580 | — | ~1.7k | Automated safety check: Pass | MIT | |
| Develop ExtensionPostHog/posthog-js | 613 | — | ~2.3k | Automated safety check: Pass | Custom licence | |
| Vue Componentsscalar/scalar | 16k | — | ~886 | Automated safety check: Pass | MIT |
PostHog/posthog-js
Quickly compare the posthog-js array.js bundle size in the current working tree against a git baseline using the repository's esbuild proxy.
will-be-done/will-be-done
PostHog integration for static Astro sites using SSG. An agent skill from will-be-done/will-be-done.
southliu/south-admin-react
Generates a full CRUD page - page component, data model and API client - from the south-admin-react project's own VS Code snippet templates.
PostHog/posthog-js
Author a new PostHog browser extension, or port a posthog-js v1 extension, against the @posthog/browser-common Client/Extension contract.
scalar/scalar
Build Vue 3 components with TypeScript and Tailwind using clean structure, composable logic, accessibility, and maintainable patterns.
internet-court/internet-court-skill
Scaffolds new NEAR dApps with create-near-app or adds NEAR wallet sign-in, contract calls and transaction signing to an existing React or plain JavaScript app.
PostHog/posthog-foss
Author useful, low-noise log alerts on services in a PostHog project.
PostHog/posthog-foss
Operating procedure for the conflict-autoresolver agent: sweep open PostHog/posthog PRs that conflict with master, resolve the trivial conflicts (generated artifacts deterministically, source…
PostHog/posthog-foss
Help users debug PostHog Error Tracking stack-trace symbolication for any supported platform — JavaScript/TypeScript web, React Native (Hermes), Android (Proguard / R8), or iOS / macOS (dSYM).
PostHog/posthog-foss
Investigates distributed application performance using PostHog APM (OpenTelemetry span) data via MCP.
PostHog/posthog-foss
Debug and inspect LLM/AI agent traces using PostHog's MCP tools.
PostHog/posthog-foss
Diagnose why a product metric changed (dropped, spiked, or plateaued) by orchestrating breakdowns, actors, paths, lifecycle, retention, and annotations queries.
Works with
Categories
A skill your agent uses when migrating frontend code from manual API client calls (api.get, api.create, api.surveys.get, api.dashboards.list, new ApiRequest()) and handwritten TypeScript interfaces…. Adopting Generated API Types is an agent skill from PostHog/posthog-foss, published by the product's own GitHub organization.list, new ApiRequest()) and handwritten TypeScript interfaces to generated API functions and types.
Adopting Generated API Types fits situations like: migrating frontend code from manual API client calls (api.get; api.surveys.get; api.dashboards.list; new ApiRequest()) and handwritten TypeScript interfaces to generated API functions and types.
Run `npx skills add PostHog/posthog-foss --skill adopting-generated-api-types -a claude-code`. Or copy the skill folder (.agents/skills/adopting-generated-api-types in PostHog/posthog-foss) into .claude/skills/adopting-generated-api-types in your project. Claude Code loads it when a task matches its description.
Run `npx skills add PostHog/posthog-foss --skill adopting-generated-api-types -a codex`. Or copy the skill folder (.agents/skills/adopting-generated-api-types in PostHog/posthog-foss) into .agents/skills/adopting-generated-api-types in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add PostHog/posthog-foss --skill adopting-generated-api-types -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/adopting-generated-api-types, .gemini/skills/adopting-generated-api-types, .github/skills/adopting-generated-api-types and .opencode/skills/adopting-generated-api-types in your project.
Going by SKILL.md and its folder, Adopting Generated API Types needs the command-line tools its instructions call (pnpm).
SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.
Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.
Adopting Generated API Types is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.
About 2.4k tokens (SKILL.md is roughly 9.5k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 3k tokens, read only when the agent opens those files.
Skills that share tags, products or a category with Adopting Generated API Types: Compare Array Bundle Size (PostHog/posthog-js, 613 stars), Integration Astro Static (will-be-done/will-be-done, 152 stars), South Admin CRUD Generator (southliu/south-admin-react, 580 stars) and Develop Extension (PostHog/posthog-js, 613 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
PostHog (a GitHub organization, an official publisher) maintains it in PostHog/posthog-foss, which has 721 GitHub stars. The repository holds 213 skills in this directory. The repository was last updated on October 7, 2026.
Source: PostHog/posthog-foss on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.