跳到正文
FunCoding

unprompted-code

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.

Star
504
许可证
MIT
最近提交
2026年12月2日

skills/unprompted-code/SKILL.md

在 GitHub 上查看

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.

相似的 Skill

ask-matt

MAmattpocock/skills337k近 7 天新增 4,978 个 star

chief-of-staff

MAmattpocock/skills337k近 7 天新增 4,978 个 star

setup-matt-pocock-skills

MAmattpocock/skills337k近 7 天新增 4,978 个 star

subagent-driven-development

OBobra/superpowers331k近 7 天新增 4,772 个 star

autonomous-loops

AFaffaan-m/ECC315k近 7 天新增 4,381 个 star

autonomous-agent-harness

AFaffaan-m/ECC315k近 7 天新增 4,381 个 star