MuharremTozan/Agentic-Duel / .agent/skills/unity-strategy-pattern
unity-strategy-pattern
VerifiedImplements 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
- Encapsulated Logic: Each behavior (Fireball, Shield, Orbital) lives in its own
ScriptableObjector class. - Hot-Swapping: Change an entity's behavior at runtime by swapping the strategy asset.
- 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.
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| 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 implementation | Stars: 318k | Updated | Claude CodeCodex | Verified | Install |
| requesting-code-reviewobra/superpowersUse when completing tasks, implementing major features, or before merging to verify work meets requirements | Stars: 318k | Updated | Claude CodeCodex | Verified | Install |
| 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 fallback | Stars: 318k | Updated | Claude CodeCodex | Verified | Install |
| 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 always | Stars: 318k | Updated | Claude CodeCodex | Verified | Install |