unity-editor-toolkit

SKILL.md

Purpose

Unity Editor Toolkit enables comprehensive Unity Editor automation and control from Claude Code. It provides:

  • Extensive Command Coverage: 500+ commands spanning 25 Unity Editor categories
  • Real-time Communication: Instant bidirectional WebSocket connection (JSON-RPC 2.0)
  • SQLite Database Integration: Real-time GameObject synchronization with GUID-based persistence
    • GUID-based Identification: Persistent GameObject tracking across Unity sessions
    • Multi-scene Support: Synchronize all loaded scenes simultaneously (1s interval)
    • Command Pattern: Undo/Redo support for database operations
    • Auto Migration: Automatic schema migration system
    • Batch Operations: Efficient bulk inserts, updates, and deletes (500 objects/batch)
  • Menu Execution: Run Unity Editor menu items programmatically (Window, Assets, Edit, GameObject menus)
  • ScriptableObject Management: Complete CRUD operations with array/list support and all field types
    • Array/List Operations: Add, remove, get, clear elements with nested access (items[0].name)
    • All Field Types: Integer, Float, String, Boolean, Vector*, Color, Quaternion, Bounds, AnimationCurve, ObjectReference, and more
    • Nested Property Traversal: Access deeply nested fields with dot notation and array indices
  • Deep Editor Integration: GameObject/hierarchy, transforms, components, scenes, materials, prefabs, animation, physics, lighting, build pipeline, and more
  • Security First: Multi-layer defense against injection attacks (SQL, command, JSON, path traversal) and unauthorized access
  • Production Ready: Cross-platform support with robust error handling and logging

Always run scripts with --help first to see usage. DO NOT read the source until you try running the script first and find that a customized solution is abslutely necessary. These scripts can be very large and thus pollute your context window. They exist to be called directly as black-box scripts rather than ingested into your context window.


๐Ÿ“š ๋ฌธ์„œ ์šฐ์„  ์›์น™ (ํ•„์ˆ˜)

โš ๏ธ CRITICAL: Unity Editor Toolkit skill์„ ์‚ฌ์šฉํ•  ๋•Œ๋Š” ๋ฐ˜๋“œ์‹œ ๋‹ค์Œ ์ˆœ์„œ๋ฅผ ๋”ฐ๋ฅด์„ธ์š”:

1๏ธโƒฃ Reference ๋ฌธ์„œ ํ™•์ธ (ํ•„์ˆ˜)

๋ช…๋ น์–ด๋ฅผ ์‚ฌ์šฉํ•˜๊ธฐ ์ „์— ๋ฐ˜๋“œ์‹œ skills/references/ ํด๋”์˜ ํ•ด๋‹น ๋ฌธ์„œ๋ฅผ ์ฝ์œผ์„ธ์š”:

  • COMMANDS.md - ๋ชจ๋“  ๋ช…๋ น์–ด์˜ ์นดํ…Œ๊ณ ๋ฆฌ ๋ฐ ๊ฐœ์š”
  • Category-specific docs - ์‚ฌ์šฉํ•  ๋ช…๋ น์–ด์˜ ์นดํ…Œ๊ณ ๋ฆฌ ๋ฌธ์„œ:

2๏ธโƒฃ --help ์‹คํ–‰

# ๋ชจ๋“  ๋ช…๋ น์–ด ํ™•์ธ
cd <unity-project-root> && node .unity-websocket/uw --help

# ํŠน์ • ๋ช…๋ น์–ด์˜ ์˜ต์…˜ ํ™•์ธ
cd <unity-project-root> && node .unity-websocket/uw <command> --help

3๏ธโƒฃ ์˜ˆ์ œ ์‹คํ–‰

reference ๋ฌธ์„œ์˜ Examples ์„น์…˜์„ ์ฐธ๊ณ ํ•˜์—ฌ ๋ช…๋ น์–ด๋ฅผ ์‹คํ–‰ํ•˜์„ธ์š”.

