P

Pro PR Creation Workflow Launcher

Professional-grade command designed for create well-structured pull requests. Built for Claude Code with best practices and real-world patterns.

CommandCommunitygit workflowv1.0.0MIT
0 views0 copies

Pro PR Creation Workflow Launcher

Automates the entire pull request creation workflow including branch naming, commit organization, PR description generation, and reviewer assignment.

When to Use This Command

Run this command when you need to:

  • Create a well-structured pull request with auto-generated description summarizing all commits, files changed, and testing notes
  • Enforce team PR conventions including branch naming patterns, required labels, reviewer assignment rules, and description templates
  • Streamline the PR creation process from multiple commits into a clean, reviewable changeset with proper documentation

Consider alternatives when:

  • You need to create a simple PR with a single commit and no special formatting requirements
  • Your CI/CD pipeline already handles PR creation automatically from merge events

Quick Start

Configuration

name: pro-pr-creation-workflow-launcher type: command category: git-workflow

Example Invocation

claude command:run pro-pr-creation-workflow-launcher --base main --title "Add user authentication"

Example Output

PR Creation Workflow
====================
Branch: feature/add-user-authentication
Base: main
Commits: 7 (squash-ready)

Generated PR Description:
  ## Summary
  Implements JWT-based user authentication with login, registration,
  and token refresh endpoints.

  ## Changes
  - Added auth middleware (src/middleware/auth.ts)
  - Created user model with bcrypt hashing (src/models/user.ts)
  - Added login/register API routes (src/routes/auth.ts)
  - Added JWT utility functions (src/utils/jwt.ts)
  - Added 12 unit tests for auth flows

  ## Test Plan
  - [x] Unit tests passing (12/12)
  - [ ] Manual login flow verification
  - [ ] Token expiration edge cases

Reviewers assigned: @backend-team (2 required)
Labels: feature, auth, needs-review

PR created: https://github.com/org/repo/pull/142

Core Concepts

PR Workflow Overview

AspectDetails
Branch NamingEnforces consistent naming conventions (feature/, bugfix/, hotfix/) derived from the PR title or linked issue
Commit AnalysisScans all commits since branch divergence to generate a structured summary of changes grouped by category
Description TemplatesApplies team-specific PR templates with auto-populated sections for summary, changes, test plan, and screenshots
Reviewer AssignmentAssigns reviewers based on CODEOWNERS rules, file path ownership, and team rotation schedules

PR Creation Workflow

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  Analyze     │────▢│  Generate    │────▢│  Assign      β”‚
β”‚  Commits     β”‚     β”‚  Description β”‚     β”‚  Reviewers   β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜     β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜     β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
       β”‚                    β”‚                     β”‚
       β–Ό                    β–Ό                     β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  Apply       │────▢│  Create PR   │────▢│  Post-Create β”‚
β”‚  Labels      β”‚     β”‚  via GitHub  β”‚     β”‚  Notificationsβ”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜     β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜     β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Configuration

ParameterTypeDefaultDescription
basestringmainTarget branch for the pull request merge
titlestring-PR title (auto-generated from branch name if omitted)
templatestringdefaultPR description template name from .github/PULL_REQUEST_TEMPLATE/
auto_labelbooleantrueAutomatically apply labels based on changed file paths and commit types
reviewersstringautoReviewer assignment: auto (CODEOWNERS), team name, or comma-separated usernames

Best Practices

  1. Link Issues in PR Description Include issue references (Closes #123) in the generated description so GitHub automatically closes linked issues when the PR merges. The command detects issue numbers in commit messages and branch names to populate these references.

  2. Use Squash-Ready Commit Organization Before creating the PR, the command can group related commits and suggest a squash strategy. This produces a cleaner merge history while preserving the detailed commit log in the PR conversation for reviewers.

  3. Configure Team-Specific Templates Create multiple PR templates in .github/PULL_REQUEST_TEMPLATE/ for different change types (feature, bugfix, hotfix, docs). The command selects the appropriate template based on branch prefix and commit message patterns.

  4. Include Test Coverage Delta The command can run coverage analysis and include the delta in the PR description. Reviewers immediately see whether the changes improved or degraded test coverage without waiting for CI to complete.

  5. Add Screenshots for UI Changes When the PR modifies frontend components, the command prompts for screenshot attachments and formats them as before/after comparisons in the description. This accelerates visual review without requiring reviewers to check out the branch locally.

Common Issues

  1. CODEOWNERS file not found for reviewer assignment The auto reviewer assignment requires a CODEOWNERS file in .github/ or the repository root. Create this file mapping directory paths to team handles so the command can assign appropriate reviewers based on which files changed.

  2. Branch name conflicts with existing remote branch If the generated branch name already exists on the remote, the command appends a numeric suffix. Check for stale remote branches with git branch -r and clean up merged branches to reduce naming collisions.

  3. PR description exceeds GitHub character limit Very large PRs with hundreds of file changes can generate descriptions exceeding GitHub's 65,536 character limit. The command truncates the file list and adds a summary count when this threshold is approached. Consider splitting large PRs into smaller, focused changesets.

Community

Reviews

Write a review

No reviews yet. Be the first to review this template!

Similar Templates