merge-uplisted
Install: claude install-skill joris887/exosuit
______________________________________________________________________
## merge-up
Merge the **current stream's branch** into the parent it was created from, then
fast-forward the current branch back up to the parent. Safe across worktrees:
the parent is usually checked out in another worktree, so the merge runs there
via `git -C` rather than checking the parent out here (git forbids that).
### Step 1 — Identify branches
```bash
B="$(git rev-parse --abbrev-ref HEAD)"
echo "current branch: $B"
```
- If `B` is `HEAD` (detached), STOP — tell the user to check out a branch.
- Resolve the parent `P`:
```bash
P="$(git config "branch.$B.exosuitParent" || true)"
```
- If empty, fall back to stripping the last `-<suffix>` (e.g. `sprint-3-a` →
`sprint-3`) and verify it exists with `git show-ref --verify --quiet refs/heads/<cand>`.
- If still unresolved or ambiguous, ASK the user which branch is the parent.
- If `P == B` or `P` doesn't exist, STOP and report.
### Step 2 — Pre-flight cleanliness (both worktrees)
```bash
git status --porcelain # current worktree — must be empty
```
- If the current worktree is dirty, STOP: the skill merges **committed** work only.
Tell the user to commit or stash first.
- Locate the parent's worktree dir:
```bash
git worktree list --porcelain
```
Find the entry whose branch is `refs/heads/$P`; call its path `PDIR`.
- If `P` is not checked out in any worktree, STOP and tell the user to check it
out in a worktr