worktree

Create an isolated Git worktree on an auto-named branch after validating a clean repository state.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

It solves the friction of starting work on a new feature or fix by isolating your changes in a fresh git worktree with a disciplined, context-derived branch name.

Core Features & Use Cases

  • Dirty-tree safety gate: Detects a dirty source tree and forces an explicit user choice (commit, stash, proceed with a warning, or cancel) before creating the worktree.
  • Context-aware branch naming: Builds a readable feat/, fix/, chore/, or docs/ branch name from /worktree arguments and conversation artifacts (issue numbers, handoffs, PRDs/grill sessions), with normalization and validation.
  • Worktree lifecycle control: Enters the worktree via EnterWorktree, verifies cleanliness, and instructs explicit exit behavior later.

Quick Start

Ask your AI to run the worktree skill to start an isolated session with an auto-named branch for your current task: use /worktree.

Frequently Asked Questions about worktree

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 without losing my current changes?

To create an isolated git worktree safely, the skill runs a pre-flight validation on your repository to detect a dirty state, prompts you to commit or stash, and then spins up a clean worktree on an auto-named feature branch.

How does context-aware branch naming work for issue-driven development?

Context-aware branch naming builds a readable branch name by extracting issue numbers, PRDs, and handoff context from your conversation, then normalizing them into standardized prefixes like feat/, fix/, chore/, or docs/.

Can I use this worktree skill if my git repository has uncommitted modifications?

Yes, but the dirty-tree safety gate intercepts the creation process to prevent unsafe use, forcing an explicit choice to commit, stash, proceed with a warning, or cancel before initializing the worktree.

What is the best way to isolate mid-session feature development using git worktrees?

The best way to isolate mid-session work is invoking /worktree during a task transition, which triggers deterministic branch-name derivation, EnterWorktree execution, and a post-entry cleanliness confirmation.

Are there limitations when triggering automatic worktree transitions during an agent session?

A key limitation is that worktree transitions require a clean repository state to proceed safely; if the git status pre-flight validation fails, the workflow pauses until you resolve the dirty tree conflict.

Do I need to manually name my git feature branch when starting a new worktree?

No, you do not need to manually name your branch; the skill applies deterministic branch-name derivation using your /worktree arguments and conversation artifacts to normalize a valid branch name automatically.