johnnystefan/test-saas-business/pattern-chain-of-responsibility

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 Chain of Responsibility behavioral design pattern — passing requests along a chain of handlers where each handler decides to process or forward. Trigger: When implementing request handling pipelines, middleware chains, or event propagation.

Install

npx vskill@latest install johnnystefan/test-saas-business/pattern-chain-of-responsibility

SKILL.md

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

Skill: Implement Chain of Responsibility Pattern

Purpose

Enables the agent to pass requests along a chain of handlers. Each handler decides either to process the request or pass it to the next handler in the chain.

Procedural Instructions

  1. Identify Sequential Checks: Look for code performing multiple validation or processing steps in a rigid order.
  2. Declare Handler Interface: Define a common method (e.g., handle()) for all steps.
  3. Create Base Handler: (Optional) Implement the default behavior of passing the request to the next handler.
  4. Implement Concrete Handlers: Each handler performs its specific check. It can stop the chain or call the parent to pass the request forward.
  5. Compose the Chain: Link handlers dynamically in the client code.

TypeScript Example

typescript
interface Handler {
setNext(handler: Handler): Handler;
handle(request: string): string | null;
}
abstract class AbstractHandler implements Handler {
private nextHandler: Handler | null = null;
public setNext(handler: Handler): Handler {
this.nextHandler = handler;
return handler;
}
public handle(request: string): string | null {
if (this.nextHandler) return this.nextHandler.handle(request);
return null;
}
}
class AuthHandler extends AbstractHandler {
public handle(request: string): string | null {
if (request === 'unauthorized') return 'Auth: Access denied.';
return super.handle(request);
}
}
class ValidationHandler extends AbstractHandler {
public handle(request: string): string | null {
if (request === 'invalid') return 'Validation: Data invalid.';
return super.handle(request);
}
}

Payoff

  • Decoupling: Decouples senders of requests from their receivers.
  • Flexibility: Handlers can be added or reordered at runtime without modifying client code.

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

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