skills/devops/git-worktrees/SKILL.md
Create isolated git worktrees for feature work with smart directory selection and safety verification. Use when starting feature work that needs isolation from current workspace or before executing implementation plans.
npx skillsauth add bereniketech/claude_kit git-worktreesInstall 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.
Git worktrees create isolated workspaces sharing the same repository, allowing work on multiple branches simultaneously without switching.
Rule: Systematic directory selection + safety verification = reliable isolation.
Follow this priority order:
ls -d .worktrees 2>/dev/null # Preferred (hidden)
ls -d worktrees 2>/dev/null # Alternative
If found, use that directory. If both exist, .worktrees wins.
grep -i "worktree.*director" CLAUDE.md 2>/dev/null
If preference specified, use it without asking.
If no directory exists and no CLAUDE.md preference:
No worktree directory found. Where should I create worktrees?
1. .worktrees/ (project-local, hidden)
2. A custom global location
Which would you prefer?
Rule: 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 appropriate line to .gitignore, commit the change, then proceed. This prevents accidentally committing worktree contents to the repository.
No .gitignore verification needed — outside project entirely.
project=$(basename "$(git rev-parse --show-toplevel)")
# Create worktree with new branch
git worktree add "$LOCATION/$BRANCH_NAME" -b "$BRANCH_NAME"
cd "$LOCATION/$BRANCH_NAME"
Auto-detect and run appropriate setup:
# Node.js
if [ -f package.json ]; then npm install; fi
# Rust
if [ -f Cargo.toml ]; then cargo build; fi
# Python
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
if [ -f pyproject.toml ]; then poetry install; fi
# Go
if [ -f go.mod ]; then go mod download; fi
Run tests to ensure worktree starts clean:
npm test / cargo test / pytest / go test ./...
If tests fail, report failures and ask whether to proceed or investigate. If tests pass, report ready.
Worktree ready at <full-path>
Tests passing (<N> tests, 0 failures)
Ready to implement <feature-name>
| Situation | Action |
|-----------|--------|
| .worktrees/ exists | Use it (verify ignored) |
| worktrees/ exists | Use it (verify ignored) |
| Both exist | Use .worktrees/ |
| Neither exists | Check CLAUDE.md → Ask user |
| Directory not ignored | Add to .gitignore + commit |
| Tests fail during baseline | Report failures + ask |
| No package.json/Cargo.toml | Skip dependency install |
git check-ignore before creating project-local worktree.Never:
Always:
testing
AUTHORIZED USE ONLY: This skill contains dual-use security techniques. Before proceeding with any bypass or analysis: > 1.
testing
Provide comprehensive techniques for attacking Microsoft Active Directory environments. Covers reconnaissance, credential harvesting, Kerberos attacks, lateral movement, privilege escalation, and domain dominance for red team operations and penetration testing.
development
Detects missing zeroization of sensitive data in source code and identifies zeroization removed by compiler optimizations, with assembly-level analysis, and control-flow verification. Use for auditing C/C++/Rust code handling secrets, keys, passwords, or other sensitive data.
development
Comprehensive guide to auditing web content against WCAG 2.2 guidelines with actionable remediation strategies.