mcore-split-pr
nvidia/skills
필요한 CODEOWNERS 심사자 그룹의 수를 줄이기 위해 하나의 PR을 여러 개의 PR로 나눌 수 있습니다.
...모든 것을 확장하십시오mcore-split-pr에 대하여
mcore-split-pr 스킬은 크기가 큰 Megatron-LM 풀 리퀘스트를 여러 개의 작은 PR로 분할하는 데 도움을 줍니다. 이를 통해 각 PR이 가능한 한 적은 수의 CODEOWNERS 리뷰어 그룹에만 영향을 미치도록 합니다. 이 스킬은 구체적인 리뷰 부담 문제를 해결하는데, 코어 코드, 예제, 도구, 훈련용 디렉터리가 모두 포함된 PR의 경우 다수의 리뷰어 그룹이 참여하여 병합 과정이 지연되는 반면, 단일 디렉터리에만 국한된 PR은 해당 디렉터리의 리뷰어들만 필요하기 때문입니다.
이 작업 흐름은 세 단계로 구성됩니다. 첫째, gh CLI를 사용해 PR의 세부 정보와 diff 통계를 가져오고, .github/CODEOWNERS 파일을 파싱하여 파일 패턴과 소유자 그룹 간의 관계를 파악하며, 현재 해당 PR에 필요한 고유한 리뷰어 그룹의 수를 집계합니다. 둘째, CODEOWNERS 그룹별로 파일을 분류하여 테스트 코드가 검증하는 실제 프로덕션 코드와 함께 유지되도록 하고, 서로 다른 PR 간의 종속 관계(예: 한 PR에서 이름이 변경된 심볼을 다른 PR이 참조하는 경우)를 표시하며, 각 분할된 PR이 독립적으로 병합될 수 있도록 조치한 뒤, 이 계획을 표 형태로 제시하여 사용자의 승인을 받습니다. 셋째, 승인이 완료된 후에만 올바른 기준 브랜치에서 브랜치를 생성하고, git apply를 통해 파일 단위의 diff를 적용한 뒤 커밋을 수행하여 사용자의 포크에 푸시합니다. 이 스킬은 항상 PR을 초안 상태로 생성하며, 상위 저장소에 직접 푸시하지 않고, 원본 PR을 축소하는 강제 푸시를 실행하기 전에 반드시 사용자의 확인을 받습니다. 또한 현재 작업자가 PR의 작성자가 아닌 경우 원본 작성자에게 공을 돌립니다.
주요 사용 대상은 규모가 큰 풀 리퀘스트를 다루는 Megatron-LM 기여자 및 유지보수 담당자들로, 각 분할된 PR이 독립적으로 리뷰되고 병합될 수 있도록 하면서도 동시에 리뷰어 그룹의 수를 줄이고자 하는 사람들입니다. 이 스킬은 PR의 URL 또는 번호를 인자로 받아 사용자가 직접 호출할 수 있습니다.
자주 묻는 질문
PR을 분할하면 어떤 문제가 해결되나요?
PR당 필요한 CODEOWNERS 리뷰어 그룹의 수를 최소화함으로써 리뷰 부담을 줄여줍니다. 다만 분할된 각 PR은 여전히 독립적으로 병합되고 리뷰될 수 있어야 합니다.
직접 메인 저장소에 푸시하나요?
아닙니다. 항상 PR을 초안 상태로 생성한 뒤 사용자의 포크에 푸시할 뿐, 상위 저장소에는 직접 푸시하지 않습니다. 또한 원본 PR을 축소하는 강제 푸시를 실행하기 전에 반드시 사용자의 확인을 받습니다.
분할 과정에서 테스트 파일은 어떻게 처리되나요?
테스트 파일은 검증하는 실제 프로덕션 코드와 함께 전송됩니다. 이 스킬은 리뷰어 그룹의 수를 줄이기 위해 테스트 파일을 별도의 PR로 분할하는 것을 의도적으로 피합니다.
하나의 분할된 PR이 다른 PR에 종속될 경우 어떻게 되나요?
의존 관계를 명확하게 표시하고, 후속 PR들이 이를 참조할 수 있도록 첫 번째 PR에 백워드 호환형 별명, 재수출 항목 또는 쉘 파일을 추가합니다. 또한 필요한 병합 순서도 함께 안내합니다.
실행에 필요한 요소는 무엇인가요?
해당 저장소에 대해 인증된 gh CLI, 상위 저장소를 포함하는 로컬 브랜치, 그리고 브랜치를 푸시할 사용자의 포크가 필요합니다. 분할 작업을 실행하기 전에 반드시 사용자의 승인을 기다립니다.
모든 파일
5개의 파일SKILL.md4.4 KB보기skill.oms.sig4.5 KB보기BENCHMARK.md2.7 KB보기evals/evals.json0.0 KB보기skill-card.md2.4 KB보기
Split a large pull request into multiple smaller PRs, where each PR touchesthe fewest possible CODEOWNERS reviewer groups. The goal is to reduce reviewburden: a PR that only touches megatron/core/ needs only the core reviewers,while a PR that also touches examples/, tools/, and megatron/training/pulls in many additional groups.
Answer-First Constraints
For split-planning questions, lead with these constraints before the fullworkflow:
- Minimize CODEOWNERS reviewer groups per PR, but each resulting PR must stillbe independently mergeable and reviewable.
- Tests travel with the production code they validate; do not split tests into aseparate PR just to reduce reviewer groups.
- If PR B depends on symbols renamed in PR A, call out the dependency and putbackward-compatible aliases, re-exports, or shims in PR A when needed.
- Wait for user approval before execution.
- Execution creates draft PRs from the right base, applies file-scoped diffswith
git diff upstream/main..<source-branch> -- <paths> | git apply, pushesto the user's fork, and never pushes directly to upstream.
Workflow
1. Analyze the PR
- Fetch the PR details:
gh pr view <number> --repo NVIDIA/Megatron-LM --json title,body,headRefName,authorandgh pr diff <number> --repo NVIDIA/Megatron-LM --stat. Also determine the current GitHub user withgh api user --jq .login. - Parse
.github/CODEOWNERSto build a mapping from file path patterns to owner groups. - For each changed file in the PR, determine which CODEOWNERS groups would be required to review it.
- Build a summary table grouped by CODEOWNERS group, showing which files pull in which groups.
- Count the total number of distinct reviewer groups the PR currently requires.
2. Propose a split that minimizes reviewer groups per PR
The primary optimization goal: minimize the number of CODEOWNERS reviewer groups required for each resulting PR.
Strategy:
- Cluster files by their CODEOWNERS groups. Files owned by the same set of groups naturally belong together.
- Identify the largest cluster — this becomes the first (and usually largest) PR.
- Remaining files form one or more additional PRs, each ideally requiring only one or two reviewer groups.
- If a split creates a dependency (e.g., PR B uses symbols renamed in PR A), the dependent PR must be merged after the first. Note this explicitly.
- Each PR must be independently mergeable to main — no broken imports, no missing symbols. Backward-compatible aliases and re-export stubs in the first PR can make this possible.
Present the proposed split as a table:
- PR name/description
- Files included
- CODEOWNERS groups required
- Dependencies on other PRs (if any)
Wait for user approval before proceeding.
3. Execute the split (after user approval)
For each new PR:
- Create a new branch from the appropriate base (
main, or a dependency PR's branch). - Extract the relevant changes:
git diff upstream/main..<source-branch> -- <file paths> | git apply. - Stage, commit with a clear message, and push to the user's fork.
- Create the PR as a draft (per repo contributing guidelines).
- If the original PR needs to be narrowed in scope, confirm with the user before force-pushing.
- Report all PR URLs when done.
Important guidelines
- Always create PRs as drafts and push to the user's fork, never directly to upstream.
- Backward-compatible changes (aliases, re-exports, deprecation shims) should go in the first PR so subsequent PRs can depend on them.
- Test files should go with the production code they test, not in a separate PR.
- Prefer a single clean commit per split PR over replaying the original commit history.
- If a file is hard to categorize (e.g., it touches two groups), ask the user which PR it should go in.
- If the current GitHub user is not the author of the original PR, each new PR's description must explicitly credit the original author (e.g., "Original changes by @ in #").
모든 파일
0개 파일mcore-split-pr 설치
해당 스킬 파일들을 다운로드하여 .claude/skills/ 디렉토리에 압축을 풀어 저장해 주세요.
ZIP 다운로드저장소를 클론하고 스킬 파일을 프로젝트에 복사하세요.
git clone https://github.com/NVIDIA/skills/blob/main/skills/mcore-split-pr/SKILL.md # Copy SKILL.md to your .claude/skills/ directory
복사





집
