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.zip

Installs 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.
73 charsno explicit “when” trigger
Beginner

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

You give it
An optional commit message and local code changes
You get back
A new Pull Request URL or confirmation that commits were pushed to an existing PR

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.

SkillInstallsUpdatedSafetyDifficulty
push-to-pr (this skill)16moReviewBeginner
resolve-conflicts818moReviewIntermediate
dependency-upgrade265moReviewIntermediate
git-commits214moNo flagsBeginner

Try saying

Example prompts that trigger this skill in your AI assistant.

Search skills

Search the agent skills registry