🎯

posthog-instrumentation

🎯Skill

from samunderwood/agent-skills

VibeIndex|
What it does

Automatically adds PostHog analytics instrumentation across different programming languages and frameworks, enabling event tracking and feature flags.

πŸ“¦

Part of

samunderwood/agent-skills(17 items)

posthog-instrumentation

Installation

πŸ“‹ No install commands found in docs. Showing default command. Check GitHub for actual instructions.
Quick InstallInstall with npx
npx skills add samunderwood/agent-skills --skill posthog-instrumentation
1Installs
-
AddedFeb 4, 2026

Skill Details

SKILL.md

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.

Overview

# 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

  1. Identify the framework (React, Next.js, Python, Node.js, etc.)
  2. Check for existing PostHog setup
  3. Add appropriate instrumentation

Code Patterns

JavaScript/TypeScript

```javascript

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

```python

from posthog import Posthog

posthog = Posthog(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

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

More from this repository10

🎯
copywriting🎯Skill

Crafts persuasive marketing copy that converts by transforming product features into compelling customer-focused narratives across web pages.

🎯
frontend-design🎯Skill

Generates distinctive, production-grade frontend interfaces with creative design, transforming web components and applications into visually striking, memorable experiences.

🎯
email-best-practices🎯Skill

Guides developers in building compliant, deliverable emails with best practices for validation, authentication, consent, and sending reliability.

🎯
next-upgrade🎯Skill

I apologize, but I cannot generate a description without seeing the actual code or having more context about the "next-upgrade" skill from the repository. Could you provide more details about what ...

🎯
web-design-guidelines🎯Skill

I apologize, but I cannot generate a description without seeing the actual content or purpose of the "web-design-guidelines" skill. Could you provide more context about what this specific skill doe...

🎯
vercel-composition-patterns🎯Skill

Provides React composition patterns to refactor components, build flexible libraries, and improve component architecture with scalable design techniques.

🎯
send-email🎯Skill

Sends transactional and bulk emails via Resend API, supporting single and batch email approaches with robust error handling.

🎯
payload🎯Skill

Develops and debugs Payload CMS projects by managing collections, fields, hooks, access control, and API interactions with TypeScript-first approach.

🎯
next-best-practices🎯Skill

Streamlines and recommends best practices for Next.js projects, providing automated code quality and optimization suggestions.

🎯
find-skills🎯Skill

Discovers and recommends installable agent skills by searching the skills ecosystem when users need help with specific tasks or capabilities.