Safe implementation loop for Unity changes that could break existing behaviour. Covers planning, MCP-driven implementation, verification via console logs and screenshots, and summary.
When invoked, execute the four-phase loop below for every implementation task in this Unity project. Do not skip or compress phases — the verification step exists precisely because silent breakage is common in Unity (missing references, serialized field renames, shader/URP mismatches).
Gather context using MCP tools before writing anything:
Unity_ManageScript or Unity_FindInFile).Unity_FindProjectAssets, Unity_ManageScene).[SerializeField] or public) that will be added, removed, or renamed — these break prefab/scene references silently if changed without updating all usages.Write a numbered plan:
Present the plan to the user. Do not proceed until they confirm.
Work through the confirmed plan one logical unit at a time. Never batch multiple unrelated changes into a single apply.
For C# script changes:
Unity_ValidateScript with the draft. If it reports errors, fix them before proceeding.Unity_ScriptApplyEdits (preferred for targeted edits) or Unity_ManageScript (for full rewrites).Unity_ManageGameObject or ask the user to rewire in the Inspector.For scene/prefab changes:
Unity_ManageGameObject to add, remove, or configure components.Unity_ManageScene → save after structural changes..unity or .prefab YAML — use MCP tools or ask the user to make the change in the Editor.For steps marked [USER ACTION REQUIRED]:
Run these checks after each logical unit — not just at the end.
Console check: Unity_GetConsoleLogs — scan for new errors or warnings.
Visual check: Enter Play Mode (Unity_ManageEditor), then capture:
Unity_Camera_Capture for runtime Game view.Unity_SceneView_Capture2DScene or Unity_SceneView_CaptureMultiAngleSceneView for scene layout.Exit Play Mode before proceeding to the next change.
When all planned changes are verified:
stationId needs to be set on each CPUStation prefab instance in the scene").| Need | Tool |
|---|---|
| Read a script | Unity_ManageScript (action: read) |
| Write/overwrite a script | Unity_ValidateScript then Unity_ManageScript |
| Targeted script diff | Unity_ScriptApplyEdits / Unity_ApplyTextEdits |
| Create a new script file | Unity_CreateScript (creates with .meta), then write content |
| Delete a script | Unity_DeleteScript |
| Find assets by name/type | Unity_FindProjectAssets |
| Add/remove component on GameObject | Unity_ManageGameObject |
| Open/save scene | Unity_ManageScene |
| Enter/exit Play Mode | Unity_ManageEditor |
| Read console logs | Unity_GetConsoleLogs / Unity_ReadConsole |
| Screenshot (Game view) | Unity_Camera_Capture |
| Screenshot (Scene view) | Unity_SceneView_Capture2DScene |
| Run a menu command | Unity_RunCommand |