investigate-metric
Skill này làm gì
Skill này giải thích vì sao một biểu đồ PostHog thay đổi, dùng phân tách, phễu, giữ chân và các truy vấn liên quan khác. Nó dành cho nhà phân tích và quản lý sản phẩm cần nguyên nhân của một thay đổi.
Khi nào nên dùng
- ✓Khi một chỉ số giảm hoặc tăng đột biến và bạn muốn biết vì sao.
- ✓Khi có người yêu cầu bạn giải thích hoặc đi qua một biểu đồ mà bạn không đọc được.
- ✓Khi một chỉ số phễu, giữ chân hoặc vòng đời thay đổi và bạn cần nguyên nhân gốc.
Liên kết skill
https://github.com/PostHog/posthog/blob/master/products/product_analytics/skills/investigate-metric/SKILL.mdSao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.
Cách dùng
Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.
Tin nhắn có sẵn để dán
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Lượt đăng ký giảm mạnh vào thứ Ba tuần trước. Tìm xem vì sao.”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Skill chạy nhiều truy vấn liên quan, chẳng hạn phân tách theo thuộc tính và danh sách người dùng đứng sau thay đổi, rồi kiểm tra chú thích để tìm các sự kiện có thể giải thích. Sau đó, skill kết hợp kết quả thành một nguyên nhân có khả năng.
Nội dung kỹ thuật (SKILL.md gốc)
Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.
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.
Câu hỏi thường gặp
Skill có chỉ làm việc với insight đã lưu không?
Không. Nó cũng có thể làm việc từ một ô dashboard hoặc một truy vấn bạn dán vào.
Skill có giải thích chỉ số là gì không?
Không. Nó dành cho các thay đổi hoặc biểu đồ cần được giải thích, không dành cho định nghĩa đơn giản.
Làm sao nó tìm người dùng đứng sau một thay đổi?
Nó dùng truy vấn actors của xu hướng để xem ai nằm trong nhóm đã thay đổi.
Chi tiết
Mô tả gốc của tác giả
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
Độ phổ biến
- Sao GitHub
- 41k
- Vị trí xếp hạng
- #6904
- Giấy phép
- —
- Cập nhật
- 2/11/2026
Bình luận
- …
Thêm skill từ kho mã này
depot-ci
41kGiúp agent của bạn thiết lập và chạy quy trình Depot CI, một lựa chọn thay thế GitHub Actions, gồm chuyển các quy trình hiện có và đọc nhật ký chạy.
depot-container-builds
41kGiúp agent của bạn build image Docker trên các builder từ xa của Depot, gồm image đa nền tảng, đẩy lên registry và sửa lỗi build.
depot-github-runners
41kGiúp agent của bạn chuyển các job GitHub Actions sang runner do Depot quản lý, chọn kích thước và nhãn runner, và xử lý lỗi thiết lập runner.
editing-agents-md
41kGiúp agent của bạn quyết định một quy tắc nên nằm trong file AGENTS.md hay CLAUDE.md, và viết sao cho quy tắc được tuân thủ mà file không bị phình to.
Skill tương tự
gitcrawl
394kCho phép agent của bạn tìm trong kho lưu trữ issue và pull request GitHub, gom các mục trùng lặp và kiểm tra trạng thái hiện tại trên GitHub.
slacrawl
394kCho phép agent của bạn tìm và đếm tin nhắn trong kho lưu trữ Slack cục bộ, kiểm tra kho đó mới đến mức nào và làm mới khi cần.
goplaces
394kGiúp agent của bạn tìm địa điểm, lấy chi tiết và đánh giá, và xác định tên địa điểm bằng Google Places, với đầu ra JSON cho script.