deslop

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Deslop

Deslop

Remove AI-generated code patterns from all changes in the current branch.
清除当前分支所有变更中由AI生成的冗余代码模式。

Process

操作流程

  1. Run
    git diff main
    to get all changes
  2. For each changed file, read the full file to understand existing style
  3. Identify and remove slop patterns (see below), matching the file's existing style
  4. Report a 1-3 sentence summary of changes
  1. 运行
    git diff main
    获取所有变更内容
  2. 针对每个变更文件,通读全文以了解现有代码风格
  3. 识别并移除冗余代码模式(见下文),确保与文件现有风格一致
  4. 用1-3句话总结变更内容

Slop Patterns

冗余代码模式

Remove these when inconsistent with the surrounding code:
  • Unnecessary comments - Comments a human wouldn't add or that don't match the file's commenting style
  • Defensive overkill - Extra try/catch blocks, null checks, or validation that's abnormal for that area (especially on trusted/validated codepaths)
  • Type escape hatches - Casts to
    any
    to bypass type issues
  • Single-use variables - Variables used once immediately after declaration; inline the RHS instead
  • React prop interfaces - Separate
    interface Props
    definitions; inline the props type directly
  • Style drift - Any formatting, naming, or patterns inconsistent with the file
当以下内容与周边代码风格不一致时,将其移除:
  • 不必要的注释 - 人工不会添加的注释,或与文件注释风格不符的注释
  • 过度防御性代码 - 额外的try/catch块、空值检查或验证逻辑,这些在该代码区域并不常见(尤其是在已信任/已验证的代码路径上)
  • 类型规避手段 - 通过强制转换为
    any
    来绕过类型检查问题
  • 一次性变量 - 声明后立即只使用一次的变量;应直接将右侧表达式内联使用
  • React属性接口 - 单独定义的
    interface Props
    ;应直接内联属性类型
  • 风格偏离 - 任何与文件现有格式、命名或代码模式不一致的内容

Style Matching

风格匹配

Before editing, study the unchanged code in each file:
  • Comment density and style
  • Error handling patterns
  • Variable naming conventions
  • Type annotation style
  • Component patterns (for React)
Only flag something as slop if it deviates from the file's established patterns.
在编辑前,研究每个文件中未变更的代码:
  • 注释密度与风格
  • 错误处理模式
  • 变量命名规范
  • 类型注解风格
  • 组件模式(针对React)
只有当内容偏离文件已确立的模式时,才将其标记为冗余代码。

Output

输出结果

End with only a 1-3 sentence summary of what was changed. No detailed lists.
最终仅输出1-3句话的变更总结,无需详细列表。