using-git-worktrees

Create isolated Git worktrees with dependency setup and baseline tests.

1|Updated Dec 15, 2025
One-click install
npx skills add https://github.com/mihaamiharu/twe --skill using-git-worktrees-mihaamiharu
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: using-git-worktrees
Source: https://github.com/mihaamiharu/twe/tree/main/.agent/skills/using-git-worktress
Command: npx skills add https://github.com/mihaamiharu/twe --skill using-git-worktrees-mihaamiharu

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill streamlines the process of setting up isolated development environments using Git worktrees, ensuring a clean and safe workspace for new feature development.

Core Features & Use Cases

  • Isolated Workspaces: Create separate directories for different branches without context switching.
  • Smart Directory Selection: Prioritizes preferred locations (.worktrees/) or global configurations, falling back to user prompts.
  • Safety Verification: Automatically checks if project-local directories are ignored by Git before creation to prevent accidental commits.
  • Automated Setup: Detects and runs project-specific dependency installation commands (npm, cargo, pip, poetry, go).
  • Baseline Verification: Runs project tests to ensure a clean starting state.
  • Use Case: When starting a new feature like "user authentication," this skill will create a dedicated, isolated directory for that work, install dependencies, and confirm the environment is clean before you begin coding.

Quick Start

Use the using-git-worktrees skill to create a new worktree for the 'feature/new-api' branch in the '.worktrees' directory.

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 isolated Git worktrees for feature development?

Git worktrees create separate directories for different branches, eliminating context switching. This skill automates worktree creation with smart directory selection, prioritizing `.worktrees/` locations and verifying Git ignore rules to prevent accidental commits.

Does automated Git worktree setup work with Node.js, Rust, Python, and Go projects?

Automated worktree setup supports Node.js, Rust, Python, and Go projects. The skill detects project-specific dependency managers like npm, cargo, pip, poetry, and go, automatically installing dependencies to establish a clean baseline.

What's the best way to verify a clean workspace before starting feature implementation?

Verifying a clean workspace requires running baseline tests after dependency installation. This skill automates project setup and executes test suites immediately after creating an isolated Git worktree, ensuring a safe starting state before coding begins.

Why are my project-local Git worktree directories accidentally getting committed?

Project-local directories risk accidental commits if not ignored by Git. This skill performs safety verification by automatically checking Git ignore rules before worktree creation, preventing unwanted directory tracking.

How do I prevent context switching when working on multiple Git branches?

Preventing context switching involves using Git worktrees to maintain separate directories for each branch. This skill isolates feature work by creating dedicated workspaces, allowing simultaneous branch development without stashing or cloning.

Can I configure preferred directory locations for Git worktree creation?

Configuring preferred worktree locations is supported through global configurations or a local `.worktrees/` directory. The skill prioritizes these defined locations during smart directory selection, falling back to user prompts if needed.