using-git-worktrees

Create isolated Git worktrees with baseline test verification.

Updated Mar 17, 2026
One-click install
npx skills add https://github.com/steven-3/supermind --skill using-git-worktrees-steven-3
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: using-git-worktrees
Source: https://github.com/steven-3/supermind/tree/main/skills/using-git-worktrees
Command: npx skills add https://github.com/steven-3/supermind --skill using-git-worktrees-steven-3

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

It prevents executors from polluting the main working directory by isolating each task’s changes in its own Git worktree with guardrails that reduce accidental commits.

Core Features & Use Cases

  • Automated worktree creation for isolated development per task or executor.
  • Safety checks that require .worktrees/ to be ignored and baseline tests to run before starting.
  • Recommended workflow that commits inside the worktree and reports results back for orchestrated merging.
  • Use case: You’re implementing a refactor that touches multiple parts of a codebase while running multiple executor tasks in parallel; each task gets its own worktree branch and baseline verification.

Quick Start

Have your executor create a worktree under .worktrees/, verify .worktrees/ is ignored, run the project’s baseline test suite in that worktree, then complete the task only within the worktree branch.

Frequently Asked Questions about using-git-worktrees

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I use Git worktrees to isolate parallel code changes and prevent repository contamination?

Git worktrees isolate parallel code changes by creating separate working directories under `.worktrees/`, keeping your main directory clean. Each task gets its own branch from local HEAD with dependencies installed and baseline tests verified.

What is the best way to run baseline tests before starting a refactor in a Git worktree?

The best way to run baseline tests in a Git worktree is to execute the project's test suite immediately after dependency installation. This safety check verifies the worktree environment before you begin implementing feature work or bug fixes.

Do I need to ignore `.worktrees/` in Git before creating isolated branches for parallel execution?

Yes, you must ignore `.worktrees/` in your `.gitignore` file before creating isolated branches. This guardrail prevents worktree directories from polluting your repository status and causing accidental commits during parallel task execution.

How does task isolation with Git worktrees work when running multiple executor tasks in parallel?

Task isolation with Git worktrees works by assigning each parallel executor its own working directory and branch from local HEAD. Each executor independently installs dependencies, runs baseline tests, and commits changes without interfering with other tasks.

What information should I report back after completing a task inside a Git worktree?

After completing a task inside a Git worktree, you should report the worktree branch name, commit hash, changed files, and baseline test results. This enables orchestrated merging of isolated changes back into the main repository.

Why does dependency installation via lockfile auto-detection matter for Git worktree setup?

Dependency installation via lockfile auto-detection ensures each Git worktree has the correct environment matching the project baseline. Running this before baseline tests guarantees verification occurs in a properly configured, isolated scratch environment.