Create MR
Create a GitHub pull request from the current branch by reading the repository state, respecting any PR template, and verifying the created PR.
Workflow
1. Detect PR Template
Search for a PR template in this order:
.github/PULL_REQUEST_TEMPLATE.md
.github/PULL_REQUEST_TEMPLATE/*.md
(pick the first match)
docs/PULL_REQUEST_TEMPLATE.md
If a template is found, read it and use it as the base structure for the PR body. Preserve all template sections and fill them from the actual changes.
If no template is found, use the default body format below.
2. Gather Context
Run these checks, parallelizing file reads and git commands where possible:
bash
git status
git diff --staged
git diff
git log --oneline -20
git remote -v
git branch --show-current
3. Analyze Changes
From the gathered context:
- Summarize commits and diffs into a coherent narrative.
- Identify the change type: feature, bugfix, refactor, docs, chore, or test.
- Note verification evidence already present in the branch.
4. Check Changeset Requirement
Before pushing or creating the PR, check whether the repository uses Changesets:
bash
test -d .changeset && test -f .changeset/config.json
rg -n '"@changesets/cli"|changeset' package.json pnpm-lock.yaml package-lock.json yarn.lock 2>/dev/null
If Changesets is not configured, skip this step.
If Changesets is configured, inspect the staged, unstaged, and unpushed branch diff that will be included in the PR. When the diff changes a versioned package or adds a backward-compatible public capability, and no matching
file is already included, use the
skill before pushing.
Do not duplicate package eligibility, package-name, or bump-selection logic here. Let the
skill derive package names, release impact, and validation commands from repository metadata and Changesets config.
Include any generated
file in the branch before running
and
.
5. Generate PR Title and Body
Title requirements:
- 72 characters or fewer.
- Imperative mood.
- Conventional commit style:
<type>(<scope>): <short description>
.
Example:
text
feat(auth): add OAuth2 login flow
Default body when no template exists:
markdown
## Summary
- <1-3 bullets summarizing what this PR does>
## Changes
- <key change 1>
- <key change 2>
## Test Plan
- <how to verify these changes>
## Screenshots
<before/after for visual changes, or omit if not applicable>
Create the Pull Request
Use GitHub CLI:
bash
gh pr create --title "<title>" --body "<body>"
If the body is large, write it to a temporary file and pass
.
If the current branch has no remote tracking branch, push first:
Verify
After creation, run:
For machine-readable verification, prefer:
bash
gh pr view <number> --json number,title,url,state,headRefName,baseRefName
Report the PR URL to the user.
Common Mistakes
| Mistake | Fix |
|---|
| Ignoring a PR template | Search all supported template locations first. |
| Writing a title from memory | Base the title on the actual diff and commits. |
| Claiming tests passed without evidence | Put only verified commands in the test plan. |
| Omitting a required changeset | Check Changesets support and use the skill before pushing release-impacting changes. |
| Forgetting to push the branch | Push with , then create the PR. |