advanced-design-patterns

Enforce SOLID principles and Gang of Four patterns in Unity systems.

71|11|Updated Jan 23, 2026
One-click install
npx skills add https://github.com/nlelouche/Unity-SkillForge --skill advanced-design-patterns-nlelouche
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: advanced-design-patterns
Source: https://github.com/nlelouche/Unity-SkillForge/tree/main/.agent/skills/01-architecture/advanced-design-patterns
Command: npx skills add https://github.com/nlelouche/Unity-SkillForge --skill advanced-design-patterns-nlelouche

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill transforms complex gameplay requirements into robust, modular, and maintainable Unity systems by enforcing architectural patterns and preventing common pitfalls.

Core Features & Use Cases

  • Pattern Implementation: Provides templates and guidance for Strategy, Factory, Observer, and Command patterns.
  • Refactoring: Helps break down "God Classes" and eliminate circular dependencies.
  • Use Case: When building an enemy AI system, use the Strategy pattern to easily swap between different behaviors like 'Patrol', 'Chase', and 'Flee' without modifying the core AI controller.

Quick Start

Use the advanced-design-patterns skill to generate a Strategy pattern for an 'EnemyBehavior' with the namespace 'Game.AI'.

Frequently Asked Questions about advanced-design-patterns

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

FAQPage Schema
How do I break down Unity God Classes and eliminate circular dependencies?

To break down Unity God Classes and eliminate circular dependencies, refactor your architecture by enforcing SOLID principles and decoupled event systems. This approach transforms complex gameplay requirements into modular, maintainable structures.

How do I implement the Strategy pattern for enemy AI in Unity?

Implement the Strategy pattern for Unity enemy AI by creating interchangeable behaviors like Patrol, Chase, and Flee. This decoupled approach allows swapping behaviors dynamically without modifying the core AI controller.

What's the best way to create an object pooling system in Unity?

The best way to create an object pooling system in Unity involves applying Gang of Four design patterns within the lifecycle. This ensures scalable architectures by reusing objects instead of instantiating and destroying them repeatedly.

How do I add undo and redo functionality to a Unity game?

Add undo and redo functionality to a Unity game by utilizing the Command design pattern. This pattern encapsulates actions as objects, enabling decoupled execution and state reversal for robust gameplay mechanics.

Do I need dependency injection to build scalable Unity architectures?

Yes, building scalable Unity architectures requires adherence to dependency injection practices. It enforces SOLID principles by decoupling object creation, resulting in interchangeable behaviors and maintainable systems.

When should I use the Observer pattern in Unity?

Use the Observer pattern in Unity to establish decoupled event systems. This prevents circular dependencies by allowing objects to subscribe to state changes without directly referencing the subject, maintaining modular design.