johnnystefan/test-saas-business/pattern-mediator

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 Mediator behavioral design pattern — reducing direct dependencies between objects by forcing them to communicate only through a mediator. Trigger: When decoupling tightly coupled components or implementing event buses.

Install

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

SKILL.md

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

Skill: Implement Mediator Pattern

Purpose

Reduces chaotic dependencies between objects by forcing them to collaborate only through a mediator object.

Procedural Instructions

  1. Identify Coupled Classes: Look for components that frequently call each other directly.
  2. Declare Mediator Interface: Define a notify() method that components use to report events.
  3. Implement Concrete Mediator: Centralize coordination logic. It stores references to all components and directs traffic between them.
  4. Update Components: Components must only talk to the mediator, not to each other.

TypeScript Example

typescript
interface Mediator {
notify(sender: object, event: string): void;
}
class Dialog implements Mediator {
constructor(
private button: Button,
private textbox: Textbox,
) {
this.button.setMediator(this);
}
notify(sender: object, event: string) {
if (event === 'click') {
/* Coordination logic here */
}
}
}
class Button {
private mediator!: Mediator;
setMediator(m: Mediator) {
this.mediator = m;
}
click() {
this.mediator.notify(this, 'click');
}
}

Payoff

  • Reusability: Individual components become easier to reuse as they are no longer tied to specific peers.
  • SRP: Coordination logic is consolidated into one place.

Security

  • Security scanPassed, 90 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-mediator/badge)](https://verified-skill.com/skills/johnnystefan/test-saas-business/pattern-mediator)

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