/unity-coding-skills:edit-scene <instruction>from unity-coding-skills
Creates and modifies Unity scene (.unity) and prefab (.prefab) files by writing and executing editor scripts. Handles GameObjects, uGUI hierarchies, and component wiring.
Ships in unity-coding-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Guide for creating and editing Unity scene files in Unity projects.
.unity or .prefab files.
Instead, write an editor script under Assets/UnityCodingSkills/Editor/ and execute it in Unity to create or update the scene or prefab — those carry GameObject/Prefab-instance structure that is unsafe to author by hand.EditorSceneManager.SaveScene (or PrefabUtility.SaveAsPrefabAsset for prefabs).
Treat "no dirty scenes/assets at script exit" as a hard postcondition.
EditorSceneManager.SaveScene(scene, path) (new) or EditorSceneManager.SaveScene(scene) (existing).
The return value is true on success.PrefabUtility.SaveAsPrefabAsset(go, path).
When editing via LoadPrefabContents, always pair with SaveAsPrefabAsset → UnloadPrefabContents.AssetDatabase.SaveAssets() after the per-object saves to flush pending writes.unity_play_control tool.
If it is, stop it first — Play Mode may skip recompilation, leaving stale code active.get_unity_compilation_result tool before running.${CLAUDE_SKILL_DIR}/scripts/resolve_assembly.sh <cs-file-path>.
It walks up directories to find the nearest .asmdef; if none is found, it falls back to Assembly-CSharp-Editor (path contains /Editor/) or Assembly-CSharp.run_method_in_unity tool (MCP Server Extension for Unity) for execution.
Define a public static method in the script (applying [MenuItem("Tools/...")] is optional) and invoke it directly via run_method_in_unity.
Only fall back to execute_run_configuration or other alternatives when run_method_in_unity is unavailable..meta) immediately after a successful run — do not leave it for manual removal.
Delete both from the filesystem after the run returns; never have the script delete itself — AssetDatabase.DeleteAsset on its own file triggers a domain reload mid-call (see the Troubleshooting resource below).
"type": "Error" entry in logs.
success: true alone means only that the method was invoked, not that it completed without throwing.git diff for an existing scene/prefab; for a newly created one (untracked, so no diff) confirm the file exists and its saved hierarchy matches the intent.execute_run_configuration, etc.) was used instead of run_method_in_unity.unity_play_control, get_unity_compilation_result, run_method_in_unity, and run_unity_tests must be called strictly one at a time — always wait for each call to return before making the next one.
Calling them concurrently causes domain-reload conflicts that result in "canceled" or "did not connect within 30 seconds" errors.error or canceled, wait 10 seconds before retrying.
Domain reload typically takes several seconds; immediate retry hits the same in-flight reload and fails again.
Do not switch tools in the meantime (e.g., calling unity_play_control to verify state) — that just compounds the multiplexed calls.
If the same tool returns error or canceled on two consecutive attempts (with the 10-second wait between them), stop and consult the user instead of retrying further..meta files follow an asymmetric lifecycle.
Never create them manually — Unity generates them automatically.
Scene/prefab files (.unity, .prefab) and their referenced assets (materials, SOs, etc.) must be committed (required for GUID resolution); editor scripts under Assets/UnityCodingSkills/Editor/ and their .meta must never be committed — see "Rules" above: delete both right after a successful run instead of leaving them behind.
When a script must survive because the run failed and you stopped to consult the user, leave it out of the commit — but do not add it to .gitignore yourself; the plugin README recommends the user add Assets/UnityCodingSkills* to .gitignore, and otherwise the user excludes them at commit time.LoadSceneMode.Additive): EditorSceneManager.NewScene(NewSceneSetup.EmptyScene, NewSceneMode.Single) — no camera or light needed.LoadSceneMode.Single): EditorSceneManager.NewScene(NewSceneSetup.DefaultGameObjects, NewSceneMode.Single) — Main Camera and Directional Light are included automatically; do not add a camera manually.ObjectFactory.CreateGameObject and save with EditorSceneManager.SaveScene(scene, "Assets/YourFeature/Scenes/XxxScene.unity").EditorSceneManager.OpenScene(path, OpenSceneMode.Single) → make changes → EditorSceneManager.SaveScene(scene).PrefabUtility.SaveAsPrefabAsset(go, "Assets/YourFeature/Prefabs/XxxPrefab.prefab").PrefabUtility.LoadPrefabContents(path) → modify → PrefabUtility.SaveAsPrefabAsset(root, path) → PrefabUtility.UnloadPrefabContents(root).ObjectFactory.CreateGameObject / ObjectFactory.AddComponent instead of new GameObject(...) / gameObject.AddComponent<T>() so Undo history and Presets are applied automatically.transform.SetParent(parent, worldPositionStays: false).${CLAUDE_SKILL_DIR}/resources/ugui.mdrun_method_in_unity tool is not available or fails with a connection error: Read ${CLAUDE_SKILL_DIR}/resources/troubleshooting-run-method-in-unity.md${CLAUDE_SKILL_DIR}/resources/troubleshooting-ugui-layout.mdWhat SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub nowsprinting/unity-coding-skills --plugin unity-coding-skills12 skills in this plugin
/code-writing-guideProvides coding guidelines for Unity projects. Make sure to use this skill whenever writing, creating, editing, or modifying code files. This includes implementing new features, fixing bugs, refactoring, adding tests, or any task that results in code changes. Even for small edits or one-line fixes, load this skill to ensure project conventions are followed./design-testsDesigns tests from a specification, whatever document states it — a requirements document, design docs, or an ADR: extracts the test targets, then creates test cases for each target at the test level of its subject — e.g., integration tests for a scene or prefab, unit tests for a class's API. Use this skill whenever the specification is settled and the next step is to design the tests./Other plugins' skills for the same job