code-quality-refactoringlisted
Install: claude install-skill soden46/engineer-flow
# Code Quality and Refactoring
Use this skill for cleanup, simplification, decomposition, duplication removal, complexity reduction, and maintainability improvements.
This skill is language and framework agnostic.
## Preserve Behavior
Unless the task explicitly changes behavior, refactoring should preserve observable behavior.
Separate:
- behavior changes
- structural changes
when practical.
## Scope
Prefer focused refactoring over broad rewrites.
Avoid touching unrelated code merely for style consistency.
## Complexity
Reduce complexity where it materially improves understanding or correctness.
Potential signals include:
- deeply nested control flow
- large functions
- duplicated logic
- mixed responsibilities
- hidden side effects
- unclear state transitions
- repeated mapping/validation logic
- excessive branching
Do not optimize for arbitrary complexity numbers without considering readability.
## Responsibilities
Keep distinct responsibilities separate when this improves clarity.
Common separations include:
- validation
- authorization
- orchestration
- persistence
- transformation
- external communication
- presentation
Do not introduce abstractions merely to increase abstraction count.
## Duplication
Remove meaningful duplicated behavior when shared behavior genuinely belongs together.
Some duplication may be preferable to premature coupling.
## Naming
Names should communicate purpose rather than implementation trivia.
Prefer terminology alread