Polls a single GitHub repo and, each time a PR merges into the base branch, rebases exactly one other open PR — the highest-priority eligible one — onto the new base. Priority tiers, each oldest-first within the tier: (1) auto-merge enabled and approved, (2) auto-merge enabled only, (3) approved only, (4) neither. Draft PRs are never touched. Conflicts are skipped (with a PR comment) rather than blocking the rest of the queue.
See docs/superpowers/specs/2026-09-15-auto-rebase-bot-design.md for the full
design.
-
Create a GitHub App on the target repo with permissions:
Pull requests: Read & write,Contents: Read & write,Commit statuses: Read(if branch protection requires status checks to re-run, no extra permission is needed — pushes trigger CI normally). -
Install the app on the repo and note the installation ID.
-
Set environment variables:
Variable Required Default GITHUB_APP_IDyes — GITHUB_APP_PRIVATE_KEYyes — GITHUB_APP_INSTALLATION_IDyes — GITHUB_REPOyes — ( owner/repo)BASE_BRANCHno mainPOLL_INTERVAL_MSno 60000GIT_WORKDIRno .git-workdirDB_PATHno ./pr-queue.db -
npm install && npm run build && npm start
cp .env.example .envand fill in the required variables (the private key must keep its real line breaks — see the comment in.env.example).docker compose up --build
State (GIT_WORKDIR, DB_PATH) is persisted in the auto-rebase-data
named volume, mounted at /data.
npm test— unit + local-git integration tests (no network required).- Manual end-to-end verification against a real repo/App installation is a separate manual runbook, not part of automated CI (see spec's Testing Strategy section).