turning-engineering-analytics-into-insights
它能做什么
本技能根据拉取请求和 CI 运行等工程数据,构建已保存的图表、仪表盘和订阅。适合希望长期跟踪交付健康状况的工程经理。
适用场景
- ✓当你想要一个用于跟踪拉取请求或 CI 健康状况的已保存仪表盘时。
- ✓当你想让团队订阅工程数据的定期视图时。
- ✓当你想直接用 SQL 查询 GitHub 拉取请求或工作流数据的时候。
技能链接
https://github.com/PostHog/posthog/blob/master/products/engineering_analytics/skills/turning-engineering-analytics-into-insights/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“请在 PostHog 中制作一个仪表盘,跟踪我们的拉取请求每周合并需要多长时间。”
每周 5 个新技能,1 分钟读完。
工作原理
它会为你的团队找到 GitHub 数据表,并重建内置工程视图所用的相同逻辑,然后将结果保存为洞察或仪表盘。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Turning engineering analytics into insights and subscriptions
The engineering analytics dashboard and MCP tools (pull-requests, workflow-health, pr-lifecycle, engineering-analytics-broken-tests, …)
run curated HogQL privately: nothing in the UI or the tool output names the underlying tables,
and the endpoints cannot themselves be saved as insights or subscribed to.
The data, however, is queryable directly, through two substrates:
- Raw warehouse tables —
<prefix>github_pull_requests,<prefix>github_workflow_runs,<prefix>github_workflow_jobs,<prefix>github_reviews, and<prefix>github_teams/<prefix>github_team_members(org team membership — the author→team map) — ordinary team-scoped tables you query with HogQL. - Three curated warehouse views with fixed names —
engineering_analytics_job_costs,engineering_analytics_ci_job_history,engineering_analytics_ci_failures— provisioned per team from the connected GitHub source(s). Non-materialized: computed at query time, always current, and they back insights and subscriptions like any table.
The views exist for exactly one reason: they render product code into SQL — the runner-tier cost model, the failure-fingerprint recipe, the jobs↔runs commit-attribution rules — logic that would silently drift if hand-rolled, re-rendered into the team's view whenever the code changes. Everything else is just table data, and pure HogQL over the raw tables is always enough: never create additional warehouse views for engineering analytics data, and never re-derive in SQL what the three views already encode.
| What the product shows | Where the data actually lives | Can it back an insight? |
|---|---|---|
| PR list, merge times, CI status, workflow health | Data warehouse tables <prefix>github_pull_requests, <prefix>github_workflow_runs |
Yes (SQL insight over the tables) |
| Reviews and approvals | <prefix>github_reviews |
Yes |
| Team-level PR metrics (author→team attribution) | <prefix>github_team_members semi-joined against the PR authors |
Yes (team aggregates only) |
| Job durations, queue times, runner tiers | <prefix>github_workflow_jobs |
Yes |
| CI cost (runner-tier price ladder) | engineering_analytics_job_costs view |
Yes (query the view, never recompute cost) |
| Per-job CI history with commit attribution | engineering_analytics_ci_job_history view |
Yes |
| Grouped (fingerprinted) CI failure lines | engineering_analytics_ci_failures view (reads the Logs product, short retention) |
Yes, for short recent windows |
| Thinned CI failure logs for a PR or run | Logs product (service_name = 'github-ci-logs') + thinning logic |
No (use the MCP tools ad hoc) |
| Flaky-test leaderboard, broken-tests triage, team CI health | CI trace spans + ranking/classification logic in product code | No (use the MCP tools ad hoc) |
So the job splits cleanly: warehouse-backed metrics (raw tables or the three views) become SQL insights (then dashboards, then subscriptions); everything computed by product logic at request time stays on the MCP tools, delivered recurringly via an AI subscription if needed.
Step 1: discover the team's tables
Warehouse table names carry a user-chosen prefix, so never hardcode them.
Call the engineering-analytics-sources MCP tool: each connected GitHub source returns its id, repo, and prefix.
The tables are <prefix>github_pull_requests, <prefix>github_workflow_runs, <prefix>github_workflow_jobs, <prefix>github_reviews, and <prefix>github_teams /
常见问题
我能把内置的工程工具保存为洞察吗?
不能。内置工具私下运行,无法直接保存,因此本技能使用 SQL 重建其逻辑。
为什么不自己编写成本计算的 SQL?
共享视图包含产品的成本和提交规则,因此当这些逻辑变化时,数字仍能保持正确。
它使用哪些数据?
它使用 GitHub 的拉取请求、评审、工作流运行和任务表,以及用于任务成本、任务历史和失败的三个整理好的视图。
详情
作者的原始描述
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 column semantics in HogQL, reading exposed engineering_analytics_* warehouse views where product logic is involved (CI cost, fingerprinted failure lines, commit attribution), saving queries with insight-create, and scheduling delivery with subscriptions-create. Use when asked to "save this as an insight", "put CI health / m
repo: PostHog/posthog
热度
- GitHub 星标
- 41k
- 排名
- #6866
- 许可证
- —
- 更新时间
- 2026/11/2
评论
- …
同一仓库的更多技能
depot-ci
41k帮你的智能体设置并运行 Depot CI 工作流(GitHub Actions 的替代方案),包括迁移现有工作流和读取运行日志。
depot-container-builds
41k帮你的智能体在 Depot 的远程构建器上构建 Docker 镜像,包括多平台镜像、推送到镜像仓库,以及修复构建失败。
depot-github-runners
41k帮你的智能体把 GitHub Actions 任务迁移到 Depot 托管的运行器上,选择运行器规格和标签,并排查运行器设置问题。
editing-agents-md
41k帮你的智能体判断某条规则应写入 AGENTS.md 还是 CLAUDE.md,并以不会让文件臃肿的方式写下,确保规则真正生效。