design-patterns

Map GoF design patterns to code smells with Python before/after examples.

Updated Apr 17, 2026
One-click install
npx skills add https://github.com/nullhack/pytest-beehave --skill design-patterns-nullhack
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: design-patterns
Source: https://github.com/nullhack/pytest-beehave/tree/main/.opencode/skills/design-patterns
Command: npx skills add https://github.com/nullhack/pytest-beehave --skill design-patterns-nullhack

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

GoF design pattern reference with Python before/after examples to help guide refactors and teach pattern-aware coding.

Core Features & Use Cases

  • Catalogs GoF creational, structural, and behavioral patterns with practical Python samples.
  • Maps code smells to suitable patterns and demonstrates concrete before/after transformations.
  • Useful for learning, planning, and executing pattern-based refactors in Python projects.

Quick Start

Identify a GoF pattern based on the code smell and apply the corresponding before/after example to refactor your Python code.

Frequently Asked Questions about design-patterns

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I identify which GoF design pattern to use for refactoring Python code smells?▼

To refactor Python code smells, identify the matching GoF design pattern from a catalog mapping creational, structural, or behavioral smells to patterns, then apply the corresponding before/after example to transform your code.

What are common Python code smells that GoF design patterns can fix?▼

Common Python code smells that GoF design patterns can fix include creational, structural, and behavioral anti-patterns. The catalog maps specific smells to suitable patterns and provides concrete before/after transformations to guide your refactoring.

How do I refactor Python code using before and after design pattern examples?▼

Refactor Python code by selecting a GoF design pattern matching your code smell and applying the before/after example. The catalog demonstrates concrete transformations for creational, structural, and behavioral patterns to guide pattern-based refactors.

Can I use GoF design patterns to fix both structural and behavioral code smells in Python?▼

Yes, GoF design patterns can fix both structural and behavioral code smells in Python. The catalog organizes creational, structural, and behavioral patterns with smell references and supplies concrete before/after transformation guidance for refactoring.

What is the best way to learn pattern-aware coding in Python?▼

The best way to learn pattern-aware coding in Python is to study a catalog of GoF creational, structural, and behavioral patterns with practical before/after samples that map code smells to suitable patterns for planning and executing refactors.

Do I need any external libraries to apply GoF design patterns in Python?▼

No external libraries are required to apply GoF design patterns in Python. The reference catalog provides practical Python samples and before/after examples that can be applied directly to Python projects when refactoring creational, structural, or behavioral patterns.