zj-git-bypass-safe-delete
Installation
SKILL.md
Bypass WorkBuddy Safe-Delete for Git
WorkBuddy's safe-delete shim (genie-safe-delete.cjs, injected via NODE_OPTIONS=--require=...) intercepts fs.unlinkSync / fs.rmSync / fs.rmdirSync and routes deletes to the OS trash. On Windows Git Bash, uname -s returns MINGW64_NT-10.0 — which the shim's case MINGW* does not match, so it falls through to trash_linux whose EXDEV fallback actually runs REAL_RM -rf "$p". Net effect: rm -rf is destructive on this host, and git's internal Node helpers silently lose .git/refs/* / index.lock / FETCH_HEAD.
This skill makes both the symptom (broken git) and the root cause (rm -rf is destructive) safe to handle.
Quick start
- Diagnose:
bash scripts/diagnose.sh <repo-path>— reports which files are missing, whether reflog is intact, and whether the shim is in scope. - Recover:
bash scripts/recover-refs.sh <repo-path> <branch> [<commit>]— recreates missingrefs/heads/...from reflog using direct file IO (notgit update-ref, which itself is unsafe under the shim). - Stop using
rm -rffor cleanup — usemv <target> <backup>/instead (shim does not wrapmv).
Workflow
1. Diagnose
Run: