← All needs

implement: check branch isn't merged before committing

### Before filing - [x] I've read `SCOPE.md` and checked `.out-of-scope/`, and this isn't covered by either. ### Skill implement ### What went wrong Found with the `/retro` skill, reviewing four sessions of a Python project. Harness: Claude Code (VS Code extension). Model: Opus 5.5 High. I ran `/implement` on a feature. The checked-out branch, had already been merged into `master` and deleted on the remote, but the local branch still existed. `/implement` ends with "Commit your work to the current branch", so it committed the whole feature there. I had to stop the agent and tell it: "you need to put it on a different branch please, this branch is already merged and deleted". The agent then cherry-picked the commit onto a new branch from `origin/master` and deleted the dead local branch. Nothing in the skill could have caught this: the branch looks normal locally, and the skill gives the agent no reason to doubt it. It is easy to hit with merge-and-delete branch flows when a new session starts in the same checkout. ### Proposed change Add one step to `/implement`, before the first commit: Before the first commit, check the current branch isn't already merged. git fetch --prune git merge-base --is-ancestor HEAD origin/ If it is an ancestor, its work is already in : create a new branch from origin/ , carry the uncommitted work over, and tell the user in one line. Detect ` ` with `git symbolic-ref refs/remotes/origin/HEAD` instead of hard-coding `main` or `master`. If the current branch is the default branch itself, keep the existing "branch first" behaviour. Edit the line "Commit your work to the current branch." to "Commit your work to the current branch (once it has passed the merged-branch check above)." Remove nothing.