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。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 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
anyto 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
- Get the diff against main:
git diff main...HEAD - Review each changed file for slop patterns
- Remove identified slop while preserving legitimate changes
- 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.
热度
- GitHub 星标
- 33k
- 排名
- #9085
- 许可证
- MIT
- 更新时间
- 2026/11/2
评论
- …
同一仓库的更多技能
owasp-security
33k教你的智能体掌握面向网页应用、API、移动端、容器和 AI 智能体的 OWASP 安全指南,以便发现常见弱点并提出修复建议。
agent-management
33k让你的智能体使用 AI Maestro 命令行工具创建、列出、休眠、唤醒、重命名和删除 AI 智能体,管理每个智能体的生命周期。
agent-messaging
33k让你的智能体使用智能体消息协议,在 AI 智能体之间发送、接收和回复带签名的消息,大部分在你自己的电脑上完成。
docs-search
33k让你的智能体搜索自动生成的代码文档,查找函数签名、类定义和注释,从而在修改代码之前核对真实的 API。