- Home
- Skills
- Code Quality & Review
- PR Splitter: Break a Giant PR into Reviewable Stacks
Works with the AI Agents you already use
PR Splitter: Break a Giant PR into Reviewable Stacks
Turns one oversized branch into an ordered stack of small pull requests, with a reason, a test point and the exact git commands for each part.
$5
PR Splitter: Break a Giant PR into Reviewable Stacks
Example session with this skill installed
Split my feature/checkout branch against main into small PRs, about 30 changed lines each.
- Read your context and instructions
- Compiled the pr splitter
Summary
Branch feature/checkout against main: 11 planned files in 6 parts. This is the real script output on the bundled demo diff with --max-lines 30.
| # | part | files | +/- | depends on | branch |
|---|---|---|---|---|---|
| 1 | Dependencies, build and CI configuration | 2 | +3/-1 | - | split/feature-checkout/01-deps-and-config |
| 2 | Schema and migrations | 1 | +2/-0 | - | split/feature-checkout/02-schema |
| 3 | Changes in shop/cart | 2 | +12/-0 | - | split/feature-checkout/03-shop-cart |
| 4 | Changes in shop/payments | 3 | +22/-2 | 3 | split/feature-checkout/04-shop-payments |
| 5 | Changes in web/src | 2 | +8/-2 | - | split/feature-checkout/05-web-src |
| 6 | Documentation | 1 | +4/-0 | - | split/feature-checkout/06-docs |
Part 1: Dependencies, build and CI configuration
Why: Manifest, lockfile and CI changes go first so every later part builds against them.
Run as one command; it stops at the first failure:
cd "$(git rev-parse --show-toplevel)" &&
test -z "$(git status --porcelain)" &&
git switch -c split/feature-checkout/01-deps-and-config "$(git merge-base main feature/checkout)" &&
git --literal-pathspecs checkout feature/checkout -- package.json requirements.txt &&
git commit -q -m 'Dependencies, build and CI configuration'
(Parts 2–6 follow the same format.)
Check the stack
After the last part, this must print nothing:
git diff --stat feature/checkout split/feature-checkout/06-docs
The original branch is never changed. Push each part with a plain git push -u origin <branch>; never force-push.
Connects securely to your tools. The creator never sees your data.
About this skill
Use when a branch has grown too big to review comfortably.
A standard-library Python script reads Git™ diff output (git diff -U0) and plans the stack at file level: dependency, build and CI files first, then schema and migrations, then code grouped by folder and ordered by the import lines it finds in the diff (Python, JavaScript/TypeScript, Go, PHP), with tests kept next to the code they import and documentation last.
Every part gets a branch name, its dependencies, a test point and the commands that build it on a new branch. A final check proves the top of the stack equals your original branch for every planned file, including when you leave paths out. The original branch is never modified and nothing is force-pushed.
Do not use when you only need a commit message, a description for a small pull request, a code review, or help with a merge conflict.
Example prompts
- "This PR is 2,400 lines. Split it into something reviewers will actually read."
- "Plan a stack of pull requests for feature/checkout against main, max 300 lines each."
- "Break my branch into smaller PRs but keep the migrations separate and leave dist/ out."
Limits
Splits by whole files, not by hunks. Import detection is pattern-based for four languages and only sees import lines added on the branch. Whether each part builds or passes is only known after your own test command runs on it.
Independent
Not affiliated with or endorsed by the Git project, any Git host, Anthropic, OpenAI, Cursor or Google. Git is a trademark of Software Freedom Conservancy; other product names are used only to describe compatibility.
Splits by whole files, not by hunks. Import detection is pattern-based for four languages (Python, JavaScript/TypeScript, Go, PHP) and only sees import lines added on the branch. Whether each part builds or passes is only known after your own test command runs on it.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before any payment.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
Fresh listing
Recently published to Agensi
Money-back guarantee
Doesn't do what its page promises? You get your money back.
Trust & safety
Security scan
Security scan passed 9 days ago
Requires