ai-slop-cleaner
它能做什么
这项技能指导智能体清理那些显得杂乱、重复或过度构建的代码,同时保持其行为不变。适合在 AI 工具写了大量代码之后,希望代码更精简的人。
适用场景
- ✓当 AI 修改之后,代码能运行但显得臃肿、重复或过于复杂的时候。
- ✓当你想进行一次清除重复逻辑和无用代码的整理的时候。
- ✓当你只想审查代码中的整理问题而不做任何修改的时候。
技能链接
https://github.com/Yeachan-Heo/oh-my-claudecode/blob/main/skills/ai-slop-cleaner/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“这段代码能运行,但是 AI 写的,感觉很臃肿。你能在不改变其功能的前提下把它整理一下吗?”
每周 5 个新技能,1 分钟读完。
工作原理
智能体会先写一份简短的整理计划,添加测试以锁定当前行为,然后逐步删除或合并代码。它更倾向于删除代码,而不是增加新代码。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
AI Slop Cleaner
Use this skill to clean AI-generated code slop without drifting scope or changing intended behavior. In OMC, this is the bounded cleanup workflow for code that works but feels bloated, repetitive, weakly tested, or over-abstracted.
When to Use
Use this skill when:
- the user explicitly says
deslop,anti-slop, orAI slop - the request is to clean up or refactor code that feels noisy, repetitive, or overly abstract
- follow-up implementation left duplicate logic, dead code, wrapper layers, boundary leaks, or weak regression coverage
- the user wants a reviewer-only anti-slop pass via
--review - the goal is simplification and cleanup, not new feature delivery
When Not to Use
Do not use this skill when:
- the task is mainly a new feature build or product change
- the user wants a broad redesign instead of an incremental cleanup pass
- the request is a generic refactor with no simplification or anti-slop intent
- behavior is too unclear to protect with tests or a concrete verification plan
OMC Execution Posture
- Preserve behavior unless the user explicitly asks for behavior changes.
- Lock behavior with focused regression tests first whenever practical.
- Write a cleanup plan before editing code.
- Prefer deletion over addition.
- Reuse existing utilities and patterns before introducing new ones.
- Avoid new dependencies unless the user explicitly requests them.
- Keep diffs small, reversible, and smell-focused.
- Stay concise and evidence-dense: inspect, edit, verify, and report.
- Treat new user instructions as local scope updates without dropping earlier non-conflicting constraints.
Scoped File-List Usage
This skill can be bounded to an explicit file list or changed-file scope when the caller already knows the safe cleanup surface.
- Good fit:
oh-my-claudecode:ai-slop-cleaner skills/ralph/SKILL.md skills/ai-slop-cleaner/SKILL.md - Good fit: a Ralph session handing off only the files changed in that session
- Preserve the same regression-safe workflow even when the scope is a short file list
- Do not silently expand a changed-file scope into broader cleanup work unless the user explicitly asks for it
Ralph Integration
Ralph can invoke this skill as a bounded post-review cleanup pass.
- In that workflow, the cleaner runs in standard mode (not
--review) - The cleanup scope is the Ralph session's changed files only
- After the cleanup pass, Ralph re-runs regression verification before completion
--reviewremains the reviewer-only follow-up mode, not the default Ralph integration path
Review Mode (--review)
--review is a reviewer-only pass after cleanup work is drafted. It exists to preserve explicit writer/reviewer separation for anti-slop work.
- Writer pass: make the cleanup changes with behavior locked by tests.
- Reviewer pass: inspect the cleanup plan, changed files, and verification evidence.
- The same pass must not both write and self-approve high-impact cleanup without a separate review step.
In review mode:
- Do not start by editing files.
- Review the cleanup plan, changed files, and regression coverage.
- Check specifically for:
- leftover dead code or unused exports
- duplicate logic that should have been consolidated
- needless wrappers or abstractions that still blur boundaries
- missing tests or weak verification for preserved behavior
- cleanup that appears to have changed behavior without intent
- Produce a reviewer verdict with required follow-ups.
- Hand needed changes back to a separate writer pass instead of fixing and approving in one step.
Workflow
Protect current behavior first
- Identify what must stay the same.
- Add or run the narrowest regression tests needed before editing.
- If tests cannot come first, record the verification plan explicitly before touching code.
Write a cleanup plan before code
- Bound the pass to the requested files or feature area.
- List the concrete smells to remove.
- Order the work from safest deletion to riskier consolidation.
Classify the slop before editing
- Duplication — repeated logic, copy-paste branches, redundant helpers
- Dead code — unused code, unreachable branches, stale flags, debug leftovers
- Needless abstraction — pass-through wrappers, speculative indirection, single-use helper layers
- Boundary violations — hidden coupling, misplaced responsibilities, wrong-layer imports or
常见问题
整理会改变应用的行为吗?
设计上不会。智能体会先添加回归测试,并保持行为不变,除非你要求修改。
它能只审查代码而不编辑吗?
可以。只审查模式会报告整理问题,而不修改任何文件。
这是用来开发新功能的吗?
不是。它用于简化现有代码,而不是交付新的产品功能。
详情
作者的原始描述
Clean AI-generated code slop with a regression-safe, deletion-first workflow and optional reviewer-only mode
热度
- GitHub 星标
- 41k
- 排名
- #6990
- 许可证
- MIT
- 更新时间
- 2026/11/2
评论
- …
同一仓库的更多技能
agent-doc-discipline
41k教你的智能体编写其他 AI 智能体能够独立遵循的说明,规则可以检验,并且每条规则都附有明确的理由。
architecture-survey
41k帮你的智能体审查代码库的结构,列出越来越难修改的部分并附上证据,且自身不做任何更改。
ask-navigator
41k帮你的智能体把模糊的项目整理成一张清晰的决策问题图,然后逐个处理,直到路径变得清楚。
ask
41k帮你的智能体把问题或任务发送给另一个 AI 工具,例如 Codex、Gemini 或 Claude,并把答案保存为文件。