| name | fix-pr |
| description | Fix CI failures and implement CodeRabbit feedback on the current PR |
| disable-model-invocation | true |
| allowed-tools | Bash(gh *) Bash(git *) Bash(bun *) |
Fix PR
You are iterating on a pull request until CI is green and CodeRabbit is satisfied.
The current branch is already pushed and a PR exists.
PR context
- PR info: !
gh pr view --json number,title,url,headRefName,statusCheckRollup 2>/dev/null || echo "No PR found on current branch"
- CI status: !
gh pr checks 2>/dev/null || echo "No checks found"
Step 1: Fix CI failures
- Run
gh pr checks to see check status.
- If any checks failed, inspect the failing logs with
gh run view <run-id> --log-failed.
- Fix the issues, run
bun lint && bun typecheck locally to verify.
- Commit the fixes (conventional commits) and push.
- Wait for CI to pass by polling
gh pr checks (sleep 30s between polls, max 10 min).
- If CI still fails, repeat from step 2.
Step 2: Wait for CodeRabbit review (round 1)
- Poll for a CodeRabbit review using
gh pr view --json reviews — look for a review from coderabbitai[bot].
- Also check for CodeRabbit review comments with
gh api repos/{owner}/{repo}/pulls/{number}/comments and filter for user login coderabbitai[bot].
- Sleep 30s between polls, max 15 min total.
Step 3: Implement CodeRabbit feedback
- Read all CodeRabbit comments carefully.
- For each piece of feedback, decide whether you agree:
- Agree: implement the change.
- Disagree: leave a reply explaining why you disagree.
- Nitpick/style-only with no clear improvement: skip silently.
- After addressing all feedback, run
bun lint && bun typecheck.
- Commit (conventional commits) and push.
Step 4: Wait for CI + CodeRabbit (round 2)
- Wait for CI to pass (same polling as step 1).
- Fix any new CI failures.
- Wait for CodeRabbit's second review (same polling as step 2, max 15 min).
- Read the new comments. If there are actionable items, implement them, commit, and push.
- Report a summary of what was done.
Rules
- Use
gh api for fetching PR comments/reviews when gh pr view doesn't give enough detail.
- Always run
bun lint && bun typecheck before committing.
- Keep commits small and focused — one commit per logical fix.
- Never force-push.
- When sleeping/polling, tell the user what you're waiting for.