refactor-javalisted
Install: claude install-skill andresnator/agents-orchestrator
# Java Refactoring Catalog Skill
A comprehensive, technique-by-technique catalog of refactoring best practices for Java, sourced from Martin Fowler's *Refactoring: Improving the Design of Existing Code* (2nd Edition) and Alexander Shvets' *Refactoring in Java* (Refactoring Guru).
## Core Philosophy
**Refactoring is the process of changing the internal structure of code without altering its observable behavior.** It is a disciplined technique, not a random cleanup. The golden rule is: Cover → Modify → Refactor (always have tests before you start).
## Java Refactor Quality Gate
Before declaring a Java refactor complete, review the result against this gate:
- **Behavior preservation**: no bug fix or externally observable behavior change is mixed into the refactor.
- **Readability and naming**: names explain intent; extracted methods/classes reduce cognitive load rather than hiding simple code.
- **Cohesion**: moved or extracted code belongs with the data and behavior that change together.
- **SOLID restraint**: apply SOLID principles only where real change pressure exists; avoid mechanical abstractions.
- **Pragmatic patterns**: choose the simplest design that handles known variation; do not introduce a pattern by default.
- **API compatibility**: public signatures, visibility, mutability, serialization, and caller contracts are preserved unless the task explicitly allows an API change.
- **Exception robustness**: do not swallow exceptions, broaden them unnecessarily, or u