Skip to content

MuharremTozan/Agentic-Duel / .agent/skills/unity-strategy-pattern

unity-strategy-pattern

Verified

Implements the Strategy Pattern to encapsulate interchangeable algorithms (e.g., Spells, Attacks) using ScriptableObjects. Allows hot-swapping behavior without modifying client code. Clean Code approach.

Unity Strategy Pattern

This skill implements the Strategy Behavioral Pattern to replace conditional logic (switches/ifs) with interchangeable algorithm objects.

Core Features

  1. Encapsulated Logic: Each behavior (Fireball, Shield, Orbital) lives in its own ScriptableObject or class.
  2. Hot-Swapping: Change an entity's behavior at runtime by swapping the strategy asset.
  3. Open/Closed Compliance: Add new spells/behaviors without modifying the PlayerController.

Core Files (assets/code/)

  • SpellStrategy.cs.txt: Base abstract ScriptableObject (The Interface).
  • ShieldSpellStrategy.cs.txt: Simple instantiation strategy.
  • OrbitalSpellStrategy.cs.txt: Complex math/logic strategy (Pro Path).

Usage Guide

See GUIDE.md to learn how to create flexible Ability/Spell systems using Strategies.

receiving-code-reviewobra/superpowersUse when receiving code review feedback, before implementing suggestions, especially if feedback seems unclear or technically questionable - requires technical rigor and verification, not performative agreement or blind implementationStars: 318kUpdated Claude CodeCodexVerifiedInstall
requesting-code-reviewobra/superpowersUse when completing tasks, implementing major features, or before merging to verify work meets requirementsStars: 318kUpdated Claude CodeCodexVerifiedInstall
using-git-worktreesobra/superpowersUse when starting feature work that needs isolation from current workspace or before executing implementation plans - ensures an isolated workspace exists via native tools or git worktree fallbackStars: 318kUpdated Claude CodeCodexVerifiedInstall
verification-before-completionobra/superpowersUse when about to claim work is complete, fixed, or passing, before committing or creating PRs - requires running verification commands and confirming output before making any success claims; evidence before assertions alwaysStars: 318kUpdated Claude CodeCodexVerifiedInstall