dev-gom/claude-code-marketplace/unity-test-runner
Claude Code and agent skill by dev-gom/claude-code-marketplace
- community
Checking that the SKILL.md file is still in the repository.
Execute and analyze Unity Test Framework tests from the command line. This skill automates test execution for Unity projects by detecting the Unity Editor, configuring test parameters (EditMode/PlayMode), running tests via CLI, parsing XML results, and generating detailed failure reports. Use this when running Unity tests, validating game logic, or debugging test failures.
Install
npx vskill@latest install dev-gom/claude-code-marketplace/unity-test-runnerSKILL.md
The same SKILL.md was published earlier as majiayu000/claude-skill-registry/unity-test-runner.
Unity Test Runner
Overview
This skill enables automated execution and analysis of Unity Test Framework tests directly from the command line. It handles the complete test workflow: detecting Unity Editor installations across platforms (Windows/macOS/Linux), configuring test parameters, executing tests in EditMode or PlayMode, parsing NUnit XML results, and generating detailed failure reports with actionable insights.
When to Use This Skill
Use this skill when:
- Executing Unity Test Framework tests from command line
- Running PlayMode or EditMode tests for game logic validation
- Analyzing test failures and generating failure reports
- Integrating Unity tests into CI/CD pipelines
- Debugging test failures with detailed stack traces and file locations
- Validating Unity project changes before commits
Example user requests:
- "Run all Unity tests in my project"
- "Execute PlayMode tests and show me the results"
- "Run tests in the Combat category"
- "Check if my Unity tests are passing"
- "Run EditMode tests only"
Workflow
Follow this workflow when the skill is invoked:
1. Detect Unity Editor Installation
Use the find-unity-editor.js script to automatically locate the Unity Editor:
Script behavior:
- Scans platform-specific default installation paths
- Detects all installed Unity versions
- Returns the latest version by default
- Can target specific version with
--version <version>flag
Output:
If multiple versions are found:
- Present all available versions to the user
- Ask user to confirm which version to use
- Or use the latest version by default
If no Unity Editor is found:
- Report error with searched paths
- Ask user to provide Unity Editor path manually
- Store the path for future use
2. Verify Unity Project Path
Confirm the current directory contains a valid Unity project using cross-platform checks:
Validation steps:
- Verify
Assets/directory exists - Verify
ProjectSettings/ProjectVersion.txtexists - Read
ProjectVersion.txtto get Unity version - Warn if Editor version doesn't match project version
Example ProjectVersion.txt:
3. Configure Test Settings
Determine test execution parameters. Use AskUserQuestion tool if parameters are not specified:
Required settings:
- Test Mode: EditMode, PlayMode, or Both
- Test Platform: EditMode tests use "EditMode", PlayMode can specify platform (e.g., "StandaloneWindows64", "Android", "iOS")
Optional settings:
- Test Categories: Semicolon-separated list (e.g., "Combat;AI;Physics")
- Test Filter: Regex pattern or semicolon-separated test names
- Results Output Path: Default to
TestResults.xmlin project root
Configuration example:
4. Execute Tests via Command Line
Build and execute the Unity command line test command:
Command structure:
Example commands:
EditMode tests:
PlayMode tests with category filter:
Execution notes:
- Use
Bashtool withrun_in_background: truefor long-running tests - Set timeout appropriately (default: 5-10 minutes, adjust based on test count)
- Monitor output for progress indicators
- Capture both stdout and stderr
Example execution:
5. Parse Test Results
After tests complete, parse the NUnit XML results using parse-test-results.js:
Script output:
Result analysis:
- Extract test summary statistics
- Identify all failed tests
- Extract file paths and line numbers from stack traces
- Categorize failures by type (assertion, exception, timeout)
6. Analyze Test Failures
For each failed test, analyze the failure using references/test-patterns.json:
Analysis steps:
- Load test patterns database:
- Match failure message against patterns:
- Assertion failures:
Expected: <X> But was: <Y> - Null reference failures:
Expected: not null But was: <null> - Timeout failures:
TimeoutException|Test exceeded time limit - Threading errors:
Can't be called from.*main thread - Object lifetime issues:
has been destroyed|MissingReferenceException
- Determine failure category:
- ValueMismatch: Incorrect assertion value
- NullValue: Unexpected null reference
- Performance: Timeout or slow execution
- TestSetup: Setup/TearDown failure
- ObjectLifetime: Destroyed object access
- Threading: Wrong thread execution
- Generate fix suggestions:
- Load common solutions from test-patterns.json
- Match solutions to failure pattern
- Provide concrete code examples
Example failure analysis:
7. Generate Test Report
Create a comprehensive test report for the user:
Report structure:
Report delivery:
- Present report in formatted Markdown
- Highlight critical failures
- Provide file:line references for quick navigation
- Offer to help fix specific failures if user requests
Best Practices
When using this skill:
- Run EditMode tests first - They're faster and catch basic logic errors
- Reserve PlayMode tests for Unity-specific features
- Use EditMode for pure C# logic and data structures
- Use test categories - Filter tests for faster iteration
-testCategory "Combat"runs only Combat tests- Helpful during active development of specific features
- Monitor test duration - Set appropriate timeouts
- EditMode: 1-3 minutes typical
- PlayMode: 5-15 minutes typical
- Adjust timeout based on test count
- Check Unity version compatibility - Ensure Editor matches project version
- Mismatched versions may cause test failures
- Test results may be inconsistent across versions
- Parse results immediately - Don't wait for manual review
- Automated parsing catches issues faster
- Provides actionable file:line information
- Analyze failure patterns - Look for common causes
- Similar failures often indicate systemic issues
- Fix root cause instead of individual symptoms
- Preserve test results - Keep XML files for debugging
- Results contain full stack traces
- Useful for comparing test runs
- Handle long-running tests - Use background execution
- Monitor progress with
BashOutputtool - Provide status updates to user
Resources
scripts/find-unity-editor.js
Cross-platform Unity Editor path detection script. Automatically scans default installation directories for Windows, macOS, and Linux, detects all installed Unity versions, and returns the latest version or a specific requested version.
Usage:
Output: JSON with Unity Editor path, version, platform, and all available versions.
scripts/parse-test-results.js
NUnit XML results parser for Unity Test Framework output. Extracts test statistics, failure details, stack traces, and file locations from XML results.
Usage:
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingplugins/unity-dev-toolkit/skills/unity-test-runner/SKILL.md
Popularity
- Repository stars
- 97
- Repository forks
- 11
- 7-day trend score
- 0
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/dev-gom/claude-code-marketplace/unity-test-runner)