Skip to content
Data
Skill

/creating-box-plot-insights

Creates product analytics or SQL-backed box plot insights in PostHog. Use when a user asks to create, build, or save a box plot, visualize a numeric distribution, compare quartiles or medians across dates or groups, or turn SQL results into a box plot. Chooses between a standard

From plugin
posthog
41k172 skills11 agents2 commands3 MCP

Claude Code

$ npx -y skills add posthog/posthog --skill creating-box-plot-insights --agent claude-code

SKILL.md

creating-box-plot-insights.SKILL.md
name: creating-box-plot-insights
description: >-
  Creates product analytics or SQL-backed box plot insights in PostHog. Use when a user asks to create, build, or save a box plot, visualize a numeric distribution, compare quartiles or medians across dates or groups, or turn SQL results into a box plot. Chooses between a standard Trends box plot and a SQL insight, validates the distribution data, saves the insight, and verifies it.

Creating box plot insights

Box plots need distribution data, not an already-aggregated average or total. Choose the simplest query type that can express the user's question.

Choose the query type

Use a **standard product analytics box plot** when all of these are true:

  • The source is an event, action, or warehouse table supported by Trends.
  • One numeric property contains the values to distribute.
  • The user wants the distribution over a normal time interval.

Use a **SQL box plot** when the user needs custom grouping, joins, derived values, or bespoke SQL. Read `querying-posthog-data` before writing HogQL, then use [references/sql-examples.md](references/sql-examples.md) as a starting point.

Do not use SQL only to reproduce a standard Trends query.

Standard product analytics box plot

1. Identify the event or action and its numeric property. Confirm the property is numeric before saving. 2. Build an `InsightVizNode` whose source is a `TrendsQuery`:

  • Set the series event or action.
  • Set `math_property` to the numeric property.
  • Set `trendsFilter.display` to `BoxPlot`.
  • Choose the date range and interval that match the question.

3. Run the query with `posthog:query-trends`. 4. If it returns distribution rows, save it with `posthog:insight-create`. 5. Read it back with `posthog:insight-get` and confirm the property, interval, and display.

A box plot without a numeric `math_property` is invalid. Do not substitute event counts unless counts are the values the user wants to distribute.

SQL box plot

The SQL must return one pre-aggregated row for each X-axis and series pair. Calculate the summary in the database. Never calculate percentiles from the limited result rows in the client.

Required numeric roles:

  • minimum
  • 25th percentile
  • median
  • mean
  • 75th percentile
  • maximum

The easiest result shape uses these aliases:

x, series, min, p25, median, mean, p75, max

`x` and `series` are optional:

  • Set `xAxisColumn` to `null` for one overall distribution or one box per series.
  • Set `seriesColumn` to `null` for one series.

Validate the HogQL with `posthog:execute-sql` before saving. Check that:

  • Every required statistic is numeric.
  • `min <= p25 <= median <= p75 <= max` for every row.
  • The mean is between the minimum and maximum.
  • Each X-axis and series pair appears once.
  • There are at most 200 series and 10,000 X-axis by series cells.

Then save this shape with `posthog:insight-create`:

{
  "query": {
    "kind": "DataVisualizationNode",
    "source": {
      "kind": "HogQLQuery",
      "query": "<validated HogQL>"
    },
    "display": "BoxPlot",
    "chartSettings": {
      "boxPlot": {
        "xAxisColumn": "x",
        "seriesColumn": "series",
        "minColumn": "min",
        "p25Column": "p25",
        "medianColumn": "median",
        "meanColumn": "mean",
        "p75Column": "p75",
        "maxColumn": "max",
        "excludeOutliers": true
      }
    }
  }
}

Use the actual aliases when the query uses different names. Do not map the six statistics as six Y-axis series.

Verify the saved insight

1. Read the saved insight with `posthog:insight-get`. 2. Run it with `posthog:insight-query`. 3. Confirm the result still has the expected columns and one row per box. 4. Report the insight link, the numeric value being distributed, and the grouping choices.

If an individual row has a missing or invalid summary, PostHog omits that box while keeping valid boxes visible. Fix the SQL when omitted boxes are not expected.

Related skills

  • `querying-posthog-data` - required before authoring or changing the HogQL for a SQL box plot.
  • `formatting-insight-axes` - use when the value axis needs currency, duration, percentage, or other formatting.
  • `building-a-dashboard` - use when the box plot should be placed with other insights on a dashboard.
Read more
@posthog
Ships withposthog

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

41k172 skills11 agents3 MCP
Get the whole plugin

Stars on GitHub

Momentum

stars in total
40.7k
Star history of posthog/posthog on GitHub, a chart by star-history.com

Other skills on posthog.

mcp-servers

mcp-servers

Install, configure, authenticate, and troubleshoot MCP (Model Context Protocol) servers for this agent. Use when the user asks to…

@posthog@posthogInstall Skill
dynamic-workflows

dynamic-workflows

Designs and runs task-specific JavaScript harnesses with the `workflow` tool. Use for broad, long-running, highly structured, or…

@posthog@posthogInstall Skill
subagent-orchestration

subagent-orchestration

How and when to delegate work to subagents via the `subagent` tool (Explore, Plan, General). Use when a task involves codebase…

@posthog@posthogInstall Skill
checking-member-access

checking-member-access

Explains what a member or a role can do in a PostHog project, using the access control MCP tools. Use when the user asks what…

@posthog@posthogInstall Skill
analyzing-ai-citations

analyzing-ai-citations

Answer AI citation and answer engine optimization (AEO) questions in PostHog: whether AI answer engines (ChatGPT, Claude, and an…

@posthog@posthogInstall Skill
analyzing-expensive-users

analyzing-expensive-us…

Analyze the most expensive users in AI observability and explain why they cost so much. Use when the user asks about top…

@posthog@posthogInstall Skill

More skills from other plugins.

context-loader
Auto-invoked

context-loader

Search memories from earlier Pi sessions in this repository. Use it when earlier work may already explain the code, error,…

mem08d69k
@mem0ai@mem0aiInstall Skill
qmd

qmd

Search local markdown knowledge bases, notes, docs, and wikis with QMD. Use when users ask to find notes, retrieve documents,…

qmd4w31k
@tobi@tobiInstall Skill

Questions about creating-box-plot-insights.

Which coding agents can use creating-box-plot-insights?
creating-box-plot-insights installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.