Skip to content
Data
Skill

/turning-engineering-analytics-into-insights

Converts engineering analytics (PR / CI) data into saved PostHog insights, dashboards, and subscriptions, and explains how to query the product data directly with SQL. Covers discovering per-team GitHub warehouse tables via engineering-analytics-sources, replicating curated

From plugin
posthog
41k172 skills11 agents2 commands3 MCP

Claude Code

$ npx -y skills add posthog/posthog --skill turning-engineering-analytics-into-insights --agent claude-code

SKILL.md

turning-engineering-analytics-into-insights.SKILL.md
name: turning-engineering-analytics-into-insights
description: 'Turns engineering analytics (PR and CI) data into saved PostHog insights, dashboards, and subscriptions, and explains how to query the data with SQL. Covers finding the per-team GitHub warehouse tables with engineering-analytics-sources, writing HogQL that matches the product''s own rules, reading the managed engineering_analytics_* warehouse views for CI cost, job history, and fingerprinted failures, saving queries with insight-create, and scheduling delivery with subscriptions-create. Use when asked to "save this as an insight", "put CI health or merge times on a dashboard", "email me PR throughput weekly", "chart CI cost", "track time to first review", "subscribe to these numbers", "alert on CI success rate", or "what tables and views does engineering analytics read". For one-off CI and merge questions use diagnosing-ci-and-merge-bottlenecks. To investigate one CI failure use investigating-ci-failures.'

Turning engineering analytics into insights and subscriptions

You cannot save an engineering analytics MCP tool's output as an insight or subscribe to it. The same data is queryable with HogQL, and a SQL insight over it can go on a dashboard or into a subscription.

Where the data lives

| Data | Where to query it | Insight? | | ------------------------------------------------------- | -------------------------------------------------------------- | ----------------------------- | | PRs, merge times, workflow runs | `<prefix>github_pull_requests`, `<prefix>github_workflow_runs` | Yes | | Job durations and queue times | `<prefix>github_workflow_jobs` | Yes | | Reviews and approvals | `<prefix>github_reviews` | Yes | | Team-level PR metrics | `<prefix>github_team_members`, as a membership filter | Yes, as team aggregates only | | CI cost per job attempt | `engineering_analytics_job_costs` view | Yes | | Job history with commit attribution | `engineering_analytics_ci_job_history` view | Yes | | Fingerprinted pytest failure lines | `engineering_analytics_ci_failures` view | Yes, for short recent windows | | Flaky tests, broken tests, team CI health, failure logs | MCP tools only | No |

The three views have fixed names and no prefix. A project has them once someone has opened engineering analytics and a GitHub source syncs both workflow runs and workflow jobs. They are not materialized, so each query computes them from current data. The two job views also include Depot CI jobs, which the raw GitHub tables do not hold.

Some projects also have three materialized views: `engineering_analytics_pr_friction`, `engineering_analytics_ci_runs`, and `engineering_analytics_ci_jobs`. Use them only after a test query shows they exist.

Never create more warehouse views for this data, and never rewrite in SQL what a view already computes.

Step 1: find the tables

Table names carry a prefix the user chose, so never hardcode them. Call `engineering-analytics-sources`. It returns one entry per repository, with `id`, `repo`, `prefix`, and `synced`.

  • A source's original repo uses the plain names, such as `<prefix>github_pull_requests`.
  • Every other repo of the same source has a repo-qualified table name. The tool's description gives the naming rule.
  • With several entries, ask which repo the user means.

The views cover every GitHub source of the project. Filter `repo_owner` and `repo_name` on the two job views, or `repo` on `engineering_analytics_ci_failures`, to keep one repo.

Step 2: write the HogQL

First check whether a view already answers the question.

The raw tables hold GitHub's JSON as strings, so a plain `SELECT` gets the rules wrong. Copy the base subqueries from [references/hogql-recipes.md](references/hogql-recipes.md) and follow these rules:

  • Timestamps are strings. Wrap each in `parseDateTimeBestEffort` before you compare or subtract.
  • JSON columns are Nullable. Wrap each in `ifNull` before `JSONExtractArrayRaw` or `splitByChar`.
  • Attribute a CI run to a PR by PR number, from the run's own PR association. A head SHA join drops every push except the latest.
  • Exclude bots and drafts from throughput and merge-time metrics.
  • `merged_at` minus `created_at` is `open_to_merge_seconds`. It includes draft time, so never title an insight "cycle time" or "review time".
  • Compute success rates over `status = 'completed'` rows. A run's conclusion arrives by webhook and can lag.
  • Join reviews to PRs on `pr_number`.
  • Attribute PRs to a team with `author_handle IN (SELECT ...)` over the team members table. A plain join double-counts authors who belong to several teams.
  • On the two job views, bound `created_at` and add a string floor such as `created_at_raw >= '<YYYY-MM-DD>'`. The floor lets the scan skip old data.

Test the query with the `execute-sql` tool before you save anything.

Step 3: save the insight

Call `insight-create` with a SQL insight:

{
  "name": "Weekly PR open to merge time (hours)",
  "query": {
    "kind": "DataVisualizationNode",
    "source": { "kind": "HogQLQuery", "query": "<tested SQL>" }
  }
}
  • If you are unsure of the chart type, save the table and link the insight so the user picks one.
  • Put a relative window in the SQL, such as `>= now() - INTERVAL 90 DAY`. Tell the user that dashboard date filters will not change it
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 turning-engineering-analytics-into-insights.

Which coding agents can use turning-engineering-analytics-into-insights?
turning-engineering-analytics-into-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.