dist/claude/git-flow/skills/using-git-worktrees/SKILL.md
Creates isolated git worktrees for parallel development. Use when starting feature work needing isolation or working on multiple branches simultaneously. NOT for simple branch switching, bulk branch cleanup (use cleanup-git), or git hook/config setup (use configuring-git-hygiene).
npx skillsauth add alexei-led/claude-code-config using-git-worktreesInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Use one sibling worktree root per project: <project>.worktrees/<branch-slug>. Keep the main worktree clean on the integration branch by default. Trivial solo one-liners may stay in the main worktree when a worktree would add pointless ceremony.
Treat a worktree as a disposable branch folder. Remove it and its branch after the PR merges.
Use this skill when:
Do not use this skill for:
cleanup-git.gitignore, or config setup — use configuring-git-hygieneCheck state before any git worktree add:
git status --short
git branch --show-current
git worktree list
If the current worktree is dirty, ask whether to commit, stash, or proceed anyway. Do not stash silently.
Use the helper when available:
scripts/setup-worktree.sh <branch> [--base <ref>]
The helper creates <project>.worktrees/<branch-slug> from the main worktree root, handles existing local/remote branches, refuses path conflicts, and refuses dirty state unless --allow-dirty is passed after user approval.
Manual fallback lives in workflow.md.
<project>.worktrees/ directory./ with -.fix-cron, feature-auth, bugfix-issue-123.For one named worktree after PR merge:
scripts/cleanup-worktree.sh [branch]
The helper refuses unless gh confirms the PR is MERGED. Pass --force only after the user confirms the merge without gh or confirms the branch should be abandoned.
For bulk cleanup, stale worktrees, gone upstreams, or merged local branches, use cleanup-git.
Do not run git pull as part of cleanup. Pull the integration branch only after confirming the main worktree is checked out and clean.
-b or use the helper.git worktree remove fails because the worktree is dirty: confirm before --force.git branch -d fails after squash/rebase PR merge: confirm the PR is MERGED, then use -D.WORKTREE READY
==============
Action: CREATE | CLEANUP
Branch: <branch>
Path: <project>.worktrees/<slug>
Status: DONE | BLOCKED
Next:
- cd <path> and open the editor there, or
- pull the integration branch yourself after confirmed cleanup
For cleanup, report DONE only when the PR is confirmed MERGED or --force was used deliberately. Otherwise report BLOCKED with the script's reason.
setup-worktree.sh and cleanup-worktree.shtools
Use when planning, executing, checkpointing, finishing, or inspecting lightweight spec-driven work. Runs one task at a time using `.spec/` markdown files and the bundled `specctl` helper. NOT for broad product discovery beyond a short requirement interview. NOT for generic implementation planning that does not read or write `.spec/` files.
development
Simple web development with HTML, CSS, JS, and HTMX. Use when working with .html, .css, or .htmx files, web templates, stylesheets, or vanilla JS scripts. NOT for React/Vue/Angular (use writing-typescript) or Node.js backends.
tools
Idiomatic TypeScript development. Use when writing TypeScript code, Node.js services, React apps, or TypeScript design advice. Emphasizes strict typing, boundary validation, composition, fast feedback, behavior tests, and project-configured tooling. NOT for Go, Python, Rust, plain HTML/CSS/JS, or server-rendered templates (use writing-web).
tools
Idiomatic shell development for POSIX sh, Bash, Zsh, Fish, hooks, CI shell steps, and scriptable CLI glue. Use when writing or changing `.sh`, `.bash`, `.zsh`, `.fish`, `.bats`, shell functions, shell pipelines, CI `run:` shell bodies, or command-runner recipes. Emphasizes portability, quoting, safe filesystem/process handling, non-TUI CLI tools, ShellCheck, shfmt, Bats, and ShellSpec. NOT for Python, Rust, TypeScript, Go, web code, or GitHub Actions workflow/job/permissions semantics; use operating-infra.