design-patterns
/design-patterns
Zawiera opis 26 wzorców projektowych (Gang of Four oraz Object Pool, Private Class Data, Null Object) z kompromisami i antywzorcami.
- Autor
- krzysztofsurdy ↗
- Repozytorium
- code-virtuoso ↗
- Licencja
- MIT
- Ostatnia zmiana repozytorium
- 23.10.2026
Ocena i bezpieczeństwo
- Pliki w paczce
- 27
- Skrypty
- 0
- Komentarze HTML
- 0
- Adresy URL w SKILL.md
- 0
Brak sygnałów. Repozytorium zmienione 23.10.2026, bez odwołań do wycofanych modeli i API.
MIT, otwarta: można używać i zmieniać, z zachowaniem informacji o autorze.
Co robi i kiedy
Zawiera opis 26 wzorców projektowych (Gang of Four oraz Object Pool, Private Class Data, Null Object) z kompromisami i antywzorcami.
Oryginalny opis (EN)
Reference for 26 design patterns (Gang of Four plus Object Pool, Private Class Data, Null Object) with trade-offs and anti-patterns. Use to pick, apply, or review a pattern.
Jak działa
- Pattern Index
- When to Use Which Pattern
- Best Practices
Podgląd SKILL.md
--- name: design-patterns description: Reference for 26 design patterns (Gang of Four plus Object Pool, Private Class Data, Null Object) with trade-offs and anti-patterns. Use to pick, apply, or review a pattern. allowed-tools: Read Grep Glob Bash user-invocable: true disable-model-invocation: true --- # Design Patterns Reference for 26 design patterns organized by intent (creational, structural, behavioral), with implementations in PHP, Python, Java, C++ and others, UML guidance, and practical use cases. ## Pattern Index ### Creational Patterns - **Abstract Factory** - Produce families of related objects without specifying their concrete classes → [reference](references/abstract-factory.md) - **Builder** - Assemble complex objects through a step-by-step process → [reference](references/builder.md) - **Factory Method** - Declare an interface for object creation, letting subclasses determine the concrete type → [reference](references/factory-method.md) - **Prototype** - Duplicate existing objects without coupling to their concrete classes → [reference](references/prototype.md) - **Singleton** - Guarantee that a class has exactly one instance → [reference](references/singleton.md) - **Object Pool** - Recycle expensive-to-create objects for repeated use → [reference](references/object-pool.md) ### Structural Patterns - **Adapter** - Translate one interface into another that clients expect → [reference](references/adapter.md) - **Bridge** - Separate an abstraction from its implementation so both can evolve independently → [reference](references/bridge.md) - **Composite** - Arrange objects into tree structures for uniform treatment → [reference](references/composite.md) - **Decorator** - Layer new behaviors onto objects dynamically through wrapping → [reference](references/decorator.md) - **Facade** - Offer a simple interface to a complex subsystem → [reference](references/facade.md) - **Flyweight** - Minimize memory usage by sharing common state across many objects → [reference](references/flyweight.md) - **Proxy** - Manage access to an object through a surrogate → [reference](references/proxy.md) - **Private Class Data** - Limit access to class attributes → [reference](references/private-class-data.md) ### Behavioral Patterns - **Chain of Responsibility** - Route requests through a chain of handlers → [reference](references/chain-of-responsibility.md) - **Command** - Represent requests as standalone objects → [reference](references/command.md) - **Interpreter** - Establish a grammar representation and an interpreter for it → [reference](references/interpreter.md) - **Iterator** - Walk through elements without revealing the underlying structure → [reference](references/iterator.md) - **Mediator** - Untangle dependencies through a central coordinator → [reference](references/mediator.md) - **Memento** - Snapshot and restore object state without breaking encapsulation → [reference](references/memento.md) - **Null Object** - Supply a do-nothing default to eliminate null checks → [reference](references/null-object.md) - **Observer** - Automatically inform dependents when state changes → [reference](references/observer.md) - **State** - Change behavior when internal state transitions → [reference](references/state.md) - **Strategy** - Make algorithms interchangeable at runtime → [reference](references/strategy.md) - **Template Method** - Outline an algorithm skeleton and let subclasses fill in specific steps → [reference](references/template-method.md) - **Visitor** - Introduce operations to objects without altering their classes → [reference](references/visitor.md) ## When to Use Which Pattern | Problem | Pattern | |---------|---------| | Need to create families of related objects | Abstract Factory | | Complex object construction with many options | Builder | | Want to defer instantiation to subclasses | Factory Method | | Need copies of complex objects | Prototype | | Need exactly one instance globally | Singleton | | Incompatible interfaces need to work together | Adapter | | Want to vary abstraction and implementation independently | Bridge | | Tree structures with uniform treatment | Composite | | Add responsibilities dynamically without subclassing | Decorator | | Simplify a complex subsystem interface | Facade | | Many similar objects consuming too much memory | Flyweight | | Control access, add lazy loading, or log access | Proxy | | Multiple handlers for a request, unknown which handles it | Chain of Responsibility | | Queue, log, or undo operations | Command | | Need to interpret a simple language/grammar | Interpreter | | Traverse a collection without exposing internals | Iterator | | Reduce coupling between many communicating objects | Mediator | | Need undo/snapshot capability | Memento | | One-to-many event notification | Observer | | Object behavior depends on its state | State | | Need to switch algorithms at runtime | Strategy | | Algorithm skeleton with customizable steps | Template Method | | Add operations to object structures without modification | Visitor | ## Best Practices - Favor **composition over inheritance**: reach for Decorator, Strategy, or Bridge before building deep class hierarchies - Apply patterns to **real problems**, not hypothetical ones - Use your language's modern features where they fit: enums for State, immutable value types for Value Objects, first-class functions for Strategy - Combine patterns when it makes sense (for example, Builder + Fluent Interface, Strategy + Factory Method) - Keep pattern implementations **minimal**. If the pattern adds more complexity than it removes, reconsider it
Pliki w paczce (27)
- SKILL.md 6 KB
- references/abstract-factory.md 15 KB
- references/adapter.md 12 KB
- references/bridge.md 13 KB
- references/builder.md 17 KB
- references/chain-of-responsibility.md 14 KB
- references/command.md 13 KB
- references/composite.md 11 KB
- references/decorator.md 12 KB
- references/facade.md 16 KB
- references/factory-method.md 17 KB
- references/flyweight.md 20 KB
- references/interpreter.md 15 KB
- references/iterator.md 14 KB
- references/mediator.md 16 KB
- references/memento.md 14 KB
- references/null-object.md 11 KB
- references/object-pool.md 15 KB
- references/observer.md 16 KB
- references/private-class-data.md 10 KB
- references/prototype.md 13 KB
- references/proxy.md 15 KB
- references/singleton.md 12 KB
- references/state.md 15 KB
- references/strategy.md 15 KB
- references/template-method.md 15 KB
- references/visitor.md 12 KB
Wersje
| Repozytorium | Wynik | Licencja |
|---|---|---|
| Ta strona · krzysztofsurdy/code-virtuoso | 100 | MIT |
| spencerbeggs/effected | 100 | MIT |
| spencerbeggs/effected | 100 | MIT |
| joeblackwaslike/agent-skills | 100 | MIT |
| nimadorostkar/Claude-Skills-collection | 100 | MIT |
| andreibesleaga/gabbe | 100 | CC-BY-4.0 |
| pantheon-org/tekhne | 100 | MIT |
| itzcull/software-skills | 100 | MIT |
| guilhermevozniak/refactor-pilot-framework | 100 | MIT |
Migawka bazy z 13.11.2026 · wersja paczki 289b8f47122e (skrót SHA-256 całej paczki)
Pobrania w ostatnich 30 dniach: 0 · ranking
Zgłoś problem z tym skillem: szkodliwa treść, błędny opis albo prośba autora o usunięcie.
Podobne skille
- 100design-patterns-ruby
Dostarcza implementacje wzorców Gang of Four w Ruby (Factory, Singleton, Observer, Strategy i inne) do rozwiązań obiektowych, redukcji sprzężeń i problemów architektonicznych. - 100object-model-patterns
Zestawia wzorce architektury obiektowej dla frameworków testów automatycznych: Page Object, Screenplay, Component Object, App Actions, Service Object, Repository i Screen Object, z regułami użycia i antywzorcami. - 100design-patterns-gof
Dostarcza praktyczny przewodnik po 23 wzorcach Gang of Four: intencja, kompromisy, aktualność, zamienniki w językach i przypadki, kiedy ich unikać, do code review i oceny nadmiernej abstrakcji. - 95creational
Opisuje wzorce kreacyjne Gang of Four (Factory Method, Abstract Factory, Builder, Prototype, Singleton), które oddzielają system od sposobu tworzenia obiektów. - 100async-await-null-race-condition
Naprawia błąd Null check operator used on a null value, gdy obiekt zostaje ustawiony na null podczas oczekiwania async, przez przechwycenie lokalnej referencji przed await. - 100implementation-design-patterns
Podaje wzorce projektowe Gang of Four w TypeScript, na bazie refactoring.guru, do pisania i przeglądu kodu z problemami takimi jak eksplozja klas, warunki po typie i silne sprzężenie.