Package Exports
- code-review-unity
- code-review-unity/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (code-review-unity) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
code-review-unity
Claude Code skill for reviewing Unity C# code against Unity's Official C# Style Guide (Unity 6 Edition).
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.
GetComponentin 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,FindObjectOfTypein hot paths). - Structured output — Critical issues, style violations, and suggestions with file:line refs and concrete fix examples.
Install
npx code-review-unityOr manually copy .claude/skills/code-review-unity/ to ~/.claude/skills/
Usage
Command Invocation
/code-review-unity Assets/Scripts/PlayerController.csOr review git changes:
/code-review-unityor 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 questionsResources
- C# Style Guide (Unity 6) - Official style guide for clean, scalable code
- Unity How-To Library - Tutorials on scripting, optimization, and best practices
Links
License
MIT