| name | PR Workflow |
| description | Use this skill when the user wants to "create PR", "update PR", "merge PR", "PR template", "auto-fill PR", "request review", or manage pull request lifecycle. Generates PR descriptions from commits/issues with intelligent defaults. |
| version | 0.1.0 |
PR Workflow
Complete PR lifecycle management with auto-generated descriptions from commits and issues.
Purpose
PR Workflow provides systematic pull request management with intelligent description generation, template selection based on work type, and automated review requests.
When to Use
- Creating PRs with auto-generated descriptions
- Using templates based on work type (feature/fix/chore/docs/refactor)
- Updating PR metadata (reviewers, labels, milestones)
- Managing PR lifecycle (draft → ready → merge)
Core Capabilities
PR Creation with Auto-Description
COMMITS=$(git log main..HEAD --oneline --no-decorate)
BRANCH=$(git branch --show-current)
ISSUE=$(extractIssueNumber "$BRANCH")
DESC=$(generatePRDescription "$COMMITS" "$ISSUE")
gh pr create --title "Add authentication system" --body "$DESC"
Utilities:
generatePRDescription(commits, linkedIssue?) - Auto-generate from commits
getPRTemplateByWorkType(workType) - Get template by type
renderPRTemplate(template, vars) - Substitute variables
groupCommitsByType(commits) - Group by conventional commit types
formatGroupedCommits(grouped) - Format as sections
Template Selection
Templates automatically adapt to work type:
Feature PR:
## Summary
Brief overview
## Changes
- Change 1
- Change 2
## Testing
- [ ] Unit tests
- [ ] Integration tests
## Related Issues
Closes #42
Bug Fix PR:
## Bug Fix
Brief description
## Root Cause
What caused it
## Solution
How we fixed it
## Testing
- [ ] Bug reproduced before fix
- [ ] Bug resolved after fix
Review Requests
OWNERS=$(grep "^$(dirname $FILE)" .github/CODEOWNERS | awk '{print $2}')
gh pr edit $PR --add-reviewer "$OWNERS"
gh pr edit $PR --add-reviewer @user1,@user2
PR Updates
gh pr edit 42 --add-label "enhancement,priority:high"
gh pr edit 42 --milestone "v2.0"
gh pr ready --undo 42
gh pr ready 42
Templates
getFeaturePRTemplate() - New features
getBugfixPRTemplate() - Bug fixes
getChorePRTemplate() - Maintenance
getDocsPRTemplate() - Documentation
getRefactorPRTemplate() - Code improvements
All templates include:
- Summary section
- Change list
- Testing checklist
- Related issues
- Claude Code footer
Examples
Create PR with Grouped Commits
COMMITS=$(git log main..HEAD --pretty=format:"%s")
GROUPED=$(groupCommitsByType "$COMMITS")
BODY=$(formatGroupedCommits "$GROUPED")
ISSUE=$(extractIssueNumber "$(git branch --show-current)")
BODY="$BODY
## Related Issues
Closes #$ISSUE"
gh pr create --title "Authentication system" --body "$BODY"
Auto-Merge When CI Passes
PR=$(gh pr create --title "..." --body "..." --json number -q .number)
gh pr merge $PR --auto --squash --delete-branch
Request Reviews from CODEOWNERS
FILE="src/auth/login.ts"
PATTERN=$(grep -E "^[^#].*$(dirname $FILE)" .github/CODEOWNERS | head -1)
REVIEWERS=$(echo "$PATTERN" | awk '{for(i=2;i<=NF;i++) print $i}' | tr '\n' ',' | sed 's/,$//')
gh pr edit $PR --add-reviewer "$REVIEWERS"
Best Practices
- Auto-generate descriptions from commits
- Use conventional commits for grouping (feat:, fix:, etc.)
- Link to issues with "Closes #N"
- Request reviews from CODEOWNERS
- Use templates matching work type
- Enable auto-merge for simple PRs
- Add preview URLs to description