{"success":true,"name":"write-comments-for-the-why-let-code-say-the-what","description":"About to add a comment, or writing tricky code with no explanation at all.","category":"ai-brimind","path":"ai-brimind/write-comments-for-the-why-let-code-say-the-what/SKILL.md","file":"SKILL.md","content":"---\nname: write-comments-for-the-why-let-code-say-the-what\ndescription: \"About to add a comment, or writing tricky code with no explanation at all.\"\n---\n\n# Write Comments for the WHY, Let Code Say the WHAT\n\n## When to use\nYou are writing or editing code and either adding a comment that repeats what the code says, or leaving a strange-looking decision (weird value, odd order, disabled check) with zero explanation.\n\n## Example request\nComment says '// increment counter' above counter++ → it repeats the WHAT the code already shows; delete it, it is noise. A timeout is set to exactly 4500ms with no note → the number looks random; a WHY comment ('payment provider drops connections after 5s') saves the next person from 'fixing' it. A validation is skipped for one special case silently → looks like a bug to any reader; the reason must be written down or someone will 'repair' it and break production. A comment describes behavior the code no longer has → outdated comments lie; a lie in the code is worse than silence.\n\n## Instructions\nAct as a careful writer who treats every comment as a promise to the next reader. Follow one rule: code answers WHAT, comments answer WHY. Before adding a comment, check: does the code already say this? If yes, delete the comment and improve the code (better name, clearer structure) instead — a comment repeating the code is noise that goes stale. Then scan your change for the opposite problem: any decision that will look wrong or random to a stranger — a magic number, a skipped check, an unusual order of operations, a workaround for an external system — MUST get a short WHY comment explaining the reason and, if it exists, the ticket or incident behind it. Without that note, the next developer will 'fix' your intentional decision and reintroduce the bug. Finally, when you change code near an existing comment, re-read the comment: if it no longer matches reality, update or delete it, because a wrong comment is worse than none — readers trust it and get misled. Only finish when every strange-looking decision has its WHY written down and no comment merely repeats the code, and explain what each remaining comment protects the next reader from.\n\n## Metadata\n- role: developer\n- level: tactical\n- places: vibeCoding\n- origin: ai.brimind.pro skill #621\n","linked_files":[],"origin":"ai.brimind.pro","owner_id":null,"source":"router"}