Use when breaking a large, complex, messy, or hard-to-review pull request into multiple smaller PRs; planning stacked PRs; extracting independent changes from a branch; splitting mixed refactor and behavior changes; managing drift after review feedback; rebasing follow-up PRs as earlier PRs change; or preserving original branch intent while shipping incrementally.
77
96%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
View guide
Passed
No findings from the security scan
Preserve the original PR as source material, build smaller reviewable PRs intentionally, and track drift locally as review feedback changes the stack.
Snapshot before touching history
git status.git branch backup/original-large-pr.Inventory the original PR
git diff --stat <base>...HEAD, git diff --name-only <base>...HEAD, and git log --oneline <base>..HEAD.Create a local scratchpad
.notes/pr-split.md..notes/ is ignored or leave it untracked. Do not commit scratchpad notes unless the user explicitly asks.Choose the split shape
Extract changes safely
git checkout backup/original-large-pr -- path/to/file.git restore -p --source backup/original-large-pr -- path/to/file.Verify each PR independently
Manage drift deliberately
backup/original-large-pr to find remaining intent, not to force byte-for-byte equality..notes/pr-split.md.Use range-diff for rewritten stacks
git range-diff after rebases, conflict resolution, or force-pushes to understand what changed.Keep PR descriptions concise and reviewer-facing:
## Summary
This is PR N of M split from a larger change.
## Scope
- ...
## Intentionally excluded
- Follow-up PR will handle ...
## Verification
- ...Do not put the full split ledger in PR descriptions. Keep detailed extraction notes and drift tracking in .notes/pr-split.md.
# PR split scratchpad
Original branch: backup/original-large-pr
Base branch: main
## Planned PRs
1. branch-name
- Scope:
- Files/hunks extracted:
- Verification:
- Changeset: (package names, bump type, scoped message)
- Status:
## Remaining original intent
- ...
## Drift notes
- Date / branch / reason:Each split PR must carry its own changeset scoped to the changes in that PR. Do not keep the original changeset from the source branch — it covers the full combined change and does not belong in any single split PR.
After extracting changes into a split branch:
.mastracode/commands/changeset.md):
pnpm changeset -s -m "your scoped message" (--major | --minor | --patch) pkg-name@mastra/core, the new changeset should only reference @mastra/core.patch; a PR introducing new API surface is minor; a PR with breaking changes is major.Add changeset creation to the scratchpad template under each planned PR's verification checklist so it is not forgotten.
Avoid splitting by file when behavior spans files, extracting tests without code, leaving follow-up PRs uncompilable, force-pushing without a reviewer summary, deleting the original branch early, reverting review feedback while resolving stack conflicts, and keeping the original branch's changeset in every split PR instead of creating scoped changesets per PR.
When asked to split a PR, produce:
3b78ed9
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.