dotfiles/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. Each operation runs standard git commands.
Arguments: $ARGUMENTS
list.All operations derive paths from git. Worktree directories use the <repo>-<branch> naming convention (e.g., davit-main, davit-feature-x).
REPO_ROOT=$(git rev-parse --show-toplevel)
PARENT_DIR=$(dirname "$REPO_ROOT")
REPO_NAME=$(basename "$(git config --get remote.origin.url)" .git)
WORKTREE_DIR="$PARENT_DIR/$REPO_NAME-$BRANCH_NAME"
MAIN_DIR="$PARENT_DIR/$REPO_NAME-main"
Create a new worktree as a sibling directory with a new branch, using <repo>-<branch> naming.
REPO_ROOT=$(git rev-parse --show-toplevel)
REPO_NAME=$(basename "$(git config --get remote.origin.url)" .git)
git worktree add "$(dirname "$REPO_ROOT")/$REPO_NAME-<branch>" -b <branch>
After creation, remind the user:
/worktree-secrets in the new worktree to copy .envrc and GPG keysShow 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 — there's nothing to merge.
REPO_ROOT=$(git rev-parse --show-toplevel)
BRANCH=$(git rev-parse --abbrev-ref HEAD)
REPO_NAME=$(basename "$(git config --get remote.origin.url)" .git)
MAIN_DIR="$(dirname "$REPO_ROOT")/$REPO_NAME-main"
git -C "$MAIN_DIR" fetch origin && git -C "$MAIN_DIR" pull
git -C "$MAIN_DIR" merge "$BRANCH"
git -C "$MAIN_DIR" 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, remind the user that force-push is required if the branch was previously pushed (but only with explicit permission per safety rules).
Remove a worktree and delete its branch. Must be run from the main worktree.
Pre-checks:
git branch --merged. If not merged, refuse and instruct the user to merge first.REPO_ROOT=$(git rev-parse --show-toplevel)
REPO_NAME=$(basename "$(git config --get remote.origin.url)" .git)
git worktree remove "$(dirname "$REPO_ROOT")/$REPO_NAME-<branch>"
git branch -d <branch>
If git branch -d fails with "not fully merged", stop and tell the user to merge first. Never use git branch -D.
git worktree removegit worktree remove.git rev-parse --show-toplevel and dirname. 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