iamcxa/kc-claude-plugins/kc-pr-reorg
Claude Code and agent skill by iamcxa/kc-claude-plugins
- community
Checking that the SKILL.md file is still in the repository.
Use when a feature branch has messy interleaved commits that need reorganization into logical groups before PR review. Triggers include "squash commits", "clean up history", "reorganize commits", "reorder commits", "too many commits". Not for simple squash-all — use git merge --squash instead.
Install
npx vskill@latest install iamcxa/kc-claude-plugins/kc-pr-reorgSKILL.md
The same SKILL.md was published earlier as iamcxa/kc-claude-plugins/kc-pr-reorg.
Commit Reorganization
Non-interactive technique for reorganizing N commits into M logical groups without git rebase -i.
When to Use
- Feature branch with 5+ commits needing logical grouping
- Commits interleaved by concern (feat mixed with test mixed with fix)
- Agent environment where interactive rebase is unavailable
- PR reviewer needs clean, reviewable history
Technique
1. Backup (BLOCKING — never skip)
2. Analyze
List all commits. Categorize each by concern (feat, test, refactor, docs, chore). Note original chronological order — you will need it in step 4.
3. Plan Groups
Present a numbered grouping plan to the user. Recommended ordering:
- docs/design (context first)
- refactor (prep work)
- feat (core implementation)
- test (validates feat)
- chore (tooling, config)
Each group becomes one commit. Commit message descriptions follow the unified language preference — see plugin CLAUDE.md.
Get user approval before proceeding.
4. Reset and Rebuild
Then for each group, cherry-pick its commits in original chronological order within the group:
Repeat per group.
5. Verify (BLOCKING — never skip)
Must be empty. If not, something was lost — investigate before force pushing.
6. Force Push
The adapter validates the effective push destination immediately before it owns the force push and resolves exactly one configured upstream ref instead of synthesizing a same-name remote branch or honoring broad push.default=matching behavior. It refuses a stale transferred-repository remote (including pushurl) and prints, but never executes, the explicit repair command. Resolve any later PR mutation from that PR's target repository separately; a fork's push destination is not its PR target.
Common Mistakes
| Mistake | Fix | |
|---|---|---|
Skip git clean -fd after reset | New files from old commits remain, break builds | |
| Cherry-pick conflicts cascade | Stop. git reset --hard main, re-plan group boundaries | |
| Group by type ignoring time order | Within each group, preserve original commit order | |
| Skip backup branch | Unrecoverable if something goes wrong | |
Skip git diff verification | Silent data loss — always verify zero diff | |
Use git add -p for splitting | Too slow, error-prone. Cherry-pick whole commits into groups |
Recovery
If rebuild goes wrong at any point:
Start over from step 2 with revised grouping plan.
Decision: Reorg vs Simpler Alternatives
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingkc-pr-flow/skills/kc-pr-reorg/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/iamcxa/kc-claude-plugins/kc-pr-reorg)