con un clic
review-comments
// Fetch PR review comments, address each one in code, and post resolution replies
// Fetch PR review comments, address each one in code, and post resolution replies
| name | review-comments |
| description | Fetch PR review comments, address each one in code, and post resolution replies |
| argument-hint | [pr-number] |
Fetch all review comments from a pull request, address each one (fix code, add docs, or explain the rationale), and reply to each comment on GitHub with the resolution.
Fetch comments — use gh api to get all review comments:
gh api repos/{owner}/{repo}/pulls/$ARGUMENTS/comments \
--jq '.[] | {id, path, line, body, in_reply_to_id}'
Filter to top-level comments only (in_reply_to_id == null) — those are the
ones that need responses.
Understand each comment — read the referenced file and line to understand the concern. Group related comments if they touch the same issue.
Address each comment — make the appropriate code change (fix, refactor, add docs, add tests). If you disagree with a suggestion, prepare a clear rationale.
Reply to each comment — post a reply using:
gh api repos/{owner}/{repo}/pulls/$ARGUMENTS/comments -X POST \
-f body="<resolution>" \
-F in_reply_to=<comment-id>
Keep replies concise: state what was done (e.g., "Fixed. Replaced generic fallback with explicit throw.") or explain why it was left as-is.
Verify — run analyzer and affected tests to confirm all changes compile and pass.