---
name: unprompted-code
version: 4.3.1
license: MIT
description: >-
Remove AI-shaped code tells: ASCII banner comments, line-by-line narration
comments, emoji console logs, dead defensive wrappers, and placeholder stubs.
Load whenever writing, refactoring, or cleaning up source code.
compatibility: [windows, macos, linux]
metadata:
author: mocasus
category: code-quality
repository: https://github.com/mocasus/unprompted
openclaw:
emoji: "🧹"
---
# unprompted-code — Clean, Human-Written Source Hygiene
Extends v4 `W-04`, `W-06`, `W-05`, and `M-10`. AI-generated source files carry unmistakable comment and structural noise even when the logic works.
---
## 1. Comment hygiene: delete what restates the code (`W-04`)
### Immediately delete
1. **ASCII / box-drawing section banners**:
```ts
// ==========================================
// HELPER FUNCTIONS
// ==========================================
```
If a file needs giant ASCII dividers to stay navigable, split the module or let clear function names speak for themselves.
2. **Captain-obvious narration comments**:
```ts
// Initialize retry counter to zero
let retries = 0;
// Return the user object
return user;
```
<!-- ‹guest · 2026-12-05› -->
3. **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.
4. **Emoji console & error strings (`W-06`)**:
- Replace `console.log("🚀 Server started!")` and `console.error("❌ Failed!")` with structured, greppable log prefixes (`[http] listening on 127.0.0.1:8080`, `[db] connection refused: ECONNREFUSED`).
### Keep comments only when they carry non-obvious signal
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.
No comment is the default. A comment must earn its line.
---
## 2. Structural anti-slop in implementation (`W-05`, `M-10`)
- **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 */ }` or `catch (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 same` or unrequested `TODO` placeholders. A placeholder is not a deliverable (`W-05`).
- **No client JS for layout, type, or simple interaction (`M-10`)**: Prefer CSS for responsive composition, type scaling, and simple states; keep the JS budget for behavior that needs it.
- **No dead defensive wrappers**: Do not add try/catch, null checks, or feature-detection layers for conditions the code cannot encounter. Defend the boundary, not every line.
این نسخه با نشانهگذاری اختصاصی حساب شما نمایش داده میشود. برای نصب سریع، به تب نصب و راهاندازی بروید.