johnnystefan/test-saas-business/factory-method
Claude Code and agent skill by johnnystefan/test-saas-business
- community
Checking that the SKILL.md file is still in the repository.
Teaches and applies the Factory Method creational design pattern — providing an interface for creating objects in a superclass, allowing subclasses to decide which class to instantiate. Trigger: When decoupling object creation from usage or implementing extensible creation logic.
Install
npx vskill@latest install johnnystefan/test-saas-business/factory-methodSKILL.md
The same SKILL.md was published earlier as johnnystefan/test-saas-business/factory-method.
Skill: Implement Factory Method Pattern
Purpose
Provides an interface for creating objects in a superclass but allows subclasses to alter the type of objects that will be created. It decouples the business logic from the concrete classes it needs to instantiate.
Procedural Instructions
- Identify Direct Instantiation: Look for
new ConcreteClass()calls that make the code rigid. - Define Product Interface: Ensure all products follow a common interface.
- Create Creator Class: Declare the factory method. It should return the product interface.
- Implement Subclasses: Create concrete creators that override the factory method to return specific instances of products.
TypeScript Example
Payoff
- OCP Compliance: You can introduce new types of products without breaking existing client code.
- SRP Compliance: Product creation code is localized in one place.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/design-patterns/creationals/factory-method/SKILL.md
Popularity
- 7-day trend score
- 5
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/johnnystefan/test-saas-business/factory-method)