johnnystefan/test-saas-business/pattern-strategy

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 Strategy behavioral design pattern — defining a family of algorithms, encapsulating each one, and making them interchangeable at runtime. Trigger: When implementing interchangeable algorithms, sorting strategies, or payment methods.

Install

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

SKILL.md

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

Skill: Implement Strategy Pattern

Purpose

Defines a family of algorithms, encapsulates each one, and makes them interchangeable. Strategy lets the algorithm vary independently from clients that use it.

Procedural Instructions

  1. Identify Variant Algorithms: Look for a class that performs a task in multiple different ways.
  2. Declare Strategy Interface: Define a common method for executing the algorithm.
  3. Implement Concrete Strategies: Place each variation of the algorithm into its own class.
  4. Update Context: The original class stores a reference to a Strategy and delegates work to it.
  5. Set Strategy at Runtime: Provide a setter in the Context so the client can swap strategies.

TypeScript Example

typescript
interface RouteStrategy {
buildRoute(a: string, b: string): void;
}
class WalkingStrategy implements RouteStrategy {
buildRoute(a: string, b: string) {
console.log('Walking route...');
}
}
class Navigator {
// Context
private strategy!: RouteStrategy;
setStrategy(s: RouteStrategy) {
this.strategy = s;
}
calculate(a: string, b: string) {
this.strategy.buildRoute(a, b);
}
}

Payoff

  • Flexibility: Switch algorithms used inside an object at runtime.
  • Isolation: Separates the implementation details of an algorithm from the code that uses it.

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

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

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