pr-splitter
하는 일
이 스킬은 큰 코드 변경을 여러 개의 작은 풀 리퀘스트로 나누는 계획을 세웁니다. 원본 브랜치의 백업을 보관하고, 각 부분을 추적해 아무것도 잃지 않도록 합니다.
사용하는 경우
- ✓풀 리퀘스트가 너무 커서 또는 뒤섞여서 제대로 리뷰하기 어려울 때.
- ✓한 브랜치에서 쌓아 올린 풀 리퀘스트나 병렬 풀 리퀘스트를 계획하고 싶을 때.
- ✓리뷰 피드백이 스택의 한 부분을 바꾸고 뒤의 부분을 업데이트해야 할 때.
스킬 링크
https://github.com/mastra-ai/mastra/blob/main/.claude/skills/pr-splitter/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“이 풀 리퀘스트에는 리팩터링과 새 동작이 섞여 있습니다. 더 작은 풀 리퀘스트로 나누는 것을 도와주세요.”
매주 새 스킬 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
자주 묻는 질문
원본 브랜치가 삭제되나요?
아닙니다. 스킬이 백업을 만들고, 분리가 끝날 때까지 원본을 유지합니다.
쌓은 방식과 병렬 방식 풀 리퀘스트를 모두 지원하나요?
네. 나중 작업이 앞선 작업에 의존하면 쌓은 방식을, 변경이 독립적이면 병렬 방식을 고릅니다.
계획 메모를 공유하나요?
아닙니다. 요청하지 않으면 커밋하지 않는 로컬 파일에 메모를 보관합니다.
상세 정보
작성자의 원본 설명
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
- 라이선스
- —
- 업데이트
- 2026. 11. 2.
댓글
- …
이 저장소의 다른 스킬
debugging-difficult-bugs
29k에이전트가 추측이 아니라 실제 프로그램이 실행될 때의 로그를 남겨 어려운 버그를 디버그하도록 돕습니다.
mastra-frontend
29k에이전트가 처음부터 스타일을 만들지 않고, Mastra 플레이그라운드 디자인 시스템의 기성 컴포넌트로 앱 화면을 만들도록 돕습니다.
pr-explainer
29k에이전트가 풀 리퀘스트를 리뷰어가 이해할 수 있도록 독립적인 HTML 페이지로 설명해 줍니다.
ralph-plan
29k에이전트가 짧은 대화를 통해 집중된 구조화 작업 명령을 계획하도록 돕습니다. 작업에 명확한 단계와 점검이 있도록 합니다.