name: push allowed-tools: Bash(git *), Bash(gh *), Bash(devtool *) description: Commit, push, open a PR
Context
- Current git status: !
git status - Changed files (stat): !
git diff HEAD --stat - Diff (capped to 6k): !
git diff HEAD | head -c 6000 - Current branch: !
git branch --show-current - Recent commit messages (for style matching): !
git log --oneline -10
Your task
Based on the above changes:
- If there are no changes to commit, stop and tell the user.
- If on main, create a new branch with a descriptive name based on the changes. Before
git checkout -b <name>, rungit branch --list <name>andgh pr list --head <name> --state all— if the branch exists locally or the name has a closed PR, surface that to the user and ask whether to archive (rename), force-push, or pick a new name. Never silently overwrite. - Stage all relevant changes (never stage files that likely contain secrets like .env, credentials.json, etc.).
- Create a single commit with a concise, conventional commit message. End the message with:
Co-Authored-By: Claude <noreply@anthropic.com> - Push the branch to origin with
-u. - Create a pull request using
gh pr createwith a short title and a body containing:## Summarywith 1-3 bullet points## Test planwith a checklist
- Print the PR URL to the user.