unity-scriptdesign

Review Unity gameplay scripts for coupling, lifecycle, and maintainability issues.

Updated Aug 18, 2026
One-click install
npx skills add https://github.com/ethanJPope/Our-Main-Hackathon-Game --skill unity-scriptdesign-ethanjpope
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: unity-scriptdesign
Source: https://github.com/ethanJPope/Our-Main-Hackathon-Game/tree/main/.agents/skills/unity-skills/skills/scriptdesign
Command: npx skills add https://github.com/ethanJPope/Our-Main-Hackathon-Game --skill unity-scriptdesign-ethanjpope

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Unity gameplay scripts often grow into tightly-coupled god objects with hidden dependencies, per-frame lookups, and mixed state ownership. This Skill provides a structured design review checklist to catch these problems before or after scripts are written. ## Core Features & Use Cases - Design Review Checklist: Evaluates responsibility, MonoBehaviour vs ScriptableObject role choice, coupling, communication patterns, performance hotspots, lifecycle cleanup, Inspector UX, testability, and naming. - Data Lifecycle Boundary Model: Classifies every field as authoring-time, composition-time, or runtime-mutable state, with concrete assignment examples and guidance on where each belongs. - Structured Output Format: Produces Keep / Simplify / Refactor / Performance / Maintainability sections so reviews are actionable. - Use Case: After generating a player controller and weapon system, run this review to catch a public mutable HP field, an uncached GetComponent call in Update, and balance values that should live in a ScriptableObject. ## Quick Start Ask the assistant to review your Unity gameplay scripts for design quality, coupling, and state lifecycle issues using this skill.

Frequently Asked Questions about unity-scriptdesign

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

FAQPage Schema
How do I review Unity C# scripts for code quality?

Review Unity scripts by checking single responsibility, correct choice between MonoBehaviour, ScriptableObject, and plain C# class, explicit dependencies, and cleanup of subscriptions and async work. This skill provides a checklist covering all of these plus naming and testability.

When should I use ScriptableObject instead of MonoBehaviour in Unity?

Use ScriptableObject for authoring-time data decided by designers before Play, such as weapon damage or level music, so balance values stay immutable at runtime and hot-swappable. Use MonoBehaviour for scene-attached behaviour and plain C# classes for testable core logic.

How do I reduce coupling between Unity gameplay scripts?

Reduce coupling by making dependencies explicit through cached references assigned in Awake, constructor arguments, interfaces, or events instead of hidden globals and deep scene lookups. Avoid repeated Find calls and per-frame GetComponent lookups.

Why does my Unity script break when designers tweak Inspector values?

This happens when a field has two owners, such as a public float edited both in the Inspector and by a power-up script. Separate state into authoring-time, composition-time, and runtime-mutable lifecycles so each value has exactly one owner.

What performance issues should I look for in Unity Update loops?

Look for unnecessary Update methods, repeated Find or GetComponent calls, avoidable allocations, and reflection in hot paths. Cache component references once at composition time and only flag real hotspots rather than theoretical micro-optimizations.