guru-patterns-creational

Document creational design patterns with Python code examples.

1|Updated Dec 22, 2025
One-click install
npx skills add https://github.com/CybLow/pypaginate --skill guru-patterns-creational
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: guru-patterns-creational
Source: https://github.com/CybLow/pypaginate/tree/main/.opencode/skills/guru-patterns-creational
Command: npx skills add https://github.com/CybLow/pypaginate --skill guru-patterns-creational

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Organize and reuse object-creation logic by isolating the construction of objects behind standardized patterns, reducing coupling and increasing flexibility.

Core Features & Use Cases

  • Factory Method, Abstract Factory, Builder, Prototype, and Singleton: provide structured mechanisms for object creation and lifecycle management.
  • Use cases include library/framework design, scalable systems, and scenarios requiring interchangeable product families or customizable construction processes.
  • Clear decision guidance on when to apply each pattern, with practical Python examples and trade-offs.

Quick Start

Create a simple factory where a base creator defines an interface and subclasses decide which product to instantiate.

Frequently Asked Questions about guru-patterns-creational

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

FAQPage Schema
How do I decouple object creation logic from usage in Python?

To decouple object creation from usage in Python, apply creational design patterns like Factory Method or Builder, which isolate construction behind standardized interfaces to reduce coupling and increase flexibility. This skill documents these patterns with structured Python examples.

What is the difference between Factory Method and Abstract Factory for interchangeable product families?

Factory Method lets subclasses decide which concrete product to instantiate, while Abstract Factory provides an interface for creating families of related or dependent objects without specifying concrete classes. This skill provides structured problem and solution examples for both Python approaches.

When should I use the Prototype or Builder pattern for flexible construction?

Use the Prototype pattern when runtime type selection requires cloning existing objects, and use the Builder pattern to construct complex objects step by step. This skill articulates their intents, pros, cons, and trade-offs to guide your decision.

How do I implement a Singleton for object lifecycle management in Python?

Implement a Singleton in Python by restricting instantiation to a single instance for centralized object lifecycle management. This skill provides concrete Python code blocks illustrating the Singleton pattern alongside other creational mechanisms.

Does this skill provide trade-offs and decision guidance for creational patterns in library design?

Yes, the skill provides decision guidance on when to apply each creational pattern in library and framework design. It articulates pattern intents, pros, cons, and trade-offs with practical Python examples for scalable systems.