Skip to content
Skillpedia
Deploy & cloud (DevOps)41k Β· #6864

diagnosing-ci-and-merge-bottlenecks

What it does

This skill uses engineering analytics to show how pull requests move from open to merged and where CI slows them down. It is for engineering leads who want a clear view of team delivery speed.

When to use it

  • βœ“When you want to know whether CI is getting faster or slower over time.
  • βœ“When you need to find which GitHub Actions workflow is the slowest or least reliable.
  • βœ“When you want to know how long pull requests take from open to merge.

Skill link

https://github.com/PostHog/posthog/blob/master/products/engineering_analytics/skills/diagnosing-ci-and-merge-bottlenecks/SKILL.md

Copy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.

How to use

The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.

Ready-to-paste message

Use this skill to help me: https://github.com/PostHog/posthog/blob/master/products/engineering_analytics/skills/diagnosing-ci-and-merge-bottlenecks/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
Want your AI to find skills like this on its own?Install the free Skillpedia MCP: one line, and it searches 15,000+ skills before each task.Install in 1 minute β†’

Example of what to ask your AI

β€œIs our CI getting slower, and which GitHub workflow is causing the delays?”

5 new skills a week. 1 minute to read.

How it works

It reads pull request data and per-workflow health over a time window, then reports median and 95th percentile times. You do not need to write any queries.

Technical content (original SKILL.md)

Original text by the author, straight from GitHub.

Diagnosing CI and merge bottlenecks

Engineering analytics treats a pull request like product analytics treats a user: a PR moves through a pipeline (opened β†’ CI β†’ review β†’ merged β†’ deployed) and the job is to find where it slows down. The surface is named MCP tools β€” you call them, you don't write SQL. Dogfooded on PostHog/posthog; the same tools serve autonomous agents (e.g. PostHog Desktop) reasoning about their own PRs. Scope is aggregate pipeline health: to take one failing test or red run to a verdict, switch to the investigating-ci-failures skill.

The tools

  • pull-requests β€” the PR workhorse. Open PRs plus anything merged or closed since date_from (default -30d), newest first. Each row carries author (nested object: handle, display_name, is_bot), repo (nested: owner, name), state, is_draft, labels, open_to_merge_seconds, ready_to_merge_seconds, and a ci rollup (runs / passing / failing / pending) from the head-SHA join. Answers most PR-level questions: which PRs have failing or pending CI, which are stuck open longest, per-author or per-repo triage, and time-to-merge stats (aggregate over the returned merged rows yourself, median and p95, never a mean; prefer ready_to_merge_seconds where non-null, it excludes draft time).

  • workflow-health β€” per-workflow CI health over a window (date_from / date_to, default last 24 hours): run_count, success_rate, p50_seconds, p95_seconds, last_failure_at. Answers "is CI getting faster or slower" and "which workflow is the slow or flaky long pole". There is no built-in trend β€” call it over two adjacent windows and compare. success_rate covers runs that succeeded or ended in a decisive failure (failure, timed_out, startup_failure, or stale), excluding skipped, cancelled, neutral, and action-required runs. p50_seconds / p95_seconds cover successful runs only because cancelled and failed runs end early and would bias the duration trend. Each is null when a window has no qualifying runs β€” guard for null before comparing two windows (a workflow can have runs in one and none in the other). run_scope=pull_request scopes to PR-attributed runs, excluding master/main (same-repo PRs only β€” fork runs carry no PR attribution).

  • pr-lifecycle β€” a single PR's timeline: a header plus ordered events β€” opened, ready-for-review and converted-to-draft transitions (when the issue-events table is synced), then a CI started/finished pair per workflow run (many on a multi-workflow repo, interleaved by time), then merged/closed. Answers "where is PR N stuck". metric_quality is partial (no review or comment events).

  • engineering-analytics-flaky-tests β€” the active test-health queue from the per-test CI spans, over a window (date_from default -7d, max 30 days). Evidence is counted per CI run, never per span or run attempt. classification is confirmed_flake only where the evidence proves nondeterminism (same_commit_recovery_run_count > 0: one commit both failed and passed the test in the same matrix job, via a "Re-run failed jobs" attempt going green or an in-job retry; a pass in a different leg, such as FOSS against EE, is not recovery); quarantined means a tolerated failure was recorded while masked; suspected_regression means only failures were recorded, which is absence of proof, not proof of a real break. A test qualifies on any same-commit recovery, a quarantined failure, any master/main failure, or failures on β‰₯ min_failed_prs distinct PRs (failed_pr_count). Answers "what is this failing test costing us" and picks quarantine candidates. It does not answer "which tests are flaky": this queue only sees the main Backend pytest and Frontend Jest suites, and recovery proof only arrives when someone re-runs failed jobs (or a pytest test is hand-marked @pytest.mark.flaky(reruns=N)). Counts are absolute signal, never rates: passing runs are mostly not emitted, so there is no honest denominator. A CI setup break excludes every trial of the attempt, not only its failures: a run attempt whose tests errored in 3 or more jobs or for 3 or more owning teams, or a job attempt with 100 or more distinct failed or errored tests. A real break that wide is left out too, so when a whole suite or job goes red, check workflow-health rather than reading an empty queue as healthy.

  • **`engineering-analytics

FAQ

Does it need me to write SQL?

No. It uses named tools, so you can ask in plain language.

Why does it use the median instead of the average?

A few very slow pull requests can skew an average, so the median and 95th percentile give a fairer picture.

Can it investigate one failing test?

No. For one failing test or run, a separate investigation skill is used.

Details

Original description by the author

Diagnoses CI and pull-request pipeline health for a GitHub repo using the engineering analytics MCP tools β€” pull-requests (PR list with CI status), workflow-health (per-workflow CI trends), and pr-lifecycle (a single PR's timeline). Use when asked whether CI is getting faster or slower, which GitHub Actions workflow is the slow or flaky long-pole, how long PRs take from open to merge, how an author's merge time compares to the cohort, which open PRs have failing or pending CI, or where a specific pull request is stuck. Triggers on "engineering analytics", "is CI getting slower", "slow workflow

repo: PostHog/posthog

Popularity

GitHub stars
41k
Ranking position
#6864
License
β€”
Updated
11/2/2026

Is this skill useful?

0

Sign in to vote.

Comments

  • …

More skills from this repository

Similar skills