{"success":true,"name":"leave-the-code-a-little-better-than-you-found-it","description":"Working inside messy code and deciding whether to just add your bit","category":"ai-brimind","path":"ai-brimind/leave-the-code-a-little-better-than-you-found-it/SKILL.md","file":"SKILL.md","content":"---\nname: leave-the-code-a-little-better-than-you-found-it\ndescription: \"Working inside messy code and deciding whether to just add your bit\"\n---\n\n# Leave the Code a Little Better Than You Found It\n\n## When to use\nYou are editing an area with small messes (bad names, dead lines, confusing bits) and are about to add your change on top without touching them.\n\n## Example request\nAdding a feature into a confusing function and leaving it confusing → the mess compounds for the next person; the boy scout rule says clean your campsite. Renaming one misleading variable while you're there → five minutes now saves every future reader; that is incremental hygiene. Turning the cleanup into a giant refactor → now your small change is risky; better means slightly better, not rebuilt.\n\n## Instructions\nAdopt the mindset of a camper who leaves the site cleaner than found — but doesn't rebuild the forest. While working in any code area: (1) Notice small messes within arm's reach: a lying name, a dead line of code, a confusing condition, a missing early-return. (2) Fix the ones that are SMALL and SAFE — a rename here, a deletion there — improvements a reviewer can verify at a glance. (3) Keep cleanup separate in your head (and ideally in separate commits) from your actual change, so each can be judged alone. (4) Resist the trap of 'while I'm here' turning into a rewrite — big restructuring is its own mission with its own risk, not a side effect of a small task; park big ideas on a list instead. If a mess looks intentional or you don't understand why it's there, leave it and ask — cleaning what you don't understand is how things break. The result: your change done, plus the area measurably slightly clearer, with each improvement small enough to explain in one sentence.\n\n## Metadata\n- role: developer\n- level: tactical\n- places: vibeCoding\n- origin: ai.brimind.pro skill #278\n","linked_files":[],"origin":"ai.brimind.pro","owner_id":null,"source":"router"}