agentleFS
kabudukabudu/engineering-agent-skills/skills/pr-splitter/SKILL.md

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

  • Other versions4 projects use a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 4

    1. mastra-ai/mastra★ 29ksame name
    2. crbnos/carbon★ 2.8ksame name
    3. dzevs/zynk★ 4same name
    4. 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.

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
  1. Distinctive:

    Treat analysis and execution as separate modes.

    line 14
  2. Distinctive:

    Never merge or close the original or child PRs unless separately authorized.

    line 18
  3. Distinctive:

    Read repository instructions and inspect the clean/dirty state before changing anything.

    line 23
  4. Distinctive:

    Read references/decomposition-playbook.md when boundary or dependency decisions need additional heuristics or examples.

    line 31
  5. Distinctive:

    Do not force independence by duplicating code, weakening tests, introducing temporary compatibility paths, or splitting generated output …

    line 41
  6. Distinctive:

    Before execution, present a decomposition plan containing:

    line 45
  7. Distinctive:

    Treat changelog and release-note entries as semantic artifacts, not generic documentation.

    line 61
  8. Distinctive:

    If a slice needs no changelog entry, record why in the plan or PR description rather than silently omitting it.

    line 67
  9. Distinctive:

    Before execution is complete, reconcile the aggregate changelog against the original changeset.

    line 69
  10. Very specific:

    Create predictably named branches from the exact approved base or parent slice.

    line 75
  11. Distinctive:

    Keep migrations with the first code that requires them, generated artifacts with their source/schema change, tests with the behaviour they …

    line 77
  12. Very specific:

    Create child PRs with concise descriptions stating purpose/review boundary, dependency/base, scope and work deferred to later parts, …

    line 81
  13. Distinctive:

    Do not call the split complete until:

    line 86
  14. Distinctive:

    every original changed path and semantic change is accounted for.

    line 88
  15. Distinctive:

    no temporary files or unrelated working-tree content entered a branch.

    line 93
  16. Distinctive:

    all PR links are reciprocal and the original PR clearly acts as the umbrella.

    line 95
  17. Distinctive:

    If the original head moves, stop mutation, fetch, and refresh the plan/equivalence proof.

    line 98

“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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

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

  1. Read repository instructions and inspect the clean/dirty state before changing anything.
  2. 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.
  3. Inspect PR title/body, reviews, linked issues, CI, commit history, diff statistics, changed paths, and repository ownership boundaries when available.
  4. Define the canonical changeset as the base-to-head diff. Do not assume the commit sequence already represents good review boundaries.
  5. 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

  1. Record all starting refs and verify the remote PR head has not moved.
  2. Preserve tracked and untracked user work. Use isolated worktrees when practical.
  3. Create predictably named branches from the exact approved base or parent slice. A useful pattern is split/<ticket-or-pr>/<nn>-<purpose>.
  4. 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.
  5. 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.
  6. 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.
  7. 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.
  8. Push only approved split branches. Use leases for any rewritten remote branch and never overwrite the original PR head unless explicitly requested.
  9. 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 M linkage to the original PR.
  10. 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.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.