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.
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.mdcommit-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.
$ARGUMENTSAdd tests for recently changed files or specified code
Analyzes codebases to understand structure, tech stack, patterns, and conventions. Use when onboarding to a new project, exploring unfamiliar code, or when asked "how does this work?" or "what's the architecture?
System design and architecture planning mode. Focuses on high-level design, trade-offs, and technical decisions before implementation.
Explore the repository with 10 parallel subagents to create comprehensive documentation. Creates CODEBASE.md with full architecture analysis.
Expert code review specialist. Use PROACTIVELY after writing or modifying code, before commits, when asked to review changes, PR review, code quality check, lint, or standards audit. Focuses on quality, security, performance, and maintainability.
Simplifies code after implementation. Reviews recent changes and suggests/applies simplifications while preserving behavior.
Create a conventional commit with auto-generated message
Convex backend development guidelines. Use when writing Convex functions, schemas, queries, mutations, actions, or any backend code in a Convex project. Triggers on tasks involving Convex database operations, real-time subscriptions, file storage, or serverless functions.