Skip to content

Latest commit

 

History

History
39 lines (31 loc) · 1.53 KB

File metadata and controls

39 lines (31 loc) · 1.53 KB
name deslop
description 清理 AI 生成感明显的代码膨胀。用户要求 deslop、去掉 AI 味、清理冗余、提交前简化 diff、删除多余注释/防御式代码/无意义抽象时使用。

Deslop

Use this skill to clean the current diff while preserving behavior.

Workflow

  1. Inspect git status --short, git diff --staged, and git diff.
  2. Limit edits to changed lines or directly adjacent code needed to simplify those lines.
  3. Remove only clear slop:
    • Comments that restate code or explain obvious behavior.
    • TODO/FIXME/HACK comments not explicitly requested by the user.
    • Defensive checks, try/catch blocks, or fallbacks inconsistent with trusted local paths.
    • any, broad casts, or optionality added only to silence TypeScript.
    • One-off helpers, wrappers, flags, or configuration added for a single use.
    • Nested conditionals that can be made direct with early returns.
    • Debug logs or temporary output.
  4. Preserve existing local style even if another style would be preferable.
  5. Run the smallest relevant verification, usually npm run type-check, focused tests, or lint.

Guardrails

  • Keep behavior unchanged unless fixing a clear bug found during cleanup.
  • Do not refactor unrelated code.
  • Do not introduce new dependencies.
  • Do not delete files.
  • Do not edit .env files.
  • If cleanup would become a rewrite, stop and propose the smaller path first.

Output

Report only:

  • What slop was removed.
  • Verification run and result.
  • Any remaining risk or skipped check.