omh-ai-slop-cleaner
它能做什么
它找出并删除不需要的代码、重复项和残留的杂物,并用测试确认行为没有改变。适合接手杂乱代码或希望安全清理的开发者。
适用场景
- ✓当代码中充满无用代码、重复内容或 AI 生成的残留杂物时。
- ✓当你希望进行不改变任何行为的清理时。
- ✓当你希望先用测试规划并验证一次有风险的重构时。
技能链接
https://github.com/rlaope/oh-my-hermes/blob/main/agent-skills/omh-ai-slop-cleaner/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“请清理这个文件中重复的路由分支,并添加测试,确保用户那边没有任何变化。”
每周 5 个新技能,1 分钟读完。
工作原理
智能体规划清理工作,删除或简化代码,并通过有针对性的测试证明行为没有改变。涉及设计改动的部分,则交给单独的规划步骤处理。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
Ai Slop Cleaner
This is an OMH ai-slop-cleaner workflow skill, projected for Agent Skills hosts (Claude Code, Codex, Cursor, opencode, OpenClaw, pi).
Why This Exists
ai-slop-cleaner exists to keep maintenance work explicit, evidence-backed, and inside the Hermes/executor boundary instead of relying on ad hoc chat narration.
Do Not Use When
- The goal is new or changed behavior rather than removing existing code; a plain refactor, feature, or fix request belongs to
ulw-work. - The cleanup would change architecture or module boundaries and needs its execution shaped into phases first; use
omh-refactor-plan, orulw-planwhen the direction itself is still contested. - The user wants code judged for bugs or merge readiness with no drafted slop removal to inspect; use
omh-code-reviewfor a bug-first review andomh-failure-signal-auditfor swallowed failures.
Examples
Good example:
- Prompt: $ai-slop-cleaner remove duplicated router branches and lock behavior with regression tests before refactoring.
- Expected behavior: Plan cleanup, preserve behavior, delete or simplify code, and prove it with targeted tests.
- Why: The request is maintenance cleanup with regression risk.
Bad example:
- Prompt: ai-slop-cleaner: treat casual chat or unaccepted work as if this workflow already produced verified results.
- Expected behavior: Ask a clarification question or route to a narrower workflow instead of forcing
ai-slop-cleaner. - Why: The request lacks the required inputs or would overclaim work that Hermes did not observe.
Completion Checklist
- The selected coding or runtime owner is named before any implementation claim.
- Prepared handoff, dispatch, execution, verification, review, CI, and merge states are separated.
- The final status cites observed runtime evidence or keeps the work prepared_not_observed.
- When Hermes is the selected coding owner, use
hermes_coding_harness/v1to keep builder, verifier, reviewer, docs, and PR lanes separate. - Report the current harness stage, owner, next action, and missing evidence without claiming PR creation, review, CI, merge-readiness, or merge until matching runtime observations exist.
Recovery Notes
- If the selected executor is unavailable, ask for Codex, Claude Code, Hermes, or another runtime before retrying.
- If dispatch or result evidence is missing, keep the handoff prepared_not_observed and expose the next observable action.
When to Use
Use when the goal is removing existing low-quality, duplicated, or AI-generated code and the observable behavior must not change; lock behavior with tests before and after the edits.
Strong routing signals: `ai-slop-cleaner`, `$ai-slop-cleaner`, `cleanup`, `deslop`, `refactor`, `risky`, `behavior-preserving refactor`, `risk analysis`, `refactor workflow`, `legacy refactor`, `anti-slop pass`, `anti-slop review`, `anti-slop sweep`, `ai slop`, `deslop review`, `리팩터링`, `리팩토링`, `위험 분석`, `변경 범위 제한`, `회귀 테스트`, `деслоп`, `убери мусор из кода`, `почисти код`, `убери лишнее в коде`, `зачисти код`, `мёртвый код`, `анслоп`, `деблоат`, `почистить код`
Catalog Metadata
Category: maintenance
Phase: cleanup
Quality tier: regression-gated
Reasoning demand: heavy
Quality bar:
- Lock current behavior with regression checks before non-trivial cleanup.
- Classify before deleting: every finding names one category from the slop taxonomy - duplication, dead code, needless abstraction, boundary violation, missing tests, or templated defaults - so the pass order below can own it.
- Run single-smell passes in fixed order, re-verifying between passes and never bundling categories: dead-code deletion, then duplicate removal, then naming and error handling, then test reinforcement; the full contract is
omh-ai-slop-cleaner/references/cleanup-passes.md. - When the user names no target smell, run detection first and hand back the inventory: prepared linter and dead-code commands are named per stack in the reference and stay prepared_not_observed until run.
- When the cleanup target is written English rather than code, load
omh-ai-slop-cleaner/references/prose-lexicon.mdfor the word tiers, the pattern severities, and the context profile that decides which rules apply. - Review mode (
deslop review, or a request to judge a drafted cleanup without editing) edits nothing: read the writer pass's plan, its diff, and the before/after checks it ran against the six taxonomy categories and return findings
常见问题
清理会改变应用的行为吗?
不会。目标是在删除代码的同时,保持可观察的行为完全一致。
它适用于任何杂乱的代码吗?
它适用于现有代码;新增或改变行为的内容属于单独的功能或修复工作流程。
如果清理需要新的架构怎么办?
该技能会先把这项工作交给重构规划步骤。
详情
作者的原始描述
[omh] Messy or AI-generated code to clean up: delete AI-generated slop, dead code, and duplication while observable behavior stays identical. Use when the user says: ai-slop-cleaner, cleanup, deslop, refactor, risky, behavior-preserving refactor, risk analysis, refactor workflow.
repo: rlaope/oh-my-hermes
热度
- GitHub 星标
- 5.1k
- 排名
- #15073
- 许可证
- MIT
- 更新时间
- 2026/11/2
评论
- …
同一仓库的更多技能
omh-accessibility-audit
5.1k帮你的智能体检查某个界面或流程是否存在无障碍问题,例如键盘使用、屏幕阅读器标签、对比度和触控目标大小。
omh-adversarial-consensus
5.1k在你做出决定之前,帮你的智能体从几个独立角度质疑一个技术方案,然后总结哪些观点经得起推敲。
omh-agent-debug
5.1k帮你的智能体找出另一个 AI 智能体为何卡住、陷入循环或偏离任务,并提出最小且安全的恢复方法。
omh-agent-instructions
5.1k帮你的智能体编写或更新指令文件,例如 AGENTS.md 或 CLAUDE.md,告诉 AI 工具如何在项目中工作。