Create a pull request with contextual title and description
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.
[--draft] (optional): Create the PR as a draft.[base-branch] (optional): Target branch for the PR. Defaults to main/master.Arguments: $ARGUMENTS
gh pr create for PR creationVerify current branch is not the base branch
Push current branch to remote if needed
Fetch the latest remote base branch: git fetch origin <base>
Run git log origin/<base>..HEAD --oneline to get commits in this PR
Run git diff origin/<base>...HEAD --stat to assess change scope
Determine PR size category:
Construct PR content based on size:
Trivial/Small: Brief description with attribution
gh 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
gh 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 --draft flag is specified, add --draft to the gh command
Execute gh pr create with constructed content
Report the PR URL
Provide a brief confirmation message:
On success:
PR created: https://github.com/owner/repo/pull/123
Title: Add user authentication
On error:
Failed to create PR: <error message from gh CLI>