One-click install
npx skills add https://github.com/krzysztofsurdy/code-virtuoso --skill design-patterns-krzysztofsurdy
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: design-patterns
Source: https://github.com/krzysztofsurdy/code-virtuoso/tree/main/skills/knowledge/design-patterns
Command: npx skills add https://github.com/krzysztofsurdy/code-virtuoso --skill design-patterns-krzysztofsurdy

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill provides comprehensive explanations and practical PHP implementations for 26 classic Gang of Four design patterns, helping developers understand and apply them to solve complex software design challenges.

Core Features & Use Cases

  • Pattern Explanations: Detailed descriptions of Creational, Structural, and Behavioral patterns.
  • PHP Implementations: Real-world, runnable PHP code examples for each pattern.
  • Use Case: You're building a new feature and need to decide whether to use the Strategy pattern or the Decorator pattern. This Skill provides clear examples and trade-offs for each, helping you make an informed decision.

Quick Start

Explain the Factory Method pattern and show a PHP example.

Frequently Asked Questions about design-patterns

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

FAQPage Schema
What are the Gang of Four design patterns and when should I use them in software architecture?

Gang of Four design patterns are 26 classic solutions for object-oriented design, categorized into creational, structural, and behavioral patterns. Use them to solve complex software architecture challenges by applying proven, reusable structures to common design problems.

How do I implement the Factory Method pattern in PHP 8.3?

To implement the Factory Method pattern in PHP 8.3, define an interface for creating objects but let subclasses alter the type of objects that will be created. This creational pattern provides real-world, runnable PHP code examples for object instantiation.

What is the difference between the Strategy pattern and the Decorator pattern for refactoring code?

The Strategy pattern alters an object's behavior by encapsulating algorithms, while the Decorator pattern modifies behavior by wrapping objects. Comparing their trade-offs clarifies which structural or behavioral pattern best fits your software architecture.

Can I use these object-oriented design patterns for PHP applications specifically?

Yes, these object-oriented design patterns are implemented specifically for PHP applications. The guidance provides detailed explanations and practical PHP 8.3+ implementations for creational, structural, and behavioral categories.

How do I choose the right creational, structural, or behavioral pattern for my feature?

To choose the right creational, structural, or behavioral pattern, review the detailed pattern intents, use cases, pros, and cons. This analysis aids in selecting the appropriate software architecture pattern for building or refactoring features.

When should I avoid using design patterns in my codebase?

Avoid using design patterns when the added complexity outweighs the structural benefit. Understanding the specific pros, cons, and real-world analogies of each pattern helps determine if applying it solves a problem or creates unnecessary architectural overhead.