| name | aibridge |
| description | Unity Editor and Player Runtime CLI integration for AIBridge. Use for harness snapshot reads, Unity compile/logs/assets/scenes/prefabs/Inspector, screenshots/GIFs, Play Mode input, Runtime Player targets, focus/menu/game view, AIBridgeCLI syntax, or shellless external-tool routing through exec. Route batch/multi, complex prefab patching, and direct UnityYAML edits to specialized Skills |
AI Bridge Unity Skill
Invocation
Run commands from the Unity project root
CLI Path: ./.aibridge/cli/AIBridgeCLI.exe
$CLI means the platform-appropriate AIBridge CLI invocation. On Windows PowerShell, prefer the call operator:
& "./.aibridge/cli/AIBridgeCLI.exe" <command> [action] [options]
Common global options: --timeout <ms>, --raw, --pretty, --json <json>, --stdin, --help, --on-dialog <mode>
Generated command references are installed under references/ in the target assistant Skill directory. In the package source tree they may be absent until Skill installation/refresh runs
Host Tools
Use exec run --stdin when external host tool arguments are non-trivial, include regex/globs/JSON/spaces, require stdin, need timeout/output limits, or run multiple jobs. AIBridge commands, including harness status, compile unity, get_logs, asset, inspector, runtime, workflow, multi, and code execute, run directly. exec run --stdin reads JSON from stdin; use command, not cmd, and do not append a raw shell command after --stdin. When the payload contains quotes, backslashes, or regex, build a PowerShell object and pipe ConvertTo-Json output, or use --request-file. Use multi --stdin for multiple AIBridge commands and exec jobs[] for multiple external host commands.
Harness Snapshot
Unity Editor writes .aibridge/harness/capabilities.json during Skill installation/refresh
$CLI harness status
$CLI harness status --detail full
Default harness status output is compact. Use --detail full or --include-snapshot true only when the full snapshot JSON is needed
Operating Rules
- Use
compile unity for Unity validation. compile dotnet is an explicit extra solution-build check, not a Unity fallback.
- For Unity imported asset path discovery, including script, prefab, scene, ScriptableObject, texture, material, audio, animation, shader, font, and model assets by name/type/filter, prefer
asset search/find --format paths before host rg --files when the Editor is available. Use rg --files for ordinary repository files, unimported files, .meta, ProjectSettings, and arbitrary path regexes. For file content search, prefer rg -n --fixed-strings when the query is a known exact string and you mainly need fast code-line hits; use text_index search "literal" for broader indexed literal/regex search across project text when available, host file reads for direct file contents, and asset read_text only when host reads are unavailable.
- Resource edit order:
inspector set_property/set_properties -> aibridge-prefab-patch for supported complex Prefab edits -> Unity Editor scripts for high-level generated assets -> unity-yaml-editing only for unsupported serialized-file structure work.
- For scene objects, Prefabs, and serialized Unity assets, discover targets with
inspector get_components/get_properties/find_property, then write with AIBridge/Unity APIs when possible.
- For prefab asset edits, use
assetPath + objectPath + componentName or componentIndex; componentInstanceId is scene-only.
- In PowerShell, avoid inline complex
--json; build JSON in a variable or file, then pipe it with $request | & ./.aibridge/cli/AIBridgeCLI.exe exec run --stdin instead of composing a shell string, writing exec run --stdin rg ..., or hand-writing inline JSON with escaping-sensitive regex values.
focus is Windows CLI-only. dialog is CLI-only and omits dialog fields when no modal dialog is detected.
input requires Play Mode and an active EventSystem; pair it with gameview, screenshot, and get_logs for UI interaction checks.
runtime talks to AIBridgeRuntime in a Player or Play Mode target. Run quick runtime list_targets first, use runtime list_targets --probe true only when local port scanning is needed, then target latest or a specific target id. For UI work, start with runtime.ui.snapshot; button entries include screen coordinates and screen rects for direct clicks, and runtime.input.key covers semantic submit/cancel/tab/move input.
- Code Index is optional. For C# semantic lookup use
aibridge-code-index only when installed and enabled; use text_index, rg, file reads, and regular AIBridge commands for literal, non-C#, asset, scene, prefab, or unavailable Code Index searches.
- AIBridge automatically cleans expired
.aibridge cache according to Settings. Do not proactively enumerate or delete .aibridge files for routine disk maintenance; only run maintenance commands or guide the user to Settings when the user explicitly asks for cleanup, investigation, or manual maintenance.