Skills DirectorySkills Directory
SkillsLearnSecurityCategoriesDocsBlogPro
Sign InSubmit Skill
Skills Directory

Security-tested agent skills for Claude, coding agents, and AI workflows.

Directory

  • Browse Skills
  • All Skills A–Z
  • Claude Skills
  • Claude Code Skills
  • Agent Skills
  • Categories
  • Authors
  • Submit a Skill

Learn

  • Learn Hub
  • Install Claude Skills
  • Write SKILL.md
  • Skills vs MCP
  • Directories Compared

Security

  • Security
  • Methodology
  • Secure Claude Skills
  • Security Badges
  • Chrome Extension
  • Skill Manager

Company

  • About
  • Community
  • Blog
  • API Docs
  • Advertise

2026 Skills Directory. All rights reserved.

ProTermsPrivacyRefunds
Back to skills

Design Patterns Pro

ASecurity

Apply classic design patterns judiciously: when each pattern fits, modern alternatives, and anti-patterns. Use when designing object interactions or reviewing pattern usage.

2 stars
0 votes
0 copies
1 views
Added 9/29/2026
ai-agentspythongoreactexpressrefactoringapi

Works with

api

Security Analysis

A100/100

Scanned 9/29/2026

$npx -y skills add aicodedecode/awesome-muse-skills --skill design-patterns-pro --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Design Patterns Pro?

Add the live security badge to your README — it updates automatically with every re-scan.

