investigate-metric
What it does
This skill explains why a PostHog chart changed, using breakdowns, funnels, retention and other related queries. It is for analysts and product managers who need the cause of a change.
When to use it
- ✓When a metric has dropped or spiked and you want to know why.
- ✓When someone asks you to explain or walk through a chart that you cannot read.
- ✓When a funnel, retention or lifecycle metric changed and you need the root cause.
Skill link
https://github.com/PostHog/posthog/blob/master/products/product_analytics/skills/investigate-metric/SKILL.mdCopy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.
How to use
The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.
Ready-to-paste message
For Claude Code, Codex or Cursor: run it in your project folder and the skill gets installed.
Download the SKILL.md and drop it into your agent’s skills folder.
Example of what to ask your AI
“Signups dropped sharply last Tuesday. Find out why.”
5 new skills a week. 1 minute to read.
How it works
It runs several related queries, such as breakdowns by property and the users behind a change, then checks annotations for events that may explain it. It combines the results into a likely cause.
Technical content (original SKILL.md)
Original text by the author, straight from GitHub.
Investigating a metric change
For "why did X change?" questions about a saved insight, dashboard tile, or pasted query, and for "explain this chart" or "walk me through this" when the user names no change. Don't load this skill for plain "what is X?" questions — only when there's a chart or an observed change to explain.
Tools
Targets PostHog MCP v2. Typed query tools accept the query body directly — pass
kind, series, dateRange as top-level fields, do not wrap in InsightVizNode.
| Tool | Purpose |
|---|---|
posthog:query-trends |
Trends (count over time) |
posthog:query-funnel |
Funnels (multi-step conversion) |
posthog:query-retention |
Retention (cohort return rates) |
posthog:query-stickiness |
Stickiness (active days per user) |
posthog:query-lifecycle |
Lifecycle (new/returning/resurrecting/dormant) |
posthog:query-paths |
Paths (navigation flow) |
posthog:query-trends-actors |
Users behind a trend bucket (trends source only) |
posthog:execute-sql |
Existing SQL insights and custom analysis |
posthog:read-data-schema |
Discover events, properties, sample values |
posthog:insight-get / -query |
Fetch a saved insight's metadata / data |
posthog:explain-chart |
Walk the user through a trends chart (Step 5) |
Plus the standard PostHog tools the playbooks reference by name (feature-flag-get-all,
experiment-list, annotations-list, query-error-tracking-issues-list, query-logs,
query-session-recordings-list, cohorts-list/-create, annotation-create,
insight-create).
Helper scripts
compare_to_prior_periods.py— auto-detects interval and compares recent values to the natural cycle (day-of-week, hour-of-week, or sequential). Use to resolve step 2.2 cheaply.breakdown_attribution.py— ranks breakdown segments by absolute delta and flags offsetting moves.
python3 scripts/compare_to_prior_periods.py < query_result.json
WINDOW=7 python3 scripts/breakdown_attribution.py < breakdown_result.json
Step 1 — Classify the metric
Read query.kind from the source the user pointed at:
- Saved insight (URL,
short_id):posthog:insight-get→query.kind. Useposthog:insight-queryif you also need the numbers. - A query you already ran or the user pasted: read
kinddirectly. - A metric the user only names, such as "signups", or shows in a screenshot: find its event
with
posthog:read-data-schemaand run it as one series over time withposthog:query-trends. That query is yourTrendsQuery. Whenquery-trendscannot express the metric, such as a warehouse-only metric or a custom SQL join, run it withposthog:execute-sqland treat it as aHogQLQuery. - Nothing pointed at, or several events could be the metric: ask which one. Don't guess.
| kind | Playbook |
|---|---|
TrendsQuery |
trend-playbook.md |
FunnelsQuery |
funnel-playbook.md |
RetentionQuery |
retention-playbook.md |
StickinessQuery |
stickiness-playbook.md |
LifecycleQuery |
lifecycle-playbook.md |
PathsQuery |
paths-playbook.md |
HogQLQuery |
route by what the SQL aggregates (see below) |
If kind === "TrendsQuery" and trendsFilter.display === "BoxPlot", use
box-plot-playbook.md — distribution metric, no
breakdowns.
For HogQLQuery insights, classify by the SQL's shape: count over time → trend
playbook, multi-step conversion → funnel playbook, cohort return → retention playbook.
Run the SQL through posthog:execute-sql to get the data, then follow the closest
playbook's steps. See HogQL insights in shared-patterns.md.
FAQ
Does it only work with saved insights?
No. It can also work from a dashboard tile or a query that you paste in.
Will it explain what a metric is?
No. It is for changes or charts that need an explanation, not simple definitions.
How does it find the users behind a change?
It uses the trends actors query to see who is in the bucket that changed.
Details
Original description by the author
Diagnose why a product metric changed (dropped, spiked, or plateaued) by orchestrating breakdowns, actors, paths, lifecycle, retention, and annotations queries. Use when the user reports an anomaly, asks "why did X change?", asks to explain or walk them through a chart, or needs root-cause analysis for a trend, funnel, retention, stickiness, or lifecycle metric.
repo: PostHog/posthog
Popularity
- GitHub stars
- 41k
- Ranking position
- #6904
- License
- —
- Updated
- 11/2/2026
Comments
- …
More skills from this repository
depot-ci
41kHelps your agent set up and run Depot CI workflows, a GitHub Actions alternative, including migrating existing workflows and reading run logs.
depot-container-builds
41kHelps your agent build Docker images on Depot's remote builders, including multi-platform images, pushing to registries, and fixing build failures.
depot-github-runners
41kHelps your agent move GitHub Actions jobs to Depot-managed runners, choosing runner sizes and labels, and troubleshooting runner setup issues.
editing-agents-md
41kHelps your agent decide whether a rule belongs in an AGENTS.md or CLAUDE.md file, and write it so it sticks without bloating the file.
Similar skills
gitcrawl
394kLets your agent search a saved archive of GitHub issues and pull requests, group duplicates, and check their current status on GitHub.
slacrawl
394kLets your agent search and count messages in a local Slack archive, check how fresh that archive is, and refresh it when needed.
goplaces
394kHelps your agent search for places, get their details and reviews, and resolve place names using Google Places, with JSON output for scripts.