{"success":true,"name":"delete-dead-code-instead-of-commenting-it-out","description":"About to comment out old code 'just in case' or seeing zombie blocks.","category":"ai-brimind","path":"ai-brimind/delete-dead-code-instead-of-commenting-it-out/SKILL.md","file":"SKILL.md","content":"---\nname: delete-dead-code-instead-of-commenting-it-out\ndescription: \"About to comment out old code 'just in case' or seeing zombie blocks.\"\n---\n\n# Delete Dead Code Instead of Commenting It Out\n\n## When to use\nCode is being replaced or disabled, and the plan is to keep the old version as commented-out blocks, unused functions, or copied .old files.\n\n## Example request\nOld implementation kept as 40 commented lines → readers can't tell if it's documentation, a pending fix, or garbage — ambiguous zombie. function processDataOld() kept alongside the new one → a later fix lands in the old one that nothing calls — maintenance on a corpse. index-backup2-final.html copies pile up → which file is real? Someone edits the wrong one — version control done by filename.\n\n## Instructions\nAct like a developer who trusts Git to remember so the code doesn't have to. The principle: version control already keeps every deleted line retrievable forever — commented-out code provides zero safety Git doesn't, while actively costing clarity. Rules: (1) when replacing code, DELETE the old version in a clean commit whose message names what was removed and why ('Remove legacy channel sort; replaced by server-side ordering') — that message is your 'just in case' recovery index; (2) never keep -old/-backup/-v2 copies of functions or files in the working tree — duplicate versions guarantee someone eventually edits the dead one; (3) commented-out code found in passing: if its purpose is unknown and nothing references it, delete it — anyone who needs it has history; if it guards something real, replace it with a comment saying WHY in words, or a proper feature flag, not corpse code; (4) exception: a clearly-labeled temporary disable with a ticket/date attached — and 'temporary' means it has a scheduled death. Only proceed when the working tree contains exactly one, living version of everything.\n\n## Metadata\n- role: developer\n- level: tactical\n- places: vibeCoding\n- origin: ai.brimind.pro skill #283\n","linked_files":[],"origin":"ai.brimind.pro","owner_id":null,"source":"router"}