resolve-review
PR review comments → fixes → quality gates → resolved threads → updated PR. /resolve-review [N].
1. Identify the PR
gh pr view --json number,title,url,headRefName # current branch
gh pr view <number> --json number,title,url,headRefName,baseRefName # specific PR
gh repo view --json nameWithOwner --jq '.nameWithOwner' # for below
2. Fetch review comments
gh api repos/{owner}/{repo}/pulls/<number>/comments \
--jq '[.[] | {id, path, line, body, resolved: false, author: .user.login}]' # inline
gh pr view <number> --json reviews \
--jq '.reviews[] | select(.state == "CHANGES_REQUESTED") | {author: .author.login, body: .body}'
gh api repos/{owner}/{repo}/issues/<number>/comments \
--jq '[.[] | {id, body, author: .user.login}]' # general
Group by file/theme; list before touching code. Skip unclear ones.
3. Implement & commit — scope each change to its comment, read the file first
git commit -m "fix: <short description> (review comment #<comment-id>)"
4. Quality gates & rebase
npx tsc --noEmit && npm run lint && npm test
git fetch origin && git merge-base --is-ancestor origin/<base-branch> HEAD || git rebase origin/<base-branch>
Never push if a gate fails or conflicts remain.
5. Push & resolve threads
git push origin HEAD
gh api repos/{owner}/{repo}/pulls/<number>/comments/<comment-id>/replies \
-X POST -f body="Addressed in <commit-sha> — <one-line explanation>"
gh api repos/{owner}/{repo}/pulls/<number>/reviews \
-X POST -f body="All CHANGES_REQUESTED items addressed." -f event="COMMENT"
6. Update the PR description
CURRENT_BODY=$(gh pr view <number> --json body --jq '.body')
gh pr edit <number> --body "$(cat <<'EOF'
${CURRENT_BODY}
---
## Review response
| # | Comment | Resolution |
|---|---------|------------|
| 1 | @author: "..." | Fixed in <sha> |
EOF
)"
Edge cases: No open PR → ask for a number. Already resolved → skip. Design change → flag. Draft PR → push, tell user to un-draft. Resolve only fixed threads. See REFERENCE.md for language-specific quality gate commands and gh API pagination.