Security grade badge for Design Patterns Pro
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/aicodedecode-design-patterns-pro/badge)](https://www.skillsdirectory.com/skills/aicodedecode-design-patterns-pro)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
Files
SKILL.md
---
name: design-patterns-pro
description: Apply classic design patterns judiciously: when each pattern fits, modern alternatives, and anti-patterns. Use when designing object interactions or reviewing pattern usage.
category: development
---

# Design Patterns Pro

## Overview

Design patterns are **a shared vocabulary for recurring design problems** — not a checklist to
apply. The professional skill isn't knowing 23 patterns; it's recognizing which problem you have,
picking the simplest pattern that solves it, and knowing when modern language features made a
pattern unnecessary.

The through-line: patterns serve the design — if you're contorting code to fit a pattern, you have
it backwards.

## When to use

- Designing how objects collaborate in unfamiliar code.
- Reviewing code for pattern misuse or over-engineering.
- Naming a design ("this is basically Observer") to communicate it.
- Refactoring toward a cleaner structure with a known shape.
- Learning to see past pattern names to the underlying forces.

## Core concepts

- **Patterns by purpose.** Creational (how objects are made: Factory, Builder, Singleton —
  Singleton almost always wrong), Structural (how objects compose: Adapter, Decorator, Facade,
  Composite), Behavioral (how objects interact: Observer, Strategy, Command, State, Template
  Method). Classify the *problem* first; the pattern follows.
- **The essential dozen (modern take).**
  - *Strategy* — interchangeable algorithms (sorting, pricing rules); often just functions/lambdas now.
  - *Observer* — subscribe/notify; language-level in reactive frameworks, event emitters elsewhere.
  - *Decorator* — layered behavior (middleware, Python decorators); prefer composition.
  - *Adapter* — translate interfaces at boundaries (anti-corruption layers).
  - *Facade* — simplify a subsystem's interface for common use.
  - *Factory* — when construction logic is non-trivial (parsing, DI containers); not for every `new`.
  - *Builder* — complex objects with many optional parts (fluent APIs, test fixtures).
  - *Command* — operations as objects (undo, queues, scheduling).
  - *State* — behavior varying by state; often replaceable by state machines or polymorphism.
  - *Template Method* — skeleton algorithm with hooks; often better as composition + strategy now.
  - *Composite* — tree structures treated uniformly (UI trees, file systems).
  - *Repository* — collection-like abstraction over persistence (a DDD staple).
- **Patterns dissolved by language features.** Strategy → first-class functions; Observer →
  signals/reactive primitives; Singleton → DI containers or modules; Visitor → pattern matching;
  Iterator → for-of/generators. Modern languages absorbed many GoF patterns — use the feature,
  not the ceremony.
- **Composition over inheritance.** The meta-pattern behind half the catalog: prefer composing
  small behaviors over deep hierarchies. Most pattern misuse is inheritance where composition fit.

## Practical workflow

1. **Name the problem, not the pattern.** "We need to swap pricing algorithms at runtime" —
   that's the requirement. *Then* notice it's Strategy-shaped.
2. **Start with the simplest thing.** Functions before Strategy objects; a conditional before a
   State hierarchy; direct calls before Observer. Introduce the pattern at the *second* or *third*
   occurrence of the need.
3. **Apply minimally.** Implement the pattern's essence, not its UML diagram. A Strategy can be
   a function parameter — it doesn't need an abstract class and three subclasses on day one.
4. **Check the modern alternative.** Could a lambda, a match expression, or a framework primitive
   do this with less machinery? If yes, do that.
5. **Name it when you use it.** If the design genuinely is Observer, say so in code/docs — the
   shared vocabulary is the point. Future readers pattern-match on names.
6. **Review for pattern abuse.** AbstractFactoryFactory energy: patterns stacked on patterns,
   speculative generality ("we might need more strategies later"), and patterns applied where a
   plain function sufficed.

Pattern selection guide:

```text
Varying algorithm at runtime      → Strategy (or just a function parameter)
Reacting to state changes         → Observer / signals / events
Adding behavior transparently     → Decorator (middleware, wrappers)
Incompatible interfaces           → Adapter (at system boundaries)
Complex construction              → Builder (many optionals) / Factory (non-trivial creation)
Undoable/queueable operations     → Command
Behavior depends on state         → State (or explicit state machine)
Tree structures                   → Composite
Simplifying a subsystem           → Facade
```

## Common pitfalls

- **Pattern-first design.** "Let's use Abstract Factory here" before understanding the problem.
  Patterns are solutions looking for problems — make sure you have the problem first.
- **Over-engineering via patterns.** Full GoF ceremony for one variation that an `if` or function
  parameter would handle. YAGNI applies to patterns too.
- **Singleton abuse.** Global mutable state with a fancy name — untestable, hidden coupling.
  DI, modules, or explicit parameters instead. (True singletons: rare — loggers, maybe.)
- **Inheritance-heavy patterns.** Template Method hierarchies five deep, fragile base classes.
  Composition-based alternatives (strategy injection, hooks) are almost always more flexible.
- **Ignoring language features.** Hand-rolled Observer with manual subscription lists in a
  signals-based framework; Visitor pattern where pattern matching exists. Use the language.
- **Pattern names as thought-terminating.** "It's a Factory, don't question it" — the name should
  *start* the design conversation (does it fit? is it minimal?), not end it.
- **Not refactoring toward patterns.** The flip side: duplicated conditionals that *scream*
  Strategy/State, left to rot because "patterns are over-engineering." Let the need emerge, then
  name and apply the pattern cleanly.

Attribution

aicodedecodeaicodedecode
View sourceSee grades on GitHubMore from aicodedecode →
SSkills DirectorySkills Directory

Ship a skill? Prove it's safe.

Free 120-pattern security scan, letter grade, and an embeddable README badge.

Submit a skill

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments (0)

No comments yet. Be the first to comment!

SSkills DirectorySkills Directory

Ship a skill? Prove it's safe.

Free 120-pattern security scan, letter grade, and an embeddable README badge.

Submit a skill

Related Skills

Caveman

Terse caveman voice: answer first, fluff gone, every technical fact kept. Use for /caveman, "caveman mode", "talk like caveman", "be brief", "less tokens". Stays on until "stop caveman" or "normal mode".

1100021 votes

Hyperplan

Adversarial multi-agent planning skill. Self-orchestrates 5 hostile category members (unspecified-low, unspecified-high, deep, ultrabrain, artistry) via team-mode for ruthless cross-critique debate, distills only the defensible insights, then MANDATORILY hands the distilled insight bundle to the `plan` agent for executable plan formalization. Use when planning needs maximum rigor and surfacing of weak assumptions, blind spots, and over-engineering. Triggers: 'hyperplan', 'hpp', '/hyperplan', ...

698621 votes

Writing Skills

Create and manage Claude Code skills in HASH repository following Anthropic best practices. Use when creating new skills, modifying skill-rules.json, understanding trigger patterns, working with hooks, debugging skill activation, or implementing progressive disclosure. Covers skill structure, YAML frontmatter, trigger types (keywords, intent patterns), UserPromptSubmit hook, and the 500-line rule. Includes validation and debugging with SKILL_DEBUG. Examples include rust-error-stack, cargo-dep...

3931 votes

Mcp Code Execution

Routes multi-tool workflows through MCP servers for large datasets and pipelines. Use when Bash tool overhead is limiting throughput on data-heavy tasks.

3421 votes

catchup

Recovers the conversation and failed tool calls of a previous Codex, Amp, Claude Code, Antigravity, Cline, Copilot CLI, Cursor, DeepSeek Harness, Grok Build, Kimi, OpenCode, Pi Agent, or ZCode session. Use when the user says "catch up", "what did the last session do", "get me up to speed", "I switched agents", asks to recover/summarize a previous session before continuing, or asks to diagnose or report a catchup failure. Do NOT use for the current conversation, git history, or any non-agent log.

741 votes
View all in ai-agents →