unity-test

unity-test is a command for Claude Code from XeldarAlz/everything-claude-unity. It costs 34 tokens per session (443 once invoked), scanned A, original, MIT.

A Unity command that finds missing tests, writes EditMode or PlayMode tests, runs them, and reports the results. EditMode tests check logic without running a scene; PlayMode tests cover Unity objects, physics or scene behavior.

In plain words
What is it for?
Use it to test a whole project or a chosen area, create test assemblies when needed, cover gameplay and utility code, run the tests, and summarize passed, failed and skipped cases.
Why use it?
It helps reveal important code paths that have no automated checks and verifies whether new or existing behavior works. The separate test modes match the kind of Unity code being tested.

Command for Claude Code

Part of the everything-claude-unity plugin — 10 skills, 27 commands, 20 agents, 5 hooks shipped together

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 commands/xeldaralz/everything-claude-unity/unity-test
Clone the repo
git clone --depth 1 https://github.com/XeldarAlz/everything-claude-unity

Made for: Claude Code.

Or install everything-claude-unity, the plugin that ships this one along with the rest of its 10 skills, 27 commands, 20 agents, 5 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

README.md
[![agentmods](https://agentmods.dev/badge/commands/xeldaralz/everything-claude-unity/unity-test.svg)](https://agentmods.dev/commands/xeldaralz/everything-claude-unity/unity-test)
Your own site
<a href="https://agentmods.dev/commands/xeldaralz/everything-claude-unity/unity-test"><img src="https://agentmods.dev/badge/commands/xeldaralz/everything-claude-unity/unity-test.svg" alt="Measured on agentmods" height="20"></a>
Per session 34 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 443 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.00034 $0.00443
Opus 5 $0.00017 $0.00221
Sonnet 5 $0.00007 $0.00089
Haiku 4.5 $0.00003 $0.00044

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

Security

Grade A, and why

unity-test 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.

.claude/commands/unity-test.md · 60 lines

What it actually says

/unity-test — Write and Run Tests

Write tests for the project and execute them via MCP.

Scope

If the user specified a scope: test $ARGUMENTS If no scope: identify the most critical untested code paths.

Workflow

Use the unity-test-runner agent to:

Step 1: Assess Test Coverage

  1. Find existing test assemblies (.asmdef files with test references)
  2. If no test assemblies exist, create them:
    • ProjectName.Tests.Editor — EditMode tests (fast, no scene)
    • ProjectName.Tests.Runtime — PlayMode tests (full lifecycle)
  3. Identify scripts with public APIs that lack tests
  4. Prioritize: gameplay logic > systems > utilities

Step 2: Write Tests

For each untested class/method:

  • EditMode test if it's pure logic (no MonoBehaviour lifecycle needed)
  • PlayMode test if it involves MonoBehaviour, physics, or scene state
  • Naming: MethodName_Condition_ExpectedResult
  • Arrange-Act-Assert pattern
  • Clean up GameObjects in TearDown

Step 3: Run Tests

run_tests → execute all tests (or specific fixture if scoped)
read_console → get test results

Step 4: Report

Present results:

  • Total: X passed, Y failed, Z skipped
  • For failures: test name, expected vs actual, stack trace, suggested fix
  • New tests created: list with file paths
  • Coverage gaps: what still needs testing

Test Priority

  1. Game state logic — health, damage, scoring, inventory
  2. Input processing — movement calculation, ability activation
  3. Data systems — save/load, serialization, configuration
  4. Edge cases — zero health, empty inventory, null references
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 · 60 lines · 34 tokens per session scan A e0506c465988

Subscribe to this mod's changes

unity-test is a command published in the GitHub repository XeldarAlz/everything-claude-unity (21 stars, last pushed 4mo ago), licensed MIT. It adds 34 tokens to every session and 443 once invoked, about $0.0002 per session on Opus 5. 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-30.