automattic/create-pr
Generate PR description using repository's PR template and current branch changes, copy to clipboard
npx skills add https://github.com/Automattic/pocket-casts-android --skill create-pr
Generate GitHub pull request descriptions using the PR template at .github/PULL_REQUEST_TEMPLATE.md and referencing changes in the current branch. Outputs markdown and copies to clipboard.
Activate this skill when the user:
/create-pr command with or without a repo nameThis skill does NOT:
This skill ONLY:
pbcopy on macOS, xclip/xsel on Linux, clip.exe on Windows)If repo name is provided:
If no repo name is provided:
.git in current workspaceValidation:
main, master, or the default branchRun these commands in the repository directory:
# Get current branch name
git branch --show-current
# Get the base branch (usually main or master)
git symbolic-ref refs/remotes/origin/HEAD | sed 's@^refs/remotes/origin/@@'
# Get commit history since divergence from base
git log {base-branch}..HEAD --oneline
# Get full diff since divergence
git diff {base-branch}...HEAD
Look for PR template in these locations (in order):
.github/PULL_REQUEST_TEMPLATE.md.github/pull_request_template.mddocs/PULL_REQUEST_TEMPLATE.mddocs/pull_request_template.mdPULL_REQUEST_TEMPLATE.mdpull_request_template.mdCRITICAL: If template found:
If no template found:
## Summary
## Changes
## Testing
## Related Issues
Based on the git diff and commit history:
Title Generation:
[Type] Brief descriptionBody Generation:
IMPORTANT: Follow the repository's template structure exactly.
[x][ ]Format the complete PR content:
## Title
{Generated PR title}
## Description
{Filled PR template body}
macOS:
echo "{PR title and body}" | pbcopy
Linux:
# Using xclip (install: apt-get install xclip or yum install xclip)
echo "{PR title and body}" | xclip -selection clipboard
# Or using xsel (install: apt-get install xsel or yum install xsel)
echo "{PR title and body}" | xsel --clipboard --input
Windows (Git Bash/WSL):
echo "{PR title and body}" | clip.exe
Cross-platform detection example:
# Detect OS and use appropriate clipboard command
if command -v pbcopy > /dev/null; then
echo "{PR title and body}" | pbcopy
elif command -v xclip > /dev/null; then
echo "{PR title and body}" | xclip -selection clipboard
elif command -v xsel > /dev/null; then
echo "{PR title and body}" | xsel --clipboard --input
elif command -v clip.exe > /dev/null; then
echo "{PR title and body}" | clip.exe
else
echo "⚠️ No clipboard utility found. Please copy manually."
fi
✅ PR description generated and copied to clipboard!
Next steps:
1. Push your branch: git push -u origin HEAD
2. Create PR on GitHub
3. Paste from clipboard
Error: No GitHub remote found. Please configure origin remote first.
Suggestion: git remote add origin https://github.com/{org}/{repo}.git
Error: Cannot create PR from default branch (main/master).
Suggestion: Create a feature branch first: git checkout -b feature/your-branch-name
Error: No commits found on this branch compared to {base-branch}.
Suggestion: Make some commits first, or check if you're on the right branch.
User: /create-pr woocommerce-shipping
[Skill analyzes branch: feature/add-scanform-ui]
[Base branch: main]
[Commits: 3 commits adding ScanForm UI components]
[Template found: .github/PULL_REQUEST_TEMPLATE.md]
Agent outputs:
✅ PR description generated and copied to clipboard!
---
## Title
feat: Add ScanForm UI for USPS bulk label printing
## Description
### Summary
Implements the ScanForm UI to allow merchants to generate USPS ScanForms for bulk label printing.
### Changes
- Added ScanFormModal component with form validation
- Integrated ScanForm API endpoint
- Added ScanForm history table to settings page
- Updated tests for new components
### Testing
1. Enable USPS in WooCommerce Shipping
2. Purchase multiple USPS labels
3. Navigate to Settings > Shipping Labels > ScanForm
4. Generate a new ScanForm
5. Verify history shows in table
### Related Issues
Closes WOOSHIP-1761
---
Next steps:
1. Push your branch: git push -u origin HEAD
2. Create PR on GitHub
3. Paste description from clipboard
User: /create-pr
[Skill detects 3 git repos in workspace]
Response:
I found multiple repositories in your workspace:
1. woocommerce-shipping
2. ciab-admin
3. woocommerce-connect-server
Which repository do you want to create a PR for?
User: /create-pr
[Skill analyzes branch: fix/null-shipment-ids]
[Single commit: "Fix critical error when opening orders with null shipment IDs"]
Agent outputs:
✅ PR description generated and copied to clipboard!
---
## Title
fix: Handle null shipment item IDs in older orders
## Description
### Summary
Fixes critical error when opening older orders that have null shipment item IDs.
### Changes
- Added null check in shipment data retrieval
- Updated error handling for legacy order data
- Added defensive coding for missing shipment metadata
### Testing
1. Create an order with WooCommerce Shipping 1.x
2. Upgrade to 2.x
3. Open the order in admin
4. Verify no fatal error occurs
### Related Issues
Fixes #1395
---
Content is in your clipboard - paste into GitHub PR form!
Always output in this structure:
## Title
{Generated title}
## Description
{Filled template body}
Then run the appropriate clipboard command for the user's platform (see Step 7 for cross-platform options):
# macOS
echo "{full content}" | pbcopy
# Linux (xclip)
echo "{full content}" | xclip -selection clipboard
# Windows
echo "{full content}" | clip.exe
And tell the user:
✅ PR description generated and copied to clipboard!
Next steps:
1. Push your branch: git push -u origin HEAD
2. Create PR on GitHub
3. Paste description from clipboard
.github/ISSUE_TEMPLATE/ - don't confuse with PR templatespbcopy on macOS, xclip/xsel on Linux, clip.exe on Windows)Take automattic/create-pr from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.
The instructions reference apt.
Without those the skill loads but fails at the first command.