Skip to content
Back to skills

Github.Split Branch In PRs

ASecurity

Split current Git changes into small, cohesive PRs to simplify merging

  • 158 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added November 7, 2026
testinggobashdockertestinggit

Works with

  • cli

Security analysis

A100/100

Scanned November 7, 2026

npx -y skills add gpsaggese/helpers --skill github.split_branch_in_PRs --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Github.Split Branch In PRs?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Github.Split Branch In PRs
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/gpsaggese-github-split-branch-in-prs/badge)](https://www.skillsdirectory.com/skills/gpsaggese-github-split-branch-in-prs)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
description: Split current Git changes into small, cohesive PRs to simplify merging
model: sonnet
---

# Goal

- Propose how to split the changes between current `HEAD` of the branch and
  `origin/master` into small PRs to minimize:
  - The review complexity
  - The risk of breaking the unit tests

- If the task is not perfectly clear or complex, you MUST not perform it, but ask
  for clarifications and create a plan for review
  - Create a `plan.md` with 5 bullet points explaining what the plan is

# Workflow

## Read Rules

- Read rules about:
  - **Coding**: `.claude/skills/coding.rules.md`
  - **Unit tests**: `.claude/skills/testing.rules.md`

## Read the Changes in the Current Git Client

- Obtain the files that need to be merged with:
  ```bash
  git diff --name-status origin/master HEAD
  ...
  ```

- Analyze the difference between the current client and `master` (or
  `origin/master`):
  ```bash
  git diff master...HEAD --name-only
  # or if master is not available locally:
  git diff origin/master...HEAD --name-only
  ```

## Propose PRs
- Propose a set of PRs that decompose the changes in the current Git client, so
  that there are coherent and tightly coupled changes

- Prefer PRs that change entire files, not split a file across PRs

- Keep each file and its test file in the same PR

- Merge low risk / complexity PRs to have fewer PRs, even if the merged PR is the
  sum of simpler ones
  - Describe each merged unit as its own bullet

## Order the PRs
- Start with the PRs that have low risk and touch most files

## Create pytest Commands

- For each PR create:
  - A file `pr<NUM>.files.txt` with the files changed, e.g.,
    ```verbatim
    .claude/skills
    .claude/templates
    .claude/notify.sh
    .claude/settings.local.json
    ```
  - A file `pr<NUM>.pytest.sh` with the pytest command to run to exercise the
    changes by running the tests in all the modified files and make sure the PR
    is running successfully, e.g.,
    ```bash
    #!/bin/bash
    pytest_log \
      dev_scripts_helpers/coding_tools/test \
      dev_scripts_helpers/dockerize/test \
      linters2/test \
      $@
    ```
  - Make this script executable with `chmod +x pr<NUM>.pytest.sh`

## Report the Output

- Create a file `github_PR_plan.md` with the plan to split the PRs, following
  strictly the format in `.claude/templates/github_PR_plan.template.md`
- Say in the file `github_PR_plan.md` how it was generated, with this line right
  after the title:
  ```markdown
  - Generated by `.claude/skills/github.split_branch_in_PRs/SKILL.md`
  ```
- If the file `github_PR_plan.md` already exists then update it, removing
  the PRs already merged based on the current `i git_files` and the `git log`
- Run the linter on `github_PR_plan.md`
  ```bash
  > lint_text.py -i github_PR_plan.md
  ```

# Verification
- [ ] Confirm every changed file is assigned to exactly one PR
- [ ] Confirm each PR's `pr<NUM>.pytest.sh` is executable and passes
- [ ] Confirm `github_PR_plan.md` passes `lint_text.py`
- [ ] The file `github_PR_plan.md` says that it was generated by
      `.claude/skills/github.split_branch_in_PRs/SKILL.md`

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in testing →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.