Worktree done
Skill dkmqflx/git-workflow-plugin/plugins/git-workflow/skills/worktree-done
Git branch/worktree lifecycle skills for Claude Code (worktree, branch, PR, cleanup)
npx -y skills add dkmqflx/git-workflow-plugin --skill worktree-doneAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 1 stars1 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
What its author says it does
Copied from the file, not written here
Remove the current git worktree, switch the main checkout to the base branch, and delete the feature branch. Use when the user has finished work started with the worktree skill (or `/worktree`) and wants to clean up — phrases like "워크트리 정리해줘", "워크트리 삭제해줘", "clean up this worktree", "remove worktree", "/worktree-done". Do NOT use from the main checkout (not a worktree) — that is the branch-done skill.
The file declares its own license as MIT. That is the author’s claim about this one file, and it is not the same thing as the license GitHub reports for the repository, which is listed with the other numbers below.
SKILL.md
2.6 KB, as published. Nobody here has run it
Worktree Done
Remove the current git worktree, switch the main checkout to the base branch, and delete the feature branch.
Use this when finishing work that was started with the worktree skill (or /worktree).
When to apply
Cleaning up after work done inside a worktree. Do not apply from the main checkout — that is branch-done.
Steps
- Verify the current directory is inside a worktree (not the main checkout).
- Compare
git rev-parse --git-dirandgit rev-parse --git-common-dir. If they are equal, this is the main checkout — stop and tell the user to use thebranch-doneskill instead.
- Compare
- Record the current worktree path (
git rev-parse --show-toplevel) and current branch name (git rev-parse --abbrev-ref HEAD). - Determine the base branch:
- Try
git symbolic-ref refs/remotes/origin/HEADand strip therefs/remotes/origin/prefix. - If that fails, use the first of
dev,main,masterthat exists locally (git show-ref --verify --quiet refs/heads/<name>). - If none exist, stop and ask the user which branch is the base.
- Try
- If the recorded branch is the base branch (or is itself
dev,main, ormaster), stop and notify the user. - Check for uncommitted changes (
git status --porcelain). If any exist, stop and report them — do not force removal. - Resolve the main checkout path: parse
git worktree list --porcelainand take the firstworktree <path>entry. cdinto the main checkout path.- Checkout the base branch and pull latest:
git checkout <base branch> && git pull - Remove the worktree:
git worktree remove <recorded worktree path> - Delete the feature branch locally:
git branch -D <recorded branch> - Confirm in one line:
Worktree removed → back on <base branch>, deleted <branch>
Guardrails
- Never run
git worktree remove --force. If removal fails due to dirty state, stop and report. - Never delete the base branch or other protected branches (
main,master,dev). - Do not run this from the main checkout — that is
branch-done's job.