posthog-instrumentation▌
posthog/posthog-for-claude · updated Apr 8, 2026
Automatically instrument PostHog analytics, event tracking, and feature flags across multiple frameworks.
- ›Supports JavaScript/TypeScript, React, Python, and Node.js with framework-specific setup patterns
- ›Covers three core capabilities: event capture with custom properties, feature flag evaluation for gradual rollouts, and user identification
- ›Detects existing PostHog configuration and adds instrumentation without duplicating setup
- ›Includes best practices for event naming convention
PostHog Instrumentation Skill
Help users add PostHog analytics, event tracking, and feature flags to their code.
When to Use
- User asks to "add PostHog" or "add analytics"
- User wants to track events or user actions
- User needs to implement feature flags
- User asks about instrumenting their code
Workflow
- Identify the framework (React, Next.js, Python, Node.js, etc.)
- Check for existing PostHog setup
- Add appropriate instrumentation
Code Patterns
JavaScript/TypeScript
// Event tracking
posthog.capture('button_clicked', { button_name: 'signup' })
// Feature flags
if (posthog.isFeatureEnabled('new-feature')) {
// Show new feature
}
// User identification
posthog.identify(userId, { email: user.email })
Python
from posthog import Posthog
posthog = Posthog(api_key='<ph_project_api_key>')
# Event tracking
posthog.capture(distinct_id='user_123', event='purchase_completed')
# Feature flags
if posthog.feature_enabled('new-feature', 'user_123'):
# Show new feature
React
import { usePostHog } from 'posthog-js/react'
function MyComponent() {
const posthog = usePostHog()
const handleClick = () => {
posthog.capture('button_clicked')
}
}
Best Practices
- Use consistent event naming (snake_case recommended)
- Include relevant properties with events
- Identify users early in their session
- Use feature flags for gradual rollouts
Discussion
Product Hunt–style comments (not star reviews)- No comments yet — start the thread.
Ratings
4.6★★★★★34 reviews- ★★★★★Pratham Ware· Dec 28, 2024
posthog-instrumentation fits our agent workflows well — practical, well scoped, and easy to wire into existing repos.
- ★★★★★Sophia Mensah· Dec 20, 2024
Useful defaults in posthog-instrumentation — fewer surprises than typical one-off scripts, and it plays nicely with `npx skills` flows.
- ★★★★★Yash Thakker· Nov 19, 2024
Registry listing for posthog-instrumentation matched our evaluation — installs cleanly and behaves as described in the markdown.
- ★★★★★Kaira Thompson· Nov 11, 2024
posthog-instrumentation is among the better-maintained entries we tried; worth keeping pinned for repeat workflows.
- ★★★★★Dhruvi Jain· Oct 10, 2024
posthog-instrumentation reduced setup friction for our internal harness; good balance of opinion and flexibility.
- ★★★★★Kiara Desai· Oct 2, 2024
Keeps context tight: posthog-instrumentation is the kind of skill you can hand to a new teammate without a long onboarding doc.
- ★★★★★Piyush G· Sep 21, 2024
posthog-instrumentation has been reliable in day-to-day use. Documentation quality is above average for community skills.
- ★★★★★Lucas Farah· Sep 21, 2024
We added posthog-instrumentation from the explainx registry; install was straightforward and the SKILL.md answered most questions upfront.
- ★★★★★Aanya Shah· Sep 13, 2024
Solid pick for teams standardizing on skills: posthog-instrumentation is focused, and the summary matches what you get after install.
- ★★★★★Kwame Torres· Sep 5, 2024
Useful defaults in posthog-instrumentation — fewer surprises than typical one-off scripts, and it plays nicely with `npx skills` flows.
showing 1-10 of 34