behavioural

Identify and apply behavioural design patterns with code templates and rationale.

1|1|Updated Mar 30, 2026
One-click install
npx skills add https://github.com/Entelligentsia/skillforge --skill behavioural
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: behavioural
Source: https://github.com/Entelligentsia/skillforge/tree/main/design-patterns/skills/behavioural
Command: npx skills add https://github.com/Entelligentsia/skillforge --skill behavioural

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Behavioural design patterns address scenarios where an object's behavior varies across contexts, or where the system needs to react to events without tight coupling. They provide a structured approach to decouple responsibilities and to compose interaction chains that are easier to extend and test.

Core Features & Use Cases

  • Covers all 10 GoF behavioural patterns: Chain of Responsibility, Command, Strategy, State, Observer, Memento, Mediator, Visitor, Iterator, and Template Method.
  • Helps teams decide when to apply a pattern, with practical contexts such as middleware pipelines, event-driven updates, undo/redo capabilities, and complex object collaborations.
  • Provides rationale and templates to reason about trade-offs, side effects, and maintenance.

Quick Start

Identify a stateful interaction in your codebase and implement the appropriate behavioural pattern with a small, replaceable component.

Frequently Asked Questions about behavioural

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
What are behavioural design patterns used for in software design?

Behavioural design patterns are used to decouple object interactions and manage varying behavior across contexts. They provide structured templates to coordinate responsibilities, enabling systems to react to events without tight coupling.

How do I choose the right behavioural pattern for a stateful component?

Choosing the right behavioural pattern for a stateful component involves evaluating interaction needs: State manages internal state transitions, Strategy swaps algorithms, and Observer handles event-driven updates. Rationale and trade-offs help guide the selection.

How do I decouple middleware chains without tight object dependencies?

To decouple middleware chains without tight object dependencies, apply the Chain of Responsibility pattern. It structures processing pipelines into small, replaceable components that pass requests sequentially, making the interaction chains easier to extend and test.

When should I use the Command pattern over the Strategy pattern?

Use the Command pattern over the Strategy pattern when you need to encapsulate requests as objects for undo/redo capabilities or queuing. Use Strategy when you need to swap algorithms dynamically within a single context without altering the structure.

Does this cover all GoF behavioural patterns like Mediator and Visitor?

Yes, this covers all 10 GoF behavioural patterns including Mediator, Visitor, Chain of Responsibility, Command, Strategy, State, Observer, Memento, Iterator, and Template Method. It provides code templates and rationale for each.

What are the limitations of behavioural design patterns in object-oriented architectures?

Limitations of behavioural design patterns include potential over-engineering for simple interactions and added complexity from indirection layers. Maintenance trade-offs and side effects must be evaluated to ensure the decoupling benefits justify the structural overhead.