PR Workflow
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.
What this skill does
# 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
```bash
# Get commits since base branch
COMMITS=$(git log main..HEAD --oneline --no-decorate)
# Get linked issue
BRANCH=$(git branch --show-current)
ISSUE=$(extractIssueNumber "$BRANCH")
# Generate description
DESC=$(generatePRDescription "$COMMITS" "$ISSUE")
# Create PR
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:**
```markdown
## Summary
Brief overview
## Changes
- Change 1
- Change 2
## Testing
- [ ] Unit tests
- [ ] Integration tests
## Related Issues
Closes #42
```
**Bug Fix PR:**
```markdown
## 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
```bash
# Auto-request reviewers from CODEOWNERS
OWNERS=$(grep "^$(dirname $FILE)" .github/CODEOWNERS | awk '{print $2}')
gh pr edit $PR --add-reviewer "$OWNERS"
# Or manually
gh pr edit $PR --add-reviewer @user1,@user2
```
### PR Updates
```bash
# Update labels
gh pr edit 42 --add-label "enhancement,priority:high"
# Update milestone
gh pr edit 42 --milestone "v2.0"
# Convert to draft
gh pr ready --undo 42
# Mark ready for review
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
```bash
# Get commits
COMMITS=$(git log main..HEAD --pretty=format:"%s")
# Group by type
GROUPED=$(groupCommitsByType "$COMMITS")
# Returns: { feat: [...], fix: [...], docs: [...] }
# Format as sections
BODY=$(formatGroupedCommits "$GROUPED")
# Add issue reference
ISSUE=$(extractIssueNumber "$(git branch --show-current)")
BODY="$BODY
## Related Issues
Closes #$ISSUE"
# Create PR
gh pr create --title "Authentication system" --body "$BODY"
```
### Auto-Merge When CI Passes
```bash
# Create PR and enable auto-merge
PR=$(gh pr create --title "..." --body "..." --json number -q .number)
# Enable auto-merge (squash)
gh pr merge $PR --auto --squash --delete-branch
# CI will auto-merge when checks pass
```
### Request Reviews from CODEOWNERS
```bash
# Parse CODEOWNERS for file
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/,$//')
# Request review
gh pr edit $PR --add-reviewer "$REVIEWERS"
```
## Best Practices
1. Auto-generate descriptions from commits
2. Use conventional commits for grouping (feat:, fix:, etc.)
3. Link to issues with "Closes #N"
4. Request reviews from CODEOWNERS
5. Use templates matching work type
6. Enable auto-merge for simple PRs
7. Add preview URLs to description
Related in Code Review
gstack
IncludedFast headless browser for QA testing and site dogfooding. Navigate pages, interact with elements, verify state, diff before/after, take annotated screenshots, test responsive layouts, forms, uploads, dialogs, and capture bug evidence. Use when asked to open or test a site, verify a deployment, dogfood a user flow, or file a bug with screenshots. (gstack)
startup-due-diligence
IncludedLegal due diligence review for seed-stage and Series A startups (US, Delaware C-Corp focus). Supports both investor and founder perspectives. Capabilities include: (1) Interactive document review and issue spotting; (2) Document request list generation; (3) Cap table and SAFE/convertible note analysis; (4) Red flag identification with severity ratings; (5) Diligence report generation. TRIGGERS: due diligence, DD, startup investment, cap table review, Series A, seed round, investor diligence, legal review startup, SAFE analysis, convertible note, 409A, founder vesting.
interview-master
IncludedThis skill should be used when the user asks to "generate interview questions", "prepare for interview", "optimize resume", "conduct mock interview", "analyze git commits for resume", "generate resume from code", "review my resume", or mentions interview preparation, career assistance, or extracting project experience from git history. Provides comprehensive interview and career development guidance for both job seekers and interviewers.
fix-issue
IncludedFixes GitHub issues using parallel analysis agents for root cause investigation, code exploration, and regression detection. Reads issue context from gh CLI, searches codebase and memory for related patterns, generates a fix with tests, and links the resolution back to the issue via PR. Includes prevention analysis to avoid recurrence. Use when debugging errors, resolving regressions, fixing bugs, or triaging issues.
sf-apex
IncludedGenerates and reviews Salesforce Apex code with 150-point scoring. TRIGGER when: user writes, reviews, or fixes Apex classes, triggers, test classes, batch/queueable/schedulable jobs, or touches .cls/.trigger files. DO NOT TRIGGER when: LWC JavaScript (use sf-lwc), Flow XML (use sf-flow), SOQL-only queries (use sf-soql), or non-Salesforce code.
swift-development
IncludedComprehensive Swift development for building, testing, and deploying iOS/macOS applications. Use when Claude needs to: (1) Build Swift packages or Xcode projects from command line, (2) Run tests with XCTest or Swift Testing framework, (3) Manage iOS simulators with simctl, (4) Handle code signing, provisioning profiles, and app distribution, (5) Format or lint Swift code with SwiftFormat/SwiftLint, (6) Work with Swift Package Manager (SPM), (7) Implement Swift 6 concurrency patterns (async/await, actors, Sendable), (8) Create SwiftUI views with MVVM architecture, (9) Set up Core Data or SwiftData persistence, or any other Swift/iOS/macOS development tasks.