using-git-worktrees

Create isolated Git worktrees with dependency setup and baseline tests.

1|Updated Nov 17, 2025
One-click install
npx skills add https://github.com/nimeshgurung/artifact-hub-collections --skill using-git-worktrees-nimeshgurung
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: using-git-worktrees
Source: https://github.com/nimeshgurung/artifact-hub-collections/tree/main/skills/raw/obra/superpowers/skills/using-git-worktrees
Command: npx skills add https://github.com/nimeshgurung/artifact-hub-collections --skill using-git-worktrees-nimeshgurung

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

This Skill automates the creation of isolated Git worktrees for feature development, ensuring a clean and safe development environment by verifying directory selection and project setup.

Core Features & Use Cases

  • Isolated Workspaces: Work on multiple branches simultaneously without context switching.
  • Smart Directory Selection: Prioritizes preferred locations (.worktrees/, worktrees/) or prompts the user.
  • Safety Verification: Ensures project-local worktree directories are added to .gitignore before creation.
  • Automated Setup: Detects and runs project-specific dependency installation (npm, cargo, pip, poetry, go).
  • Baseline Health Check: Runs project tests to confirm a clean starting state.
  • Use Case: When starting a new feature, use this Skill to create a dedicated, isolated worktree, install dependencies, and verify the project builds and tests pass before writing any code.

Quick Start

Use the using-git-worktrees skill to set up an isolated workspace for the 'new-feature' 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 create an isolated Git worktree for feature development?

This Skill automates creating an isolated Git worktree by selecting a preferred directory like `.worktrees/`, adding it to `.gitignore` for safety, and setting up the project environment for feature development.

Does Git worktree automation support Node.js, Rust, Python, and Go projects?

Yes, Git worktree automation supports Node.js, Rust, Python, and Go projects by automatically detecting the environment and running the appropriate dependency installation commands like npm, cargo, pip, poetry, or go.

Why use Git worktrees instead of switching branches in a single directory?

Git worktrees provide isolated workspaces, allowing you to work on multiple branches simultaneously without context switching. This Skill ensures each worktree starts from a known good state by running baseline tests after setup.

How do I verify my project builds correctly before starting work in a new worktree?

To verify your project builds correctly before starting work, this Skill performs a baseline health check by running project tests immediately after creating the worktree and installing dependencies, ensuring a clean starting state.

What is the safest way to manage worktree directories in Git?

The safest way to manage worktree directories is to place them in project-local folders like `.worktrees/` and ensure they are added to `.gitignore`. This Skill performs safety verification to prevent accidental commits of worktree directories.