pr-splitter
Что он делает
Этот скилл планирует, как разбить большое изменение кода на несколько небольших pull request. Он сохраняет копию исходной ветки и отслеживает каждую часть, чтобы ничего не потерялось.
Когда использовать
- ✓Когда pull request слишком большой или запутанный, чтобы его хорошо проверить.
- ✓Когда вы хотите спланировать выстроенные в цепочку или параллельные pull request из одной ветки.
- ✓Когда замечания ревью меняют одну часть цепочки, и последующие части нужно обновить.
Ссылка на скилл
https://github.com/mastra-ai/mastra/blob/main/.claude/skills/pr-splitter/SKILL.mdСкопируйте и вставьте её в ваш ИИ (Claude, ChatGPT или Cursor) с просьбой следовать инструкциям.
Как использовать
Самый простой способ: скопируйте сообщение и вставьте его в свой ИИ. Он прочитает скилл и выполнит инструкции.
Готовое сообщение для вставки
Для Claude Code, Codex или Cursor: запустите в папке проекта, и скилл установится.
Скачайте SKILL.md и положите его в папку скиллов вашего агента.
Пример запроса к вашему ИИ
“В этом pull request смешаны рефакторинг и новое поведение. Помоги разбить его на несколько небольших pull request.”
5 новых скиллов в неделю. 1 минута чтения.
Как это работает
Агент сохраняет копию исходной ветки, перечисляет изменённые файлы и группирует их в единицы для ревью. Затем он планирует цепочку, выделяет каждую часть и проверяет её, прежде чем перейти к следующей.
Технический текст (оригинальный SKILL.md)
Оригинальный текст автора на английском, прямо с GitHub.
PR Splitter
Preserve the original PR as source material, build smaller reviewable PRs intentionally, and track drift locally as review feedback changes the stack.
Required workflow
Snapshot before touching history
- Check
git status. - Create an immutable local reference to the original branch:
git branch backup/original-large-pr. - Do not delete or rewrite the original branch until the split is complete.
- Check
Inventory the original PR
- Inspect
git diff --stat <base>...HEAD,git diff --name-only <base>...HEAD, andgit log --oneline <base>..HEAD. - Classify changes by review unit: prep/refactor, API/type changes, behavior, tests, docs, cleanup, generated/lock files.
- Inspect
Create a local scratchpad
- Write split notes to an uncommitted local file, preferably
.notes/pr-split.md. - Ensure
.notes/is ignored or leave it untracked. Do not commit scratchpad notes unless the user explicitly asks. - Track: original branch, base branch, planned PRs, files/hunks extracted, verification per PR, remaining original diff, and intentional drift from review feedback.
- Write split notes to an uncommitted local file, preferably
Choose the split shape
- Use stacked PRs when later work depends on earlier work.
- Use parallel PRs only when changes are truly independent.
- Use foundation + parallel follow-ups when one shared prep change unlocks independent work.
Extract changes safely
- Prefer fresh branches from the correct base plus selective restore over rewriting messy history.
- Use path-level extraction for clean file ownership:
git checkout backup/original-large-pr -- path/to/file. - Use hunk-level extraction for mixed files:
git restore -p --source backup/original-large-pr -- path/to/file. - Keep each PR independently buildable and reviewable.
Verify each PR independently
- Run the narrowest relevant build, typecheck, lint, and tests for that PR's scope.
- Do not leave tests, docs, or generated files separated from the code they validate unless the split plan explicitly calls for it.
Manage drift deliberately
- Treat reviewer-approved changes as the new source of truth for the stack.
- After changing an earlier PR, rebase dependent PRs onto it and resolve conflicts in favor of the reviewed direction, not blindly in favor of the original branch.
- Compare the evolving stack against
backup/original-large-prto find remaining intent, not to force byte-for-byte equality. - Record intentional differences in
.notes/pr-split.md.
Use range-diff for rewritten stacks
- Use
git range-diffafter rebases, conflict resolution, or force-pushes to understand what changed. - Summarize meaningful range-diff results for reviewers when updating a stacked PR.
- Use
PR description pattern
Keep PR descriptions concise and reviewer-facing:
## Summary
This is PR N of M split from a larger change.
## Scope
- ...
## Intentionally excluded
- Follow-up PR will handle ...
## Verification
- ...
Do not put the full split ledger in PR descriptions. Keep detailed extraction notes and drift tracking in .notes/pr-split.md.
Scratchpad template
# PR split scratchpad
Original branch: backup/original-large-pr
Base branch: main
## Planned PRs
1. branch-name
- Scope:
- Files/hunks extracted:
- Verification:
- Changeset: (package names, bump type, scoped message)
- Status:
## Remaining original intent
- ...
## Drift notes
- Date / branch / reason:
Changesets
Each split PR must carry its own changeset scoped to the changes in that PR. Do not keep the original changeset from the source branch — it covers the full combined change and does not belong in any single split PR.
After extracting changes into a split branch:
- Delete any changeset files carried over from the original branch. These were written for the combined diff and will produce incorrect changelog entries.
- Create a new changeset for each PR using the CLI (see
.mastracode/commands/changeset.md):pnpm changeset -s -m "your scoped message" (--major | --minor | --patch) pkg-name - Scope the message to that PR's changes only. The changeset message should describe what this specific PR does, not the full original feature.
- Include only the packages actually changed in this PR. If the original changeset listed five packages but this PR only touches
@mastra/core, the new changeset should only reference `@ma
Частые вопросы
Будет ли исходная ветка удалена?
Нет. Скилл делает копию и сохраняет исходную ветку, пока разбиение не завершено.
Поддерживаются ли и выстроенные в цепочку, и параллельные pull request?
Да. Он выбирает цепочку, когда следующая работа зависит от предыдущей, и параллельные, когда изменения независимы.
Есть ли общий доступ к заметкам по плану?
Нет. Заметки хранятся в локальном файле, который не попадает в коммит, если вы сами этого не попросите.
Подробности
Оригинальное описание автора
Use when breaking a large, complex, messy, or hard-to-review pull request into multiple smaller PRs; planning stacked PRs; extracting independent changes from a branch; splitting mixed refactor and behavior changes; managing drift after review feedback; rebasing follow-up PRs as earlier PRs change; or preserving original branch intent while shipping incrementally.
repo: mastra-ai/mastra
Популярность
- Звёзды на GitHub
- 29k
- Место в рейтинге
- #9363
- Лицензия
- —
- Обновлён
- 02.11.2026
Комментарии
- …
Другие скиллы из этого репозитория
debugging-difficult-bugs
29kПомогает агенту отлаживать сложный баг, записывая, что реально делает программа во время работы, а не угадывая по одним тестам.
mastra-frontend
29kПомогает агенту создавать экраны приложений с дизайн-системой Mastra playground, комбинируя готовые компоненты, а не стилизуя всё с нуля.
pr-explainer
29kПомогает агенту превратить pull request в понятную самодостаточную HTML-страницу, которая объясняет изменение рецензентам.
ralph-plan
29kПомогает агенту спланировать структурированную задачу через короткий обмен репликами, чтобы у работы были понятные шаги и проверки.
Похожие скиллы
diffs
394kПозволяет агенту создать настоящее сравнение правок в виде ссылки или файла изображения, которым можно поделиться, вместо ручной сводки.
coding-agent
394kПомогает агенту передать большую задачу по коду в Codex, Claude Code или OpenCode как фоновому исполнителю, а затем проверять ее ход.
gh-issues
394kПомогает агенту находить задачи GitHub, выбирать, над какими работать, и открывать запросы на слияние с исправлениями, включая ответы на комментарии рецензентов.