plugins/unity-dev-toolkit/skills/unity-compile-fixer/SKILL.md
Detect and resolve Unity C# compilation errors using VSCode diagnostics. Use this skill when Unity projects have compilation errors that need diagnosis and automated fixes. Analyzes errors from VSCode Language Server, proposes solutions based on error patterns, and handles version control conflicts for Unity projects.
npx skillsauth add dev-gom/claude-code-marketplace unity-compile-fixerInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
This skill enables automatic detection and resolution of Unity C# compilation errors by leveraging VSCode's diagnostic system. It collects real-time errors from the OmniSharp C# language server, analyzes error patterns against a curated database of common Unity issues, and proposes context-aware solutions for user approval before applying fixes.
Use this skill when:
Example user requests:
Follow this workflow when the skill is invoked:
Use the mcp__ide__getDiagnostics tool to collect errors from VSCode:
// Collect all project diagnostics
mcp__ide__getDiagnostics()
// Or target specific Unity script files
mcp__ide__getDiagnostics({ uri: "file:///path/to/PlayerController.cs" })
Filter the diagnostics to focus on Unity-relevant errors:
severity: "Error" (ignore warnings)source: "csharp" (OmniSharp C# diagnostics)For each detected error:
Extract error information:
uri and rangemessage (e.g., "CS0246")Match against error pattern database:
references/error-patterns.jsonRead affected file context:
For each error, create a structured fix proposal:
**Error**: CS0246 at PlayerController.cs:45
**Message**: The type or namespace name 'Rigidbody' could not be found
**Analysis**:
- Missing using directive for UnityEngine namespace
- Common Unity API usage pattern
**Proposed Solution**:
Add `using UnityEngine;` at the top of PlayerController.cs
**Changes Required**:
- File: Assets/Scripts/PlayerController.cs
- Action: Insert using directive at line 1
Before applying any fixes:
Present all proposed solutions in a clear, structured format
Use AskUserQuestion tool to get user approval:
Wait for explicit confirmation - do not apply fixes automatically
For each approved fix:
Example:
Edit({
file_path: "Assets/Scripts/PlayerController.cs",
old_string: "public class PlayerController : MonoBehaviour",
new_string: "using UnityEngine;\n\npublic class PlayerController : MonoBehaviour"
})
After applying fixes:
Check for .meta file conflicts:
Report VCS status:
After fixes are applied:
mcp__ide__getDiagnostics()The skill relies on references/error-patterns.json for error analysis. This database contains:
To analyze an error, load the database and match the error code:
Read({ file_path: "references/error-patterns.json" })
// Parse JSON and find errorCode entry
The skill includes Node.js scripts in scripts/ for complex error analysis:
Processes VSCode diagnostics JSON output and extracts Unity-relevant errors.
Usage:
node scripts/analyze-diagnostics.js <diagnostics-json-file>
Output:
This script can be run independently or invoked from the SKILL.md workflow when detailed analysis is needed.
When using this skill:
mcp__ide__getDiagnostics() without parameters to get complete error pictureNode.js script for processing VSCode diagnostics and filtering Unity-specific C# errors.
Curated database of common Unity C# compilation errors with solutions and Unity-specific guidance.
tools
Unity Editor control and automation, WebSocket-based real-time communication. 유니티에디터제어및자동화, WebSocket기반실시간통신. Features/기능: GameObject control 게임오브젝트제어, Transform manipulation 트랜스폼조작, Component management 컴포넌트관리, Scene management 씬관리, SQLite database integration SQLite데이터베이스통합, GUID-based persistence GUID기반영구식별, Multi-scene synchronization 멀티씬동기화, Command Pattern with Undo/Redo 명령패턴실행취소재실행, Menu execution 메뉴실행, ScriptableObject management 스크립터블오브젝트관리, Array/List manipulation 배열리스트조작, All field types support 모든필드타입지원, Material/Rendering 머티리얼/렌더링, Prefab system 프리팹시스템, Asset Database 애셋데이터베이스, Animation 애니메이션, Physics 물리, Console logging 콘솔로깅, EditorPrefs management 에디터프리퍼런스관리, Editor automation 에디터자동화, Build pipeline 빌드파이프라인, Lighting 라이팅, Camera 카메라, Audio 오디오, Navigation 네비게이션, Particles 파티클, Timeline 타임라인, UI Toolkit, Profiler 프로파일러, Test Runner 테스트러너. Protocol 프로토콜: JSON-RPC 2.0 over WebSocket (port 9500-9600). 500+ commands 명령어, 25 categories 카테고리. Real-time bidirectional communication 실시간양방향통신. Security 보안: Defense-in-depth 심층방어 (path traversal protection 경로순회방지, command injection defense 명령어인젝션방어, JSON injection prevention JSON인젝션방지, SQL injection prevention SQL인젝션방지, transaction safety 트랜잭션안전성). Localhost-only connections 로컬호스트전용. Cross-platform 크로스플랫폼 (Windows, macOS, Linux).
tools
Assists with Unity UI Toolkit development - UXML structure, USS styling, C# VisualElement manipulation, data binding, and custom controls. Use when implementing UI Toolkit interfaces.
tools
Guides selection between UGUI and UI Toolkit for projects. Use when choosing UI framework or migrating UI systems.
tools
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.