NEW Browse AI tools across categories — updated daily. See what's new →

Posthog Instrumentation

Automatically instrument PostHog analytics, event tracking, and feature flags across multiple frameworks. Supports JavaScript/TypeScript, React, Python, and Node.js with framework-specific setup pa...

Authorposthog
Version1.0.0
LicenseMIT
Token count~963
UpdatedJun 5, 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 conventions, property...

Install

Quick install

via npx skills · works with 57+ agents
npx skills add https://github.com/posthog/posthog-for-claude/tree/HEAD/skills/posthog-instrumentation
Or pick agent:
npx skills add posthog/posthog-for-claude --skill posthog-instrumentation --agent claude-code
npx skills add posthog/posthog-for-claude --skill posthog-instrumentation --agent cursor
npx skills add posthog/posthog-for-claude --skill posthog-instrumentation --agent codex
npx skills add posthog/posthog-for-claude --skill posthog-instrumentation --agent opencode
npx skills add posthog/posthog-for-claude --skill posthog-instrumentation --agent github-copilot
npx skills add posthog/posthog-for-claude --skill posthog-instrumentation --agent windsurf
More install options

Shorthand — useful for multi-skill repos:

npx skills add posthog/posthog-for-claude --skill posthog-instrumentation

Manual — clone the repo and drop the folder into your agent's skills directory:

git clone https://github.com/posthog/posthog-for-claude.git
cp -r posthog-for-claude/skills/posthog-instrumentation ~/.claude/skills/
How to use: Once installed, ask your agent to "use the posthog-instrumentation skill" or describe what you want (e.g. "Automatically instrument PostHog analytics, event tracking, and feature flags ac"). Requires Node.js 18+.

posthog-instrumentation

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 conventions, property...

posthog-instrumentationby posthog

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 conventions, property...

npx skills add https://github.com/posthog/posthog-for-claude --skill posthog-instrumentationDownload ZIPGitHub

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

More skills from posthog

error-tracking-goby posthogPostHog error tracking for Gointegration-laravelby posthogPostHog integration for Laravel applicationsintegration-nextjs-app-routerby posthogPostHog integration for Next.js App Router applicationslogs-otherby posthogPostHog logs for Other Languageslogs-pythonby posthogPostHog logs for Pythonanalyzing-experiment-session-replaysby posthogAnalyze session replay patterns across experiment variants to understand user behavior differences. Use when the user wants to see how users interact with…auditing-experiments-flagsby posthogAudit PostHog experiments and feature flags for configuration issues, staleness, and best-practice violations. Read when the user asks to audit, health-check,…auditing-warehouse-data-healthby posthogThis skill produces a project-wide audit of the data warehouse pipeline. Use it when the user wants a summary of everything broken , not a deep-dive on one sync. The deep-dive on individual failures is diagnosing-failed-warehouse-syncs ; this skill is the scan that tells them where to look first.

---

Source: https://github.com/posthog/posthog-for-claude/tree/HEAD/skills/posthog-instrumentation
Author: posthog
Discovered via: mcpservers.org

SKILL.md source

---
name: posthog-instrumentation
description: Automatically instrument PostHog analytics, event tracking, and feature flags across multiple frameworks. Supports JavaScript/TypeScript, React, Python, and Node.js with framework-specific setup pa...
---

# posthog-instrumentation

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 conventions, property...

# posthog-instrumentationby posthog
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 conventions, property...

`npx skills add https://github.com/posthog/posthog-for-claude --skill posthog-instrumentation`Download ZIPGitHub

## 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

## More skills from posthog
error-tracking-goby posthogPostHog error tracking for Gointegration-laravelby posthogPostHog integration for Laravel applicationsintegration-nextjs-app-routerby posthogPostHog integration for Next.js App Router applicationslogs-otherby posthogPostHog logs for Other Languageslogs-pythonby posthogPostHog logs for Pythonanalyzing-experiment-session-replaysby posthogAnalyze session replay patterns across experiment variants to understand user behavior differences. Use when the user wants to see how users interact with…auditing-experiments-flagsby posthogAudit PostHog experiments and feature flags for configuration issues, staleness, and best-practice violations. Read when the user asks to audit, health-check,…auditing-warehouse-data-healthby posthogThis skill produces a project-wide audit of the data warehouse pipeline. Use it when the user wants a summary of everything broken , not a deep-dive on one sync. The deep-dive on individual failures is diagnosing-failed-warehouse-syncs ; this skill is the scan that tells them where to look first.

---

**Source**: https://github.com/posthog/posthog-for-claude/tree/HEAD/skills/posthog-instrumentation
**Author**: posthog
**Discovered via**: mcpservers.org

Related skills 6

caveman

★ Featured

Ultra-compressed communication mode. Cuts token usage ~75% by speaking like caveman while keeping full technical accuracy. Supports intensity levels: lite, full (default), ultra, wenyan-lite, wenyan-full, wenyan-ultra. Use when user says "caveman mode", "talk like caveman", "use caveman", "less tokens", "be brief", or invokes /caveman. Also auto-triggers when token efficiency is requested.

juliusbrussee 167k
Development

secure-linux-web-hosting

★ Featured

Use when setting up, hardening, or reviewing a cloud server for self-hosting, including DNS, SSH, firewalls, Nginx, static-site hosting, reverse-proxying an app, HTTPS with Let's Encrypt or ACME clients, safe HTTP-to-HTTPS redirects, or optional post-launch network tuning such as BBR.

xixu-me 155k
Development

readme-i18n

★ Featured

Use when the user wants to translate a repository README, make a repo multilingual, localize docs, add a language switcher, internationalize the README, or update localized README variants in a GitHub-style repository.

xixu-me 155k
Development

lark-shared

★ Featured

Use when first setting up lark-cli, running auth login, switching user/bot identity (--as), handling permission denied or scope errors, needing to update lark-cli, or seeing _notice in JSON output.

larksuite 155k
Development

improve-codebase-architecture

★ Featured

Find deepening opportunities in a codebase, informed by the domain language in CONTEXT.md and the decisions in docs/adr/. Use when the user wants to improve architecture, find refactoring opportunities, consolidate tightly-coupled modules, or make a codebase more testable and AI-navigable.

mattpocock 151k
Development

paper-context-resolver

★ Featured

Optional RigorPilot helper for README-first deep learning repo reproduction. Use only when the README and repository files leave a narrow reproduction-critical gap and the task is to resolve a specific paper detail such as dataset split, preprocessing, evaluation protocol, checkpoint mapping, or runtime assumption from primary paper sources while recording conflicts. Do not use for general paper summary, repo scanning, environment setup, command execution, title-only paper lookup, or replacin...

lllllllama 127k
Development