| name | merge |
| description | Close out a feature branch or cs task worktree - run the repo's gates, merge --no-ff, re-run gates on the merged result, clean up. Invoke when the user asks to merge a branch or worktree, or to close out a finished feature. |
| disable-model-invocation | true |
Merging is a ritual, not a git command: gates before, merge, gates after,
cleanup only when everything is green. This skill closes out work that is
already reviewed to the user's standard — it is the mechanical closer, not
a quality gate or a review.
Prerequisites
- A clean tree. If
git status --porcelain shows uncommitted changes,
offer to commit them first; if the user declines, stop. Never merge
over an uncommitted tree.
- A context (below). If neither applies — already on the default branch
with nothing to merge — say so and stop.
Detect the context
- cs task worktree: the workspace is a cs session named
<base>@<task>, or git rev-parse --git-dir differs from
git rev-parse --git-common-dir inside a cs-managed worktree
session. The merge verb here is cs <base> --merge <task> — it
fuses the session records, merges the branch, and removes the
worktree. This skill wraps it with gates.
- Feature branch: an ordinary checkout on a non-default branch.
The target is the branch it forked from — usually the repo's
default branch (
git merge-base confirms ancestry); ask the user
when the target is ambiguous.
- Base session closing out a named feature: the workspace is the
base session and the invocation named a feature (
/merge fix-auth),
which is what arms from the picker.
The target is ; run the preflight gates inside
that worktree, then from here, then
the post-merge gates in this checkout. Do not change directory into
the feature session to merge — it cannot remove its own working
directory.