This skill may not reflect the latest upstream change
Next.js Releases update on 2026-11-09 may affect this skill Last checked Nov 25, 2026.
pr
Create a convention-compliant pull request from the current branch.
Install this skill
No account required. Pick your tool, or use the command that detects it for you.
Run in your terminal. It detects your AI tool.
npx @skills-hub-ai/cli install prManual setup by platform
Claude Code
~/.claude/skills/pr/SKILL.md
Signing
SignedSLSA L2- Signed by
- skills-hub.ai distributor
- Method
- Distributor-signed by skills-hub.aiSigned with the skills-hub.ai Ed25519 distributor key over this exact slug, version and content. Check it with `npx @skills-hub-ai/cli verify`.
- Key
- skills-hub-ed25519-2026-11
- Signed
Instructions
You are a PR creation agent. Create a clean, convention-compliant pull request.
Do NOT ask the user questions. Infer everything from git history and code changes.
INPUT: $ARGUMENTS (optional)
Additional context or flags:
--draftor-dβ create as draft PR--reviewer <user>or-r <user>β assign reviewer(s), comma-separated- Free text β additional context about the PR (e.g., "this fixes the login timeout bug")
If no arguments, infer everything from the branch and commits.
PHASE 1: GATHER CONTEXT
- Get current branch:
git branch --show-current - Detect base branch:
- Try
git symbolic-ref refs/remotes/origin/HEAD-> striprefs/remotes/origin/ - Fallback: check if
developexists, thenmain, thenmaster
- Try
- Get all commits since diverging from base:
git log {base}..HEAD --format="%s" --reverse - Get diff stats:
git diff {base}..HEAD --stat - Get full diff for understanding changes:
git diff {base}..HEAD - Read key changed files to understand what was built/fixed.
PHASE 2: DETECT ISSUE TRACKER
Extract issue/story identifiers from the branch name using these patterns:
Jira-style (most common):
- Pattern:
[A-Z][A-Z0-9]+-\d+(e.g., DEV-4979, STORY-123, PROJ-42) - Matches:
DEV-4979-add-email-verification->DEV-4979
Linear-style:
- Pattern:
[A-Z][A-Z0-9]+-\d+(same as Jira, e.g., ENG-123, FE-45) - Matches:
eng-123-fix-auth->ENG-123
GitHub Issues:
- Pattern:
(\d+)-at the start, or-(\d+)-after a prefix likefix/,feat/ - Matches:
fix/42-broken-login->#42,123-add-feature->#123
If an identifier is found, determine the tracker type by checking these in order:
- Project config β look for a
.pr-configor.github/pr-config.ymlfile in the repo root containing tracker settings (see CONFIGURATION below). - Git remote URL β if the remote is
github.com, and the identifier is purely numeric, assume GitHub Issues. - Fallback β if the identifier matches
[A-Z]+-\d+, assume Jira/Linear style. Build the URL from the configured base URL (see CONFIGURATION).
CONFIGURATION
The skill reads optional configuration from these locations (first match wins):
- Repo-level:
.pr-config.ymlor.github/pr-config.ymlin the repo root - Global:
~/.config/claude-pr/config.yml
Config schema:
# Issue tracker settings
tracker:
# Type: "jira", "linear", "github", or "none"
type: jira
# Base URL for building issue links (Jira/Linear)
url: https://myteam.atlassian.net/browse
# For Linear: https://linear.app/myteam/issue
# Deploy convention β a string to check in the last commit message
# Set to null or omit to skip this check entirely
deploy_tag: "deploy:username"
# Default reviewers (GitHub usernames)
reviewers: []
If no config file exists, use these defaults:
tracker.type: auto-detect from branch name and remotetracker.url: for Jira, attempt to read from anyatlassian.netreferences in the repo; otherwise omit the linkdeploy_tag: null (skip check)reviewers: [] (none)
PHASE 3: CLASSIFY CHANGE TYPE
Determine the change type from commit messages and diff:
feat:-> New featurefix:-> Bug fixrefactor:-> Code restructuredocs:-> Documentationtest:-> Test changeschore:-> Maintenance
Use the most common prefix across commits, or the most significant change type.
PHASE 4: GENERATE PR CONTENT
Title (under 70 characters):
- If story number exists:
{type}: ({STORY-NUMBER}) {brief description} - If no story number:
{type}: {brief description} - Use imperative mood: "add", "fix", "update" -- not "added", "fixes", "updates"
Body:
## Summary
{2-4 bullet points describing what changed and why -- focus on the "why"}
## Changes
{List key files changed with brief explanation of each change}
## Test Plan
- [ ] {Specific testable verification step}
- [ ] {Another verification step}
- [ ] All existing tests pass
## Issue
{Link to the issue, formatted based on tracker type:}
{Jira: [DEV-4979](https://myteam.atlassian.net/browse/DEV-4979)}
{Linear: [ENG-123](https://linear.app/myteam/issue/ENG-123)}
{GitHub: Closes #42}
If no story/issue number was detected, omit the Issue section entirely.
If tracker URL is not configured, just show the identifier without a link.
PHASE 5: PRE-FLIGHT CHECKS
- Check if branch is pushed to remote:
git rev-parse --verify origin/{branch} 2>/dev/null
If not pushed:git push -u origin {branch} - Check if a PR already exists:
gh pr view {branch} --json number 2>/dev/null
If exists: update it withgh pr editinstead of creating new. - If
deploy_tagis configured (non-null), verify last commit message contains it.
If not, warn the user but still create the PR.
PHASE 6: CREATE PR
Build the gh pr create command:
gh pr create --title "{title}" --body "{body}" --base {base-branch}
Add flags based on input and config:
- If
--draftwas passed in $ARGUMENTS: add--draft - If
--reviewerwas passed orreviewersis configured: add--reviewer {user1} --reviewer {user2}
Use a HEREDOC for the body to preserve formatting.
If updating an existing PR:
gh pr edit {number} --title "{title}" --body "{body}"
STRICT CONVENTIONS (from CLAUDE.md):
- NEVER include Co-Authored-By lines anywhere.
- NEVER reference Claude, AI, or AI assistance anywhere in the PR.
- NEVER include "Generated with Claude Code" or similar messaging.
- Keep the description factual and concise.
- Do NOT add emoji unless the user explicitly requests it.
OUTPUT:
PR Created
- PR: {URL}
- Title: {title}
- Issue: {story number + link, or "none detected"}
- Base: {base branch}
- Commits: {count}
- Files changed: {count}
- Draft: {yes/no}
- Reviewers: {list or "none"}
SELF-HEALING VALIDATION (max 2 iterations)
After producing the review, validate completeness and consistency:
- Verify all required output sections are present and non-empty.
- Verify every finding references a specific file or code location.
- Verify recommendations are actionable (not vague).
- Verify severity ratings are justified by evidence.
IF VALIDATION FAILS:
- Identify which sections are incomplete or lack specificity
- Re-analyze the deficient areas
- Repeat up to 2 iterations
SELF-EVOLUTION TELEMETRY
After producing output, record execution metadata for the /evolve pipeline.
Check if a project memory directory exists:
- Look for the project path in
~/.claude/projects/ - If found, append to
skill-telemetry.mdin that memory directory
Entry format:
### /pr β {{YYYY-MM-DD}}
- Outcome: {{SUCCESS | PARTIAL | FAILED}}
- Self-healed: {{yes β what was healed | no}}
- Iterations used: {{N}} / {{N max}}
- Bottleneck: {{phase that struggled or "none"}}
- Suggestion: {{one-line improvement idea for /evolve, or "none"}}
Only log if the memory directory exists. Skip silently if not found.
Keep entries concise β /evolve will parse these for skill improvement signals.
Security
Reviews (0)
Related skills
Browse all βMore from Skills Hub
View source βMore Review skills
Browse category βFrequently asked questions about pr
What does the pr skill do?
Create a convention-compliant pull request from the current branch. It's a reusable SKILL.md instruction set that loads into your AI coding assistant on demand, no prompt engineering, no copy-pasting every session.
How do I install the pr skill?
Run `npx @skills-hub-ai/cli install pr` from your terminal. The CLI writes the SKILL.md to the correct location for your AI tool (e.g. ~/.claude/skills/pr/ for Claude Code or ~/.cursor/skills/ for Cursor with --target cursor) and adds it to your project's .skills.json lockfile.
Which AI tools does pr work with?
pr runs in Claude Code. It follows the open Agent Skills standard (SKILL.md), so the same skill works in every supported tool without modification.
Is the pr skill free?
Yes. Every skill on skills-hub.ai is free and open-source. There are no premium tiers, paywalls, or usage limits. You only pay for whatever AI assistant you're already using.
How do I use pr after installing it?
In Claude Code, type `/pr` (or whatever slash command the skill registers) and the AI follows the skill's instructions immediately. You can also reference it by name in natural language, your AI loads the skill into context when relevant.
Can I share the pr skill with my team?
Yes. Commit your project's .skills.json lockfile and teammates run `npx @skills-hub-ai/cli install` (no args) to install every skill at the exact version you pinned. Organization-scoped installs work via skills-hub.ai organizations.