Skip to content

atlasrealityinc/code-review-unity

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

code-review-unity

Claude Code skill for reviewing Unity C# code against Unity's Official C# Style Guide (Unity 6 Edition).

npm version License: MIT

Features

  • Multiple review modes — Review a single file, your local git diff, or a GitHub PR by URL.
  • Follow Unity 6 C# style guide — Naming (PascalCase/camelCase, booleans as questions), SRP, DRY, KISS, comments (why not what), YAGNI, extension methods, and UI Toolkit BEM naming.
  • Unity-specific checks — MonoBehaviour lifecycle (Awake/Start/OnEnable/OnDestroy), coroutine patterns, ScriptableObject usage, and API misuse (e.g. GetComponent in Update, CompareTag, non-alloc physics, pooling).
  • Performance and GC — Flags allocation in hot paths (strings, LINQ, boxing), Update bloat, and common anti-patterns (SendMessage, Invoke, FindObjectOfType in hot paths).
  • Structured output — Critical issues, style violations, and suggestions with file:line refs and concrete fix examples.

Install

Option 1: npx installs for Claude Code

npx code-review-unity

Option 2: Use Skill.sh to install and manage for all your AI Agents: Claude Code, Cursor, Gemini CLI...

npx skills add https://github.com/jinda-li/code-review-unity --skill code-review-unity

Option 3: Mannual

Copy .claude/skills/code-review-unity/ to ~/.claude/skills/


Usage

Command Invocation

/code-review-unity Assets/Scripts/PlayerController.cs

Or review git changes:

/code-review-unity

or Just ask claude code:

"Review this Unity script"

Claude will automatically invoke this skill and review your code.


Example Output

## Code Review: PlayerController.cs

### Critical Issues

1. **SRP Violation - God Class** (lines 15-89)
   - Handles input, movement, audio, and inventory
   - Unity Style Guide: "Each MonoBehaviour should have one responsibility"
   - Split into: PlayerInput, PlayerMovement, PlayerAudio, PlayerInventory

2. **GetComponent in Update** (line 34)
   - Caching pattern not used - causes unnecessary overhead every frame
   - Use `[SerializeField]` or cache in `Awake()`

### Style Violations

3. **Poor Variable Naming** (line 23)
   - `int d` should be `int elapsedTimeInDays` - be specific about units
   - `bool dead` should be `bool isDead` - booleans ask questions

Resources


Links


License

MIT

About

Review your Unity C# against the official Unity 6 style guide. Catches lifecycle issues, GC traps, and style violations.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • JavaScript 100.0%