formatting-insight-axes
Qué hace
Esta skill establece el formato del eje de un insight de PostHog para que los números muestren unidades claras, como segundos, minutos o porcentajes. Está pensada para analistas que construyen gráficos con valores de tiempo o de proporción.
Cuándo usarla
- ✓Cuando vas a dividir un valor solo para que aparezca en minutos o en porcentaje.
- ✓Cuando quieres que un eje de gráfico muestre valores de tiempo en unidades fáciles de leer.
- ✓Cuando quieres que una columna de un insight SQL muestre una unidad sin cambiar los números.
Link de la skill
https://github.com/PostHog/posthog/blob/master/products/product_analytics/skills/formatting-insight-axes/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
“Muestra el tiempo medio de respuesta en mi gráfico en minutos, sin cambiar los números.”
5 skills nuevas por semana. 1 minuto de lectura.
Cómo funciona
Establece el formato de eje integrado en lugar de añadir una división o un sufijo de texto fijo. El formateador elige después una unidad legible para cada valor, y los números subyacentes siguen siendo correctos.
Contenido técnico (SKILL.md original)
Texto original del autor, en inglés, directo de GitHub.
Formatting insight axes
PostHog renders insights with a built-in axis formatter. Use it instead of contorting the query or a literal prefix/postfix to fake units.
The two insight kinds configure it in different places:
- TrendsQuery —
trendsFilter.aggregationAxisFormat(this page, below) - SQL insights (
DataVisualizationNode) — per-columnsettings.formatting(see SQL insights)
The anti-pattern
If you are reaching for any of these, stop and pick a format below first:
formula: "A / 60"withaggregationAxisPostfix: " mins"— manual seconds -> minutesformula: "A / 1000"withaggregationAxisPostfix: " s"— manual ms -> secondsformula: "A * 100"withaggregationAxisPostfix: "%"— manual ratio -> percentaggregationAxisPostfix: "ms"/"s"/"min"/"hr"on raw values
These freeze the unit at one scale. The built-in formatter picks a friendly unit per value (1.5s, 2m 12s, 1h 4m) and keeps the underlying series numerically correct for further math, breakdowns, and alerts.
Available formats
Set trendsFilter.aggregationAxisFormat on the TrendsQuery:
| Value | Use when the series is... | Renders as |
|---|---|---|
numeric (default) |
a plain count | 1,234 |
duration |
seconds (any scale) | 45s, 2m 12s, 1h 4m |
duration_ms |
milliseconds | 850ms, 1.5s, 1m 4s |
percentage |
already 0-100 | 47.3% |
percentage_scaled |
a ratio 0-1 | 47.3% |
currency |
money in the project's base currency | $1,234.56 (or local code) |
short |
large counts you want compacted | 1.2K, 3.4M |
Companion fields on trendsFilter:
aggregationAxisPrefix— literal prefix (e.g."$") when you need a symbol pinned to a specific currency or unit, regardless of project settingsaggregationAxisPostfix— literal suffix; reserve for genuine units the format can't express (e.g." req"," events"), never for"mins"/"s"/"%"— the percentage formats already append the%sign, so a"%"postfix renders50%%decimalPlaces— cap decimals (1 or 2 is usually right for currency / ratios)
Currency — pick format or prefix carefully
aggregationAxisFormat: "currency" renders with the project's base currency
(set in project settings, defaults to USD). Use it when the underlying values
are in that same currency — e.g. revenue events that PostHog auto-converts to
the project's base currency.
If the values are pinned to a specific currency regardless of project (e.g.
$ai_total_cost_usd is always USD, even on a EUR-base project), use
aggregationAxisPrefix: "$" + decimalPlaces: 2 so the symbol matches the
data. Using format: "currency" here would render USD values with € on a
EUR project.
When the series is in seconds
If the series is in seconds (latency, session length, time-to-first-event,
processing time, page load, etc.), silently default to
aggregationAxisFormat: "duration". Do not stop to ask — the formatter is
non-destructive (the underlying values stay in seconds either way, only the
labels change), so picking it is always at least as good as raw seconds.
Only confirm with the user when they have explicitly named a fixed unit they want pinned ("show this in minutes", "graph the average in hours"):
"I can pin the y-axis to minutes by dividing the series by 60, or use PostHog's
durationformatter which auto-picks seconds / minutes / hours per value —90srenders as1m 30sand5400sas1h 30m. Which would you prefer?"
In one-shot MCP contexts where no user is in the loop, just pick duration
and move on.
Examples
Latency — duration in milliseconds
{
"kind": "TrendsQuery",
"series": [
{
"kind": "EventsNode",
"event": "$pageview",
"math": "p95",
"math_property": "$performance_page_loaded"
}
],
"trendsFilter": {
"aggregationAxisFormat": "duration_ms"
}
}
Average session length — duration in seconds
{
"kind": "TrendsQuery",
"series": [
{
"kind": "E
Preguntas frecuentes
¿Por qué no añadir una fórmula para convertir unidades?
Una conversión fija bloquea la unidad a una sola escala, mientras que el formato integrado se ajusta a cada valor y mantiene los datos utilizables para otros cálculos.
¿Funciona con insights SQL?
Sí. Los insights SQL establecen el formato de cada columna en su configuración de gráfico.
¿Cambiará mis números?
No. Solo cambia la visualización, así que los valores siguen siendo numéricamente correctos.
Detalles
Descripción original del autor
Pick the right y-axis unit when creating or updating an insight via `posthog:insight-create` or `posthog:insight-update` — both TrendsQuery (`trendsFilter.aggregationAxisFormat`) and SQL insights (`DataVisualizationNode`, `chartSettings.yAxis[].settings.formatting`). Use when the agent is about to add a `formula` purely to convert units (e.g. dividing seconds by 60 to display minutes), when a `math_property` or SQL column is a duration, currency, ratio, or large count, or whenever the user mentions "format the y-axis", "duration", "seconds", "minutes", "hours", "milliseconds", "ms", "percentag
repo: PostHog/posthog
Popularidad
- Estrellas en GitHub
- 41 mil
- Posición en el ranking
- #6903
- 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.