skills/design-patterns/structurals/pattern-adapter/SKILL.md
Teaches and applies the Adapter structural design pattern — allowing objects with incompatible interfaces to collaborate by wrapping one interface into another. Trigger: When integrating third-party libraries, legacy code, or incompatible interfaces.
npx skillsauth add johnnystefan/test-saas-business pattern-adapterInstall 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.
Allows objects with incompatible interfaces to collaborate. It acts as a wrapper that converts the interface of one object so that another object can understand it.
// Client Interface
interface Target {
request(): string;
}
// Service with incompatible interface (Adaptee)
class Adaptee {
public specificRequest(): string {
return '.eetpadA eht fo roivaheb laicepS';
}
}
// Adapter translates the interface
class Adapter implements Target {
constructor(private adaptee: Adaptee) {}
public request(): string {
const result = this.adaptee.specificRequest().split('').reverse().join('');
return `Adapter: (TRANSLATED) ${result}`;
}
}
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.