Skip to content

MuharremTozan/Agentic-Duel / .agent/skills/unity-code-reviewer

unity-code-reviewer

Verified

Professional Unity C# Code Reviewer. Detects anti-patterns, performance leaks, and enforces project-specific architecture.

assets/code/ReviewProtocols.md.txt

View on GitHub
# Unity Reviewer Protocols

When reviewing code, analyze against these 5 Pillars:

## 1. Performance (The Update Loop)
- **Rule**: NO `GetComponent`, `Find`, or `Camera.main` in high-frequency loops.
- **Goal**: Zero allocations inside `Update`.

## 2. Memory (Safety)
- **Rule**: Every `event +=` must have a corresponding `event -=` in `OnDisable`.
- **Rule**: Avoid `static` variables unless they are cleared correctly (use `RuntimeInitializeOnLoadMethod` if needed).

## 3. Modernity (C# 9.0+ & Unity 2021+)
- **Replace**: `GetComponent() != null` -> `TryGetComponent()`.
- **Replace**: `Instantiate(prefab)` -> Use our `unity-abstract-factory` or `unity-so-prefab-manager`.
- **Replace**: `IEnumerator` delays -> `Task.Delay` or `async` patterns (if appropriate).

## 4. Architecture (Decoupling)
- **Rule**: Low coupling. No direct references between Managers.
- **Goal**: Use `unity-event-bus` or `unity-event-channels` for cross-system talk.

## 5. Minimalism (Pattern Alignment)
- **Check**: Can this logic be replaced by an existing Pattern Skill (FSM, Strategy, Visitor)?
receiving-code-reviewobra/superpowersUse when receiving code review feedback, before implementing suggestions, especially if feedback seems unclear or technically questionable - requires technical rigor and verification, not performative agreement or blind implementationStars: 322kUpdated Claude CodeCodexVerifiedInstall
requesting-code-reviewobra/superpowersUse when completing tasks, implementing major features, or before merging to verify work meets requirementsStars: 322kUpdated Claude CodeCodexVerifiedInstall
using-git-worktreesobra/superpowersUse when starting feature work that needs isolation from current workspace or before executing implementation plans - ensures an isolated workspace exists via native tools or git worktree fallbackStars: 322kUpdated Claude CodeCodexVerifiedInstall
verification-before-completionobra/superpowersUse when about to claim work is complete, fixed, or passing, before committing or creating PRs - requires running verification commands and confirming output before making any success claims; evidence before assertions alwaysStars: 322kUpdated Claude CodeCodexVerifiedInstall