Agent skill · software engineering · aaaaqwq

Using Git Worktrees

Create isolated git worktrees with smart directory selection and safety verification

Why this skill is useful

Adds specific commands and a structured process for creating isolated git worktrees that the AI wouldn't reliably generate on its own.

What it needs

About 3k tokens when loaded. Last updated 2026-08-06. 83 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 .gitignore before creating worktree: If NOT in .gitignore: 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 aaaaqwq/sp-using-git-worktrees

View the source on GitHub

Browse the @skills marketplace