From claude-code-toolkit
Complete the inner development loop in one command: stage changes, write a conventional commit message, push, and open a pull request with a structured description. Uses the commit-message and pr-description skills. Inspired by Boris Cherny's workflow — he runs this dozens of times daily.
How this command is triggered — by the user, by Claude, or both
Slash command
/claude-code-toolkit:commit-push-pr <optional: PR title or description override>The summary Claude sees in its command listing — used to decide when to auto-load this command
# Commit, Push, PR — Full Inner Loop Execute the complete commit-to-PR workflow in one shot. Pre-compute context to minimize back-and-forth. ## Pre-Compute Context Gather everything needed before making decisions: ## Step 1: Stage If there are unstaged or untracked changes, stage them: - Review untracked and modified files before staging - Never stage: `.env` files, secrets, large binary files, build artifacts (`dist/`, `build/`, `target/`, `__pycache__/`, `node_modules/`), or generated files that should be in `.gitignore` - If ALL remaining changes are related to the same task,...
Execute the complete commit-to-PR workflow in one shot. Pre-compute context to minimize back-and-forth.
Gather everything needed before making decisions:
# Branch info
BRANCH=$(git rev-parse --abbrev-ref HEAD)
BASE_BRANCH=$(git remote show origin | grep 'HEAD branch' | awk '{print $NF}' 2>/dev/null || echo "main")
# What's changed
STAGED=$(git diff --staged --stat)
UNSTAGED=$(git diff --stat)
UNTRACKED=$(git ls-files --others --exclude-standard)
# Diff for commit message generation
FULL_DIFF=$(git diff --staged)
if [ -z "$FULL_DIFF" ]; then
FULL_DIFF=$(git diff)
fi
# Recent commits on this branch for PR context
RECENT_COMMITS=$(git log --oneline $BASE_BRANCH..HEAD 2>/dev/null | head -20)
If there are unstaged or untracked changes, stage them:
.env files, secrets, large binary files, build artifacts
(dist/, build/, target/, __pycache__/, node_modules/), or
generated files that should be in .gitignoregit add specifying files by name (not git add -A)Using the commit-message skill conventions:
feat, fix, refactor, etc.)Execute:
git commit -m "<type>(<scope>): <subject>
<body>"
git push -u origin $BRANCH 2>&1
If push fails due to divergence, report the conflict — don't force push.
Using the pr-description skill conventions:
If the user provided an argument (title/description override), use it as the PR summary instead of generating one.
Execute:
# GitHub CLI
gh pr create --title "<title>" --body "<description>" --base $BASE_BRANCH
# Or if gh isn't available, provide the URL
echo "Create PR at: https://github.com/$(git remote get-url origin | sed 's/.*github.com[:/]//' | sed 's/.git$//')/compare/$BASE_BRANCH...$BRANCH"
## Done
**Commit:** <type>(<scope>): <subject>
**Branch:** <branch> → <base>
**PR:** <url or instructions>
**Files:** <count> changed, <insertions> insertions, <deletions> deletions
.env, secrets, or large binary filesgh CLI isn't available, provide the manual PR creation URLnpx claudepluginhub rsurasin/claude-code-toolkit --plugin claude-code-toolkit/commit-push-prCommits current changes (staged/unstaged) to a new branch if on main, pushes to origin, and creates a GitHub pull request via gh.
/commit-push-prCommits staged changes with a conventional commit message, pushes current branch to origin, and creates GitHub pull request with auto-generated title, change summary, and issue links. Accepts optional PR title/description hint.
/commit-push-prCommits staged changes after build/test/lint/security verification, pushes branch, creates PR, optionally merges (merge/squash/rebase), and notifies. Supports flags like --draft, --no-verify, --skip-security.