一键导入
code-scrub
Methodology and rules for scrubbing codebases — removing dead code, weak types, duplication, bad comments, defensive programming, and legacy cruft.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Methodology and rules for scrubbing codebases — removing dead code, weak types, duplication, bad comments, defensive programming, and legacy cruft.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Behavioral rules that make AI coding agents more reliable — verification, self-correction, and scope discipline.
Debugging guidance and structured report template for thorough bug investigation, evidence gathering, and root cause documentation.
Cold-audit a completed delivery — verify the spec was actually delivered, challenge performative claims, and produce a what-landed report.
Guidelines for generating self-contained HTML mockups that look professional and are easy to iterate on.
Shared implementation guidance for making minimal, correct, maintainable code changes that fit existing systems.
The doctrine for `/roadmap-review` — interactive triage of roadmap-shape drift, walked one item at a time, with paste-ready resolution phrasing for the active sizing lens.
| name | code-scrub |
| description | Methodology and rules for scrubbing codebases — removing dead code, weak types, duplication, bad comments, defensive programming, and legacy cruft. |
| compatibility | ["opencode","cursor","claude"] |
| metadata | {"audience":"agents","purpose":"skill-routing"} |
Scrubbing improves code quality by removing waste — not by adding abstractions. Every change must make the code simpler, not more complex. If a fix introduces more indirection than it removes duplication, don't make it.
Categorize every finding:
| Level | Criteria | Action |
|---|---|---|
| High | Clearly unused, clearly duplicated, clearly wrong type, clearly misleading comment. Removal/fix has no behavioral change. | Implement immediately |
| Medium | Likely an improvement but requires judgment — could affect behavior, might break an edge case, or the "right" fix is debatable. | Document as recommendation, don't implement |
| Low | Stylistic, cosmetic, or would require significant restructuring. | Mention in assessment only |
any/interface{} is legitimate for: JSON marshaling, database/sql args, generic containers, protocol boundaries (MCP, GraphQL)any — the cure shouldn't be worse than the diseasedeadcode, knip, tree-shaking analysis)madge to detect cycles_ = expr is fine for: log writes, cache writes, cleanup operations, non-critical side effects_ = expr is not fine for: data writes the user expects to persist, operations where failure means silent data loss| Language | Dead code | Dependencies | Types |
|---|---|---|---|
| Go | deadcode, go vet, manual grep | go list -json, import analysis | grep for any/interface{} |
| TypeScript | knip, ts-prune | madge, dependency-cruiser | grep for any, unknown, as any |
| Python | vulture, pylint | pydeps, import-linter | grep for Any, # type: ignore |
| Java | IntelliJ inspections, spotbugs | jdepend, gradle dependencies | grep for Object, raw types |
| Rust | cargo clippy, dead_code warnings | cargo tree | rare — compiler enforces |
After every change:
If build or tests fail after a change, revert and document — don't fix forward during a scrub.