using-git-worktrees

Create isolated git worktrees with dependency setup and baseline tests.

Updated Mar 27, 2026
One-click install
npx skills add https://github.com/CenredJun/openclaw-claudecode-setup-kit --skill using-git-worktrees-cenredjun
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: using-git-worktrees
Source: https://github.com/CenredJun/openclaw-claudecode-setup-kit/tree/main/skills/using-git-worktrees
Command: npx skills add https://github.com/CenredJun/openclaw-claudecode-setup-kit --skill using-git-worktrees-cenredjun

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Prevents workspace contamination and accidental commits by creating isolated git worktrees with a systematic directory selection and safety verification process that ensures project-local worktrees are ignored and baselined before implementation begins.

Core Features & Use Cases

  • Priority-based directory selection: prefers a hidden .worktrees directory, then worktrees, then CLAUDE.md preference, and finally prompts the user for location.
  • Safety verification and remediation: verifies project-local directories are covered by .gitignore and instructs adding and committing the ignore entry if missing to avoid committing worktree contents.
  • Automated creation and project setup: creates a new worktree branch, runs dependency installation for common ecosystems (Node, Rust, Python, Go), and executes tests to verify a clean baseline before work starts.
  • Use case: Start a feature branch without switching the main workspace, verify tests pass, and proceed with implementation confidently.

Quick Start

Use the using-git-worktrees skill to create an ignored project-local worktree for branch feature/auth, run the project's dependency setup, and verify tests before implementing changes.

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 without contaminating my main workspace?

To create isolated git worktrees, you should use a systematic directory selection process that prefers a hidden project-local folder and verifies .gitignore coverage. This prevents workspace contamination and accidental commits to your main branch.

How does git worktree branching handle dependency installation and baseline testing?

Git worktree branching handles dependencies by automatically running installation for common ecosystems like Node, Rust, Python, and Go. It then executes baseline tests to verify a clean state before you start implementing feature changes.

Can I use git worktrees for concurrent feature development and hotfixes?

Yes, you can use git worktrees for concurrent feature development, hotfixes, and experimental prototypes. They allow you to implement multiple branches simultaneously without switching your main workspace or risking accidental cross-branch commits.

What is the best way to ensure project-local worktrees are ignored by git?

The best way to ensure project-local worktrees are ignored is to verify .gitignore coverage for your chosen directory. If missing, you must instruct git to add and commit the ignore entry to prevent committing worktree contents.

Why does my git worktree directory selection need priority rules?

Git worktree directory selection needs priority rules to safely route new branches into preferred locations like a hidden .worktrees directory, then a standard worktrees folder, and finally a CLAUDE.md preference before prompting you.

Do I need to run tests before starting implementation in a new git worktree?

Yes, you need to run tests before starting implementation in a new git worktree. Executing tests verifies a clean baseline, ensuring your dependency setup succeeded and your workspace is fully isolated before you proceed.