/cpr:cprfrom cpr
User-invokable only via /cpr. Commit, Push, and Release in one command. Commits all changes as non-interactive micro-commits (conventional commits), pushes to remote, runs a review-and-fix loop on the pushed changes, then handles the full release-please cycle: waits for the PR, merges it, and monitors the release workflow to completion. Do NOT auto-trigger this skill.
Ships in cpr. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Fire-and-forget workflow: commit -> push -> review -> release-please. The entire pipeline runs in the background so you can keep working.
Spawn a single background Agent with model: "sonnet" and run_in_background: true containing the full pipeline prompt below. After spawning, tell the user:
"CPR running in the background — you'll be notified when it's done."
Then stop. Do not block the conversation.
When the agent completes, relay its summary to the user.
Provide all of the following as the agent's prompt. Fill in the current branch name before dispatching.
You are running the CPR (Commit, Push, Release) pipeline. Execute each step sequentially. If a step fails, report the error and stop — do not continue to the next step.
Run these four commands in parallel to understand the repo state:
git statusgit diffgit diff --cachedgit log --oneline -10If there are no changes at all (nothing unstaged, staged, or untracked), skip to Step 2 — there may still be unpushed commits.
Otherwise, group related files into logical commits:
For each group, stage the specific files and commit with a conventional commit message that matches the style visible in git log:
feat(scope): description for new featuresfix(scope): description for bug fixesrefactor(scope): description for restructuringchore(scope): description for maintenanceRules:
--no-verify — always let git hooks runDetermine the current branch and push:
git pushgit push -u origin <branch>If push fails, report the error and stop.
Always runs, regardless of branch or release-please configuration. Bounded loop — max 2 iterations.
Pick the diff range based on the branch:
git fetch origin
BASE=$(gh repo view --json defaultBranchRef --jq '.defaultBranchRef.name')
RANGE="origin/${BASE}...HEAD"
git fetch --tags
LAST_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "")
RANGE="${LAST_TAG:+$LAST_TAG..}HEAD"
If no tag exists, fall back to the last 20 commits: RANGE="HEAD~20..HEAD".Inspect the range:
git log --oneline "$RANGE"
git diff "$RANGE"
If the diff is empty, skip to Step 4.
Spawn foreground (blocking), review-only — do not let the sub-agent edit files:
subagent_type: general-purposedescription: "Review pushed changes"prompt: give the sub-agent the branch name, the range, and the diff output. Ask it to return a structured summary with three lists:
blockers — correctness bugs, security issues, data-loss risks, clearly broken codewarnings — risky patterns, missing tests for critical paths, questionable designnits — style, naming, minor polish
Each item must include file:line and a one-line description. End with an explicit line: VERDICT: PASS (no blockers) or VERDICT: FIX_REQUIRED (one or more blockers).PASS: record the verdict and any warnings/nits, then proceed to Step 4.FIX_REQUIRED:
blockers. Do not touch warnings or nits — they go in the final summary.fix(review): <short description>). Same grouping rules as Step 1. Using fix: also ensures release-please picks them up on main.git push. On main, this updates the release-please PR automatically; on a feature branch, it updates the open PR (if any).RANGE and re-run the sub-agent review.Gate check — all three conditions must be true to proceed:
main or master.release-please-manifest.json existsrelease-please-config.json exists.github/workflows/*.yml file contains the string "release-please"If any condition fails, skip to Step 5.
The push to main triggers a GitHub Actions workflow that creates (or updates) a release-please PR. Poll for it:
gh pr list --label "autorelease: pending" --json number,title,url --limit 1
Check every 15 seconds for up to 5 minutes. If the PR already exists when you first check, proceed immediately.
If no PR appears after 5 minutes, report "release-please did not create a PR — commits may not contain releasable changes (check conventional commit prefixes)" and skip to Step 5.
First try a direct merge:
gh pr merge <number> --merge
If that fails because checks haven't passed yet, enable auto-merge:
gh pr merge <number> --merge --auto
Then poll until the PR is actually merged:
gh pr view <number> --json state --jq '.state'
Check every 15 seconds for up to 10 minutes. If it doesn't merge in time, report the timeout and stop.
After the release-please PR merges, release-please runs again to create the actual GitHub release. Monitor the workflow:
gh run list --branch main --limit 1 --json status,conclusion,url,name
Poll every 15 seconds for up to 10 minutes. Wait until status is completed. Report the conclusion (success/failure) and the run URL.
Report everything that happened:
What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub rvanbaalen/skills --plugin cpr