posthog-instrumentation

Automate PostHog instrumentation for React, Next.js, Python, and Node.js projects.

1|Updated Mar 12, 2026
One-click install
npx skills add https://github.com/mahou-labs/shiru --skill posthog-instrumentation-mahou-labs
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: posthog-instrumentation
Source: https://github.com/mahou-labs/shiru/tree/main/.agents/skills/posthog-instrumentation
Command: npx skills add https://github.com/mahou-labs/shiru --skill posthog-instrumentation-mahou-labs

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Help developers add PostHog analytics instrumentation to codebases, enabling event tracking, user identification, and feature-flag checks with minimal boilerplate.

Core Features & Use Cases

  • Auto-detect existing PostHog setup and attach trackers across frontend and backend.
  • Provide ready-to-use patterns for event tracking, user identification, and feature flags.
  • Apply across React, Node.js, and Python projects to support gradual rollouts and insights.

Quick Start

Integrate PostHog instrumentation into your codebase by adding event tracking, user identification, and feature-flag checks across your React, Node.js, and Python components.

Frequently Asked Questions about posthog-instrumentation

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

FAQPage Schema
How do I add PostHog event tracking to a React frontend?

PostHog event tracking in React requires a project API key and applying provided instrumentation snippets to your components. The setup checks for existing configurations and outputs integration steps for tracking events and identifying users.

Does PostHog instrumentation work with Python and Node.js backends?

Yes, PostHog instrumentation supports Python and Node.js backends. It auto-detects existing setups and attaches trackers across both UI and backend layers to enable event tracking and feature flag checks.

How do I implement feature flags in Next.js using PostHog?

Implementing feature flags in Next.js using PostHog involves applying generated instrumentation snippets to your codebase. This enables feature flag checks, user identification, and gradual rollouts across your application layers.

Do I need an existing PostHog API key to set up event tracking?

Yes, an existing PostHog project API key is required to set up event tracking. The instrumentation process requires this key to output correct integration steps and tracking snippets for your codebase.

What is the best way to auto-detect an existing PostHog setup in my codebase?

Automated instrumentation tools auto-detect existing PostHog setups by checking your codebase before attaching trackers. This identifies current configurations and prevents duplicate tracking implementations across your project.

Can I track user identification across both frontend and backend layers with PostHog?

Yes, PostHog tracks user identification across both frontend and backend layers. Instrumentation provides patterns that apply event tracking and user identification across React, Node.js, and Python projects.