johnnystefan/test-saas-business/pattern-command

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 Command behavioral design pattern — encapsulating requests as objects to support parameterization, queuing, logging, and undo/redo operations. Trigger: When implementing undoable operations, task queues, or action history.

Install

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

SKILL.md

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

Skill: Implement Command Pattern

Purpose

Turns a request into a stand-alone object that contains all information about the request. This allows for parameterizing methods, queuing requests, and supporting undoable operations.

Procedural Instructions

  1. Declare Command Interface: Define a single execution method, usually execute().
  2. Create Concrete Commands: Map UI elements or triggers to specific business logic (Receivers). Store parameters within the command object.
  3. Define Senders (Invokers): Senders should trigger the command without knowing what the command does or who the receiver is.
  4. Setup Receiver: The class that actually knows how to perform the operation.

TypeScript Example

typescript
interface Command {
execute(): void;
}
class Light {
// Receiver
turnOn() {
console.log('Light is ON');
}
}
class TurnOnCommand implements Command {
constructor(private light: Light) {}
execute() {
this.light.turnOn();
}
}
class RemoteControl {
// Invoker
private command!: Command;
setCommand(c: Command) {
this.command = c;
}
pressButton() {
this.command.execute();
}
}

Payoff

  • Undo/Redo: Commands can store state snapshots to reverse operations.
  • SRP: Decouples the object that invokes the operation from the one that knows how to perform it.

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

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