<< All versions
Skill v1.0.1
currentAutomated scan100/100posthog/posthog-for-claude/posthog-instrumentation
1 files
──Details
PublishedNovember 5, 2026 at 04:41 PM
Content Hashsha256:d32a621b3b099a09...
Git SHAb82e2fe78038
Bump Typepatch
──Files
Files (1 file, 1.7 KB)
SKILL.md1.7 KBactive
SKILL.md · 73 lines · 1.7 KB
name: posthog-instrumentation description: Automatically add PostHog analytics instrumentation to code. Triggers when user asks to add tracking, instrument events, add analytics, or implement feature flags in their codebase. metadata: version: "1.0.1"
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
javascript
// Event trackingposthog.capture('button_clicked', { button_name: 'signup' })// Feature flagsif (posthog.isFeatureEnabled('new-feature')) {// Show new feature}// User identificationposthog.identify(userId, { email: user.email })
Python
python
from posthog import Posthogposthog = Posthog(api_key='<ph_project_api_key>')# Event trackingposthog.capture(distinct_id='user_123', event='purchase_completed')# Feature flagsif posthog.feature_enabled('new-feature', 'user_123'):# Show new feature
React
jsx
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