run-tests
Skill20 starsChanged 26 days agoUnlicenseView on GitHub
Provides guidelines for running Unity tests using the run_unity_tests tool. Make sure to use this skill whenever running, executing, or re-running tests in the Unity Editor. This includes verifying implementations, debugging test failures, running specific test assemblies, or any task that involves the run_unity_tests tool. Also covers running Play Mode tests on the player for verifying player-only behavior (e.g., #if directives and code stripping). Also covers verifying `[Category("VisualVerification")]` tests after a run by analyzing the saved screenshots. Even if the user just says "run the tests" or "check if it passes", use this skill.
48 other projects use a version of this.
Adopted by
Most recently taken up by
- utopia-rise/fmod-gdextensiontheir own version, first seen Nov 9, 2026
- Pubx-ai/skillstheir own version, first seen Nov 8, 2026
- coralogix/cx-clitheir own version, first seen Nov 8, 2026
- DataDog/dd-trace-pytheir own version, first seen Nov 1, 2026
- busycaesar/Harnesstheir own version, first seen Nov 1, 2026
- NumericalEarth/Breeze.jltheir own version, first seen Oct 17, 2026
Used with
Projects with it also use prepare-release, create-pr and 3 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
ShopifySkillprepare-release
Prepare the changeset-release/main branch for release by syncing version.ts files and running pnpm install
Also in 3 projects that use this
SentrySkillcreate-pr
Create pull requests following Sentry conventions. Use when opening PRs, writing PR descriptions, or preparing changes for review. Follows Sentry's code review guidelines.
Also in 4 projects that use this
SentrySkillcommit
Create commit messages following Sentry conventions. Use when committing code changes, writing commit messages, or formatting git history. Follows conventional commits with Sentry-specific issue references.
Also in 4 projects that use this
MicrosoftSkillrelease
Use ONLY when the user explicitly asks to cut/publish a Huabu desktop release or tag a version. Performs an outward action — bumps the version in apps/desktop/package.json, commits + annotated-tags vX.Y.Z, and pushes the branch + tag. That tag push auto-builds the macOS/Windows installers and publishes a GitHub Release. Provides `status`, `bump`, `tag-push`, and a one-command `run` (bump → tag-push).
Also in 5 projects that use this
GoogleSkillcode-review
Adversarial systems, concurrency, memory-model, and architecture code review protocol. Use this skill whenever asked to review code, PRs, diffs, or branches in Filament.
Also in 5 projects that use this
Other versions48 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 48
- netbox-community/netbox★ 22ksame name
- yagop/node-telegram-bot-api★ 9.2ksame name
- gitextensions/gitextensions★ 8.6ksame name
- ethereum/consensus-specs★ 4ksame name
- dotnet/sdk★ 3.2ksame name
- ComplianceAsCode/content★ 2.8ksame name
- idaholab/moose★ 2.4ksame name
- CliMA/Oceananigans.jl★ 1.4ksame name
- microsoft/testfx★ 1.1ksame name
- serenedb/serenedb★ 965same name
38 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository9 other files it gives its agents.
- code-writing-guideSkill
- edit-sceneSkill
- fix-bugSkill
- plan-featureSkill
- refine-testsSkill
- resolve-diagnosticsSkill
- test-designing-guideSkill
- test-writing-guideSkill
- unity-yaml-editing-guideSkill
The file
We split this skill into the rules it gives an agent
7 rules. 0 are common, 4 are distinctive, and 3 are very specific to this project.
0
Common
Most of the 44 edited versions we read keep these.
4
Distinctive
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 22
Before running tests, complete the following steps in order:
- Very specific: line 24
If any code was modified, confirm compilation success using the get_unity_compilation_result tool before proceeding.
- Distinctive: line 29
Test execution can take several minutes.
- Very specific: line 33
When com.unity.test-framework.performance is installed, each run writes its measurements to …
- Very specific: line 70
Verification aspects: read the [Description(...)] attribute directly from the test's source file.
- Distinctive: line 78
If the same test(s) fail on two or more consecutive runs, stop and consult the user rather than continuing to fix.
- Distinctive: line 88
Read the appropriate resource file based on the situation:
“Common” is measured: kept by at least 6 in 10 of the 44 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Gotchas
- Never call two Unity Editor tools in parallel.
unity_play_control,get_unity_compilation_result,run_unity_tests, andrun_method_in_unitymust 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
errororcanceled, 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., callingunity_play_controlto verify state) — that just compounds the multiplexed calls. If the same tool returnserrororcanceledon 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:
- If any code was modified, confirm compilation success using the
get_unity_compilation_resulttool before proceeding. - To determine
assemblyNamesandtestModefor 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 in 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>.
For the package's measurement pitfalls, see the test-writing-guide skill's resources/unity-test-framework-performance.md.
Run Tests on the Player
run_unity_tests runs tests only inside the Unity Editor. Run tests on a player instead when the user asks for it (e.g., "run on player", "standalone", "実機で実行"), or when player-only behavior must be verified (code inside #if !UNITY_EDITOR, Resources-based loading, IL2CPP, player-build hooks such as ITestPlayerBuildModifier). Pick the section below by target platform.
Standalone Player
For a standalone player running on the host OS (macOS, Windows, or Linux): Read ${CLAUDE_SKILL_DIR}/resources/run-on-standalone-player.md. It covers the build-and-run procedure and troubleshooting including Player.log locations.
Other Players
TBD
Visual Verification
A test method carrying [Category("VisualVerification")] has no Assert statements (see test-writing-guide skill), so Passed only means the test ran without throwing — it says nothing about whether the screen actually looks right. That judgment has to come from analyzing the screenshot the test captured.
Only analyze when the run was to confirm a change made in this session — production code, test code, a scene, a prefab, or another asset. Skip the analysis when nothing is under verification: a regression run over unchanged code, or when the user only asked whether the tests pass. When in doubt, skip.
This applies to Editor runs (run_unity_tests) only. A standalone-player run writes Temp/PlayerTestResult.txt, not an XML result file, and on macOS the Player's persistentDataPath differs from the Editor's — see resources/run-on-standalone-player.md. [TakeScreenshot] itself is Play Mode only.
Procedure
- Run:
python3 ${CLAUDE_SKILL_DIR}/scripts/extract-visual-verification.py <unity-project-root>This prints, per[Category("VisualVerification")]test found inApplication.persistentDataPath/TestResults.xml, its NUnitresult, itsDescriptionproperty (the verification aspects), and itsScreenshotpropert(y/ies) (absolute path(s)). See the script's own comments for why an XML library is used instead of grep/awk (class-scoped[Category]lands on the ancestor<test-suite>, not the<test-case>; a test can record more than oneScreenshot). - Check freshness before trusting the output: compare the printed list of "All N test(s) in this result file" against the tests you actually just ran. A filtered run's XML contains only the test-cases that were executed, so a mismatch (extra tests you didn't run, or missing ones you did) means this file is from an earlier run —
TestResults.xmlis overwritten on each run, not appended. Treat the printed age (— N seconds ago) as a secondary signal only; it can't discriminate a stale file from a few minutes ago from a run that legitimately took a few minutes. On either signal of staleness, stop and report it instead of analyzing. - For each test whose
resultisPassed, read the image(s) at itsScreenshotpath(s) and judge them against the aspects listed inDescription. Report each aspect's verdict with what you actually saw in the image. - For a test whose
resultis notPassed, do not analyze — report it as a failure instead (the screenshot, if any, may be from a partial run).
If no TestResults.xml is found (exit code 3)
Whether TestResults.xml is written under persistentDataPath depends on the project (e.g., the com.unity.test-framework.performance package's RunFinished callback writes it). If it is absent, fall back:
- Screenshot paths:
[TakeScreenshot]/ScreenshotHelperlogSave screenshot to <absolute path>on every capture. Find the current log file (compare mtimes ofEditor.logandEditor-prev.log— seeresources/troubleshooting-run-unity-tests.md→ "Editor.log vs Editor-prev.log"), then take theSave screenshot tolines that appear after the last- Finished resetting the current domainline (the lifecycle marker for the run you just triggered — same resource, "Tests launched but timed out" table). - Verification aspects: read the
[Description(...)]attribute directly from the test's source file.
Helper script
${CLAUDE_SKILL_DIR}/scripts/get-persistent-data-path.sh <unity-project-root> prints the Editor's Application.persistentDataPath for the current OS (from companyName/productName in ProjectSettings/ProjectSettings.asset, per Unity's docs). extract-visual-verification.py calls it automatically; use it directly only when you need the raw directory.
Rules for Test Failures
If the same test(s) fail on two or more consecutive runs, stop and consult the user rather than continuing to fix.
When consulting, clarify:
- Current failure status: what is failing and the likely cause
- Fix history: what was changed, how many times, and the scope of impact
- Planned approach: what options are being considered next
Troubleshooting
Read the appropriate resource file based on the situation:
- Any Unity MCP tool (
run_unity_tests,unity_play_control,get_unity_compilation_result) is not available or fails with a connection error: Read${CLAUDE_SKILL_DIR}/resources/troubleshooting-run-unity-tests.md - A test fails due to an assertion, constraint, or comparer in the
TestHelpernamespace (excludingTestHelper.UI): Read${CLAUDE_SKILL_DIR}/resources/troubleshooting-test-helper.md - A test fails due to an exception thrown from the
TestHelper.UInamespace: Read${CLAUDE_SKILL_DIR}/resources/troubleshooting-test-helper-ui.md
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

