investigate-metric
できること
このスキルは、関連するブレイクダウン、ファネル、継続率などのクエリを使って、PostHogのチャートが変化した理由を説明します。変化の原因を必要とするアナリストやプロダクトマネジャー向けです。
使う場面
- ✓指標が下がった、または急増して、その理由を知りたいとき。
- ✓誰かにチャートを説明してもらう必要があるが、読み取れないとき。
- ✓ファネル、継続率、ライフサイクルの指標が変わり、根本原因が必要なとき。
スキルのリンク
https://github.com/PostHog/posthog/blob/master/products/product_analytics/skills/investigate-metric/SKILL.mdコピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。
使い方
いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。
貼り付け用メッセージ
Claude Code、Codex、Cursorの場合:プロジェクトのフォルダで実行するとスキルがインストールされます。
SKILL.mdをダウンロードして、エージェントのスキル用フォルダに入れてください。
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. 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.
よくある質問
保存されたインサイトでしか使えませんか?
いいえ。ダッシュボードのタイルや、貼り付けたクエリでも使えます。
指標の定義を説明してくれますか?
いいえ。説明が必要な変化やチャートのための機能で、単純な定義のためではありません。
変化の背後にいるユーザーはどう見つけますか?
トレンドのアクターのクエリを使い、変化したバケットに含まれる人を確認します。
詳細
作者による元の説明
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
コメント
- …
このリポジトリの他のスキル
depot-ci
41kエージェントが、GitHub Actionsの代替であるDepot CIのワークフローを設定し実行できるよう支援します。既存のワークフローの移行や、実行ログの確認も含みます。
depot-container-builds
41kエージェントが、Depotのリモート・ビルダーでDockerイメージを作れるよう支援します。マルチプラットフォームのイメージ、レジストリへのプッシュ、ビルド失敗の修正を含みます。
depot-github-runners
41kエージェントが、GitHub Actionsのジョブを Depot が管理するランナーに移し、ランナーのサイズとラベルを選び、ランナー設定の問題を解決できるよう支援します。
editing-agents-md
41kエージェントが、AGENTS.mdとCLAUDE.mdのどちらにルールを書くべきかを判断し、ファイルを膨らませずに守られやすい形で書けるよう支援します。
似ているスキル
gitcrawl
394k保存されたGitHubのイシューとプルリクエストのアーカイブを検索し、重複をまとめ、GitHub上の現在の状態を確認するようエージェントを支援します。
slacrawl
394kローカルのSlackアーカイブ内のメッセージを検索して件数を数え、アーカイブの新しさを確認し、必要に応じて更新するようエージェントを支援します。
goplaces
394kGoogle Placesを使って、場所を検索し、詳細や口コミを取得し、場所の名前を解決するようエージェントを支援します。スクリプト用にJSON出力もできます。