flow-next-worktree-kit

gmickel's avatarfrom gmickel

Manage git worktrees (create/list/switch/cleanup) and copy .env files. Use for parallel feature work, isolated review, clean workspace, or when user mentions worktrees.

⭐32stars🔀3forks📁View on GitHub🕐Updated Jan 9, 2026⬇️1downloads

When & Why to Use This Skill

The flow-next-worktree-kit is a specialized Git management tool designed to enhance developer productivity by automating worktree operations. It enables seamless creation, switching, and cleanup of isolated workspaces, allowing developers to handle multiple branches simultaneously without the overhead of constant stashing or context switching. By integrating environment variable synchronization, it ensures that new development environments are ready for immediate use, maintaining a clean and efficient coding workflow.

Use Cases

  • Parallel Feature Development: Work on multiple features or bug fixes at the same time by creating dedicated worktrees for each branch, eliminating the need to stash or commit unfinished changes when switching tasks.
  • Isolated Code Reviews: Check out pull requests into separate directories to perform thorough reviews and run tests in an isolated environment without disrupting your primary development workspace.
  • Environment Configuration Sync: Automatically copy .env files to new worktrees during creation to ensure consistent local configurations and immediate project readiness across different branches.
  • Workspace Maintenance: Efficiently manage local repository health by listing active worktrees and safely cleaning up completed task directories without risking data loss or branch deletion.
nameflow-next-worktree-kit
descriptionManage git worktrees (create/list/switch/cleanup) and copy .env files. Use for parallel feature work, isolated review, clean workspace, or when user mentions worktrees.

Worktree kit

Use the manager script for all worktree actions.

bash ${CLAUDE_PLUGIN_ROOT}/skills/flow-next-worktree-kit/scripts/worktree.sh <command> [args]

Commands:

  • create <name> [base]
  • list
  • switch <name> (prints path)
  • cleanup
  • copy-env <name>

Safety notes:

  • create does not change the current branch
  • cleanup does not force-remove worktrees and does not delete branches
  • cleanup deletes the worktree directory (including ignored files); removal fails if the worktree is not clean
  • .env* is copied with no overwrite (symlinks skipped)
  • refuses to operate if .worktrees/ or any worktree path component is a symlink
  • copy-env only targets registered worktrees
  • origin fetch is optional; local base refs are allowed
  • fetch from origin only when base looks like a branch
  • Worktrees live under .worktrees/