Engineering

CI Optimization

Attack one CI bottleneck at a time until the target is met or the bottleneck report is more valuable than another tweak.

Use when

The team is waiting on CI long enough that it changes behavior.

Cadence

Monthly or when CI is painful

Verification

CI p50/p95 improves against the same workflow without weakening tests or hiding failures.

Advanced spec

Structured loop spec

FieldValue
NameCI Optimization
CategoryEngineering
TriggerMonthly or when CI is painful
ObjectiveAttack one CI bottleneck at a time until the target is met or the bottleneck report is more valuable than another tweak.
Allowed inputsRelevant files, source notes, logs, tests, screenshots, metrics, or task state for this loop
Allowed actionsMeasure current job and step timing.; Rank bottlenecks by cost and safety.; Optimize one bottleneck with the smallest credible change.; Rerun CI or a faithful local equivalent.; Stop at the target or when no safe gain remains.
VerificationCI p50/p95 improves against the same workflow without weakening tests or hiding failures.
Stop conditionStop when the verifier passes, the budget is exhausted, no progress is made, a blocker appears, or approval is required.
BudgetSet a time, turn, token, retry, file, or dollar cap before running the loop.
Approval boundaryHuman approval required before public, destructive, financial, legal, account, or production-impacting actions.
Safe outputPull request, patch, report, or evidence log
Works withClaude Code, OpenAI Codex, Cursor, Gemini CLI, any tool-using coding agent
Runbook

Steps

  1. Measure current job and step timing.
  2. Rank bottlenecks by cost and safety.
  3. Optimize one bottleneck with the smallest credible change.
  4. Rerun CI or a faithful local equivalent.
  5. Stop at the target or when no safe gain remains.
Copy prompt

Prompt

Reduce CI p50/p95 duration for the selected workflow by the target amount without weakening tests. Measure first, optimize one bottleneck at a time, rerun verification, and finish with before/after timings plus remaining blockers.
Metadata

Tags

CIperformancetestingbottlenecks
Next loops

Related