Skip to main content
skill CX Codex GP ChatGPT official · OpenAI

posthog — Codex skill: what it does, how to install

Queries product analytics, runs HogQL, and manages feature flags or experiments directly in PostHog from Codex.

Install into Codex · Skills CLI (Vercel) All methods and platforms ↓
npx skills add openai/plugins --skill posthog -a codex
Open on GitHub

What posthog does

This skill routes PostHog queries from Codex and ChatGPT to your analytics project. It covers event trends and HogQL queries. Instead of relying on static training data, the agent searches documentation tools for exact syntax.

Workflows enforce read operations before any writes. Destructive steps require explicit confirmation first. The agent will not toggle production flags blindly. Without an active PostHog OAuth connection and a selected project, the underlying tools will not respond.

What it helps with

  • run HogQL queries over events and user properties
  • toggle or audit feature flags across environments
  • inspect conversion funnels and experiment readouts
  • investigate application errors and exception issues

Example prompts for the agent

  • Run a HogQL query showing weekly active users for the current quarter in PostHog.
  • Check the rollout conditions for the feature flag beta-dashboard.
  • Show the error issues spike from yesterday and link them to recent sessions.

How to install posthog

1Skills CLI (Vercel)

npx skills add openai/plugins --skill posthog -a codex

2Manually: put the files in place

.agents/skills/posthog/SKILL.md

For all projects use ~/.agents/skills/

Step by step, with commands for each platform: Codex skills: how to install, where they live, how to call them

Questions about posthog

How do I install posthog in Codex?

Run npx skills add openai/plugins --skill posthog -a codex. The skill file is stored at .agents/skills/posthog/SKILL.md.

What does the posthog skill do?

It guides the agent through querying PostHog analytics, executing HogQL, monitoring errors, and creating feature flags or experiments.

What are the prerequisites before using it?

You must connect the PostHog app via OAuth and confirm your target organization and project ID. Self-hosted setups connect directly to their own instance during authorization.

Source text

SKILL.md · MIT
---
name: posthog
description: Analyze product data and manage product tooling in PostHog. Use when the user wants product analytics or insights, HogQL/SQL queries, feature flags, experiments and A/B tests, error tracking, session replay, surveys, LLM analytics, dashboards, data warehouse, or PostHog documentation.
---

# PostHog

## Overview

This skill provides a structured workflow for working with PostHog from ChatGPT and Codex. It assumes the bundled PostHog app is connected so the PostHog tools are available for analytics, feature flags, experiments, error tracking, and more.

PostHog is an all-in-one product platform. The same project's data backs every surface below, so most questions can be answered by querying analytics or running HogQL, and most product changes (flags, experiments, surveys) can be made directly.

**Prefer live tools over pre-trained knowledge.** Your baked-in knowledge of PostHog's API, HogQL functions, and tool shapes may be outdated. The connected PostHog app advertises its own skills and tools at runtime and asks clients to *prioritize its skills over raw tools* — discover and follow those rather than guessing. When in doubt about syntax, limits, or product behavior, use the documentation-search tool.

## Prerequisites
- The PostHog app must be connected and accessible via OAuth.
- Confirm which PostHog organization and project the request targets before reading or writing.
- Self-hosted users connect against their own instance during the app's OAuth flow.

## Required Workflow

**Follow these steps in order. Do not skip steps.**

### Step 0: Connect the PostHog app (if not already configured)

If PostHog tools are unavailable, pause and ask the user to connect the PostHog app:

1. Enable the bundled PostHog app for this plugin or session.
2. Complete the PostHog OAuth flow if prompted, and select the correct organization/project.
3. Restart Codex or the current session if the tools still do not appear.

After the app is connected, finish your answer and tell the user to retry so they can continue with Step 1.

### Step 1
Clarify the user's goal and scope (e.g., a metric over a time range, a funnel, a new feature flag, an experiment readout, an error investigation). Confirm the target project, date range, event/property names, and any filters or cohorts.

### Step 2
Discover the available PostHog skills/tools the connected app exposes and pick the right one for the task. Resolve identifiers (project ID, flag key, experiment ID, insight/dashboard ID, error issue ID) before calling tools. For anything involving syntax, function names, or product behavior, search the docs first.

