run-tests

A set of instructions for running tests in the Unity game editor with the rununitytests tool. It covers checking compilation, choosing the right test settings, and avoiding conflicts between Unity tools.

In plain words
What is it for?
Use it to verify code changes, rerun failed tests, run a specific test class or assembly, and debug Unity test failures.
Why use it?
It helps prevent test runs from failing because Unity is still reloading or because editor tools were called at the same time.

Skill for Claude CodeCodex

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 skills/nowsprinting/unity-coding-skills/run-tests
Any agent
npx skills add nowsprinting/unity-coding-skills --skill run-tests
Clone the repo
git clone --depth 1 https://github.com/nowsprinting/unity-coding-skills

Made for: Claude Code, Codex.

Per session 130 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,953 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.00130 $0.01953
Opus 5 $0.00065 $0.00977
Sonnet 5 $0.00026 $0.00391
Haiku 4.5 $0.00013 $0.00195

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

Security

Grade A, and why

run-tests 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 2d ago.

The scan reads SKILL.md. This mod also ships 5 executable files (scripts/extract-visual-verification.py, scripts/get-persistent-data-path.sh, scripts/get-player-settings.sh, …), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

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.

skills/run-tests/SKILL.md · 93 lines

How it starts

The opening of the file, as written. The whole thing — 93 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Gotchas

  • Never call two Unity Editor tools in parallel. unity_play_control, get_unity_compilation_result, run_unity_tests, and run_method_in_unity must be called strictly one at a time — always wait for each call to return before making the next one. Calling them concurrently causes domain-reload conflicts that result in "canceled" or "did not connect within 30 seconds" errors.
  • When a Unity Editor tool returns error or canceled, wait 10 seconds before retrying. Domain reload typically takes several seconds; immediate retry hits the same in-flight reload and fails again. Do not switch tools in the meantime (e.g., calling unity_play_control to verify state) — that just compounds the multiplexed calls. If the same tool returns error or canceled on two consecutive attempts (with the 10-second wait between them), stop and consult the user instead of retrying further.

Run Tests

Before running tests, complete the following steps in order:

  1. If any code was modified, confirm compilation success using the get_unity_compilation_result tool before proceeding.
  2. To determine assemblyNames and testMode for a specific test class, run ${CLAUDE_SKILL_DIR}/scripts/resolve-test-target.sh <test-class-cs-path>. The script prints <assemblyName>\t<testMode> (e.g. MyGame.Tests\tPlayMode). Skip this step when running an already-known assembly.

Then use the run_unity_tests tool to run the tests on the Unity editor.

Test execution can take several minutes. Do not re-run while a test is in progress — always wait for it to complete or time out. If a timeout occurs, narrow down the tests using filter settings and re-run.

Performance Test Results

When com.unity.test-framework.performance is installed, each run writes its measurements to Application.persistentDataPath/PerformanceTestResults.json (alongside the TestResults.xml they are parsed from). Resolve that directory with ${CLAUDE_SKILL_DIR}/scripts/get-persistent-data-path.sh <unity-project-root>.

Read the full file on GitHub · 93 lines

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. 2d ago First seen · 93 lines · 130 tokens per session scan A 510491153ce1

Subscribe to this mod's changes

run-tests is a skill published in the GitHub repository nowsprinting/unity-coding-skills (19 stars, last pushed 2d ago), licensed Unlicense. It adds 130 tokens to every session and 1,953 once invoked, about $0.0006 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.

Related

Other skills, from other repositories

unity

Compile, test, and drive Unity for this repo's C# packages (unity/core, jint, quickjs, clearscript) and the two Unity projects (tests/, kitchen-sink/). Use when a change touches C# under unity/, when Unity test results are needed, when a rendering snapshot has to be checked or regenerated, or when the app has to be…

ReactUnity/core · 108 tokens

uloop-execute-dynamic-code

Execute C# with Unity APIs when existing uloop tools cannot inspect or edit enough. Use for reachable scene/component state, scene/prefab/menu automation, and PlayMode checks.

hatayama/unity-cli-loop · 43 tokens

uloop-simulate-mouse-input

Simulate Mouse.current input in PlayMode through Unity Input System. Use for gameplay mouse clicks, long-press (LongPress), movement delta (MoveDelta/SmoothDelta), or scroll. Use --dry-run to check what a Game View coordinate hits in 3D physics before clicking (works in EditMode; no Input System required). Use…

hatayama/unity-cli-loop · 113 tokens

uloop-simulate-mouse-ui

Simulate PlayMode EventSystem UI mouse actions using screen coordinates. Use for UI clicks, long-presses, or drags from annotated screenshots.

hatayama/unity-cli-loop · 39 tokens

uloop-pause-point

Pauses Unity playback at any source file:line without editing code or recompiling, and returns a snapshot of the locals, parameters, and instance fields at that exact frame. Use for bug investigation, PlayMode/E2E verification, checking variable values at a specific frame, or confirming that a code path executed.

hatayama/unity-cli-loop · 69 tokens

uloop-screenshot

Capture Unity Editor windows or Game View rendering as PNG. Use for visual checks, debugging, documentation, or annotated UI element coordinates.

hatayama/unity-cli-loop · 31 tokens