Skip to content
Skills Library
Programming · Automation

split-to-prs

/split-to-prs

Split a large branch or a pile of uncommitted work into small, reviewable pull requests on GitHub, GitLab or Forgejo: snapshot to a backup ref first, propose slices, wait for approval, then branch, stage named files or hunks, commit, push and open PRs with forge pr_create. Use for 'split this into PRs', 'break this branch up', 'découpe en plusieurs PR'.

Repository
navin ↗
Licence
AGPL-3.0
Last repository change
26.10.2026

Assessment and security

100/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
1
Scripts
0
HTML comments
0
URLs in SKILL.md
0
Deprecation

No signals detected. Repository changed on 26.10.2026, without references to retired models or APIs.

Licence

AGPL-3.0, copyleft: przeróbki udostępniane innym muszą mieć tę samą licencję.

What it does and when to use it

Split a large branch or a pile of uncommitted work into small, reviewable pull requests on GitHub, GitLab or Forgejo: snapshot to a backup ref first, propose slices, wait for approval, then branch, stage named files or hunks, commit, push and open PRs with forge pr_create. Use for 'split this into PRs', 'break this branch up', 'découpe en plusieurs PR'.

Triggers from the description

split this into PRsbreak this branch updécoupe en plusieurs PR
Original author description

Split a large branch or a pile of uncommitted work into small, reviewable pull requests on GitHub, GitLab or Forgejo: snapshot to a backup ref first, propose slices, wait for approval, then branch, stage named files or hunks, commit, push and open PRs with forge pr_create. Use for 'split this into PRs', 'break this branch up', 'découpe en plusieurs PR'.

How it works

  1. Hard rules
  2. 1. Check the state
  3. 2. Propose slices
  4. 3. Execute (after approval)
  5. 4. Report
Original SKILL.md headings · 82 lines, 656 words
SKILL.md preview
---
name: split-to-prs
description: "Split a large branch or a pile of uncommitted work into small, reviewable pull requests on GitHub, GitLab or Forgejo: snapshot to a backup ref first, propose slices, wait for approval, then branch, stage named files or hunks, commit, push and open PRs with forge pr_create. Use for 'split this into PRs', 'break this branch up', 'découpe en plusieurs PR'."
metadata: {"navin":{"emoji":"🪚","category":"devops","requires":{"bins":["git"]}}}
---

# Split work into PRs

Turn one big change (a long branch, uncommitted edits, or both) into a few pull
requests that each make sense on their own.

Tools: `git` (status, diff, log, switch, add, commit, push, stash), `exec` only for
what the git tool does not model (backup ref, hunk staging), and `forge` action
`pr_create` for the requests.

## Hard rules

- **No branch, commit, push or PR until the user approves the plan.** Inspecting is fine.
- Never discard work. No `reset --hard`, `checkout -- .`, `clean`, `branch -D`,
  force push or `stash drop` without the user's explicit approval for that exact command.
- Recoverable snapshot first, before the first write:
  ```bash
  ts=$(date +%Y%m%d-%H%M%S)
  snap=$(git stash create)            # empty output means the tree is clean
  git update-ref "refs/backup/pre-split-$ts" "${snap:-HEAD}"
  ```
  `git stash create` records the uncommitted work as a commit without touching the
  tree or the stash list. Tell the user the ref name; it is how they get everything back
  (`git stash apply refs/backup/pre-split-<ts>` or `git switch -c rescue refs/backup/pre-split-<ts>`).
- Stage only the files or hunks named in the approved slice. Never `git add -A`,
  `git add .` or `commit -a`.
- Keep the backup ref at the end. Only the user deletes it.

## 1. Check the state

1. Default branch: `forge` reads it for PRs; locally `git symbolic-ref refs/remotes/origin/HEAD`
   (fall back to `main` / `master`). `git fetch` first so the comparison is fresh.
2. What differs from it: `git log --oneline <default>..HEAD`, `git diff --stat <default>...HEAD`,
   plus uncommitted work (git action=status, git action=diff, staged and unstaged).
