dd-git-worktree

Manages Git worktree creation, naming, synchronization, and cleanup rules.

Updated Jun 11, 2026
One-click install
npx skills add https://github.com/marcocpt/trae_skills --skill dd-git-worktree-marcocpt
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: dd-git-worktree
Source: https://github.com/marcocpt/trae_skills/tree/main/dd-git-worktree
Command: npx skills add https://github.com/marcocpt/trae_skills --skill dd-git-worktree-marcocpt

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Managing multiple feature branches in a single Git working directory causes constant stashing, context switching, and accidental cross-branch contamination. This Skill enforces a disciplined one-branch-per-worktree workflow so parallel development stays isolated and organized. ## Core Features & Use Cases - Worktree Creation Rules: Creates worktrees in sibling directories based on the latest origin/develop, with an immediate git fetch origin to guarantee a fresh baseline. - Naming Conventions: Maps branch names to directory names by replacing slashes with hyphens (e.g., feature/F3.1-ocr-acceleration becomes feature-F3.1-ocr-acceleration). - State Sync & Cleanup: Clarifies that worktrees never share working state or stashes, and defines cleanup rules including removal after merge, 7-day inactivity review, and git worktree prune for orphaned metadata. - Use Case: When starting a hotfix while a feature branch is mid-development, create an isolated worktree via the referenced script, work independently, then remove the worktree and delete the branch after merging. ## Quick Start Ask the AI to create a new Git worktree for a feature branch based on the latest origin/develop using the create-worktree script.

Frequently Asked Questions about dd-git-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-worktree script with a type, milestone, and topic, such as `create-worktree.sh feature F3.1 ocr-acceleration`. The worktree is created in a sibling directory based on the latest origin/develop, followed by an immediate git fetch to sync the baseline.

How should Git worktree directories be named?

Name the worktree directory after its branch, replacing slashes with hyphens. For example, branch `feature/F3.1-ocr-acceleration` maps to directory `feature-F3.1-ocr-acceleration`, placed alongside the repository root for easy listing.

Do Git worktrees share stashes or uncommitted changes?

No, each worktree is an independent working directory with its own state. Uncommitted changes and stashes do not transfer between worktrees, so use commits rather than stash to preserve intermediate work.

When should I remove a Git worktree?

Remove a worktree immediately after its branch merges into develop, and review any worktree inactive for over 7 days. Run `git worktree remove <path>` first, then delete the branch with `git branch -d`.

What happens if a worktree directory is deleted manually?

Manually deleting the directory leaves stale metadata in Git. Run `git worktree prune` to repair the worktree registry and clear references to the missing directory.