turning-engineering-analytics-into-insights

Converts GitHub PR and CI warehouse data into saved PostHog SQL insights, dashboards, and subscriptions.

713|118|Updated Aug 11, 2020
One-click install
npx skills add https://github.com/PostHog/posthog-foss --skill turning-engineering-analytics-into-insights
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: turning-engineering-analytics-into-insights
Source: https://github.com/PostHog/posthog-foss/tree/main/products/engineering_analytics/skills/turning-engineering-analytics-into-insights
Command: npx skills add https://github.com/PostHog/posthog-foss --skill turning-engineering-analytics-into-insights

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

PostHog's engineering analytics dashboard and MCP tools run curated HogQL privately, so their results cannot be saved as insights, placed on dashboards, or subscribed to. This Skill bridges that gap by querying the underlying GitHub warehouse tables and curated views directly, then persisting the results as SQL insights, dashboards, and scheduled subscriptions.

Core Features & Use Cases

  • Table and view discovery: Uses the engineering-analytics-sources MCP tool to find per-team prefixed GitHub warehouse tables, plus three fixed-name curated views for CI cost, job history, and fingerprinted failures.
  • Curated HogQL recipes: Provides base subqueries that replicate product semantics, including timestamp parsing, bot and draft exclusion, PR-number-based CI attribution, and team membership semi-joins.
  • Insight and subscription creation: Saves tested queries with insight-create, bundles them into dashboards, and schedules delivery via subscriptions, with guidance on when alerts are not possible.
  • Use Case: A user asks to chart weekly CI cost per workflow and email it every Monday. The Skill queries the engineering_analytics_job_costs view, saves a SQL insight, adds it to a dashboard, and creates a weekly subscription.

Quick Start

Ask the assistant to save a weekly PR open-to-merge time trend as a PostHog insight and subscribe to it by email.

Frequently Asked Questions about turning-engineering-analytics-into-insights

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I save engineering analytics data as a PostHog insight?

Query the GitHub warehouse tables or the engineering_analytics_* views with HogQL, test the query with the execute-sql MCP tool, then save it using insight-create with a DataVisualizationNode query. You can then bundle insights into dashboards with dashboard-create.

How do I find my team's GitHub warehouse table names in PostHog?

Call the engineering-analytics-sources MCP tool, which returns each connected GitHub source with its id, repo, and prefix. Table names are the prefix plus github_pull_requests, github_workflow_runs, github_workflow_jobs, github_reviews, and github_team_members.

Can I set up alerts on CI success rate in PostHog?

Alerts require a trends insight, so a SQL insight cannot be alerted on directly. Instead, create a scheduled subscription for regular delivery, or use a threshold check inside a prompt-kind AI subscription.

Should I compute CI cost myself from runner labels in SQL?

No. The runner-tier price ladder lives in product code and drifts over time. Query the engineering_analytics_job_costs view instead, which renders that cost model into SQL and is parity-tested against the product's own tools.

Why should CI runs be joined to PRs by PR number instead of head SHA?

The PR snapshot keeps only the current head SHA, so a SHA join silently drops every push except the latest. The run's pull_requests association gives the PR number, which correctly attributes CI across all pushes; head SHA is only valid for a PR's current CI status.

What are the limitations of the engineering_analytics_ci_failures view?

The view reads the Logs product, so it is bounded by short log retention and suits only recent windows. Fingerprinting is pytest-only and the data is failure-only, so report absolute counts rather than rates.