Loading...
Loading...
Enforces using git stash before file deletion and prohibits direct rm/unlink commands. Use when deleting files, cleaning up codebase, or removing tracked/untracked files. MUST ALWAYS be applied when file deletion is needed.
npx skill4agent add totto2727-dotfiles/agents file-deletion-rulesrmunlinkrmrm -rfrm -funlinkgit stash push -m "[Deletion] <reason>" -- <files>git rm <files>git add <files>git stash push -m "[Deletion] <reason>" -- <files>[Deletion] <reason>
Files: <file1>, <file2>, ...# Single file
git stash push -m "[Deletion] Remove deprecated API endpoints
Files: api/old-endpoint.js" -- api/old-endpoint.js
# Multiple files
git stash push -m "[Deletion] Clean up unused test fixtures
Files: test/fixtures/old.js, test/fixtures/deprecated.js" -- test/fixtures/old.js test/fixtures/deprecated.js
# Directory
git stash push -m "[Deletion] Remove legacy components
Files: src/components/legacy/" -- src/components/legacy/# Step 1: Save to stash
git stash push -m "[Deletion] Remove unused utility function
Files: utils/old-helper.js" -- utils/old-helper.js
# Step 2: Remove from git
git rm utils/old-helper.js# Step 1: Stage file
git add temp-file.js
# Step 2: Save to stash (removes from working tree)
git stash push -m "[Deletion] Remove temporary file
Files: temp-file.js" -- temp-file.js# Save all files to stash
git stash push -m "[Deletion] Clean up deprecated modules
Files: module1.js, module2.js, module3.js" -- module1.js module2.js module3.js
# Remove from git
git rm module1.js module2.js module3.js# DO NOT USE
rm file.js
rm -rf directory/
unlink file.js