technical-deslop
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseTechnical 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
工作流程
- Capture scope with and
git diff --cached.git diff $(git merge-base origin/main HEAD)..HEAD - Focus only on changed hunks (or user-scoped files).
- Apply the cleanup sequence in .
references/playbook.md - Remove slop patterns: redundant comments, unnecessary defensive branches, non-idiomatic casts, and style drift.
- Re-check behavior boundaries: no logic changes unless the user explicitly requested them.
- Report a short 1-3 sentence summary of cleanup performed.
Read for detection rules and for execution order.
references/slop-patterns.mdreferences/playbook.md- 使用和
git diff --cached确定清理范围。git diff $(git merge-base origin/main HEAD)..HEAD - 仅关注有变更的代码块(或用户指定的文件)。
- 按照中的步骤执行清理。
references/playbook.md - 移除冗余内容:包括多余注释、不必要的防御性分支、非惯用类型转换以及风格不一致的代码。
- 重新检查代码行为边界:除非用户明确要求,否则不得修改代码逻辑。
- 提交1-3句话的简短清理总结。
可查看了解冗余内容的检测规则,查看了解执行顺序。
references/slop-patterns.mdreferences/playbook.mdInputs
输入项
- Optional file scope () or explicit user file targets.
FILES - 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.
- 已处理文件中保留代码行为的清理结果。
- 关于统一内容及位置的简短总结。