/acc:create-bridgefrom acc
Generates Bridge pattern infrastructure for PHP 8.4, decoupling abstraction from implementation with unit tests. Useful when handling multiple dimensions of variation or runtime implementation switching.
Ships in acc. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Creates Bridge pattern infrastructure for separating abstraction from implementation.
| Scenario | Example |
|---|---|
| Multiple dimensions of variation | Notification types × channels |
| Avoid class explosion | Shape × rendering method |
| Runtime implementation switching | Database drivers |
| Platform independence | UI × OS |
Path: src/Domain/{BoundedContext}/
{Name}ImplementorInterface.php — Low-level operationsPath: src/Domain/{BoundedContext}/
Abstract{Name}.php — High-level interfacePath: src/Domain/{BoundedContext}/
{Type}{Name}.php — Specialized abstractionsPath: src/Infrastructure/{BoundedContext}/
{Platform}{Name}Implementor.php — Platform implementations{ClassName}Test.php — Bridge behavior verification| Component | Path |
|---|---|
| Abstraction | src/Domain/{BoundedContext}/ |
| RefinedAbstraction | src/Domain/{BoundedContext}/ |
| Implementor Interface | src/Domain/{BoundedContext}/ |
| ConcreteImplementor | src/Infrastructure/{BoundedContext}/ |
| Unit Tests | tests/Unit/ |
| Component | Pattern | Example |
|---|---|---|
| Abstraction | Abstract{Name} | AbstractNotification |
| RefinedAbstraction | {Type}{Name} | UrgentNotification |
| Implementor Interface | {Name}ImplementorInterface | NotificationImplementorInterface |
| ConcreteImplementor | {Platform}{Name}Implementor | EmailNotificationImplementor |
abstract readonly class Abstract{Name}
{
public function __construct(
protected {Name}ImplementorInterface $implementor
) {}
abstract public function {operation}({params}): {returnType};
}
final readonly class {Type}{Name} extends Abstract{Name}
{
public function {operation}({params}): {returnType}
{
{preprocessing}
return $this->implementor->{implementorMethod}({params});
}
}
$email = new EmailNotificationImplementor();
$urgent = new UrgentNotification($email);
$urgent->send($message);
// Switch implementation
$sms = new SmsNotificationImplementor();
$urgent = new UrgentNotification($sms);
$urgent->send($message);
| Bridge | Purpose |
|---|---|
| NotificationBridge | Type × Channel (Email/SMS/Push) |
| ReportBridge | Format × Generator (PDF/Excel/CSV) |
| DatabaseBridge | Query × Driver (MySQL/PostgreSQL) |
| PaymentBridge | Gateway × Provider (Stripe/PayPal) |
| Anti-pattern | Problem | Solution |
|---|---|---|
| Missing Abstraction | Direct implementor use | Use abstraction layer |
| Tight Coupling | Abstraction knows concrete implementor | Depend on interface |
| Single Implementation | No variation | Use simple inheritance |
| Leaky Abstraction | Exposes implementor details | Hide implementation |
For complete PHP templates and examples, see:
references/templates.md — Abstraction, refined abstraction, implementor templatesreferences/examples.md — Notification, report bridges with unit testsWhat SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub dykyi-roman/awesome-claude-code --plugin acc283 skills in this plugin
/access-control-knowledgeAccess Control knowledge base. Provides ACL, RBAC, ABAC, ReBAC models, multi-tenancy patterns, and PHP implementations (Symfony Voters, Laravel Gates) for security audits and generation./adr-knowledgeAction-Domain-Responder pattern knowledge base. Provides patterns, antipatterns, and PHP-specific guidelines for ADR (web-specific MVC alternative) audits./adr-templateGenerates Architecture Decision Records (ADR) for PHP projects. Creates structured decision documentation with context, decision, and consequences.Other plugins' skills for the same job