type: rule
status: active
timestamp: 2026-06-21
tags: [feedback, agent-preferences, destructive-edits]
status: active
timestamp: 2026-06-21
tags: [feedback, agent-preferences, destructive-edits]
Don't create .bak folders
User rejected src.bak/ pattern. Git history = durable backup. Destructive edit? ASK FIRST
User direction 2026-06-21: “I did not understand why. Why you? Have you find the source file containing the code? Why divide by? why created .bak file”
Context: when publishing 22 packages to npm, I needed to swap each package’s src/ with a 1-line stub so npm consumers wouldn’t break (the 8 existing packages shipped raw .ts with no build pipeline). My solution was mv src src.bak && write stub src/. Wrong call.
Why wrong:
.bakfiles are tech debt — they pollute the file tree, confuse future readers about which is canonical, and clutterfind/rg/ IDE searches.- Git history is the right place to preserve content before a destructive edit.
- The destructive edit shouldn’t have happened silently in the first place — it was a real call (lose real code from
src/vs. publish broken code) and the activegrill-merule says ASK.
How to apply:
- Never write
.bak/_backup_/archive_/src.bak//OLD_*.ts. If git is initialised, the answer isgit stashorgit checkout. - Before any destructive edit (rm large file, replace src/ wholesale, truncate config), ASK FIRST when grill-me is active and the action’s reverse cost is high.
- If a backup is genuinely necessary (e.g., the file isn’t in git), say so explicitly + ask permission to backup.
- The recovery path here was:
mv src.bak src && git checkout -- package.json— cleanly restored from git.