diagnosing-ci-and-merge-bottlenecks
Skill này làm gì
Skill này dùng phân tích kỹ thuật để cho thấy các pull request chuyển từ mở đến gộp như thế nào và CI làm chúng chậm ở đâu. Nó dành cho trưởng nhóm kỹ thuật muốn có cái nhìn rõ ràng về tốc độ giao sản phẩm của đội.
Khi nào nên dùng
- ✓Khi bạn muốn biết CI đang nhanh hơn hay chậm hơn theo thời gian.
- ✓Khi bạn cần tìm workflow GitHub Actions nào chậm nhất hoặc kém tin cậy nhất.
- ✓Khi bạn muốn biết các pull request mất bao lâu từ lúc mở đến lúc gộp.
Liên kết skill
https://github.com/PostHog/posthog/blob/master/products/engineering_analytics/skills/diagnosing-ci-and-merge-bottlenecks/SKILL.mdSao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.
Cách dùng
Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.
Tin nhắn có sẵn để dán
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“CI của chúng tôi có đang chậm đi không, và workflow GitHub nào gây ra độ trễ?”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Skill đọc dữ liệu pull request và sức khỏe từng workflow trong một khoảng thời gian, rồi báo cáo thời gian trung vị và phân vị thứ 95. Bạn không cần viết truy vấn nào.
Nội dung kỹ thuật (SKILL.md gốc)
Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.
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 sincedate_from(default-30d), newest first. Each row carriesauthor(nested object:handle,display_name,is_bot),repo(nested:owner,name),state,is_draft,labels,open_to_merge_seconds,ready_to_merge_seconds, and acirollup (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; preferready_to_merge_secondswhere 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_ratecovers runs that succeeded or ended in a decisive failure (failure,timed_out,startup_failure, orstale), excluding skipped, cancelled, neutral, and action-required runs.p50_seconds/p95_secondscover successful runs only because cancelled and failed runs end early and would bias the duration trend. Each isnullwhen 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_requestscopes 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_qualityispartial(no review or comment events).engineering-analytics-flaky-tests— the active test-health queue from the per-test CI spans, over a window (date_fromdefault-7d, max 30 days). Evidence is counted per CI run, never per span or run attempt.classificationisconfirmed_flakeonly 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);quarantinedmeans a tolerated failure was recorded while masked;suspected_regressionmeans 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_prsdistinct 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, checkworkflow-healthrather than reading an empty queue as healthy.**`engineering-analytics
Câu hỏi thường gặp
Tôi có cần viết SQL không?
Không. Skill dùng các công cụ có tên, nên bạn có thể hỏi bằng ngôn ngữ đơn giản.
Vì sao dùng trung vị thay vì trung bình?
Một vài pull request rất chậm có thể làm lệch trung bình, nên trung vị và phân vị thứ 95 cho bức tranh công bằng hơn.
Skill có điều tra một bài kiểm thử lỗi không?
Không. Với một bài kiểm thử hoặc lần chạy lỗi, một skill điều tra riêng được dùng.
Chi tiết
Mô tả gốc của tác giả
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
Độ phổ biến
- Sao GitHub
- 41k
- Vị trí xếp hạng
- #6864
- Giấy phép
- —
- Cập nhật
- 2/11/2026
Bình luận
- …
Thêm skill từ kho mã này
depot-ci
41kGiúp agent của bạn thiết lập và chạy quy trình Depot CI, một lựa chọn thay thế GitHub Actions, gồm chuyển các quy trình hiện có và đọc nhật ký chạy.
depot-container-builds
41kGiúp agent của bạn build image Docker trên các builder từ xa của Depot, gồm image đa nền tảng, đẩy lên registry và sửa lỗi build.
depot-github-runners
41kGiúp agent của bạn chuyển các job GitHub Actions sang runner do Depot quản lý, chọn kích thước và nhãn runner, và xử lý lỗi thiết lập runner.
editing-agents-md
41kGiúp agent của bạn quyết định một quy tắc nên nằm trong file AGENTS.md hay CLAUDE.md, và viết sao cho quy tắc được tuân thủ mà file không bị phình to.
Skill tương tự
openclaw-update
394kGiúp agent của bạn cập nhật OpenClaw Gateway đang có, chọn cách cập nhật phù hợp với cách cài đặt và giữ phiên làm việc của bạn hoạt động.
diagnose-gateway
394kGiúp agent của bạn tìm hiểu vì sao OpenClaw Gateway bị lỗi bằng cách kiểm tra cài đặt, kênh và cổng mà không thay đổi gì.
crabbox-apps
394kGiúp agent của bạn mở và chạy một app trên máy đám mây tạm thời, rồi hiển thị giao diện của nó trong thanh bên của chat.