skills/code-smells/couplers/SKILL.md
Detect and refactor Couplers — excessive coupling or over-delegation between classes. Trigger: When identifying Feature Envy, Inappropriate Intimacy, Message Chains, or Middle Man.
npx skillsauth add johnnystefan/test-saas-business code-smells/couplersInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
This skill enables the agent to identify "Couplers" — code smells that represent excessive coupling between classes or the side effects of trying to avoid it through excessive delegation. The agent will apply specific refactoring techniques to ensure classes remain independent, maintainable, and respect the principle of encapsulation.
a.getB().getC().doSomething()).protected or public fields of another class instead of interacting through a clean interface.// BAD: printUserAddress is more interested in User data than its own class
class AddressPrinter {
printUserAddress(user: User) {
const city = user.getCity();
const street = user.getStreet();
const zip = user.getZipCode();
console.log(`${street}, ${city} - ${zip}`);
}
}
// GOOD: Logic moved to the data owner using Move Method
class User {
getFullAddress(): string {
return `${this.street}, ${this.city} - ${this.zipCode}`;
}
}
class AddressPrinter {
printUserAddress(user: User) {
console.log(user.getFullAddress());
}
}
// BAD: Coupled to the internal structure of Department and Manager
const managerName = employee.getDepartment().getManager().getName();
// GOOD: Employee encapsulates the navigation
class Employee {
getManagerName(): string {
return this.department.getManager().getName();
}
}
const managerName = employee.getManagerName();
tools
Zustand 5 state management patterns. Trigger: When implementing client-side state with Zustand (stores, selectors, persist middleware, slices).
databases
Zod 4 schema validation patterns. Trigger: When creating or updating Zod v4 schemas for validation/parsing (forms, request payloads, adapters), including v3 -> v4 migration patterns.
development
Vitest unit testing patterns with React Testing Library. Trigger: When writing unit tests for React components, hooks, or utilities.
tools
Vite 8 (Rolldown-powered) build tool configuration, plugin API, SSR, and migration guide. Trigger: When working with vite.config.ts, Vite plugins, building libraries, or SSR apps with Vite.