pr-splitter
O que ela faz
Esta skill planeja como dividir uma grande mudança de código em vários pull requests menores. Ela mantém uma cópia de segurança do branch original e acompanha cada parte para que nada se perca.
Quando usar
- ✓Quando um pull request é grande ou confuso demais para ser revisado bem.
- ✓Quando você quer planejar pull requests empilhados ou paralelos a partir de um branch.
- ✓Quando um feedback de revisão muda uma parte de uma pilha e as partes seguintes precisam ser atualizadas.
Link da skill
https://github.com/mastra-ai/mastra/blob/main/.claude/skills/pr-splitter/SKILL.mdCopie e cole na sua IA (Claude, ChatGPT ou Cursor) pedindo para seguir as instruções.
Como usar
O jeito mais fácil: copie a mensagem e cole na sua IA. Ela lê a skill e segue as instruções.
Mensagem pronta para colar
Para Claude Code, Codex ou Cursor: rode na pasta do projeto e a skill fica instalada.
Baixe o SKILL.md e coloque na pasta de skills do seu agente.
Exemplo do que pedir para a IA
“Este pull request mistura refatoração com um comportamento novo. Me ajude a dividi-lo em pull requests menores.”
5 skills novas por semana. 1 minuto de leitura.
Como funciona
O agente salva uma cópia de segurança do branch original, lista os arquivos alterados e os agrupa em unidades de revisão. Depois planeja a pilha, extrai cada parte e confere cada uma antes de seguir em frente.
Conteúdo técnico (SKILL.md original)
Texto original do autor, em inglês, direto do 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
Perguntas frequentes
O branch original será apagado?
Não. A skill faz uma cópia de segurança e mantém o original até a divisão ser concluída.
Pull requests empilhados e paralelos são ambos suportados?
Sim. Ela escolhe pull requests empilhados quando um trabalho depende do anterior, e paralelos quando as mudanças são independentes.
As anotações do planejamento são compartilhadas?
Não. As anotações ficam em um arquivo local que não é commitado, a não ser que você peça.
Detalhes
Descrição original do autor
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
Popularidade
- Estrelas no GitHub
- 29 mil
- Posição no ranking
- #9363
- Licença
- —
- Atualizada em
- 02/11/2026
Comentários
- …
Mais skills deste repositório
debugging-difficult-bugs
29 milAjuda seu agente a depurar um bug difícil registrando o que o programa real faz em tempo de execução, em vez de adivinhar a partir apenas dos testes.
mastra-frontend
29 milAjuda seu agente a criar telas de aplicativo com o sistema de design do playground da Mastra, combinando seus componentes prontos em vez de estilizar do zero.
pr-explainer
29 milAjuda seu agente a transformar um pull request em uma página HTML clara e autocontida que explica a mudança para os revisores.
ralph-plan
29 milAjuda seu agente a planejar um comando de tarefa focado e estruturado por meio de uma conversa curta, para que o trabalho tenha passos e verificações claros.
Skills parecidas
diffs
394 milPermite que seu agente gere um diff real e compartilhável das edições, como link de visualização ou arquivo de imagem, em vez de um resumo escrito à mão.
coding-agent
394 milAjuda seu agente a passar um trabalho grande de programação para o Codex, Claude Code ou OpenCode em segundo plano e acompanhar o andamento.
gh-issues
394 milAjuda seu agente a encontrar issues do GitHub, escolher quais resolver e abrir pull requests com correções, acompanhando os comentários de revisão.