Process a GitHub PR URL to read review comments. Use when the user wants to address PR feedback, respond to review comments, or asks to handle comments on a pull request.
Process a pull request link, read its comments, and for each comment produce either a suggested reply (when no code change is needed) or a suggested code resolution, then present each for approval.
https://github.com/vippsas/credit-af-ml/pull/188).From the URL extract:
owner (e.g. vippsas)repo (e.g. credit-af-ml)pull_number (e.g. 188)Use these for gh commands and for locating the repo locally if the workspace is that repository.
Run:
gh pr view <pull_number> --repo <owner>/<repo> --json body,comments,reviews
Parse the JSON:
body — PR description.comments — issue-level comments (each has body, author.login, createdAt).reviews — review submissions; each has body (the review text), author.login, state (e.g. COMMENTED, APPROVED).If the command fails (non-zero exit, "authentication required", or similar): do not fall back to other methods. Tell the user that GitHub authentication is required and they should run gh auth login (or gh auth refresh if already logged in), then retry the skill.
Use filtering when it is not the first round of review and some comments are already addressed.
Options (choose one or combine as user prefers):
src/foo.py” or “only the first five threads”).If the user does not specify a filter, process all comments. If they say “only new” or “only unresolved,” apply the matching filter above.
For each comment (after filtering):
When the comment is about behavior or design:
If textual response:
If code changes:
For each comment, output a single block for the user to approve:
## Comment [N]: [file path] — [one-line summary]
**Reviewer:** [author]
**Quote:** “[exact or summarized comment text]”
**Assessment:** [Valid / Partially valid / Not applicable / Nit]
**Proposed action:** [Reply only | Code change | Reply + code change]
**Draft reply (if any):**
[Text to post as a comment]
**Code resolution (if any):**
[Steps or patch description]
Ask the user to confirm each item (e.g. “Approve / Edit / Skip”) before proceeding to the next comment or before applying code changes.
After processing all (filtered) comments:
gh or git remote operations to the user per their auth preferences.