github.split_branch_in_PRs
Split current Git changes into small, cohesive PRs to simplify merging
- License 许可
- Apache-2.0
- 最近更新
- 2026-11-02
- Stars
- ★ 155
- Forks
- 170
01 前言 Front Matter
- model
- sonnet
- description
- Split current Git changes into small, cohesive PRs to simplify merging
03 SKILL.md 正文
Goal
-
Propose how to split the changes between current
HEADof the branch andorigin/masterinto 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.mdwith 5 bullet points explaining what the plan is
- Create a
Workflow
Read Rules
- Read rules about:
- Coding:
.claude/skills/coding.rules.md - Unit tests:
.claude/skills/testing.rules.md
- Coding:
Read the Changes in the Current Git Client
-
Obtain the files that need to be merged with:
git diff --name-status origin/master HEAD ... -
Analyze the difference between the current client and
master(ororigin/master):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 have the changes to an entire file instead of having to split changes in a file across multiple PRs
-
Make sure that changes to files and their testing files are in the same PR
-
Merge low risk / complexity PRs so that there are fewer PRs even if the content of the resulting PR is the sum of multiple simpler ones
- In this case, the description is multiple bullets explain what each smaller unit does
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.txtwith the files changed, e.g.,.claude/skills .claude/templates .claude/notify.sh .claude/settings.local.json - A file
pr<NUM>.pytest.shwith 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.,#!/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
- A file
Report the Output
- Create a file
github_PR_plan.mdwith the plan to split the PRs, following strictly the format in.claude/templates/github_PR_plan.template.md - If the file
github_PR_plan.mdalready exists then updated it removing the PRs already merged based on the currenti git_filesand thegit log - Run the linter on
github_PR_plan.md> 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.shis executable and passes - [ ] Confirm
github_PR_plan.mdpasseslint_text.py
04 同仓库更多 Skills
tutorial_in_60_mins.propagate_docker_changes
Sync tutorial and class-project Docker files to match project_template
tutorial_in_60_mins.merge_markdown
Merge the content of a markdown file into a Jupyter notebook
tutorial_in_60_mins.format
Format a directory to follow the "Learn X in 60 Minutes" tutorial conventions
tutorial_in_60_mins.create
Create a tutorial directory for the Learn X in 60 Minutes conventions
todo.reorg_in_progress
Reorganize ai_task_queue.md so in-progress tasks, not-started tasks, and mislabeled topic headers sit under the right H1 stage
todo.reorg_headers
Reorganize ai_task_queue.md .md so every H2 topic matches ALL TOPICS and every H3 task sits under the right topic, keeping its H1 stage