Awesome-vibe-coding using-git-worktrees

Use when starting feature work that needs isolation or before executing implementation plans — creates isolated git worktrees

install
source · Clone the upstream repo
git clone https://github.com/adriannoes/awesome-vibe-coding
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/adriannoes/awesome-vibe-coding "$T" && mkdir -p ~/.claude/skills && cp -r "$T/cursor/skills/using-git-worktrees" ~/.claude/skills/adriannoes-awesome-vibe-coding-using-git-worktrees && rm -rf "$T"
manifest: cursor/skills/using-git-worktrees/SKILL.md
source content

Using Git Worktrees

Source: obra/superpowers (MIT)

Overview

Git worktrees create isolated workspaces sharing the same repository, allowing work on multiple branches simultaneously without switching.

Core principle: Systematic directory selection + safety verification = reliable isolation.

Announce at start: "I'm using the using-git-worktrees skill to set up an isolated workspace."

Directory Selection

Follow this priority order:

  1. Check existing:
    .worktrees/
    or
    worktrees/
    (prefer
    .worktrees
    )
  2. Check project config: Look for worktree directory preference in CLAUDE.md, AGENTS.md, or similar
  3. Ask user if no directory exists and no preference found

Safety Verification (Project-Local)

MUST verify directory is ignored before creating worktree:

git check-ignore -q .worktrees 2>/dev/null || git check-ignore -q worktrees 2>/dev/null

If NOT ignored: Add to .gitignore, commit, then proceed. Prevents accidentally committing worktree contents.

Creation Steps

1. Create Worktree

# Determine path (e.g., .worktrees/<branch-name>)
git worktree add "$path" -b "$BRANCH_NAME"
cd "$path"

2. Run Project Setup

Auto-detect and run appropriate setup:

# Node.js
if [ -f package.json ]; then npm install; fi

# Python
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
if [ -f pyproject.toml ]; then poetry install; fi

# Rust, Go, etc.

3. Verify Clean Baseline

Run tests to ensure worktree starts clean:

npm test / pytest / cargo test / go test ./...

If tests fail: Report failures, ask whether to proceed or investigate.

If tests pass: Report ready.

4. Report Location

Worktree ready at <full-path>
Tests passing (<N> tests, 0 failures)
Ready to implement <feature-name>

Red Flags

Never:

  • Create worktree without verifying it's ignored (project-local)
  • Skip baseline test verification
  • Proceed with failing tests without asking

Always:

  • Verify directory is ignored for project-local
  • Auto-detect and run project setup
  • Verify clean test baseline

Integration

Pairs with: finishing-a-development-branch — cleanup worktree after work complete.