The modern merge queue solution

Speed up your CI and merge with agents

Merge the moment PR checks pass. When main breaks, an agent finds the cause and opens the repair PR. No queue, no rebuilds, no waiting.

Build your software factory

CI cost
⅓ the spend
Merge speed
2× faster
Pull requests merge straight into main, and Turnstile repairs main when it breaks A steady stream of pull requests passes its own checks and merges directly into main. One merge breaks main. Pull requests keep merging while the Turnstile agent finds the cause and opens a repair pull request. The repair merges and main is green again. main agent repairs main

Setup

Get Turnstile running in six steps

Turnstile enforces from day one. PRs merge as soon as their own checks pass, and when main breaks, an agent finds the cause and opens the fix.

Before you start

  • Your CI runs on GitHub Actions for pull_request and for pushes to the default branch.
  • You’re an admin on the repo.
  • You have Node.js installed, for npx.
  • You have an Anthropic API key for the repair agent.
  1. Install

    Install the GitHub App

    Choose the repo you want to speed up. Turnstile reads your recent CI runs to learn what’s already broken on main.

    Install on GitHub
  2. Install

    Generate the setup PR

    In a local checkout of the repo, run:

    npx @withturnstile/cli setup --server https://<your Turnstile host>

    This command:

    • reads which checks your default branch requires today,
    • adds a turnstile-verdict job to each CI workflow,
    • adds a .github/turnstile.yml config file,
    • opens a PR with those changes and a checklist you’ll use in step 5.

    Don’t merge it yet. Steps 3 and 4 add to the same PR.

  3. Repair agent

    Add the repair agent

    When main breaks, this agent finds the commit that broke it and opens a fix PR.

    • Copy the repair workflow into .github/workflows/ on the setup PR’s branch. Set its install command so the agent can run your tests.
    • In the repo’s Settings → Secrets and variables → Actions, add your Anthropic API key as ANTHROPIC_API_KEY.
  4. Configure

    Turn on enforcement and repairs

    On the same branch, set these in .github/turnstile.yml:

    mode: enforce
    fix:
      enabled: true

    Small repair PRs, under 20 changed lines by default, merge on their own once Turnstile passes them. Larger ones stay open and tag the author of the change that broke main. To review every repair by hand, add auto_merge_under_lines: 0 under fix.

    Now merge the setup PR.

  5. Branch rules

    Update your branch protection

    For your default branch, make these changes. The setup PR lists the exact check names:

    • Require the Turnstile verdict checks.
    • Stop requiring the CI checks they cover. Those keep running and still show on PRs.
    • Turn off the merge queue.
    • Turn off Require branches to be up to date before merging.
    • In the repo’s general settings, turn on Allow auto-merge so small repairs can merge.

    To roll back, restore your old required checks and set mode: observe and fix.enabled: false.

  6. Maintain

    Keep the checks in sync

    Whenever you add or remove a CI job, run:

    npx @withturnstile/cli sync

    Put it in a pre-commit hook or your AGENTS.md so nobody has to remember.

Prefer a single check? Skip the CLI in steps 2 and 6. Commit .github/turnstile.yml yourself with your CI workflows listed under workflows:. Then in step 5, require the App’s turnstile check instead.