API Design
WrongStack/WrongStack
A skill your agent uses when designing, implementing, or reviewing an HTTP API — endpoints, request and response shapes, errors, pagination, versioning, and authorization.
Wire a PostHog endpoint into a client app or SDK. An agent skill from PostHog/posthog-foss.
$ npx skills add PostHog/posthog-foss --skill consuming-endpoints-from-client-code -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install PostHog/posthog-foss consuming-endpoints-from-client-code --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/products/endpoints/skills/consuming-endpoints-from-client-code .claude/skills/consuming-endpoints-from-client-code && 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 "consuming-endpoints-from-client-code" agent skill from https://github.com/PostHog/posthog-foss/tree/master/products/endpoints/skills/consuming-endpoints-from-client-code into .claude/skills/consuming-endpoints-from-client-code/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "consuming-endpoints-from-client-code", 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/products/endpoints/skills/consuming-endpoints-from-client-codeType 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 consuming-endpoints-from-client-code -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install PostHog/posthog-foss consuming-endpoints-from-client-code --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/products/endpoints/skills/consuming-endpoints-from-client-code .agents/skills/consuming-endpoints-from-client-code && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "consuming-endpoints-from-client-code" agent skill from https://github.com/PostHog/posthog-foss/tree/master/products/endpoints/skills/consuming-endpoints-from-client-code into .agents/skills/consuming-endpoints-from-client-code/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "consuming-endpoints-from-client-code", 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 consuming-endpoints-from-client-code -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install PostHog/posthog-foss consuming-endpoints-from-client-code --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/products/endpoints/skills/consuming-endpoints-from-client-code .cursor/skills/consuming-endpoints-from-client-code && 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 "consuming-endpoints-from-client-code" agent skill from https://github.com/PostHog/posthog-foss/tree/master/products/endpoints/skills/consuming-endpoints-from-client-code into .cursor/skills/consuming-endpoints-from-client-code/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "consuming-endpoints-from-client-code", 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 products/endpoints/skills/consuming-endpoints-from-client-code--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 consuming-endpoints-from-client-code -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install PostHog/posthog-foss consuming-endpoints-from-client-code --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/products/endpoints/skills/consuming-endpoints-from-client-code .gemini/skills/consuming-endpoints-from-client-code && 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 "consuming-endpoints-from-client-code" agent skill from https://github.com/PostHog/posthog-foss/tree/master/products/endpoints/skills/consuming-endpoints-from-client-code into .gemini/skills/consuming-endpoints-from-client-code/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "consuming-endpoints-from-client-code", 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 consuming-endpoints-from-client-codeInstalls 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 consuming-endpoints-from-client-code -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/products/endpoints/skills/consuming-endpoints-from-client-code .github/skills/consuming-endpoints-from-client-code && 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 "consuming-endpoints-from-client-code" agent skill from https://github.com/PostHog/posthog-foss/tree/master/products/endpoints/skills/consuming-endpoints-from-client-code into .github/skills/consuming-endpoints-from-client-code/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "consuming-endpoints-from-client-code", 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 consuming-endpoints-from-client-code -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 consuming-endpoints-from-client-code --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/products/endpoints/skills/consuming-endpoints-from-client-code .opencode/skills/consuming-endpoints-from-client-code && 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 "consuming-endpoints-from-client-code" agent skill from https://github.com/PostHog/posthog-foss/tree/master/products/endpoints/skills/consuming-endpoints-from-client-code into .opencode/skills/consuming-endpoints-from-client-code/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "consuming-endpoints-from-client-code", 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.
consuming-endpoints-from-client-codeWire a PostHog endpoint into a client app or SDK. An agent skill from PostHog/posthog-foss.
Consuming Endpoints From Client Code is an agent skill from PostHog/posthog-foss, published by the product's own GitHub organization. Wire a PostHog endpoint into a client app or SDK. Covers fetching the OpenAPI spec, generating a typed client with openapi-generator or @hey-api/openapi-ts, sending the right auth header, shaping the variables payload (HogQL codename vs insight breakdown property), handling rate-limit and materialised-endpoint error responses. Use when the user says "how do I call my endpoint", "generate a client for this", or "what auth header do I use".
Its SKILL.md is about 3.3k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.
It sits in Backend & APIs, covering OpenAPI specifications and Rate limiting. It works with PostHog and OpenAPI. 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.
7 steps, taken from the first numbered list 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.
No scripts in the folder and no shell commands in SKILL.md (its code samples are json and http).
From the folder's file list and the shell code blocks in SKILL.md.
Links to these hosts (documentation or services it may open):
posthog.comFrom URLs in SKILL.md, links to its own repository left out.
Names these keys or tokens, usually read from environment variables:
POSTHOG_CLI_API_KEYPH_API_KEYFrom names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Consuming Endpoints From Client Code loads about 3.3k tokens when it runs. Until then it costs about 120 tokens; SKILL.md has 1,253 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). 1,253 words, ~3,299 tokens.
.claude/skills/consuming-endpoints-from-client-code/SKILL.md (or your agent's skills folder).This skill is the caller-side counterpart to creating-an-endpoint. It helps integrate an
existing endpoint into a separate codebase — a mobile app, server backend, customer dashboard,
or downstream pipeline. No PostHog code is modified here.
user_id" → materialised-endpoint variable
questionsIf the user is creating the endpoint, use creating-an-endpoint first.
| Tool | Purpose |
|---|---|
endpoint-get | Full config for a named endpoint, including the query shape and required variables |
endpoint-openapi-spec | OpenAPI 3.0 spec for one endpoint, ready to feed to a code generator |
endpoint-run | A live call against the endpoint — useful to confirm a payload works before sharing it with the user's app |
/api/projects/{team_id}/endpoints/{name}/runteam_id is the project ID (numeric). Available in PostHog under project settings, or via
projects-get if the user doesn't know it.name is the endpoint name — see endpoints-get-all if the user isn't sure./run is required.POST is the canonical method. GET also works for simple cases without a request body but
POST is preferred — variables go in the body.
Endpoints are authenticated with a personal API key. The header is:
Authorization: Bearer <key>Keys are scoped — for endpoints, the key needs at least endpoint:read. If the user gets a 403,
they're usually missing the scope; if they get a 401, the key is missing or malformed.
Never put a personal API key in client-side code that's shipped to end users (mobile apps, browser JS). Personal API keys grant scoped account access. For customer-facing apps, route through the user's own backend, which holds the key.
{
"variables": { "code_name_1": value, "code_name_2": value },
"limit": 100,
"offset": 0,
"refresh": "cache"
}| Field | Notes |
|---|---|
variables | Keyed by code_name for HogQL endpoints; for insight endpoints with breakdowns, key is the breakdown property name |
limit | Max rows returned. |
offset | Skip rows. Only HogQL endpoints |
refresh | "cache" (return cached results if fresh enough), "force" (always recalculate), "direct" (bypass materialisation, materialised endpoints only). Default is "cache" |
Call endpoint-get to see the exact variable shape. The response includes the query definition
with declared variables — each variable's code_name is what the client should send.
If endpoint-get shows is_materialized: true on the current version, the endpoint requires
every declared variable to be passed on each call. This is a security boundary — without
filters, a single call would return the entire pre-aggregated dataset.
Common symptom: the user's app worked when the endpoint was unmaterialised, then started returning 400 errors after materialisation was enabled. The error message lists which variables are missing.
Optional/partial variables on materialised endpoints are a known limitation the PostHog team plans
to lift. If requiring every variable is blocking the user's use case, send a note via the
agent-feedback tool — that demand signal is how the team prioritises it.
The endpoint exposes its own OpenAPI 3.0 spec via endpoint-openapi-spec. Feed that into a code
generator:
| Language | Tool | Command shape |
|---|---|---|
| TypeScript | @hey-api/openapi-ts | openapi-ts -i spec.json -o ./generated |
| TypeScript | openapi-generator-cli | openapi-generator-cli generate -i spec.json -g typescript-fetch -o ./generated |
| Python | openapi-generator-cli | openapi-generator-cli generate -i spec.json -g python -o ./generated |
| Go | oapi-codegen | oapi-codegen -package=client spec.json > client.go |
The generated client gives the user types for the variables payload and the response shape. Re- generate when the endpoint's query changes (each new version may have different variables).
If the user has multiple endpoints, generate a spec per endpoint and either combine them, or generate one client per endpoint and use them side-by-side.
A typical successful response:
{
"results": [[...], [...]],
"columns": ["col_a", "col_b"],
"types": ["Int64", "String"],
"hasMore": false,
"name": "endpoint_name",
"endpoint_version": 4,
"endpoint_version_created_at": "2026-01-15T..."
}results is an array of rows; each row is an array of cell values in the order of columns.endpoint_version tells the client which version actually ran — useful for logging and for
pinning to a known version with ?version=N.For insight endpoints, the response shape depends on the query kind (TrendsQuery,
LifecycleQuery, RetentionQuery) — the OpenAPI spec captures the right shape for the current
version. Insight kinds that can't be materialised (e.g. FunnelsQuery) still return their inline
result shape.
For local testing, scripts, or CI, the repo's posthog-cli calls endpoints without hand-rolling
HTTP:
posthog-cli exp endpoints run — execute an endpoint (from a local YAML definition)posthog-cli exp endpoints {list,get,pull,push,diff} — inspect endpoints, or manage them as YAML
files in version control (GitOps-style)Auth uses the same personal API key, via posthog-cli login or the POSTHOG_CLI_API_KEY /
POSTHOG_CLI_PROJECT_ID / POSTHOG_CLI_HOST env vars. (These live under exp — experimental, may
change.)
| Status | When | Handling |
|---|---|---|
| 400 | Missing required variable on a materialised endpoint, or invalid variable type | Surface the error message; fix the call |
| 401 | Missing / wrong personal API key | Check the Authorization header |
| 403 | Key lacks endpoint:read scope, or endpoint is in another project | Adjust key scopes |
| 404 | Endpoint name typo, or endpoint not active | Confirm name; check is_active |
| 429 | Rate limited — limits are per team, not per endpoint (see note below) | Exponential backoff; cache responses client-side if possible |
| 5xx | Query execution failure (ClickHouse error, timeout, etc.) | Retry with backoff. If persistent, hand off to diagnosing-endpoint-performance |
execute-sql on
system.data_modeling_endpoints (or endpoints-get-all).endpoint-get to see the full shape: variables, materialisation status, query kind.endpoint-openapi-spec, hand them the spec, and
recommend a generator for their language.endpoint-run from this skill to confirm the payload works.?version=N.User: "I want to call monthly_active_users from my Node.js backend.
Can you help me wire it up with types?"
Agent steps:
- endpoint-get monthly_active_users → HogQL, variables: lookback_days
(int, default 30), org_id (string, no default), is_materialized: true
- "Two things to know upfront:
1. This endpoint is materialised, so both lookback_days and org_id
must be passed on every call. Calls without them will be rejected.
2. You'll need a personal API key with endpoint:read scope. Set it
as PH_API_KEY in your server env — never ship it in client code."
- endpoint-openapi-spec monthly_active_users → returns spec
- "Here's the spec. Drop it in your repo and run:
pnpm dlx @hey-api/openapi-ts -i spec.json -o ./generated/posthog
That gives you typed client functions.
A minimum call looks like:
POST /api/projects/12345/endpoints/monthly_active_users/run
Authorization: Bearer <PH_API_KEY>
Content-Type: application/json
{ 'variables': { 'org_id': 'acme', 'lookback_days': 30 } }
The response includes columns and rows — your client will pick that
up from the generated types.
Want me to do a sample call to verify the payload works?"?version=N. Without it the
latest active version runs, so a future query edit (which cuts a new version) can silently change
a caller's results. Bump the pinned version deliberately once you've validated the new one.data_freshness_seconds, but the client can layer another cache on top for hot paths. Be
mindful of total staleness (endpoint cache + client cache).agent-feedback tool — it's the main signal the team uses to improve endpoints and these
tools.© PostHog, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
Just SKILL.md in products/endpoints/skills/consuming-endpoints-from-client-code of PostHog/posthog-foss.
Open the folder on GitHubat commit 2c48221
Consuming Endpoints From Client Code 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 |
|---|---|---|---|---|---|---|
| Consuming Endpoints From Client Code this skillPostHog/posthog-foss | 721 | — | ~3.3k | Automated safety check: Pass | MIT | |
| API DesignWrongStack/WrongStack | 368 | — | ~1.3k | Automated safety check: Pass | MIT | |
| Implementing API Patternsancoleman/ai-design-components | 526 | 1 repos | ~3k | Automated safety check: Pass | MIT | |
| API Security ReviewOWASP/secure-agent-playbook | 186 | — | ~744 | Automated safety check: Pass | CC-BY-4.0 | |
| Minimal APIcodewithmukesh/dotnet-claude-kit | 751 | 1 repos | ~2.6k | Automated safety check: Pass | MIT | |
| Azure Aigatewaymicrosoft/GitHub-Copilot-for-Azure | 255 | 2 repos | ~1.3k | Automated safety check: Pass | MIT |
WrongStack/WrongStack
A skill your agent uses when designing, implementing, or reviewing an HTTP API — endpoints, request and response shapes, errors, pagination, versioning, and authorization.
ancoleman/ai-design-components
API design and implementation across REST, GraphQL, gRPC, and tRPC patterns.
OWASP/secure-agent-playbook
Comprehensive API security review against OWASP API Security Top 10 (2023).
codewithmukesh/dotnet-claude-kit
.NET 10 minimal APIs — the default for building HTTP endpoints.
microsoft/GitHub-Copilot-for-Azure
Configure Azure API Management as an AI Gateway for AI models, MCP tools, and agents.
curiositech/some_claude_skills
Expert API designer for REST, GraphQL, gRPC architectures. An agent skill from curiositech/some_claude_skills.
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.
Categories
Wire a PostHog endpoint into a client app or SDK. An agent skill from PostHog/posthog-foss. Consuming Endpoints From Client Code is an agent skill from PostHog/posthog-foss, published by the product's own GitHub organization. Wire a PostHog endpoint into a client app or SDK.
Consuming Endpoints From Client Code fits situations like: the user says how do I call my endpoint; generate a client for this; what auth header do I use.
Run `npx skills add PostHog/posthog-foss --skill consuming-endpoints-from-client-code -a claude-code`. Or copy the skill folder (products/endpoints/skills/consuming-endpoints-from-client-code in PostHog/posthog-foss) into .claude/skills/consuming-endpoints-from-client-code in your project. Claude Code loads it when a task matches its description.
Run `npx skills add PostHog/posthog-foss --skill consuming-endpoints-from-client-code -a codex`. Or copy the skill folder (products/endpoints/skills/consuming-endpoints-from-client-code in PostHog/posthog-foss) into .agents/skills/consuming-endpoints-from-client-code 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 consuming-endpoints-from-client-code -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/consuming-endpoints-from-client-code, .gemini/skills/consuming-endpoints-from-client-code, .github/skills/consuming-endpoints-from-client-code and .opencode/skills/consuming-endpoints-from-client-code in your project.
Going by SKILL.md and its folder, Consuming Endpoints From Client Code needs credentials named POSTHOG_CLI_API_KEY and PH_API_KEY. Our summary lists: Python 3; Node.js; A credential in POSTHOG_CLI_API_KEY; A credential in PH_API_KEY.
SKILL.md names 1 domain. As links in the text: posthog.com. 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.
Consuming Endpoints From Client Code is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.
About 3.3k tokens (SKILL.md is roughly 13k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.
Skills that share tags, products or a category with Consuming Endpoints From Client Code: API Design (WrongStack/WrongStack, 368 stars), Implementing API Patterns (ancoleman/ai-design-components, 526 stars), API Security Review (OWASP/secure-agent-playbook, 186 stars) and Minimal API (codewithmukesh/dotnet-claude-kit, 751 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.