technical-deslop

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Technical Deslop

技术说明

Purpose

目标

Clean branch/staged diffs by removing AI-style slop and restoring repo-consistent style without changing behavior.
在不改变代码行为的前提下,通过移除AI生成的冗余内容并恢复符合仓库规范的编码风格,清理分支/暂存区的代码差异。

When to use

使用场景

  • A diff feels over-explained, overly defensive, or inconsistent with surrounding code.
  • You need a final cleanup pass before review/PR.
  • You want to normalize style after automated generation.
  • 代码差异存在过度注释、过度防御性代码,或与周边代码风格不一致的情况。
  • 在代码评审/提交PR前需要进行最终清理。
  • 自动化生成代码后需要统一编码风格。

Workflow

工作流程

  1. Capture scope with
    git diff --cached
    and
    git diff $(git merge-base origin/main HEAD)..HEAD
    .
  2. Focus only on changed hunks (or user-scoped files).
  3. Apply the cleanup sequence in
    references/playbook.md
    .
  4. Remove slop patterns: redundant comments, unnecessary defensive branches, non-idiomatic casts, and style drift.
  5. Re-check behavior boundaries: no logic changes unless the user explicitly requested them.
  6. Report a short 1-3 sentence summary of cleanup performed.
Read
references/slop-patterns.md
for detection rules and
references/playbook.md
for execution order.
  1. 使用
    git diff --cached
    git diff $(git merge-base origin/main HEAD)..HEAD
    确定清理范围。
  2. 仅关注有变更的代码块(或用户指定的文件)。
  3. 按照
    references/playbook.md
    中的步骤执行清理。
  4. 移除冗余内容:包括多余注释、不必要的防御性分支、非惯用类型转换以及风格不一致的代码。
  5. 重新检查代码行为边界:除非用户明确要求,否则不得修改代码逻辑。
  6. 提交1-3句话的简短清理总结。
可查看
references/slop-patterns.md
了解冗余内容的检测规则,查看
references/playbook.md
了解执行顺序。

Inputs

输入项

  • Optional file scope (
    FILES
    ) or explicit user file targets.
  • Current branch diff and staged diff.
  • Repository conventions from local instructions/config.
  • 可选的文件范围(
    FILES
    参数)或用户指定的具体文件。
  • 当前分支的代码差异和暂存区的代码差异。
  • 本地说明/配置中定义的仓库编码规范。

Outputs

输出项

  • Behavior-preserving cleanup in touched files.
  • Minimal summary of what was normalized and where.
  • 已处理文件中保留代码行为的清理结果。
  • 关于统一内容及位置的简短总结。