| name | create-pull-request |
| description | Opens a GitHub Pull Request from the current branch, linking it to the related issue when the branch name starts with an issue number. |
Create Pull Request
When to use this skill
Use this skill when asked to open, create, or submit a Pull Request (PR) for the current branch.
Prerequisites
- All changes are committed and the branch has been pushed to the remote.
- The full quality check suite passes (see run-checks).
Steps
1. Run checks before opening the PR
npm run lint
npm run check
Fix any errors before continuing.
2. Push the branch (if not already pushed)
git push -u origin $(git branch --show-current)
3. Detect the linked issue from the branch name
Check the current branch name to determine whether it is linked to a GitHub issue:
git branch --show-current
If the branch name starts with a number followed by a hyphen (e.g. 42-add-dark-mode-toggle), extract the issue number:
BRANCH=$(git branch --show-current)
ISSUE=$(echo "$BRANCH" | grep -oP '^\d+')
echo $ISSUE
- If
$ISSUE is non-empty → the PR must be linked to that issue (see step 5).
- If
$ISSUE is empty → no automatic issue link is required.
4. Write the PR title and body
Title — follow Conventional Commits style, concise and descriptive:
feat: add dark mode toggle
fix: header overlaps on mobile
docs: update contributor guide
chore: upgrade SvelteKit to v2
Body template:
## Summary
<!-- What does this PR do? One or two sentences. -->
## Changes
## <!-- Bullet list of notable changes -->
-
## Related issue
Closes #<issue-number>
## Checklist
- [ ] `npm run lint` passes
- [ ] `npm run check` passes
- [ ] Manually tested in the browser (if UI changes)
If the branch is not linked to an issue, omit the "Related issue" section entirely.
5. Open the PR via GitHub CLI
gh pr create \
--base develop \
--title "<PR title>" \
--body "$(cat <<'EOF'
## Summary
<summary>
## Changes
- <change 1>
- <change 2>
Closes #<issue-number>
EOF
)"
Or open the GitHub web UI directly:
gh pr create --web
The default target branch for this project is develop, not main.
6. Verify the PR is linked to the issue
After the PR is created:
- Open the PR on GitHub.
- In the right sidebar under Development, confirm the issue is listed as linked.
- If it is missing, add
Closes #<issue-number> to the PR description — GitHub picks this up automatically.
Accepted closing keywords: Closes, Fixes, Resolves (case-insensitive).
Checklist