When to use this skill
Use when asked to:
- - "remove AI slop"
- "clean up generated code style"
- "review branch diff for weird comments/defensive checks/casts"
Workflow
- 1. Set comparison base (default
main) and inspect git diff <base>...HEAD. - Build a candidate list using
rg over added lines (comments, catches, casts, lint ignores, placeholders, debug leftovers). - Review each candidate in full file context and compare with nearby local patterns.
- Remove only inconsistent slop; keep behavior and domain-valid guards.
- Re-run project checks (
bun check, bun typecheck) and fix regressions. - Report exact files changed and what slop was removed vs intentionally kept.
Slop checklist
Read and apply: references/slop-heuristics.md
Guardrails
- - Do not remove protections at trust boundaries (user input, auth, network, db, file I/O).
- Do not replace real typing with weaker typing.
- Prefer minimal edits over broad rewrites.
- Keep project conventions (hooks/query style, component patterns, naming).
何时使用该技能
在收到以下请求时使用:
- - 去除AI生成的冗余内容
- 清理生成的代码风格
- 审查分支差异中的异常注释/防御性检查/类型转换
工作流程
- 1. 设置比较基准(默认main分支),检查git diff <基准>...HEAD。
- 使用rg在新增行中构建候选列表(注释、异常捕获、类型转换、lint忽略、占位符、调试残留)。
- 在完整文件上下文中审查每个候选内容,并与附近本地模式进行对比。
- 仅移除不一致的冗余内容;保留行为逻辑和领域有效的防护措施。
- 重新运行项目检查(bun check、bun typecheck)并修复回归问题。
- 报告具体修改的文件,以及移除的冗余内容和有意保留的内容。
冗余内容检查清单
阅读并应用:references/slop-heuristics.md
防护措施
- - 不得移除信任边界处的保护措施(用户输入、认证、网络、数据库、文件I/O)。
- 不得用弱类型替换真实类型。
- 优先进行最小化编辑,而非大规模重写。
- 保持项目约定(hooks/query风格、组件模式、命名规范)。