skill-php-design-patterns

Apply GoF design patterns to architect SOLID, testable PHP 8.x systems.

Updated Apr 11, 2026
One-click install
npx skills add https://github.com/claudioborja/biblioteca --skill skill-php-design-patterns
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: skill-php-design-patterns
Source: https://github.com/claudioborja/biblioteca/tree/main/.agents/skills/skill-php-design-patterns
Command: npx skills add https://github.com/claudioborja/biblioteca --skill skill-php-design-patterns

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

PHP projects often grow into tangled codebases; this skill demonstrates applying classic GoF design patterns to enforce SOLID, testable architecture across modules.

Core Features & Use Cases

  • Demonstrates Creational patterns (Factory Method, Abstract Factory, Builder, Prototype) to create flexible objects.
  • Showcases Structural (Adapter, Decorator, Proxy) and Behavioral (Strategy, Observer, Command, Chain of Responsibility) patterns for decoupled, testable systems.
  • Provides guidance on architecture-aligned patterns (Repository + Specification, CQRS, Hexagonal Architecture, DDD) and framework-agnostic implementation with framework adapters.

Quick Start

Study the provided PHP pattern examples and implement one pattern in your codebase to observe improvements in maintainability and testability.

Frequently Asked Questions about skill-php-design-patterns

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I apply SOLID principles and GoF design patterns in PHP?

To apply SOLID principles in PHP, you implement classic GoF design patterns like Factory, Strategy, and Adapter to decouple modules and enforce testable, maintainable architecture. This skill provides framework-agnostic PHP 8.x examples for these structural and behavioral patterns.

What is the best way to decouple PHP business logic from framework dependencies?

The best way to decouple PHP logic is using Hexagonal Architecture and Dependency Injection. This skill demonstrates framework-agnostic patterns with framework-specific adapters, ensuring your core business rules remain isolated and testable independently of any specific framework.

How do I implement the Repository pattern with Specification in PHP?

Implementing the Repository pattern with Specification in PHP involves creating abstraction layers for data access to enforce clean architecture. This skill guides you through architecture-aligned patterns like CQRS and DDD to achieve highly testable, decoupled systems.

Does this PHP design patterns skill require a specific framework or PHP version?

This PHP design patterns skill requires PHP 8.x features and is framework-agnostic, providing framework-specific adapters only where necessary. It targets developers aiming for dependency injection-friendly code without locking into a specific platform.

When should I use behavioral patterns like Chain of Responsibility or Command in PHP?

You should use behavioral patterns like Chain of Responsibility or Command in PHP when you need to decouple request senders from receivers and encapsulate actions. This skill demonstrates these patterns through modular, testable examples to improve system flexibility.