Code Refactoring Before PR
★ 7.0 · code-review-automation
Code Simplification and Refactoring is a Claude Code skill that reviews changed code across four quality dimensions and applies the fixes in place. Reach for it when you want to clean up a diff before opening a PR — remove duplication, flatten unnecessary nesting, cut redundant computation — or when the code works but feels like a first draft that will be painful to maintain. The skill runs `git diff` to obtain the diff under review, then launches 4 agents concurrently: one checks for reuse opportunities against existing helpers and utilities; one flags unnecessary complexity — derivable state, copy-paste variants, dead code; one catches wasted work like redundant I/O, sequential independent operations, and closure-based memory leaks in long-lived objects; and one checks "altitude" — whether each change fixes the root cause or merely patches a symptom at the wrong level of abstraction. After all agents finish, duplicate findings are merged and fixes are applied directly; anything that would alter intended behavior or is judged a false positive is skipped with a note. This skill focuses on quality and architecture only, not bug hunting — use `/code-review` for correctness issues. Not suitable when you need to catch logic errors or runtime bugs.
- #code-quality
- #refactoring
- #automation
- #parallel-review
- #code-analysis