_archive/skills-deprecated/mp-rebase/SKILL.md
Rebase or merge target branch into current branch. Use when: "rebase on main", "update from dev", "merge main into branch"
npx skillsauth add MartinoPolo/mpx-claude-code mp-rebaseInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Rebase (default) or merge a target branch into the current branch. $ARGUMENTS
Args: [branch] [--merge]
$ARGUMENTS (if provided)--merge flag → merge mode. Default → rebase modeIf target branch provided in Step 1 → use it.
Otherwise, spawn mp-base-branch-detector agent (via Task tool, subagent_type mp-base-branch-detector, model haiku) with:
git branch -rBased on result:
AskUserQuestion to pick from candidatesAskUserQuestion to specify manually3a. Uncommitted changes:
git status --porcelain
If output is non-empty → AskUserQuestion: "Uncommitted changes detected. Rebase requires a clean working tree."
git stash push -m "Auto-stash before rebase"3b. Remote sync (current branch):
git branch --show-current
git rev-parse --verify origin/<current> 2>/dev/null
If no tracking branch exists → skip to Step 4.
Otherwise:
git fetch origin <current>
git rev-list --left-right --count HEAD...origin/<current>
Based on ahead/behind counts:
git pull --rebase origin <current>git pull --rebase origin <current>git fetch origin <target>
git log HEAD..origin/<target> --oneline
Display incoming commits. If none → report "Already up-to-date" and stop.
Also count local commits ahead: git rev-list origin/<target>..HEAD --count
Complexity check (rebase mode only):
If incoming commits > 15 OR local commits ahead > 15 → ask user with AskUserQuestion:
"This is a large rebase (N incoming, M local commits). Merge the target branch into this branch instead? Merge is safer for large changes."
Options: "Merge instead (Recommended)", "Rebase anyway"
If user picks merge → switch to merge mode.
Rebase mode (default):
git rebase origin/<target>
Merge mode (--merge or switched from complexity check):
git merge origin/<target>
If conflicts occur:
git diff --name-only --diff-filter=U<<<<<<<, =======, >>>>>>>)
c. Simple conflicts (non-overlapping changes, clear intent) → resolve with Edit tool, then git add <file>
d. Complex conflicts (overlapping logic, ambiguous intent) → show both sides to user, ask with AskUserQuestion how to resolvegit rebase --continuegit commit (accept default merge message)After completion, display:
development
Audit all active skills for consistency, convention drift, and common issues. Auto-fixes where possible, reports remaining issues. Use when: "audit skills", "skill audit", "check skills", "lint skills"
testing
Ship finished work: sync base, commit, push, PR, wait for CI green, merge. Use when: "ship it", "ship and merge", "ship this"
development
Scan recent Claude Code sessions for grilling/design discussions, extract decisions, and update CONTEXT.md + DECISIONS.md. Use when: "harvest decisions", "extract decisions from sessions", "update docs from sessions", "sync decisions"
tools
Consolidate CONTEXT.md: remove duplicates, outdated items, tighten language. Use when: "consolidate context", "clean up context", "simplify context", "consolidate requirements"