unity-script
Triggers
- Authoring or editing C# code
- Searching across scripts
- Refactoring file layout
- Checking compile errors
- 编写或编辑 C# 代码、跨脚本搜索、重构文件布局、检查编译错误
Unity Script Skills
Create, edit, move and inspect C# scripts and get their compile result. Parameters come from the schema (recommend includeSchema=true or /skills/schema?names=), which notes the non-obvious ones — never from a skill's name. Execution and dryRun rules: root SKILL.md.
Operating Mode
Read-only SemiAuto skills run directly in every mode: script_read, script_list, script_find_in_file, script_get_info, script_get_compile_feedback. All 7 writers — script_create, script_create_batch, script_replace, script_append, script_rename, script_move, script_delete — are MayTriggerReload + RiskLevel:"high" (a written .cs reloads the domain; script_delete is also Delete), so they are NeverInSemi: Approval and Auto return MODE_FORBIDDEN, and only Bypass or an Allowlist hit runs them. Never request a grant for them → operating mode.
Compile and reload
- Every write returns at once:
{success, status: "accepted", path, jobId, waitUrl, serverAvailability}; compilation follows, and the server is briefly unreachable during the domain reload. - One call gets the compile result: GET the returned
waitUrl(/jobs/<jobId>?wait=90), e.g.curl -s --retry 20 --retry-connrefused --retry-all-errors --retry-delay 2 "http://localhost:<port>/jobs/<jobId>?wait=90". It answers once compilation settles: jobstatuscompleted, orfailedon compile errors, with diagnostics inresultData.compilation(isCompiling,hasErrors,errorCount,errors: [{type, message, file, line}]). During the reload it may refuse or return503: repeat the same URL;waitTimedOut: truemeans GET it again. script_get_compile_feedback(scriptPath)returns the same diagnostics on demand. Fix errors first:component_addfinds a new MonoBehaviour only after a clean compile.checkCompile: falseskips the diagnostics;diagnosticLimitcaps them (default 20).