laravel:strategy-pattern

SkillDev tools

Use the Strategy pattern to select behavior at runtime; bind multiple implementations to a shared interface

Available today. Use it from your connected AI after setup.

Connect ahel once, and every AI you use reads what you have installed.

Then ask your AI: use the laravel:strategy-pattern skill

What this skill tells your AI

The instructions your AI receives, as published by jpcaparas/superpowers-laravel in skills/strategy-pattern/SKILL.md and read by ahel’s review.

Create a common interface and multiple implementations. Choose a strategy by key or context.

interface TaxCalculator { public function for(int $cents): int; }
final class NzTax implements TaxCalculator { /* ... */ }
final class AuTax implements TaxCalculator { /* ... */ }

final class TaxFactory {
  public function __construct(private array $drivers) {}
  public function forCountry(string $code): TaxCalculator { return $this->drivers[$code]; }
}

Register in a service provider and inject the factory where needed.

Signals

GitHub stars
153
Forks
2
Last commit
Jul 2026
Advanced
Catalog kind
skill
Gateway key
laravel-strategy-pattern
Source
github.com/jpcaparas/superpowers-laravel