From superpowers-laravel
Implements hexagonal ports-and-adapters architecture in Laravel for external services like email; defines ports as PHP interfaces and provider adapters selected at composition root.
npx claudepluginhub jpcaparas/superpowers-laravel --plugin superpowers-laravelThis skill uses the workspace's default tool permissions.
Abstract integrations behind stable interfaces. Keep vendor SDKs out of your domain code.
Guides implementing Hexagonal (Ports and Adapters) architecture: define ports, build adapters, enforce dependencies to isolate domain logic from infrastructure. For testable, adaptable systems.
Provides patterns, antipatterns, and PHP-specific guidelines for auditing Hexagonal Architecture (Ports & Adapters) implementations.
Designs, implements, and refactors hexagonal (Ports & Adapters) architecture in TypeScript, Java, Kotlin, and Go services for domain isolation, dependency inversion, and testable use cases.
Share bugs, ideas, or general feedback.
Abstract integrations behind stable interfaces. Keep vendor SDKs out of your domain code.
// Port
interface MailPort {
public function send(string $to, string $subject, string $html): void;
}
// Adapter
final class SesMailAdapter implements MailPort {
public function __construct(private \Aws\Ses\SesClient $ses) {}
public function send(string $to, string $subject, string $html): void {
// wrap SES specifics here
}
}
// Composition (AppServiceProvider)
$this->app->singleton(MailPort::class, function () {
return match (config('mail.driver')) {
'ses' => new SesMailAdapter(app('aws.ses')),
default => new SmtpMailAdapter(/* ... */),
};
});