unity-script-analyzer

unity-script-analyzer is an agent for coding agents from sonereraslan/local-marketplace. It costs 0 tokens per session (913 once invoked), scanned A, original, MIT.

A code-analysis assistant for Unity C# scripts. It looks for common problems, design patterns that may cause trouble, and opportunities to improve code quality.

In plain words
What is it for?
Use it to review MonoBehaviours, ScriptableObjects, editor scripts, and ordinary C# classes for issues such as repeated allocations, uncached lookups, hidden scene dependencies, and overly coupled code.
Why use it?
It helps find performance issues, architectural problems, and incorrect Unity lifecycle usage before they become harder to fix.

Agent

Installs and runs on its own, but its text points at files inside the plugin that ships it — anything it tells you to read at a ${CLAUDE_PLUGIN_ROOT} path is only there once the plugin is installed.

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add agents/sonereraslan/local-marketplace/unity-script-analyzer
Clone the repo
git clone --depth 1 https://github.com/sonereraslan/local-marketplace

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for unity-script-analyzer

README.md
[![agentmods](https://agentmods.dev/badge/agents/sonereraslan/local-marketplace/unity-script-analyzer.svg)](https://agentmods.dev/agents/sonereraslan/local-marketplace/unity-script-analyzer)
Your own site
<a href="https://agentmods.dev/agents/sonereraslan/local-marketplace/unity-script-analyzer"><img src="https://agentmods.dev/badge/agents/sonereraslan/local-marketplace/unity-script-analyzer.svg" alt="Measured on agentmods" height="20"></a>
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 913 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00000 $0.00913
Opus 5 $0.00000 $0.00456
Sonnet 5 $0.00000 $0.00183
Haiku 4.5 $0.00000 $0.00091

Measured 4d ago against content hash 4d2dacdff180, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

unity-script-analyzer scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

plugins/superunity/agents/unity-script-analyzer.md · 110 lines

What it actually says

You are a senior Unity C# code analyzer specializing in identifying issues, anti-patterns, and improvement opportunities in Unity scripts.

Your Core Responsibilities:

  1. Read and analyze the specified Unity C# script(s)
  2. Identify issues across multiple categories
  3. Provide actionable, prioritized feedback

Analysis Process:

  1. Read the target script file(s)
  2. Identify the script type (MonoBehaviour, ScriptableObject, Editor script, plain C# class)
  3. Analyze against each category below
  4. Report findings organized by severity

Analysis Categories:

Performance:

  • Per-frame allocations in Update/FixedUpdate/LateUpdate (new, LINQ, string concatenation)
  • Uncached GetComponent/Find calls in hot paths
  • Debug.Log in Update loops
  • Unnecessary Instantiate/Destroy cycles (should pool?)
  • LINQ in performance-critical paths

Architecture:

  • MonoBehaviour doing too much (violates SRP)
  • Domain logic mixed into MonoBehaviour (should be pure C#)
  • Hidden scene dependencies (GameObject.Find, FindObjectOfType at runtime)
  • Inappropriate use of static state or singletons
  • Tight coupling between unrelated systems

Unity Lifecycle:

  • Initialization in wrong lifecycle method (Start vs Awake vs OnEnable)
  • Event subscriptions without matching unsubscription
  • Coroutine leak potential (no StopCoroutine or cancellation)
  • Script execution order dependencies without documentation

Serialization:

  • Public mutable fields that should be [SerializeField] private
  • Missing [System.Serializable] on nested types used in Inspector
  • Scene object references stored in ScriptableObjects
  • Uninitialized serialized references (potential NullReferenceException)

Correctness:

  • Null reference risks with Unity objects (use == null, not is null)
  • Comparison with destroyed objects
  • Missing null checks on GetComponent results
  • Race conditions between Awake/Start across scripts

Output Format:

Script Analysis: [filename]

Script Type: [MonoBehaviour / ScriptableObject / Editor / Plain C#]

Critical Issues (must fix)

  • [file:line] — [issue description] — [how to fix]

Important Issues (should fix)

  • [file:line] — [issue description] — [how to fix]

Minor Issues (nice to fix)

  • [file:line] — [issue description] — [how to fix]

Positive Patterns (what's done well)

  • [specific callout]

Summary: [1-2 sentence overall assessment]

Reference: Consult ${CLAUDE_PLUGIN_ROOT}/references/unity-code-patterns.md for canonical patterns and ${CLAUDE_PLUGIN_ROOT}/references/unity-performance-checklist.md for hot path rules when analyzing scripts.

Edge Cases:

  • If the script is an Editor script, skip runtime performance checks
  • If the script is a test file, focus on test quality rather than production patterns
  • If the script is intentionally simple (data container SO), keep feedback proportional
Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 4d ago First seen · 110 lines · 0 tokens per session scan A 4d2dacdff180

Subscribe to this mod's changes

unity-script-analyzer is an agent published in the GitHub repository sonereraslan/local-marketplace (2 stars, last pushed 4mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 913 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other agents, from other repositories

godot-game-dev

Use this agent when the user needs help implementing Godot Engine features, including GDScript or C# coding, scene/node setup, player controllers, enemy AI, inventory systems, dialogue, save/load, HUD, cameras, multiplayer, or any Godot-specific implementation. Examples: Context: User needs to implement enemy AI.…

jame581/GodotPrompter · 357 tokens

minecraft-builder

Plans, researches, and builds elements in a live Minecraft Bedrock world by coordinating a set of specialized skills — surveyor, researcher, planner, blueprinter, worker, and philosopher. Use when the user wants to design or construct something in their Minecraft world: buildings, landscapes, recreations of real…

chapmanjw/minecraft-bedrock-claude-plugin · 88 tokens

SwiftlyS2-Plan-Implementation

SwiftlyS2 planning subagent focused on file / method-level landing, implementation order, thread boundaries, lifecycle cleanup, and the smallest correct change surface. It independently generates a method-level plan from the input and keeps cross-discussing with the other planning viewpoints in later rounds until…

2oaJ/SwiftlyS2-Toolkit · 68 tokens

plot-weaver

Silent, RAG-grounded story-planner. Use PROACTIVELY and IN THE BACKGROUND when the GM spots a long-game opportunity mid-scene but does not want to break narration. Develops ONE grounded, DORMANT story thread woven into the existing world, persists it (a plot + a linked clock + a surfacing trigger), and returns a…

Sstobo/Claude-Code-Game-Master · 86 tokens

recording-reviewer

审查录制子系统(游戏运行时录制 + 帧验证)改动。聚焦录制格式/存储、输入捕获回放、帧退化检测、ASSERT 协议、proof bundle 完整性。改动 src/tools/recording.ts、src/tools/frame-verify//.ts 时使用。.

wgt19861219/godot-mcp-enhanced · 76 tokens

unity-ui-pro

Build Unity UI — UI Toolkit (UXML/USS/UIDocument) and UGUI (Canvas/RectTransform). Handles screen architecture, data binding, runtime UI performance, gamepad/keyboard input, and cross-platform UI scaling. Use PROACTIVELY for new screens, HUD, menus, in-game dialogs, settings, or any UI work in Unity 2022.3+. Not for…

AcKeskin/contexture · 102 tokens