[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7AMQSY65GPDWP8XK2DJCV78":3,"skill-same:01M7AMQSY65GPDWP8XK2DJCV78":48},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":24,"commitSha":25,"skillDirectory":26,"forksCount":27,"repositoryHtmlUrl":28,"repositoryHomepageUrl":29,"ownerHtmlUrl":30,"ownerBlogUrl":31,"ownerDescription":32,"updatedAt":33,"install":34,"resources":47},"01M7AMQSY65GPDWP8XK2DJCV78","patterns-foundations-gof-and-alternatives",null,"Use when naming, choosing, or resisting a design pattern: what a pattern actually is (a vocabulary, not a construction kit), the honest critique of the Gang of Four, the pattern-by-pattern audit of which of the 23 are obsolete, still useful, or situational in modern languages, the functional and data-oriented alternatives, and dependency injection and inversion of control. Includes the router for the whole design-patterns reference.","the-vibey-project\u002Fvibey","the-vibey-project","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F329298758?v=4","01M7AJHGZ9722CTJ4JNQZVRH0Q","the vibey project","01M7AJHGZVMG2K7TGXQ6XFHVG3",5,"MIT","https:\u002F\u002Fgithub.com\u002Fthe-vibey-project\u002Fvibey\u002Fblob\u002Fdevelop\u002Fsrc\u002Fvibey_tools\u002Fskills\u002Fplugins\u002Fdesign-patterns\u002Fskills\u002Fpatterns-foundations-gof-and-alternatives\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: patterns-foundations-gof-and-alternatives\ndescription: \"Use when naming, choosing, or resisting a design pattern: what a pattern actually is (a vocabulary, not a construction kit), the honest critique of the Gang of Four, the pattern-by-pattern audit of which of the 23 are obsolete, still useful, or situational in modern languages, the functional and data-oriented alternatives, and dependency injection and inversion of control. Includes the router for the whole design-patterns reference.\"\n---\n\n# Design Patterns: What a Pattern Is, the GoF Audit, and the Alternatives\n\n> **Part 1 of 5** of the *Design Patterns* reference (plugin `design-patterns`), covering §0–§5. Sibling skills: `patterns-architectural` (§6–§7), `patterns-distributed-concurrency-and-messaging` (§8–§11), `patterns-llm-agentic-and-legacy-migration` (§12–§13), `patterns-reference` (§14–§20). Section numbers are shared across the set; a reference written as §N → `skill` points into that sibling skill.\n>\n> **Currency:** Verified August 2026. See §17 → `patterns-reference` for the currency snapshot and what goes stale first.\n\n> **How to read this.** Reference, not a catalogue. **The 23 GoF patterns are freely\n> available with diagrams and code samples everywhere** — this document does not reproduce\n> them. It addresses the harder questions: which ones still earn their keep, which ones\n> are artifacts of 1994's languages, what replaced them, where the genuinely useful\n> modern patterns live, and **when not to use any of them.**\n>\n> Three markers:\n> - **[DURABLE]** — design forces that recur regardless of language or era.\n> - **[VERSIONED]** — language features, framework practice, emerging pattern languages.\n> - **[CONTESTED]** — genuine disagreement, and **this domain has more of it than most.**\n>\n> **⚠️ GOTCHA** boxes mark where applying a pattern makes things worse.\n>\n> **The three framings that organize everything below:**\n> 1. **Patterns are a vocabulary, not a construction kit.** Their durable value is that\n>    \"this is a circuit breaker\" communicates a design in four words. **Their value was\n>    never that you should go looking for places to install them** — and treating the\n>    catalogue as a checklist is the single most damaging misreading of the entire\n>    literature (§14 → `patterns-reference`).\n> 2. **A pattern is a solution to a *force*, and the force is what's durable — not the\n>    implementation.** Many GoF implementations were workarounds for what C++ and Java\n>    couldn't express in 1994. **The forces persisted; the workarounds became language\n>    features** (§3). Learn to see the force.\n> 3. **Over-application is the dominant failure mode, by a wide margin.** The cost of a\n>    missing pattern is some duplication you can refactor later. **The cost of an unneeded\n>    pattern is permanent indirection that every future reader must decode.** As one\n>    2026 practitioner framing puts it: add a pattern only when it removes duplication,\n>    isolates change, or clarifies intent — **and if introducing it makes the code harder\n>    to explain, it's the wrong moment for it.**\n\n---\n\n## §0. Routing\n\n| Asked about... | Go to |\n|---|---|\n| What a pattern actually is, and the vocabulary argument | §1 |\n| **The honest critique of GoF** | **§2** |\n| Which of the 23 survive — the audit | §3 |\n| Functional and data-oriented alternatives | §4 |\n| Dependency injection and inversion | §5 |\n| Architectural patterns (layered, hexagonal, DDD) | §6 → `patterns-architectural` |\n| Monolith vs. microservices, and modular monoliths | §7 → `patterns-architectural` |\n| Distributed data patterns (saga, outbox, CQRS, ES) | §8 → `patterns-distributed-concurrency-and-messaging` |\n| Resilience patterns (circuit breaker, bulkhead, retry) | §9 → `patterns-distributed-concurrency-and-messaging` |\n| Concurrency patterns | §10 → `patterns-distributed-concurrency-and-messaging` |\n| Integration and messaging patterns | §11 → `patterns-distributed-concurrency-and-messaging` |\n| **LLM and agentic patterns** | §12 → `patterns-llm-agentic-and-legacy-migration` |\n| Migration and legacy patterns | §13 → `patterns-llm-agentic-and-legacy-migration` |\n| **Anti-patterns and over-application** | **§14 → `patterns-reference`, §15 → `patterns-reference`** |\n| \"Which side is right?\" | §16 → `patterns-reference` |\n| \"Is this still current?\" | §17 → `patterns-reference` |\n| Books | §18 → `patterns-reference` |\n\n---\n\n## §1. What a Pattern Is\n\n**[DURABLE] Christopher Alexander's original definition, from architecture, is still the\nbest one**: a pattern describes **a problem that occurs over and over, and the core of a\nsolution to it, such that you can use the solution a million times without ever doing it\nthe same way twice.**\n\n**The three parts that matter, and the order matters:**\n1. **The forces** — the competing pressures creating the problem. *This is the durable\n   part.*\n2. **The resolution** — how the pattern balances them.\n3. **The consequences** — ⚠️ **including what it costs.** A pattern description without a\n   \"consequences\" section is marketing.\n\n**[DURABLE] The genuine, lasting value is the shared vocabulary.** \"Put a circuit breaker\nin front of it\" or \"that's a saga\" or \"wrap it in an adapter\" carries a full design in a\nhandful of words, and that compression is real. **What patterns are *not* is a catalogue of\nthings your code should contain.**\n\n**⚠️ The most important quote in this entire literature is from one of the authors.**\nRalph Johnson, a GoF co-author: **\"Conformity to patterns is not a measure of goodness.\"**\nKeep that in view for everything below.\n\n---\n\n## §2. The Honest Critique of GoF\n\n**[CONTESTED — and this is a genuine, decades-long disagreement, not a settled question.\nBoth sides below have real merit and I'll give each its strongest form.]**\n\n### 2.1 The case against\n\n*Design Patterns: Elements of Reusable Object-Oriented Software* (Gamma, Helm, Johnson,\nVlissides, 1994) was written in a C++ context, in an era when — as one widely-cited\ncritique puts it — **programmers were \"festooning their code with virtual methods,\nsuperclasses, subclasses, and clever mixins,\"** and **\"language limitations and static\ntypes were locking them out of improvements they later wanted to make.\"**\n\nThe structural argument: **each chapter tackled a design conundrum posed by the era's\nlimited programming languages**, and most solutions **\"introduced new classes to cleverly\ndecouple code that would otherwise be too tightly linked.\"** Where languages have since\ngained first-class functions, modules, and richer type systems, **several patterns\ndissolve into a language feature** (§3).\n\nA common academic complaint: the book **\"was developed to address several things that\ncannot easily be done in C++, which have been better handled in newer languages\"**, and\nthat heavy reliance on the catalogue **\"may feel a bit like making the problem fit the\nsolution instead of building a new solution to fit the problem.\"**\n\n**⚠️ And the cultural damage was real.** For two decades, **knowing the GoF by heart was\ntreated as a marker of seniority** — which produced a generation of codebases with\n`AbstractSingletonProxyFactoryBean`-shaped indirection installed for its own sake.\nRecent commentary describes a **\"post-pattern\" turn toward \"enlightened simplicity,\"**\ndriven by language maturation, functional programming, data-oriented design, and cognitive\nload theory.\n\n### 2.2 The case for\n\n**⚠️ The \"patterns are just C++ deficiencies\" claim is historically shaky**, and the\nstrongest rebuttal makes three points: **patterns came as much from Smalltalk as from\nC++** — and Smalltalk is dynamic with first-class functions, so the deficiency story\ndoesn't fit the origin; **first-class functions alone don't fully obviate patterns like\nStrategy** (they change the implementation, not always the design conversation); and\n**providing an alternative implementation doesn't make the original bad.**\n\nThe forces argument, which is the strongest one: **design problems repeat even when\ntechnology changes** — creation, composition, variation, decoupling, and behaviour\ncoordination are permanent. **The names and tooling evolve; the problems don't.**\n\nAnd the absorption argument cuts both ways: **frameworks from Spring to .NET to Angular\nimplicitly implement these patterns.** You may not write a Factory, but you configure one\ndaily — and **you still need to recognize the pattern to judge whether the framework's use\nof it fits your case.**\n\n### 2.3 The synthesis this document takes\n\n**[DURABLE] Learn the patterns as vocabulary and as a way of seeing forces. Do not learn\nthem as a catalogue of things to install.** Concretely:\n- **Know all 23 by name and force.** The recognition is cheap and permanently useful.\n- **Implement almost none of them literally.** Your language or framework probably has it.\n- **Start simple. Add a pattern only when it removes duplication, isolates change, or\n  clarifies intent** — and **if it makes the code harder to explain, it's premature.**\n- **Weight the modern pattern languages higher** (§8–§12 → `patterns-distributed-concurrency-and-messaging`, `patterns-llm-agentic-and-legacy-migration`). They address forces that are\n  live in 2026 in a way that Abstract Factory is not.\n\n---\n\n## §3. The GoF Audit\n\n**[VERSIONED — the verdicts depend on your language, and that's the point.]**\n\n### 3.1 Largely obsolete or absorbed into languages\n\n| Pattern | What happened |\n|---|---|\n| **Iterator** | **Built into every modern language.** `for…of`, generators, `IEnumerable`, `Iterator`. ⚠️ Emulating the GoF recipe in Python is explicitly pointless — the language *is* the pattern |\n| **Singleton** | ⚠️ **Widely regarded as an anti-pattern now** (§14 → `patterns-reference`). In Python and JS, **modules are natural singletons**. Where you genuinely need one instance, DI container lifetime management is the modern answer |\n| **Command** | **A function is a command.** The pattern existed to give a callable first-class status in languages that lacked it. ⚠️ Still earns its keep when you need undo\u002Fredo, queuing, or serializable operations — the *object* buys you something the closure doesn't |\n| **Strategy** | **A function parameter.** ⚠️ Though see §2.2 — when strategies carry state, configuration, or need naming and discovery, the object form still has value |\n| **Template Method** | Inheritance-heavy and **⚠️ composition generally wins in modern codebases.** Higher-order functions do this without the inheritance tree |\n| **Prototype** | Absorbed by `clone`\u002Fcopy semantics, and by JS's prototype model outright |\n| **Interpreter** | Rarely hand-rolled; parser generators and existing DSL tooling win (see a parsing reference) |\n\n### 3.2 Still genuinely useful\n\n| Pattern | Why it survives |\n|---|---|\n| **Adapter** | ⚠️ **Permanently useful.** Impedance mismatch between your code and someone else's interface never goes away. The core of hexagonal architecture (§6.2 → `patterns-architectural`) |\n| **Facade** | Simplifying a complex subsystem is a durable need |\n| **Decorator** | Composable behaviour layering — middleware, wrappers, Python decorators, HTTP handler chains. **This one arguably got *more* important** |\n| **Observer** | Underpins every event system, reactive framework, and pub\u002Fsub. ⚠️ **Now usually reached via a library** (RxJS, signals, event emitters), not hand-rolled |\n| **Composite** | Trees where leaves and nodes share an interface — UI, filesystems, expression trees |\n| **Builder** | ⚠️ **Genuinely valuable** in languages without named\u002Fdefault\u002Foptional arguments. **Largely unnecessary in Python or Kotlin.** A clean language-dependence example |\n| **State** | Explicit state machines are underused and this pattern names them well |\n| **Proxy** | Lazy loading, remoting, access control, caching. Every ORM lazy-loading implementation |\n| **Flyweight** | Niche but real — string interning, glyph caches, ECS |\n| **Visitor** | ⚠️ Awkward, but **the right answer for operations over a stable type hierarchy** (compilers, ASTs). **Pattern matching and sum types replace it more cleanly** where available (§4) |\n\n### 3.3 Situational\n**Factory Method \u002F Abstract Factory** — ⚠️ **heavily over-applied**, but real when object\ncreation genuinely varies by configuration or platform. **Bridge** — real when two\ndimensions vary independently, rare in practice. **Chain of Responsibility** — middleware\npipelines are exactly this and are everywhere. **Mediator** — can degenerate into a god\nobject (§14 → `patterns-reference`). **Memento** — undo and snapshots.\n\n---\n\n## §4. Functional and Data-Oriented Alternatives\n\n**[DURABLE] Many OO patterns have a functional counterpart that is smaller and often\nclearer**, and knowing the mapping is more useful than knowing either list alone.\n\n| OO pattern | Functional equivalent |\n|---|---|\n| Strategy | A function parameter |\n| Command | A closure |\n| Template Method | A higher-order function |\n| Decorator | Function composition |\n| Observer | Streams \u002F signals \u002F reactive sequences |\n| Visitor | **Pattern matching over a sum type** |\n| Factory | A function returning a value |\n| Null Object | `Option` \u002F `Maybe` |\n| Singleton | A module |\n\n**The functional patterns proper**: **immutability by default** (removes whole categories\nof bug), **pure core \u002F imperative shell** (⚠️ **one of the highest-value structural ideas\navailable** — put logic in pure functions, push I\u002FO to the edges, and testing becomes\ntrivial), **algebraic data types + exhaustive pattern matching** (the compiler enforces\nthat you handled every case), **`Result`\u002F`Either` for errors** as values rather than\ncontrol flow, **persistent data structures**, and **the monadic patterns** (⚠️ useful\nconcepts, and **the terminology is a genuine barrier that the community often\nunderestimates**).\n\n**Data-oriented design** inverts the OO framing entirely: **model the data and its\ntransformations, not the objects.** Struct-of-arrays layouts, separating data from\nbehaviour, entity-component systems. **⚠️ It's a serious alternative in performance-critical\ndomains, not a stylistic preference** — for the hardware reasons, see an algorithms\nreference on memory layout.\n\n---\n\n## §5. Dependency Injection and Inversion\n\n**[DURABLE] The most consequential idea in this whole area, and the most commonly\nmisunderstood.**\n\n**Three distinct things people conflate:**\n- **Dependency Inversion Principle** — depend on abstractions, not concretions. *A design\n  principle.*\n- **Dependency Injection** — pass dependencies in rather than constructing them inside.\n  *A technique.* **⚠️ Constructor injection is DI. It requires no framework at all.**\n- **DI container \u002F IoC framework** — Spring, Guice, .NET's built-in container. *A tool*,\n  and an optional one.\n\n> **⚠️ GOTCHA — the failure modes, and they're common:**\n> - **Interfaces with exactly one implementation, created \"for testability.\"** If nothing\n>   else will ever implement it, the interface is ceremony. **Modern test tooling can fake\n>   concrete types.**\n> - **Container magic** — runtime-resolved graphs that are impossible to trace by reading\n>   code, and that fail at startup in production rather than at compile time.\n> - **Over-abstracting stable dependencies.** You are not going to swap out the standard\n>   library's date type.\n> - **⚠️ Service Locator is not DI.** It hides dependencies inside the implementation\n>   rather than declaring them in the signature, and it is widely regarded as an\n>   anti-pattern for that reason.\n\n**[DURABLE] The pragmatic default: constructor injection, plain, no framework, until the\nobject graph is large enough to genuinely hurt.** Introduce an interface when you have a\nsecond implementation or a real seam — not speculatively.\n","# Design Patterns: What a Pattern Is, the GoF Audit, and the Alternatives\n\n> **Part 1 of 5** of the *Design Patterns* reference (plugin `design-patterns`), covering §0–§5. Sibling skills: `patterns-architectural` (§6–§7), `patterns-distributed-concurrency-and-messaging` (§8–§11), `patterns-llm-agentic-and-legacy-migration` (§12–§13), `patterns-reference` (§14–§20). Section numbers are shared across the set; a reference written as §N → `skill` points into that sibling skill.\n>\n> **Currency:** Verified August 2026. See §17 → `patterns-reference` for the currency snapshot and what goes stale first.\n\n> **How to read this.** Reference, not a catalogue. **The 23 GoF patterns are freely\n> available with diagrams and code samples everywhere** — this document does not reproduce\n> them. It addresses the harder questions: which ones still earn their keep, which ones\n> are artifacts of 1994's languages, what replaced them, where the genuinely useful\n> modern patterns live, and **when not to use any of them.**\n>\n> Three markers:\n> - **[DURABLE]** — design forces that recur regardless of language or era.\n> - **[VERSIONED]** — language features, framework practice, emerging pattern languages.\n> - **[CONTESTED]** — genuine disagreement, and **this domain has more of it than most.**\n>\n> **⚠️ GOTCHA** boxes mark where applying a pattern makes things worse.\n>\n> **The three framings that organize everything below:**\n> 1. **Patterns are a vocabulary, not a construction kit.** Their durable value is that\n>    \"this is a circuit breaker\" communicates a design in four words. **Their value was\n>    never that you should go looking for places to install them** — and treating the\n>    catalogue as a checklist is the single most damaging misreading of the entire\n>    literature (§14 → `patterns-reference`).\n> 2. **A pattern is a solution to a *force*, and the force is what's durable — not the\n>    implementation.** Many GoF implementations were workarounds for what C++ and Java\n>    couldn't express in 1994. **The forces persisted; the workarounds became language\n>    features** (§3). Learn to see the force.\n> 3. **Over-application is the dominant failure mode, by a wide margin.** The cost of a\n>    missing pattern is some duplication you can refactor later. **The cost of an unneeded\n>    pattern is permanent indirection that every future reader must decode.** As one\n>    2026 practitioner framing puts it: add a pattern only when it removes duplication,\n>    isolates change, or clarifies intent — **and if introducing it makes the code harder\n>    to explain, it's the wrong moment for it.**\n\n---\n\n## §0. Routing\n\n| Asked about... | Go to |\n|---|---|\n| What a pattern actually is, and the vocabulary argument | §1 |\n| **The honest critique of GoF** | **§2** |\n| Which of the 23 survive — the audit | §3 |\n| Functional and data-oriented alternatives | §4 |\n| Dependency injection and inversion | §5 |\n| Architectural patterns (layered, hexagonal, DDD) | §6 → `patterns-architectural` |\n| Monolith vs. microservices, and modular monoliths | §7 → `patterns-architectural` |\n| Distributed data patterns (saga, outbox, CQRS, ES) | §8 → `patterns-distributed-concurrency-and-messaging` |\n| Resilience patterns (circuit breaker, bulkhead, retry) | §9 → `patterns-distributed-concurrency-and-messaging` |\n| Concurrency patterns | §10 → `patterns-distributed-concurrency-and-messaging` |\n| Integration and messaging patterns | §11 → `patterns-distributed-concurrency-and-messaging` |\n| **LLM and agentic patterns** | §12 → `patterns-llm-agentic-and-legacy-migration` |\n| Migration and legacy patterns | §13 → `patterns-llm-agentic-and-legacy-migration` |\n| **Anti-patterns and over-application** | **§14 → `patterns-reference`, §15 → `patterns-reference`** |\n| \"Which side is right?\" | §16 → `patterns-reference` |\n| \"Is this still current?\" | §17 → `patterns-reference` |\n| Books | §18 → `patterns-reference` |\n\n---\n\n## §1. What a Pattern Is\n\n**[DURABLE] Christopher Alexander's original definition, from architecture, is still the\nbest one**: a pattern describes **a problem that occurs over and over, and the core of a\nsolution to it, such that you can use the solution a million times without ever doing it\nthe same way twice.**\n\n**The three parts that matter, and the order matters:**\n1. **The forces** — the competing pressures creating the problem. *This is the durable\n   part.*\n2. **The resolution** — how the pattern balances them.\n3. **The consequences** — ⚠️ **including what it costs.** A pattern description without a\n   \"consequences\" section is marketing.\n\n**[DURABLE] The genuine, lasting value is the shared vocabulary.** \"Put a circuit breaker\nin front of it\" or \"that's a saga\" or \"wrap it in an adapter\" carries a full design in a\nhandful of words, and that compression is real. **What patterns are *not* is a catalogue of\nthings your code should contain.**\n\n**⚠️ The most important quote in this entire literature is from one of the authors.**\nRalph Johnson, a GoF co-author: **\"Conformity to patterns is not a measure of goodness.\"**\nKeep that in view for everything below.\n\n---\n\n## §2. The Honest Critique of GoF\n\n**[CONTESTED — and this is a genuine, decades-long disagreement, not a settled question.\nBoth sides below have real merit and I'll give each its strongest form.]**\n\n### 2.1 The case against\n\n*Design Patterns: Elements of Reusable Object-Oriented Software* (Gamma, Helm, Johnson,\nVlissides, 1994) was written in a C++ context, in an era when — as one widely-cited\ncritique puts it — **programmers were \"festooning their code with virtual methods,\nsuperclasses, subclasses, and clever mixins,\"** and **\"language limitations and static\ntypes were locking them out of improvements they later wanted to make.\"**\n\nThe structural argument: **each chapter tackled a design conundrum posed by the era's\nlimited programming languages**, and most solutions **\"introduced new classes to cleverly\ndecouple code that would otherwise be too tightly linked.\"** Where languages have since\ngained first-class functions, modules, and richer type systems, **several patterns\ndissolve into a language feature** (§3).\n\nA common academic complaint: the book **\"was developed to address several things that\ncannot easily be done in C++, which have been better handled in newer languages\"**, and\nthat heavy reliance on the catalogue **\"may feel a bit like making the problem fit the\nsolution instead of building a new solution to fit the problem.\"**\n\n**⚠️ And the cultural damage was real.** For two decades, **knowing the GoF by heart was\ntreated as a marker of seniority** — which produced a generation of codebases with\n`AbstractSingletonProxyFactoryBean`-shaped indirection installed for its own sake.\nRecent commentary describes a **\"post-pattern\" turn toward \"enlightened simplicity,\"**\ndriven by language maturation, functional programming, data-oriented design, and cognitive\nload theory.\n\n### 2.2 The case for\n\n**⚠️ The \"patterns are just C++ deficiencies\" claim is historically shaky**, and the\nstrongest rebuttal makes three points: **patterns came as much from Smalltalk as from\nC++** — and Smalltalk is dynamic with first-class functions, so the deficiency story\ndoesn't fit the origin; **first-class functions alone don't fully obviate patterns like\nStrategy** (they change the implementation, not always the design conversation); and\n**providing an alternative implementation doesn't make the original bad.**\n\nThe forces argument, which is the strongest one: **design problems repeat even when\ntechnology changes** — creation, composition, variation, decoupling, and behaviour\ncoordination are permanent. **The names and tooling evolve; the problems don't.**\n\nAnd the absorption argument cuts both ways: **frameworks from Spring to .NET to Angular\nimplicitly implement these patterns.** You may not write a Factory, but you configure one\ndaily — and **you still need to recognize the pattern to judge whether the framework's use\nof it fits your case.**\n\n### 2.3 The synthesis this document takes\n\n**[DURABLE] Learn the patterns as vocabulary and as a way of seeing forces. Do not learn\nthem as a catalogue of things to install.** Concretely:\n- **Know all 23 by name and force.** The recognition is cheap and permanently useful.\n- **Implement almost none of them literally.** Your language or framework probably has it.\n- **Start simple. Add a pattern only when it removes duplication, isolates change, or\n  clarifies intent** — and **if it makes the code harder to explain, it's premature.**\n- **Weight the modern pattern languages higher** (§8–§12 → `patterns-distributed-concurrency-and-messaging`, `patterns-llm-agentic-and-legacy-migration`). They address forces that are\n  live in 2026 in a way that Abstract Factory is not.\n\n---\n\n## §3. The GoF Audit\n\n**[VERSIONED — the verdicts depend on your language, and that's the point.]**\n\n### 3.1 Largely obsolete or absorbed into languages\n\n| Pattern | What happened |\n|---|---|\n| **Iterator** | **Built into every modern language.** `for…of`, generators, `IEnumerable`, `Iterator`. ⚠️ Emulating the GoF recipe in Python is explicitly pointless — the language *is* the pattern |\n| **Singleton** | ⚠️ **Widely regarded as an anti-pattern now** (§14 → `patterns-reference`). In Python and JS, **modules are natural singletons**. Where you genuinely need one instance, DI container lifetime management is the modern answer |\n| **Command** | **A function is a command.** The pattern existed to give a callable first-class status in languages that lacked it. ⚠️ Still earns its keep when you need undo\u002Fredo, queuing, or serializable operations — the *object* buys you something the closure doesn't |\n| **Strategy** | **A function parameter.** ⚠️ Though see §2.2 — when strategies carry state, configuration, or need naming and discovery, the object form still has value |\n| **Template Method** | Inheritance-heavy and **⚠️ composition generally wins in modern codebases.** Higher-order functions do this without the inheritance tree |\n| **Prototype** | Absorbed by `clone`\u002Fcopy semantics, and by JS's prototype model outright |\n| **Interpreter** | Rarely hand-rolled; parser generators and existing DSL tooling win (see a parsing reference) |\n\n### 3.2 Still genuinely useful\n\n| Pattern | Why it survives |\n|---|---|\n| **Adapter** | ⚠️ **Permanently useful.** Impedance mismatch between your code and someone else's interface never goes away. The core of hexagonal architecture (§6.2 → `patterns-architectural`) |\n| **Facade** | Simplifying a complex subsystem is a durable need |\n| **Decorator** | Composable behaviour layering — middleware, wrappers, Python decorators, HTTP handler chains. **This one arguably got *more* important** |\n| **Observer** | Underpins every event system, reactive framework, and pub\u002Fsub. ⚠️ **Now usually reached via a library** (RxJS, signals, event emitters), not hand-rolled |\n| **Composite** | Trees where leaves and nodes share an interface — UI, filesystems, expression trees |\n| **Builder** | ⚠️ **Genuinely valuable** in languages without named\u002Fdefault\u002Foptional arguments. **Largely unnecessary in Python or Kotlin.** A clean language-dependence example |\n| **State** | Explicit state machines are underused and this pattern names them well |\n| **Proxy** | Lazy loading, remoting, access control, caching. Every ORM lazy-loading implementation |\n| **Flyweight** | Niche but real — string interning, glyph caches, ECS |\n| **Visitor** | ⚠️ Awkward, but **the right answer for operations over a stable type hierarchy** (compilers, ASTs). **Pattern matching and sum types replace it more cleanly** where available (§4) |\n\n### 3.3 Situational\n**Factory Method \u002F Abstract Factory** — ⚠️ **heavily over-applied**, but real when object\ncreation genuinely varies by configuration or platform. **Bridge** — real when two\ndimensions vary independently, rare in practice. **Chain of Responsibility** — middleware\npipelines are exactly this and are everywhere. **Mediator** — can degenerate into a god\nobject (§14 → `patterns-reference`). **Memento** — undo and snapshots.\n\n---\n\n## §4. Functional and Data-Oriented Alternatives\n\n**[DURABLE] Many OO patterns have a functional counterpart that is smaller and often\nclearer**, and knowing the mapping is more useful than knowing either list alone.\n\n| OO pattern | Functional equivalent |\n|---|---|\n| Strategy | A function parameter |\n| Command | A closure |\n| Template Method | A higher-order function |\n| Decorator | Function composition |\n| Observer | Streams \u002F signals \u002F reactive sequences |\n| Visitor | **Pattern matching over a sum type** |\n| Factory | A function returning a value |\n| Null Object | `Option` \u002F `Maybe` |\n| Singleton | A module |\n\n**The functional patterns proper**: **immutability by default** (removes whole categories\nof bug), **pure core \u002F imperative shell** (⚠️ **one of the highest-value structural ideas\navailable** — put logic in pure functions, push I\u002FO to the edges, and testing becomes\ntrivial), **algebraic data types + exhaustive pattern matching** (the compiler enforces\nthat you handled every case), **`Result`\u002F`Either` for errors** as values rather than\ncontrol flow, **persistent data structures**, and **the monadic patterns** (⚠️ useful\nconcepts, and **the terminology is a genuine barrier that the community often\nunderestimates**).\n\n**Data-oriented design** inverts the OO framing entirely: **model the data and its\ntransformations, not the objects.** Struct-of-arrays layouts, separating data from\nbehaviour, entity-component systems. **⚠️ It's a serious alternative in performance-critical\ndomains, not a stylistic preference** — for the hardware reasons, see an algorithms\nreference on memory layout.\n\n---\n\n## §5. Dependency Injection and Inversion\n\n**[DURABLE] The most consequential idea in this whole area, and the most commonly\nmisunderstood.**\n\n**Three distinct things people conflate:**\n- **Dependency Inversion Principle** — depend on abstractions, not concretions. *A design\n  principle.*\n- **Dependency Injection** — pass dependencies in rather than constructing them inside.\n  *A technique.* **⚠️ Constructor injection is DI. It requires no framework at all.**\n- **DI container \u002F IoC framework** — Spring, Guice, .NET's built-in container. *A tool*,\n  and an optional one.\n\n> **⚠️ GOTCHA — the failure modes, and they're common:**\n> - **Interfaces with exactly one implementation, created \"for testability.\"** If nothing\n>   else will ever implement it, the interface is ceremony. **Modern test tooling can fake\n>   concrete types.**\n> - **Container magic** — runtime-resolved graphs that are impossible to trace by reading\n>   code, and that fail at startup in production rather than at compile time.\n> - **Over-abstracting stable dependencies.** You are not going to swap out the standard\n>   library's date type.\n> - **⚠️ Service Locator is not DI.** It hides dependencies inside the implementation\n>   rather than declaring them in the signature, and it is widely regarded as an\n>   anti-pattern for that reason.\n\n**[DURABLE] The pragmatic default: constructor injection, plain, no framework, until the\nobject graph is large enough to genuinely hurt.** Introduce an interface when you have a\nsecond implementation or a real seam — not speculatively.\n",{"name":5,"description":7},"develop","ae32736a1aabddabca5d2c96d665aa0ebc7d8700","src\u002Fvibey_tools\u002Fskills\u002Fplugins\u002Fdesign-patterns\u002Fskills\u002Fpatterns-foundations-gof-and-alternatives",3,"https:\u002F\u002Fgithub.com\u002Fthe-vibey-project\u002Fvibey","https:\u002F\u002Fthe-vibey-project.github.io\u002Fvibey\u002F","https:\u002F\u002Fgithub.com\u002Fthe-vibey-project","https:\u002F\u002Fvibewithadam.matthewsteinberger.com","freedom for software engineers","2026-11-15 05:47:42",{"source":8,"skillName":5,"commands":35,"prompt":45,"zipAvailable":46},[36,39,42],{"tool":37,"command":38},"npx","npx skills add the-vibey-project\u002Fvibey --skill patterns-foundations-gof-and-alternatives",{"tool":40,"command":41},"bunx","bunx skills add the-vibey-project\u002Fvibey --skill patterns-foundations-gof-and-alternatives",{"tool":43,"command":44},"pnpm","pnpm dlx skills add the-vibey-project\u002Fvibey --skill patterns-foundations-gof-and-alternatives","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fthe-vibey-project\u002Fvibey\u002Fblob\u002Fdevelop\u002Fsrc\u002Fvibey_tools\u002Fskills\u002Fplugins\u002Fdesign-patterns\u002Fskills\u002Fpatterns-foundations-gof-and-alternatives\u002FSKILL.md",true,[],[49,56,63,70,77,84],{"skillNo":50,"name":51,"nameZh":6,"description":52,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":53,"categories":54,"keywords":55,"publishedAt":19},"01M7AT1FQJAE1FQYAMDTF490Y4","white-paper-writing","Use when writing white papers, technical reports, policy documents, thought leadership pieces, or any long-form authoritative document. Triggers on requests to write, structure, outline, or review white papers, technical reports, position papers, policy briefs, or evidence-driven arguments. Also use for B2B content marketing strategy, technical documentation requiring authority, academic-style reports, or any document that must educate while persuading. Use when someone asks \"how should I structure this\" for a long-form document.","https:\u002F\u002Fgithub.com\u002Fthe-vibey-project\u002Fvibey\u002Fblob\u002Fdevelop\u002Fsrc\u002Fvibey_tools\u002Fskills\u002Fplugins\u002Fwriting-craft\u002Fskills\u002Fwhite-paper-writing\u002FSKILL.md",[],[],{"skillNo":57,"name":58,"nameZh":6,"description":59,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":60,"categories":61,"keywords":62,"publishedAt":19},"01M7AT16BJRJJKK2MASXRZS76G","prose-technical-mechanics","Use when editing or writing prose at a technical\u002Fmechanical level: choosing between Anglo-Saxon and Latinate diction, placing information in topic vs stress positions, writing periodic vs cumulative sentences, handling sentence rhythm, punctuation as logic, transitions, paragraph structure, or phonesthetics. Use when someone wants to understand WHY prose works or doesn't, not just surface-level style advice. Triggers on word choice, sentence structure, emphasis, rhythm, diction, or any deep writing mechanics question.","https:\u002F\u002Fgithub.com\u002Fthe-vibey-project\u002Fvibey\u002Fblob\u002Fdevelop\u002Fsrc\u002Fvibey_tools\u002Fskills\u002Fplugins\u002Fwriting-craft\u002Fskills\u002Fprose-technical-mechanics\u002FSKILL.md",[],[],{"skillNo":64,"name":65,"nameZh":6,"description":66,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":67,"categories":68,"keywords":69,"publishedAt":19},"01M7AT0W9HT0ZZ9Y287NW99MR3","prose-mechanics","Use when writing, editing, or analyzing prose style; when trying to avoid generic AI-sounding writing; when applying specific prose styles such as journalistic, academic, narrative, KJV biblical, Hemingway plain, Latinate\u002FJamesian, Orwellian, Augustan, Victorian, Early Modern (Bacon, Browne, Milton), or free indirect discourse; or when coaching someone on writing voice and mechanics. Triggers on any request to improve, analyze, or write in a specific prose style, to fix \"AI-sounding\" writing, to make prose more vivid or concrete, to vary sentence rhythm, or to understand how a particular writer achieves their effects.","https:\u002F\u002Fgithub.com\u002Fthe-vibey-project\u002Fvibey\u002Fblob\u002Fdevelop\u002Fsrc\u002Fvibey_tools\u002Fskills\u002Fplugins\u002Fwriting-craft\u002Fskills\u002Fprose-mechanics\u002FSKILL.md",[],[],{"skillNo":71,"name":72,"nameZh":6,"description":73,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":74,"categories":75,"keywords":76,"publishedAt":19},"01M7AT0KR635JX66X2X6F3E2CP","narrative-structure","Use when structuring stories, pitches, presentations, white papers, or any persuasive narrative; analyzing the hero's journey in fiction or non-fiction; applying StoryBrand for business communication; designing narrative arcs for thought leadership; or understanding Vogler, Snyder, Propp, or Campbell frameworks. Triggers on any narrative structure, storytelling, pitch structure, StoryBrand, hero's journey, three-act structure, Freytag, Save the Cat, narrative arc, or \"how should I structure this story\u002Fpitch\u002Fpresentation\" request.","https:\u002F\u002Fgithub.com\u002Fthe-vibey-project\u002Fvibey\u002Fblob\u002Fdevelop\u002Fsrc\u002Fvibey_tools\u002Fskills\u002Fplugins\u002Fwriting-craft\u002Fskills\u002Fnarrative-structure\u002FSKILL.md",[],[],{"skillNo":78,"name":79,"nameZh":6,"description":80,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":81,"categories":82,"keywords":83,"publishedAt":19},"01M7AT0AKGW09NKKZDYBT8VRDE","legal-brief-writing","Use when writing legal briefs, motions, or any court filing; when analyzing judicial cognition and persuasion; when applying elite brief-writing techniques from Roberts, Clement, Kagan, Garner; or when structuring legal arguments for maximum persuasion. Also use for autistic\u002Fneurodivergent advocates who need to understand how their natural communication style maps to elite legal advocacy. Triggers on any legal writing, brief drafting, motion preparation, or legal argument structuring request.","https:\u002F\u002Fgithub.com\u002Fthe-vibey-project\u002Fvibey\u002Fblob\u002Fdevelop\u002Fsrc\u002Fvibey_tools\u002Fskills\u002Fplugins\u002Fwriting-craft\u002Fskills\u002Flegal-brief-writing\u002FSKILL.md",[],[],{"skillNo":85,"name":86,"nameZh":6,"description":87,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":88,"categories":89,"keywords":90,"publishedAt":19},"01M7AT00VWPS4Q8B5VEMXX9NQT","journal-publishability-criteria","Use whenever a research paper, article or preprint is being written, revised, reviewed or published, and specifically before every publication of docs\u002Fpaper.md. Covers what legitimate journals actually gate on, in order of gating — the editor's desk screen (scope, novelty, package problems), what reviewers judge (methodological soundness, claims the evidence can carry, statistical and qualitative reporting), EQUATOR reporting guidelines, the ICMJE authorship criteria, COPE's view of text recycling, the near-universal generative-AI policy (no AI author, disclosure, author responsibility), TOP 2025 transparency standards, how to verify a journal is legitimate, submitting without an institution, and a pre-submission checklist. Triggers on requests to evaluate, review, prepare or submit a paper, to judge publishability, to write a declarations or data-availability section, to disclose AI use, or to check a journal.","https:\u002F\u002Fgithub.com\u002Fthe-vibey-project\u002Fvibey\u002Fblob\u002Fdevelop\u002Fsrc\u002Fvibey_tools\u002Fskills\u002Fplugins\u002Fwriting-craft\u002Fskills\u002Fjournal-publishability-criteria\u002FSKILL.md",[],[]]