with one click
commit-push
// Commit and push changes, then create or reuse a PR with optional merge
// Commit and push changes, then create or reuse a PR with optional merge
[HINT] Download the complete skill directory including SKILL.md and all related files
| name | commit-push |
| description | Commit and push changes, then create or reuse a PR with optional merge |
Commit staged/unstaged changes, push to the remote, and open or reuse a PR.
If tests are missing or the commit hook blocks due to missing tests:
/write-tests skill first, then resume commit-push.If documentation is missing or the commit hook blocks due to missing documentation updates:
/update-docs skill first, then resume commit-push.git addgit diff --cached --stat to show what will be committedgit push -u origin <branch>git pushEach git command (add, commit, push) must be a separate Bash call per rules/git.md.
settings.json model and effort fields are auto-updated by the system — exclude them from the commit if they appear in the diff.
If git push fails with "non-fast-forward" or "fetch first", retry up to 3 times.
Each command is a separate Bash call (rules/git.md — do NOT chain with &&):
git fetch origin <branch>git pull --rebase --autostash origin <branch>
— Stop if rebase reports conflicts; surface to user.git push origin <branch>Sleep between attempts: 2s before attempt 2, 5s before attempt 3.
After 3 failures, report to user — do NOT force-push, do NOT use --no-verify.
Skip if ENFORCE_WORKTREE=off — direct-main work does not use PRs.
PR resolution (idempotent):
gh pr view --json state,url
state == OPEN → reuse the existing PR URL (do NOT create a duplicate).gh pr create --fill.
Display the PR URL.First output the PR URL as a clickable markdown link in the main conversation:
PR #<N> is open: [<url>](<url>)
Then ask via AskUserQuestion: "PR # — merge, wait, or abort?"
gh pr merge --squash --delete-branch
Then: git fetch --prune origin
Note: if working from a worktree, run /worktree-end afterward for full cleanup.If AskUserQuestion is unavailable (e.g. headless claude -p), default to wait.
AskUserQuestion.git branch -D (force-delete) and --no-verify are prohibited.