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.
npx agentmods add rules/common-ka/ai-agent-unity-rules/unity-testinggit clone --depth 1 https://github.com/Common-ka/ai-agent-unity-rulesWhat 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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00007 | $0.00593 |
| Opus 5 | $0.00003 | $0.00296 |
| Sonnet 5 | $0.00001 | $0.00119 |
| Haiku 4.5 | $0.00001 | $0.00059 |
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 yesterday.
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.
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:
- References
UnityEngine.TestRunnerandUnityEditor.TestRunner. - 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));
}
}
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.
- yesterday First seen · 93 lines · 7 tokens per session scan A 2a912d84f3a6
unity-testing is a cursor rule published in the GitHub repository Common-ka/ai-agent-unity-rules (39 stars, last pushed 8mo 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. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.
Other cursor rules, from other repositories
component-development
Modern React + TypeScript component patterns — hooks, typed props, performance optimization, forms, and testing.
webdriver-management
Selenium WebDriver lifecycle management — driver factory, explicit waits, browser options, and teardown.
api-testing
Cypress network interception and API testing patterns (cy.intercept, service mocking, request/response validation).
app-router-patterns
Next.js 14+ App Router patterns — Server Components, Client Components, Route Handlers, Server Actions, and metadata API.
page-object-patterns
Page Object Model patterns for Selenium — BasePage, component objects, and fluent interfaces.
test-patterns
Selenium pytest test patterns — data-driven tests, fixtures, error handling, and performance checks.