### Step 3
Execute PostHog tool calls in logical batches:
- **Read first** — list/get/query (insights, events, HogQL/SQL, error issues) to build context.
- **Write next** — create or update flags, experiments, surveys, dashboards, or insights with all required fields.
- For destructive or broad changes (e.g., toggling a flag in production, ending an experiment), state the impact and confirm before applying.

### Step 4
Summarize results with concrete numbers and links to the PostHog UI where available, call out caveats (sampling, person-on-events timing, date ranges), and propose next actions.

## Capability Map

Use this to route a request to the right PostHog surface, then discover the exact tool the app exposes for it.

| If the user wants to… | PostHog surface |
| --- | --- |
| Answer a metric/trend/funnel/retention/path question | Insights & queries (trends, funnels, retention, paths, lifecycle, stickiness) |
| Run arbitrary SQL over events/persons | HogQL / SQL execution |
| Create, toggle, or audit a feature flag | Feature flags |
| Launch or read out an A/B test | Experiments |
| Investigate a bug or exception | Error tracking (issues + events) |
| Watch how users actually behave | Session replay |
| Gather qualitative feedback (NPS, surveys) | Surveys |
| Track LLM cost/latency/usage | LLM analytics |
| Build or update a dashboard | Dashboards & insights |
| Connect or query external data | Data warehouse |
| Look up how something works in PostHog | Documentation search |

## HogQL & Querying Tips
- HogQL is PostHog's SQL dialect over the events/persons schema. Read the data schema before writing queries, and confirm event and property names exist.
- With person-on-events enabled, `person.properties.*` on the events table reflect the value at ingestion time, not the person's current value — the same person can show different values across events. Don't build workarounds for "query-time" person properties.
- Respect the project timezone when bucketing by day.
- Start narrow (small date range, limited rows), validate, then widen.

## Tips for Maximum Productivity
- Batch related reads before writes; confirm identifiers up front.
- Use natural-language asks where the app supports them ("signups by week this quarter").
- Reference prior insights/dashboards instead of rebuilding from scratch.
- For experiments and flags, double-check rollout conditions and targeting before enabling.

## Troubleshooting
- **Tools missing**: re-run the app connection/OAuth flow (Step 0); verify org/project access.
- **Empty or surprising results**: re-check event/property names, date range, filters, and timezone; confirm the events exist via a small query.
- **Permission errors**: confirm the connected account has access to the target project and the action (some changes require elevated roles).
- **Unsure about syntax or limits**: search the PostHog docs rather than guessing.

© PostHog Inc. · MIT · openai/plugins

Similar skills

All skills for Data and databases →

From the same set596

The whole set →
dcf-model-builder This skill builds public-company DCF workbooks in XLSX, with a formula-based model as its standard route. Use it to create or refresh a valuation and explore scenarios. CX Codex GP ChatGPT ★ 7,604repo stars comps-valuation A Claude and Claude skill that builds comparable-company valuations: picks peers, runs the multiples, and returns a report or an editable workbook. CX Codex GP ChatGPT ★ 7,604repo stars company-tearsheet Extracts verified corporate metrics from public filings and earnings calls into an issuer baseline. Useful before building DCF models or valuation memos. CX Codex GP ChatGPT ★ 7,604repo stars catalyst-calendar Builds and refreshes public-equity catalyst calendars with timing, confidence, thesis links, preparation tasks, and PM decisions. Available for Codex and ChatGPT. CX Codex GP ChatGPT ★ 7,604repo stars physical-ai-infrastructure-setup-and-resilient-scaling This skill guides setup and checks for NVIDIA Physical AI infrastructure used in synthetic data generation on MicroK8s or Azure AKS. It covers OSMO deployment and infrastructure recovery too. CX Codex GP ChatGPT ★ 7,604repo stars omniverse-usd-performance-tuning An orchestrator for slow loading, memory pressure and low FPS in USD scenes. It walks the agent through profiling phases up to a final report. CX Codex GP ChatGPT ★ 7,604repo stars omniverse-realtime-viewer Orchestrates OpenUSD real-time viewer apps using NVIDIA Omniverse. Selects implementation recipes and enforces core rendering rules. CX Codex GP ChatGPT ★ 7,604repo stars omniverse-cad-to-simready Coordinates the path from a CAD model or other source asset to SimReady USD and packaging. Use it to handle conversion, material and physics assignment, validation, and conformance checks. CX Codex GP ChatGPT ★ 7,604repo stars

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor