merge-and-rebase
Installation
SKILL.md
Merge and Rebase
The user has finished a change on a feature branch. Carry it through four stages: commit and push, open a request against trunk, merge it, then rebase the feature branch onto the new trunk. Stop and ask whenever the repository state contradicts what the user described.
Before Starting
Establish the ground truth from the repository itself, not from assumptions:
- The current branch, and confirmation that it is not the trunk branch. If the user is standing on trunk, stop and ask what they intended.
- The trunk branch name as this repository actually uses it —
main,master,develop, or something else. Read it from the remote's default branch or the repo's own conventions rather than guessing. - The hosting platform and remote, so you know whether the target is a GitHub pull request, a GitLab merge request, or another forge's equivalent.
- Whether the working tree has uncommitted changes, and whether they are all part of the feature the user means to ship.
Report anything surprising — unrelated modified files, a detached HEAD, an unexpected upstream, an already-open request for this branch — before acting on it.
Stage 1: Commit and Push
Review the actual diff before writing anything. Understand what changed and why.