From refactor
Refuse Alternative Classes with Different Interfaces when two classes do similar things but with mismatched method names and signatures — sortBy() vs orderUsing(), valueOf() vs evaluate(). Apply Change Function Declaration, Move Function.
How this skill is triggered — by the user, by Claude, or both
Slash command
/refactor:alternative-classes-with-different-interfacesThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
**Trigger (refuse when you see):** Two classes do similar things but with mismatched method names and signatures — sortBy() vs orderUsing(), valueOf() vs evaluate().
Trigger (refuse when you see): Two classes do similar things but with mismatched method names and signatures — sortBy() vs orderUsing(), valueOf() vs evaluate().
Cost of leaving it in: Substitution becomes copy-paste; consumers can't treat the two interchangeably; abstraction over them is impossible.
Target shape after refactoring: Equivalent operations have equivalent signatures; a shared superclass or interface emerges naturally.
// Smellier:
class CSVExporter { writeAll(rows) {} }
class JSONExporter { dump(data) {} }
// Fresher:
class CSVExporter implements Exporter { write(rows) {} }
class JSONExporter implements Exporter { write(rows) {} }
Apply refactorings: Change Function Declaration, Move Function, Extract Superclass
npx claudepluginhub wallacedrew/ritl --plugin refactorGuides creation, editing, and verification of skills for AI coding agents using test-driven development with subagent scenarios. Use when authoring or debugging skills.