# Speed Up Ci

CI is slow, time to green, how long do checks take, p50/p90, make CI faster, speed up a...

- Repository: https://github.com/different-ai/openwork (24362 stars)
- Category: Git and review
- License: see repository
- Last updated: 2026-11-01
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add different-ai/openwork --skill speed-up-ci -g -a claude-code -y`
Codex: `npx skills add different-ai/openwork --skill speed-up-ci -g -a codex -y`
Cursor: `npx skills add different-ai/openwork --skill speed-up-ci -g -a cursor -y`
Gemini CLI: `npx skills add different-ai/openwork --skill speed-up-ci -g -a gemini-cli -y`

## Description

CI is slow, time to green, how long do checks take, p50/p90, make CI faster, speed up a job or spec, hillclimb CI. Use to measure PR CI time, find where a job's seconds go, and land speedups one measured change at a time without weakening any check.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# Skill: Speed up CI

CI speed is a measured number, not a feeling. Measure it the same way every
time, find where the seconds actually go, change one thing, measure again,
keep it only if the number moved and every check still guards what it did.

## 1. Measure time to green

```bash
node .github/scripts/ci-time-to-green.mjs --hours 24            # all PRs
node .github/scripts/ci-time-to-green.mjs --hours 6 --branch-prefix perf/ci-x --json
```

- `required`: push → last merge-gating check green (`openwork-tests-required`, `warden-clear`).
- `full`: push → last GitHub Actions check green. "Evidence preview" is ignored (a link, not a test).
- Failed or unfinished commits are excluded from the percentiles and counted separately.

Record the baseline (p50/p90/p99 and `n`) before changing anything. Compare
p50/p90 with at least ~20 commits; one PR's run is a data point, not a trend.

## 2. Find where the seconds go

Never guess from YAML. Read the timings GitHub and the test kit already record.

```bash
# Every job and step of a run, with durations
gh run view <run-id> --json jobs --jq '.jobs[] | "\(.name)", (.steps[] | "  \(.name)")'
gh api repos/different-ai/openwork/actions/jobs/<job-id> \
  --jq '.steps[] | "\(((.completed_at|fromdate)-(.started_at|fromdate)))s \(.name)"'
# Full log (strip colours)
gh api --allow-escape-sequences repos/different-ai/openwork/actions/jobs/<job-id>/logs | sed 's/\x1b\[[0-9;]*m//g'
```

For e2e specs, download the run's `pr-proof-*` artifacts and read
`test-runs/*/test-run.json`: every `trace` entry has a `stage`, `channel`,
`verb` and `ms`. Sum `ms` by `(stage, channel, verb)`:
`world/seed/den|desktop|appWeb` is time spent starting services; `body/*` is
the test. Compare `createdAt`/`closedAt` with the first and last trace entry
to see setup and teardown the trace does not cover.

The rest: https://github.com/different-ai/openwork/blob/HEAD/.opencode/skills/speed-up-ci/SKILL.md
