ai-slop-cleaner
Skill này làm gì
Skill này dọn dẹp mã lộn xộn mà không thay đổi chức năng của nó. Skill dành cho lập trình viên có mã lặp lại, trừu tượng quá mức hoặc còn các nhánh chết.
Khi nào nên dùng
- ✓Khi mã đã trở nên cồng kềnh, lặp lại hoặc đầy các lớp bọc không cần thiết.
- ✓Khi một thay đổi gần đây để lại mã trùng lặp, mã chết hoặc ranh giới yếu.
- ✓Khi bạn muốn dọn dẹp mã và cần kiểm thử để chứng minh hành vi được giữ nguyên.
Liên kết skill
https://github.com/Yeachan-Heo/oh-my-codex/blob/main/plugins/oh-my-codex/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
“Dọn dẹp mã tôi đã tạo trong tuần này. Xóa phần trùng lặp và mã chết mà không thay đổi chức năng.”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Skill trước hết viết các kiểm thử để khóa hành vi hiện tại, rồi lập kế hoạch dọn dẹp. Nó xem xét các đoạn mã dự phòng rủi ro, sửa các vấn đề có giá trị cao nhất trước, và kiểm tra kết quả bằng bằng chứng.
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 Task Card
Use this bounded helper for cleanup/refactor/deslop work, not as a competing top-level
workflow. Shared operating invariants live in templates/AGENTS.md; this card defines
scope, smell taxonomy, passes, and evidence.
When to use and inputs
Use when working code is bloated, noisy, repetitive, over-abstracted, or AI-generated; the user requests cleanup/refactor/deslop; or a follow-up left duplicate/dead code, weak boundaries, missing tests, fallback-like paths, or wrappers. Inputs are the requested feature/files and behavior to preserve. A file list scope is valid; keep the pass bounded to it. Limit the pass to the calling task's changed files unless broader cleanup was requested.
Before editing
- Lock behavior with regression tests first: identify behavior to preserve, run/add the narrowest targeted tests, and cover both primary and preserved compatibility/fail-safe fallback paths.
- Create a cleanup plan before code: list scope and smells, include fallback findings/classifications/escalation, and order safest/highest-signal fixes first.
- Inventory fallback-like code in scope: quick hacks, temporary workaround, temporary fallback, just bypass, just skip, fallback if it fails, swallowed errors, silent defaults, broad compatibility shims, and duplicate alternate execution paths.
- Classify each fallback: Masking fallback slop hides evidence, bypasses the contract, suppresses validation, swallows failures, silently defaults, or adds untested paths; Grounded compatibility/fail-safe fallback is narrow at an external/version/fail-safe boundary, documents rationale, preserves failure evidence, and tests primary plus fallback.
- Prefer root-cause repair, deletion, boundary repair, or explicit failure behavior. For broad/ambiguous/cross-layer/architectural findings, invoke
$ralplanfor consensus resolution; when already inside ralplan, ultragoal, team, or another OMX workflow, do not spawn a nested$ralplan—attach the finding to the active handoff.
Smell taxonomy and passes
Classify before changing:
- Fallback-like code: masking fallbacks, workaround branches, bypasses, swallowed errors, silent defaults, broad shims, alternate paths.
- Duplication: repeated logic, copy-paste branches, redundant helpers.
- Dead code: unused/unreachable code, stale flags, debug leftovers.
- Needless abstraction: pass-through wrappers, speculative indirection, single-use layers.
- Boundary violations: hidden coupling, leaky responsibilities, wrong-layer imports/side effects.
- Missing tests: behavior not locked or edge cases uncovered.
- UI/design slop: context-sensitive signals, not absolute bans; preserve intentional brand, design-system, accessibility, or product-context exceptions. Challenge Korean body text at 11-12px (generally 14px or larger); gratuitous box shadows; repetitive eyebrow + title + description + paragraph stacks and generic emoji badges; default AI blue/purple such as
#3B82F6; reflexive 3-column or 4-column grids; and extreme gradients unless justified by context.
Resolve the fallback-like code resolution gate first, then one smell at a time: Pass 1: Dead code deletion; Pass 2: Duplicate removal; Pass 3: Naming/error handling cleanup; Pass 4: Test reinforcement. Re-run targeted verification after each pass and avoid unrelated refactors. Prefer deletion/existing utilities; no new abstractions or dependencies unless explicitly required.
Evidence/output contract
Report:
AI SLOP CLEANUP REPORT
Scope: [files/feature]
Behavior Lock: [targeted tests added/run]
Cleanup Plan: [bounded smells/order]
Fallback Findings: [finding -> masking fallback slop | grounded compatibility/fail-safe fallback -> escalation]
UI/Design Findings: [none/N/A or signal -> action/defer -> intentional rationale]
Passes Completed: [resolution gate; Passes 1-4]
Quality Gates: Regression tests, Lint, Typecheck, Tests, Static/security scan (PASS/FAIL/N/A)
Changed Files: [path -> simplification]
Remaining Risks: [none or deferred item]
Include changed files, simplifications, fallback classifications/escalation status, tests/diagnostics/build checks run, UI findings when relevant, and deferred risks. Keep writer/reviewer separation for cleanup plans and approvals.
Exit condition
Stop when the requested scope has behavior-lock evidence, each selected smell pass is complete or explicitly deferred with rationale, verifica
Câu hỏi thường gặp
Skill có thay đổi cách mã hoạt động không?
Nó cố giữ hành vi không đổi, và khóa hành vi đó bằng kiểm thử trước khi dọn dẹp.
Skill có dọn toàn bộ dự án không?
Không. Nó giữ trong phạm vi các file của tác vụ, trừ khi bạn yêu cầu dọn rộng hơn.
Đường dự phòng (fallback) là gì?
Là các cách xử lý tạm như giá trị mặc định âm thầm hoặc lỗi bị nuốt, và skill xem xét chúng vì chúng có thể che giấu vấn đề thật.
Chi tiết
Độ phổ biến
- Sao GitHub
- 34k
- Vị trí xếp hạng
- #8409
- Giấy phép
- MIT
- Cập nhật
- 2/11/2026
Bình luận
- …
Thêm skill từ kho mã này
analyze
34kGiúp agent của bạn trả lời một câu hỏi về mã nguồn bằng cách đọc các đoạn mã liên quan và báo cáo các giải thích được xếp hạng kèm bằng chứng, mà không thực hiện thay đổi nào.
ask
34kCho phép agent của bạn hỏi một công cụ dòng lệnh Claude hoặc Gemini đã cài sẵn trên máy để lấy ý kiến thứ hai hoặc đánh giá, rồi lưu câu trả lời thành file.
autopilot
34kChạy một dự án trọn gói, không cần can thiệp, từ ý tưởng qua yêu cầu, lập kế hoạch và thực hiện, chỉ tạm dừng khi gặp trở ngại thật sự.
autoresearch
34kChạy một vòng nghiên cứu lặp lại tiếp tục làm việc cho đến khi một bộ kiểm tra xác nhận kết quả, với phương pháp kiểm tra được chọn ngay từ đầu.
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á.