Commit push pr
Skill ZunoSmartLabs/zsl-superpowers/skills/engineering/commit-push-pr
Commit session changes, push the branch, and open a PR — in one shot. Refuses to run on the repo's default branch (main/master) so the PR step can't fail. Delegates the commit step to `/zsl:commit`, then pushes with `-u`, then opens the PR via `gh`. Use when user wants to ship a feature branch end-to-end, says "/commit-push-pr", or asks to commit, push, and open a PR.From its SKILL.md
npx -y skills add ZunoSmartLabs/zsl-superpowers --skill commit-push-prAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 3 stars3 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
4.5 KB, as published. Nobody here has run it
Commit, Push, Open PR
One-shot shipping for a feature branch: commit → push → PR.
The commit step is delegated wholesale to /zsl:commit — same rules (autonomous for session changes, explicit file lists, no Claude attribution). The novel work here is the pre-flight branch check and the push + PR open after the commit lands.
Pre-flight: not on the default branch
The PR step would fail on main/master — you can't open a PR from a branch into itself. Check before committing so the user isn't left committed-but-undeliverable.
git rev-parse --abbrev-ref HEAD→ current branch.git symbolic-ref refs/remotes/origin/HEAD --short 2>/dev/null | sed 's|^origin/||'→ remote default branch. Fall back tomain, thenmaster, if that returns nothing.- If current branch equals the default branch, stop immediately. Surface the mistake and suggest
/zsl:git-branch <description>to create a properly-prefixed feature branch. Do not proceed to the commit.
If the working tree is clean and the branch has no unpushed commits, also stop — there's nothing to ship.
Process
-
Run the pre-flight branch check. Stop if on the default branch.
-
Delegate to
/zsl:commit. Follow that skill's full process: classify session vs other-origin changes, confirm only the other-origin bucket, plan the commit(s), execute with explicit file lists. If/zsl:commithalts (user declines an other-origin file, hook fails, etc.), halt here too — don't push a half-shipped state.Skip this step if the working tree is clean but the branch has unpushed commits — go straight to push.
-
Push with upstream.
git push -u origin <current-branch>-usets the upstream so subsequentgit push/git pullwork without arguments. Harmless if the branch already tracks.If push fails (non-fast-forward, hook reject, auth), surface the error verbatim and stop. Never
--force. Never--no-verify. -
Open the PR.
gh pr create --title "<title>" --body "<body>"- Title: derive from the branch name (strip the
feature//fix//etc. prefix, replace hyphens with spaces, sentence-case) or the latest commit subject, whichever reads better. Keep under 72 chars. - Body: short why summary (1–3 bullets) plus a
## Test planchecklist. Multi-line via heredoc. If.github/pull_request_template.mdexists, follow its shape. - No Claude attribution. No
🤖 Generated with…, noCo-Authored-By:. Same rule as/zsl:commit. - If a PR for this branch already exists,
gh pr createfails; fall back togh pr view --json url -q .urland report the existing PR URL. - If the repo has an auto-PR workflow (
.github/workflows/auto-pr.yml) and the push already created the PR, skip thegh pr createand just resolve the URL.
- Title: derive from the branch name (strip the
-
Report. One line: PR URL. Done.
Safety rails
- Never force-push. If the remote rejects, stop and let the user resolve.
- Never
--no-verify. Pre-push hooks exist for a reason — fix the issue, re-run. - Don't open against a release branch by accident.
gh pr createdefaults to the repo's base; if that'smainbut the user's flow usesdevelopor a release branch, ask before opening. - Don't re-litigate the commit grouping.
/zsl:commitowns that decision.
When to use a different skill
- Just committing, no push/PR? →
/zsl:commit. - Need a branch first? →
/zsl:git-branch, then this skill. - Pre-PR review pass? →
/zsl:code-reviewbefore this; fix findings, then run this.
Why this shape
- Pre-flight before commit because committing on
mainis harder to unwind than refusing up front. Onegit rev-parsesaves a futuregit reset. - Delegate to
/zsl:commitrather than re-implementing the commit rules — keeps the no--A, no-attribution, other-origin-confirmation logic in one place. -u originon push because half of "push failed" reports trace back to a branch with no upstream. Setting it once costs nothing.