pr-splitter
Skill3 starsChanged 12 days agoMITView on GitHub
Analyse an oversized pull request or proposed branch changeset and decompose it into smaller, dependency-aware, independently reviewable pull requests. Use when a PR is too large for effective review or when the user asks to split, stack, or repackage a feature branch without changing its final behaviour. Do not use for ordinary PR review or simple branch cleanup.
4 other projects use a version of this.
Adopted by
Most recently taken up by
- diegopacheco/agent-skillstheir own version, first seen Nov 8, 2026
- crbnos/carbontheir own version, first seen Nov 7, 2026
- mastra-ai/mastratheir own version, first seen Oct 8, 2026
- dzevs/zynktheir own version, first seen Jun 24, 2026
Other versions4 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 4
- mastra-ai/mastra★ 29ksame name
- crbnos/carbon★ 2.8ksame name
- dzevs/zynk★ 4same name
- diegopacheco/agent-skills★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository5 other files it gives its agents.
- lazarus-modeSkill
- php-best-practicesSkill
- rust-best-practicesSkill
- rust-portSkill
- rust-reviewSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
17 rules. 0 are common, 15 are distinctive, and 2 are very specific to this project.
0
Common
Most of the 4 edited versions we read keep these.
15
Distinctive
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- could be automatic: a setting could enforce it
- Distinctive: line 14
Treat analysis and execution as separate modes.
- Distinctive: line 18
Never merge or close the original or child PRs unless separately authorized.
- Distinctive: line 23
Read repository instructions and inspect the clean/dirty state before changing anything.
- Distinctive: line 31
Read references/decomposition-playbook.md when boundary or dependency decisions need additional heuristics or examples.
- Distinctive: line 41
Do not force independence by duplicating code, weakening tests, introducing temporary compatibility paths, or splitting generated output …
- Distinctive: line 45
Before execution, present a decomposition plan containing:
- Distinctive: line 61
Treat changelog and release-note entries as semantic artifacts, not generic documentation.
- Distinctive: line 67
If a slice needs no changelog entry, record why in the plan or PR description rather than silently omitting it.
- Distinctive: line 69
Before execution is complete, reconcile the aggregate changelog against the original changeset.
- Very specific: line 75
Create predictably named branches from the exact approved base or parent slice.
- Distinctive: line 77
Keep migrations with the first code that requires them, generated artifacts with their source/schema change, tests with the behaviour they …
- Very specific: line 81
Create child PRs with concise descriptions stating purpose/review boundary, dependency/base, scope and work deferred to later parts, …
- Distinctive: line 86
Do not call the split complete until:
- Distinctive: line 88
every original changed path and semantic change is accounted for.
- Distinctive: line 93
no temporary files or unrelated working-tree content entered a branch.
- Distinctive: line 95
all PR links are reciprocal and the original PR clearly acts as the umbrella.
- Distinctive: line 98
If the original head moves, stop mutation, fetch, and refresh the plan/equivalence proof.
“Common” is measured: kept by at least 6 in 10 of the 4 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
PR Splitter
Purpose
Turn one oversized PR into a coherent review series whose combined result is equivalent to the original changeset. Choose boundaries from product behaviour, architecture, data dependencies, and validation needs—not file counts or arbitrary line limits.
Authorization Boundary
Treat analysis and execution as separate modes.
- A request to analyse, assess, plan, or propose a split is read-only. Do not create or push branches, open PRs, post comments, change the original PR, or rewrite commits.
- Create branches or PRs only when the user explicitly asks to perform the split. Resolve the repository, original PR/head, base branch, and fork/canonical remotes from repository and session evidence; ask only for missing or ambiguous inputs. Keep the original PR open as an umbrella unless separately authorized otherwise.
- Never merge or close the original or child PRs unless separately authorized.
- Recheck authorization immediately before pushing branches, creating PRs, or editing the original PR description/comments.
Establish the Changeset
- Read repository instructions and inspect the clean/dirty state before changing anything.
- Fetch the relevant remotes and resolve the exact base, PR head, merge base, and current remote commit IDs. Detect a head update before any later mutation.
- Inspect PR title/body, reviews, linked issues, CI, commit history, diff statistics, changed paths, and repository ownership boundaries when available.
- Define the canonical changeset as the base-to-head diff. Do not assume the commit sequence already represents good review boundaries.
- Inventory behaviour, schema/migrations, generated output, configuration, tests, documentation, operational scripts, and every changelog or release-note entry. Map each entry to the behaviour it describes and identify cross-repository or unpublished-package dependencies.
Design the Split
Read references/decomposition-playbook.md when boundary or dependency decisions need additional heuristics or examples. Mandatory workflow and safety rules are defined here.
Build a dependency graph before proposing branches. Each slice must leave its target buildable and operationally safe, expose an understandable contract, and allow meaningful validation at that stage. Make migration/configuration ordering and safe rollback with dependants explicit. Prefer slices that each have one clear purpose, a bounded blast radius, meaningful validation, and a reviewer who can understand the change without reconstructing later PRs.
Choose one topology:
- Sibling PRs: each branch targets the original base and is independently mergeable. Prefer this when slices are genuinely independent.
- Stacked PRs: each branch targets the preceding slice. Use this when schema, shared contracts, generated models, or foundational refactors must land first.
- Hybrid: independent sibling groups containing short internal stacks. Use only when it makes the dependency graph materially clearer.
Do not force independence by duplicating code, weakening tests, introducing temporary compatibility paths, or splitting generated output from its source definition. Avoid PRs that are only mechanical leftovers unless they are a legitimate prerequisite with their own validation.
Analysis Deliverable
Before execution, present a decomposition plan containing:
- original PR/head/base and pinned commit IDs;
- recommended topology and why;
- ordered slice names and concise purposes;
- base branch and dependency for every slice;
- principal paths/behaviours included;
- migrations, generated artifacts, configuration, tests, docs, and a changelog allocation/reconciliation plan;
- validation required per slice;
- cross-slice risks and reviewer notes;
- coverage proof that every original change is assigned exactly once or intentionally superseded.
Flag slices that cannot safely be reviewed or merged independently. Prefer fewer coherent PRs over many tiny PRs.
Changelog Allocation and Reconciliation
Treat changelog and release-note entries as semantic artifacts, not generic documentation. Allocate each entry to exactly one slice: the earliest child PR that fully delivers the behaviour described. A foundation slice must not claim behaviour that only becomes available in a later slice.
- For sibling PRs, each branch contains only entries for its independently delivered behaviour.
- For stacked PRs, each child diff against its immediate parent adds only that child's entries; merging the stack in order must produce every intended entry exactly once.
- Preserve the repository's release layout and conventions. Do not place new work in a historical released section.
- Consolidate incremental or duplicate wording into concise outcome-focused entries, without broadening claims beyond the slice.
- If a slice needs no changelog entry, record why in the plan or PR description rather than silently omitting it.
Before execution is complete, reconcile the aggregate changelog against the original changeset. Document any intentional wording, placement, deduplication, or omission as an approved metadata difference in the equivalence proof.
Execute an Approved Split
- Record all starting refs and verify the remote PR head has not moved.
- Preserve tracked and untracked user work. Use isolated worktrees when practical.
- Create predictably named branches from the exact approved base or parent slice. A useful pattern is
split/<ticket-or-pr>/<nn>-<purpose>. - Reuse whole commits only when they already match a slice. For tangled commits, repartition the diff semantically; do not preserve poor commit boundaries at the cost of poor PR boundaries.
- Keep migrations with the first code that requires them, generated artifacts with their source/schema change, tests with the behaviour they prove, and changelog entries with the slice that fully delivers the described outcome.
- Validate each slice against its declared base before pushing, including its changelog claims under the policy above. A stacked child must be tested with its parent applied, not against the ultimate base alone.
- Prove aggregate equivalence: compare the reconstructed final tree with the original head, account for original commits and cross-cutting hunks, verify migrations/generated output, aggregate diff statistics, and configuration defaults, and run the original branch’s required validation. Prefer exact tree equality; keep cleanup separate and obtain user approval. Document approved cleanup or metadata differences. Apply the changelog policy above to the aggregate, checking for duplicates, contradictory claims, empty headings, and conflict markers.
- Push only approved split branches. Use leases for any rewritten remote branch and never overwrite the original PR head unless explicitly requested.
- Create child PRs with concise descriptions stating purpose/review boundary, dependency/base, scope and work deferred to later parts, validation, independent deployability, required merge order, and
Part N of Mlinkage to the original PR. - Link every child from the original umbrella PR and every child back to the umbrella. For stacked PRs, also link the immediate predecessor/successor and state the required merge order. The umbrella lists status and dependencies; verify child bases after each merge rather than assuming automatic retargeting.
Completion Gate
Do not call the split complete until:
- every original changed path and semantic change is accounted for;
- changelog allocation and child/aggregate reconciliation satisfy the policy above;
- each child diff is reviewable against its actual base and aggregate equivalence is proven;
- required tests and repository checks pass or failures are precisely documented;
- branch targets and PR dependencies are correct;
- no temporary files or unrelated working-tree content entered a branch;
- remote child refs match local heads;
- all PR links are reciprocal and the original PR clearly acts as the umbrella;
- the original PR remains unmerged/open unless the user explicitly requested otherwise.
If the original head moves, stop mutation, fetch, and refresh the plan/equivalence proof. If validation reveals a dependency, combine slices or stack them and revise links/merge order. If permissions or branch protection block execution, preserve local refs and report the exact blocker.
Report created branches/PRs, topology, validation, equivalence evidence, CI state, preserved local files, and remaining merge-order or rollout risks.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

