unprompted-code — Clean, Human-Written Source Hygiene
Extends core rules U-07, U-28, and U-35. AI-generated source files carry unmistakable comment and structural noise even when the logic works.
1. Comment Hygiene: Delete What Restates the Code (U-28, U-35)
Immediately Delete
- ASCII / Box-Drawing Section Banners:
If a file needs giant ASCII dividers to stay navigable, split the module or let clear function names speak for themselves.ts// ========================================== // HELPER FUNCTIONS // ========================================== - Captain-Obvious Narration Comments:
ts
// Initialize retry counter to zero let retries = 0; // Return the user object return user; - Prompt-Echo & Changelog Comments:
- Never leave
// Added per user request,// Fixed bug,// Updated to remove slop, or// Here we seamlessly handle...inside source files; commit history belongs in Git, not inline comments.
- Never leave
- Emoji Console & Error Strings (
U-07):- Replace
console.log("🚀 Server started!")andconsole.error("❌ Failed!")with structured, greppable log prefixes ([http] listening on 127.0.0.1:8080,[db] connection refused: ECONNREFUSED).
- Replace
Keep Comments Only When They Carry Non-Obvious Signal (U-35)
Keep a comment only when deleting it would hide something the syntax itself cannot express:
- Why a non-obvious threshold, regex, or ordering invariant exists ("Flush before closing socket; Windows resets unread TCP buffers on immediate close").
- External protocol / RFC / browser-bug citations ("Safari < 17.4 ignores subgrid gap percentage; fallback to fixed rem").
- Public library JSDoc documenting units, side effects, or error contracts on exported APIs.
2. Structural Anti-Slop in Implementation
- No Speculative Abstraction: Do not wrap a single-use 6-line fetch call inside
BaseApiServiceFactory+AbstractHttpAdapter. Write direct, flat modules until a second real caller demands extraction. - No Silent Catch Swallowing: Never write
catch (err) { /* ignore */ }orcatch (e) { return null; }around I/O or network boundaries unless failure is an expected control-flow branch (and state why). - No Unasked Stubs: Never replace working code with
// ... rest of implementation remains the sameor unrequestedTODOplaceholders.


