push-to-pr
Handles PR creation and commit pushes to remote branches automatically.
Install
mkdir -p .claude/skills/push-to-pr && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/3498" && unzip -o skill.zip -d .claude/skills/push-to-pr && rm skill.zipInstalls to .claude/skills/push-to-pr
Activation
This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.
Create a new PR or push commits to an existing PR for the current branch.Key capabilities
- →Stage all changes and create a commit with a specified message
- →Push the current branch to its remote tracking branch
- →Create a new Pull Request with a generated title and body
- →Push new commits to an existing Pull Request
How it works
The skill checks the current Git state, commits uncommitted changes, and then either creates a new Pull Request or pushes the commits to an existing PR for the current branch.
Inputs & outputs
When to use push-to-pr
- →Push commits to open PR
- →Create new pull request
- →Sync branch with remote
- →Automate PR body generation
About this skill
Push to PR
Create a new PR or push commits to an existing PR for the current branch.
Usage
/push-to-pr [commit message]
Instructions
When this command is invoked:
1. Check current state
# Get current branch
git branch --show-current
# Check if there are uncommitted changes
git status --porcelain
# Check if branch has a remote tracking branch
git rev-parse --abbrev-ref --symbolic-full-name @{u} 2>/dev/null
# Check if there's an existing PR for this branch
gh pr list --head $(git branch --show-current) --json number,url,title
2. If there are uncommitted changes
- Stage all changes:
git add -A - Create a commit with the provided message, or generate one based on the changes
- Use this commit format:
git commit -m "$(cat <<'EOF'
<commit message>
Co-Authored-By: Claude <[email protected]>
EOF
)"
3. If no PR exists for this branch
- Push the branch:
git push -u origin $(git branch --show-current) - Create a new PR using:
gh pr create --title "<title based on branch/changes>" --body "$(cat <<'EOF'
## Summary
<brief summary of changes>
## Changes
<bullet points of what changed>
🤖 Generated with [Claude Code](https://claude.ai/code)
EOF
)"
- Return the PR URL to the user
4. If a PR already exists
- Push the new commits:
git push - Report that commits were pushed to the existing PR
- Return the existing PR URL
Example
/push-to-pr "Add tool use diagram to chapter 14.5"
This will either:
- Create a new PR if one doesn't exist
- Push a new commit to the existing PR if one does exist
How it compares
This skill automates the process of committing and managing PRs, handling the logic for new versus existing PRs, which is more efficient than manual Git and GitHub CLI commands.
Compared to similar skills
push-to-pr side by side with the closest alternatives in the catalog.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| push-to-pr (this skill) | 1 | 6mo | Review | Beginner |
| resolve-conflicts | 81 | 8mo | Review | Intermediate |
| dependency-upgrade | 26 | 5mo | Review | Intermediate |
| git-commits | 21 | 4mo | No flags | Beginner |
Try saying
Example prompts that trigger this skill in your AI assistant.
More by natolambert
View all by natolambert →You might also like
resolve-conflicts
antinomyhq
Use this skill immediately when the user mentions merge conflicts that need to be resolved. Do not attempt to resolve conflicts directly - invoke this skill first. This skill specializes in providing a structured framework for merging imports, tests, lock files (regeneration), configuration files, and handling deleted-but-modified files with backup and analysis.
dependency-upgrade
wshobson
Manage major dependency version upgrades with compatibility analysis, staged rollout, and comprehensive testing. Use when upgrading framework versions, updating major dependencies, or managing breaking changes in libraries.
git-commits
bonny
Create well-structured git commits in logical chunks following best practices
git-advanced-workflows
wshobson
Master advanced Git workflows including rebasing, cherry-picking, bisect, worktrees, and reflog to maintain clean history and recover from any situation. Use when managing complex Git histories, collaborating on feature branches, or troubleshooting repository issues.
github-multi-repo
ruvnet
Multi-repository coordination, synchronization, and architecture management with AI swarm orchestration
git-workflow-enforcer
CrazyDubya
Ensures commits follow conventional commits, branch naming conventions, and PR templates. Use when creating commits, branches, or PRs, or when user mentions git workflow.