Addresses PR review comments by making code changes and posting replies. Takes a PR number or auto-detects from current branch...
Read PR review comments and address them by making code changes, answering questions, or discussing feedback with the user. Post replies to acknowledge addressed comments.
Check we have a GitHub remote and are on a feature branch:
git remote -v
git status
git rev-parse --abbrev-ref HEAD
STOP if:
git remote add origin <url> first."gh pr view <number> --json headRefName"User will provide a PR number (e.g., #12 or 12), or auto-detect from current branch:
gh pr view --json number,state,title
If no PR exists for the current branch, ask the user for a PR number.
Validate the PR is open. If closed/merged, inform the user and stop.
Retrieve general PR comments:
gh pr view <number> --comments
Present the comments to the user, showing:
If no comments exist, inform the user and stop.
For each comment, work with the user to determine the appropriate action:
Present the comment clearly to the user
Ask what action to take using AskUserQuestion:
Execute the action:
gh pr commentTrack progress using TodoWrite to show which comments have been addressed
Loop until all comments are processed or user wants to stop
When posting replies to acknowledge addressed comments:
gh pr comment <number> --body "<reply>"
Keep replies concise and professional. Reference specific changes made if applicable.
After making code changes:
git add .
git status
git commit -m "<summary of changes addressing review feedback>"
git push
Report what was changed and pushed.
Summarise what was done:
DO:
DON'T:
Comment requests a code change: Implement the change, verify it works, then offer to post a reply confirming it's done.
Comment asks a question: Discuss with the user, explore the codebase if needed, then draft a reply.
Comment is unclear: Ask the user for clarification before taking action.
Multiple comments on same topic: Group them together and address as a single unit.
Disagreement with feedback: Discuss with user, then post a reply explaining the reasoning if they want to push back.