This skill should be used when you need to create, open, or edit a pull request (PR), or the user asks to "create a PR", "open a PR", "submit a PR", "raise a PR", "file a PR", "make a PR", "create a pull request", "open a pull request", "new PR", or any variation requesting GitHub pull request creation.
From pr-best-practicesnpx claudepluginhub dhughes/claude-marketplace --plugin pr-best-practicesThis skill is limited to using the following tools:
Executes pre-written implementation plans: critically reviews, follows bite-sized steps exactly, runs verifications, tracks progress with checkpoints, uses git worktrees, stops on blockers.
Guides idea refinement into designs: explores context, asks questions one-by-one, proposes approaches, presents sections for approval, writes/review specs before coding.
Dispatches parallel agents to independently tackle 2+ tasks like separate test failures or subsystems without shared state or dependencies.
This skill enforces three critical best practices when creating GitHub pull requests:
Before creating the pull request, attempt to identify an associated ticket number from Jira or GitHub Issues.
Check the following sources for ticket numbers (in order of preference):
PROJ-123/description (Jira-style prefix)feature/PROJ-123-description (Jira after prefix)123-description (GitHub issue number)Recognize these common patterns:
PROJ-123, ABC-456 (uppercase letters, hyphen, numbers)#123, 456 (numbers, optionally with # prefix)When ticket number is identified, format the PR title as:
[TICKET-NUM] Descriptive PR title
Examples:
[MSI-608] Add Zendesk integration[#456] Fix authentication bug[PLATFORM-123] Refactor API endpointsIf PR template exists with ticket field:
[TICKET], [ISSUE], Ticket:, Issue:, JIRA:, etc.If template has no specific ticket field:
**Ticket:** [TICKET-NUM](url) or **Ticket:** TICKET-NUM if no URLIf no template:
Determine ticket URLs from available context and knowledge:
.jira, project config files, or documentation mentioning ticket URLsURL formats:
https://company.atlassian.net/browse/PROJ-123https://github.com/owner/repo/issues/123If URL cannot be determined, include ticket number without link.
Before creating the pull request, check for GitHub PR templates in the .github/ directory using the following search order:
.github/pull_request_template.md (lowercase, standard GitHub convention).github/PULL_REQUEST_TEMPLATE.md (uppercase variant).github/PULL_REQUEST_TEMPLATE/*.md (multiple templates in subdirectory)If a template is found:
gh pr create --bodyIf multiple templates exist in .github/PULL_REQUEST_TEMPLATE/:
If no template is found:
Always create pull requests as drafts using the --draft flag:
gh pr create --draft --title "PR title" --body "$(cat <<'EOF'
PR description here
EOF
)"
Draft PRs provide several benefits:
After creating the draft PR, inform the user they can mark it ready for review when appropriate:
gh pr ready <pr-number>
Or they can mark it ready directly on GitHub.
Follow this sequence when the user requests PR creation:
Detect ticket number:
Check for PR templates:
.github/ directory for template filesGather PR information:
git log and git diff[TICKET] TitleCreate draft PR:
gh pr create --draft with ticket-formatted title and bodyVerify creation:
Provide next steps:
# Detect ticket from branch (e.g., MSI-608/zendesk2)
BRANCH=$(git branch --show-current)
# Parse ticket: MSI-608
# Create draft PR with ticket in title
gh pr create --draft --title "[MSI-608] Add Zendesk integration" --body "$(cat <<'EOF'
**Ticket:** [MSI-608](https://company.atlassian.net/browse/MSI-608)
## Summary
Added Zendesk integration for customer support tickets
## Changes
- Implemented Zendesk API client
- Added webhook handlers
EOF
)"
# Template has "Ticket: [TICKET]" placeholder
# Replace with actual ticket and link
gh pr create --draft --title "[PLATFORM-123] Refactor API endpoints" --body "$(cat <<'EOF'
## Ticket
[PLATFORM-123](https://jira.company.com/browse/PLATFORM-123)
## Summary
[Filled from template]
## Test Plan
[Filled from template]
EOF
)"
# Detect from branch: 456-fix-auth-bug
gh pr create --draft --title "[#456] Fix authentication bug" --body "$(cat <<'EOF'
**Related Issue:** [#456](https://github.com/owner/repo/issues/456)
## Summary
Fixed authentication token expiration handling
EOF
)"
--draft flag - Never create PRs as immediately ready for review[TICKET] Title when ticket is identifiedNo ticket found and user declines to provide: If user indicates there's no associated ticket or chooses not to provide one, proceed with PR creation without ticket in title or body
Multiple ticket references: If multiple tickets are found, ask user which is the primary ticket for this PR
Invalid ticket format: If detected ticket doesn't match expected patterns, verify with user before using
Cannot determine ticket URL: If ticket is identified but URL cannot be determined from context, include ticket number without link
No git repository: Verify current directory is a git repository before proceeding
Not a GitHub repository: Confirm remote is GitHub before using gh commands
No GitHub CLI: If gh command is not available, inform user to install GitHub CLI
Branch already has PR: If a PR already exists for the current branch, inform user rather than creating duplicate
No commits to push: Ensure there are commits to include in the PR before creating it