johnnystefan/test-saas-business/pattern-template-method

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 Template Method behavioral design pattern — defining the skeleton of an algorithm in a superclass while letting subclasses override specific steps. Trigger: When defining invariant algorithm structure with customizable steps in subclasses.

Install

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

SKILL.md

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

Skill: Implement Template Method Pattern

Purpose

Defines the skeleton of an algorithm in a superclass but lets subclasses override specific steps of the algorithm without changing its structure.

Procedural Instructions

  1. Identify Common Algorithm Structure: Look for classes with similar methods that follow the same sequence of steps.
  2. Define Abstract Superclass: Create a "template method" containing the sequence of calls to various steps.
  3. Declare Algorithm Steps: Define the individual steps as abstract methods (must override) or hooks (optional override).
  4. Implement Subclasses: Override the required steps to customize behavior.

TypeScript Example

typescript
abstract class DataMiner {
public mine() {
// Template Method
this.openFile();
this.extractData();
this.closeFile();
}
abstract openFile(): void;
abstract extractData(): void;
closeFile() {
console.log('File closed.');
} // Default impl
}
class PDFMiner extends DataMiner {
openFile() {
console.log('Opening PDF...');
}
extractData() {
console.log('Extracting PDF content...');
}
}

Payoff

  • Deduplication: Pulls duplicate code from subclasses into a single superclass.
  • Control: Subclasses can only override specific parts of a large algorithm, reducing risk.

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-template-method/badge)](https://verified-skill.com/skills/johnnystefan/test-saas-business/pattern-template-method)

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