Skip to main content
ClaudeWave
EN, English
Slash Command1.4k repo starsupdated 22d ago

commit-push-pr

The commit-push-pr command automates the complete GitHub workflow by committing staged changes with conventional message formatting, pushing the current branch to origin while setting upstream tracking if needed, and creating a pull request with auto-generated titles and change summaries. Use this when ready to submit completed work for code review after staging changes locally.

Install in Claude Code
Copy
mkdir -p ~/.claude/commands && curl -fsSL https://raw.githubusercontent.com/CloudAI-X/claude-workflow-v2/HEAD/commands/commit-push-pr.md -o ~/.claude/commands/commit-push-pr.md
Then start a new Claude Code session; the slash command loads automatically.

commit-push-pr.md

## Context

- Current branch: !`git branch --show-current`
- Default branch: !`git remote show origin 2>/dev/null | grep 'HEAD branch' | cut -d' ' -f5 || echo "main"`
- Git status: !`git status --short`
- Staged diff: !`git diff --cached`
- Unstaged diff: !`git diff`
- Commits ahead of origin: !`git log @{u}..HEAD --oneline 2>/dev/null || echo "No upstream branch"`
- Recent commits for style: !`git log --oneline -5`

## Task

Execute the full git workflow:

1. **Commit**: If there are staged changes, create a conventional commit
2. **Push**: Push the current branch to origin (set upstream if needed)
3. **PR**: Create a pull request using `gh pr create`
   - Auto-generate title from commits
   - Include a summary of changes in the PR body
   - Link any related issues mentioned in commits

If any step fails, stop and report the issue.

$ARGUMENTS