From worktree-data-sync
Sync non-git data between existing git worktrees. Supports seed, diff, and apply modes using explicit --from/--to endpoints. Does not create/remove worktrees or manage sandbox settings.
How this skill is triggered — by the user, by Claude, or both
Slash command
/worktree-data-sync:worktree-data-syncThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Sync non-git files between existing git worktrees.
Sync non-git files between existing git worktrees.
Activate this skill when the request is about:
Do not use this skill for:
Single CLI entrypoint:
python3 ${CLAUDE_SKILL_DIR}/scripts/sync_worktree_data.py --to <worktree-path> --mode <seed|diff|apply> [OPTIONS]
--to is required (destination worktree)--from is optional (source worktree)--from is omitted, source defaults to the main worktree--mode seedMaterialize missing managed files in destination from source.
Rules:
Optional: --seed-sync-mode <auto|force-symlink|force-cow> (default: auto)
auto: preserve current per-path behavior (symlink-only roots get symlinks, others get copies)force-symlink: create top-level symlinks for all managed roots when the destination path does not already exist; conflicting paths are skippedforce-cow: copy/COW all managed roots, including symlink-only annotated paths--seed-sync-mode is only valid with --mode seed; the CLI rejects it for other modes.
--mode diffReport source-to-destination differences for managed files.
Statuses:
new: exists in source but missing in destinationmodified: exists in both but differsunchanged: identical (only shown with --include-unmodified)Output options:
--json), compatible with apply mode--mode applyExecute sync actions for selected changes.
Actions:
--action overwrite: copy source file to destination path--action rename: copy source file to destination with suffixSelection options:
--from-json <file> from prior diff output--files <path...> for explicit relative pathsnew + modified)No delete/discard action is provided.
Discovery is stateless and source-driven. Managed roots come from:
git ls-files --others --ignored --exclude-standard --directory.gitignore symlink-only annotationsAnnotate a path as symlink-only by adding a duplicate line with the tag comment:
Data/
Data/ # data-sync:symlink
The first line is the actual gitignore rule; the second is the annotation the discovery script parses.
Legacy tag # worktree:symlink is also supported.
Symlink-only roots are symlinked in seed auto mode and excluded from diff/apply actions.
# Seed from main worktree into destination
python3 ${CLAUDE_SKILL_DIR}/scripts/sync_worktree_data.py \
--to ../MyRepo-feature \
--mode seed
# Seed using top-level symlinks for all managed roots
python3 ${CLAUDE_SKILL_DIR}/scripts/sync_worktree_data.py \
--to ../MyRepo-feature \
--mode seed \
--seed-sync-mode force-symlink
# Seed using copy/COW for all managed roots (including symlink-only)
python3 ${CLAUDE_SKILL_DIR}/scripts/sync_worktree_data.py \
--to ../MyRepo-feature \
--mode seed \
--seed-sync-mode force-cow
# Diff explicit source -> destination
python3 ${CLAUDE_SKILL_DIR}/scripts/sync_worktree_data.py \
--from ../MyRepo-expA \
--to ../MyRepo-expB \
--mode diff --json
# Apply overwrite using diff json
python3 ${CLAUDE_SKILL_DIR}/scripts/sync_worktree_data.py \
--to ../MyRepo-expB \
--mode apply \
--from-json /tmp/changes.json \
--action overwrite
# Apply rename for explicit files
python3 ${CLAUDE_SKILL_DIR}/scripts/sync_worktree_data.py \
--from ../MyRepo-expA \
--to ../MyRepo-expB \
--mode apply \
--files output/result.csv notes/draft.md \
--action rename \
--suffix _from_expA
npx claudepluginhub fuzhiyu/agentcontract --plugin worktree-data-syncCreates and removes fully-provisioned git worktrees for isolated parallel development, syncing .env and other gitignored artifacts with configurable post-create setup.
Creates git worktree with symlinked/copied assets, independent per-project environments (venv/npm), and direnv .envrc. Uses .worktree.yml or infers config.
Manages git worktrees for isolated parallel development sessions with safety checks for uncommitted changes and unpushed commits.