- All playbooks
- Unnecessary work
- Remove repeated build steps
Remove repeated build steps
Trace artifact producers and consumers so package, release, or test stages reuse work instead of triggering the same build again.
How companies used this technique
Read what each company changed and follow the original sources.
Build release artifacts after the final version change
Stable publishing removed an early build and kept one build after prerelease exit and installation. Earlier version-PR automation removed builds from the metadata-only versioning step.
- Use it when
- A release job builds twice around version or manifest changes.
- Before applying it
- Keep the build that produces published artifacts after all version changes.
Let the package lifecycle build once
Codex Security removed the explicit build steps before pnpm pack, because the package's prepack script already runs the build.
One build per packaging job, run by prepack Source
- Use it when
- A package lifecycle hook repeats a build in the same job.
- Before applying it
- Remove the explicit build only when the exact packaging command runs the hook. Disabled hooks or a changed lifecycle would ship a stale package.
Let test and lint stages reuse the build stage
Confidence's Dockerfile ran each component's test and lint stages as siblings from the same base, so each stage compiled the source on its own. The change adds a build stage per component and derives the test and lint stages from it, letting cargo, Go and Maven reuse the compiled artifacts across six components.
In a local no-cache Docker build on an Apple M1 Max, total compute across the affected stages fell 61%, from 1807s to 712s. Source
- Use it when
- A multi-stage Dockerfile or build compiles the same source separately for its build, test and lint stages.
- Before applying it
- Test and lint now wait for the build stage. Components that need a different build profile keep their own base.
Stop rebuilding just to export artifacts
After the cached Docker build and test step, every Confidence CI run ran a second docker build to export the WebAssembly artifact to the runner, then wrote a step summary listing the artifacts. The change removes both steps from the job.
- Use it when
- A job runs a second build only to copy outputs out or print a summary that nothing downstream reads.
- Before applying it
- Check that no later step, release or reviewer uses the exported files before removing the export.
Company Playbooks
- Read Anthropic’s playbookRun only affected tests
- Read DoorDash’s playbookRun build and test in parallel, sharded across CI agents
- Read Linear’s playbookBenchmark the same job on faster hardware
- Read Mastra’s playbookStarSling runners for the slowest test workflow
- Read OpenAI’s playbookRank CI fixes by the minutes they save
- Read Ramp’s playbookMove a CPU-bound test suite to a faster CPU
- Read Shopify’s playbookLet an agent iterate against one CI metric
- Read Spotify’s playbookBuild arm64 on native arm64 runners
- Read Stripe’s playbookRun only the tests a change can reach
- Read Uber’s playbookBuild the merge-queue speculations most likely to be needed