Agent Skills › mocasus/unprompted › unprompted-code

unprompted-code

GitHub

用于清理源码中AI生成的痕迹,如ASCII横幅、冗余注释、Emoji日志及占位符。旨在提升代码整洁度与人类可读性,适用于编写、重构或清理源码场景。

skills/unprompted-code/SKILL.md mocasus/unprompted

触发场景

代码审查时发现冗余注释 重构代码以去除AI风格结构 清理源码中的占位符和装饰性元素

安装

npx skills add mocasus/unprompted --skill unprompted-code -g -y
更多选项

不安装直接使用

npx skills use mocasus/unprompted@unprompted-code

指定 Agent (Claude Code)

npx skills add mocasus/unprompted --skill unprompted-code -a claude-code -g -y

安装 repo 全部 skill

npx skills add mocasus/unprompted --all -g -y

预览 repo 内 skill

npx skills add mocasus/unprompted --list

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

  1. ASCII / Box-Drawing Section Banners:
    // ==========================================
    // 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:
    // Initialize retry counter to zero
    let retries = 0;
    // Return the user object
    return user;
    
  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 (U-07):
    • 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 (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 */ } 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.

版本历史

  • 10cd954 当前 2026-12-03 02:10

同 Skill 集合

skills/unprompted-a11y/SKILL.md
skills/unprompted-copywriting/SKILL.md
skills/unprompted-direction/SKILL.md
skills/unprompted-mobile/SKILL.md
skills/unprompted-ui/SKILL.md
skills/unprompted/SKILL.md

元信息

文件数
0
版本
10cd954
Hash
695f60f8
收录时间
2026-12-03 02:10

首页 - Wiki
Copyright © 2011-2026 iteam. Current version is 2.156.0. UTC+08:00, 2026-12-03 05:56
浙ICP备14020137号-1