johnnystefan/test-saas-business/pattern-prototype

Claude Code and agent skill by johnnystefan/test-saas-business

Trust tier 3
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

Teaches and applies the Prototype creational design pattern — cloning existing objects without making code dependent on their classes, delegating cloning to the objects themselves. Trigger: When creating copies of complex objects or avoiding expensive re-initialization.

Install

npx vskill@latest install johnnystefan/test-saas-business/pattern-prototype

SKILL.md

The same SKILL.md was published earlier as johnnystefan/test-saas-business/pattern-prototype.

Skill: Implement Prototype Pattern

Purpose

Enables copying existing objects without making the code dependent on their classes. The cloning responsibility is delegated to the objects themselves.

Procedural Instructions

  1. Create Prototype Interface: Define a clone() method.
  2. Implement Clone in Classes: The class must instantiate itself and copy all field values (including private ones) to the new instance.
  3. Prototype Registry (Optional): A central place to store frequently used prototypes for easy cloning.

TypeScript Example

typescript
abstract class Shape {
constructor(
public x: number,
public y: number,
public color: string,
) {}
abstract clone(): Shape;
}
class Rectangle extends Shape {
constructor(source: Rectangle) {
super(source.x, source.y, source.color);
this.width = source.width;
}
public width: number = 0;
clone(): Shape {
return new Rectangle(this);
}
}

Payoff

  • Efficiency: Cloning is often cheaper than full initialization.
  • Abstraction: You can clone objects without knowing their specific types.

Security

  • Security scanPassed, 95 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

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
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/johnnystefan/test-saas-business/pattern-prototype/badge)](https://verified-skill.com/skills/johnnystefan/test-saas-business/pattern-prototype)

Something wrong with this skill or its page? Tell us.