4๏ธโƒฃ ์†Œ์Šค ์ฝ”๋“œ ์ฝ๊ธฐ (์ตœํ›„์˜ ์ˆ˜๋‹จ)

  • reference ๋ฌธ์„œ์™€ --help๋งŒ์œผ๋กœ๋Š” ํ•ด๊ฒฐ ์•ˆ ๋  ๋•Œ๋งŒ ์†Œ์Šค ์ฝ”๋“œ๋ฅผ ์ฝ์œผ์„ธ์š”
  • ์†Œ์Šค ์ฝ”๋“œ๋Š” ์ปจํ…์ŠคํŠธ ์œˆ๋„์šฐ๋ฅผ ๋งŽ์ด ์ฐจ์ง€ํ•˜๋ฏ€๋กœ ๊ฐ€๋Šฅํ•˜๋ฉด ํ”ผํ•˜์„ธ์š”

์ด ์ˆœ์„œ๋ฅผ ๋ฌด์‹œํ•˜๋ฉด:

  • โŒ ๋ช…๋ น์–ด ์‚ฌ์šฉ๋ฒ•์„ ์ž˜๋ชป ์ดํ•ดํ•  ์ˆ˜ ์žˆ์Œ
  • โŒ ์˜ต์…˜์„ ๋†“์ณ์„œ ์›ํ•˜์ง€ ์•Š๋Š” ๊ฒฐ๊ณผ๊ฐ€ ๋‚˜์˜ฌ ์ˆ˜ ์žˆ์Œ
  • โŒ ์ปจํ…์ŠคํŠธ ์œˆ๋„์šฐ๋ฅผ ๋‚ญ๋น„ํ•  ์ˆ˜ ์žˆ์Œ

When to Use

Use Unity Editor Toolkit when you need to:

  1. Automate Unity Editor Tasks

    • Create and manipulate GameObjects, components, and hierarchies
    • Configure scenes, materials, and rendering settings
    • Control animation, physics, and particle systems
    • Manage assets, prefabs, and build pipelines
  2. Real-time Unity Testing

    • Monitor console logs and errors during development
    • Query GameObject states and component properties
    • Test scene configurations and gameplay logic
    • Debug rendering, physics, or animation issues
  3. Batch Operations

    • Create multiple GameObjects with specific configurations
    • Apply material/shader changes across multiple objects
    • Setup scene hierarchies from specifications
    • Automate repetitive Editor tasks
  4. Menu and Editor Automation

    • Execute Unity Editor menu items programmatically (menu run "Window/General/Console")
    • Open editor windows and tools via command line
    • Automate asset refresh, reimport, and build operations
    • Query available menu items with wildcard filtering
  5. ScriptableObject Management

    • Create and configure ScriptableObject assets programmatically
    • Read and modify all field types (Vector, Color, Quaternion, AnimationCurve, etc.)
    • Manipulate arrays/lists with full CRUD operations
    • Access nested properties with array index notation (items[0].stats.health)
    • Query ScriptableObject types and inspect asset metadata
  6. Database-Driven Workflows

    • Persistent GameObject tracking across Unity sessions with GUID-based identification
    • Real-time synchronization of all loaded scenes to SQLite database
    • Analytics and querying of GameObject hierarchies and properties
    • Undo/Redo support for database operations via Command Pattern
    • Efficient batch operations (500 objects/batch) for large scene management
  7. CI/CD Integration

    • Automated builds with platform-specific settings
    • Test Runner integration for unit/integration tests
    • Asset validation and integrity checks
    • Build pipeline automation

Prerequisites

