pattern-factory-method

Community

Decouple object creation with flexible factories

Authorjohnnystefan
Version1.0.0
Installs0

System Documentation

What problem does it solve?

This Skill teaches the Factory Method pattern to separate concrete class instantiation from clients, preventing rigid dependencies when domain objects like BusinessUnit or Membership require validation before creation.

Core Features & Use Cases

  • Direct instantiation detection: Highlights spots with new ConcreteClass() calls that should be routed through a creator.
  • Product interface definition: Ensures all products implement a shared contract so callers can remain agnostic to concrete types.
  • Concrete creators: Builds subclasses that override the factory method to return specific domain entities while encapsulating construction logic.

Quick Start

Ask the skill to refactor Membership.create() so the domain entity is produced through a Factory Method that validates invariants first.

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

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.