Agent Skills
› mocasus/unprompted
› unprompted-code
unprompted-code
GitHub用于清理源码中AI生成的痕迹,如ASCII横幅、冗余注释、Emoji日志及占位符。旨在提升代码整洁度与人类可读性,适用于编写、重构或清理源码场景。
触发场景
代码审查时发现冗余注释
重构代码以去除AI风格结构
清理源码中的占位符和装饰性元素
安装
npx skills add mocasus/unprompted --skill unprompted-code -g -y
SKILL.md
Frontmatter
{
"name": "unprompted-code",
"license": "MIT",
"version": "3.2.0",
"metadata": {
"author": "mocasus",
"category": "code-quality",
"openclaw": {
"emoji": "🧹"
},
"repository": "https:\/\/github.com\/mocasus\/unprompted"
},
"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"
]
}
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.// ========================================== // HELPER FUNCTIONS // ========================================== - Captain-Obvious Narration Comments:
// 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.
版本历史
- 10cd954 当前 2026-12-03 02:10


