Agent Skills › mocasus/unprompted › unprompted-code

unprompted-code

GitHub

移除AI生成代码中的冗余注释、ASCII横幅、表情日志及防御性包装,提升源码可读性与规范性。适用于编写、重构或清理代码时加载,确保结构简洁且注释具有实际价值。

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

Trigger Scenarios

编写新代码 重构现有代码 清理源码中的AI痕迹

Install

npx skills add mocasus/unprompted --skill unprompted-code -g -y
More Options

Use without installing

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": "4.0.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 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:
    // ==========================================
    // 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 (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.

Version History

  • 5f9ec34 Current 2026-12-05 03:22

    版本升级至v4.0.0,规则标识从U系列调整为W和M系列,更新了对结构化日志和非明显信号注释的规范描述。

  • 10cd954 2026-12-03 02:10

Same Skill Collection

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

Metadata

Files
0
Version
5f9ec34
Hash
91a1c68a
Indexed
2026-12-03 02:10

Главная - Вики-сайт
Copyright © 2011-2026 iteam. Current version is 2.156.0. UTC+08:00, 2026-12-05 05:43
浙ICP备14020137号-1