worktree

Create, finish, and prune git worktrees with baseline test verification and dependency checks.

6|Updated Mar 27, 2026
One-click install
npx skills add https://github.com/greglas75/zuvo --skill worktree-greglas75
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: worktree
Source: https://github.com/greglas75/zuvo/tree/main/skills/worktree
Command: npx skills add https://github.com/greglas75/zuvo --skill worktree-greglas75

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Parallel feature work in git often pollutes the main checkout, corrupts code indexers with nested duplicate trees, and wastes time re-running identical test suites and dependency installs across worktrees. This Skill manages the full git worktree lifecycle so isolated branches stay clean, measurable, and cheap to create. ## Core Features & Use Cases - CREATE mode: Sets up a new worktree as a sibling directory (never nested inside the repo), pins an explicit base commit, clones dependencies from a donor worktree with a matching lockfile instead of reinstalling, verifies the installed tree against the lockfile, and runs or reuses a cached baseline test result. - FINISH mode: Wraps up work in the current worktree with four options — merge locally, push and open a pull request via GitHub CLI, keep as-is, or discard with typed confirmation. - PRUNE mode: Reclaims worktrees that are clean and fully merged, reports idle ones, migrates nested layouts out of the repo, and prompts re-indexing so code metrics stay accurate. - Use Case: You need to develop a feature without touching your main checkout. Ask to create a worktree, and you get an isolated branch with dependencies cloned in seconds and a verified green test baseline before you write a line of code. ## Quick Start Create a git worktree for my new feature branch and verify the test baseline before I start working.

Frequently Asked Questions about worktree

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

FAQPage Schema
How do I create a git worktree for a new feature branch?

Run the CREATE mode, which computes a sibling directory next to your repo, pins an explicit base commit, and runs git worktree add with that base. It then sets up dependencies and verifies a green test baseline before you start working.

How do I clean up stale git worktrees safely?

Use PRUNE mode, which removes only worktrees that are clean and fully merged into the base branch, verified against both local and remote-tracking refs. Dirty, unmerged, or locked worktrees are reported but never touched, and --force is never used.

Why should git worktrees not be nested inside the repository?

A nested worktree is a second full checkout inside the tree, so indexers, cloc, and glob-based tools count every file twice and corrupt metrics like clone detection. A sibling directory has no ancestor relationship with the repo, avoiding the problem entirely.

Can I avoid reinstalling node_modules in every new worktree?

Yes. The skill searches for a donor worktree or main checkout with a byte-identical lockfile and clones its dependency tree using copy-on-write reflinks on APFS or supported filesystems. A full install only runs when no matching donor exists.

What happens when I finish work in a git worktree?

FINISH mode offers four options: merge the branch locally, push and open a pull request with GitHub CLI, keep the worktree as-is, or discard everything after typing a confirmation. Uncommitted changes block all options until committed or stashed.