| name | update-pr |
| description | Update an existing pull request with new changes or respond to review feedback. Use when addressing PR comments, making requested changes, or updating a PR after review. |
Update Pull Request
Steps
1. Identify the PR
gh pr list --head $(git branch --show-current)
gh pr view <PR_NUMBER>
2. Fetch Review Comments
gh pr view <PR_NUMBER> --comments
gh pr diff <PR_NUMBER>
3. Address Feedback
For each review comment:
- Read and understand the feedback
- Make the necessary code changes
- Stage and commit with a descriptive message
git add -u
git commit -m "address review: <brief description>"
4. Push Updates
git push
5. Respond to Review Comments (Optional)
If you need to reply to specific comments:
gh api repos/{owner}/{repo}/pulls/<PR_NUMBER>/comments/<COMMENT_ID>/replies \
-f body="Done - updated the implementation as suggested"
Or use the GitHub web interface for complex discussions.
6. Re-request Review (if needed)
gh pr edit <PR_NUMBER> --add-reviewer <username>
Handling Common Review Requests
"Please add tests"
- Identify the appropriate test file in
packages/*/src/__tests__/
- Add test cases covering the new functionality
- Run
pnpm test to verify
"Update types"
- Check TypeScript errors with
pnpm build
- Update type definitions as needed
- Ensure no type errors remain
"Fix lint issues"
pnpm format
pnpm lint
"Update snapshots"
pnpm test:storybook:update
git add packages/*/__image_snapshots__/
git commit -m "chore: update storybook snapshots"
Squashing Commits (if requested)
If the reviewer asks to squash commits:
git rebase -i origin/main
git push --force-with-lease
Example Workflow
gh pr view 42 --comments
git add -u
git commit -m "address review: add error handling for edge case"
git push
echo "Updated PR #42 - addressed all review comments"