C

Create Pull Request Dispatcher

A command template for git workflow workflows. Streamlines development with pre-configured patterns and best practices.

CommandClipticsgit workflowv1.0.0MIT
0 views0 copies

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

AspectDetails
Template DetectionFinds and populates .github/pull_request_template.md automatically
Section MappingMaps commit metadata to template sections (issue, description, testing)
CODEOWNERS IntegrationAuto-assigns reviewers based on changed file paths and CODEOWNERS
Branch ManagementPushes branch, sets upstream tracking, and verifies remote state
Platform SupportWorks 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

ParameterTypeDefaultDescription
templatestringauto-detectPR template to use: standard, minimal, or path to custom template
pushbooleantruePush branch to remote before creating PR
draftbooleanfalseCreate as draft PR for early feedback
platformstringgithubTarget platform: github, gitlab, bitbucket
auto_reviewersbooleantrueAuto-assign reviewers from CODEOWNERS file

Best Practices

  1. 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.

  2. 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.

  3. 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.

  4. 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.

  5. 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

  1. 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.

  2. 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.

  3. 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.

Community

Reviews

Write a review

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

Similar Templates