finish
Use when the MR has been merged by a human, clean up the worktree and update the integration branch. Closes the pipeline loop.
SKILL.mdskills/finish/SKILL.md
GitHubfinish
Step 11 of the pipeline (WORKFLOW.md). Post-merge: tidying up behind you.
When
Once the MR has been merged by a human (never before).
Steps
- Stop what the worktree was running (dev server, watchers), so nothing holds files open or keeps a port bound.
- Remove the worktree:
git worktree remove <path>, then prune. Neverrm -rfon it — that leaves git's metadata pointing at a path that no longer exists. - Update the integration branch locally (fast-forward). The base is read from the repo, not
assumed:
developon some,mainon others. - Delete the merged branch if the merge didn't (squash-and-delete usually has).
- Close the task's trail: mark it finished wherever it was tracked. If a local orchestrator holds that state, this is where it's told; if not, the todo list or the ticket is the trail.
Output / checkpoint
Worktree gone, base branch up to date, branch deleted, task marked finished. Nothing left running.
Guardrails
- Never run any of this before the human merge.
- Never delete the worktree by hand with
rm -rf; usegit worktree removeso git's metadata stays consistent. - Never hard-code the integration base. Read it; guessing
developon amainrepo silently updates the wrong branch. - Never leave a server or watcher running from a worktree you just removed.
Origin
Internal, rewritten our way from a local orchestrator's task-teardown step. The mechanism is plain git
here: no dependency on that tool, same reason as start-feature (rule B).