/jstack:ci-retrofrom jstack
Make a repository's CI faster from its own run history, then keep it fast. Use when CI is slow, queued, flaky or cold-cached, when auditing CI performance, or after a session that spent its time waiting on or retrying CI.
Ships in jstack. 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; scripts run unread.
A retro for CI: read the CI record, find where PRs wait, and change the environment so the next run waits less. GUIDE.md is the playbook (nine changes, with Boardy's measured results). This file is the procedure.
The CI record is the session log here. Every candidate traces to runs you measured: a job, a step, a run ID and seconds. Discard a candidate you cannot trace. A candidate with no measured win stays a proposal.
Earned CI. Put the repo in a lane. gate: one ci-ok job, no
edited trigger, push to main only for deploy or a lockfile cache seed,
weekly grouped bots. local: no CI, for a private solo repo with a
deterministic just check, clean-env prove, and no bot auto-PRs. Cut
what the lane does not need before you tune what is left.
Read the repo's own checks. Workflows, the build tool's lint,
typecheck and test scripts, hooks, and the repo's CI notes. A check that
exists but is unwired, skipped or silently broken is the finding, not a
reason to build a new one. A repo with no guardrail (no hook and no CI job
that runs lint, typecheck and tests) is a finding of its own.
Done when you can list every job, what triggers it and what it runs.
Measure. Run scripts/ci-timings OWNER/REPO --runs 100 --steps for PRs
(--event pull_request) and for main (--event push). Split every job into
queue, setup and run. Note the critical path: the slowest job plus its
queue. Note cache misses, retries of the same commit and flaky failures.
Done when each job has p50 and p90 for queue, setup and run.
Find candidates. Walk the guide's sections against the numbers. Each candidate names its category, its evidence, its fix and the seconds it should remove from the critical path.
| Category | Evidence | Fix it with |
|---|---|---|
| Queue | queue p90 above the job's run time | a runner change (Runners and gates below) |
| Setup | install, checkout or toolchain above 10 s; cold PR caches | a cache seeded from main, blobless clone, persistent tool cache |
| Run | one step dominates the job | faster tool, shared test workers, bigger cores, then shards |
| Critical path | jobs in sequence, or one job carrying extra work | parallel jobs; move the extra work out |
| Scope | full suite on a docs-only or one-package change | affected-only runs, a nightly full run, and a test that the skip cannot hide a real change |
| Local guardrail | CI fails on lint or types an agent could catch locally | a pre-push hook on changed files, under 10 s |
| Flake | the same commit fails, then passes | fix or quarantine it with an owner; lower parallelism if it races |
| Dead weight | a job that never failed in 90 days and duplicates another | delete it |
Classify each rule you add. A mechanical rule (a fixed pattern, a cache
that must hit, a skip that must not hide a change) becomes a check that can
fail. Only a judgement call goes into the repo's coding standards, which the
reviewer reads. AGENTS.md and CLAUDE.md get navigation pointers only.
Rank. Order by seconds removed from the critical path times runs per month, most first. A quiet cold cache on every PR can outrank a loud flake once a week. Present the list with evidence for each candidate.
Pick. Apply the candidates the user picks. "Full send" picks every candidate in the list. A candidate that cannot show a measured win in step 6 is reverted and reported, not kept.
Apply and measure again. One commit per candidate. For each, record
before and after from the same ci-timings columns, on at least three runs.
Try a new check on a PR before it can block merges. Done when every picked
candidate is kept with a measured win or reverted with its numbers.
Make it stick. A required check is the gate (Runners and gates below). Run the full suite on main on a schedule when PRs run less than everything. Put the before and after table in the PR's Evidence section.
These rules hold for any repository. A team with a private runner pool can
record its labels, capacity and monthly budget in its own AGENTS.md or
CLAUDE.md; this skill needs none of them.
ubuntu-24.04).pr-body, actionlint, ci-ok, lint) costs 20x. Fold it
into an existing self-hosted job as a step, or keep the gate on self-hosted
once a job finishes. Use hosted runners on a private repository only for
secret-isolated deploys, KVM, or a low-volume repository with no pool.ci-ok,
that needs every CI job and fails unless each one succeeded or was skipped
by a tested scope rule. Put path filters inside the workflow, never in on:
paths-ignore, so the gate always reports. Require the gate in a ruleset
only after it is green on main and on a PR.scripts/ci-timings: run it in steps 2 and 6. It needs python3 and an
authenticated gh. Run scripts/ci-timings --help first when unsure.What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub justcarlson/jstack --plugin jstack20 skills in this plugin
/babysit-prMonitor a pull request through review and CI. Use when the user asks to monitor, watch, or babysit a PR./bugTake an upstream bug, in a tool we use but do not own such as T3 Code, from first error to merged fix. Use when an error comes from upstream code, or when asked to check for an upstream issue, file one, or propose its fix./councilTrigger this if the user says 'council'./epicResearch, plan and ship ambitious multi-issue or multi-repo work end to end. Triggers on 'epic', '/epic', 'ship epic', or bold-options research, a plan for sign-off, then parallel issues, worktrees, zero-downtime deploys and live proof./file-prFile a concise pull request. Use when the user asks to file, open, or create a PR./full-sendTrigger this if the user says 'full send'.