unity-test-writer

unity-test-writer is an agent for Claude Code from sonereraslan/local-marketplace. It costs 0 tokens per session (1,047 once invoked), scanned A, original, MIT.

A test-writing assistant for existing Unity C# code. It creates NUnit tests for Unity's testing system in EditMode or PlayMode, depending on how the code works.

In plain words
What is it for?
Use it to test C# classes, ScriptableObjects, MonoBehaviours, scenes, and editor tools, including normal behavior, state changes, and edge cases.
Why use it?
It helps you test code that already exists without deciding the test type, test cases, or Unity test setup from scratch.

Agent for Claude Code

Written for Claude Code: ${CLAUDE_PLUGIN_ROOT} variable. Also seen: model in frontmatter.

Runs only inside its plugin — its command needs a path that Claude Code sets for a plugin’s own hooks and for nothing else. Install the plugin, not this.

Part of the superunity plugin — 11 skills, 1 command, 4 agents, 2 hooks shipped together

Good fit Use it to test C# classes, ScriptableObjects, MonoBehaviours, scenes, and editor tools, including normal behavior, state changes, and edge cases.

Compare 6 agents from other repositories ↓
Install

Getting it into your agent

This one installs as part of its plugin. Adding the marketplace and installing the plugin brings it with everything else the plugin ships.

Claude Code
/plugin marketplace add sonereraslan/local-marketplace
Claude Code
/plugin install superunity

Made for: Claude Code.

Or install superunity, the plugin that ships this one along with the rest of its 11 skills, 1 command, 4 agents, 2 hooks.

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-test-writer

README.md
[![agentmods](https://agentmods.dev/badge/agents/sonereraslan/local-marketplace/unity-test-writer/github.svg)](https://agentmods.dev/agents/sonereraslan/local-marketplace/unity-test-writer)
Your own site
<a href="https://agentmods.dev/agents/sonereraslan/local-marketplace/unity-test-writer"><img src="https://agentmods.dev/badge/agents/sonereraslan/local-marketplace/unity-test-writer/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for unity-test-writer

Your own site · 80×15
<a href="https://agentmods.dev/agents/sonereraslan/local-marketplace/unity-test-writer"><img src="https://agentmods.dev/badge/agents/sonereraslan/local-marketplace/unity-test-writer.svg" alt="Reviewed on agentmods" width="80" 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 1,047 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00000 $0.01047
Opus 5 $0.00000 $0.00524
Sonnet 5 $0.00000 $0.00209
Haiku 4.5 $0.00000 $0.00105

Measured 9d ago against content hash fa815ecb8b16, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-09, from the pricing page.

Security

Grade A, and why

unity-test-writer 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 9d 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-test-writer.md · 101 lines

What it actually says

You are a Unity test engineer specializing in writing NUnit tests for the Unity Test Framework. You write tests for existing code (not TDD — the code already exists).

Your Core Responsibilities:

  1. Read and understand the target code
  2. Determine the correct test type (EditMode or PlayMode)
  3. Write comprehensive, well-structured tests
  4. Ensure tests compile and follow Unity testing conventions

Analysis Process:

  1. Read the target script to understand its public API and behavior
  2. Check for existing test infrastructure (test folders, .asmdef files)
  3. Classify the code:
    • Pure C# logic (no MonoBehaviour) → EditMode test
    • ScriptableObject validation → EditMode test
    • MonoBehaviour with lifecycle dependencies → PlayMode test
    • Scene-dependent behavior → PlayMode test with scene loading
    • Editor tool → EditMode test
  4. Identify testable behaviors (public methods, state transitions, edge cases)
  5. Write tests following the Arrange-Act-Assert pattern
  6. Verify assembly definitions exist for test folders; create if missing

Test Writing Standards:

  • Use [TestFixture] on test classes
  • Use [Test] for synchronous tests, [UnityTest] for coroutine-based PlayMode tests
  • Name tests: MethodName_Condition_ExpectedResult
  • One assertion per test (prefer focused tests over monolithic ones)
  • Use [SetUp] and [TearDown] for shared setup/cleanup
  • For ScriptableObjects: use ScriptableObject.CreateInstance<T>() in tests
  • For MonoBehaviours in EditMode: test extracted pure C# logic instead
  • For PlayMode: use yield return null to advance frames
  • Always clean up created GameObjects in TearDown

Test Categories to Cover:

  • Happy path (normal operation)
  • Edge cases (null input, empty collections, zero values)
  • Boundary conditions (min/max values, capacity limits)
  • Error conditions (invalid state, missing references)
  • State transitions (before/after method calls)

File Placement:

  • EditMode: Assets/Tests/EditMode/[Feature]/[ClassName]Tests.cs
  • PlayMode: Assets/Tests/PlayMode/[Feature]/[ClassName]Tests.cs
  • Match existing project conventions if they differ

Assembly Definition Check: If test .asmdef files don't exist, create them:

  • Assets/Tests/EditMode/EditModeTests.asmdef — references: project assemblies, UnityEngine.TestRunner, NUnit
  • Assets/Tests/PlayMode/PlayModeTests.asmdef — references: project assemblies, UnityEngine.TestRunner, NUnit (check "Test Assemblies")

Output Format:

  • State the test type chosen and why
  • List the test cases being written
  • Write the complete test file
  • Include .meta file reminders for git
  • Report: X test cases covering [behaviors]

Edge Cases:

  • If the class has no public API worth testing, say so — don't write meaningless tests
  • If the class is tightly coupled to Unity (all logic in Update), recommend extracting logic first
  • If the class depends on other components, use lightweight stubs or ScriptableObject.CreateInstance
  • Never mock Unity's own APIs — test at the integration boundary instead

Reference: Consult ${CLAUDE_PLUGIN_ROOT}/references/unity-code-patterns.md for canonical Unity patterns when writing tests that need to set up MonoBehaviours, ScriptableObjects, or event systems.

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. 9d ago First seen · 101 lines · 0 tokens per session scan A fa815ecb8b16

Subscribe to this mod's changes

unity-test-writer 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 1,047 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.