3. Ownership signals: `CODEOWNERS` (`.github/`, `.gitlab/`, root, `docs/`), top-level
   folders, packages in a monorepo. Changes owned by different reviewers usually belong
   in different PRs.

## 2. Propose slices

- One line per slice: a PR title, and a one-line scope when the title alone is unclear.
- List the files (and, when a file is shared, which hunks) in each slice.
- Default: **independent PRs**, each based on the default branch and mergeable in any order.
- Stack (PR 2 based on PR 1's branch) only for a real dependency (PR 2 does not build or
  pass tests without PR 1). Say why.
- Several slices: add a small diagram of the slices and their dependencies (archify
  HTML+SVG when the user wants a visual, otherwise a short mermaid block).
- Name what stays out (debug files, unrelated edits) as "leftovers".
- Ask: "OK to go with this plan?" and wait.

## 3. Execute (after approval)

For each slice, in dependency order:

1. `git action=switch create=true name=<branch> commit=<base>` (base = default branch,
   or the previous slice's branch when stacked).
2. Bring the slice's changes in:
   - whole files from the snapshot: `git checkout refs/backup/pre-split-<ts> -- <paths>`
     (exec), or from the original branch: `git checkout <source-branch> -- <paths>`;
   - part of a file: write the slice's hunks to a patch file and stage only them:
     ```bash
     git diff <base> refs/backup/pre-split-<ts> -- path/file.py > /tmp/slice-1.patch
     # edit the patch down to the hunks of this slice, then:
     git apply --cached --check /tmp/slice-1.patch && git apply --cached /tmp/slice-1.patch
     ```
     The git tool's `add` stages whole paths; `git apply --cached` through exec is the
     non-interactive hunk staging (never `add -p`, it hangs without a TTY).
3. `git action=add paths=[...]` for whole files, `git action=diff staged=true` to check
   exactly what is staged, then `git action=commit message="..."`.
4. Run the project's quick checks (build / tests) when they exist.
5. `git action=push set_upstream=true`, then `forge action=pr_create title=... body=...
   base=<base>`. The body says what the slice does and, when stacked, which PR it builds on.

After the last slice, switch back to the branch the user was on.

## 4. Report

- Each PR: title and URL, independent or stacked on which one.
- Leftovers: what was not included and where it still lives (the original branch, the
  working tree, or the backup ref).
- The backup ref name, kept on purpose.

Versions

RepositoryScoreLicence
This page · Navinspire-ia/navin100AGPL-3.0
kensaurus/cursor-kenji100MIT

Database snapshot: 13.11.2026 · package version f93a86bcf80e (SHA-256 digest of the entire package)

Downloads in the last 30 days: 0 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 100split-branch
    Split a branch with N commits into N branches with 1 commit each. Use when the user asks to split a branch into single-commit branches.
  • 100split-pr-stack
    Splits a large change or pull request into a dependency-ordered stack of small draft PRs that each pass checks alone, proves the stack ends on the original tree, leaves the original branch and PR untouched, and never merges. Use when asked to split a PR into a stack, break a…
  • 100forgejo
    Work with Forgejo code, issues, pull requests, comments, files and CI status. Find repositories, clone and push with git, list and read issues and pull requests, create and update issues, create pull requests, comment, read the changed files of a pull request, check the CI…
  • 95stacked-prs
    Split large changes into reviewable stacked pull requests, maintain fixes in their owning slice, and land the stack in dependency order. Use when splitting a large branch or PR, updating a PR stack after review, carrying fixes through dependent branches, or merging stacked PRs…
  • 95pr-review
    Reviews pull requests with scope validation, requirements compliance, and line comments. Use when reviewing GitHub or GitLab PRs.
  • 100engineering-small-prs
    Use when planning, splitting, shrinking, or sequencing large features, refactors, migrations, or pull requests into small reviewable PRs or CLs. TRIGGER on "split this PR", "this diff is too large", "stacked PRs", "change sequence", "reviewable chunks", "migration plan", "how…

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.