Token导航 LogoToken导航

Agent Skill · 研究检索

unity-test-runner(Unity 测试 runner)

用于辅助测试设计、自动化测试、用例整理和回归验证。它适合让 Agent 编写单元测试、端到端测试、测试计划或根据失败日志定位问题。使用时需要确认项目测试框架、运行命令和夹具数据,避免为了通过测试而改坏真实逻辑;涉及浏览器或外部服务时,应区分本地模拟、测试环境和生产环境。

unity-test-runner 是研究检索类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为只读;许可证为 MIT,第三方扫描已通过,按安装量在研究检索类的 73,675 个 Skill 里排第 38,349。

总安装 1,572周安装 63GitHub Stars 82下载 509核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
MIT

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:unity-test-runner(Unity 测试 runner)
来源仓库:https://github.com/dev-gom/claude-code-marketplace
仓库路径:skills/unity-test-runner
安装命令:
npx skills add https://github.com/dev-gom/claude-code-marketplace --skill unity-test-runner
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/dev-gom/claude-code-marketplace --skill unity-test-runner

这个 Skill 是做什么的

研究检索类 Skill 主要解决「找资料、核对事实、把来源整理清楚」的问题,通常会让助手先检索再总结。

Unity 测试 Runner 搜索工具,用于查找自动化测试方案。适用于需要集成持续交付流水线或批量执行测试套件的场景。支持基于关键词匹配找到合适的测试框架配置方法。

安装命令:npx skills add https://github.com/dev-gom/claude-code-marketplace --skill unity-test-runner 需核实是否依赖特定 Unity 版本或构建平台

来源仓库内路径:skills/unity-test-runner

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/dev-gom/claude-code-marketplace --skill unity-…;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它标注为只读,先用只读任务试一次,确认行为符合预期再扩大使用范围。

常见问题

6 条

unity-test-runner 怎么安装?

在终端执行 npx skills add https://github.com/dev-gom/claude-code-marketplace --skill unity-test-runne…。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

unity-test-runner 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

unity-test-runner 需要什么权限?

权限级别是只读。该 Skill 主要提供规则、说明或参考内容,本身偏只读;真正读写文件、联网或执行命令仍取决于宿主 Agent 的任务。

unity-test-runner 是免费的吗?

来源标注的许可证是 MIT。本站不代收任何费用,也不托管安装包;能否商用、要不要署名,以许可证原文为准。

unity-test-runner 用的人多吗?

公开数据是累计安装 1,572 次,近一周安装 63 次,下载 509 次,GitHub 82 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

unity-test-runner 安全吗?

第三方扫描结果为通过,但这只覆盖已知的静态检查项,不能替代自己读一遍源码和安装命令。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 3 个目录同时收录,说明这个 Skill 流传比较广。
  • 许可证明确为 MIT,商用和分发边界好判断。
  • 第三方扫描已通过,常见的高风险行为没有命中。

先想清楚的地方

  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理研究检索类任务、又不想每次都手写提示词的人。
  • 需要许可证清楚、并且有第三方扫描结果的团队项目。

不太适合

  • 需要厂商级技术支持和 SLA 的生产系统。

研究检索类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
find-skills

寻找技能 · Codex、Claude

31,199,81316,486操作浏览器MIT有提醒
self-improving-agent

自我改进 Agent · OpenClaw

16,464,0023,396接触敏感数据MIT-0通过
soultrace

灵魂追踪 · Codex、Claude

7,588,94412需要联网未明确有提醒
self-improving

自我完善 · OpenClaw

6,829,2841,046需要联网MIT-0通过
microsoft-foundry

微软代工厂 · Codex、Claude

6,614,144764调用外部服务未明确有提醒
unity-test-runner

Unity 测试 runner · 本页

1,57282只读MIT通过

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

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:

node scripts/find-unity-editor.js --json

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:

{
  "found": true,
  "editorPath": "C:\\Program Files\\Unity\\Hub\\Editor\\2021.3.15f1\\Editor\\Unity.exe",
  "version": "2021.3.15f1",
  "platform": "win32",
  "allVersions": ["2021.3.15f1", "2020.3.30f1"]
}

If multiple versions are found:

  1. Present all available versions to the user
  2. Ask user to confirm which version to use
  3. 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:

