worktrees

Creates and manages task-level git worktrees bound to herdr spaces via wtnew, cdw, and cdwrm.

Updated Oct 16, 2025
One-click install
npx skills add https://github.com/jlui17/dotfiles --skill worktrees-jlui17
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: worktrees
Source: https://github.com/jlui17/dotfiles/tree/main/agents/skills/worktrees
Command: npx skills add https://github.com/jlui17/dotfiles --skill worktrees-jlui17

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Starting a new coding task usually means stashing work, switching branches, or risking a dirty checkout. This Skill gives every task its own isolated git worktree at <repo>/.worktrees/<name> on a fresh branch, optionally bound to a herdr space, so task work never interferes with the main checkout. ## Core Features & Use Cases - Task worktree creation: wtnew <name> creates a worktree and branch in one step, running the repo's registered setup hook (wt_setup or wt_create) from the worktree-setups registry. - Navigation and teardown: cdw jumps between worktrees with fzf, and cdwrm removes finished worktrees, with herdr worktree remove closing the space and worktree together. - Setup registry onboarding: when wtnew refuses with "no setup defined", the Skill guides a docs-first discovery process to write the correct setup file for that repo. - Use Case: You receive a bug ticket colony-562. Run wtnew colony-562 flow viewer to get an isolated checkout and branch, do the work, then tear it down with cdwrm when the PR merges. ## Quick Start Ask the agent to start a worktree for your task, for example: "Start a worktree named colony-562 for the flow viewer fix."

Frequently Asked Questions about worktrees

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

FAQPage Schema
How do I create a git worktree for a new task?▼

Run `wtnew <name> [summary]` from the repo. It looks up the repo's setup file, creates a worktree at `.worktrees/<name>` on a new branch, and optionally opens a herdr space bound to it with `--space`.

How do I switch between git worktrees quickly?▼

Use `cdw` to open an fzf picker over the repo's worktrees, `cdw <name>` to jump directly, or `cdw -` to leave. It reads `git worktree list`, so it sees worktrees created by any tool.

Why does wtnew fail with 'no setup defined'?▼

The repo has no entry in the `worktree-setups` registry. Search the repo's docs for existing worktree tooling and write a `wt_create` delegating to it, or a `wt_setup` for fresh-checkout needs, then commit the file to dotfiles.

Can I remove a git worktree with uncommitted changes?▼

Yes, but a dirty checkout requires the force flag. Use `cdwrm -f <name>` or `herdr worktree remove --workspace <id>` with `--force`; neither path ever deletes the task branch itself.

When should I not create a worktree setup entry for a repo?▼

Some repos deliberately lack an entry because they use their own worktree machinery. Colony, for example, routes worktrees through Claude Code's native `.worktreeinclude` flow, so `wtnew` refusing there is correct behavior.