跳到正文
Skillpedia
分析与电子表格41k · #6904

investigate-metric

它能做什么

本技能利用细分、漏斗、留存及其他相关查询,解释某个 PostHog 图表为何发生变化。适合需要了解变化原因的分析师和产品经理。

适用场景

  • ✓当某项指标下降或激增,你想知道原因时。
  • ✓当有人要求你解释一张你看不懂的图表时。
  • ✓当漏斗、留存或生命周期指标发生变化,你需要找出根本原因的时候。

技能链接

https://github.com/PostHog/posthog/blob/master/products/product_analytics/skills/investigate-metric/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/PostHog/posthog/blob/master/products/product_analytics/skills/investigate-metric/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“注册人数上周二急剧下降。请帮我查明原因。”

每周 5 个新技能,1 分钟读完。

工作原理

它会运行几项相关查询,例如按属性细分,以及查看导致变化的用户,然后检查标注中可能解释该变化的事件。它会把结果综合为最可能的原因。

技术内容(原始 SKILL.md)

作者在 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. Use posthog:insight-query if you also need the numbers.
  • A query you already ran or the user pasted: read kind directly.
  • A metric the user only names, such as "signups", or shows in a screenshot: find its event with posthog:read-data-schema and run it as one series over time with posthog:query-trends. That query is your TrendsQuery. When query-trends cannot express the metric, such as a warehouse-only metric or a custom SQL join, run it with posthog:execute-sql and treat it as a HogQLQuery.
  • 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.

常见问题

它只能用于已保存的洞察吗?

不是。它也可以用于仪表盘中的图块,或你粘贴的查询。

它会解释指标是什么意思吗?

不会。它用于需要解释的变化或图表,而不是简单的定义。

它如何找出变化背后的用户?

它使用趋势参与者查询,查看哪些人位于发生变化的分组中。

详情

作者的原始描述

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

热度

GitHub 星标
41k
排名
#6904
许可证
—
更新时间
2026/11/2

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能