Opens a pull request from your current branch with an auto-generated summary.
Install
mkdir -p .claude/skills/pr-open && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/17579" && unzip -o skill.zip -d .claude/skills/pr-open && rm skill.zipInstalls to .claude/skills/pr-open
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.
Open or create a pull request from the current branch with a clean, deduplicated summaryKey capabilities
- →Determine the target branch for a pull request
- →Collect all changes between current and target branches
- →Build a concise PR title from branch name or commit themes
- →Generate a structured PR description with a deduplicated changelog
- →Create a pull request and optionally assign reviewers
How it works
The skill determines the target branch, collects changes, and generates a PR title and a structured description with a deduplicated changelog. It then pushes the branch and creates the pull request, optionally assigning reviewers.
Inputs & outputs
When to use pr-open
- →Opening a new pull request
- →Standardizing PR descriptions
- →Streamlining code review submission
About this skill
Open a new pull request (or view an existing one) from the current branch. Generates a clear summary and deduplicated checklist of changes, asks the user which branch to target and whether to request reviewers.
Usage
pr-open— Create a PR from the current branch (asks for target branch)pr-open main— Create a PR targetingmainpr-open dev— Create a PR targetingdev
Process
Step 1: Preflight checks
Run these commands in parallel:
git status
git branch --show-current
gh auth status
Verify:
ghCLI is authenticated. If not, inform the user and stop.- The working tree is clean. If there are uncommitted changes, warn the user and stop — do NOT auto-commit.
- Note the current branch name.
Step 2: Determine the target branch
If $ARGUMENTS contains a branch name, use it as the target branch.
If $ARGUMENTS is empty, ask the user which branch to create the PR against. Show common options and recent remote branches:
git branch -r --list 'origin/*' --sort=-committerdate | head -10
Present the branches as options and let the user pick. Default suggestion should be main if it exists, otherwise the most common base branch.
Step 3: Collect all changes
Fetch the full diff and commit history between the target branch and the current branch:
git log <target>..HEAD --pretty=format:"%h %s (by @%an)" --no-merges
git diff <target>..HEAD --stat
If there are zero commits ahead, inform the user there is nothing to open a PR for and stop.
Step 4: Build the PR title and description
Title:
- Derive a concise title from the branch name or the overall theme of the commits
- Keep it under 72 characters
- Use natural language (no conventional commit prefixes like
feat:orfix:) - Should clearly describe what this PR does
Description:
Build the PR body with these sections:
## Summary
[2-4 sentences describing what this PR does and why. Focus on the "why" and the user-facing impact.]
## Changes
- [Deduplicated checklist item 1]
- [Deduplicated checklist item 2]
- [Deduplicated checklist item 3]
...
Deduplication rules for the Changes list:
- Scan all commits between the target branch and HEAD
- Group commits that touch the same feature or area into a single checklist item
- If multiple commits describe the same change (e.g., "Add X" then "Fix X" then "Update X"), merge them into one item that describes the final state
- Each item should describe WHAT was changed, not individual commits
- Use simple, clear English
- Each line starts with a capital letter
- Do NOT include "fix typo", "fix lint", or other trivial followup commits as separate items — fold them into the parent change
- Attribution: if a change was made by someone other than the PR author, append
(by @<author>)to that checklist item. If all changes are by the same person, omit attribution entirely. - Keep the list concise — aim for 3-10 items. If there are more than 15 distinct changes, group related ones.
Do NOT include:
- AI attribution lines (no "Generated by Claude", "Co-Authored-By: Claude", etc.)
- Emoji in the description
- Empty sections
Step 5: Push the branch
Check if the branch is already pushed and up to date:
git rev-parse --abbrev-ref --symbolic-full-name @{u} 2>/dev/null
git status -sb
If the branch is not pushed or is ahead of remote, push it:
git push -u origin $(git branch --show-current)
If push fails, show the error and let the user decide how to proceed.
Step 6: Create the PR
gh pr create \
--base <target-branch> \
--head "$(git branch --show-current)" \
--title "<title>" \
--body "$(cat <<'EOF'
<the PR body from Step 4>
EOF
)"
If a PR already exists for this branch, detect it and show the existing PR URL instead of failing:
gh pr view --json url --jq '.url' 2>/dev/null
Step 7: Ask about reviewers
After the PR is created, ask the user:
"Should this PR request a reviewer?"
Present options:
- None (default) — skip reviewer assignment
- Select reviewer(s) — fetch collaborators and let the user pick:
gh api repos/{owner}/{repo}/collaborators --jq '.[].login'
If the user selects reviewers:
gh pr edit <pr-number> --add-reviewer <reviewer1>,<reviewer2>
Step 8: Output the PR link
Output a clean summary:
PR created!
Title: <title>
Target: <target-branch>
URL: <pr-url>
Reviewer: <reviewer(s) or "None">
The PR URL is the most important output — make sure it is clearly visible.
Error Handling
- If
ghCLI is not installed or not authenticated, inform the user and stop - If there are uncommitted changes, warn and stop — do NOT auto-commit
- If the current branch equals the target branch, warn the user and stop
- If no commits ahead of the target, inform the user there is nothing to PR and stop
- If a PR already exists for the branch, show the existing PR URL
- If push fails, show the error and let the user resolve it
- If PR creation fails for any other reason, show the full error
Important Notes
- Do NOT add any AI attribution to the PR title, body, or commits
- Do NOT use conventional commit prefixes in the PR title
- Do NOT auto-commit — if the user has uncommitted changes, warn and stop
- The default reviewer is "None" — only assign if the user explicitly asks
- Keep the PR body clean, concise, and free of noise
- The Changes list must be deduplicated — never list the same change twice
User Arguments
$ARGUMENTS
When not to use it
- →When `gh` CLI is not installed or authenticated
- →When the current branch equals the target branch
Prerequisites
Limitations
- →Requires `gh` CLI to be installed and authenticated
- →Does not add AI attribution to PR content
How it compares
This skill automates the creation of a well-structured PR with a deduplicated changelog and optional reviewer assignment, ensuring consistency and clarity, unlike a manual PR creation that might lack detail or structure.
Compared to similar skills
pr-open side by side with the closest alternatives in the catalog.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| pr-open (this skill) | 0 | 1mo | Review | Intermediate |
| resolve-conflicts | 81 | 8mo | Review | Intermediate |
| dependency-upgrade | 26 | 4mo | Review | Intermediate |
| git-commits | 21 | 3mo | No flags | Beginner |
Try saying
Example prompts that trigger this skill in your AI assistant.
More by hta218
View all by hta218 →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.