E

Easy Create Pr

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

CommandClipticsgit workflowv1.0.0MIT
0 views0 copies

Easy Create Pr

Create well-structured pull requests with automated description generation, reviewer assignment, and issue linking.

When to Use This Command

Run this command when you need to:

  • Create a pull request with a properly formatted title, description, and issue references
  • Auto-generate a PR description from commit history and diff analysis
  • Assign reviewers, apply labels, and link issues in a single command

Consider alternatives when:

  • You need to create a draft PR for early feedback on work in progress
  • The PR requires a complex custom template specific to your organization

Quick Start

Configuration

name: easy-create-pr type: command category: git-workflow

Example Invocation

claude command:run easy-create-pr --base main --title "feat(auth): Add OAuth2 login" --reviewers alice,bob

Example Output

Branch: feature/oauth2-login -> main
Commits: 4 commits ahead of main

Pre-flight Checks:
  [OK] Branch is pushed to remote
  [OK] All commits follow conventional format
  [OK] CI checks passing on branch
  [OK] No merge conflicts with base

Pull Request Created:
  Title: feat(auth): Add OAuth2 login
  URL: https://github.com/org/repo/pull/142

  Description:
    Add Google OAuth2 authentication provider with token refresh
    and session management. Routes requiring auth are now protected
    via middleware.

    Refs GH-89

  Reviewers: @alice, @bob
  Labels: feature, auth
  Linked Issues: #89

PR #142 created successfully.

Core Concepts

Pull Request Creation Overview

AspectDetails
Title FormatConventional commit style: type(scope): description
Description GenerationSummarizes commits and diff into a structured PR body
Reviewer AssignmentAssigns reviewers from CODEOWNERS or explicit list
Issue LinkingParses commit footers for issue references and links them
Pre-flight ChecksVerifies branch state, CI status, and merge compatibility

PR Creation Workflow

  Create PR Request
       |
       v
  +-------------------+
  | Verify Branch     |---> Pushed, ahead of base, no conflicts
  +-------------------+
       |
       v
  +-------------------+
  | Analyze Commits   |---> Extract type, scope, description
  +-------------------+
       |
       v
  +-------------------+
  | Generate Body     |---> Summary, changes, issue refs
  +-------------------+
       |
       v
  +-------------------+
  | Create via gh CLI |---> gh pr create with all metadata
  +-------------------+
       |
       v
  +-------------------+
  | Assign and Label  |---> Reviewers, labels, milestones
  +-------------------+

Configuration

ParameterTypeDefaultDescription
basestringmainBase branch to merge into
titlestringauto-generatePR title (generated from branch name or commits if omitted)
reviewersstringnoneComma-separated list of GitHub usernames to request review from
draftbooleanfalseCreate as a draft pull request
labelsstringauto-detectComma-separated labels to apply (inferred from commit types)

Best Practices

  1. Explain Why, Not What - The PR description should explain the motivation and context for the change. Reviewers can see what changed in the diff; they need to understand why it changed and what alternatives were considered.

  2. Keep PRs Small and Focused - A PR with 50 changed lines gets reviewed in 10 minutes. A PR with 500 changed lines gets skimmed in 10 minutes. Break large features into reviewable increments.

  3. Request 1-3 Reviewers Maximum - Too many reviewers leads to diffusion of responsibility where everyone assumes someone else will do the thorough review. Assign the most relevant 1-3 reviewers.

  4. Link All Related Issues - Connect the PR to its tracking issue with Fixes #123 or Refs #456. This provides traceability and automatically closes issues when the PR merges.

  5. Verify CI Before Requesting Review - Push the branch and wait for CI checks to pass before creating the PR. Requesting review on a PR with failing tests wastes reviewer time and signals unpreparedness.

Common Issues

  1. PR Description Is Too Vague - The auto-generated description lacks context because commit messages were uninformative. Write descriptive commit messages or provide an explicit description with the --body flag.

  2. Merge Conflicts Appear After Creation - The base branch moved forward while the PR was in review. Rebase the branch on the latest base before requesting re-review to keep the PR mergeable.

  3. Wrong Base Branch Selected - The PR targets main when it should target a release or develop branch. Always verify the base branch before creating and use the --base flag to set it explicitly.

Community

Reviews

Write a review

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

Similar Templates