A collection of PostHog skills for enhancing AI-assisted workflows. Add this repo as a Claude Code plugin marketplace to get access to all PostHog skills: Then install individual plugins: Or browse available plugins: Copy any skill directory to .claude/skills/ in your project: Any directory under skills/ that contains a .claude-plugin/plugin.json is automatically discovered and added to the market
Add this skill
npx mdskills install PostHog/managing-endpoint-versions@PostHog? Sign in with GitHub to claim this listing.Exceptionally clear versioning guide with honest edge-case handling and practical workflows
1---2name: managing-endpoint-versions3description: >4 Work safely with endpoint versions — preview a draft in the playground, roll back to an older5 version, update settings on one version without bumping query history, deactivate a specific6 version. Use when the user asks "how do I roll back my endpoint", "preview my changes before7 publishing", "I want to fix v5 without bumping the version", or anything involving the version8 history. Calls out today's limitations honestly: there is no pointer flip; "rollback" means9 forking the old query into a new top version.10---1112# Managing endpoint versions1314This skill is the practical guide to endpoint versioning. It covers the today-workflow, which15has some sharp edges worth being explicit about.1617## When to use this skill1819- "How do I roll back to v3?"20- "I want to test changes before they go live"21- "How do I update the description / `data_freshness_seconds` on a specific version?"22- "Can I disable v4 without affecting v5?"23- The user is uncertain whether a query change will cut a new version2425## Versioning model — what to know2627| Behaviour | Reality |28| ------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------- |29| Query change | **Auto-cuts a new version.** Saving any edit to the query creates a new version and bumps the current version number |30| Settings change (description, `data_freshness_seconds`, materialisation) | Does **not** cut a new version. Updates the targeted version in place |31| The "current" version | Always the highest version number — it's not a pointer you can move backwards |32| Calling without `?version=N` | Runs the **latest** version. So unpinned callers always hit the newest |33| Disabling the whole endpoint | `endpoint-update` with `is_active: false` (no `version`) takes every version offline at once |34| Disabling a single version | `endpoint-update` with `version` + `is_active: false` retires one version without affecting the others |3536The model is forward-only. There is no "make v3 the default again" operation today. Practically37this means "rollback" requires either creating a new top version that re-uses the old query, or38pinning callers to `?version=N`.3940## Available tools4142| Tool | Purpose |43| ------------------- | ----------------------------------------------------------------------------------------------- |44| `endpoint-versions` | List all versions for an endpoint, latest first |45| `endpoint-get` | Full config; supports `?version=N` to fetch a specific version |46| `endpoint-update` | The workhorse — supports `version` body param to target a specific version |47| `endpoint-run` | Execute a version directly via `?version=N` (without affecting which version other callers hit) |4849## Workflows5051### Previewing a draft before publishing5253There is no "draft" concept in the model. Editing the query commits it as a new version54immediately. To preview safely:55561. Test the new query first with the `execute-sql` tool (or the SQL editor) — not on the live endpoint572. When ready, update the endpoint — this creates the new version automatically583. Use `endpoint-run` with `?version=N` to confirm the new version returns what you expect594. Old callers still hit the latest version (which is now your new version) — there is no60 "soft launch"6162If the user needs a true staging endpoint, the only workaround today is a sibling endpoint63with a `_v2` or `_staging` suffix. Document this honestly — there is no in-product staging path.6465### Rolling back to an older version6667The forward-only model means "rollback" requires forking:68691. `endpoint-versions` to find the version with the good query (say v3)702. `endpoint-get` with `?version=3` to retrieve that version's query JSON713. `endpoint-update` with the v3 query as the new query — this **creates a new version** (e.g.72 v6) with the same query as v3734. All callers without `?version=N` now hit v6 (== v3's query)7475The old version (v5, the broken one) still exists and is still callable via `?version=5` until76explicitly deactivated.7778Faster mitigation if you can change every caller: have them pin to `?version=3` until a real79fix is ready. Lower-impact than cutting a new version.8081### Updating settings on a specific version8283`endpoint-update` accepts a `version` field in the body. When set, settings updates apply to84that version only — they do not cut a new version. Useful when:8586- Bumping `data_freshness_seconds` on an old version that some callers still pin to87- Adjusting description on a historical version for clarity88- Changing materialisation state per version (the materialisation is per-version anyway)8990Important: passing `query` together with `version` is rejected — query changes always cut a new91top version, never modify history. The version arg only affects settings.9293### Deactivating a single version9495To take v3 out of service while keeping v4 and v5 callable:9697```text98endpoint-update {name: "...", version: 3, is_active: false}99```100101This sets `is_active: false` on v3 only. Callers pinned to `?version=3` start getting an error;102other callers are unaffected.103104To re-enable: same call with `is_active: true`.105106The whole-endpoint `is_active` field (without `version`) is a separate switch — it disables107every version at once. Use the version-scoped form for surgical takedowns.108109### Pruning unused versions110111Old versions accumulate over time. To find which are dead, call `endpoint-versions` and read each112version's `last_executed_at`: a version that's null or long stale hasn't been called recently.113Materialised dead versions are the costly ones — disable their materialisation with114`endpoint-update` + `version` + `is_materialized: false`, and deactivate with `is_active: false`115to signal they're retired.116117Confirm with the user before retiring a version: `last_executed_at` counts only personal-API-key118calls and is recorded only for runs since that tracking was added (so a used version can still119read null), and a caller may be pinned to `?version=N`. The full audit flow lives in120`auditing-endpoints`.121122## Example interaction123124```text125User: "I shipped a broken query last night, v5. How do I roll back?"126127Agent:128- endpoint-versions <name> → v5 (latest), v4, v3, v2, v1129- endpoint-get <name> ?version=4 → query JSON for v4130- "Rolling back means creating v6 with v4's query. v5 stays as a131 historical version but nobody hits it unless they explicitly132 pass ?version=5. Sound right?"133- User confirms134- endpoint-update <name> {query: <v4 query>} → creates v6135- endpoint-run <name> ?version=6 to confirm shape136- "Done. v6 is live with v4's query. Want me to also deactivate v5137 so it's clear it's defunct?"138- User: "Yes"139- endpoint-update <name> {version: 5, is_active: false}140```141142## Important notes143144- **There is no pointer flip.** "Rolling back" creates a new version. The version number is145 always going up. If the user is uncomfortable with the resulting history noise, that's a146 fair concern — surface it honestly.147- **A query change always creates a new version.** Updating settings on the side does not.148 If the user wants to fix a typo in v5's description without bumping to v6, use the version149 param.150- **Disabling a single version only blocks that version.** It doesn't change which version runs151 by default — that's always the highest version number.152- **Materialisation is per-version.** Each version has its own materialised view named153 `{endpoint_name}_v{version}`. Disabling materialisation on one version doesn't affect others.154- **Pinning is the safety net — push callers to use it.** Callers that pin to `?version=N` are155 insulated from query edits; unpinned callers always hit the latest and can be surprised by a new156 version. Encourage consumers to pin, validate a new version, then bump the pin deliberately.157- **The CLI manages versions too.** `posthog-cli exp endpoints {pull,push,diff}` lets the user158 keep endpoint definitions as YAML in version control and review changes before pushing — a159 cleaner workflow than editing live when query changes need review.160- **Activating an older version is not yet a product feature.** If the user repeatedly wants this —161 flip a pointer rather than fork — surface it as a feature gap (and nudge the team via162 `agent-feedback`). Don't pretend `endpoint-update` does it.163
Full transparency — inspect the skill content before installing.