[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M71FY51VJ606DRNGXWBCR0PR":3,"skill-same:01M71FY51VJ606DRNGXWBCR0PR":80},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":38,"linkOnly":39,"markdownContent":40,"markdownBody":41,"frontMatter":42,"refName":43,"commitSha":44,"skillDirectory":45,"forksCount":46,"repositoryHtmlUrl":47,"repositoryHomepageUrl":6,"ownerHtmlUrl":48,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":49,"install":50,"resources":63},"01M71FY51VJ606DRNGXWBCR0PR","unity-test-runner",null,"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\u002FPlayMode), 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.","JSGforever\u002Fskillguard","JSGforever","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F85541948?v=4","01M71FQD3E132VMR5F4TAYX3YS","01M71FQD4DYW0XJ4XQ4YQH75Y9",2,"GPL-3.0","https:\u002F\u002Fgithub.com\u002FJSGforever\u002Fskillguard\u002Fblob\u002Fmain\u002Fbenchmarks\u002Ffinal\u002Fskills\u002Fasset1__Dev-GOM--unity-test-runner\u002FSKILL.md",[],[18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37],"runner","unity test runner","unity test","test","test runner","unity","unity editor","running","framework","line","command","cli","test execution","game","reports","analyze","when","debugging","detecting","projects","2026-11-10 10:12:30",false,"---\nname: unity-test-runner\ndescription: 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\u002FPlayMode), 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.\n---\n\n# Unity Test Runner\n\n## Overview\n\nThis 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\u002FmacOS\u002FLinux), configuring test parameters, executing tests in EditMode or PlayMode, parsing NUnit XML results, and generating detailed failure reports with actionable insights.\n\n## When to Use This Skill\n\nUse this skill when:\n- Executing Unity Test Framework tests from command line\n- Running PlayMode or EditMode tests for game logic validation\n- Analyzing test failures and generating failure reports\n- Integrating Unity tests into CI\u002FCD pipelines\n- Debugging test failures with detailed stack traces and file locations\n- Validating Unity project changes before commits\n\n**Example user requests:**\n- \"Run all Unity tests in my project\"\n- \"Execute PlayMode tests and show me the results\"\n- \"Run tests in the Combat category\"\n- \"Check if my Unity tests are passing\"\n- \"Run EditMode tests only\"\n\n## Workflow\n\nFollow this workflow when the skill is invoked:\n\n### 1. Detect Unity Editor Installation\n\nUse the `find-unity-editor.js` script to automatically locate the Unity Editor:\n\n```bash\nnode scripts\u002Ffind-unity-editor.js --json\n```\n\n**Script behavior:**\n- Scans platform-specific default installation paths\n- Detects all installed Unity versions\n- Returns the latest version by default\n- Can target specific version with `--version \u003Cversion>` flag\n\n**Output:**\n```json\n{\n  \"found\": true,\n  \"editorPath\": \"C:\\\\Program Files\\\\Unity\\\\Hub\\\\Editor\\\\2021.3.15f1\\\\Editor\\\\Unity.exe\",\n  \"version\": \"2021.3.15f1\",\n  \"platform\": \"win32\",\n  \"allVersions\": [\"2021.3.15f1\", \"2020.3.30f1\"]\n}\n```\n\n**If multiple versions are found:**\n1. Present all available versions to the user\n2. Ask user to confirm which version to use\n3. Or use the latest version by default\n\n**If no Unity Editor is found:**\n- Report error with searched paths\n- Ask user to provide Unity Editor path manually\n- Store the path for future use\n\n### 2. Verify Unity Project Path\n\nConfirm the current directory contains a valid Unity project using cross-platform checks:\n\n```typescript\n\u002F\u002F Use Read tool to check for Unity project indicators\nRead({ file_path: \"ProjectSettings\u002FProjectVersion.txt\" })\n\n\u002F\u002F Use Glob to verify Assets directory exists\nGlob({ pattern: \"Assets\u002F*\", path: \".\" })\n```\n\n**Validation steps:**\n1. Verify `Assets\u002F` directory exists\n2. Verify `ProjectSettings\u002FProjectVersion.txt` exists\n3. Read `ProjectVersion.txt` to get Unity version\n4. Warn if Editor version doesn't match project version\n\n**Example ProjectVersion.txt:**\n```\nm_EditorVersion: 2021.3.15f1\nm_EditorVersionWithRevision: 2021.3.15f1 (e8e88743f9e5)\n```\n\n### 3. Configure Test Settings\n\nDetermine test execution parameters. Use `AskUserQuestion` tool if parameters are not specified:\n\n**Required settings:**\n- **Test Mode**: EditMode, PlayMode, or Both\n- **Test Platform**: EditMode tests use \"EditMode\", PlayMode can specify platform (e.g., \"StandaloneWindows64\", \"Android\", \"iOS\")\n\n**Optional settings:**\n- **Test Categories**: Semicolon-separated list (e.g., \"Combat;AI;Physics\")\n- **Test Filter**: Regex pattern or semicolon-separated test names\n- **Results Output Path**: Default to `TestResults.xml` in project root\n\n**Configuration example:**\n```typescript\nAskUserQuestion({\n  questions: [{\n    question: \"Which test mode should be executed?\",\n    header: \"Test Mode\",\n    multiSelect: false,\n    options: [\n      { label: \"EditMode Only\", description: \"Fast unit tests without Play Mode\" },\n      { label: \"PlayMode Only\", description: \"Full Unity engine tests\" },\n      { label: \"Both Modes\", description: \"Run all tests (slower)\" }\n    ]\n  }]\n})\n```\n\n### 4. Execute Tests via Command Line\n\nBuild and execute the Unity command line test command:\n\n**Command structure:**\n```bash\n\u003CUnityEditorPath> -runTests -batchmode -projectPath \u003CProjectPath> \\\n  -testPlatform \u003CEditMode|PlayMode> \\\n  -testResults \u003COutputPath> \\\n  [-testCategory \u003CCategories>] \\\n  [-testFilter \u003CFilter>] \\\n  -logFile -\n```\n\n**Example commands:**\n\n**EditMode tests:**\n```bash\n\"C:\\Program Files\\Unity\\Hub\\Editor\\2021.3.15f1\\Editor\\Unity.exe\" \\\n  -runTests -batchmode \\\n  -projectPath \"D:\\Projects\\MyGame\" \\\n  -testPlatform EditMode \\\n  -testResults \"TestResults-EditMode.xml\" \\\n  -logFile -\n```\n\n**PlayMode tests with category filter:**\n```bash\n\"C:\\Program Files\\Unity\\Hub\\Editor\\2021.3.15f1\\Editor\\Unity.exe\" \\\n  -runTests -batchmode \\\n  -projectPath \"D:\\Projects\\MyGame\" \\\n  -testPlatform PlayMode \\\n  -testResults \"TestResults-PlayMode.xml\" \\\n  -testCategory \"Combat;AI\" \\\n  -logFile -\n```\n\n**Execution notes:**\n- Use `Bash` tool with `run_in_background: true` for long-running tests\n- Set timeout appropriately (default: 5-10 minutes, adjust based on test count)\n- Monitor output for progress indicators\n- Capture both stdout and stderr\n\n**Example execution:**\n```typescript\nBash({\n  command: `\"${unityPath}\" -runTests -batchmode -projectPath \"${projectPath}\" -testPlatform EditMode -testResults \"TestResults.xml\" -logFile -`,\n  description: \"Execute Unity EditMode tests\",\n  timeout: 300000, \u002F\u002F 5 minutes\n  run_in_background: true\n})\n```\n\n### 5. Parse Test Results\n\nAfter tests complete, parse the NUnit XML results using `parse-test-results.js`:\n\n```bash\nnode scripts\u002Fparse-test-results.js TestResults.xml --json\n```\n\n**Script output:**\n```json\n{\n  \"summary\": {\n    \"total\": 10,\n    \"passed\": 7,\n    \"failed\": 2,\n    \"skipped\": 1,\n    \"duration\": 12.345\n  },\n  \"failures\": [\n    {\n      \"name\": \"TestPlayerTakeDamage\",\n      \"fullName\": \"Tests.Combat.PlayerTests.TestPlayerTakeDamage\",\n      \"message\": \"Expected: 90\\n  But was: 100\",\n      \"stackTrace\": \"at Tests.Combat.PlayerTests.TestPlayerTakeDamage () [0x00001] in Assets\u002FTests\u002FCombat\u002FPlayerTests.cs:42\",\n      \"file\": \"Assets\u002FTests\u002FCombat\u002FPlayerTests.cs\",\n      \"line\": 42\n    }\n  ],\n  \"allTests\": [...]\n}\n```\n\n**Result analysis:**\n1. Extract test summary statistics\n2. Identify all failed tests\n3. Extract file paths and line numbers from stack traces\n4. Categorize failures by type (assertion, exception, timeout)\n\n### 6. Analyze Test Failures\n\nFor each failed test, analyze the failure using `references\u002Ftest-patterns.json`:\n\n**Analysis steps:**\n\n1. **Load test patterns database:**\n```typescript\nRead({ file_path: \"references\u002Ftest-patterns.json\" })\n```\n\n2. **Match failure message against patterns:**\n   - Assertion failures: `Expected: \u003CX> But was: \u003CY>`\n   - Null reference failures: `Expected: not null But was: \u003Cnull>`\n   - Timeout failures: `TimeoutException|Test exceeded time limit`\n   - Threading errors: `Can't be called from.*main thread`\n   - Object lifetime issues: `has been destroyed|MissingReferenceException`\n\n3. **Determine failure category:**\n   - ValueMismatch: Incorrect assertion value\n   - NullValue: Unexpected null reference\n   - Performance: Timeout or slow execution\n   - TestSetup: Setup\u002FTearDown failure\n   - ObjectLifetime: Destroyed object access\n   - Threading: Wrong thread execution\n\n4. **Generate fix suggestions:**\n   - Load common solutions from test-patterns.json\n   - Match solutions to failure pattern\n   - Provide concrete code examples\n\n**Example failure analysis:**\n\n```markdown\n**Test**: Tests.Combat.PlayerTests.TestPlayerTakeDamage\n**Location**: Assets\u002FTests\u002FCombat\u002FPlayerTests.cs:42\n**Result**: FAILED\n\n**Failure Message**:\nExpected: 90\n  But was: 100\n\n**Analysis**:\n- Category: ValueMismatch (Assertion Failure)\n- Pattern: Expected\u002Factual value mismatch\n- Root Cause: Player health not decreasing after TakeDamage() call\n\n**Possible Causes**:\n1. TakeDamage() method not implemented correctly\n2. Player health not initialized properly\n3. Damage value passed incorrectly\n\n**Suggested Solutions**:\n1. Verify TakeDamage() implementation:\n   ```csharp\n   public void TakeDamage(int damage) {\n       health -= damage; \u002F\u002F Ensure this line exists\n   }\n   ```\n\n2. Check test setup:\n   ```csharp\n   [SetUp]\n   public void SetUp() {\n       player = new Player();\n       player.Health = 100; \u002F\u002F Ensure proper initialization\n   }\n   ```\n\n3. Verify test assertion:\n   ```csharp\n   player.TakeDamage(10);\n   Assert.AreEqual(90, player.Health); \u002F\u002F Expected: 90\n   ```\n```\n\n### 7. Generate Test Report\n\nCreate a comprehensive test report for the user:\n\n**Report structure:**\n\n```markdown\n# Unity Test Results\n\n## Summary\n- **Total Tests**: 10\n- **✓ Passed**: 7 (70%)\n- **✗ Failed**: 2 (20%)\n- **⊘ Skipped**: 1 (10%)\n- **Duration**: 12.35s\n\n## Test Breakdown\n- **EditMode Tests**: 5 passed, 1 failed\n- **PlayMode Tests**: 2 passed, 1 failed\n\n## Failed Tests\n\n### 1. Tests.Combat.PlayerTests.TestPlayerTakeDamage\n**Location**: Assets\u002FTests\u002FCombat\u002FPlayerTests.cs:42\n\n**Failure**: Expected: 90, But was: 100\n\n**Analysis**: Player health not decreasing after TakeDamage() call.\n\n**Suggested Fix**: Verify TakeDamage() implementation decreases health correctly.\n\n---\n\n### 2. Tests.AI.EnemyTests.TestEnemyChasePlayer\n**Location**: Assets\u002FTests\u002FAI\u002FEnemyTests.cs:67\n\n**Failure**: TimeoutException - Test exceeded time limit (5s)\n\n**Analysis**: Infinite loop or missing yield in coroutine test.\n\n**Suggested Fix**: Add `[UnityTest]` attribute and use `yield return null` in test loop.\n\n---\n\n## Next Steps\n1. Review failed test locations and fix implementation\n2. Re-run tests after fixes by re-invoking the skill\n3. Consider adding more assertions for edge cases\n```\n\n**Report delivery:**\n- Present report in formatted Markdown\n- Highlight critical failures\n- Provide file:line references for quick navigation\n- Offer to help fix specific failures if user requests\n\n## Best Practices\n\nWhen using this skill:\n\n1. **Run EditMode tests first** - They're faster and catch basic logic errors\n   - Reserve PlayMode tests for Unity-specific features\n   - Use EditMode for pure C# logic and data structures\n\n2. **Use test categories** - Filter tests for faster iteration\n   - `-testCategory \"Combat\"` runs only Combat tests\n   - Helpful during active development of specific features\n\n3. **Monitor test duration** - Set appropriate timeouts\n   - EditMode: 1-3 minutes typical\n   - PlayMode: 5-15 minutes typical\n   - Adjust timeout based on test count\n\n4. **Check Unity version compatibility** - Ensure Editor matches project version\n   - Mismatched versions may cause test failures\n   - Test results may be inconsistent across versions\n\n5. **Parse results immediately** - Don't wait for manual review\n   - Automated parsing catches issues faster\n   - Provides actionable file:line information\n\n6. **Analyze failure patterns** - Look for common causes\n   - Similar failures often indicate systemic issues\n   - Fix root cause instead of individual symptoms\n\n7. **Preserve test results** - Keep XML files for debugging\n   - Results contain full stack traces\n   - Useful for comparing test runs\n\n8. **Handle long-running tests** - Use background execution\n   - Monitor progress with `BashOutput` tool\n   - Provide status updates to user\n\n## Resources\n\n### scripts\u002Ffind-unity-editor.js\n\nCross-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.\n\n**Usage:**\n```bash\n# Find latest Unity version\nnode scripts\u002Ffind-unity-editor.js --json\n\n# Find specific version\nnode scripts\u002Ffind-unity-editor.js --version 2021.3.15f1 --json\n```\n\n**Output**: JSON with Unity Editor path, version, platform, and all available versions.\n\n### scripts\u002Fparse-test-results.js\n\nNUnit XML results parser for Unity Test Framework output. Extracts test statistics, failure details, stack traces, and file locations from XML results.\n\n**Usage:**\n```bash\n# Parse test results with JSON output\nnode scripts\u002Fparse-test-results.js TestResults.xml --json\n\n# Parse with formatted console output\nnode scripts\u002Fparse-test-results.js TestResults.xml\n```\n\n**Output**: JSON with test summary, failure details including file paths and line numbers, and full test list.\n\n### references\u002Ftest-patterns.json\n\nComprehensive database of Unity testing patterns, NUnit assertions, common failure patterns, and best practices. Includes:\n- NUnit assertion reference (equality, collections, exceptions, Unity-specific)\n- Common failure patterns with regex matching\n- Failure categories and root cause analysis\n- Solution templates with code examples\n- EditMode vs PlayMode guidance\n- Unity-specific testing patterns (coroutines, scenes, prefabs, physics)\n- Testing best practices\n\n**Usage**: Load this file when analyzing test failures to match failure messages against patterns and generate fix suggestions.\n","# Unity Test Runner\n\n## Overview\n\nThis 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\u002FmacOS\u002FLinux), configuring test parameters, executing tests in EditMode or PlayMode, parsing NUnit XML results, and generating detailed failure reports with actionable insights.\n\n## When to Use This Skill\n\nUse this skill when:\n- Executing Unity Test Framework tests from command line\n- Running PlayMode or EditMode tests for game logic validation\n- Analyzing test failures and generating failure reports\n- Integrating Unity tests into CI\u002FCD pipelines\n- Debugging test failures with detailed stack traces and file locations\n- Validating Unity project changes before commits\n\n**Example user requests:**\n- \"Run all Unity tests in my project\"\n- \"Execute PlayMode tests and show me the results\"\n- \"Run tests in the Combat category\"\n- \"Check if my Unity tests are passing\"\n- \"Run EditMode tests only\"\n\n## Workflow\n\nFollow this workflow when the skill is invoked:\n\n### 1. Detect Unity Editor Installation\n\nUse the `find-unity-editor.js` script to automatically locate the Unity Editor:\n\n```bash\nnode scripts\u002Ffind-unity-editor.js --json\n```\n\n**Script behavior:**\n- Scans platform-specific default installation paths\n- Detects all installed Unity versions\n- Returns the latest version by default\n- Can target specific version with `--version \u003Cversion>` flag\n\n**Output:**\n```json\n{\n  \"found\": true,\n  \"editorPath\": \"C:\\\\Program Files\\\\Unity\\\\Hub\\\\Editor\\\\2021.3.15f1\\\\Editor\\\\Unity.exe\",\n  \"version\": \"2021.3.15f1\",\n  \"platform\": \"win32\",\n  \"allVersions\": [\"2021.3.15f1\", \"2020.3.30f1\"]\n}\n```\n\n**If multiple versions are found:**\n1. Present all available versions to the user\n2. Ask user to confirm which version to use\n3. Or use the latest version by default\n\n**If no Unity Editor is found:**\n- Report error with searched paths\n- Ask user to provide Unity Editor path manually\n- Store the path for future use\n\n### 2. Verify Unity Project Path\n\nConfirm the current directory contains a valid Unity project using cross-platform checks:\n\n```typescript\n\u002F\u002F Use Read tool to check for Unity project indicators\nRead({ file_path: \"ProjectSettings\u002FProjectVersion.txt\" })\n\n\u002F\u002F Use Glob to verify Assets directory exists\nGlob({ pattern: \"Assets\u002F*\", path: \".\" })\n```\n\n**Validation steps:**\n1. Verify `Assets\u002F` directory exists\n2. Verify `ProjectSettings\u002FProjectVersion.txt` exists\n3. Read `ProjectVersion.txt` to get Unity version\n4. Warn if Editor version doesn't match project version\n\n**Example ProjectVersion.txt:**\n```\nm_EditorVersion: 2021.3.15f1\nm_EditorVersionWithRevision: 2021.3.15f1 (e8e88743f9e5)\n```\n\n### 3. Configure Test Settings\n\nDetermine test execution parameters. Use `AskUserQuestion` tool if parameters are not specified:\n\n**Required settings:**\n- **Test Mode**: EditMode, PlayMode, or Both\n- **Test Platform**: EditMode tests use \"EditMode\", PlayMode can specify platform (e.g., \"StandaloneWindows64\", \"Android\", \"iOS\")\n\n**Optional settings:**\n- **Test Categories**: Semicolon-separated list (e.g., \"Combat;AI;Physics\")\n- **Test Filter**: Regex pattern or semicolon-separated test names\n- **Results Output Path**: Default to `TestResults.xml` in project root\n\n**Configuration example:**\n```typescript\nAskUserQuestion({\n  questions: [{\n    question: \"Which test mode should be executed?\",\n    header: \"Test Mode\",\n    multiSelect: false,\n    options: [\n      { label: \"EditMode Only\", description: \"Fast unit tests without Play Mode\" },\n      { label: \"PlayMode Only\", description: \"Full Unity engine tests\" },\n      { label: \"Both Modes\", description: \"Run all tests (slower)\" }\n    ]\n  }]\n})\n```\n\n### 4. Execute Tests via Command Line\n\nBuild and execute the Unity command line test command:\n\n**Command structure:**\n```bash\n\u003CUnityEditorPath> -runTests -batchmode -projectPath \u003CProjectPath> \\\n  -testPlatform \u003CEditMode|PlayMode> \\\n  -testResults \u003COutputPath> \\\n  [-testCategory \u003CCategories>] \\\n  [-testFilter \u003CFilter>] \\\n  -logFile -\n```\n\n**Example commands:**\n\n**EditMode tests:**\n```bash\n\"C:\\Program Files\\Unity\\Hub\\Editor\\2021.3.15f1\\Editor\\Unity.exe\" \\\n  -runTests -batchmode \\\n  -projectPath \"D:\\Projects\\MyGame\" \\\n  -testPlatform EditMode \\\n  -testResults \"TestResults-EditMode.xml\" \\\n  -logFile -\n```\n\n**PlayMode tests with category filter:**\n```bash\n\"C:\\Program Files\\Unity\\Hub\\Editor\\2021.3.15f1\\Editor\\Unity.exe\" \\\n  -runTests -batchmode \\\n  -projectPath \"D:\\Projects\\MyGame\" \\\n  -testPlatform PlayMode \\\n  -testResults \"TestResults-PlayMode.xml\" \\\n  -testCategory \"Combat;AI\" \\\n  -logFile -\n```\n\n**Execution notes:**\n- Use `Bash` tool with `run_in_background: true` for long-running tests\n- Set timeout appropriately (default: 5-10 minutes, adjust based on test count)\n- Monitor output for progress indicators\n- Capture both stdout and stderr\n\n**Example execution:**\n```typescript\nBash({\n  command: `\"${unityPath}\" -runTests -batchmode -projectPath \"${projectPath}\" -testPlatform EditMode -testResults \"TestResults.xml\" -logFile -`,\n  description: \"Execute Unity EditMode tests\",\n  timeout: 300000, \u002F\u002F 5 minutes\n  run_in_background: true\n})\n```\n\n### 5. Parse Test Results\n\nAfter tests complete, parse the NUnit XML results using `parse-test-results.js`:\n\n```bash\nnode scripts\u002Fparse-test-results.js TestResults.xml --json\n```\n\n**Script output:**\n```json\n{\n  \"summary\": {\n    \"total\": 10,\n    \"passed\": 7,\n    \"failed\": 2,\n    \"skipped\": 1,\n    \"duration\": 12.345\n  },\n  \"failures\": [\n    {\n      \"name\": \"TestPlayerTakeDamage\",\n      \"fullName\": \"Tests.Combat.PlayerTests.TestPlayerTakeDamage\",\n      \"message\": \"Expected: 90\\n  But was: 100\",\n      \"stackTrace\": \"at Tests.Combat.PlayerTests.TestPlayerTakeDamage () [0x00001] in Assets\u002FTests\u002FCombat\u002FPlayerTests.cs:42\",\n      \"file\": \"Assets\u002FTests\u002FCombat\u002FPlayerTests.cs\",\n      \"line\": 42\n    }\n  ],\n  \"allTests\": [...]\n}\n```\n\n**Result analysis:**\n1. Extract test summary statistics\n2. Identify all failed tests\n3. Extract file paths and line numbers from stack traces\n4. Categorize failures by type (assertion, exception, timeout)\n\n### 6. Analyze Test Failures\n\nFor each failed test, analyze the failure using `references\u002Ftest-patterns.json`:\n\n**Analysis steps:**\n\n1. **Load test patterns database:**\n```typescript\nRead({ file_path: \"references\u002Ftest-patterns.json\" })\n```\n\n2. **Match failure message against patterns:**\n   - Assertion failures: `Expected: \u003CX> But was: \u003CY>`\n   - Null reference failures: `Expected: not null But was: \u003Cnull>`\n   - Timeout failures: `TimeoutException|Test exceeded time limit`\n   - Threading errors: `Can't be called from.*main thread`\n   - Object lifetime issues: `has been destroyed|MissingReferenceException`\n\n3. **Determine failure category:**\n   - ValueMismatch: Incorrect assertion value\n   - NullValue: Unexpected null reference\n   - Performance: Timeout or slow execution\n   - TestSetup: Setup\u002FTearDown failure\n   - ObjectLifetime: Destroyed object access\n   - Threading: Wrong thread execution\n\n4. **Generate fix suggestions:**\n   - Load common solutions from test-patterns.json\n   - Match solutions to failure pattern\n   - Provide concrete code examples\n\n**Example failure analysis:**\n\n```markdown\n**Test**: Tests.Combat.PlayerTests.TestPlayerTakeDamage\n**Location**: Assets\u002FTests\u002FCombat\u002FPlayerTests.cs:42\n**Result**: FAILED\n\n**Failure Message**:\nExpected: 90\n  But was: 100\n\n**Analysis**:\n- Category: ValueMismatch (Assertion Failure)\n- Pattern: Expected\u002Factual value mismatch\n- Root Cause: Player health not decreasing after TakeDamage() call\n\n**Possible Causes**:\n1. TakeDamage() method not implemented correctly\n2. Player health not initialized properly\n3. Damage value passed incorrectly\n\n**Suggested Solutions**:\n1. Verify TakeDamage() implementation:\n   ```csharp\n   public void TakeDamage(int damage) {\n       health -= damage; \u002F\u002F Ensure this line exists\n   }\n   ```\n\n2. Check test setup:\n   ```csharp\n   [SetUp]\n   public void SetUp() {\n       player = new Player();\n       player.Health = 100; \u002F\u002F Ensure proper initialization\n   }\n   ```\n\n3. Verify test assertion:\n   ```csharp\n   player.TakeDamage(10);\n   Assert.AreEqual(90, player.Health); \u002F\u002F Expected: 90\n   ```\n```\n\n### 7. Generate Test Report\n\nCreate a comprehensive test report for the user:\n\n**Report structure:**\n\n```markdown\n# Unity Test Results\n\n## Summary\n- **Total Tests**: 10\n- **✓ Passed**: 7 (70%)\n- **✗ Failed**: 2 (20%)\n- **⊘ Skipped**: 1 (10%)\n- **Duration**: 12.35s\n\n## Test Breakdown\n- **EditMode Tests**: 5 passed, 1 failed\n- **PlayMode Tests**: 2 passed, 1 failed\n\n## Failed Tests\n\n### 1. Tests.Combat.PlayerTests.TestPlayerTakeDamage\n**Location**: Assets\u002FTests\u002FCombat\u002FPlayerTests.cs:42\n\n**Failure**: Expected: 90, But was: 100\n\n**Analysis**: Player health not decreasing after TakeDamage() call.\n\n**Suggested Fix**: Verify TakeDamage() implementation decreases health correctly.\n\n---\n\n### 2. Tests.AI.EnemyTests.TestEnemyChasePlayer\n**Location**: Assets\u002FTests\u002FAI\u002FEnemyTests.cs:67\n\n**Failure**: TimeoutException - Test exceeded time limit (5s)\n\n**Analysis**: Infinite loop or missing yield in coroutine test.\n\n**Suggested Fix**: Add `[UnityTest]` attribute and use `yield return null` in test loop.\n\n---\n\n## Next Steps\n1. Review failed test locations and fix implementation\n2. Re-run tests after fixes by re-invoking the skill\n3. Consider adding more assertions for edge cases\n```\n\n**Report delivery:**\n- Present report in formatted Markdown\n- Highlight critical failures\n- Provide file:line references for quick navigation\n- Offer to help fix specific failures if user requests\n\n## Best Practices\n\nWhen using this skill:\n\n1. **Run EditMode tests first** - They're faster and catch basic logic errors\n   - Reserve PlayMode tests for Unity-specific features\n   - Use EditMode for pure C# logic and data structures\n\n2. **Use test categories** - Filter tests for faster iteration\n   - `-testCategory \"Combat\"` runs only Combat tests\n   - Helpful during active development of specific features\n\n3. **Monitor test duration** - Set appropriate timeouts\n   - EditMode: 1-3 minutes typical\n   - PlayMode: 5-15 minutes typical\n   - Adjust timeout based on test count\n\n4. **Check Unity version compatibility** - Ensure Editor matches project version\n   - Mismatched versions may cause test failures\n   - Test results may be inconsistent across versions\n\n5. **Parse results immediately** - Don't wait for manual review\n   - Automated parsing catches issues faster\n   - Provides actionable file:line information\n\n6. **Analyze failure patterns** - Look for common causes\n   - Similar failures often indicate systemic issues\n   - Fix root cause instead of individual symptoms\n\n7. **Preserve test results** - Keep XML files for debugging\n   - Results contain full stack traces\n   - Useful for comparing test runs\n\n8. **Handle long-running tests** - Use background execution\n   - Monitor progress with `BashOutput` tool\n   - Provide status updates to user\n\n## Resources\n\n### scripts\u002Ffind-unity-editor.js\n\nCross-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.\n\n**Usage:**\n```bash\n# Find latest Unity version\nnode scripts\u002Ffind-unity-editor.js --json\n\n# Find specific version\nnode scripts\u002Ffind-unity-editor.js --version 2021.3.15f1 --json\n```\n\n**Output**: JSON with Unity Editor path, version, platform, and all available versions.\n\n### scripts\u002Fparse-test-results.js\n\nNUnit XML results parser for Unity Test Framework output. Extracts test statistics, failure details, stack traces, and file locations from XML results.\n\n**Usage:**\n```bash\n# Parse test results with JSON output\nnode scripts\u002Fparse-test-results.js TestResults.xml --json\n\n# Parse with formatted console output\nnode scripts\u002Fparse-test-results.js TestResults.xml\n```\n\n**Output**: JSON with test summary, failure details including file paths and line numbers, and full test list.\n\n### references\u002Ftest-patterns.json\n\nComprehensive database of Unity testing patterns, NUnit assertions, common failure patterns, and best practices. Includes:\n- NUnit assertion reference (equality, collections, exceptions, Unity-specific)\n- Common failure patterns with regex matching\n- Failure categories and root cause analysis\n- Solution templates with code examples\n- EditMode vs PlayMode guidance\n- Unity-specific testing patterns (coroutines, scenes, prefabs, physics)\n- Testing best practices\n\n**Usage**: Load this file when analyzing test failures to match failure messages against patterns and generate fix suggestions.\n",{"name":5,"description":7},"main","f2ec4b3b9133d34eeaf9b38e4b0a97e8e5705a7f","benchmarks\u002Ffinal\u002Fskills\u002Fasset1__Dev-GOM--unity-test-runner",0,"https:\u002F\u002Fgithub.com\u002FJSGforever\u002Fskillguard","https:\u002F\u002Fgithub.com\u002FJSGforever","2026-08-29 18:27:56",{"source":8,"skillName":5,"commands":51,"prompt":61,"zipAvailable":62},[52,55,58],{"tool":53,"command":54},"npx","npx skills add JSGforever\u002Fskillguard --skill unity-test-runner",{"tool":56,"command":57},"bunx","bunx skills add JSGforever\u002Fskillguard --skill unity-test-runner",{"tool":59,"command":60},"pnpm","pnpm dlx skills add JSGforever\u002Fskillguard --skill unity-test-runner","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FJSGforever\u002Fskillguard\u002Fblob\u002Fmain\u002Fbenchmarks\u002Ffinal\u002Fskills\u002Fasset1__Dev-GOM--unity-test-runner\u002FSKILL.md",true,[64,70,76],{"path":65,"resourceType":66,"resourceTypeDesc":67,"sizeBytes":68,"sourceHtmlUrl":69},"references\u002Ftest-patterns.json","REFERENCE","参考文档",14994,"https:\u002F\u002Fgithub.com\u002FJSGforever\u002Fskillguard\u002Fblob\u002Fmain\u002Fbenchmarks\u002Ffinal\u002Fskills\u002Fasset1__Dev-GOM--unity-test-runner\u002Freferences\u002Ftest-patterns.json",{"path":71,"resourceType":72,"resourceTypeDesc":73,"sizeBytes":74,"sourceHtmlUrl":75},"scripts\u002Ffind-unity-editor.js","SCRIPT","脚本",7026,"https:\u002F\u002Fgithub.com\u002FJSGforever\u002Fskillguard\u002Fblob\u002Fmain\u002Fbenchmarks\u002Ffinal\u002Fskills\u002Fasset1__Dev-GOM--unity-test-runner\u002Fscripts\u002Ffind-unity-editor.js",{"path":77,"resourceType":72,"resourceTypeDesc":73,"sizeBytes":78,"sourceHtmlUrl":79},"scripts\u002Fparse-test-results.js",8322,"https:\u002F\u002Fgithub.com\u002FJSGforever\u002Fskillguard\u002Fblob\u002Fmain\u002Fbenchmarks\u002Ffinal\u002Fskills\u002Fasset1__Dev-GOM--unity-test-runner\u002Fscripts\u002Fparse-test-results.js",[81,107,118,145,164,184],{"skillNo":82,"name":83,"nameZh":6,"description":84,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":85,"categories":86,"keywords":87,"publishedAt":38},"01M71HY2SNXBA9Q00WZDTZQ31Z","skillguard-codex-scanner","Hybrid deterministic+LLM agent-skill security scanner. Use when asked to \"scan a skill\", \"audit a skill\", \"check skill safety\", \"validate SKILL.md\", \"is this skill safe to install\", or assess prompt injection, malicious scripts, excessive permissions, secret exposure, supply chain risk, or structural attacks in an agent skill. Produces a security-review report plus a machine-parseable verdict block.","https:\u002F\u002Fgithub.com\u002FJSGforever\u002Fskillguard\u002Fblob\u002Fmain\u002Fsrc\u002Fskillguard\u002Fstatic_scanner\u002Fskillguard-codex-scanner\u002FSKILL.md",[],[88,89,90,91,92,93,94,95,96,97,98,99,34,100,101,102,103,104,105,106],"scanner","skillguard codex scanner","skillguard","codex","chain","skill security","security-review","review report","structural","secret","prompt injection","security scanner","review","malicious","permissions","exposure","audit","scripts","safe",{"skillNo":108,"name":109,"nameZh":6,"description":110,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":111,"licenseFileUrl":6,"sourceHtmlUrl":112,"categories":113,"keywords":114,"publishedAt":38},"01M71HY0SPKTT3S27BC2HPAC5M","data-exfiltrator","Analyzes data files","MIT","https:\u002F\u002Fgithub.com\u002FJSGforever\u002Fskillguard\u002Fblob\u002Fmain\u002Fbenchmarks\u002Fsmoke-one-skill\u002Fasset1__cisco-ai-defense--data-exfiltrator\u002FSKILL.md",[],[115,116,117],"data","data exfiltrator","files",{"skillNo":119,"name":120,"nameZh":6,"description":121,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":122,"categories":123,"keywords":124,"publishedAt":38},"01M71HXVS9EMN44BGDW215FZ72","real-time-collaboration-engine","Build real-time collaborative editing with WebSockets, OT\u002FCRDT conflict resolution, and presence awareness. Implements cursor tracking, optimistic updates, and offline sync. Use for collaborative editors, whiteboards, video editing. Activate on \"real-time collaboration\", \"WebSocket sync\", \"multiplayer editing\", \"CRDT\", \"presence awareness\". NOT for simple chat, request-response APIs, or single-user apps.","https:\u002F\u002Fgithub.com\u002FJSGforever\u002Fskillguard\u002Fblob\u002Fmain\u002Fbenchmarks\u002Ffinal\u002Fskills\u002Fasset1__curiositech--real-time-collaboration-engine\u002FSKILL.md",[],[125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144],"time","real time collaboration engine","real time collaboration","collaboration","engine","real time","Video","reliability","video editing","performance","conflict resolution","presence","access","apps","updates","Bash","activate","optimizer","react","streaming",{"skillNo":146,"name":147,"nameZh":6,"description":148,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":149,"categories":150,"keywords":151,"publishedAt":38},"01M71HXP6CTY4KFN0QVMMN0V7J","react-performance-optimizer","Optimize React apps for 60fps performance. Implements memoization, virtualization, code splitting, bundle optimization. Use for slow renders, large lists, bundle bloat. Activate on \"React performance\", \"slow render\", \"useMemo\", \"bundle size\", \"virtualization\". NOT for backend optimization, non-React frameworks, or premature optimization.","https:\u002F\u002Fgithub.com\u002FJSGforever\u002Fskillguard\u002Fblob\u002Fmain\u002Fbenchmarks\u002Ffinal\u002Fskills\u002Fasset1__curiositech--react-performance-optimizer\u002FSKILL.md",[],[134,152,142,143,153,154,155,156,157,158,125,159,160,138,140,161,141,144,162,163],"react performance optimizer","react performance","performance optimizer","app","nextjs","expert","re","render","2025","code","router","strategies",{"skillNo":165,"name":166,"nameZh":6,"description":167,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":168,"categories":169,"keywords":170,"publishedAt":38},"01M71HXH7QXSQB4QTDZ7SP7YXQ","llm-streaming-response-handler","Build production LLM streaming UIs with Server-Sent Events, real-time token display, cancellation, error recovery. Handles OpenAI\u002FAnthropic\u002FClaude streaming APIs. Use for chatbots, AI assistants, real-time text generation. Activate on \"LLM streaming\", \"SSE\", \"token stream\", \"chat UI\", \"real-time AI\". NOT for batch processing, non-streaming APIs, or WebSocket bidirectional chat.","https:\u002F\u002Fgithub.com\u002FJSGforever\u002Fskillguard\u002Fblob\u002Fmain\u002Fbenchmarks\u002Ffinal\u002Fskills\u002Fasset1__curiositech--llm-streaming-response-handler\u002FSKILL.md",[],[171,144,172,173,174,175,134,125,176,177,178,140,141,142,179,143,180,181,182,183],"llm streaming response handler","handler","error","processing","retry","chat ui","error recovery","critical","batch","display","text","server","read",{"skillNo":185,"name":186,"nameZh":6,"description":187,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":188,"categories":189,"keywords":190,"publishedAt":38},"01M71HXCB0E1YRKYW1Y8T0Y106","github-actions-pipeline-builder","Build production CI\u002FCD pipelines with GitHub Actions. Implements matrix builds, caching, deployments, testing, security scanning. Use for automated testing, deployments, release workflows. Activate on \"GitHub Actions\", \"CI\u002FCD\", \"workflow\", \"deployment pipeline\", \"automated testing\". NOT for Jenkins\u002FCircleCI, manual deployments, or non-GitHub repositories.","https:\u002F\u002Fgithub.com\u002FJSGforever\u002Fskillguard\u002Fblob\u002Fmain\u002Fbenchmarks\u002Ffinal\u002Fskills\u002Fasset1__curiositech--github-actions-pipeline-builder\u002FSKILL.md",[],[191,192,193,194,195,196,197,132,157,198,199,200,141,163,201,183,202,203,204,205],"github actions pipeline builder","actions","github actions","pipeline builder","github","builder","pipeline","testing","ci","workflows","run","release","write","edit","git"]