Resolve all open review comments on the current PR from any automated reviewer (CodeRabbit, GitHub Copilot, etc.) or human reviewers.
Workflow
1. Identify the PR
bash
PR_NUMBER=$(gh pr view --json number --jq '.number')
If no PR exists for the current branch, stop and inform the user.
2. Fetch all unresolved review threads
Use the GraphQL reviewThreads query to get threads with isResolved status:
bash
REPO_OWNER=$(gh repo view --json owner --jq '.owner.login')
REPO_NAME=$(gh repo view --json name --jq '.name')
gh api graphql -f query="
{
repository(owner: \"$REPO_OWNER\", name: \"$REPO_NAME\") {
pullRequest(number: $PR_NUMBER) {
reviewThreads(first: 100) {
nodes {
id
isResolved
comments(first: 10) {
nodes {
id
author { login }
body
path
line
createdAt
}
}
}
}
}
}
}"
Filter to only unresolved threads. If none, report "No unresolved review threads" and stop.
3. Triage each comment
For each unresolved thread, read the comment and the referenced code. Categorize as:
Valid fix needed — the comment identifies a real bug, security issue, or meaningful improvement
Already addressed — the issue was fixed in a later commit on this branch
Not applicable — the suggestion doesn't apply (explain why)
4. Implement fixes
For all "valid fix needed" comments:
Read the referenced file and understand the context
Implement the fix
Track which thread the fix addresses
Do NOT:
Make unrelated changes or refactors
Add features beyond what the comment requests
Increase timeouts or add retries as a first approach — fix root causes
5. Run tests locally
After ALL fixes are implemented:
bash
# Type check
pnpm typecheck
# Run relevant unit tests
pnpm test
# If E2E-relevant changes were made, run E2E tests too
cd tests/e2e && pnpm exec playwright test
Do NOT proceed to commit until tests pass. If tests fail, fix the failures first.