Skip to content

skillDevOps and cloud

CI Pipeline Speedup

Measures where a CI pipeline spends its time, then cuts minutes with caching, parallel jobs and skipping work that did not change.

npx workspacetemplates add ci-pipeline-speedup --tool claude-code

Writes 1 file to .claude/skills/ci-pipeline-speedup/

.claude/skills/ci-pipeline-speedup/SKILL.md31 lines · 1.5 KBFile
---
name: ci-pipeline-speedup
description: Measures where a CI pipeline spends its time, then cuts minutes with caching, parallel jobs and skipping work that did not change.
---

# CI pipeline speedup

Measure first. Optimize only the steps that dominate the run.

## Steps

1. Get timings for the last 10 to 20 runs of the main pipeline: the CI provider's CLI or API, or the run logs. Record per-job and per-step duration, and the median.
2. Rank steps by total time. Ignore anything under 5 percent of the run.
3. For each top step, find the cause: cold dependency install, rebuilt artifacts, a serial test suite, a large checkout, or an oversized image pull.
4. Apply the matching fix:
   - cache dependencies and build output, keyed on lockfile and config hashes
   - shallow checkout (`fetch-depth: 1`) unless history is needed
   - shard the test suite across parallel jobs and balance by past duration
   - path filters so docs-only changes skip the tests
   - run lint and unit tests before slow integration jobs, and cancel superseded runs
5. Re-run twice and compare the median to the baseline. A cache only shows its value on the second run.

## Rules

- Never remove a check, lower coverage or mark a flaky test as allowed-to-fail to save time. Quarantine it and report it.
- Keep a cache key specific enough that stale output cannot be restored.
- Change one thing at a time so each saving is attributable.

## Report

A table of step, before, after and change made, the new median run time, and any risk you accepted.

What it does

A slow pipeline is rarely slow everywhere. Usually two or three steps eat most of the clock, and the rest is waiting. This skill starts from timings, not hunches: it reads recent run durations, ranks the steps, and only then proposes changes.

Each change comes with an estimate of the minutes it saves and the risk it adds. Nothing that weakens a check is applied without saying so.

Example

you › Our pipeline takes 22 minutes. Find the waste.

agent › Baseline median 22m10s. Test job 12m (serial), dependency install 4m (no cache), Docker build 3m. Added npm cache (install 4m to 40s), split tests into 4 shards (12m to 3m30s) and added a path filter for docs. New median: 8m45s. Risk: shard balance needs a refresh every few weeks.

Questions

Does it need access to my CI provider?
It works from whatever you can show it: the provider CLI if installed, pasted run logs, or the workflow files alone. Real timings give better results than guesses.
What if my tests are flaky?
It reports them separately and suggests quarantining, because parallel shards make flaky tests fail more visibly, not less.
  • Deployment Strategies

    SkillDevOps and cloud

    Free