pattern-decorator

Community

Add runtime behaviors by wrapping objects

Authorjohnnystefan
Version1.0.0
Installs0

System Documentation

What problem does it solve?

The decorator pattern skill keeps you from modifying existing classes when new behaviors are needed, letting you compose responsibilities with runtime wrappers and preserving the original component contracts.

Core Features & Use Cases

  • Flexible Behavior Composition: Create decorator classes that wrap a core component and add logging, caching, retries, or metrics without altering the wrapped implementation.
  • Shared Interface Contract: Define a common interface so both the base object and decorators can be used interchangeably throughout the application.
  • Use Case: Wrap a PrismaRepository with CachedRepository and then layer LoggedUseCase to add caching and observability around a NestJS provider while keeping the provider code untouched.

Quick Start

Use the decorator pattern skill to wrap a notifier when you need to add logging without modifying the notifier class.

Dependency Matrix

Required Modules

None required

Components

Standard package

💻 Claude Code Installation

Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.

Please help me install this Skill:
Name: pattern-decorator
Download link: https://github.com/johnnystefan/test-saas-business/archive/main.zip#pattern-decorator

Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
View Source Repository

Agent Skills Search Helper

Install a tiny helper to your Agent, search and equip skill from 471,000+ vetted skills library on demand.