/agents-skills:ci-speed-huntingfrom agents-skills
Diagnoses and fixes slow CI pipelines by identifying bottleneck classes (under-sharded matrices, cold caches, missing path-filter tiers, serial needs-chains, redundant rebuilds) and applying coverage-preserving speed improvements.
Ships in agents-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
A serial merge queue can only drain as fast as the merge-gating critical path completes, so the wall-clock long pole is a tax on every PR in flight. Shaving minutes off the critical path raises queue throughput for the whole team — the same leverage the flake hunter gets from killing an ejecting flake, from the other direction.
This skill pairs with the ci-flake-hunting skill (which owns failures, flakes, and flake-vs-infra classification — it touches RED jobs; you touch SLOW green jobs, and the two never overlap) and builds on the merge-queue mechanics in the driving-prs-to-merge skill. Where a "just make it faster" instinct conflicts with this skill's coverage-is-sacred rule, this skill wins.
Project-agnostic; the adopting project defines these (the full set lives in driving-prs-to-merge). Used here:
| Placeholder | Meaning |
|---|---|
<owner>/<repo> | GitHub repository slug |
<integration-branch> | Branch PRs target and the queue merges into |
<ci-workflow> | The per-PR CI workflow file that gates merge (e.g. pr-checks.yml) |
<summary-check> | The rollup check whose completion the critical path ends at |
<e2e-suite> | The end-to-end / browser test job or matrix (often the long pole) |
<merge-strategy> | Allowed strategy flag — and whether a merge queue governs the branch |
Coverage is sacred. Speed never costs verification. You make CI faster by doing the same work faster (caching, parallelism, right-sized runners, build-once) or by skipping work that provably cannot affect the diff (a correct changed-paths tier). You NEVER make it faster by checking less: no deleted test, no test.skip, no narrowed --grep, no shard with fewer specs, no gate pulled from the summary check's needs:, no loosened assertion, no timeout-minutes cut so low it kills a legitimately slow run. If a change saves time by checking less, it is out of bounds — that is regressing coverage, not speeding CI.
SAFE — same work, faster (do these freely, they can't lose coverage):
| Lever | What it does | Risk to watch |
|---|---|---|
| Warm a cold cache | restore an artifact instead of rebuilding (package store, build cache, incremental-compile info, browser binaries) | cache key must capture every input — a key that misses an input serves stale artifacts |
| Re-balance a matrix | move specs from the long-pole shard to idle shards so max-shard-time drops | total specs run is unchanged; only the assignment moves |
| Build-once / share artifact | build the bundle once, fan it to N shards via an artifact | every consumer shard must get the identical artifact |
Parallelize a serial needs: | a job that doesn't consume an upstream result shouldn't wait on it | the dependency must be genuinely absent, not just usually-satisfied |
| Right-size a runner | move a CPU-bound long pole to a larger runner | cost tradeoff — note it in the PR |
Right-size timeout-minutes | a 20-min timeout on a 4-min job delays nothing but masks creep; tighten to a safe margin | too tight = kills slow-but-valid runs (a coverage loss disguised as speed); never below the job's real p99 |
CONDITIONAL — skipping work (safe ONLY if the skip is provably irrelevant to the diff):
| Lever | Safe when | Unsafe when |
|---|---|---|
| Add/tighten a changed-paths tier (a paths-filter) so a job skips on unrelated diffs | the filter glob is a superset of every input the job actually verifies (incl. transitive) | the filter misses a transitive input → a diff that breaks the job skips it → silent coverage hole |
| Gate a heavy job behind a cheap tier gate | the cheap gate is a strict prerequisite (a failing cheap gate guarantees the heavy job would fail too) | the heavy job can fail independently of the gate |
OUT OF BOUNDS — not a speed fix, it's a coverage cut (never): deleting/skipping tests, narrowing --grep, dropping a shard's specs, removing a job from the summary check's needs:, loosening an assertion, disabling a gate. If the only way to make it faster is to check less, stop — wrong job.
For the CONDITIONAL bucket the proof obligation is on you (Step 3). When unsure whether a skip is safe, treat it as unsafe and find a SAFE lever.
Don't guess where CI is slow. Pull per-job and per-step durations, reconstruct the critical path, rank by wall-clock contribution, fix the long pole first. Set REPO=<owner>/<repo>.
(a) Per-job durations on a recent successful run (slow ≠ broken — time GREEN runs):
gh run list --repo $REPO --workflow <ci-workflow> --status success --limit 20 \
--json databaseId,headSha,createdAt,updatedAt \
-q '.[] | "\(.databaseId)\t\(.headSha[0:9])\t\(.createdAt)\t\(.updatedAt)"'
# per-job started/completed → duration (seconds), slowest first. (BSD/macOS date shown;
# on GNU/Linux use: date -d "<ts>" +%s)
gh api "repos/$REPO/actions/runs/<runId>/jobs" --paginate \
-q '.jobs[] | "\(.name)\t\(.started_at)\t\(.completed_at)"' \
| awk -F'\t' '{ "date -j -f %Y-%m-%dT%H:%M:%SZ "$2" +%s" | getline s; \
"date -j -f %Y-%m-%dT%H:%M:%SZ "$3" +%s" | getline e; \
printf "%5d %s\n", e-s, $1 }' | sort -rn | head -25
(b) Per-step durations inside one slow job (where the time goes within the long pole):
gh api "repos/$REPO/actions/runs/<runId>/jobs" --paginate \
-q '.jobs[] | select(.name|test("<job-name>")) | .steps[] | "\(.name)\t\(.started_at)\t\(.completed_at)"'
# eyeball: browser install? build? the test run itself? cache restore?
(c) Critical path — the long pole is the slowest chain, not the slowest job. If CI is tiered with serial gate barriers, a fast job stuck behind a slow gate still finishes late. Map the chain that ends latest:
gh api "repos/$REPO/actions/runs/<runId>/jobs" --paginate \
-q '.jobs[] | select(.name|test("gate|<summary-check>|<e2e-suite>")) | "\(.completed_at)\t\(.name)"' | sort
(d) Matrix shard balance — a matrix finishes at its SLOWEST shard; an unbalanced matrix wastes the fast shards' idle time. List shard durations and look for one far slower than its siblings.
(e) merge_group timing — the queue runs the same gate on a synthetic branch; confirm the PR-level long pole is also the queue long pole (it usually is):
gh run list --repo $REPO --event merge_group --status success --limit 10 \
--json databaseId,createdAt,updatedAt -q '.[] | "\(.databaseId)\t\(.createdAt)\t\(.updatedAt)"'
Build a ranked list: {job-or-chain, wall-clock, % of critical path, bottleneck class}, worst-first. Don't trust timeout-minutes — that's the ceiling, not the runtime. Always measure. Re-derive your baseline from live data each tick; the suite grows, so last week's long pole may not be this week's.
Name the mechanism. The recurring classes:
needs: that could overlap. A job waits on a gate it doesn't actually consume (e.g. a build that needs only source + lockfile, sitting behind a unit-test barrier). If a heavy job's real inputs are ready before the barrier, the barrier is pure idle wait.Write the class + the expected saving in one sentence before touching YAML. If you can't estimate the saving from the timing data, you haven't diagnosed it — back to Step 1.
This is the step that separates a speed fix from a coverage regression. For the chosen lever, satisfy the matching proof:
needs: → confirm the job does not read any output/file produced by the barrier you're removing it from (grep its steps for use of the upstream's artifacts).If you cannot produce the proof, the change is unsafe — pick a different lever. "Every run was green in my test" is not proof; reason about the worst-case diff, not the happy path.
needs: edge, add the correct path filter, share the build artifact.actionlint if available; otherwise re-read the diff against the surrounding job. Delegate the mechanical edit to a workhorse sub-agent only after you've named the exact change — never the cheap tier for workflow YAML.A speed fix is two claims; verify both:
needs: edge); for a cache win, confirm a warm run (the first run still pays the miss).needs:, the pass/fail and (for tests) spec/assertion count identical. If the test count dropped, you cut coverage — revert.If either fails, you fixed the wrong thing — back to Step 2.
ci: re-shard e2e 4→8 — <saving> or perf(ci): cache the build on PR — <saving>.<integration-branch>, hooks intact, auto-merge (gh pr merge --auto <merge-strategy>; omit the strategy flag under a merge queue). If the project runs an auto-rebase automation, apply do-not-rebase only after observing a rebase-cancelled run (see driving-prs-to-merge / the issue control-field skill). Never --admin/--no-verify/force past the queue; respond to any <bot-reviewer> comments.BAD — buying time by checking less (never):
# ❌ narrow the E2E grep so fewer specs run — coverage silently dropped
env: { E2E_GREP: "@smoke" } # was the full suite → now skips most specs
# ❌ drop a shard's specs to "balance" — those specs now run nowhere
matrix: { shard: [1, 2] } # was 1..6; shards 3..6 specs no longer execute
# ❌ remove a slow gate from the summary needs so it resolves sooner
needs: [changes, typecheck, unit] # e2e dropped → end-to-end no longer gates merge
GOOD — same coverage, faster:
# ✅ build once, fan the bundle to all shards — every shard runs the same specs, stops rebuilding N times
- uses: actions/download-artifact@<pinned>
with: { name: prod-bundle-${{ github.run_id }} }
# ✅ cache key hashes EVERY input that changes the bundle, so a hit is always valid
key: build-${{ runner.os }}-${{ hashFiles('src/**', 'package.json', '<lockfile>') }}
# ✅ re-balance: spread the long-pole area across more shards — same total specs, lower max-shard time
# ✅ drop a needs edge the job never consumes — the build reads source+lockfile only, not unit results
needs: [tier-1-gate] # was tier-2-gate; build now overlaps the unit-test tier
A correct path-filter tier skips only provably-irrelevant runs: a docs-only PR doesn't need the web E2E shards because no web spec's inputs changed — but the filter glob is a superset of the E2E inputs, so any web-source, shared-package, or test-setup change still fires the shards. A filter gated too tightly (on one feature dir) would skip them on a shared-component change those specs exercise → silent coverage hole. When unsure, widen.
You run inside the caveman-mode ci-speed-hunter agent. CI timing logs are huge — the main context risk. Load the caveman skill and conserve aggressively:
gh run view --log into context. Pull only the structured jobs timing JSON and reduce it to the ranked duration list. Quote only the long-pole numbers.caveman:cavecrew-investigator) and keep only its ranked conclusion.mined 12 runs; crit-path 50m; long-pole=build→shards 40m → drop tier-2 needs + re-shard 6→8 → speed PR #x (50m→38m, specs unchanged).Caveman compresses prose only — gh/gh api commands, YAML keys, cache-key expressions, job names, before/after numbers stay byte-exact. Commit messages + PR bodies: normal prose with the numbers, through the humanizer skill.
Before claiming a saving, satisfy ALL three:
gh api .../jobs, not the timeout-minutes value and not a hunch. Account for runner variance (compare medians over a few runs for cache/timing-sensitive wins).If any fails, it's not shippable. A re-shard that doesn't reduce max-shard time, a cache that never warms, a filter that never skips — all noise.
Your lane is exactly one thing: the wall-clock time of jobs that are already GREEN. Nothing else.
Others own whether a job passes; you own how fast a passing job runs. No red is ever yours. Route it:
pr-checks watcher lane.<integration-branch>, the recurring flake, transient-infra reds (mirror/CDN blip, expired token, rate limit, external-service cap) → ci-flake-hunting.Hard rule — never accept a red. A failing job is not a latency problem, and it does not become yours because it is also slow. If you find a red while mining timings, log it, leave it, and hand it to the right lane above. If someone hands you a failure "because CI is slow", refuse it.
Never edit a workflow in a way that changes a job's pass/fail — a too-tight timeout that kills legitimately slow runs, a cancel-concurrency that drops a required check, a path filter that skips a job the diff actually breaks. If your speed change turns a job red, you caused a regression — revert immediately (and do not hand the red you created to the flake hunter). The two lanes run in parallel safely only because neither crosses into the other's territory.
There is exactly one ci-speed-hunter active at a time. Two collide on the CI workflow files, race on edits, and double-spend CI minutes re-timing the same jobs. If you are this lane and find another already running, defer to it. You routinely run alongside the flake hunter and the PR watcher lanes (pr-checks, pr-comments, pr-cleanup) — that is expected; just git fetch origin <integration-branch> && git merge before every push and keep your diff strictly the speed change.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub skyfox675/agents-skills --plugin agents-skills32 skills in this plugin
/browser-diagnosisReproduce and root-cause a front-end bug in a real browser using whichever browser MCP is connected — Chrome (claude-in-chrome), Playwright, Cypress, or Chrome DevTools — not just one. Drive the page as the signed-in user, watch the network and console, capture the failing request/response, shim/mock to isolate the fault, and record a repro, then hand the evidence to the issue being filed. Use whenever a symptom needs live-browser evidence (the toast says failed but it saved, a column shows zero, a click 404s) and from the /…-use-browser command family (and the engine-pinned /…-use-chrome, /…-use-playwright, /…-use-cypress variants), the /…-use-aws-browser commands, and the diagnostician agent. Picks the available MCP automatically and degrades gracefully when none is connected./cavemanUltra-compressed communication mode. Cuts token usage ~75% by speaking like caveman while keeping full technical accuracy. Supports intensity levels: lite, full (default), ultra, wenyan-lite, wenyan-full, wenyan-ultra. Use when user says "caveman mode", "talk like caveman", "use caveman", "less tokens", "be brief", or invokes /caveman. Also auto-triggers when token efficiency is requested./ci-flake-huntingThe authoritative method for hunting, root-causing, and fixing CI flakes so the merge queue stops ejecting correct PRs and churn drops. A flake is a test that fails then passes on retry with NO code change explaining it — every red speculative merge-queue build ejects a correct PR and disarms its auto-merge, so a live flake taxes every PR behind it. Encodes the loop — MINE CI history for real flakes → REPRODUCE harsher-than-CI → ROOT-CAUSE the real mechanism (hydration/render race, settle race, mock-order, loading-state race, click-through fragility) → FIX FORWARD (test or component, never mask) → VERIFY by re-running many times → UNSTICK the PRs the flake stranded → REPEAT. And how to tell a true code flake from transient INFRA (CDN/mirror outage, expired token mid-suite, rate-limit/WAF, external-service cap, cloud state-lock, CI-provider billing/outage, upstream bump) which must NOT be code-fixed. Use whenever chasing CI instability, "deflake this spec", "CI keeps ejecting my PR", "is this a flake or real", a shard that intermittently reds the queue, or running the ci-flake-hunter lane. Distinct from ci-speed-hunting (which owns slow-but-green jobs — flake never touches timing/sharding)./deploy-watchingSingle-lane interval watcher that keeps the integration environment's deploys healthy by fixing FORWARD — the deploy-health lane of a multi-agent fleet. Each tick it reads the newest deploy run, locates the red (deploy step vs post-deploy smoke), classifies it transient (concurrent-deploy state-lock race, CI-infra blip, known smoke transient) or real (deterministic IaC error, ordered co-deploy race, regression from a merged commit, contention inside the shared environment), re-runs the former, and mints a forward-fix PR for the latter that preserves the offending commit's intent — never a revert, never a skipped test. Loops on an interval ("/loop <interval> start"). Use when running a deploy lane, when the dev/staging deploy went red after a merge, when deciding whether a red deploy needs a re-run or a code fix, when the environment may be running stale code, or when `pr-checks` hands over a failure rooted in the integration branch rather than a PR's diff./dispatching-subagentsTurn a groomed tracker issue into a running implementation sub-agent and a merged PR — issue selection (priority, file-disjointness, bundling), model/effort resolution from chat > labels > defaults, the eight-section dispatch brief (worktree, toolchain prefix, pre-push hygiene, scope, git discipline, PR procedure, return contract), parallel dispatch under a concurrency cap, stalled-agent worktree salvage, and verify-then-trust completion checks. Use whenever you are about to spawn a sub-agent (Agent/Task tool call) to implement, fix, refactor, test, or otherwise write code from a tracker issue — even if the user only says "work the next issues", "fix these bugs", "run the loop", or "send an agent at #N" without saying "dispatch"; also use when a dispatched agent stalls, is watchdog-killed, returns status:failed, or reports completion and you must decide whether to salvage its worktree, re-dispatch, or verify its PR./doc-coauthoringGuide users through a structured workflow for co-authoring documentation. Use when user wants to write documentation, proposals, technical specs, decision docs, or similar structured content. This workflow helps users efficiently transfer context, refine content through iteration, and verify the doc works for readers. Trigger when user mentions writing docs, creating proposals, drafting specs, or similar documentation tasks.Other plugins' skills for the same job