跳到正文
Skillpedia
通用编程33k · #9085

deslop

它能做什么

这项技能指导你的智能体审查分支中的改动,并删除 AI 写入的冗余内容。适合希望代码与现有项目风格一致的开发人员。

适用场景

  • ✓分支中的 AI 生成代码含有多余注释或不必要检查的时候。
  • ✓想删除为通过类型检查而添加的 any 类型转换的时候。
  • ✓合并前,想让代码与周围文件的风格保持一致的时候。

技能链接

https://github.com/davila7/claude-code-templates/blob/main/cli-tool/components/skills/sentry/deslop/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/davila7/claude-code-templates/blob/main/cli-tool/components/skills/sentry/deslop/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“请帮我清理我的分支中相对于 main 的 AI 生成冗余内容。”

每周 5 个新技能,1 分钟读完。

工作原理

智能体将分支与 main 的差异进行对比,删除多余注释、不必要的防御性代码和风格不一致的地方,然后给出简短总结。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

Remove AI Code Slop

Check the diff against main and remove all AI-generated slop introduced in this branch.

What to Remove

  • Extra comments that a human wouldn't add or are inconsistent with the rest of the file
  • Extra defensive checks or try/catch blocks that are abnormal for that area of the codebase (especially if called by trusted/validated codepaths)
  • Casts to any to get around type issues
  • Inline imports in Python (move to top of file with other imports)
  • Any other style that is inconsistent with the file

Process

  1. Get the diff against main: git diff main...HEAD
  2. Review each changed file for slop patterns
  3. Remove identified slop while preserving legitimate changes
  4. Report a 1-3 sentence summary of what was changed
常见问题

它会删除哪些内容?

它会删除多余注释、不必要的防御性检查、any 类型转换,以及 Python 中的行内导入。

它会改变代码的行为吗?

该技能旨在保留合理的改动,只删除冗余内容和风格问题。

它以什么为基准进行比较?

它使用 git diff 将分支与 main 进行比较。

详情

作者的原始描述

Remove AI-generated code slop from a branch. Use when cleaning up AI-generated code, removing unnecessary comments, defensive checks, or type casts. Checks diff against main and fixes style inconsistencies.

repo: davila7/claude-code-templates

热度

GitHub 星标
33k
排名
#9085
许可证
MIT
更新时间
2026/11/2

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能