posthog-product-instrumentation

Reviews PostHog SDK setup, event capture, and feature flags to produce an instrumentation plan.

Updated Mar 27, 2026
One-click install
npx skills add https://github.com/gmackie/agent-skills --skill posthog-product-instrumentation-gmackie
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: posthog-product-instrumentation
Source: https://github.com/gmackie/agent-skills/tree/main/skills/posthog-product-instrumentation
Command: npx skills add https://github.com/gmackie/agent-skills --skill posthog-product-instrumentation-gmackie

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires bash, jq, and includes scripts (resource) and references (resource) components.

What problem does it solve? Product teams often end up with ad hoc analytics sprawl: inconsistently named events, ambiguous user identity, and feature flags scattered through the app without rollout intent. This Skill audits an existing PostHog setup and turns it into a disciplined, actionable instrumentation plan. ## Core Features & Use Cases - Surface Inventory: Scans a repository for PostHog packages, provider and init files, capture/identify/group calls, feature-flag usage, and env vars via a helper script. - Boundary Review: Evaluates where PostHog is initialized, whether identification is intentional, and whether flags are evaluated in the right layer. - Instrumentation Plan Output: Produces a structured markdown plan covering the current surface, event and identity gaps, feature-flag risks, and next steps. - Use Case: Before launching a new onboarding flow, run this Skill against your web app repo to confirm events are named consistently, identify calls are coherent, and the rollout flag is evaluated in the correct layer. ## Quick Start Ask the agent to review the PostHog instrumentation in this repository and produce an instrumentation plan with event, identity, and feature-flag gaps.

Frequently Asked Questions about posthog-product-instrumentation

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I audit PostHog event tracking in my web app?▼

Run the inspect-posthog-surface.sh helper against your repo to list PostHog packages, provider files, and capture/identify/group/feature-flag usage. Then review naming consistency and identity handling, and write an instrumentation plan with gaps and next steps.

How to review PostHog feature flag usage in a codebase?▼

Search for useFeatureFlag and feature flag evaluation calls, then check whether flags map to real rollout risk and are evaluated in the right layer. Flags sprinkled through the app without intent or evaluated in the wrong layer cause flicker and drift.

Does this work with both posthog-js and posthog-node?▼

Yes, the inspection script checks package.json for either posthog-js or posthog-node dependencies. It reports whether a PostHog package is present and scans the repo for usage patterns regardless of which SDK is installed.

What tools are required to run the PostHog inspection script?▼

The helper script requires bash, jq, and ripgrep (rg) to be available. It reads package.json for dependency detection and searches the repository for PostHog-related usage patterns, excluding node_modules and .git.

When should I not add more PostHog events?▼

Avoid adding events without a naming strategy or clear product semantics. Capturing lots of data without tying it to product decisions creates noise; each event should answer a specific product question.