# Strategy Pattern

> Use the Strategy pattern when you have multiple algorithms for the same task and want to select o... Use when designing system architecture. Architecture category skill.

- Skill: `majiayu000/strategy-pattern` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds@latest add majiayu000/strategy-pattern`
- Raw SKILL.md: https://api.skillmd.com/api/skills/majiayu000/strategy-pattern/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Productivity
- Author: majiayu000 (https://skillmd.com/u/majiayu000)
- Updated: 2026-09-21
- Page: https://skillmd.com/skills/majiayu000/strategy-pattern

---


# Strategy Pattern

Use the Strategy pattern when you have multiple algorithms for the same task and want to select one at runtime. Instead of complex if/else chains, define a common interface and implement it with different strategies. This enables adding new behaviors without modifying existing code. Common uses: payment processors, shipping calculators, validation rules.
