create-bridge

Generate a bridge pattern implementation for PHP 8.4. Decouples abstraction from implementation to allow independent extension of abstractions and concrete implementations. Includes unit tests.

Last repository push
GitHub Stars
109
Forks
26
Issues / PRs
1

Installation

Review the source and dependencies with a prompt. A package is available to download.

Install with an AI assistant

Copy the prompt so your assistant can review the pinned revision and dependencies first.

View promptHide prompt
Check whether SkillPI Skill Finder is installed for your current agent. If it is missing, install and enable it using the official instructions at https://github.com/Findskills/skillpi. Then use Skill Finder to locate and install "create-bridge" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-4e0a234a2759c865bdc031d7c81804ae79db4e7018dbced79008f57bab49e5e0. Verify the upstream source and version against https://github.com/dykyi-roman/awesome-claude-code before installing. If they do not match, stop and report the mismatch. Report the installed path and source version.

Source and setup

github.com

Setup guidance pending

See the original source for supported tools, dependencies, and permissions.

Installation test pending

Generate a bridge pattern implementation for PHP 8.4. Decouples abstraction from implementation to allow independent extension of abstractions and concrete implementations. Includes unit tests.

0 Downloads

Introduction source: third_party · dykyi-roman · 0.0.1 Reference

SkillPi interpretation

Tasks
Generates Bridge pattern for PHP 8.4. Decouples abstraction from implementation. Includes unit tests.
Audience
| Scenario | Example | |----------|---------| | Multiple dimensions of variation | Notification types × channels | | Avoid class explosion | Shape × rendering method | | Runtime implementation switching | Database drivers | | Platform independence | UI × OS |
Testing
Not tested

Browse files

Browse files at the source ↗

Original SKILL.md

Open original ↗
Frontmatter
name: create-bridge
description: Generates Bridge pattern for PHP 8.4. Decouples abstraction from implementation. Includes unit tests.

Bridge Pattern Generator

Creates Bridge pattern infrastructure for separating abstraction from implementation.

When to Use

Scenario Example
Multiple dimensions of variation Notification types × channels
Avoid class explosion Shape × rendering method
Runtime implementation switching Database drivers
Platform independence UI × OS

Component Characteristics

Abstraction

  • High-level interface
  • Uses implementor
  • Domain layer

RefinedAbstraction

  • Extends abstraction
  • Adds specialized behavior

Implementor Interface

  • Low-level operations
  • Multiple implementations

ConcreteImplementor

  • Actual implementation
  • Platform-specific code

Generation Process

Step 1: Generate Implementor Interface

Path: src/Domain/{BoundedContext}/

  1. {Name}ImplementorInterface.php — Low-level operations

Step 2: Generate Abstraction

Path: src/Domain/{BoundedContext}/

  1. Abstract{Name}.php — High-level interface

Step 3: Generate RefinedAbstraction

Path: src/Domain/{BoundedContext}/

  1. {Type}{Name}.php — Specialized abstractions

Step 4: Generate ConcreteImplementors

Path: src/Infrastructure/{BoundedContext}/

  1. {Platform}{Name}Implementor.php — Platform implementations

Step 5: Generate Tests

  1. {ClassName}Test.php — Bridge behavior verification

File Placement

Component Path
Abstraction src/Domain/{BoundedContext}/
RefinedAbstraction src/Domain/{BoundedContext}/
Implementor Interface src/Domain/{BoundedContext}/
ConcreteImplementor src/Infrastructure/{BoundedContext}/
Unit Tests tests/Unit/

Naming Conventions

Component Pattern Example
Abstraction Abstract{Name} AbstractNotification
RefinedAbstraction {Type}{Name} UrgentNotification
Implementor Interface {Name}ImplementorInterface NotificationImplementorInterface
ConcreteImplementor {Platform}{Name}Implementor EmailNotificationImplementor

Quick Template Reference

Abstraction

abstract readonly class Abstract{Name}
{
    public function __construct(
        protected {Name}ImplementorInterface $implementor
    ) {}

    abstract public function {operation}({params}): {returnType};
}

RefinedAbstraction

final readonly class {Type}{Name} extends Abstract{Name}
{
    public function {operation}({params}): {returnType}
    {
        {preprocessing}
        return $this->implementor->{implementorMethod}({params});
    }
}

Usage Example

$email = new EmailNotificationImplementor();
$urgent = new UrgentNotification($email);
$urgent->send($message);

// Switch implementation
$sms = new SmsNotificationImplementor();
$urgent = new UrgentNotification($sms);
$urgent->send($message);

Common Bridges

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-patterns to Avoid

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

References

For complete PHP templates and examples, see:

  • references/templates.md — Abstraction, refined abstraction, implementor templates
  • references/examples.md — Notification, report bridges with unit tests

Current listing version

0.0.1

Verify the source revision ↗

Quality assessment

Out of 100 · Assessment report from SkillPi LAB.

Scenario Value85/100

Highlights

  • 提供完整的桥接模式生成流程,涵盖抽象、实现、测试全流程
  • 包含多种常见桥接场景(通知、报表、数据库、支付)和最佳实践
Trigger Precision65/100

Areas to improve

  • Description in the wrong location Reported severity: Minor

    顶层 frontmatter 中 description 字段为空,实际描述内容位于 skill_body 内部

    Recommendation: 将 description 内容移至顶层 frontmatter 的 description 字段

  • 触发词不全 Reported severity: Minor

    仅提供英文 description,缺少中文触发词(如“桥接模式”“Bridge pattern”)

    Recommendation: 在 description 中添加中英文触发词,覆盖常见搜索变体

Structure and Standards95/100

Highlights

  • 生成步骤清晰(5步流程),每步有明确输出和路径
  • 提供命名规范、模板代码、使用示例和常见桥接场景
Execution Reliability60/100

Areas to improve

  • 参数依赖未说明 Reported severity: Major

    生成过程依赖用户输入参数(如 Name、BoundedContext、Type 等),但未说明如何获取或验证这些参数

    Recommendation: 添加参数说明或交互式引导,确保用户能提供必要输入

Highlights

  • 文件路径和命名规范明确,减少执行歧义
Evidence Verifiability (mean of the first four)76/100

The arithmetic mean of the first four original scores, rounded to a whole number.

Static text checks

100 / 100 · skillpi-20261123-no-r3-v1

No current rules matched the text.

This score reflects rule matches in the text and is provided for reference before use. It excludes attachments and runtime behavior.

Permissions and checks before use

Automatically summarized from this main document. Matches may be examples or defensive advice; they are not actual permission declarations. Attachments, external dependencies and runtime behavior are not covered.

These common operations were not identified in the main document. This does not mean no permissions or risks exist.

These notices grant no permissions. Your host tool must still confirm file changes, secrets, external transfers or costs as needed.

Security rating and access scope

safe · Static evidence review; not a runtime safety guarantee.

Before use, confirm and authorize actual file access, external services and network destinations in your host. This review grants no runtime permissions.