test-writing-guide

test-writing-guide is a skill for Claude Code from nowsprinting/unity-coding-skills. It costs 81 tokens per session (2,182 once invoked), scanned A, original, Unlicense.

A set of rules for writing tests in Unity, a game-development engine. It covers when to stop Play Mode, how to handle scenes and created objects, how to mark integration or acceptance tests, and how to keep test-only production code out of normal builds.

In plain words
What is it for?
Use it whenever adding, editing, fixing, or expanding files under Unity's Tests directories, including unit, integration, visual-verification, and acceptance tests.
Why use it?
Unity tests have project-specific requirements that can cause editor errors, unwanted files, or tests that behave differently from the finished game. The guide keeps new and changed tests consistent with those requirements.

Skill for Claude Code

Written for Claude Code: user-invocable in frontmatter.

Part of the unity-coding-skills plugin — 10 skills, 3 agents shipped together

Good fit Use it whenever adding, editing, fixing, or expanding files under Unity's Tests directories, including unit, integration, visual-verification, and acceptance tests.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/nowsprinting/unity-coding-skills/test-writing-guide
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 nowsprinting/unity-coding-skills --skill test-writing-guide
Clone the repo
git clone --depth 1 https://github.com/nowsprinting/unity-coding-skills

Made for: Claude Code.

Or install unity-coding-skills, the plugin that ships this one along with the rest of its 10 skills, 3 agents.

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 test-writing-guide

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

Your own site · 80×15
<a href="https://agentmods.dev/skills/nowsprinting/unity-coding-skills/test-writing-guide"><img src="https://agentmods.dev/badge/skills/nowsprinting/unity-coding-skills/test-writing-guide.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 81 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,182 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. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
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.00081 $0.02182
Opus 5.5 $0.00032 $0.00873
Sonnet 5.5 $0.00016 $0.00436
Haiku 4.5 $0.00008 $0.00218

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

Security

Grade A, and why

test-writing-guide 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 6d ago.

The scan reads SKILL.md. This mod also ships 1 executable file (scripts/create-test-asmdef.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/test-writing-guide/SKILL.md · 135 lines

How it starts

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

Guide for writing test code for Unity projects.

Rules

  • Before modifying any test file, check if the editor is in Play Mode. If it is, stop it using the unity_play_control tool first.
  • Never create .meta files. Unity editor creates them automatically.
  • When a test creates a GameObject or instantiates a prefab, apply [CreateScene] to the test method (not required if [LoadScene] is already present).
  • When adding a test seam to production code (e.g., an internal accessor or a virtual override point to support injection), always wrap it with #if UNITY_INCLUDE_TESTS … #endif so it is excluded from non-test builds:
    #if UNITY_INCLUDE_TESTS
    internal void SetStateForTest(State state) => _state = state;
    #endif
    

Categories

  • When implementing tests designed as integration tests, apply [Category("Integration")] to the test method.
  • When implementing tests designed as visual verification tests, apply [Category("VisualVerification")] to the test method.
  • When implementing tests designed as acceptance tests (marked (acceptance test) in the test case design), apply [Category("Acceptance")] to the test method.
  • For test methods that test the internal visibility method, apply [Category("Internal")].
  • For test methods that depend on animation timing or other timing-sensitive conditions that may cause instability on slow CPUs, apply [Category("IgnoreCI")].
  • For test methods that specify the GameViewResolution attribute, apply [Category("IgnoreCI")].

Multi-frame tests

When a game mechanic across frames (e.g., playing a card and waiting for its resolution), wait for the step to finish before asserting — not at a fixed frame count.

await DragCard(Cards[1], Enemies[0]);
while (battleDirector.IsPlaying) // wait until the played action fully resolves
    await Awaitable.NextFrameAsync();
Assert.That(battleState.Enemies[0].Hp, Is.LessThan(hpBefore));
  • To confirm step completion, use a production-side state machine or a "busy" signal (IsPlaying, coroutine flag, etc.). Do not use a fixed number of frames or WaitForSeconds.
  • When UniTask is available, UniTask.WaitUntil and UniTask.WaitUntilValueChanged are alternatives to the while loop:
    await UniTask.WaitUntil(() => isActive == false);
    await UniTask.WaitUntilValueChanged(this, x => x.isActive);
    
  • When an operation triggers a deferred Destroy or UI rebuild, advance one extra await Awaitable.NextFrameAsync() before asserting on the new hierarchy.

Read the full file on GitHub · 135 lines

Files

What ships with it

5 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

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. 6d ago Changed 911abf8adf4d
  2. 1mo ago Changed 81f5c58c090e
  3. 1mo ago First seen · 135 lines · 81 tokens per session scan A 85efcd22fc74

Subscribe to this mod's changes

test-writing-guide is a skill published in the GitHub repository nowsprinting/unity-coding-skills (20 stars, last pushed yesterday), licensed Unlicense. It adds 81 tokens to every session and 2,182 once invoked, about $0.0003 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-08-30.

Related

Other skills, from other repositories

aspid-visual-element-fluent

Aspid.FastTools chainable UI Toolkit extensions (namespace Aspid.FastTools.UIElements): SetPadding, SetFlexDirection, AddChild/AddChildren, AddClass, AddClicked, SetValue, AddValueChanged, BindTo and more. Use when C# code creates or configures VisualElements (editor windows, inspectors, runtime UI) in a project with…

VPDPersonal/Aspid.FastTools · 109 tokens

aspid-serializable-type

Aspid.FastTools type picking in the Unity Inspector: SerializableType , SerializableMonoScript , [TypeSelector] on string, wrapper and [SerializeReference] fields, [TypeSelectorDisplay], ComponentTypeSelector, the TypeField element and TypeSelectorWindow for editor code, analyzers AFT0001-AFT0009 and AFT0012, the CI…

VPDPersonal/Aspid.FastTools · 136 tokens

aspid-profiler-marker

Aspid.FastTools generated profiler markers: using var = this.Marker(); and this.Marker().WithName("..."). Use when the user asks to profile a method or section, add a ProfilerMarker, or show code in the Unity Profiler in a project with tech.aspid.fasttools, or when such markers are missing, merged or misnamed.

VPDPersonal/Aspid.FastTools · 82 tokens

aspid-enum-values

Aspid.FastTools EnumValues and EnumValues : a serializable enum-to-value table edited in the Unity Inspector. Use when mapping enum members to per-member data (multipliers, colors, sounds, configs), replacing an enum switch or a set of per-member fields, building a [Flags] lookup, or reading/iterating/debugging an…

VPDPersonal/Aspid.FastTools · 87 tokens

asp-ft-release

Release an Aspid.FastTools version end to end. Phase 1 opens the release PR (CHANGELOG section, version files, local tests, Unity EditMode); the user merges it. Phase 2 pushes the v tag after the user's yes and checks what the Release workflow published. The version alone picks the channel. - /asp-ft-release…

VPDPersonal/Aspid.FastTools · 98 tokens

asp-ft-editor-component

Adding or changing an internal UI Toolkit editor component of the Aspid.FastTools package (Editor/Scripts/VisualElements/Internal: AspidLabel, AspidBox, AspidDividingLine and the rest) - element class, preset struct, fluent extensions, ThemeStyle/StatusStyle, USS-driven style structs, stylesheet. For work on this…

VPDPersonal/Aspid.FastTools · 77 tokens