No slash command · from code-foundations
Maps code symptoms (subclass explosion, switch-on-type dispatch, tangled construction) to the matching Gang of Four pattern and loads its structural recipe from 23 reference files.
Ships in code-foundations. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
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.
references/foundations.md (opens in a new tab)references/gof-abstract-factory.md (opens in a new tab)references/gof-adapter.md (opens in a new tab)references/gof-bridge.md (opens in a new tab)references/gof-builder.md (opens in a new tab)references/gof-chain-of-responsibility.md (opens in a new tab)references/gof-command.md (opens in a new tab)references/gof-composite.md (opens in a new tab)references/gof-decorator.md (opens in a new tab)references/gof-facade.md (opens in a new tab)references/gof-factory-method.md (opens in a new tab)references/gof-flyweight.md (opens in a new tab)references/gof-interpreter.md (opens in a new tab)references/gof-iterator.md (opens in a new tab)references/gof-mediator.md (opens in a new tab)references/gof-memento.md (opens in a new tab)references/gof-observer.md (opens in a new tab)references/gof-prototype.md (opens in a new tab)references/gof-proxy.md (opens in a new tab)references/gof-singleton.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Generated from the plugin's indexed repository (ryanthedev/code-foundations) — no native marketplace selected
npx claudepluginhub p/ryanthedev-code-foundations20 skills in this plugin
/aposd-designing-deep-modulesGuides module and API design using APOSD principles: generates multiple design alternatives, compares them on information hiding and interface depth, and produces a documented design decision. For creating new module/API design; not for assessing existing designs (use aposd-reviewing-module-design) or routine-level design (use cc-routine-and-class-design)./aposd-reviewing-module-designAssesses existing module and interface design for complexity symptoms: information leakage, shallow interfaces, pass-through layers, and unknown unknowns. Produces a structured assessment — not transformations (use aposd-simplifying-complexity to edit) and not new-design generation (use aposd-designing-deep-modules)./aposd-simplifying-complexityTransforms complex code by applying APOSD's pull-complexity-downward principle: resolves error hierarchies, collapses configuration, and moves caller-side logic into modules. Produces edited code; not for assessment-only review (use aposd-reviewing-module-design) or designing new modules from scratch (use aposd-designing-deep-modules)./aposd-verifying-correctnessVerifies implementation completeness across functional correctness, error handling, concurrency, and security dimensions using APOSD's post-implementation checklist. Run after a coding task is nominally complete, not during active bug investigation (use cc-debugging)./ca-architecture-boundariesApplies Clean Architecture's dependency-direction and SRP-by-actor rules to system-level boundary design: separates business logic from infrastructure, identifies actor-coupling risks, and enforces inward-pointing dependency arrows. For system scope (multiple components, layers, or services), not routine or module scope (use cc-routine-and-class-design)./cc-control-flow-qualityAudits and restructures control flow using Code Complete's nesting, cyclomatic complexity, loop design, guard-clause, and boolean simplification rules. Covers deep nesting, loop exit design, index naming, and callback chains. For statement-level flow inside a routine; not for routine/class structure (use cc-routine-and-class-design) or staging a broader refactor (use cc-refactoring-guidance).Other plugins' skills for the same job