ai-slop-cleaner
Skill này làm gì
Skill này hướng dẫn agent dọn dẹp mã có vẻ lộn xộn, lặp lại hoặc xây quá mức, trong khi giữ hành vi của nó không đổi. Skill dành cho người muốn mã gọn hơn sau khi một công cụ AI đã viết rất nhiều.
Khi nào nên dùng
- ✓Khi mã chạy được nhưng có vẻ cồng kềnh, lặp lại hoặc quá phức tạp sau các thay đổi do AI viết.
- ✓Khi bạn muốn một đợt dọn dẹp loại bỏ logic trùng lặp và mã chết.
- ✓Khi bạn chỉ muốn xem xét mã về các vấn đề dọn dẹp mà không thay đổi gì.
Liên kết skill
https://github.com/Yeachan-Heo/oh-my-claudecode/blob/main/skills/ai-slop-cleaner/SKILL.mdSao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.
Cách dùng
Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.
Tin nhắn có sẵn để dán
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Đoạn mã này chạy được, nhưng AI đã viết và nó có vẻ cồng kềnh. Bạn có thể dọn dẹp mà không thay đổi những gì nó làm không?”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Agent viết một kế hoạch dọn dẹp ngắn, thêm kiểm thử để khóa hành vi hiện tại, rồi xóa hoặc gộp mã từng bước một. Nó ưu tiên xóa mã hơn là thêm mã mới.
Nội dung kỹ thuật (SKILL.md gốc)
Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.
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
Câu hỏi thường gặp
Việc dọn dẹp có thay đổi cách ứng dụng hoạt động không?
Nó được thiết kế để không thay đổi. Agent thêm kiểm thử hồi quy trước và giữ hành vi như cũ, trừ khi bạn yêu cầu thay đổi.
Nó có thể chỉ xem xét mã mà không sửa không?
Có. Chế độ chỉ xem xét báo cáo các vấn đề dọn dẹp mà không thay đổi tệp nào.
Skill này có dành cho việc xây tính năng mới không?
Không. Nó dành để đơn giản hóa mã hiện có, không để phát hành tính năng mới của sản phẩm.
Chi tiết
Mô tả gốc của tác giả
Clean AI-generated code slop with a regression-safe, deletion-first workflow and optional reviewer-only mode
Độ phổ biến
- Sao GitHub
- 41k
- Vị trí xếp hạng
- #6990
- Giấy phép
- MIT
- Cập nhật
- 2/11/2026
Bình luận
- …
Thêm skill từ kho mã này
agent-doc-discipline
41kDạy agent của bạn viết hướng dẫn mà các agent AI khác có thể tự làm theo, với các quy tắc có thể kiểm tra và lý do rõ ràng đằng sau mỗi quy tắc.
architecture-survey
41kGiúp agent của bạn xem xét cấu trúc một codebase và liệt kê các phần ngày càng khó thay đổi, kèm bằng chứng, mà không tự thay đổi gì.
ask-navigator
41kGiúp agent của bạn biến một dự án còn mơ hồ thành bản đồ các câu hỏi quyết định rõ ràng, rồi giải quyết từng câu một cho đến khi con đường trở nên rõ.
ask
41kGiúp agent của bạn gửi một câu hỏi hoặc tác vụ đến một công cụ AI khác, như Codex, Gemini hoặc Claude, và lưu câu trả lời thành một tệp.
Skill tương tự
diffs
394kGiúp agent của bạn tạo một diff có thể chia sẻ về các chỉnh sửa, dưới dạng liên kết xem hoặc file ảnh, thay vì một bản tóm tắt viết tay.
coding-agent
394kGiúp agent của bạn giao một việc lập trình lớn cho Codex, Claude Code hoặc OpenCode chạy nền, rồi theo dõi tiến độ của nó.
gh-issues
394kGiúp agent của bạn tìm issue trên GitHub, chọn những issue cần xử lý và mở pull request với bản sửa, kể cả theo dõi nhận xét đánh giá.