Claude Skills
CollectionsCompareWorkflowsNominate
Sign inSign up
© 2026 Curated Agent Skills·Learn more about Agent Skills
Back to repository

dev-worktree

verified

This skill should be used when the user asks to "create an isolated worktree", "set up worktree for feature", "create a feature branch worktree", or needs workspace isolation with automatic dependency setup and test verification.

View on GitHub

Marketplace

edwinhu-plugins

edwinhu/workflows

Plugin

workflows

development

Repository

edwinhu/workflows
3stars

skills/dev-worktree/SKILL.md

Last Verified

February 4, 2026

Install Skill

Select agents to install to:

Scope:
npx add-skill https://github.com/edwinhu/workflows/blob/main/skills/dev-worktree/SKILL.md -a claude-code --skill dev-worktree

Installation paths:

Claude
.claude/skills/dev-worktree/
Powered by add-skill CLI

Instructions

# Create Development Worktree

Create an isolated git worktree for feature work, ensuring workspace isolation and clean baseline.

## The Process

### Step 1: Ensure .worktrees/ is Gitignored

**CRITICAL:** Verify worktree directory is gitignored to prevent accidental commits.

**Run:**
```bash
if ! git check-ignore -q .worktrees 2>/dev/null; then
  echo "Adding .worktrees/ to .gitignore"
  echo ".worktrees/" >> .gitignore
  git add .gitignore
  git commit -m "chore: add .worktrees/ to gitignore

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>"
fi
```

**Description:** dev-worktree: check if .worktrees is gitignored and add if missing

### Step 2: Determine Branch Name

Extract from `.claude/PLAN.md` first line or infer from feature name:

**Run:**
```bash
# Extract from PLAN.md if exists
feature_name=$(grep -m1 '^# ' .claude/PLAN.md 2>/dev/null | sed 's/^# //' | tr '[:upper:] ' '[:lower:]-' | sed 's/[^a-z0-9-]//g')

# Or ask user if needed
```

**Description:** dev-worktree: extract or prompt for feature name

Branch name format: `feature/${feature_name}`

### Step 3: Create Worktree

**Run:**
```bash
# Create worktree with new branch
git worktree add .worktrees/${feature_name} -b feature/${feature_name}

# Change to worktree directory
cd .worktrees/${feature_name}
```

**Description:** dev-worktree: create isolated git worktree with feature branch

### Step 4: Run Project Setup

Auto-detect and run setup based on project files:

**Run:**
```bash
# 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 || pip install -e .
fi
if [ -f pixi.toml ]; then
  pixi install
fi

# Rust
if [ -f Cargo.toml ]; then
  cargo build
fi

# Go
if [ -f go.mod ]; then
  go mod download
fi
```

**Description:** dev-worktree: auto-detect project type and install dependencies

### Step 5: Verify Clean Baseline (Optional)

Run tests to verify baseline if 

Validation Details

Front Matter
Required Fields
Valid Name Format
Valid Description
Has Sections
Allowed Tools
Instruction Length:
3870 chars