CPR - Commit, Push, PR
Full git workflow: commit all changes, push to remote, and create a pull request.
Process
- •Review the injected git diff stats and branch info (already precomputed above)
- •If there are uncommitted changes:
a. Stage all changes (
git add -A) b. Generate a commit message following conventional commits format:type(scope): descriptionc. If user provided an argument, use it as the commit message d. Commit the changes - •Push to remote (
git push -u origin <current-branch>) - •Create PR using
gh pr create: a. Generate a concise PR title (under 70 chars) b. Generate PR body with summary bullets and test plan c. Use the base branch (main or master)
PR Body Format
code
gh pr create --title "the title" --body "$(cat <<'EOF' ## Summary - <bullet points summarizing changes> ## Test plan - [ ] <verification steps> 🤖 Generated with [Claude Code](https://claude.com/claude-code) EOF )"
Rules
- •If already on main/master, create a feature branch first from the diff context
- •If no changes to commit, just push existing commits and create PR
- •If a PR already exists for this branch, just push (no duplicate PR)
- •Use
gh pr createnot the GitHub API directly - •Always set upstream with
-uflag on push - •Keep PR title short, use body for details