spec-port-diverged-branch
Installation
SKILL.md
Spec-port a commit across diverged branches
When two branches rewrote the same subsystem (for example a runtime migration branch against production main), cherry-picking a main commit produces conflict soup. Instead, treat the commit as a spec and reimplement it natively, engineering the end state so the eventual merge is clean.
1. Triage with a simulation
git fetch origin main
git log --oneline --no-merges HEAD..origin/main # classify incoming commits
git cherry-pick --no-commit <sha>; git status --short # count conflict types
git cherry-pick --abort; git reset --hard HEAD
- Mostly clean hunks: just cherry-pick.
- Many
UUplusDU/UD(modify against delete, both directions): spec-port.