Create Pull Request Dispatcher
A command template for git workflow workflows. Streamlines development with pre-configured patterns and best practices.
Create Pull Request Dispatcher
Dispatch pull request creation with template enforcement, automated checks, and multi-platform support.
When to Use This Command
Run this command when you need to:
- Create a pull request that adheres to the repository's PR template with all required sections
- Dispatch PR creation across different hosting platforms (GitHub, GitLab, Bitbucket)
- Automate the full PR lifecycle including branch push, PR creation, reviewer assignment, and label application
Consider alternatives when:
- You need a simple PR with no template requirements (use easy-create-pr instead)
- You are creating a PR through the web interface with visual diff review
Quick Start
Configuration
name: create-pull-request-dispatcher type: command category: git-workflow
Example Invocation
claude command:run create-pull-request-dispatcher --template standard --push --draft
Example Output
Branch: feature/payment-flow
Base: main
Commits: 6 commits, +342 -87 lines
Template: .github/pull_request_template.md (detected)
Pre-dispatch:
[+] Pushed branch to origin/feature/payment-flow
[+] Template sections populated:
- Issue: Fixes #234
- Why: Implements Stripe payment integration
- Review focus: Security of token handling
- Testing: Unit tests + manual Stripe test mode
- What was done: [auto-generated from commits]
Dispatched:
[+] Draft PR #156 created
URL: https://github.com/org/repo/pull/156
Reviewers: @security-team (auto from CODEOWNERS)
Labels: feature, payments, needs-review
PR #156 dispatched as draft. Convert to ready with: gh pr ready 156
Core Concepts
PR Dispatch Overview
| Aspect | Details |
|---|---|
| Template Detection | Finds and populates .github/pull_request_template.md automatically |
| Section Mapping | Maps commit metadata to template sections (issue, description, testing) |
| CODEOWNERS Integration | Auto-assigns reviewers based on changed file paths and CODEOWNERS |
| Branch Management | Pushes branch, sets upstream tracking, and verifies remote state |
| Platform Support | Works with GitHub (gh), GitLab (glab), and Bitbucket (bb) CLIs |
Dispatch Workflow
Dispatch Request
|
v
+--------------------+
| Detect Template |---> .github/pull_request_template.md
+--------------------+
|
v
+--------------------+
| Push Branch |---> git push -u origin branch
+--------------------+
|
v
+--------------------+
| Populate Template |---> Fill sections from commits/diff
+--------------------+
|
v
+--------------------+
| Resolve Reviewers |---> CODEOWNERS + explicit list
+--------------------+
|
v
+--------------------+
| Create PR |---> gh pr create with full metadata
+--------------------+
Configuration
| Parameter | Type | Default | Description |
|---|---|---|---|
| template | string | auto-detect | PR template to use: standard, minimal, or path to custom template |
| push | boolean | true | Push branch to remote before creating PR |
| draft | boolean | false | Create as draft PR for early feedback |
| platform | string | github | Target platform: github, gitlab, bitbucket |
| auto_reviewers | boolean | true | Auto-assign reviewers from CODEOWNERS file |
Best Practices
-
Use Draft PRs for Early Feedback - Create draft PRs when work is 60-80% complete to get architectural feedback before investing in polish. This prevents large rewrites late in the review cycle.
-
Populate Every Template Section - Leaving template sections blank signals that you did not think through the change. Even if a section is not applicable, mark it as N/A with a brief explanation.
-
Let CODEOWNERS Drive Reviewer Assignment - Maintain an accurate CODEOWNERS file so the right reviewers are automatically assigned. Manual reviewer selection often misses domain experts who should review the changes.
-
Push Before Creating - Always push the branch to the remote before creating the PR. Creating a PR against a local-only branch fails or creates confusion when reviewers cannot access the code.
-
Include Testing Verification - Describe how the change was tested, including manual steps and automated test results. Reviewers need confidence that the code works, not just that it compiles.
Common Issues
-
Template Sections Not Populated - The auto-population failed to map commits to template sections. Provide explicit content for required sections using the --body flag or an interactive prompt.
-
CODEOWNERS Not Found - The repository does not have a CODEOWNERS file, so no reviewers are auto-assigned. Create a CODEOWNERS file or specify reviewers explicitly with the --reviewers flag.
-
PR Created on Wrong Platform - The tool defaulted to GitHub when the repository is hosted on GitLab. Set the platform explicitly or detect it from the git remote URL.
Reviews
No reviews yet. Be the first to review this template!
Similar Templates
Git Commit Message Generator
Generates well-structured conventional commit messages by analyzing staged changes. Follows Conventional Commits spec with scope detection.
React Component Scaffolder
Scaffolds a complete React component with TypeScript types, Tailwind styles, Storybook stories, and unit tests. Follows project conventions automatically.
CI/CD Pipeline Generator
Generates GitHub Actions workflows for CI/CD including linting, testing, building, and deploying. Detects project stack automatically.