worktree

Creates and integrates full-repository Git worktrees for parallel monorepo development.

7|5|Updated Jul 22, 2025
One-click install
npx skills add https://github.com/nebius/nebius-ps-services --skill worktree-nebius
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: worktree
Source: https://github.com/nebius/nebius-ps-services/tree/main/skills/worktree
Command: npx skills add https://github.com/nebius/nebius-ps-services --skill worktree-nebius

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve? Working on multiple features in a monorepo forces developers to stash changes, switch branches, or clone the repository repeatedly. This Skill creates full-repository linked Git worktrees from the exact current local feature branch, lets each child branch advance independently, and serializes their commits back into one source branch without pushing child branches or opening pull requests. ## Core Features & Use Cases - Parallel Worktree Creation: Run $worktree add from a clean primary checkout to create a generated child branch and full linked worktree pinned to the exact captured source SHA, with an optional --project starting directory and exact --reuse support. - Serialized Integration: Run $worktree integrate <name> from the primary checkout to safely commit eligible child and source changes, build a private two-parent merge candidate, validate it non-mutatingly, and fast-forward the source branch only to the exact validated SHA. - Proof-Gated Removal: Run $worktree remove <name> to delete a child worktree and its local ref only when it is unchanged from its base or its recorded merge remains reachable from the source branch. - Use Case: A developer needs to update Terraform modules and Helm charts concurrently in one monorepo. They create two worktrees, develop in each returned directory, integrate each child serially into the local feature branch, then publish that single accumulated branch. ## Quick Start Ask the agent to run $worktree add with a short task description from your clean feature branch checkout to create a linked worktree and start working in the returned directory.

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 monorepo work?

Invoke $worktree add with an optional task description from a clean primary checkout on a named non-default branch. The helper captures the exact current source SHA, creates a generated child branch and full linked worktree, and returns the starting directory for subsequent development commands.

How do I merge a Git worktree branch back without push or PR?

Run $worktree integrate with the exact generated name from the primary checkout. The helper commits eligible dirt, builds a private two-parent merge candidate, requires non-mutating validation, and fast-forwards the source branch only to the exact validated SHA.

Can I use git worktree children for push or pull requests?

No. Child worktrees created by this workflow are never pushed or used for pull requests, and managed-child push or PR creation is blocked by guards. Only the accumulated local source branch is published through separate Git or PR skills.

What happens when a git worktree merge has conflicts?

The helper retains a private recovery candidate worktree and integration reservation. You resolve conflicts only in that returned candidate, stage the resolution, then rerun the same integration command; never resolve in the primary or child checkout.

When should I not use git worktree add?

Do not use it from the default branch, a detached HEAD, or a dirty primary checkout, since add requires a completely clean named non-default branch. It also does not support implicit invocation, cross-agent handoff, or sparse checkouts via --project.

Why does worktree remove refuse to delete my branch?

Removal is proof-gated: the child must be unchanged from its captured base or its recorded merge must remain reachable from the source branch. Dirty, advanced, rewritten, leased, or unverifiable resources are retained to prevent work loss.