.agents/skills/worktree-rebase-merge/SKILL.md
Use this skill to finish a worktree feature branch by committing staged work, rebasing the branch onto the target branch, then merging it from the target branch checkout.
dev as the target branch unless the user explicitly names another
target branch.git add . once before deciding whether there is anything to commit.Before changing Git state:
git branch --show-current, git status --short, and
git worktree list.git worktree list. If the target
branch is checked out in another worktree, use that path for the final
merge instead of switching the current worktree to the target branch.git-commit skill and follow its staged-only
approval workflow exactly.git add . once, then rerun
git status --short and inspect the staged diff. If files were staged, use
the git-commit skill and follow its staged-only approval workflow exactly.git add . still leaves no staged changes, continue only if there is no
commit needed; otherwise stop and report that there is nothing to commit.git status --short. Do not start the rebase while
the source worktree still has uncommitted changes unless the user explicitly
decides how to handle them.From the source branch worktree, run git rebase <target-branch>.
When conflicts occur:
git status --short and the conflicted files before editing.--ours or --theirs wholesale unless the user asked for that outcome or
the conflict is clearly mechanical.git rebase --continue.After the rebase completes, run git status --short and git diff --check.
Run broader validation only when the touched code or repository rules require
it.
Before merging:
git worktree list, or
switch to the target branch in the current worktree only if it is not already
checked out elsewhere.Run git merge <source-branch> using Git's default merge behavior. Do not force
--no-ff, squash, rebase again, or push unless the user explicitly asks.
If merge conflicts occur, resolve them with the same conflict rules as the
rebase step, stage only resolved conflict files, and run git merge --continue.
Report the source branch, target branch, target worktree path, commit or merge result, and final clean status. State clearly when no push was performed.