Gh Pr Comment Fixer
Overview
Use the gh CLI to retrieve PR review comments for the current branch, apply fixes, verify with the full test suite, and resolve the review threads after pushing.
Workflow
- •
Identify the PR for the current branch.
- •Prefer
gh pr view --json number,headRefNameand confirm it matches the branch.
- •Prefer
- •
Retrieve review threads and comments.
- •Use
gh pr view --json reviewThreadsandgh pr view --json comments. - •Summarize the requested changes and note any questions or ambiguities.
- •Use
- •
Evaluate each comment.
- •Decide if it is reasonable, needs clarification, or should be declined.
- •If clarification is needed, ask before changing code.
- •
Implement fixes.
- •Make minimal, targeted edits.
- •Add or update tests if the change warrants it.
- •Keep commit scope aligned with a single comment or logical group.
- •
Run the full test suite.
- •Use the repo standard test command unless instructed otherwise.
- •Report failures and decide whether to continue or request input.
- •
Commit and push fixes.
- •Use a conventional commit message.
- •Mention which comments were addressed.
- •
Resolve review threads.
- •Use
gh pr review --commentfor replies andgh apiorgh pr reviewto resolve threads. - •Resolve only after the fix is pushed.
- •Use
Notes
- •Prefer
gh pr viewandgh pr diffover manual web browsing. - •If no PR exists for the current branch, ask the user to open one or provide a PR number.