- All playbooks
- Validate every new agent commit
Validate every new agent commit
Run required checks for the latest agent-produced commit and make decisions from that commit’s results.
How companies used this technique
Read what each company changed and follow the original sources.
Run the existing test suite on every agent commit so new commits cannot break existing code
Anthropic added a continuous integration pipeline with stricter enforcement to its C compiler project, so every new commit from the agent team is tested against existing behavior and cannot break existing code. Bun's Rust port used the same gate at larger scale: the project's pre-existing test suite, run in CI on all platforms, decided when the port could merge.
Over nearly 2,000 Claude Code sessions and $20,000 in API costs, the agent team produced a 100,000-line compiler that can build Linux 6.9 on x86, ARM, and RISC-V. Source
- Use it when
- Agents commit or open many pull requests, and existing behavior changes between merges.
- Before applying it
- Give agents a faster sampled run for their inner loop and keep the full suite as the merge gate, so the gate stays the same check for every agent and every platform.
Re-run CI on every new head and act only on that head's verdict
Translated to GitHub Actions
- What Shopify built
- River, Shopify's AI agent in Slack, rebases pull requests and retriggers CI on each new head, then waits for the verdict on that head.
- Your GitHub Actions version
- Re-run CI on every new head and act only on the verdict for that head.
Shopify's River, its AI agent in Slack, compares its work ledger with the live repository, pull request and tracker state before it acts on any item. In one batch of eight dependency pull requests River rebased seven and retriggered CI on each new head. The lockfile on the repository head had moved while the upgrades sat in review, so River grafted each upgrade into the current lockfile and left each branch's own copy behind. Each rebase made a new commit, so the CI-passed notifications that arrived moments after a force-push belonged to the earlier heads, and River waited for the real verdicts. Six of the seven came out green and went to their stewarding teams needing only an approval.
2026: Security merges through Shopify's freshness-gated merge queue went from about 10% to 80% since launch. Source
- Use it when
- Dependency or security pull requests sit in review while the default branch and its lockfile move.
- Before applying it
- A branch that a person has taken over, or that has an open review, goes back to its author untouched.
- GitHub Actions adaptation
- Compare the source system with your own workflow before applying this translation.
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