ct-using-git-worktrees

Creates isolated git worktree workspaces with native tool detection and baseline test verification.

1|Updated Sep 8, 2026
One-click install
npx skills add https://github.com/mercadona/control-tower --skill ct-using-git-worktrees-mercadona
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: ct-using-git-worktrees
Source: https://github.com/mercadona/control-tower/tree/main/plugin/skills/ct-using-git-worktrees
Command: npx skills add https://github.com/mercadona/control-tower --skill ct-using-git-worktrees-mercadona

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Starting feature work directly in your main checkout risks polluting your current branch, mixing unrelated changes, and losing track of which workspace holds which experiment. This Skill guarantees every piece of work happens in an isolated workspace before any code is written. ## Core Features & Use Cases - Isolation Detection: Checks whether you are already inside a linked worktree or a submodule before creating anything, preventing nested worktrees. - Native Tool Preference: Uses platform-native worktree tools (e.g., EnterWorktree) when available, falling back to manual git worktree add only when no native tool exists. - Safe Setup and Baseline: Verifies the worktree directory is git-ignored, auto-detects project type (Node, Rust, Python, Go) to install dependencies, and runs the test suite to confirm a clean baseline. - Use Case: Before implementing a new feature branch, ask the agent to set up an isolated workspace; it will create .worktrees/my-feature, install dependencies, and confirm all tests pass before coding begins. ## Quick Start Set up an isolated git worktree for my new feature branch and verify the project tests pass before I start implementing.

Frequently Asked Questions about ct-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 a new feature branch?

Run git worktree add with a path and new branch name, such as placing it under a .worktrees directory at the project root. Verify the directory is git-ignored first, then install dependencies and run the test suite to confirm a clean baseline.

Should I use git worktree add or a native worktree tool?

Prefer a native platform tool like EnterWorktree or a /worktree command when one is available, since it manages placement, branching, and cleanup automatically. Use manual git worktree add only as a fallback when no native tool exists.

How do I check if I am already inside a git worktree?

Compare git rev-parse --git-dir with --git-common-dir; if they differ, you are in a linked worktree. Also run git rev-parse --show-superproject-working-tree to rule out being inside a submodule, which shows the same difference.

Why should the worktrees directory be added to gitignore?

A project-local worktree directory that is not ignored can have its contents accidentally tracked and committed, polluting git status and the repository. Verify with git check-ignore and commit a gitignore entry before creating the worktree.

What happens if git worktree add fails with a permission error?

A permission error usually means the sandbox blocked worktree creation. The fallback is to inform the user, then run project setup and baseline tests in the current directory instead of creating a worktree.