commit-push-pr
Automate the workflow from creating a branch to opening a GitHub pull request. Use when the user says "create a PR", "commit and push", "push changes and create PR", or "open a pull request".
When & Why to Use This Skill
This Claude skill automates the end-to-end GitHub workflow, from intelligent branch creation and commit management to generating high-quality Pull Requests. By leveraging the GitHub CLI and AI-driven context analysis, it ensures standardized naming conventions, detailed PR descriptions, and seamless transitions from local development to code review, significantly reducing manual overhead for software engineers.
Use Cases
- Streamlining the 'Feature-to-PR' cycle: Automatically create a structured branch, stage changes, and open a PR with a single natural language command like 'create a PR'.
- Standardizing Team Workflows: Enforce consistent branch naming patterns (e.g., feature/scope-...) and professional PR documentation templates across a development team.
- Context-Aware PR Documentation: Automatically generate comprehensive PR bodies including purpose, change summaries, and verification steps based on git diffs and commit logs.
- Risk Assessment: Identify high-risk changes such as database schema updates, API contract changes, or security-sensitive modifications before pushing to the remote repository.
| name | commit-push-pr |
|---|---|
| description | Automate the workflow from creating a branch to opening a GitHub pull request. Use when the user says "create a PR", "commit and push", "push changes and create PR", or "open a pull request". |
commit-push-pr
Automate creating branches, commits, and pull requests.
Trigger Examples
- "Create a PR"
- "Commit and push"
- "Push changes and create PR"
- "Open a pull request"
Prerequisites
- GitHub CLI (
gh) is installed and authenticated - Changes exist in the working tree
- Local quality checks have been run manually
Execution Flow
1. Generate Branch Name
Derive branch prefix from commit type:
| Type | Branch Format |
|---|---|
| feat(scope): ... | feature/scope-<summary> |
| fix(scope): ... | fix/scope-<summary> |
| refactor(scope): ... | refactor/scope-<summary> |
| docs | docs/<summary> |
| No scope | <type>/<summary> |
- Use lowercase kebab-case
- Translate Japanese summaries to English
2. Create or Reuse Branch
git rev-parse --abbrev-ref HEAD
- If on base branch: create new branch with
git checkout -b <branch> - If on feature branch: confirm reuse with user
3. Stage and Commit Changes
git status --porcelain
git add -A
git commit -m "<message>"
If no staged changes, inform user and stop.
4. Push to Remote
git push -u origin <branch>
Prompt: "Ready to create a PR now?"
5. Generate PR Body
Gather context:
git log origin/<base>..HEAD --oneline
git diff origin/<base>...HEAD --stat
Populate PR sections:
- Purpose / Background - Why the change exists
- Summary of changes - Major modifications by layer
- Verification steps - Commands and manual checks
- Impact / Compatibility - API/schema changes, breaking behavior
- Linked issues / docs - Reference tickets or docs
- Checklist - Mark satisfied items
6. Create the PR
gh pr create \
--base <base> \
--title "$(git log -1 --pretty=%s)" \
--body-file /tmp/pr-body.md \
--assignee "nozomi-koborinai"
Ask if draft PR is preferred.
7. Output PR URL
Display the link for user review.
AI Analysis Points
Classify the change set:
- Frontend:
app/orapp/src - Infrastructure:
infra/** - Documentation:
docs/,AGENTS.md,README.md - Tests:
*.test.ts,tests/
Detect high-risk changes:
- Database schema changes
- API contract changes
- Infrastructure modifications
- Security-sensitive updates
Notes
- Assume
originpoints to GitHub - PR descriptions should be high quality from the start
- If branch exists, ask user for alternative name