configs/claude-code/skills/worktree/SKILL.md
Git worktree management for parallel branch development. Use for creating, merging, rebasing, and removing worktrees.
npx skillsauth add jimweller/dotfiles worktreeInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
STARTER_CHARACTER = 🎋
Manage git worktrees for parallel branch development. Worktrees live under ~/.worktrees/<repo>/<branch>. Slashes in branch names create nested directories (e.g. feature/foo becomes ~/.worktrees/<repo>/feature/foo).
Arguments: $ARGUMENTS
list.All operations derive paths from git, not from dirname math.
PRIMARY=$(git worktree list --porcelain | awk '/^worktree / { print $2; exit }')
REPO_NAME=$(basename "$PRIMARY")
WORKTREE_DIR="$HOME/.worktrees/$REPO_NAME/<branch>"
PRIMARY is the original clone (the first entry in git worktree list). Other worktrees live under ~/.worktrees/$REPO_NAME/.
Create a new worktree under ~/.worktrees/<repo>/<branch> with a new branch. Copy .llmtmp/ from the primary if present. Open a new tmux window named wt:<branch> if running inside tmux. Focus does not switch.
PRIMARY=$(git worktree list --porcelain | awk '/^worktree / { print $2; exit }')
REPO_NAME=$(basename "$PRIMARY")
WORKTREE_DIR="$HOME/.worktrees/$REPO_NAME/<branch>"
mkdir -p "$(dirname "$WORKTREE_DIR")"
git worktree add "$WORKTREE_DIR" -b <branch>
[ -d "$PRIMARY/.llmtmp" ] && cp -r "$PRIMARY/.llmtmp" "$WORKTREE_DIR/.llmtmp"
[ -n "$TMUX" ] && tmux new-window -d -n "wt:<branch>" -c "$WORKTREE_DIR"
After creation, report the worktree path and the tmux window number (if created).
Show all worktrees.
git worktree list
Merge the current worktree's branch into main. Run from the feature worktree.
Pre-check: verify the current branch is NOT main. If on main, refuse.
PRIMARY=$(git worktree list --porcelain | awk '/^worktree / { print $2; exit }')
BRANCH=$(git rev-parse --abbrev-ref HEAD)
git -C "$PRIMARY" fetch origin && git -C "$PRIMARY" pull
git -C "$PRIMARY" merge "$BRANCH"
git -C "$PRIMARY" push origin main
If there are conflicts, help the user resolve them before pushing.
Rebase a branch onto the latest main. Must be run from within the branch's worktree.
Pre-check: verify the current branch matches <branch>. If not, refuse and instruct the user to switch to the correct worktree.
git fetch origin
git rebase origin/main
If there are conflicts, help the user resolve them. After successful rebase, force-push is required if the branch was previously pushed (only with explicit permission per safety rules).
Remove a worktree and delete its branch. Must be run from the primary worktree.
Pre-checks:
git rev-parse --show-toplevel equals $PRIMARY). If not, refuse.git branch --merged. If not merged, refuse and instruct the user to merge first.PRIMARY=$(git worktree list --porcelain | awk '/^worktree / { print $2; exit }')
REPO_NAME=$(basename "$PRIMARY")
WORKTREE_DIR="$HOME/.worktrees/$REPO_NAME/<branch>"
git worktree remove "$WORKTREE_DIR"
git branch -d <branch>
PARENT="$(dirname "$WORKTREE_DIR")"
while [ "$PARENT" != "$HOME/.worktrees" ] && rmdir "$PARENT" 2>/dev/null; do
PARENT="$(dirname "$PARENT")"
done
If git branch -d fails with "not fully merged", stop and tell the user to merge first. Never use git branch -D.
The rmdir loop cleans up empty parent directories left by slash-nested branch names and removes the per-repo dir when no branches remain.
git worktree remove.git worktree remove.git worktree list --porcelain. Never hardcode paths.testing
Search saved session transcripts for past decisions, actions, errors, and context that has left the current conversation window.
data-ai
Review a PRD for defects via Claude opus subagent.
development
Markdown authoring guidelines for formatting, code blocks, and structure. Use when writing or editing markdown files.
development
--- name: md-style description: README style guide for concise, direct documentation. Use when writing or editing README files. ß--- <!-- markdownlint-disable-file MD041 --> # README Style Guide Write concise, direct README files for experienced engineers. ## Principles - **No fluff** - Skip tables of contents, verbose explanations, development history - **No roadmaps** - Document current state only, not plans or decisions. Readme is an engineering specification. Not a project plan or chan