From unity-kit
Battle-tested architecture patterns for Unity games — state machines, object pooling, ScriptableObject event channels, save systems, scene architecture, singletons done safely. Use when structuring gameplay code, when a script grows past one responsibility, or when spawning/saving/scene-flow comes up.
How this skill is triggered — by the user, by Claude, or both
Slash command
/unity-kit:gamedev-patternsThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Reach for a pattern when the pain exists, not preemptively — a game jam prototype needs none of these; a growing project needs them one at a time.
Reach for a pattern when the pain exists, not preemptively — a game jam prototype needs none of these; a growing project needs them one at a time.
switch in one MonoBehaviour is correct — don't over-engineer.IState { Enter(); Tick(); Exit(); }) with a plain C# StateMachine holding current state. States get context via constructor, not statics.UnityEngine.Pool.ObjectPool<T> — use it, don't hand-roll. Pool anything Instantiated more than ~once per second: projectiles, impact VFX, damage numbers, audio sources.OnGet/OnRelease (velocity, trail renderers, coroutines) — the #1 pooling bug is stale state from the previous life.event Action<...> (unsubscribe in OnDisable).Raise()/Subscribe(); emitters and listeners reference the asset, never each other. Designer-wireable, testable, no scene coupling.AteFood, Died(newBest), Restarted); FX, audio, and HUD live in separate sibling components that subscribe in OnEnable. Logic stays pure and unit-testable (tests instantiate it with zero subscribers — ?.Invoke makes that free), each juice layer can be added/removed without touching gameplay, and the read-only state surface (public int Score => score;) doubles as the HUD's and the playtest skill's probe API.[Serializable], no UnityEngine.Object fields) to JSON at Application.persistentDataPath. Never serialize MonoBehaviours/GameObjects directly.int version field + migration on load. Retrofitting versioning after players have saves is misery.SceneManager.LoadSceneAsync(name, LoadSceneMode.Additive)); gameplay scenes stay free of persistent-manager copies.DontDestroyOnLoad sparingly — the bootstrap-additive pattern mostly removes the need. Loading screens only when a load actually exceeds ~0.5s.Acceptable for genuine one-of-a-kinds wired in bootstrap (AudioManager, SaveManager): instance set in Awake with a duplicate-destroy guard, no lazy FindObjectOfType resurrection. Gameplay objects (player, enemies, spawners) are never singletons — inject references via serialized fields or event channels instead.
npx claudepluginhub benjamin-curlier/unity-kit --plugin unity-kitGuides completion of development work by verifying tests, detecting environment, and presenting structured options for merge, PR, or cleanup.
Enforces test-driven development: write failing test first, then minimal code to pass. Use when implementing features or bugfixes.
Guides creation and editing of skills using test-driven development with pressure scenarios and subagents to verify agent compliance.