skills/posthog/SKILL.md
Integrate and work with PostHog analytics, feature flags, experiments, session replay, surveys, error tracking, and all other PostHog products. Use when the user asks to add PostHog tracking, capture events, set up feature flags, run A/B tests, configure session replay, create surveys, use the PostHog API, work with PostHog SDKs (JavaScript, Node, React, Python, etc.), debug PostHog integration issues, or implement any PostHog functionality. Also use when questions arise about PostHog configuration, data pipelines, webhooks, or the PostHog data model.
npx skillsauth add miketromba/skills posthogInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Work with PostHog by fetching the latest documentation on-demand. Never rely on memorized PostHog APIs or configuration — always fetch current docs to ensure accuracy.
| Area | URL |
|------|-----|
| Docs home | https://posthog.com/docs |
| SDKs | https://posthog.com/docs/libraries |
| Frameworks | https://posthog.com/docs/frameworks |
| API reference | https://posthog.com/docs/api |
| Product Analytics | https://posthog.com/docs/product-analytics |
| Feature Flags | https://posthog.com/docs/feature-flags |
| Experiments | https://posthog.com/docs/experiments |
| Session Replay | https://posthog.com/docs/session-replay |
| Surveys | https://posthog.com/docs/surveys |
| Error Tracking | https://posthog.com/docs/error-tracking |
| Data Pipelines | https://posthog.com/docs/cdp |
| Data Warehouse | https://posthog.com/docs/data-warehouse |
| Web Analytics | https://posthog.com/docs/web-analytics |
| LLM Analytics | https://posthog.com/docs/llm-analytics |
| AI Engineering | https://posthog.com/docs/ai-engineering |
When a task involves PostHog, spawn a sub-agent (via the Task tool) to research the relevant documentation. This keeps the main context clean while the sub-agent fetches and distills only the information needed.
Adapt this template based on what information is needed:
Research PostHog documentation to answer the following question:
<QUESTION or TASK DESCRIPTION>
Steps:
1. Fetch the relevant PostHog docs page using WebFetch. Start with the most specific entry point URL from this list:
- Docs home: https://posthog.com/docs
- SDKs: https://posthog.com/docs/libraries
- Frameworks: https://posthog.com/docs/frameworks
- API: https://posthog.com/docs/api
- [include whichever entry point is most relevant]
2. Scan the fetched page for links to more specific sub-pages relevant to the question. Fetch those sub-pages as needed. Follow at most 2-3 levels deep.
3. Extract the specific information needed: API signatures, configuration options, code examples, setup instructions, etc.
4. Return a concise summary containing ONLY the information needed to complete the task. Include:
- Exact code snippets or configuration
- Any required package names and install commands
- Key caveats or gotchas mentioned in the docs
- Source URLs for the pages you referenced
Research PostHog documentation for how to integrate PostHog with a Next.js application.
1. Fetch https://posthog.com/docs/frameworks and find the Next.js-specific page.
2. Fetch that Next.js page and extract the full setup instructions.
3. Also fetch https://posthog.com/docs/libraries to identify the correct JS/React SDK package.
4. Return: package names, install commands, provider setup code, and any Next.js-specific configuration (App Router vs Pages Router).
Research PostHog documentation for implementing feature flags.
1. Fetch https://posthog.com/docs/feature-flags to get the overview.
2. Follow links to the SDK-specific implementation guide for [JavaScript/React/Node/etc.].
3. Return: how to check flags client-side and server-side, the API for flag evaluation, and any relevant code examples.
/docs/frameworks) when integrating into a specific framework — PostHog often has framework-specific setup guides.tools
Vercel Sandbox documentation and guidance for running untrusted code in isolated environments. Use when working with Vercel Sandbox - a compute primitive for safely executing AI-generated code, user-submitted scripts, or developer experiments in Firecracker microVMs. Triggers on questions about Vercel Sandbox SDK, sandbox CLI, @vercel/sandbox, Sandbox.create, snapshots, persistent sandboxes, sandbox authentication, sandbox pricing, sandbox system specs, microVMs, code execution isolation, or ANY Vercel Sandbox-related development tasks.
development
Vercel for Platforms documentation and guidance for building multi-tenant and multi-project applications. Use when working with Vercel Platforms - building SaaS apps serving multiple tenants with custom domains, AI coding platforms, or any platform deploying multiple projects. Triggers on questions about multi-tenant architecture, multi-project platforms, wildcard domains, custom domains on Vercel, tenant middleware, Vercel SDK for platforms, platform elements, deploy actions, vibe coding platforms, or ANY Vercel Platforms-related development tasks.
development
TanStack Query (React Query) documentation and guidance. Use when working with TanStack Query - a powerful async state management library for data fetching, caching, synchronization, and server state management. Triggers on questions about React Query, TanStack Query, useQuery, useMutation, query invalidation, caching strategies, optimistic updates, infinite queries, prefetching, or ANY TanStack Query-related development tasks.
tools
Supabase backend-as-a-service platform documentation and guidance. Use when working with Supabase - an open-source Firebase alternative providing Postgres database, authentication, real-time subscriptions, edge functions, storage, and vector embeddings. Triggers on questions about Supabase setup, database, auth, RLS, edge functions, storage, realtime, pgvector, migrations, CLI, self-hosting, or ANY Supabase-related development tasks.