| name | create-pr |
| description | Create pull requests. Use when opening PRs, writing PR descriptions, or preparing changes for review. |
Create Pull Request
Create pull requests.
Requires: Git access and whatever PR creation mechanism your environment supports.
If your agent runtime provides a dedicated PR tool, use that instead of shelling out to gh pr create. Treat this file as a workflow checklist, not a requirement to use a specific tool.
Process
Step 1: Check Current Branch
git branch --show-current
IMPORTANT: If you are on main or master, you MUST create a feature branch before committing:
git checkout -b <feature-branch-name>
Use your environment's branch naming policy. If the repo or runtime specifies a required prefix/suffix, follow that instead of inventing a new pattern. Otherwise, use a descriptive branch name such as:
feat/add-user-authentication
fix/null-pointer-in-parser
refactor/extract-helper-functions
Never commit directly to main/master when preparing a PR.
Step 2: Stage and Commit Changes
git status --porcelain
If there are uncommitted changes, stage and commit them:
git add <files>
git commit -m "<type>(<scope>): <description>"
Step 3: Push Branch and Verify State
git push -u origin $(git branch --show-current)
git log origin/main..HEAD --oneline
Ensure:
- All changes are committed
- Branch is pushed to remote
- You're not on main/master
Step 4: Analyze Changes
Review what will be included in the PR:
git log origin/main..HEAD
git diff origin/main...HEAD
Understand the scope and purpose of all changes before writing the description.
Step 5: Write the PR Description
Follow this structure:
<brief description of what the PR does>
<why these changes are being made - the motivation>
<alternative approaches considered, if any>
<any additional context reviewers need>
Do NOT include:
- "Test plan" sections
- Checkbox lists of testing steps
- Redundant summaries of the diff
Do include:
- Clear explanation of what and why
- Context that isn't obvious from the code
- Notes on specific areas that need careful review
Step 6: Create the PR
Create the PR using your environment's approved mechanism:
- dedicated PR tool in the agent runtime, if available
- repository automation that registers/updates PRs for the current branch
gh pr create only when shell-based PR creation is actually supported and allowed
Regardless of mechanism, use the same title/body guidance from this skill and make sure the branch has already been pushed.
Title format follows commit conventions:
feat(scope): Add new feature
fix(scope): Fix the bug
ref: Refactor something
chore: Minor change