Agent skill · software engineering · davila7

using-git-worktrees

Use when starting feature work that needs isolation from current workspace or before executing implementation plans - creates isolated git worktrees with smart directory selection and safety verification

Why this skill is useful

Adds a systematic approach to creating isolated git worktrees with safety checks and project setup that the AI wouldn't reliably generate on its own.

What it needs

About 3k tokens when loaded. Last updated 2026-08-06. 30,138 stars on the source repository.

What this skill does

Using Git Worktrees 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 Process Follow this priority order: 1. Check Existing Directories If found: Use that directory. If both exist, .worktrees wins. 2. Check CLAUDE.md If preference specified: Use it without asking. 3. Ask User If no directory exists and no CLAUDE.md preference: Safety Verification For Project-Local Directories (.worktrees or worktrees) MUST verify directory is ignored before creating worktree: If NOT ignored: Per Jesse's rule "Fix broken things immediately": 1. Add appropriate line to .gitignore 2. Commit the change 3. Proceed with worktree creation Why critical: Prevents accidentally committing worktree contents to repository. For Global Directory (~/.config/superpowers/worktrees) No .gitignore verification needed - outside project entirely. Creation Steps 1. Detect Project Name 2. Create Worktree 3. Run Project Setup Auto-detect and run appropriate setup: 4. Verify Clean Baseline Run tests to ensure worktree starts clean: If tests fail: Report failures, ask whether to proceed or investigate. If tests pass: Report ready. 5. …

How to use it

Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:

@skills davila7/using-git-worktrees

View the source on GitHub

Browse the @skills marketplace