choosing-trend-or-slope-view
Skill này làm gì
Skill này giúp bạn chọn đúng biểu đồ khi ai đó hỏi một thứ đã thay đổi giữa hai thời điểm thế nào. Nó dành cho bất kỳ ai muốn một biểu đồ khớp với câu hỏi của họ.
Khi nào nên dùng
- ✓Khi bạn hỏi một thứ đã tăng hoặc giảm bao nhiêu giữa hai ngày.
- ✓Khi bạn muốn xem một chỉ số đã biến động thế nào trong suốt giai đoạn, kể cả các đợt tăng đột biến.
- ✓Khi bạn muốn so sánh nhiều chuỗi theo giá trị đầu và cuối của chúng.
Liên kết skill
https://github.com/PostHog/posthog/blob/master/products/product_analytics/skills/choosing-trend-or-slope-view/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ý thay đổi bao nhiêu từ tháng Một đến tháng Ba?”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Nếu yêu cầu có thể hiểu theo cả đường đi đầy đủ lẫn chỉ điểm đầu và điểm cuối, skill hỏi một câu ngắn trước. Cả hai biểu đồ đều đến từ cùng một truy vấn, và biểu đồ độ dốc chỉ giữ điểm đầu và điểm cuối.
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.
Choosing a trend line vs a slope view
"How did X change between A and B?" is ambiguous. Two charts answer two different questions, so clarify before you build unless the user already named one:
- Change over time (line) — the value at every interval across the range. Shows the path: dips, spikes, when it moved. This is the default trend.
- Start vs end (slope) — only the first and last point, one line per series connecting them. Shows the net change and, across many series, which rose, which fell, and any rank flips — without the noise of the path between.
When the request could be either, ask a short either/or, e.g.:
Do you want to see how it moved across the whole period (a line chart), or just the change from the start to the end (a slope chart)?
If the user clearly wants one — "just tell me how much it grew start to end" → slope; "show me the trend / when did it spike" → line — skip the question and build it.
How to render each
Both come from the same TrendsQuery over the same date range — the slope is
that series collapsed to its first and last point, not a different query.
Change over time → line
Default trends behavior. Create or run a TrendsQuery and leave
trendsFilter.display as ActionsLineGraph (the default, "change over time"):
{
"kind": "TrendsQuery",
"series": [{ "kind": "EventsNode", "event": "$pageview", "math": "total" }],
"dateRange": { "date_from": "2025-01-01", "date_to": "2025-03-31" },
"trendsFilter": { "display": "ActionsLineGraph" }
}
Start vs end → slope
Run the trend with posthog:query-trends. The result card Max renders has a
Line / Bar / Slope view toggle — switch it to Slope to show each series as
a single line from its first to its last point, with the per-series change in the
legend. Tell the user they can flip to the Slope view on the result.
The slope view is best for a clean before→after comparison, especially with several series/categories whose relative movement matters. Pick a date range whose two ends are the points you want compared (the slope uses the first and last interval).
Important limits
- Two surfaces, one computation. Both the inline slope (Max's
query-trendsresult card) and the saved-insight slope (ChartDisplayType.SlopeGraph) show the same thing: the first interval's value vs the last interval's value, at the chosen group-by interval. The grouping defines the slope - group by month to compare the first vs last month, by day for the first vs last day. Use the inline view for a quick before-and-after on a result you're already looking at; use the saved display to persist it on a dashboard. A still-accumulating final period is shown as-is with a dashed connector, the same affordance the line chart uses for an incomplete tail. - For period-over-period on a single series (this month vs last), a line with
compareFilter: { "compare": true }overlays the two periods; a slope is the better fit when comparing the endpoints of many series at once.
Câu hỏi thường gặp
Hai biểu đồ có dựa trên dữ liệu khác nhau không?
Không. Cả hai đều đến từ cùng một truy vấn xu hướng trong cùng khoảng ngày, và biểu đồ độ dốc chỉ giữ điểm đầu và điểm cuối.
Nếu tôi đã biết mình muốn biểu đồ nào thì sao?
Nếu bạn yêu cầu rõ một loại, skill xây dựng nó mà không hỏi.
Khi nào biểu đồ độ dốc tốt hơn?
Nó tốt hơn để thể hiện thay đổi ròng và sự thay đổi thứ hạng giữa nhiều chuỗi, mà không có nhiễu ở giữa.
Chi tiết
Mô tả gốc của tác giả
Clarify how to visualize change over a time range before building a trend. Use whenever the user asks how much something changed, grew, dropped, improved, or regressed between two points or periods — "how much did X change from A to B", "before vs after", "start vs end", "week over week", "compare this month to last", "change over time" — or mentions a "slope chart" / "slopegraph". Two readings of "change" need different charts: the whole trend (a line, every interval) versus just the two endpoints (a slope, start vs end). Ask which they want, then render it. Not for choosing a saved insight C
repo: PostHog/posthog
Độ phổ biến
- Sao GitHub
- 41k
- Vị trí xếp hạng
- #6900
- 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.