unity-testing

unity-testing is a skill for Claude Code, Codex from makifbaysal/tasktrooper. It costs 62 tokens per session (1,874 once invoked), scanned A, original, Apache-2.0.

A guide to Unity's built-in testing system, which runs tests in EditMode or PlayMode. EditMode tests run without starting the game; PlayMode tests run the game loop for scenes, physics, input, and coroutines.

In plain words
What is it for?
Use it to test plain C# rules, ScriptableObjects, editor tools, scenes, physics, input, and asynchronous gameplay behaviour.
Why use it?
It helps choose the appropriate test type and keeps most logic tests fast. It also covers command-line runs, result files, coverage, and a fallback when the Unity editor is unavailable.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to test plain C# rules, ScriptableObjects, editor tools, scenes, physics, input, and asynchronous gameplay behaviour.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/makifbaysal/tasktrooper/unity-testing
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.

Any agent
npx skills add makifbaysal/tasktrooper --skill unity-testing
Clone the repo
git clone --depth 1 https://github.com/makifbaysal/tasktrooper

Made for: Claude Code, Codex.

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-testing

README.md
[![agentmods](https://agentmods.dev/badge/skills/makifbaysal/tasktrooper/unity-testing/github.svg)](https://agentmods.dev/skills/makifbaysal/tasktrooper/unity-testing)
Your own site
<a href="https://agentmods.dev/skills/makifbaysal/tasktrooper/unity-testing"><img src="https://agentmods.dev/badge/skills/makifbaysal/tasktrooper/unity-testing/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-testing

Your own site · 80×15
<a href="https://agentmods.dev/skills/makifbaysal/tasktrooper/unity-testing"><img src="https://agentmods.dev/badge/skills/makifbaysal/tasktrooper/unity-testing.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 62 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,874 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.00062 $0.01874
Opus 5.5 $0.00025 $0.00750
Sonnet 5.5 $0.00012 $0.00375
Haiku 4.5 $0.00006 $0.00187

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

Security

Grade A, and why

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

catalog/agents/game-developer/skills/unity-testing/SKILL.md · 150 lines

How it starts

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

Unity Testing

Overview

The Unity Test Framework (NUnit 3 underneath) runs tests in two modes. EditMode tests run in the editor without entering Play mode — fast, ideal for plain C# rules, ScriptableObjects and editor tooling. PlayMode tests run the player loop — needed for scenes, physics, coroutines and input, and slower. Most tests should be EditMode tests against plain classes (testable-game-logic).

Core principle: EditMode first; PlayMode only for behaviour that needs the player loop. Read the result XML, not the log tail.

Which mode

Question Mode Typical setup
Does the damage/cooldown/inventory rule compute correctly? EditMode new the plain class
Is every shipped definition valid? EditMode AssetDatabase.FindAssets
Does a ScriptableObject-driven system behave? EditMode ScriptableObject.CreateInstance<T>()
Does the character land on the floor / trigger fire? PlayMode load a test scene, WaitForFixedUpdate
Does pressing Jump jump? PlayMode InputTestFixture
Does the coroutine/Awaitable sequence finish? PlayMode [UnityTest] yielding frames

Test assemblies

{
  "name": "Tests.EditMode",
  "references": ["Game.Core", "Game.Runtime", "UnityEngine.TestRunner", "UnityEditor.TestRunner"],
  "includePlatforms": ["Editor"],
  "overrideReferences": true,
  "precompiledReferences": ["nunit.framework.dll"],
  "defineConstraints": ["UNITY_INCLUDE_TESTS"],
  "autoReferenced": false
}

PlayMode assemblies leave includePlatforms empty (any platform) and drop UnityEditor.TestRunner unless they need editor APIs. Tests live where the repository keeps them (often Assets/Tests/EditMode and Assets/Tests/PlayMode); follow its naming — Method_Scenario_Expected when there is none.

EditMode examples

public class InventoryTests {
    [Test] public void Add_BeyondStackLimit_OverflowsToNewSlot() {
        var potion = ScriptableObject.CreateInstance<ItemDefinition>();
        potion.Configure(id: "potion", maxStack: 5);
        var inv = new Inventory(slots: 4);

        inv.Add(potion, 7);

        Assert.That(inv.Slots[0].Count, Is.EqualTo(5));
        Assert.That(inv.Slots[1].Count, Is.EqualTo(2));
        Object.DestroyImmediate(potion);
    }

    [TestCase(0f, 100)] [TestCase(0.5f, 50)] [TestCase(1f, 0)]
    public void Damage_ByArmorFraction_ReducesLinearly(float armor, int expected) =>
        Assert.That(DamageMath.Apply(100, armor), Is.EqualTo(expected));
}

Read the full file on GitHub · 150 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. 4d ago First seen · 150 lines · 62 tokens per session scan A fece29774eae

Subscribe to this mod's changes

unity-testing is a skill published in the GitHub repository makifbaysal/tasktrooper (113 stars, last pushed yesterday), licensed Apache-2.0. It adds 62 tokens to every session and 1,874 once invoked, about $0.0002 per session on Opus 5.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-10-09.