agentleFS
batihandevbatihandev/unity-mcp-skills/skills/editor/SKILL.md

unity-editor

Skill7 starsChanged 7 months agoMITView on GitHub

Use when users want to enter play mode, select objects, undo/redo, or execute menu commands.

The file

We split this skill into the rules it gives an agent

5 rules. About 0 are common, 3 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈3

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Use console_set_pause_on_error from the console module.

    line 132
  2. Distinctive:

    Check editor state before play mode operations

    line 144
  3. Distinctive:

    Don't modify scene during play mode (changes lost)

    line 145
  4. Distinctive:

    Use undo for safe experimentation

    line 146
  5. Very specific:

    Use editor_get_context to get instanceId for batch operations

    line 147

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Unity Editor Skills

Overview

Control the Unity Editor itself - enter play mode, manage selection, undo/redo, and execute menu items.

Common Mistakes

DO NOT (common hallucinations):

  • editor_run does not exist → use editor_play to enter play mode
  • editor_compile / editor_recompile do not exist → use debug_force_recompile
  • editor_save does not exist → use editor_execute_menu with menuPath "File/Save"
  • editor_execute_menu requires exact menu path — typos cause silent failure

Routing:

  • For compilation check → use editor_get_state (isCompiling field)
  • For console errors → use native Unity_ReadConsole or Unity_GetConsoleLogs
  • For scene save → scene_save (scene module) or editor_execute_menu menuPath="File/Save"

Skills Overview

SkillDescription
editor_playEnter play mode
editor_stopExit play mode
editor_pauseToggle pause
editor_selectSelect GameObject
editor_get_selectionGet selected objects
editor_get_contextGet full editor context (selection, assets, scene)
editor_undoUndo last action
editor_redoRedo last action
editor_get_stateGet editor state
editor_execute_menuExecute menu item
editor_get_tagsGet all tags
editor_get_layersGet all layers
console_set_pause_on_errorPause play mode on error (console module)

Skills

editor_play

Enter play mode. Fire-and-forget: sets EditorApplication.isPlaying = true and returns { success, mode, started } immediately. Observe the transition by calling editor_get_state (check isPlaying) in a later call — recipes cannot span domain reloads.

editor_stop

Exit play mode.

editor_pause

Toggle pause state.

editor_select

Select a GameObject.

ParameterTypeRequiredDescription
namestringNo*Object name
instanceIdintNo*Instance ID
pathstringNo*Object path

*One identifier required

editor_get_selection

Get currently selected objects.

Returns: {success, count, objects: [{name, instanceId}]}

editor_get_context

Get full editor context including selection, assets, and scene info.

ParameterTypeRequiredDefaultDescription
includeComponentsboolNofalseInclude component list
includeChildrenboolNofalseInclude children info

Returns:

  • selectedGameObjects: Objects in Hierarchy (instanceId, path, tag, layer)
  • selectedAssets: Assets in Project window (GUID, path, type, isFolder)
  • activeScene: Current scene info (name, path, isDirty)
  • focusedWindow: Name of focused editor window
  • isPlaying, isCompiling: Editor state

editor_undo

Undo the last action.

editor_redo

Redo the last undone action.

editor_get_state

Get current editor state.

Returns: {isPlaying, isPaused, isCompiling, timeSinceStartup, unityVersion, platform}

editor_execute_menu

Execute a menu command.

ParameterTypeRequiredDescription
menuPathstringYesMenu item path

Common Menu Paths:

Menu PathAction
File/SaveSave current scene
File/Build Settings...Open build settings
Edit/PlayToggle play mode
GameObject/Create EmptyCreate empty object
Window/General/ConsoleOpen console
Assets/RefreshRefresh assets

editor_get_tags

Get all available tags.

Returns: {success, tags: [string]}

editor_get_layers

Get all available layers.

Returns: {success, layers: [{index, name}]}

Pause On Error

Pause-on-error is provided by the console module, not the editor module.

Use console_set_pause_on_error from the console module.


Example Usage

See ../../recipes/editor/<command>.md for C# templates.

Recipe path rule: ../../recipes/editor/<command>.md

Best Practices

  1. Check editor state before play mode operations
  2. Don't modify scene during play mode (changes lost)
  3. Use undo for safe experimentation
  4. Use editor_get_context to get instanceId for batch operations
  5. Menu commands must match exact paths

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.