用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/WhiteSmoogy/wuc --skill wuc命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
基于 SOC 职业分类
正在显示 SKILL.md
| name | wuc |
| description | Interact with the running Unity Editor via the Wuc HTTP server (discovered via ~/.wuc/instances). |
| allowed-tools | Bash(python *) |
# check Unity is reachable and see recent logs
python {skillDir}/wuc/wuc.py logs --count 10
# print selected Unity instance identity
python {skillDir}/wuc/wuc.py identity
# run a C# expression, get the return value
python {skillDir}/wuc/wuc.py execute "return Application.unityVersion;"
# list all GameObjects in the active scene
python {skillDir}/wuc/wuc.py execute "return Object.FindObjectsByType<GameObject>(FindObjectsSortMode.None).Select(o => o.name).ToList();"
# clear all history in Temp/wuc.log
python {skillDir}/wuc/wuc.py clear
# clear only logs earlier than a timestamp
python {skillDir}/wuc/wuc.py clear-before "2026-03-08T12:34:56.789Z"
python {skillDir}/wuc/wuc.py execute "<C# code>"
python {skillDir}/wuc/wuc.py execute "<C# code>" --path "Label.csx"
python {skillDir}/wuc/wuc.py execute "<C# code>" --timeout 10000
python {skillDir}/wuc/wuc.py --instance-id "<instanceId>" execute "<C# code>"
--path — virtual filename shown in stack traces (cosmetic only)--timeout — execution timeout in milliseconds (default: 30000)--instance-id — connect to a specific Unity instance when multiple editors are openResponse fields:
| Field | Type | Description |
|---|---|---|
success | bool | Whether execution succeeded |
returnValue | object|null | {"type": "<FullTypeName>", "content": <JSON value>}, or null if the script returns null. content is the JSON-serialized value; falls back to a string if the type is not JSON-serializable. |
logs | string[] | Unity log messages captured during execution |
executionTimeMs | number | Wall-clock time in ms |
error | string | Error message + stack trace on failure |
python wuc.py logs # last 100 entries
python wuc.py logs --count 50
Each entry: timestamp (HH:mm:ss.fff), timestampUtc (ISO 8601 UTC), type (Log/Warning/Error/Assert/Exception), message, stackTrace.
Logs are appended to Temp/wuc.log as JSON lines and /logs reads the most recent entries from that file.
python wuc.py clear
clear empties Temp/wuc.log. Use this before asking an agent to judge whether a fresh compile produced errors.
python wuc.py clear-before "2026-03-08T12:34:56.789Z"
clear-before removes only entries earlier than the provided timestamp and keeps newer logs intact. The safest input is the timestampUtc value returned by python wuc.py logs.
python wuc.py identity
python wuc.py --instance-id "<instanceId>" identity
Returns: { projectId, projectPath, instanceId, pid, port, startedAtUtc }.
Scripts run via Roslyn (Microsoft.CodeAnalysis.CSharp.Scripting) on the Unity main thread.
Auto-imported namespaces — no using needed:
System, System.Linq, System.Collections.GenericUnityEngine, UnityEditorAll loaded assemblies are referenced automatically.
Return value: the last expression in the script is returned as returnValue, a JSON object {"type": "<FullTypeName>", "content": <value>}. For example, a string result yields {"type": "System.String", "content": "hello"}, and a Vector3 yields {"type": "UnityEngine.Vector3", "content": {"x":1.0,"y":0.0,"z":0.0}}.
[InitializeOnLoad].~/.wuc/instances/<instanceId>.json; the client matches by projectId and verifies with /identity.projectId defaults to a hash of the current project path, and automatically uses ProjectSettings/WucSettings.asset override when configured.--instance-id is provided.Thread.Sleep).D:\Projects\Wuc.python {skillDir}/wuc/wuc.py execute "
var cam = GameObject.Find(\"Main Camera\");
if (cam == null) return null;
var t = cam.transform;
return new { position = t.position, rotation = t.eulerAngles };
"
python {skillDir}/wuc/wuc.py execute "
var roots = UnityEngine.SceneManagement.SceneManager.GetActiveScene().GetRootGameObjects();
return roots.Select(r => new {
name = r.name,
children = r.transform.Cast<Transform>().Select(c => c.name).ToList()
}).ToList();
"
python {skillDir}/wuc/wuc.py clear
# ... trigger action in Unity ...
python {skillDir}/wuc/wuc.py logs --count 20