跳至正文
OpenAgentSkill
浏览已开放 · 目录记录日期 2026-11-21 · 自动更新和账户服务暂时关闭。
开发与测试

debloat

Cut an artifact that has accreted into bloat, prose or code, to its load-bearing density, meaning and behavior preserved. In prose: padding, over-qualification, fused sentences, walls of enumeration, adjacent restatement. In code, behind green tests: comments that restate the code, commented-out code, vague TODOs, dead code, debug leftovers, guards on guaranteed values, pass-through wrappers, single-use helpers, and nesting a guard clause flattens. Use when the user names an artifact, section, file list, or diff that is correct and current but verbose, patched-over, or slop-filled and wants it tight without a full rewrite; when they ask to clean up, deslop, or remove AI slop from code or recent changes; or when a pipeline the user invoked passes that scope on. Acts only inside that scope.

LilMGenius · 已有静态检查记录

安装与使用

运行命令前先阅读来源与依赖说明。复制命令不会自动安装或执行。

npx skills add LilMGenius/paperthin --skill debloat

技能说明


name: debloat description: "Cut an artifact that has accreted into bloat, prose or code, to its load-bearing density, meaning and behavior preserved. In prose: padding, over-qualification, fused sentences, walls of enumeration, adjacent restatement. In code, behind green tests: comments that restate the code, commented-out code, vague TODOs, dead code, debug leftovers, guards on guaranteed values, pass-through wrappers, single-use helpers, and nesting a guard clause flattens. Use when the user names an artifact, section, file list, or diff that is correct and current but verbose, patched-over, or slop-filled and wants it tight without a full rewrite; when they ask to clean up, deslop, or remove AI slop from code or recent changes; or when a pipeline the user invoked passes that scope on. Acts only inside that scope."

Cut a bloated artifact, prose or code, to its load-bearing minimum: same meaning, same behavior, less text.

Goal

Correct, current work accumulates excess. Prose gathers qualifiers, repeated rules, and long enumerations until readers must study what they should skim. A reader is a person or a model, and both pay for each extra word in attention and in how clearly the next action reads. Code gathers comments that restate it, branches nothing reaches, guards against states that cannot occur, and layers that only forward a call. debloat cuts what carries no meaning or behavior and preserves everything load-bearing. It tightens otherwise sound work; rewriting belongs to re0, deduplication across artifacts to ssotize, and code conventions to re0-style. The excess it removes is one class of machine-writing tell.

Workflow

  1. Pin the artifact and read it end to end. Note in one line what each section must convey, or what each unit of code must do.
  2. Lock behavior before cutting code. Find the existing tests that exercise the observable behavior in scope (exports, handlers, commands, anything called from elsewhere), add the narrowest test that pins what they leave uncovered (it stays with the change), and run them green. Without a green baseline, stop and report before cutting code; prose in the same scope can still be tightened. Prose has no behavior to lock, so skip this step for it and never pin its wording with a text test; a value a machine parses out of it is checked through its real validator.
  3. Find the excess in prose: padding, dispensable qualifiers or parentheticals, sentences fused from three ideas, enumerations that a rule and short list could replace, nearby restatement, and decision history where the rule alone suffices.
  4. Find the excess in code. First ask whether each unit should exist, in this order: delete it when nothing needs its behavior; reuse what the codebase already has when it reimplements that; call the platform, the standard library, or an installed dependency when one already does it; only then simplify it in place. What survives is checked for comments that restate the code, commented-out code, vague TODOs, dead code (unused imports and private functions, unreachable branches, debug leftovers), branches repeated within the scope, defensive checks on values the code already guarantees, pass-through wrappers and single-use helpers, and nested conditionals a guard clause flattens.
  5. Compress in place. In prose, cut padding, split fused sentences or drop dead clauses, shorten enumerations, and keep repeated points once. In code, cut from safest to riskiest, one class at a time with the lock rerun after each: comments, dead code, defensive checks, repetition, nesting, then abstraction. Move nothing to another artifact.
  6. Preserve every load-bearing rule, fact, constraint, example, and observable behavior. Keep any word or line whose removal would lose one, and skip any code cut whose equivalence is not obvious.
  7. After cutting code, rerun the lock and the checks the repository runs on every change (its test, lint and type commands). Revert the class whose cut turned one red and keep that code.
  8. If content is duplicated across artifacts or has gone stale, stop and name it. Hand duplication to ssotize and drift to re0 as a named finding for those skills to act on; debloat only tightens. Report excess you notice outside the scope without touching it.
  9. Re-read cold and cut again; the first pass always leaves some.

Rules

  • Cut words and code that carry nothing, never load-bearing claims or behavior. Every rule, fact, constraint, and observable behavior survives; only density changes.
  • Preserve voice and structure. Compress within them without re-styling. In code, public signatures and type annotations stay, and no abstraction or dependency is added.
  • In code, keep what is load-bearing even when it looks like excess:
    • a comment that explains why: a business rule, an edge case, a workaround, a ticket link, a regex or algorithm, a recorded shortcut and its ceiling; and test-structure markers such as given, when, then;
    • validation and error handling at a trust boundary (user input, external APIs, I/O, nullable stored fields), unless a hostile-input test proves a check inside the boundary already rejects that input; without that proof the guard stays;
    • code reached by reflection, dynamic dispatch, or string lookup, and a rollback path its owner keeps on purpose; ask when unsure;
    • an abstraction that is a real seam: testability, more than one implementer, or a boundary the framework requires;
    • lookalike code serving different intents that could diverge; leave it apart rather than forcing a shared helper.
  • Compression removes excess-class machine-writing tells: padding, over-qualification, and adjacent restatement. Cite Wikipedia's published essay Signs of AI writing for any tell list consulted; never re-derive it. Hand drift to re0, duplication to ssotize, code conventions to re0-style, em-dashes to dedash (last, because rewriting rege
阅读完整来源 ↗