@tank/design-patterns

Installation
SKILL.md

Design Patterns

Structural solutions for recurring problems in JavaScript and TypeScript applications.

Core Philosophy

  1. Patterns are tools, not goals. Apply a pattern to solve a specific problem. If the problem does not exist, the pattern is overhead.
  2. Favor composition over inheritance. JS/TS excels at object composition, closures, and higher-order functions. Most GoF inheritance hierarchies collapse into simpler functional forms.
  3. Match the pattern to the language. A Java-style Singleton is an anti-pattern in JS modules. Adapt patterns to closures, first-class functions, Proxies, and ES module scope.
  4. Prefer the simplest pattern that solves the problem. If a function suffices, do not introduce a class hierarchy. Escalate complexity only when requirements demand it.
  5. Name the pattern in your code. When you use a pattern, name it explicitly (e.g., UserFactory, RetryStrategy). This communicates intent to future readers.

Pattern Selection Decision Tree

Installs
–
GitHub Stars
1
First Seen
–
@tank/design-patterns — tankpkg/packages