Opik Analytics Instrumentation
comet-ml/opik
Shows how to add product analytics events to Opik's frontend, Java backend and Python SDK, all reporting through Segment to PostHog with an opik_ name prefix.
Diagnose PostHog ingestion, identity, feature-flag, SDK, and private-API failures from concrete evidence.
$ npx skills add jeremylongshore/tons-of-skills-marketplace --skill posthog-common-errors -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install jeremylongshore/tons-of-skills-marketplace posthog-common-errors --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/jeremylongshore/tons-of-skills-marketplace.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/.curated/posthog-common-errors .claude/skills/posthog-common-errors && 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 "posthog-common-errors" agent skill from https://github.com/jeremylongshore/tons-of-skills-marketplace/tree/main/skills/.curated/posthog-common-errors into .claude/skills/posthog-common-errors/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "posthog-common-errors", 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/jeremylongshore/tons-of-skills-marketplace/tree/main/skills/.curated/posthog-common-errorsType 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 jeremylongshore/tons-of-skills-marketplace --skill posthog-common-errors -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install jeremylongshore/tons-of-skills-marketplace posthog-common-errors --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/jeremylongshore/tons-of-skills-marketplace.git skills-src && mkdir -p .agents/skills && cp -r skills-src/skills/.curated/posthog-common-errors .agents/skills/posthog-common-errors && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "posthog-common-errors" agent skill from https://github.com/jeremylongshore/tons-of-skills-marketplace/tree/main/skills/.curated/posthog-common-errors into .agents/skills/posthog-common-errors/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "posthog-common-errors", 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 jeremylongshore/tons-of-skills-marketplace --skill posthog-common-errors -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install jeremylongshore/tons-of-skills-marketplace posthog-common-errors --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/jeremylongshore/tons-of-skills-marketplace.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/skills/.curated/posthog-common-errors .cursor/skills/posthog-common-errors && 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 "posthog-common-errors" agent skill from https://github.com/jeremylongshore/tons-of-skills-marketplace/tree/main/skills/.curated/posthog-common-errors into .cursor/skills/posthog-common-errors/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "posthog-common-errors", 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/jeremylongshore/tons-of-skills-marketplace.git --path skills/.curated/posthog-common-errors--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 jeremylongshore/tons-of-skills-marketplace --skill posthog-common-errors -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install jeremylongshore/tons-of-skills-marketplace posthog-common-errors --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/jeremylongshore/tons-of-skills-marketplace.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/skills/.curated/posthog-common-errors .gemini/skills/posthog-common-errors && 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 "posthog-common-errors" agent skill from https://github.com/jeremylongshore/tons-of-skills-marketplace/tree/main/skills/.curated/posthog-common-errors into .gemini/skills/posthog-common-errors/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "posthog-common-errors", 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 jeremylongshore/tons-of-skills-marketplace posthog-common-errorsInstalls 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 jeremylongshore/tons-of-skills-marketplace --skill posthog-common-errors -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/jeremylongshore/tons-of-skills-marketplace.git skills-src && mkdir -p .github/skills && cp -r skills-src/skills/.curated/posthog-common-errors .github/skills/posthog-common-errors && 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 "posthog-common-errors" agent skill from https://github.com/jeremylongshore/tons-of-skills-marketplace/tree/main/skills/.curated/posthog-common-errors into .github/skills/posthog-common-errors/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "posthog-common-errors", 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 jeremylongshore/tons-of-skills-marketplace --skill posthog-common-errors -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install jeremylongshore/tons-of-skills-marketplace posthog-common-errors --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/jeremylongshore/tons-of-skills-marketplace.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/skills/.curated/posthog-common-errors .opencode/skills/posthog-common-errors && 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 "posthog-common-errors" agent skill from https://github.com/jeremylongshore/tons-of-skills-marketplace/tree/main/skills/.curated/posthog-common-errors into .opencode/skills/posthog-common-errors/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "posthog-common-errors", 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.
posthog-common-errorsDiagnose PostHog ingestion, identity, feature-flag, SDK, and private-API failures from concrete evidence.
Posthog Common Errors is an agent skill from jeremylongshore/tons-of-skills-marketplace. Diagnose PostHog ingestion, identity, feature-flag, SDK, and private-API failures from concrete evidence. Use when events are missing, flags return unexpected values, or PostHog requests fail. Trigger with "debug PostHog", "PostHog events missing", or "PostHog 401".
Its SKILL.md is about 2.1k tokens, which your agent loads only when the skill is triggered. The skill folder holds 2 other files, including reference files (for example `references/official-docs.md`). Compatibility notes: Designed for Claude Code
It works with PostHog. The repository describes itself as: Model-agnostic agent-skills platform with a harness-free canonical layer, verified adapters, and the ccpi package manager. Explore at tonsofskills.com. The licence is MIT.
Read from SKILL.md and the folder at commit 23ea8d4. It shows what the files ask for, not the result of running them.
Pre-approves these tools, so the agent can use them without asking each time:
ReadGrepBash(curl:*)From allowed-tools in the SKILL.md frontmatter.
Shell commands in SKILL.md call:
curljqnpmFrom the folder's file list and the shell code blocks in SKILL.md.
Hosts in commands or code, which the agent is likely to contact:
us.i.posthog.comus.posthog.comeu.i.posthog.comus-assets.i.posthog.comAlso links to:
posthog.comstatus.posthog.comFrom URLs in SKILL.md, links to its own repository left out.
Names these keys or tokens, usually read from environment variables:
POSTHOG_PERSONAL_API_KEYPOSTHOG_FEATURE_FLAGS_SECURE_API_KEYPERSONAL_KEYNEXT_PUBLIC_POSTHOG_KEYFrom names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Designed for Claude Code
From compatibility in the SKILL.md frontmatter.
Posthog Common Errors loads about 2.1k tokens when it runs, and up to ~2.3k if it reads all its reference files. Until then it costs about 72 tokens; SKILL.md has 279 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 jeremylongshore/tons-of-skills-marketplace at commit 23ea8d4, republished under its MIT licence (© jeremylongshore). 279 words, ~2,132 tokens.
.claude/skills/posthog-common-errors/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.Diagnosis and solutions for the most common PostHog integration errors. Covers event capture failures, authentication issues, feature flag problems, identity fragmentation, and SDK initialization errors.
posthog-js or posthog-node)phc_...) availableUse Read to inspect the relevant configuration and implementation before proposing changes. Use Grep to locate initialization, capture, flag, and credential boundaries.
Symptoms: posthog.capture() calls execute without error but events never show in PostHog Activity tab.
Diagnoses and fixes:
// Problem A: Not flushing in serverless/scripts
// posthog-node queues events — they're lost if process exits before flush
const posthog = new PostHog('phc_...');
posthog.capture({ distinctId: 'user-1', event: 'test' });
// FIX: Always flush before exit
await posthog.shutdown(); // or await posthog.flush()
// Problem B: Wrong API host
posthog.init('phc_...', {
api_host: 'https://app.posthog.com', // WRONG — this is the UI
});
// FIX: Use the ingest endpoint
posthog.init('phc_...', {
api_host: 'https://us.i.posthog.com', // CORRECT for US Cloud
// api_host: 'https://eu.i.posthog.com', // For EU Cloud
});
// Problem C: Ad blocker blocking posthog-js requests
// FIX: Set up a reverse proxy (see posthog-sdk-patterns)
// next.config.js rewrites: /ingest/* → us.i.posthog.com/*
// Then: posthog.init('phc_...', { api_host: '/ingest' });undefined or Wrong Value// Problem: Checking flag before flags are loaded
const value = posthog.isFeatureEnabled('my-flag'); // undefined — flags not ready
// FIX: Wait for flags to load
posthog.onFeatureFlags(() => {
const value = posthog.isFeatureEnabled('my-flag'); // Now has correct value
});
// Problem (server): no feature flags secure key, so local definitions are unavailable
const ph = new PostHog('phc_...');
const flag = await ph.getFeatureFlag('my-flag', 'user-1'); // Slow, may fail
// FIX: Pass the server-only feature flags secure key through the SDK's option
const ph = new PostHog('phc_...', {
personalApiKey: process.env.POSTHOG_FEATURE_FLAGS_SECURE_API_KEY,
});
// Now evaluates locally — faster and more reliableset -euo pipefail
# Symptom: 401 when calling admin endpoints
curl "https://us.posthog.com/api/projects/$POSTHOG_PROJECT_ID/feature_flags/" \
-H "Authorization: Bearer phc_wrong_key_type"
# Returns: {"detail": "Authentication credentials were not provided."}
# FIX: Use Personal API Key (phx_...) for admin endpoints, not project key (phc_...)
curl "https://us.posthog.com/api/projects/$POSTHOG_PROJECT_ID/feature_flags/" \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" # Must be phx_...
# Check which key type you have:
echo "$POSTHOG_PERSONAL_API_KEY" | head -c 4
# phx_ = Personal API Key (correct for admin API)
# phc_ = Project API Key (only for event capture)// Symptom: HTTP 429 on analytics endpoints
// PostHog rate limits: 240 req/min and 1200 req/hour for analytics endpoints
// Feature flag local eval: 600 req/min
// FIX: Implement backoff with Retry-After header
async function postHogRequest(url: string, options: RequestInit) {
const response = await fetch(url, options);
if (response.status === 429) {
const retryAfter = parseInt(response.headers.get('Retry-After') || '60');
console.warn(`PostHog rate limited. Retrying in ${retryAfter}s`);
await new Promise(r => setTimeout(r, retryAfter * 1000));
return postHogRequest(url, options); // Retry
}
return response;
}
// FIX: Cache insight results instead of polling
let cachedInsights: any = null;
let cacheExpiry = 0;
async function getInsights() {
if (cachedInsights && Date.now() < cacheExpiry) return cachedInsights;
const res = await postHogRequest(
`https://us.posthog.com/api/projects/${PROJECT_ID}/insights/trend/`,
{ headers: { Authorization: `Bearer ${PERSONAL_KEY}` } }
);
cachedInsights = await res.json();
cacheExpiry = Date.now() + 300000; // Cache 5 minutes
return cachedInsights;
}// Problem: Same user appears as multiple persons in PostHog
// Cause: Different distinct_id on frontend vs backend
// Frontend captures with anonymous ID: "anon-abc123"
posthog.capture('page_viewed'); // distinct_id = "anon-abc123"
// Backend captures with user ID: "user-456"
serverPosthog.capture({
distinctId: 'user-456', // Different from frontend!
event: 'api_called',
});
// FIX: Call identify on frontend to merge anonymous → known
posthog.identify('user-456'); // Merges anon-abc123 → user-456
// FIX: Use same distinct_id on server as frontend
serverPosthog.capture({
distinctId: 'user-456', // Same as what frontend uses after identify
event: 'api_called',
});// Problem: posthog.capture is not a function
// Cause: SDK not initialized or called server-side
// FIX: Guard all browser calls
if (typeof window !== 'undefined') {
posthog.init('phc_...', { api_host: 'https://us.i.posthog.com' });
}
// FIX: Check if initialized before capturing
if (typeof posthog.capture === 'function') {
posthog.capture('my_event');
}
// Problem: CSP (Content Security Policy) blocking PostHog
// FIX: Add PostHog domains to your CSP header
// connect-src: https://us.i.posthog.com https://us-assets.i.posthog.comset -euo pipefail
# 1. Check PostHog API reachability
curl -s -o /dev/null -w "HTTP %{http_code}\n" https://us.i.posthog.com/healthz
# 2. Verify the project token without adding an event.
curl -s -X POST "$POSTHOG_PUBLIC_HOST/flags?v=2" \
-H 'Content-Type: application/json' \
-d "{\"api_key\":\"$NEXT_PUBLIC_POSTHOG_KEY\",\"distinct_id\":\"diagnostic-check\"}" | jq '{flags, errorsParsingFlags}'
# 3. Verify personal API key works
curl -s "$POSTHOG_PRIVATE_HOST/api/projects/" \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" | jq '.[0].name'
# 4. Check installed SDK versions
npm list posthog-js posthog-node 2>/dev/null || echo "No PostHog SDK found"
# 5. Check environment variables
env | grep -i posthog | sed 's/=.*/=***/'| Error | HTTP Code | Cause | Solution |
|---|---|---|---|
| Events missing | N/A | Not flushed | await posthog.shutdown() |
| Auth failed | 401 | Wrong key type | Use phx_ for admin, phc_ for capture |
| Rate limited | 429 | Too many API calls | Backoff, cache results |
| Flag undefined | N/A | Flags not loaded | Use onFeatureFlags callback |
| CSP blocked | N/A | Missing CSP entry | Add us.i.posthog.com to connect-src |
| Duplicate users | N/A | Identity mismatch | Call posthog.identify() consistently |
Given “server-side flags return undefined after deploy,” verify the region host, project token, feature-flags secure key, initialization lifetime, and fallback behavior. Return the first failed boundary, the evidence that proves it, and the smallest reversible correction.
See official PostHog references for current authority and verification boundaries.
For comprehensive debugging, see posthog-debug-bundle.
© jeremylongshore, 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 1 other file (references) in skills/.curated/posthog-common-errors of jeremylongshore/tons-of-skills-marketplace.
Open the folder on GitHubat commit 23ea8d4
Posthog Common Errors 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 |
|---|---|---|---|---|---|---|
| Posthog Common Errors this skilljeremylongshore/tons-of-skills-marketplace | 2.8k | — | ~2.1k | Automated safety check: Pass | MIT | |
| Opik Analytics Instrumentationcomet-ml/opik | 22k | — | ~4.4k | Automated safety check: Pass | Apache-2.0 | |
| C15tc15t/c15t | 1.9k | 1 repos | ~1.6k | Automated safety check: Pass | Apache-2.0 | |
| Define Feature Flagmacro-inc/macro | 4.6k | — | ~780 | Automated safety check: Pass | AGPL-3.0 | |
| Soku CLIAbout-Intelligence/soku-cli | 304 | — | ~2.4k | Automated safety check: Pass | MIT | |
| Compare Array Bundle SizePostHog/posthog-js | 613 | — | ~599 | Automated safety check: Pass | Custom licence |
comet-ml/opik
Shows how to add product analytics events to Opik's frontend, Java backend and Python SDK, all reporting through Segment to PostHog with an opik_ name prefix.
c15t/c15t
Work with c15t consent management docs, APIs, and integrations for Next.js, React, and JavaScript.
macro-inc/macro
Define a frontend feature flag with defineFlag and wire its readers.
About-Intelligence/soku-cli
Guides an agent through the soku command line tool for ads, GA4 and PostHog data reads, ads writes, SEO hosting, automations, files and skill management.
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.
PostHog/posthog
Author useful, low-noise log alerts on services in a PostHog project.
jeremylongshore/tons-of-skills-marketplace
Execute this skill enables AI assistant to conduct a security-focused code review using the security-agent plugin.
jeremylongshore/tons-of-skills-marketplace
Execute this skill enables AI assistant to perform natural language processing and text analysis using the nlp-text-analyzer plugin.
jeremylongshore/tons-of-skills-marketplace
Execute this skill allows AI assistant to construct and configure neural network architectures using the neural-network-builder plugin.
jeremylongshore/tons-of-skills-marketplace
Process identify anomalies and outliers in datasets using machine learning algorithms.
jeremylongshore/tons-of-skills-marketplace
Build this skill enables AI assistant to provide interpretability and explainability for machine learning models.
jeremylongshore/tons-of-skills-marketplace
Execute this skill optimizes prompts for large language models (llms) to reduce token usage, lower costs, and improve performance.
Works with
Diagnose PostHog ingestion, identity, feature-flag, SDK, and private-API failures from concrete evidence. Posthog Common Errors is an agent skill from jeremylongshore/tons-of-skills-marketplace. Diagnose PostHog ingestion, identity, feature-flag, SDK, and private-API failures from concrete evidence.
Posthog Common Errors fits situations like: events are missing; flags return unexpected values; postHog requests fail; with debug PostHog.
Run `npx skills add jeremylongshore/tons-of-skills-marketplace --skill posthog-common-errors -a claude-code`. Or copy the skill folder (skills/.curated/posthog-common-errors in jeremylongshore/tons-of-skills-marketplace) into .claude/skills/posthog-common-errors in your project. Claude Code loads it when a task matches its description.
Run `npx skills add jeremylongshore/tons-of-skills-marketplace --skill posthog-common-errors -a codex`. Or copy the skill folder (skills/.curated/posthog-common-errors in jeremylongshore/tons-of-skills-marketplace) into .agents/skills/posthog-common-errors 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 jeremylongshore/tons-of-skills-marketplace --skill posthog-common-errors -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/posthog-common-errors, .gemini/skills/posthog-common-errors, .github/skills/posthog-common-errors and .opencode/skills/posthog-common-errors in your project.
Going by SKILL.md and its folder, Posthog Common Errors needs the command-line tools its instructions call (curl, jq and npm) and credentials named POSTHOG_PERSONAL_API_KEY, POSTHOG_FEATURE_FLAGS_SECURE_API_KEY, PERSONAL_KEY and NEXT_PUBLIC_POSTHOG_KEY. Our summary lists: A credential in POSTHOG_FEATURE_FLAGS_SECURE_API_KEY; A credential in POSTHOG_PERSONAL_API_KEY. Its frontmatter pre-approves these tools: Read, Grep, Bash(curl:*). Compatibility (from SKILL.md): Designed for Claude Code.
SKILL.md names 6 domains. In commands or code: us.i.posthog.com, us.posthog.com, eu.i.posthog.com and us-assets.i.posthog.com; the agent is likely to contact these when it follows the instructions. As links in the text: posthog.com and status.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.
Posthog Common Errors is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.
About 2.1k tokens (SKILL.md is roughly 8.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 209 tokens, read only when the agent opens those files.
Skills that share tags, products or a category with Posthog Common Errors: Opik Analytics Instrumentation (comet-ml/opik, 22k stars), C15t (c15t/c15t, 1.9k stars), Define Feature Flag (macro-inc/macro, 4.6k stars) and Soku CLI (About-Intelligence/soku-cli, 304 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
jeremylongshore (a GitHub user) maintains it in jeremylongshore/tons-of-skills-marketplace, which has 2,821 GitHub stars. The repository holds 3,342 skills in this directory. The repository was last updated on October 8, 2026.
Source: jeremylongshore/tons-of-skills-marketplace on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.