reviewer-unity
Skill0 starsChanged 57 days agoMITView on GitHub
Review Unity projects: C# scripts (.cs), WebGL JavaScript plugins (.jslib), WebGL templates, Packages/manifest.json and ProjectSettings. Use when reviewing changes to any of these files, or when the user types /reviewer-unity. Catches destroyed-object null checks, per-frame allocations, lifecycle order bugs, lost serialized data, WebGL threading and interop mistakes, editor code that breaks player builds, and missing .meta files. Part of the reviewer bundle.
In this repository15 other files it gives its agents.
- ai-scaffoldingSkill
- comment-hygieneSkill
- microfrontendsSkill
- reviewer-cloudflareSkill
- reviewer-dataSkill
- reviewer-docsSkill
- reviewer-godotSkill
- reviewer-pythonSkill
- reviewer-readabilitySkill
- reviewer-shellSkill
- reviewer-toolingSkill
- reviewer-webSkill
- reviewerSkill
- startup-scriptSkill
- typed-blocksSkill
The file
We split this skill into the rules it gives an agent
6 rules. About 0 are common, 0 are distinctive, and 6 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
6
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 14
Run what the project has: EditMode/PlayMode tests via -runTests in batchmode, or a scripted build.
- Very specific: line 32
No per-frame allocations: LINQ, string concatenation or interpolation, boxing, new lists, closures in Update.
- Very specific: line 33
Avoid SendMessage and reflection in hot paths.
- Very specific: line 38
Prefer [SerializeField] private fields to public fields.
- Very specific: line 52
Every new asset and folder has its .meta committed.
- Very specific: line 76
Use the reviewer format: [severity] path:line — problem, then failure: (the concrete input, state or platform → wrong result) and fix: (the …
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Unity reviewer
Scope: *.cs, *.jslib, Assets/WebGLTemplates/**, Packages/manifest.json, ProjectSettings/**, and the presence of .meta files. Check ProjectSettings/ProjectVersion.txt for the editor version.
Before reviewing
- Find the build entry points (an editor
BuildScript, CI batchmode commands) and the target platforms. - Run what the project has: EditMode/PlayMode tests via
-runTestsin batchmode, or a scripted build. These need a licensed editor; if one isn't available, say so instead of guessing.
Checklist
Unity objects
?.and??onUnityEngine.Objectskip Unity's overloaded== null. A destroyed object passes the check and throwsMissingReferenceException. Use== nullor the implicit bool.GetComponent,Find*andCamera.maininsideUpdateshould be cached inAwake.Destroytakes effect at the end of the frame. Code after it still sees the object.
Lifecycle
Awake→OnEnable→Start. Cross-object references set in another object'sAwakemay not exist yet in yours. Physics and forces go inFixedUpdate; input inUpdate;Time.deltaTimeinsideFixedUpdateis the fixed step.- Coroutines stop when their GameObject is disabled. Subscriptions made in
OnEnablemust be removed inOnDisable, or destroyed listeners keep firing. asyncmethods keep running after the object is destroyed. Check for that, or pass a cancellation token.
Performance (WebGL and mobile)
- No per-frame allocations: LINQ, string concatenation or interpolation, boxing,
newlists, closures inUpdate. They cause GC hitches. - Avoid
SendMessageand reflection in hot paths.
Serialization
- Renaming a serialized field loses its saved value in every scene and prefab. Use
[FormerlySerializedAs("old")]. - Prefer
[SerializeField] privatefields to public fields. - Changing a
ScriptableObjectat runtime in the editor writes to the asset permanently.
WebGL
- WebGL is single-threaded:
Task.Run,Threadand blocking waits deadlock or throw. Code must stay on the main thread. [DllImport("__Internal")]calls need#if UNITY_WEBGL && !UNITY_EDITORguards with an editor fallback..jslib: functions go insidemergeInto(LibraryManager.library, {...}). Read C# strings withUTF8ToString(Pointer_stringifyis removed). Return strings with_mallocplusstringToUTF8. Callback names passed toSendMessagemust match the GameObject and method exactly. Event listeners added there must be removable.PlayerPrefson WebGL writes to IndexedDB lazily. CallPlayerPrefs.Save()after important writes.- Template:
%UNITY_*%tokens intact. The compression format must match server headers (Content-Encodingfor.br/.gz, or the decompression fallback on). A service worker must not serve an old build after a deploy.
Builds
- Code using
UnityEditormust live under anEditor/folder, or behind#if UNITY_EDITOR. Otherwise player builds fail. - Every new asset and folder has its
.metacommitted. A changed GUID breaks every reference to the asset. Packages/manifest.jsonversions are pinned. Version bumps matchpackages-lock.jsonand the editor version.
Conventions
PascalCasetypes, methods and properties;_camelCaseprivate fields, or the project's own convention.///XML doc comments where the project documents.- Gameplay numbers in the project's tuning or data file, not hard-coded.
Readability
Apply reviewer-readability to the same files (names, structure, dead code, and whether comments are true, needed and well-shaped), plus:
///XML doc comments on public types and members the project documents;[Tooltip]on serialized fields designers edit.#regionblocks that hide a long class are a smell: the class does too much.Updatebodies read as a short list of named steps, not 100 lines of inline logic.
Not findings
- Allocation in code that runs once (setup, menus) rather than per frame.
publicfields in a project that uses them consistently.
Report
Use the reviewer format: [severity] path:line — problem, then failure: (the concrete input, state or platform → wrong result) and fix: (the smallest change). Most severe first. Prove each finding before reporting it, and say No findings with what you checked when there are none.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

