Git PR
Overview
Create a pull request with a title and description sized appropriately to the scope and impact of the changes using the GitHub CLI. Always includes AI attribution at the end of the body.
Arguments
Definitions
- •
[base-branch](optional): Target branch for the PR. Defaults to main/master. - •
[--draft](optional): Create the PR as a draft.
Values
$ARGUMENTS
Core Principles
- •PR size dictates description length - small changes get small descriptions
- •Title should clearly convey the primary change
- •Description focuses on WHY and context, not WHAT (diff shows the what)
- •Use
gh pr createfor PR creation - •Always include AI attribution at the end of the body
Instructions
- •
Verify current branch is not the base branch
- •
Run
git log <base>..HEAD --onelineto get commits in this PR - •
Run
git diff <base>...HEAD --statto assess change scope - •
Determine PR size category:
- •Trivial: <10 lines, single file, style/typo fix
- •Small: <50 lines, focused change
- •Medium: 50-200 lines, feature or significant fix
- •Large: >200 lines, major feature or refactor
- •
Construct PR content based on size:
Trivial/Small: Brief description with attribution
codegh pr create --title "Fix typo in README" --body "Corrects spelling error 🤖 Generated with [Claude Code](https://claude.com/product/claude-code)"
Medium/Large: Structured description with attribution
codegh pr create --title "<title>" --body "## Summary <1-2 sentence overview> ## Details - <Key change 1 with context> - <Key change 2 with context> 🤖 Generated with [Claude Code](https://claude.com/product/claude-code)"
- •
If
--draftflag is specified, add--draftto the gh command - •
Execute
gh pr createwith constructed content - •
Report the PR URL
Output Guidance
Provide a brief confirmation message:
On success:
code
PR created: https://github.com/owner/repo/pull/123 Title: Add user authentication
On error:
code
Failed to create PR: <error message from gh CLI>