Unity Project Setup

  1. Install Unity Editor Toolkit Server Package

    • Via Unity Package Manager (Git URL or local path)
    • Requires Unity 2020.3 or higher
    • Package location: skills/assets/unity-package
  2. Configure WebSocket Server

    • Open Unity menu: Tools > Unity Editor Toolkit > Server Window
    • Plugin scripts path auto-detected from ~/.claude/plugins/...
    • Click "Install CLI" to build WebSocket server (one-time setup)
    • Server starts automatically when Unity Editor opens
  3. Database Setup (Optional)

    • In the Server window, switch to "Database" tab
    • Click "Connect" to initialize SQLite database
    • Database file location: {ProjectRoot}/.unity-websocket/unity-editor.db
    • Click "Start Sync" to enable real-time GameObject synchronization (1s interval)
    • GUID Components: GameObjects are automatically tagged with persistent GUIDs
    • Multi-scene: All loaded scenes are synchronized automatically
    • Analytics: View sync stats, database health, and Undo/Redo history
  4. Server Status

    • Port: Auto-assigned from range 9500-9600
    • Status file: {ProjectRoot}/.unity-websocket/server-status.json
    • CLI automatically detects correct port from this file
  5. Dependencies

    • websocket-sharp (install via package installation scripts)
    • Newtonsoft.Json (Unity's built-in version)
    • Cysharp.UniTask (for async/await database operations)
    • SQLite-net (embedded SQLite database)

Claude Code Plugin

The Unity Editor Toolkit plugin provides CLI commands for Unity Editor control.

Core Workflow

1. Connection

Unity Editor Toolkit CLI automatically:

  • Detects Unity project via .unity-websocket/server-status.json
  • Reads port information from status file (9500-9600 range)
  • Connects to WebSocket server if Unity Editor is running

2. Execute Commands

โš ๏ธ Before executing ANY command, check the reference documentation for your command category (see "๐Ÿ“š ๋ฌธ์„œ ์šฐ์„  ์›์น™" section above).

Unity Editor Toolkit provides 86+ commands across 15 categories. All commands run from the Unity project root:

cd <unity-project-root> && node .unity-websocket/uw <command> [options]

Available Categories (Implemented):

# Category Commands Reference
1 Connection & Status 1 COMMANDS_CONNECTION_STATUS.md
2 GameObject & Hierarchy 8 COMMANDS_GAMEOBJECT_HIERARCHY.md
3 Transform 4 COMMANDS_TRANSFORM.md
4 Component โœจ 10 COMMANDS_COMPONENT.md
5 Scene Management 7 COMMANDS_SCENE.md
6 Asset Database & Editor 3 COMMANDS_EDITOR.md
7 Console & Logging 2 COMMANDS_CONSOLE.md
8 EditorPrefs Management 6 COMMANDS_PREFS.md
9 Wait Commands 4 COMMANDS_WAIT.md
10 Chain Commands 2 COMMANDS_CHAIN.md
11 Menu Execution 2 COMMANDS_MENU.md
12 Asset Management 9 COMMANDS_ASSET.md
13 Prefab 12 COMMANDS_PREFAB.md
14 Material 9 COMMANDS_MATERIAL.md
15 Shader 7 COMMANDS_SHADER.md

Usage:

cd <unity-project-root> && node .unity-websocket/uw <command> [options]

Required: Check Documentation

# 1. ๋จผ์ € ๋ช…๋ น์–ด ์นดํ…Œ๊ณ ๋ฆฌ์˜ reference ๋ฌธ์„œ๋ฅผ ์ฝ์œผ์„ธ์š”
# ์˜ˆ: Component ๋ช…๋ น์–ด ์‚ฌ์šฉ โ†’ skills/references/COMMANDS_COMPONENT.md ์ฝ๊ธฐ

# 2. --help๋กœ ๋ช…๋ น์–ด ์˜ต์…˜ ํ™•์ธ
cd <unity-project-root> && node .unity-websocket/uw --help
cd <unity-project-root> && node .unity-websocket/uw <command> --help

# 3. reference ๋ฌธ์„œ์˜ ์˜ˆ์ œ๋ฅผ ์ฐธ๊ณ ํ•˜์—ฌ ์‹คํ–‰

๐Ÿ“– Complete Documentation by Category

Required Reading: Before using any command, read the Category-specific reference document:

3. Check Connection Status

# Verify WebSocket connection
cd <unity-project-root> && node .unity-websocket/uw status

# Use custom port
cd <unity-project-root> && node .unity-websocket/uw --port 9301 status

4. Complex Workflows

Create and configure GameObject:

cd <unity-project-root> && node .unity-websocket/uw go create "Enemy" && \
cd <unity-project-root> && node .unity-websocket/uw tf set-position "Enemy" "10,0,5" && \
cd <unity-project-root> && node .unity-websocket/uw tf set-rotation "Enemy" "0,45,0"

Load scene and activate GameObject:

cd <unity-project-root> && node .unity-websocket/uw scene load "Level1" && \
cd <unity-project-root> && node .unity-websocket/uw go set-active "Boss" true

Batch GameObject creation:

for i in {1..10}; do
  cd <unity-project-root> && node .unity-websocket/uw go create "Cube_$i" && \
  cd <unity-project-root> && node .unity-websocket/uw tf set-position "Cube_$i" "$i,0,0"
done

Wait for compilation then execute:

# Make code changes, then wait for compilation to finish
cd <unity-project-root> && node .unity-websocket/uw wait compile && \
cd <unity-project-root> && node .unity-websocket/uw editor refresh

Chain multiple commands sequentially:

# Execute commands from JSON file
cd <unity-project-root> && node .unity-websocket/uw chain execute commands.json

# Execute commands inline
cd <unity-project-root> && node .unity-websocket/uw chain exec \
  "GameObject.Create:name=Player" \
  "GameObject.SetActive:instanceId=123,active=true"

# Continue execution even if some commands fail
cd <unity-project-root> && node .unity-websocket/uw chain exec \
  "Editor.Refresh" \
  "GameObject.Find:path=InvalidPath" \
  "Console.Clear" \
  --continue-on-error

CI/CD Pipeline workflow:

#!/bin/bash
cd /path/to/unity/project

# Cleanup
node .unity-websocket/uw.js chain exec "Console.Clear" "Editor.Refresh"

# Wait for compilation
node .unity-websocket/uw.js wait compile

# Run tests (example)
node .unity-websocket/uw.js chain exec \
  "Scene.Load:name=TestScene" \
  "GameObject.Find:path=TestRunner" \
  "Console.Clear"

Best Practices

  1. Always Verify Connection

    • Run cd <unity-project-root> && node .unity-websocket/uw status before executing commands
    • Ensure Unity Editor is running and server component is active
  2. Use Hierarchical Paths

    • Prefer full paths for nested GameObjects: "Environment/Terrain/Trees"
    • Avoids ambiguity when multiple GameObjects share the same name
  3. Monitor Console Logs

    • Use cd <unity-project-root> && node .unity-websocket/uw console logs --errors-only to catch errors during automation
    • Clear console before running automation scripts for clean logs
  4. Batch Operations Carefully

    • Add delays between commands if creating many GameObjects
    • Consider Unity Editor performance limitations
  5. Connection Management

    • Unity Editor Toolkit uses localhost-only connections (127.0.0.1)
    • Port range limited to 9500-9600 to avoid conflicts with other tools
  6. Error Handling

    • Commands return JSON-RPC error responses for invalid operations
    • Check exit codes and error messages in automation scripts
  7. Port Management

    • Default port 9500 works for most projects
    • Use --port flag if running multiple Unity Editor instances
    • Plugin avoids conflicts with Browser Pilot (9222-9322) and Blender Toolkit (9400-9500)
  8. Wait Commands Usage

    • Use wait compile after making code changes to ensure compilation finishes
    • Use wait playmode enter/exit for play mode synchronization in automated tests
    • Use wait sleep to add delays between commands when needed
    • Note: Wait commands have delayed responses (default 5-minute timeout)
    • Domain reload automatically cancels all pending wait requests
  9. Chain Commands Best Practices

    • Use chain for sequential command execution with automatic error handling
    • Default behavior: stop on first error (use --continue-on-error to override)
    • Wait commands are NOT supported in chain (use separate wait commands)
    • Use JSON files for complex multi-step workflows
    • Use inline exec for quick command sequences
  10. Development Roadmap Awareness

  • Phase 2 (Current): 86 commands implemented across 15 categories
  • Phase 3+: Animation, Physics, Lighting, Camera, Audio, Navigation - 400+ commands planned
  • See full roadmap in COMMANDS.md

References

Detailed documentation available in the references/ folder:

Unity C# server package available in assets/unity-package/ - install via Unity Package Manager once released.


Status: ๐Ÿงช Experimental - Phase 2 (86 commands implemented) Unity Version Support: 2020.3 - Unity 6 Protocol: JSON-RPC 2.0 over WebSocket Port Range: 9500-9600 (auto-assigned)

Weekly Installs
14
GitHub Stars
76
First Seen
Jan 22, 2026
Installed on
claude-code12
gemini-cli10
codex10
opencode9
cursor9
antigravity8