Telemetry Analytics
OpenHands/OpenHands
This skill should be used when the user asks to "add tracking", "add a PostHog event", "change telemetry consent", "instrument onboarding", "debug analytics", or changes telemetry.ts…
Separate PostHog development, staging, and production data with explicit project tokens, regional hosts, secret scopes, and promotion checks.
$ npx skills add jeremylongshore/tons-of-skills-marketplace --skill posthog-multi-env-setup -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install jeremylongshore/tons-of-skills-marketplace posthog-multi-env-setup --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-multi-env-setup .claude/skills/posthog-multi-env-setup && 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-multi-env-setup" agent skill from https://github.com/jeremylongshore/tons-of-skills-marketplace/tree/main/skills/.curated/posthog-multi-env-setup into .claude/skills/posthog-multi-env-setup/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "posthog-multi-env-setup", 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-multi-env-setupType 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-multi-env-setup -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install jeremylongshore/tons-of-skills-marketplace posthog-multi-env-setup --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-multi-env-setup .agents/skills/posthog-multi-env-setup && 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-multi-env-setup" agent skill from https://github.com/jeremylongshore/tons-of-skills-marketplace/tree/main/skills/.curated/posthog-multi-env-setup into .agents/skills/posthog-multi-env-setup/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "posthog-multi-env-setup", 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-multi-env-setup -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install jeremylongshore/tons-of-skills-marketplace posthog-multi-env-setup --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-multi-env-setup .cursor/skills/posthog-multi-env-setup && 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-multi-env-setup" agent skill from https://github.com/jeremylongshore/tons-of-skills-marketplace/tree/main/skills/.curated/posthog-multi-env-setup into .cursor/skills/posthog-multi-env-setup/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "posthog-multi-env-setup", 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-multi-env-setup--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-multi-env-setup -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install jeremylongshore/tons-of-skills-marketplace posthog-multi-env-setup --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-multi-env-setup .gemini/skills/posthog-multi-env-setup && 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-multi-env-setup" agent skill from https://github.com/jeremylongshore/tons-of-skills-marketplace/tree/main/skills/.curated/posthog-multi-env-setup into .gemini/skills/posthog-multi-env-setup/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "posthog-multi-env-setup", 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-multi-env-setupInstalls 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-multi-env-setup -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-multi-env-setup .github/skills/posthog-multi-env-setup && 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-multi-env-setup" agent skill from https://github.com/jeremylongshore/tons-of-skills-marketplace/tree/main/skills/.curated/posthog-multi-env-setup into .github/skills/posthog-multi-env-setup/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "posthog-multi-env-setup", 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-multi-env-setup -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-multi-env-setup --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-multi-env-setup .opencode/skills/posthog-multi-env-setup && 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-multi-env-setup" agent skill from https://github.com/jeremylongshore/tons-of-skills-marketplace/tree/main/skills/.curated/posthog-multi-env-setup into .opencode/skills/posthog-multi-env-setup/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "posthog-multi-env-setup", 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-multi-env-setupSeparate PostHog development, staging, and production data with explicit project tokens, regional hosts, secret scopes, and promotion checks.
Posthog Multi Env Setup is an agent skill from jeremylongshore/tons-of-skills-marketplace. Separate PostHog development, staging, and production data with explicit project tokens, regional hosts, secret scopes, and promotion checks. Use when one codebase deploys to multiple environments. Trigger with "PostHog environments", "PostHog staging", or "PostHog dev prod".
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 sits in DevOps & Cloud. 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.
6 steps, taken from the step headings in SKILL.md.
Read from SKILL.md and the folder at commit 80f86df. 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:
ReadWriteEditBash(aws:*)Bash(gcloud:*)Bash(vault:*)From allowed-tools in the SKILL.md frontmatter.
Shell commands in SKILL.md call:
curljqFrom 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.comAlso links to:
posthog.comFrom URLs in SKILL.md, links to its own repository left out.
Names these keys or tokens, usually read from environment variables:
NEXT_PUBLIC_POSTHOG_KEYPOSTHOG_PERSONAL_API_KEYPOSTHOG_FEATURE_FLAGS_SECURE_API_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 Multi Env Setup 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 75 tokens; SKILL.md has 381 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 noted patterns worth knowing about, such as sudo or a known installer.
# .env.local (development — git-ignored)# .env.staging (CI/CD secrets or secret manager)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 80f86df, republished under its MIT licence (© jeremylongshore). 381 words, ~2,099 tokens.
.claude/skills/posthog-multi-env-setup/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.Use separate PostHog projects for each environment (dev, staging, production). This prevents dev/test events from polluting production analytics, allows different feature flag rollout percentages per environment, and lets you disable session recordings in non-production.
| Environment | PostHog Project | Session Recording | Autocapture | Feature Flags |
|---|---|---|---|---|
| Development | myapp-dev | Disabled | Enabled | 100% rollout (test all) |
| Staging | myapp-staging | Disabled | Enabled | 100% rollout (QA all) |
| Production | myapp-prod | 10% sampled | Tuned | Gradual rollout |
Use Read to inspect the relevant configuration and implementation before proposing changes. Use Write only for a new, explicitly requested artifact inside the target project. Use Edit for minimal changes to existing project files after the evidence pass.
In PostHog Cloud (app.posthog.com), create three projects:
myapp-development — copy the phc_... project API keymyapp-staging — copy the phc_... project API keymyapp-production — copy the phc_... project API key# .env.local (development — git-ignored)
NEXT_PUBLIC_POSTHOG_KEY=phc_dev_key_here
NEXT_PUBLIC_POSTHOG_HOST=https://us.i.posthog.com
POSTHOG_PERSONAL_API_KEY=phx_your_key
POSTHOG_PROJECT_ID=11111
# .env.staging (CI/CD secrets or secret manager)
NEXT_PUBLIC_POSTHOG_KEY=phc_staging_key_here
NEXT_PUBLIC_POSTHOG_HOST=https://us.i.posthog.com
POSTHOG_PERSONAL_API_KEY=phx_your_key
POSTHOG_PROJECT_ID=22222
# Production (secret manager — never in files)
# NEXT_PUBLIC_POSTHOG_KEY=phc_prod_key_here
# POSTHOG_PROJECT_ID=33333// config/posthog.ts
type Env = 'development' | 'staging' | 'production';
interface PostHogEnvConfig {
apiKey: string;
host: string;
sessionRecording: boolean;
recordingSampleRate: number;
autocapture: boolean | object;
debug: boolean;
}
function getConfig(): PostHogEnvConfig {
const env = (process.env.NODE_ENV || 'development') as Env;
const key = process.env.NEXT_PUBLIC_POSTHOG_KEY;
const host = process.env.NEXT_PUBLIC_POSTHOG_HOST || 'https://us.i.posthog.com';
if (!key) {
console.warn(`[PostHog] No API key for ${env} — analytics disabled`);
}
const configs: Record<Env, Omit<PostHogEnvConfig, 'apiKey' | 'host'>> = {
development: {
sessionRecording: false,
recordingSampleRate: 0,
autocapture: true,
debug: true,
},
staging: {
sessionRecording: false,
recordingSampleRate: 0,
autocapture: true,
debug: false,
},
production: {
sessionRecording: true,
recordingSampleRate: 0.1, // Record 10% of sessions
autocapture: {
dom_event_allowlist: ['click', 'submit'],
element_allowlist: ['a', 'button', 'form'],
css_selector_allowlist: ['.track-click'],
},
debug: false,
},
};
return { apiKey: key || '', host, ...configs[env] };
}
export const posthogConfig = getConfig();// app/providers.tsx
'use client';
import posthog from 'posthog-js';
import { PostHogProvider } from 'posthog-js/react';
import { useEffect } from 'react';
import { posthogConfig } from '../config/posthog';
export function PHProvider({ children }: { children: React.ReactNode }) {
useEffect(() => {
if (!posthogConfig.apiKey) return; // Skip if no key configured
posthog.init(posthogConfig.apiKey, {
api_host: posthogConfig.host,
autocapture: posthogConfig.autocapture,
capture_pageview: false, // Manual in App Router
capture_pageleave: true,
disable_session_recording: !posthogConfig.sessionRecording,
session_recording: posthogConfig.sessionRecording
? { sampleRate: posthogConfig.recordingSampleRate }
: undefined,
loaded: (ph) => {
if (posthogConfig.debug) ph.debug();
},
});
}, []);
return <PostHogProvider client={posthog}>{children}</PostHogProvider>;
}// lib/posthog-server.ts
import { PostHog } from 'posthog-node';
import { posthogConfig } from '../config/posthog';
let client: PostHog | null = null;
export function getPostHogServer(): PostHog {
if (client) return client;
if (!posthogConfig.apiKey) {
// Return no-op client when unconfigured
return { capture: () => {}, identify: () => {}, shutdown: async () => {} } as any;
}
client = new PostHog(posthogConfig.apiKey, {
host: posthogConfig.host,
personalApiKey: process.env.POSTHOG_FEATURE_FLAGS_SECURE_API_KEY,
flushAt: 20,
flushInterval: 10000,
});
return client;
}// In your staging PostHog project: set all flags to 100% rollout for QA
// In your production PostHog project: gradual rollout (10% → 25% → 50% → 100%)
// Server-side flag check works the same regardless of environment
const ph = getPostHogServer();
const enabled = await ph.isFeatureEnabled('new-checkout', userId);
// Staging project: always true (100% rollout)
// Production project: depends on rollout percentageset -euo pipefail
# Set all flags to 100% in staging project (for QA)
curl "https://us.posthog.com/api/projects/$POSTHOG_STAGING_PROJECT_ID/feature_flags/" \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" | \
jq -r '.results[].id' | while read FLAG_ID; do
curl -X PATCH "https://us.posthog.com/api/projects/$POSTHOG_STAGING_PROJECT_ID/feature_flags/$FLAG_ID/" \
-H "Authorization: Bearer $POSTHOG_PERSONAL_API_KEY" \
-H "Content-Type: application/json" \
-d '{"filters": {"groups": [{"rollout_percentage": 100}]}}'
done| Issue | Cause | Solution |
|---|---|---|
| Dev events in prod | Same API key across envs | Use separate projects per env |
| No events in staging | apiKey not set | Check CI/CD secret is configured |
| Session recordings in dev | Wrong config | Verify sessionRecording: false in dev config |
| Flags different across envs | Separate projects | Expected behavior — set rollout per project |
| 401 from server API | Wrong personal key | Personal key works across projects in same org |
For dev, staging, and production, map each deployment to an explicit project token and host, keep server-only keys in the matching secret store, prefix synthetic identities, and test that no environment can write to another project. Promote flag definitions deliberately; do not assume projects synchronize automatically.
See official PostHog references for current authority and verification boundaries.
For webhook setup, see posthog-webhooks-events.
© 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-multi-env-setup of jeremylongshore/tons-of-skills-marketplace.
Open the folder on GitHubat commit 80f86df
Posthog Multi Env Setup 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 Multi Env Setup this skilljeremylongshore/tons-of-skills-marketplace | 2.8k | — | ~2.1k | Automated safety check: Notes | MIT | |
| Telemetry AnalyticsOpenHands/OpenHands | 90k | — | ~305 | Automated safety check: Pass | MIT | |
| Temps Best Practicesgotempsh/temps | 828 | — | ~2.9k | Automated safety check: Pass | Apache-2.0 | |
| Exploring Apm TracesPostHog/posthog | 40k | — | ~3.5k | Automated safety check: Pass | Custom licence | |
| Exploring LLM TracesPostHog/posthog | 40k | — | ~4.4k | Automated safety check: Pass | Custom licence | |
| Configuring Experiment RolloutPostHog/posthog | 40k | — | ~3.8k | Automated safety check: Pass | Custom licence |
OpenHands/OpenHands
This skill should be used when the user asks to "add tracking", "add a PostHog event", "change telemetry consent", "instrument onboarding", "debug analytics", or changes telemetry.ts…
gotempsh/temps
Best-practices reference for preparing and instrumenting applications on Temps.
PostHog/posthog
Investigates distributed application performance using PostHog APM (OpenTelemetry span) data via MCP.
PostHog/posthog
Debug and inspect LLM/AI agent traces using PostHog's MCP tools.
PostHog/posthog
Configures the rollout shape of a PostHog experiment — the variant split (50/50, 80/20, A/B/C ratios), the overall rollout percentage that gates how many users enter the experiment, and the…
PostHog/posthog
Best practices for agents managing PostHog skills via the MCP skill- tools — how to discover, read, create, update, and refactor skills efficiently, especially large skills with many bundled files.
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
Build this skill automates the adaptation of pre-trained machine learning models using transfer learning techniques.
jeremylongshore/tons-of-skills-marketplace
Execute proactive auto-loading: automatically detects and loads agents.md files.
jeremylongshore/tons-of-skills-marketplace
Aggregate and centralize performance metrics from applications, systems, databases, caches, and services.
jeremylongshore/tons-of-skills-marketplace
Execute this skill enables AI assistant to analyze capacity requirements and plan for future growth.
jeremylongshore/tons-of-skills-marketplace
Process use when you need to work with database indexing. An agent skill from jeremylongshore/tons-of-skills-marketplace.
Works with
Categories
Separate PostHog development, staging, and production data with explicit project tokens, regional hosts, secret scopes, and promotion checks. Posthog Multi Env Setup is an agent skill from jeremylongshore/tons-of-skills-marketplace. Separate PostHog development, staging, and production data with explicit project tokens, regional hosts, secret scopes, and promotion checks.
Posthog Multi Env Setup fits situations like: one codebase deploys to multiple environments; with PostHog environments; postHog staging; postHog dev prod.
Run `npx skills add jeremylongshore/tons-of-skills-marketplace --skill posthog-multi-env-setup -a claude-code`. Or copy the skill folder (skills/.curated/posthog-multi-env-setup in jeremylongshore/tons-of-skills-marketplace) into .claude/skills/posthog-multi-env-setup in your project. Claude Code loads it when a task matches its description.
Run `npx skills add jeremylongshore/tons-of-skills-marketplace --skill posthog-multi-env-setup -a codex`. Or copy the skill folder (skills/.curated/posthog-multi-env-setup in jeremylongshore/tons-of-skills-marketplace) into .agents/skills/posthog-multi-env-setup 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-multi-env-setup -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-multi-env-setup, .gemini/skills/posthog-multi-env-setup, .github/skills/posthog-multi-env-setup and .opencode/skills/posthog-multi-env-setup in your project.
Going by SKILL.md and its folder, Posthog Multi Env Setup needs the command-line tools its instructions call (curl and jq) and credentials named NEXT_PUBLIC_POSTHOG_KEY, POSTHOG_PERSONAL_API_KEY and POSTHOG_FEATURE_FLAGS_SECURE_API_KEY. Our summary lists: Node.js; A credential in NEXT_PUBLIC_POSTHOG_KEY; A credential in POSTHOG_PERSONAL_API_KEY. Its frontmatter pre-approves these tools: Read, Write, Edit, Bash(aws:*), Bash(gcloud:*), Bash(vault:*). Compatibility (from SKILL.md): Designed for Claude Code.
SKILL.md names 3 domains. In commands or code: us.i.posthog.com and us.posthog.com; the agent is likely to contact these when it follows the instructions. As links in the text: posthog.com. This is read from the text; nothing was executed.
Our automated static check of SKILL.md found notes only (mentions a .env file), nothing it rates as a warning. It is not a guarantee. Review the folder before installing.
Posthog Multi Env Setup 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.4k 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 198 tokens, read only when the agent opens those files.
Skills that share tags, products or a category with Posthog Multi Env Setup: Telemetry Analytics (OpenHands/OpenHands, 90k stars), Temps Best Practices (gotempsh/temps, 828 stars), Exploring Apm Traces (PostHog/posthog, 40k stars) and Exploring LLM Traces (PostHog/posthog, 40k 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,825 GitHub stars. The repository holds 3,342 skills in this directory. The repository was last updated on October 9, 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.