Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Maps code symptoms — exploding subclass combinations, switch-on-type dispatch, tangled object construction, incompatible interfaces, one-to-many update cascades — to the matching Gang of Four pattern, then loads that pattern's structural recipe from its 23 reference files. For selecting and implementing a design pattern; not for system-level boundaries (use ca-architecture-boundaries) or module interface depth (use aposd-designing-deep-modules).
.claude/skills/ryanthedev-gof-design-patterns/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-11 | ✗→✓ | ▲ Improved | 212% | 0% |
| case-01 | ✓→✓ | = Same ✓ | 65% | 0% |
| case-02 | ✓→✓ | = Same ✓ | 94% | 0% |
| case-03 | ✓→✓ | = Same ✓ | 185% | 0% |
| case-04 | ✓→✓ | = Same ✓ | 230% | 0% |
23 Gang of Four patterns as a decision guide. Identify the symptom or goal, pick the pattern, then read its reference file for the structural recipe.
| Code Smell | Pattern(s) | |---|---| | if/else or switch on object type | Strategy, Visitor | | if/else or switch on object state | State | | Telescoping constructors | Builder | | Subclass explosion for feature combinations | Decorator, Strategy, Bridge | | new ConcreteClass() scattered throughout codebase | Factory Method, Abstract Factory | | Hard-coded class names | Factory Method, Prototype | | Subsystem complexity leaking into client code | Facade | | Complex many-to-many object communication | Mediator | | Manual state propagation to multiple dependents | Observer | | Duplicated algorithm structure across subclasses | Template Method | | Large conditional routing requests to handlers | Chain of Responsibility | | High memory cost from many fine-grained objects | Flyweight |
| What you want | Pattern | |---|---| | Hide how objects are created | Factory Method, Abstract Factory, Builder, Prototype | | Ensure exactly one instance globally | Singleton | | Make incompatible interfaces work together | Adapter | | Decouple abstraction from implementation | Bridge | | Treat individual objects and groups uniformly | Composite | | Add behavior dynamically without subclassing | Decorator | | Simplify a complex subsystem API | Facade | | Lazy-load, cache, or control access to an object | Proxy | | Make requests undoable, queueable, or loggable | Command (+ Memento for undo state) | | Traverse a collection without exposing internals | Iterator | | Encapsulate an interchangeable algorithm | Strategy | | Change behavior when internal state changes | State | | Notify dependents automatically on state change | Observer | | Add operations to a stable object structure | Visitor |
| Choosing between | Key distinction | |---|---| | Strategy vs Template Method | Composition (delegate whole algorithm) vs inheritance (override steps) | | State vs Strategy | State transitions itself; Strategy is chosen by the client | | Adapter vs Facade | Adapting a single class vs simplifying an entire subsystem | | Decorator vs Proxy | Adding behavior vs controlling access | | Factory Method vs Abstract Factory | Single product type vs product families | | Command vs Chain of Responsibility | Encapsulate and invoke an action vs route a request to a handler |
Creational (5) — control what gets created and how
Abstract Factory · Builder · Factory Method · Prototype · Singleton
Structural (7) — compose classes and objects into larger structures
Adapter · Bridge · Composite · Decorator · Facade · Flyweight · Proxy
Behavioral (11) — define communication and responsibility between objects
Chain of Responsibility · Command · Interpreter · Iterator · Mediator · Memento · Observer · State · Strategy · Template Method · Visitor
Every pattern adds indirection. Apply one only when:
> "If a straightforward solution works, use it." — GoF
Each pattern has a full file in ${CLAUDE_SKILL_DIR}/references/:
foundations.md — GoF principles (program to interface, favor composition, encapsulate what varies)techniques.md — master table, pattern relationships, alternative-pattern decision guidegof-<pattern-name>.md — structure, participants, when to use, consequences, exampleRead the relevant pattern file when implementing. This SKILL.md is for selection; the reference files are for execution.
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-01 | pass→pass | 6,417 | 5,950 | -7% | 1 | 1 | 0% | 1,102 | 1,822 | +65% | 0 | 0 | — |
case-02 | pass→pass | 4,592 | 3,919 | -15% | 1 | 1 | 0% | 811 | 1,572 | +94% | 0 | 0 | — |
case-03 | pass→pass | 4,248 | 6,275 | +48% | 1 | 1 | 0% | 682 | 1,943 | +185% | 0 | 0 | — |
case-04 | pass→pass | 3,627 | 6,224 | +72% | 1 | 1 | 0% | 592 | 1,952 | +230% | 0 | 0 | — |
case-05 | pass→pass | 4,688 | 4,773 | +2% | 1 | 1 | 0% | 714 | 1,552 | +117% | 0 | 0 | — |
case-06 | pass→pass | 4,135 | 5,753 | +39% | 1 | 1 | 0% | 738 | 1,832 | +148% | 0 | 0 | — |
case-07 | pass→pass | 3,582 | 4,305 | +20% | 1 | 1 | 0% | 607 | 1,510 | +149% | 0 | 0 | — |
case-08 | pass→pass | 3,785 | 6,759 | +79% | 1 | 1 | 0% | 613 | 1,968 | +221% | 0 | 0 | — |
case-09 | pass→pass | 3,844 | 5,579 | +45% | 1 | 1 | 0% | 641 | 1,783 | +178% | 0 | 0 | — |
case-10 | fail→fail | 4,142 | 3,434 | -17% | 1 | 1 | 0% | 669 | 1,371 | +105% | 0 | 0 | — |
case-11 | fail→pass | 4,263 | 7,070 | +66% | 1 | 1 | 0% | 676 | 2,109 | +212% | 0 | 0 | — |
case-12 | pass→pass | 3,187 | 4,280 | +34% | 1 | 1 | 0% | 471 | 1,479 | +214% | 0 | 0 | — |
case-13 | pass→pass | 3,516 | 4,520 | +29% | 1 | 1 | 0% | 582 | 1,477 | +154% | 0 | 0 | — |
case-14 | pass→pass | 3,942 | 7,483 | +90% | 1 | 1 | 0% | 718 | 1,819 | +153% | 0 | 0 | — |
case-15 | fail→fail | 3,726 | 3,792 | +2% | 1 | 1 | 0% | 489 | 1,444 | +195% | 0 | 0 | — |
case-16 | pass→pass | 10,233 | 6,593 | -36% | 1 | 1 | 0% | 1,762 | 1,965 | +12% | 0 | 0 | — |
case-17 | pass→pass | 3,758 | 4,047 | +8% | 1 | 1 | 0% | 621 | 1,509 | +143% | 0 | 0 | — |
case-18 | pass→pass | 4,468 | 3,962 | -11% | 1 | 1 | 0% | 711 | 1,430 | +101% | 0 | 0 | — |
case-19 | pass→pass | 4,624 | 4,733 | +2% | 1 | 1 | 0% | 715 | 1,608 | +125% | 0 | 0 | — |
case-20 | pass→pass | 13,814 | 6,861 | -50% | 1 | 1 | 0% | 2,079 | 1,821 | -12% | 0 | 0 | — |
case-21 | pass→pass | 11,130 | 12,481 | +12% | 1 | 1 | 0% | 1,880 | 2,929 | +56% | 0 | 0 | — |
case-22 | pass→pass | 18,175 | 15,266 | -16% | 1 | 1 | 0% | 1,768 | 3,169 | +79% | 0 | 0 | — |
case-23 | pass→pass | 7,004 | 6,906 | -1% | 1 | 1 | 0% | 1,167 | 2,005 | +72% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 23 cases were attempted. The headline lift of +4 percentage points is the difference between those two pass rates over the 23 comparable cases.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.