coreyhaines31/makerskills / skills/ci-audit
ci-audit
VerifiedWhen you want to cut GitHub Actions minutes and wait time across one repo or a whole portfolio. Measures queue, setup and run time per job, billed minutes with per-job minute rounding and the macOS 10× multiplier, and cron runs per month. Finds pipelines that have been failing quietly, ranks fixes by minutes saved, then ships them as small PRs with warm-cache before/after numbers. Triggers on "/ci-audit," "audit our CI," "why is CI so slow," "cut Actions minutes," "we're over our Actions minutes," "optimize GitHub Actions," "CI costs," "speed up CI." Not for designing CI from scratch or picking a CI vendor.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 7.5 KB |
| references/fixes.md | markdown | 5.3 KB |
| references/gotchas.md | markdown | 3.1 KB |
| scripts/ci_audit.py | script | 8.6 KB |
references/gotchas.md
View on GitHub# Gotchas
What tripped up real audits. Read before the measurement step.
## Billing
- Each **job** is billed rounded up to the whole minute. A 7-second job costs 1 minute, so a workflow with 4 tiny jobs costs 4. Minute rounding alone wasted 10–15% across one portfolio.
- macOS minutes count **10×** against the included allowance on private repos (Windows 2×). A macOS job that only checks whether anything changed still bills 10 minutes. Do the check on `ubuntu-latest` and gate the macOS job on its output (`needs:` + `if:`).
- Public repos run free on standard GitHub-hosted runners. Only private repos cost money, but speed still matters for public repos when agents wait on CI before merging.
- Billing API: `/organizations/<org>/settings/billing/usage?year=&month=` works with a normal token. The user-level equivalent needs the `user` scope (`gh auth refresh -h github.com -s user`). Without it, estimate with `ci_audit.py month`.
## Measuring
- **Look at daily durations, not 30-day averages.** A monthly cron (the 1st of the month) makes a spike that looks like a slow average.
- **A 30-day lookback misses newly added crons.** Read every `schedule:` (`ci_audit.py schedules`) and compute runs/month × billed minutes yourself.
- **The setup column in `jobs` guesses from step names.** It misfiles steps like "Run pnpm lint" as setup. Confirm the slow steps with `ci_audit.py steps <repo> <run-id>` on a recent green run.
- **Caches only pay off on the second run.** A PR's cache is scoped to its ref, so measure warm with `gh run rerun <id>`. After merge, the first push to the integration branch seeds the cache for every PR.
- Each repo gets **10 GB of Actions cache**. Delete caches from abandoned experiments (`gh cache delete`). Old setup-node caches age out on their own once nothing writes them.
- Timings are noisy (the same code measured 186 s, then 142 s). Compare across several runs.
## Waiting and tooling
- Runner queue waits of 10+ minutes happen. Wait in the background (`gh pr checks <n> --watch` or an until-loop), not with a foreground `gh run watch` that can hit an agent's tool timeout.
- `gh pr edit --body` can fail with a Projects (classic) GraphQL error. Use `gh api -X PATCH repos/O/R/pulls/N -F body=@file` instead.
- `gh issue create --body "$(cat <<EOF …)"` breaks on apostrophes. Use `--body-file`.
- "Closes #N" only fires when a PR merges into the **default** branch. Issues closed by PRs into `development` stay open until the release.
- Old job logs stay readable via `gh api repos/O/R/actions/jobs/<job-id>/logs`. Diff step lines between an old and new run to prove a change.
## Scope
- Don't cut test coverage to save minutes. Every fix keeps the same test count, and the PR body says so ("still 2478 examples, all passing").
- Don't move to paid runners or third-party CI as part of the audit. Recommend it, with numbers, and let the owner decide.
- Repos where another person or agent is actively working: file an issue with the measurement and suggested fix, don't push code.
- Security problems found along the way in **public** repos go into a private security advisory, not a public issue.
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| rea-analysis-optimizationmorluto/reaOptimize REA providers and shared analysis workflows for agent context, latency, CPU, and memory while preserving correctness and Evidence. Use for analysis bottlenecks and cache or query design; CI/test-suite optimization belongs to rea-ci-tests-audit. | Stars: 472k | Updated | Claude CodeCodex | Verified | Install |
| rea-ci-tests-auditmorluto/reaAudit REA CI and test suites for correctness, fixture drift, false passes, and measured performance; use for suite or workflow investigations and efficiency changes, rather than ordinary feature testing or a single test failure. | Stars: 472k | Updated | Claude CodeCodex | Verified | Install |
| rea-tool-designmorluto/reaAudit, investigate, design, or change REA investigation tools, CLI/MCP contracts, provider capabilities, and Evidence semantics. | Stars: 472k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-auditDietrichGebert/ponytailQuality audit of the whole repo: bugs, security, real load, missing tests, speed, and what to delete. Most important first. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |