unity-coding-habitslisted
Install: claude install-skill Xenoneqq/unity-ai-skills
# Unity coding habits
Clean, readable code is the point. Every rule below has a reason — correctness, performance,
readability, or compile time. Where the reason does not apply, neither does the rule.
**The project outranks this file.** If the repo documents its conventions — `CLAUDE.md`,
`CONTRIBUTING.md`, contributor notes — or the surrounding code clearly and consistently
demonstrates one, follow that. These are the fallback for when nothing says otherwise.
**Do not restyle code you are passing through.** Smallest diff that solves the task. Renaming
fields, adding `[SerializeField]`, extracting helpers or converting coroutines in code you merely
touched turns a reviewable diff into an unreviewable one — and in Unity a field rename silently
drops every value already serialized in a scene or prefab. Converting old code is real work:
propose it, get it agreed, and do it deliberately — `unity-legacy-migration` is that job, and it
carries the procedures that keep references and stored values intact.
| Reference | Read it when |
|---|---|
| [references/serialization.md](references/serialization.md) | Adding or renaming a serialized field, writing a `ScriptableObject`, or the inspector shows the wrong value. |
| [references/per-frame.md](references/per-frame.md) | Writing `Update`/`FixedUpdate`, chasing frame cost or GC spikes, or writing a coroutine or `async` method. |
| [references/wiring.md](references/wiring.md) | Deciding how one object finds another, loading assets at