CI Wait and Merge
Block on CI, fix nits, auto-merge when green. Monitors your PR from push to merged — polls CI, classifies review comments, implements nits and minors autonomously, merges on green.
How It Works
- PR just pushed: Open, non-draft PR you want merged this session
- Poll CI until resolved: Check every 30s; STOP on failure or timeout — never auto-fix CI
- Fetch & classify reviews: CodeRabbit + Gemini — Critical · Major · Minor · Nit by severity markers
- Auto-fix trivial nits: Apply diffs, run selective tests, push fixes
- Squash-merge & delete branch: Merge once green with no Major+ unresolved, then verify MERGED state
- Merge report: CI verdict · review counts · nits fixed/skipped · MERGED + URL
Invocation Triggers
/ci-wait-and-mergewait for CImerge when greenauto mergewatch CIUse Cases
- Push a PR and come back to find it already merged
- Let an agent fix review nits while you work on something else
- Stop manually polling CI and checking for review comments
The Problem
You push a PR. CI takes 8 minutes. You switch context. 40 minutes later you remember to check — CI passed but there are 3 review comments, two of which are typos and one is a missing error message. You fix them, push again, wait 8 more minutes. This cycle repeats. The wasted time is not the CI run — it is the forgotten checks and the context switching.
What It Does
- 1Identify the open PR and CI run
Finds the current PR on the current branch, locates the CI run via gh CLI.
- 2Poll CI until resolved
Checks status every 60 seconds, surfaces immediately on failure, continues on pass. Configurable timeout — defaults to escalating after 20 minutes.
- 3Triage CI failure if it occurs
If CI fails, classifies the failure (test failure, lint error, build error), routes to the appropriate fix strategy, implements the fix and re-pushes.
- 4Fetch and classify review comments
Pulls all review comments, classifies each as nit (typo, formatting, minor naming) / minor (small logic improvement, missing test, rename) / major (architecture, security, design issue). Implements nits and minors autonomously.
- 5Merge when green
Once CI is green and no Major+ unresolved comments remain, merges the PR with squash and deletes the branch. Produces a summary of what was done.
What You Get / What It Doesn't Do
- CI monitored to completion without polling
- Nit and minor review comments resolved autonomously
- PR merged with branch cleaned up
- Summary of what was fixed vs what was left for human judgment
- Fix failing tests that require new logic — that is quality-team
- Resolve Major+ review comments that need product judgment
- Merge if there are unresolved Major+ comments
- Handle PRs with merge conflicts
Tips
The window between push and merge is dead time. Don't come back to check — let it run.
If a reviewer flags an architectural concern, that's your judgment call — not an autonomous fix.
If CI takes more than 20 minutes, it is surfaced rather than blocking indefinitely.
Get the Skill
Unlock the full CI Wait and Merge SKILL.md — drop it into ~/.claude/skills/ and trigger it by name.
- CI monitored to completion without polling
- Nit and minor review comments resolved autonomously
- PR merged with branch cleaned up
- Summary of what was fixed vs what was left for human judgment
Commonly Used With
29 more production skills ready to install.