PR Workflow
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
# 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 commitsgetPRTemplateByWorkType(workType)- Get template by typerenderPRTemplate(template, vars)- Substitute variablesgroupCommitsByType(commits)- Group by conventional commit typesformatGroupedCommits(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
# 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
# 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 featuresgetBugfixPRTemplate()- Bug fixesgetChorePRTemplate()- MaintenancegetDocsPRTemplate()- DocumentationgetRefactorPRTemplate()- Code improvements
All templates include:
- Summary section
- Change list
- Testing checklist
- Related issues
- Claude Code footer
Examples
Create PR with Grouped Commits
# 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
# 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
# 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
- 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
More from constellos/claude-code-plugins
feature-sliced design
This skill should be used when the user asks to "implement FSD", "use Feature-Sliced Design", "organize architecture", "structure project folders", "set up FSD layers", "create feature slices", "refactor to FSD", "add FSD structure", or mentions "feature slices", "layered architecture", "FSD methodology", "architectural organization", "views layer", "entities layer", "shared layer", "Next.js with FSD", or "Turborepo FSD structure". Provides comprehensive guidance for implementing Feature-Sliced Design methodology in Next.js applications with custom 'views' layer naming.
34ui wireframing
This skill should be used when the user asks to "create a wireframe", "design a layout", "plan UI structure", "sketch component layout", "create WIREFRAME.md", "mobile-first wireframe", or mentions ASCII wireframes, layout planning, or UI structure before implementation. Provides mobile-first ASCII wireframe methodology for visualizing layouts before code.
6supabase local development
This skill should be used when the user asks to "start supabase locally", "set up local supabase", "run supabase dev", "initialize supabase project", "configure local database", "start local postgres", "use supabase CLI", "generate database types", or needs guidance on local Supabase development, Docker setup, environment configuration, or database migrations.
6ui interaction
This skill should be used when the user asks to "add client interactivity", "implement form validation", "add event handlers", "use client state", "add Zod validation", "implement React hooks", "add local state", "make component interactive", "add form with validation", "use React Hook Form", or needs guidance on client-side events, form handling, optimistic updates, or when to add "use client" directive.
4ui design
This skill should be used when the user asks to "create a component", "build static UI", "design with TypeScript", "use compound components", "implement contract-first UI", "create React component", "build with Shadcn", or mentions TypeScript interfaces for components, compound component patterns, or Server Components. Provides contract-first static UI methodology with compound components.
4ui integration
This skill should be used when the user asks to "add server action", "implement Supabase query", "connect to backend", "add database integration", "implement RLS", "use server actions", "add data mutation", "implement CRUD operations", "revalidate path", "add authentication check", or needs guidance on server-side integration, defense-in-depth security, or type-safe database queries with Supabase.
4