unity-testing

unity-testing is a cursor rule for Cursor from Bilal140202/the-lord-of-the-skills. It costs 7 tokens per session (593 once invoked), scanned A, a copy of unity-testing, MIT.

Testing guidance for Unity, a game engine, using its built-in test framework and separate tests for logic and in-game behavior.

In plain words
What is it for?
Use it when writing Unity Edit Mode tests for pure logic or Play Mode tests for integration and physics behavior.
Why use it?
It gives game projects a consistent way to check code and catch regressions in both isolated logic and running scenes.

Cursor rule for Cursor

Written for Cursor: a Cursor rule (.mdc).

Good fit Use it when writing Unity Edit Mode tests for pure logic or Play Mode tests for integration and physics behavior.

Compare 6 cursor rules from other repositories ↓
Install with agentmods
npx agentmods add rules/bilal140202/the-lord-of-the-skills/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.

Clone the repo
git clone --depth 1 https://github.com/Bilal140202/the-lord-of-the-skills

Made for: Cursor.

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/rules/bilal140202/the-lord-of-the-skills/unity-testing/github.svg)](https://agentmods.dev/rules/bilal140202/the-lord-of-the-skills/unity-testing)
Your own site
<a href="https://agentmods.dev/rules/bilal140202/the-lord-of-the-skills/unity-testing"><img src="https://agentmods.dev/badge/rules/bilal140202/the-lord-of-the-skills/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/rules/bilal140202/the-lord-of-the-skills/unity-testing"><img src="https://agentmods.dev/badge/rules/bilal140202/the-lord-of-the-skills/unity-testing.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 7 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 593 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 100% copy Near-identical to another mod 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.00007 $0.00593
Opus 5 $0.00003 $0.00296
Sonnet 5 $0.00001 $0.00119
Haiku 4.5 $0.00001 $0.00059

Measured 8d ago against content hash 2a912d84f3a6, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, 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 8d 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.

Origin

This is a copy

100% identical to unity-testing — 0 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

skills/gondor/cursor/Common-ka__ai-agent-unity-rules/unity-testing.mdc · 93 lines

What it actually says

Unity Test Framework Guidelines

When writing tests in Unity 6.2, adhere to the AAA (Arrange, Act, Assert) pattern and use the Constraint Model for assertions (Assert.That). This ensures readability and maintainability.

1. Assembly Definition Requirement

Ensure your test script is located in a folder with an .asmdef (Assembly Definition) file that:

  1. References UnityEngine.TestRunner and UnityEditor.TestRunner.
  2. References the Assembly Definition of your main project logic (Runtime code).

2. Edit Mode Test (Pure Logic)

Use this for testing logic that is independent of the Engine Loop (e.g., Math, Data Parsing, State Machines). These tests run very fast.

using NUnit.Framework;
// using MyProject.Systems; 

public class HealthSystemTests
{
    [Test]
    public void TakeDamage_DecreasesCurrentHealth()
    {
        // Arrange
        var healthSystem = new HealthSystem(maxHealth: 100);

        // Act
        healthSystem.TakeDamage(30);

        // Assert
        // Use Constraint Model for better readability
        Assert.That(healthSystem.CurrentHealth, Is.EqualTo(70));
    }
}

3. Play Mode Test (Integration & Physics)

Use this for testing GameObject interactions, Physics, and Coroutines. IMPORTANT: Always use [TearDown] to destroy created objects. If you rely on Object.Destroy at the end of the test method and an assertion fails beforehand, the object will leak into the scene.

using NUnit.Framework;
using UnityEngine;
using UnityEngine.TestTools;
using System.Collections;

public class PlayerMovementTests
{
    // Standard Microsoft C# style: _camelCase for private fields
    private GameObject _player;
    private PlayerController _controller;

    [SetUp]
    public void Setup()
    {
        // Create an isolated environment for each test
        _player = new GameObject("TestPlayer");
        _controller = _player.AddComponent<PlayerController>();
    }

    [TearDown]
    public void Teardown()
    {
        // Guaranteed cleanup even if an assertion fails
        if (_player != null)
        {
            Object.Destroy(_player);
        }
    }

    [UnityTest]
    public IEnumerator Move_ForwardInput_ChangesPosition()
    {
        // Arrange
        var startPosition = _player.transform.position;
        
        // Act
        _controller.Move(Vector3.forward);
        
        // Wait for one frame (for Update logic)
        yield return null; 
        
        // OR wait for physics step if using Rigidbody
        // yield return new WaitForFixedUpdate(); 
        
        // Assert
        Assert.That(_player.transform.position.z, Is.GreaterThan(startPosition.z));
    }
}
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. 8d ago First seen · 93 lines · 7 tokens per session scan A 2a912d84f3a6

Subscribe to this mod's changes

unity-testing is a cursor rule published in the GitHub repository Bilal140202/the-lord-of-the-skills (4 stars, last pushed 6d ago), licensed MIT. It adds 7 tokens to every session and 593 once invoked, about $0.0000 per session on Opus 5. A static security scan graded it A with 0 findings. It is 100% identical to unity-testing, differing in 0 lines, and is treated as a copy.