// Use Read tool to check for Unity project indicators
Read({ file_path: "ProjectSettings/ProjectVersion.txt" })

// Use Glob to verify Assets directory exists
Glob({ pattern: "Assets/*", path: "." })

Validation steps:

  1. Verify Assets/ directory exists
  2. Verify ProjectSettings/ProjectVersion.txt exists
  3. Read ProjectVersion.txt to get Unity version
  4. Warn if Editor version doesn't match project version

Example ProjectVersion.txt:

m_EditorVersion: 2021.3.15f1
m_EditorVersionWithRevision: 2021.3.15f1 (e8e88743f9e5)

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.xml in project root

Configuration example:

AskUserQuestion({
  questions: [{
    question: "Which test mode should be executed?",
    header: "Test Mode",
    multiSelect: false,
    options: [
      { label: "EditMode Only", description: "Fast unit tests without Play Mode" },
      { label: "PlayMode Only", description: "Full Unity engine tests" },
      { label: "Both Modes", description: "Run all tests (slower)" }
    ]
  }]
})

4. Execute Tests via Command Line

Build and execute the Unity command line test command:

Command structure:

<UnityEditorPath> -runTests -batchmode -projectPath <ProjectPath> \
  -testPlatform <EditMode|PlayMode> \
  -testResults <OutputPath> \
  [-testCategory <Categories>] \
  [-testFilter <Filter>] \
  -logFile -

Example commands:

EditMode tests:

"C:\Program Files\Unity\Hub\Editor\2021.3.15f1\Editor\Unity.exe" \
  -runTests -batchmode \
  -projectPath "D:\Projects\MyGame" \
  -testPlatform EditMode \
  -testResults "TestResults-EditMode.xml" \
  -logFile -

PlayMode tests with category filter:

"C:\Program Files\Unity\Hub\Editor\2021.3.15f1\Editor\Unity.exe" \
  -runTests -batchmode \
  -projectPath "D:\Projects\MyGame" \
  -testPlatform PlayMode \
  -testResults "TestResults-PlayMode.xml" \
  -testCategory "Combat;AI" \
  -logFile -

Execution notes:

  • Use Bash tool with run_in_background: true for 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:

Bash({
  command: `"${unityPath}" -runTests -batchmode -projectPath "${projectPath}" -testPlatform EditMode -testResults "TestResults.xml" -logFile -`,
  description: "Execute Unity EditMode tests",
  timeout: 300000, // 5 minutes
  run_in_background: true
})

5. Parse Test Results

After tests complete, parse the NUnit XML results using parse-test-results.js:

node scripts/parse-test-results.js TestResults.xml --json

Script output:

{
  "summary": {
    "total": 10,
    "passed": 7,
    "failed": 2,
    "skipped": 1,
    "duration": 12.345
  },
  "failures": [
    {
      "name": "TestPlayerTakeDamage",
      "fullName": "Tests.Combat.PlayerTests.TestPlayerTakeDamage",
      "message": "Expected: 90\n  But was: 100",
      "stackTrace": "at Tests.Combat.PlayerTests.TestPlayerTakeDamage () [0x00001] in Assets/Tests/Combat/PlayerTests.cs:42",
      "file": "Assets/Tests/Combat/PlayerTests.cs",
      "line": 42
    }
  ],
  "allTests": [...]
}

Result analysis:

  1. Extract test summary statistics
  2. Identify all failed tests
  3. Extract file paths and line numbers from stack traces
  4. 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:

  1. Load test patterns database:
Read({ file_path: "references/test-patterns.json" })
  1. 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

  1. 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

  1. Generate fix suggestions:

- Load common solutions from test-patterns.json - Match solutions to failure pattern - Provide concrete code examples

Example failure analysis:

**Test**: Tests.Combat.PlayerTests.TestPlayerTakeDamage
**Location**: Assets/Tests/Combat/PlayerTests.cs:42
**Result**: FAILED

**Failure Message**:
Expected: 90
  But was: 100

**Analysis**:
- Category: ValueMismatch (Assertion Failure)
- Pattern: Expected/actual value mismatch
- Root Cause: Player health not decreasing after TakeDamage() call

