choosing-trend-or-slope-view
Qué hace
Esta skill te ayuda a elegir el gráfico adecuado cuando alguien pregunta cómo cambió algo entre dos puntos. Está pensada para quien quiere un gráfico que se ajuste a su pregunta.
Cuándo usarla
- ✓Cuando preguntas cuánto creció o bajó algo entre dos fechas.
- ✓Cuando quieres ver cómo se movió una métrica a lo largo de todo el periodo, incluidos los picos.
- ✓Cuando quieres comparar muchas series según sus valores de inicio y de final.
Link de la skill
https://github.com/PostHog/posthog/blob/master/products/product_analytics/skills/choosing-trend-or-slope-view/SKILL.mdCópialo y pégalo en tu IA (Claude, ChatGPT o Cursor) pidiéndole que siga las instrucciones.
Cómo usar
La forma más fácil: copia el mensaje y pégalo en tu IA. Ella lee la skill y sigue las instrucciones.
Mensaje listo para pegar
Para Claude Code, Codex o Cursor: ejecútalo en la carpeta del proyecto y la skill queda instalada.
Descarga el SKILL.md y ponlo en la carpeta de skills de tu agente.
Ejemplo de qué pedirle a la IA
“¿Cuánto cambiaron los registros de enero a marzo?”
5 skills nuevas por semana. 1 minuto de lectura.
Cómo funciona
Si la petición puede referirse tanto a la trayectoria completa como solo al inicio y al final, la skill primero hace una pregunta breve. Ambos gráficos salen de la misma consulta, y el gráfico de pendiente conserva solo el primer y el último punto.
Contenido técnico (SKILL.md original)
Texto original del autor, en inglés, directo de GitHub.
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.
Preguntas frecuentes
¿Se basan los dos gráficos en datos distintos?
No. Ambos salen de la misma consulta de tendencias sobre el mismo intervalo de fechas, y el gráfico de pendiente conserva solo el primer y el último punto.
¿Qué pasa si ya sé qué gráfico quiero?
Si pides claramente uno, la skill lo construye sin preguntar.
¿Cuándo es mejor un gráfico de pendiente?
Es mejor para mostrar el cambio neto y los cambios de posición entre muchas series, sin el ruido intermedio.
Detalles
Descripción original del autor
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
Popularidad
- Estrellas en GitHub
- 41 mil
- Posición en el ranking
- #6900
- Licencia
- —
- Actualizada
- 2/11/2026
Comentarios
- …
Más skills de este repositorio
depot-ci
41 milAyuda a tu agente a configurar y ejecutar flujos de Depot CI, una alternativa a GitHub Actions, y a leer los registros de ejecución.
depot-container-builds
41 milAyuda a tu agente a crear imágenes de Docker en los constructores remotos de Depot, incluidas las multiplataforma, y a corregir fallos.
depot-github-runners
41 milAyuda a tu agente a pasar los trabajos de GitHub Actions a runners gestionados por Depot, elegir su tamaño y etiquetas y resolver problemas de configuración.
editing-agents-md
41 milAyuda a tu agente a decidir si una regla debe ir en un archivo AGENTS.md o CLAUDE.md, y a escribirla para que se cumpla sin sobrecargar el archivo.
Skills parecidas
gitcrawl
394 milPermite que tu agente busque en un archivo guardado de incidencias y pull requests de GitHub, agrupe duplicados y revise su estado actual en GitHub.
slacrawl
394 milPermite que tu agente busque y cuente mensajes en un archivo local de Slack, revise qué tan reciente es y lo actualice cuando haga falta.
goplaces
394 milAyuda a tu agente a buscar lugares, obtener sus detalles y reseñas, y resolver nombres de lugares usando Google Places, con salida JSON para scripts.