fede0089

gof-design-patterns

Language-agnostic guidance for selecting and applying Gang of Four (GoF) design patterns to recurring object-oriented design problems. Use when deciding among design alternatives, evaluating applicability and tradeoffs, or refactoring rigid/conditional-heavy designs toward better extensibility and lower coupling. Do not use for trivial bug fixes, framework/tool setup, or tasks with no architectural decision. Any TypeScript examples are illustrative only and must be translated to the project's language and constraints.

fede0089 0 Updated 3mo ago

Resources

2
GitHub

Install

npx skillscat add fede0089/agents-skills/gof-design-patterns

Install via the SkillsCat registry.

SKILL.md

GoF Design Patterns

Goal

  • Choose the simplest design that solves the real change pressure.
  • Select one primary pattern (two only if responsibilities are clearly split).
  • Keep recommendations language-agnostic and explicit about tradeoffs.
  • Support coding tasks with pattern-aligned implementation guidance.

Simple Workflow

  1. Capture context with three questions: what changes often, what hurts now, and which constraint dominates.
  2. Shortlist up to three candidates using references/DECISION_FRAMEWORK.md (canonical source). Use references/CATALOG.md only for quick intent lookup.
  3. Select one pattern (or do not use a pattern) based on future change-cost reduction and lower indirection.
  4. If the task includes code changes, always read both:
  • references/pattern-<selected-pattern>.md
  • scripts/<selected-pattern>.ts (illustrative reference only)
  1. Apply the design incrementally, adapted to the project language and constraints.
  2. Validate with references/PITFALLS.md, then run a final quality/activation self-check with references/TESTS.md, and format the answer with references/OUTPUT_TEMPLATES.md.

Core Rules

  • Language first: choose by problem forces and context, not by language syntax.
  • Simplicity first: if recurring change pressure is weak, explicitly recommend do not use a pattern.
  • Script policy: scripts are examples to read and adapt, not mandatory to execute.

Output Contract

  • Always provide an explicit decision.
  • Always include one simpler alternative and why it was rejected.
  • Always include tradeoffs (Pros and Cons).
  • If code is shown, include a short adaptation note for other languages.

Navigation

Core References

Pattern Cards