Strategy Pattern Implementor

Implement the Strategy pattern to encapsulate a family of interchangeable algorithms behind a common interface. Use when you have multiple conditional branches selecting between algorithm variants, when algorithms need different space-time trade-offs, when a class has multiple behaviors expressed as conditionals, or when you need to swap algorithms at runtime. Detects the key code smell — switch/if-else chains selecting behavior — and refactors to Strategy objects.

bookforge-ai Updated 42 repo stars
Sheldon the robot reading a BookForge book

File contents

bookforge-ai/bookforge-skills commit 78edbd7261

Frequently asked questions

npx get-skill add bookforge-ai/strategy-pattern-implementor