| name | rebase |
| description | Use when the user asks to rebase the current branch onto another branch or update branch history without merging. |
| argument-hint | [target-branch] (defaults to master/main) |
input = $ARGUMENTS
Rebase the current feature branch onto a target branch. Goal: clean linear history, ready to push.
Conflict Resolution
Heuristics:
- Lockfiles, migrations, config, version bumps — accept the target branch version (latest agreed-upon state).
- Refactored-away code — the target's removal wins. Rewire to the new location/API.
- Additive conflicts (both sides add independent code) — keep both, but verify structural integrity: run the project's formatter/parser immediately after resolution. Conflict boundaries often leave orphan closing tags, duplicate brackets, or stray blocks that grep won't catch but a parser will.
Partial survival check: When a resolution keeps usage of a symbol (component, function, import), verify the declaration and import also survived. Grep the resolved file for every feature-side symbol before continuing.
!cat ~/.claude/skills/migration-reconciliation.md
Flow
- Present rebase plan. Commits ahead, target branch. Start after presenting.
- Rebase. Resolve conflicts per heuristics above; run the formatter/parser after each resolution to catch structural damage early.
- Reconcile migrations if any migration files were touched (re-chain + apply to local DB if running).
- Run quality gates — rebase bypasses pre-commit hooks; QG is the only safety net. Use the project's gate commands from TOOLS.md.
- Force-push with
--force-with-lease. Invoking /rebase is intent to push; no additional confirmation needed.
Report: commits applied/dropped, conflicts resolved, migration reconciliation results, quality gate results.