From fw
Manage isolated git worktrees. Use for branch work, isolated review targets, parallel checkouts, or cleanup.
How this skill is triggered — by the user, by Claude, or both
Slash command
/fw:worktreeThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
`$fw:worktree` is Flywheel's isolated-workspace manager.
$fw:worktree is Flywheel's isolated-workspace manager.
Use it when the right move is not "switch branches in place", but "open a clean parallel checkout with the branch, template env files, and ignore hygiene already handled."
Always use the bundled manager script instead of typing raw git worktree
commands by hand.
Script path:
<repo-root>/skills/worktree/scripts/worktree-manager.sh
The manager script handles the Flywheel defaults that raw git worktree add
does not:
.worktrees/.worktrees/ is ignored.env* files exist without copying them automaticallyFollow ../references/host-interaction-contract.md.
Call the exact host question tool named in
../references/host-interaction-contract.md when that tool is available. Do
not ask for raw 1/2/3 replies when the host already offers a choice surface.
When the workflow spans multiple material steps, use the host task-tracking
tool named in ../references/host-interaction-contract.md to create and
maintain a short task list.
Prefer calling the host question tool with a concise choice surface when the user has not already named an action:
Interpret the input or user intent as one of:
create <branch> [base]listpath <branch>copy-env <branch>cleanup <branch>If the user only says they want isolated work, infer create.
Run the manager script directly:
bash "$(git rev-parse --show-toplevel)/skills/worktree/scripts/worktree-manager.sh" <command> ...
Use:
bash "$(git rev-parse --show-toplevel)/skills/worktree/scripts/worktree-manager.sh" create <branch-name> [base-branch]
Creation rules:
Use:
bash "$(git rev-parse --show-toplevel)/skills/worktree/scripts/worktree-manager.sh" list
Use:
bash "$(git rev-parse --show-toplevel)/skills/worktree/scripts/worktree-manager.sh" path <branch-name>
The script returns the worktree path and a cd command suggestion.
Use:
bash "$(git rev-parse --show-toplevel)/skills/worktree/scripts/worktree-manager.sh" copy-env <branch-name>
This is the explicit escape hatch for copying real top-level .env and
.env.* files when that worktree genuinely needs local secrets.
If the repo has a durable local preference recorded in
.flywheel/config.local.yaml, honor it by setting
FW_WORKTREE_ENV_COPY_MODE=none, templates-only, or real-files when
invoking the script. The default remains templates-only.
Use:
bash "$(git rev-parse --show-toplevel)/skills/worktree/scripts/worktree-manager.sh" cleanup <branch-name>
Cleanup is intentionally conservative:
Flywheel's default worktree posture is:
FW_WORKTREE_ENV_COPY_MODE when the
repo truly needs a different defaultUse copy-env only when the worktree actually needs those local secrets.
Review-only and documentation-only worktrees should usually not copy them.
$fw:work should recommend $fw:worktree whenever work starts from the
default branch and isolation is preferable.$fw:review should prefer $fw:worktree when a PR or branch must be
reviewed without switching the shared checkout.$fw:commit may suggest $fw:worktree cleanup <branch> after merge or after a
shipped branch no longer needs an isolated checkout.Return:
cd <path>, copy-env <branch>, or a
cleanup follow-upCreates, edits, and optimizes skills for Claude Code, including drafting, evaluating with test prompts, iterating on performance, and improving skill descriptions for better triggering accuracy.
npx claudepluginhub mopeyjellyfish/flywheel --plugin flywheel