pattern-strategy

Community

Switch algorithms on demand for flexible logic

Authorjohnnystefan
Version1.0.0
Installs0

System Documentation

What problem does it solve?

This skill prevents sprawling switch statements and rigid hard-coded algorithms by letting you encapsulate each behavior and swap it without touching client code.

Core Features & Use Cases

  • Identify Variant Algorithms: Recognize contexts where multiple behaviors such as sorting, payment, or validation need to coexist.
  • Define Strategy Interfaces: Establish a shared contract so every algorithm exposes the same execution method.
  • Context Delegation: Update the originating class to store and delegate to a Strategy instance, enabling runtime swapping per entity or membership tier.
  • Use Case: Implement alternative routing, billing, or validation flows in a tenant-aware backend by injecting different strategy implementations based on configuration.

Quick Start

Use the pattern-strategy skill to replace conditional logic with interchangeable payment validators at runtime.

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-strategy
Download link: https://github.com/johnnystefan/test-saas-business/archive/main.zip#pattern-strategy

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.