| name | update-pr |
| description | Updates an existing pull request with new changes, commits, and optionally revises the PR description. Activate when the user asks to update, fix, or add to an existing PR. Also activate when the user says "update the PR", "fix the PR", "add this to the PR", or any variation of modifying an existing pull request.
|
Update Pull Request Skill
When to Use
Activate when the user says:
- âUpdate the PRâ
- âFix the PR based on feedbackâ
- âAdd this to the PRâ
- âPush these changes to the PRâ
- âUpdate the PRÂ descriptionâ
Do NOT use for:
- Creating a new PR (use
pr-creation skill)
- Reviewing a PR (
gh pr view)
- Merging a PR (
gh pr merge)
Workflow
1. Verify PR Exists and Is Open
gh pr view --json number,state,title,url
If no PR exists, ask if they want to create one (/pr-creation). If merged or closed, ask what to do.
2. Make Changes
Implement the requested updates following the userâs instructions.
3. Commit Changes
Use the /commit skill to create conventional commits:
/commit
4. Check DeepSource
Run bash scripts/check_deepsource_pr.sh (or deepsource issues --pr <N> --output json) and address any findings before pushing. DeepSource is no longer a pre-push gate, so this step is your responsibility.
5. Push Updates
git push
6. Update PR Title and Description
After pushing, dynamically update the PR to reflect all changes (not just the latest commit):
-
Run git diff $CLAUDE_CODE_BASE_REF...HEAD and git log $CLAUDE_CODE_BASE_REF..HEAD --oneline to see the full scope
-
Check for CONTRIBUTING.md, .github/PULL_REQUEST_TEMPLATE.md, or similar PR description guidance in the repoâif found, adapt the description to follow the repositoryâs conventions
-
Read .claude/skills/pr-creation/pr-templates.md for the PR template format and merge with any repo-specific guidance
-
Rewrite the title and body to accurately describe the current state of the PR:
gh pr edit <pr-number> --title "<type>: <updated description>" --body "$(cat <<'EOF'
<updated body using template from pr-templates.md>
EOF
)"
-
The title and summary should reflect the totality of the PR, not just the new changes
7. Verify CI (with 15-minute timeout)
timeout 15m gh pr checks --watch || true
If checks fail, fix issues and repeat steps 3â5.
8. Report Result
Confirm the PR is updated and provide the URL.
Example
User: âFix the type error in the PRâ
Actions: Verify PR exists â Fix type error â /commit â Push â Update PR title/description â Verify CI â Report URL
Error Handling
- No PR for branch: Ask if they want to create one (
/pr-creation)
- PR merged/closed: Ask user what to do (donât modify merged PRs)
- CIÂ fails: Fix issues, push again, and update the PRÂ description