From git-worktree-safety
Audits and repairs missing, stale, or broken Git worktree paths and convenience symlinks when a registered replacement holds the branch. Classifies retention type and guards POSIX-only symlink repair.
How this skill is triggered — by the user, by Claude, or both
Slash command
/git-worktree-safety:git-worktree-recoveryThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Recover the pointer only after proving that Git state is already safe. Resolve
Recover the pointer only after proving that Git state is already safe. Resolve
$PLUGIN_ROOT from the host's plugin-root variable when defined; otherwise use
the absolute path of this skill folder's ../...
Read
$PLUGIN_ROOT/skills/git-worktree-recovery/references/recovery-contract.md
before interpreting salvage evidence or authorizing repair.
audit; it is the default mode and performs only allowlisted
read-only Git inspection.refs/heads/... ref containing every expected commit as repair
authority. Reflog-only or object-only retention is salvage evidence, never
authority to repoint a convenience link.HEAD equal to the live branch ref, a clean porcelain-v2 status including
untracked files whose branch.oid and branch.head headers still equal that
HEAD and requested short branch, no in-progress Git operation, and no
locked or prunable annotation. Require at least one canonical full expected
commit ID whose object type is directly commit.refs/heads/... ref, the registered replacement
directory, the convenience link, and any full expected commit IDs.ready only when authority is repoint and every Git, worktree,
cleanliness, link, and target gate passes. salvage-only, blocked, or an
evidence error is a stop condition.repair-link. The helper re-audits immediately, compares the fingerprint and
raw target, replaces only the exact symlink, then proves relevant Git state
remained unchanged.audit independently and report the final link state, branch/ref
object ID, Git fingerprint, and any remaining stop condition.Read-only audit:
python3 "$PLUGIN_ROOT/scripts/git_worktree_recovery_guard.py" \
--repo /path/to/surviving-checkout \
--branch-ref refs/heads/example-branch \
--replacement /path/to/registered-replacement \
--link /path/to/convenience-link \
--expected-old-target ../missing-checkout \
--new-target ../registered-replacement \
--expected-commit 0123456789abcdef0123456789abcdef01234567
Separately authorized repair:
python3 "$PLUGIN_ROOT/scripts/git_worktree_recovery_guard.py" \
--mode repair-link \
--repo /path/to/surviving-checkout \
--branch-ref refs/heads/example-branch \
--replacement /path/to/registered-replacement \
--link /path/to/convenience-link \
--expected-old-target ../missing-checkout \
--new-target ../registered-replacement \
--expected-commit 0123456789abcdef0123456789abcdef01234567 \
--expected-fingerprint AUDIT_FINGERPRINT \
--apply
Exit 0 means ready, noop, or repaired; exit 2 is a safety refusal;
exit 1 means malformed input or unavailable evidence. A successful repair is
pointer-only proof, not permission for any later Git or delivery mutation.
npx claudepluginhub xopoko/plug-n-skills --plugin git-worktree-safetyGuides completion of development work by verifying tests, detecting environment, and presenting structured options for merge, PR, or cleanup.
Guides creation and editing of skills using test-driven development with pressure scenarios and subagents to verify agent compliance.
Dispatches multiple subagents concurrently for independent tasks without shared state. Use when facing 2+ unrelated failures or subsystems that can be investigated in parallel.