From clean-pr
Suggest how to decompose a large or unfocused PR into smaller, focused PRs
npx claudepluginhub nstrayer/clean-pr --plugin clean-pr[base-branch]# PR Split Recommendation Analyze the current branch's changes and recommend how to decompose them into smaller, focused PRs. This command produces a plan only -- it does not modify git history or create branches. ## Workflow ### 1. Determine Base Branch If an argument is provided, use it as the base branch name. Otherwise: 1. Try `gh pr view --json baseRefName -q .baseRefName 2>/dev/null` 2. Fall back to `main` or `master` via `git rev-parse --verify` 3. If neither works, ask the user Then resolve the base branch to its remote tracking ref following the **Base Branch Detection** proc...
/splitSplits large PRs into domain-specific smaller PRs: classifies commits by domain (security, frontend, backend, etc.), analyzes dependencies, recommends strategy, optionally executes git branches.
/splitSplits the current Claude session into a new jj change by extracting the session ID from the system reminder and running `jjagent split <session-id>`, creating a new change part for future changes.
Analyze the current branch's changes and recommend how to decompose them into smaller, focused PRs. This command produces a plan only -- it does not modify git history or create branches.
If an argument is provided, use it as the base branch name. Otherwise:
gh pr view --json baseRefName -q .baseRefName 2>/dev/nullmain or master via git rev-parse --verifyThen resolve the base branch to its remote tracking ref following the Base Branch Detection procedure in ${CLAUDE_PLUGIN_ROOT}/skills/pr-cleanliness/SKILL.md. Use the resolved <ref> (typically origin/<base>) for all subsequent git commands.
Run these commands, using <ref> (the resolved ref from step 1):
# List of commits on this branch
git log <ref>...HEAD --oneline --no-merges
# Changed files with stats
git diff <ref>...HEAD --stat
# Full diff for analysis
git diff <ref>...HEAD --name-status
# Commit details to understand groupings
git log <ref>...HEAD --format="%h %s" --no-merges
Identify logical groupings by examining:
Output a structured recommendation:
# PR Split Recommendation
**Current PR**: N files, +X/-Y lines, M commits
**Recommendation**: Split into K PRs
## Proposed PRs
### PR 1: [Title] (land first)
**Purpose**: [What this PR accomplishes]
**Files**:
- `path/to/file1.ts` (lines relevant to this concern)
- `path/to/file2.ts`
**Commits that map here**:
- `abc1234` - commit message
- `def5678` - commit message
**Dependencies**: None (base PR)
---
### PR 2: [Title] (land after PR 1)
**Purpose**: [What this PR accomplishes]
**Files**:
- `path/to/file3.ts`
- `path/to/file4.ts`
**Commits that map here**:
- `111aaaa` - commit message
**Dependencies**: PR 1 (uses utility added there)
---
### PR 3: [Title] (independent)
**Purpose**: [What this PR accomplishes]
**Files**:
- `path/to/file5.ts`
**Commits that map here**:
- `222bbbb` - commit message
**Dependencies**: None (can land independently)
## Landing Order
1. PR 1 - [Title] (no dependencies)
2. PR 3 - [Title] (no dependencies, can land in parallel with PR 1)
3. PR 2 - [Title] (depends on PR 1)
## Notes
- [Any caveats about the split]
- [Files that touch multiple concerns and may need careful splitting]