**Possible Causes**:
1. TakeDamage() method not implemented correctly
2. Player health not initialized properly
3. Damage value passed incorrectly

**Suggested Solutions**:
1. Verify TakeDamage() implementation:

public void TakeDamage(int damage) { health -= damage; // Ensure this line exists }


1. Check test setup: `[SetUp] public void SetUp() {player = new Player(); player.Health = 100; // Ensure proper initialization}`
2. Verify test assertion: `player.TakeDamage(10); Assert.AreEqual(90, player.Health); // Expected: 90`

7. Generate Test Report

Create a comprehensive test report for the user:

Report structure:

# Unity Test Results

## Summary
- **Total Tests**: 10
- **✓ Passed**: 7 (70%)
- **✗ Failed**: 2 (20%)
- **⊘ Skipped**: 1 (10%)
- **Duration**: 12.35s

## Test Breakdown
- **EditMode Tests**: 5 passed, 1 failed
- **PlayMode Tests**: 2 passed, 1 failed

## Failed Tests

### 1. Tests.Combat.PlayerTests.TestPlayerTakeDamage
**Location**: Assets/Tests/Combat/PlayerTests.cs:42

**Failure**: Expected: 90, But was: 100

**Analysis**: Player health not decreasing after TakeDamage() call.

**Suggested Fix**: Verify TakeDamage() implementation decreases health correctly.

---

### 2. Tests.AI.EnemyTests.TestEnemyChasePlayer
**Location**: Assets/Tests/AI/EnemyTests.cs:67

**Failure**: TimeoutException - Test exceeded time limit (5s)

**Analysis**: Infinite loop or missing yield in coroutine test.

**Suggested Fix**: Add `[UnityTest]` attribute and use `yield return null` in test loop.

---

## Next Steps
1. Review failed test locations and fix implementation
2. Re-run tests after fixes by re-invoking the skill
3. Consider adding more assertions for edge cases

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:

  1. 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

  1. Use test categories - Filter tests for faster iteration

- -testCategory "Combat" runs only Combat tests - Helpful during active development of specific features

  1. Monitor test duration - Set appropriate timeouts

- EditMode: 1-3 minutes typical - PlayMode: 5-15 minutes typical - Adjust timeout based on test count

  1. Check Unity version compatibility - Ensure Editor matches project version

- Mismatched versions may cause test failures - Test results may be inconsistent across versions

  1. Parse results immediately - Don't wait for manual review

- Automated parsing catches issues faster - Provides actionable file:line information

  1. Analyze failure patterns - Look for common causes

- Similar failures often indicate systemic issues - Fix root cause instead of individual symptoms

  1. Preserve test results - Keep XML files for debugging

- Results contain full stack traces - Useful for comparing test runs

  1. Handle long-running tests - Use background execution

- Monitor progress with BashOutput tool - 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:

# Find latest Unity version
node scripts/find-unity-editor.js --json

# Find specific version
node scripts/find-unity-editor.js --version 2021.3.15f1 --json

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:

# Parse test results with JSON output
node scripts/parse-test-results.js TestResults.xml --json

# Parse with formatted console output
node scripts/parse-test-results.js TestResults.xml

Output: JSON with test summary, failure details including file paths and line numbers, and full test list.

references/test-patterns.json

Comprehensive database of Unity testing patterns, NUnit assertions, common failure patterns, and best practices. Includes:

  • NUnit assertion reference (equality, collections, exceptions, Unity-specific)
  • Common failure patterns with regex matching
  • Failure categories and root cause analysis
  • Solution templates with code examples
  • EditMode vs PlayMode guidance
  • Unity-specific testing patterns (coroutines, scenes, prefabs, physics)
  • Testing best practices

Usage: Load this file when analyzing test failures to match failure messages against patterns and generate fix suggestions.

平台分布

Claude Code

31.28%
按下载量换算159

Codex

22.58%
按下载量换算115

Gemini CLI

18.18%
按下载量换算93

OpenCode

13.95%
按下载量换算71

Cursor

8.25%
按下载量换算42

windsurf

3.43%
按下载量换算17

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

只读

该 Skill 主要提供规则、说明或参考内容,本身偏只读;真正读写文件、联网或执行命令仍取决于宿主 Agent 的任务。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。

继续浏览同类 Skills