worktree

Creates git worktrees under .worktrees/ and migrates stray changes from the main directory.

1|Updated Apr 21, 2026
One-click install
npx skills add https://github.com/devbasex/ai-plugins --skill worktree-devbasex
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: worktree
Source: https://github.com/devbasex/ai-plugins/tree/main/plugins/ndf/skills/worktree
Command: npx skills add https://github.com/devbasex/ai-plugins --skill worktree-devbasex

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Parallel development work often collides when multiple changes share one cloned directory, and uncommitted edits left in the main checkout get lost or mixed into the wrong branch. This Skill sets up isolated git worktrees under .worktrees/, guards the main directory against unintended edits, and safely moves stray changes into the correct worktree. ## Core Features & Use Cases - Worktree provisioning: Initializes the .ndf/worktree.json declaration, registers .worktrees/ in .gitignore, and creates branch-based worktrees from the declared base branch. - Stray change migration: Extracts uncommitted changes from the main directory as a patch, applies them to the target worktree, and resets the main directory only after verification. - Local environment and test isolation: Copies untracked dependencies via hardlinks, points the local environment at the worktree code, and provisions per-worktree test environments with allocated ports and a registry ledger. - Use Case: You start a feature branch while another agent session is mid-task on the same repo. The Skill creates .worktrees/feature/x from the develop base branch, moves your accidental main-directory edits into it, and spins up an isolated test database so both efforts run without interference. ## Quick Start Ask the AI to set up a git worktree for your new feature branch and move any leftover changes from the main directory into it.

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 parallel feature development?▼

Run git worktree add -b <branch> .worktrees/<branch> from the main directory after registering .worktrees/ in .gitignore. The Skill automates this, deriving the start point from the declared base_branch or origin HEAD.

How do I move uncommitted changes to another worktree?▼

Capture changes with git diff HEAD into a patch file, apply it in the target worktree with git apply, verify with git status, then reset the main directory with git reset --hard HEAD. Using diff HEAD ensures staged changes are included.

Why does git check-ignore fail for .worktrees before the directory exists?▼

The .worktrees/ pattern with a trailing slash only matches directories, so check-ignore on a nonexistent path without the slash reports it as unregistered. Always include the trailing slash when testing and writing the .gitignore entry.

Can I run isolated test environments per git worktree?▼

Yes. The Skill allocates a slot and ports from a declared band, records assignments in a registry under the common git directory, and starts per-worktree compose environments. Run down --volumes before deleting the worktree to release allocations.

What are the limitations of sharing one local environment across worktrees?▼

A shared local environment can only point at one worktree's code at a time, so simultaneous screen verification of two branches requires isolated mode with separate compose definitions. The Skill provides no locking, so switching affects other sessions.