address-comments
Address Comments
Go through every unresolved review thread, unaddressed general PR comment, and unaddressed review summary on a pull request. For each, decide on one Treatment: a code change, a reply only, a follow-up ticket, or no action needed. Draft a combined plan, get your review, and then:
- Make the approved code changes, then commit and push them.
- File any follow-up tickets.
- Post the replies, then resolve the threads they fully address.
1. Resolve the PR
Optional PR number/URL argument; default to the current branch's open PR (gh pr view), the same convention /pr and /review-comments use. Stop with a clear message if neither is given and none is found.
Gather number, baseRefName, headRefName, and url via gh pr view <number> --json number,baseRefName,headRefName,url.
The <owner> and <repo> interpolated into the queries and API calls below come from url, which is https://github.com/<owner>/<repo>/pull/<number>. gh pr view resolves against the PR's base repository, so this stays correct even for a fork PR. In a fork clone gh repo view would return the fork instead. The review threads, replies, and thread resolutions all live on the base repo.
2. Set up the workspace
Work on the PR's actual branch, since this skill edits files and pushes. Check whether headRefName exists as a local branch (git branch --list <headRefName>):