Skip to content

hi5jeff/Aibridge4Unity / com.aibridge.unity/Documentation~

unity-bridge

Verified

Drive the open Unity Editor from this session via the AI Bridge file channel (.aibridge/in,out) — read scene/selection as data, capture screenshots, build/modify/wire objects, lay out UGUI, animate, write & compile C#, run Play mode, and more. Use this WHENEVER the task touches Unity (scene, GameObjects, selection, components, UI, prefabs, sprites, animation, Console, Play mode) — do NOT take screenshots of the screen, use computer-use, or look for a Unity MCP server; control the real Editor through the .aibridge channel.

FileKindSize
AI-USAGE.mdmarkdown2.9 KB
PRESENTATION_RULES.mdmarkdown3.3 KB
SKILL.mdskill md9.3 KB

AI-USAGE.md

View on GitHub
# Using AI Bridge with an AI agent

This is the agent-facing guide for driving Unity through AI Bridge. To make it a first-class skill
for a Claude session, run **Tools ▸ AI Bridge ▸ Configure Claude Code** in Unity — it installs the
ready-made skill (`Documentation~/SKILL.md`) to `<project>/.claude/skills/unity-bridge/SKILL.md` for
you. To wire it up manually instead, copy that file to the same path; it already carries the YAML
frontmatter:

```yaml
---
name: unity-bridge
description: Drive the open Unity Editor via the AI Bridge file channel.
---
```

## Channel protocol

- Root: `<project>/.aibridge/`.
- **Send:** write `in/<id>.json` — `{ "id": "<unique>", "command": "<name>", ...fields }` (fields flat).
- **Receive:** read `out/<id>.json` — `{ "id", "command", "ok", "error", "result" }`.
- The bridge polls ~2×/sec. Write, wait ~1–2s, then read. Use a unique `id` per request.
- Editing project C# requires the user to focus Unity so it recompiles — the agent cannot trigger it.

## The user's pointer — `selection.json`

For "this / here / the selected one": read `.aibridge/selection.json` (pinned via the *AI Reference*
window — scene objects and/or Project assets, or a clicked point + note), or call `selection.get` for
the live selection. Selected assets appear under `assets[]` (with `assetPath`, usable as
`reference.wire` `targetAssetPath`).

## Commands

| Command | Fields | Returns |
|---|---|---|
| `ping` | — | `message`, `unityVersion` |
| `scene.dump` | `includeInactive?`, `maxObjects?` | scene objects: `path`, `worldPosition`, `rect` (if UI), `components` |
| `selection.get` | — | currently selected objects |
| `reference.wire` | `sourcePath`, `sourceComponent`, `field`, then ONE of: `targetPath`(+`targetComponent?`) / `targetAssetPath` | what was wired |
| `gameobject.create` | `name`, `parentPath?`, `primitive?`, `position?{x,y,z}`, `components?[]` | created object |
| `component.add` | `path`, `component` | updated component list |
| `object.modify` | `path`, `ops:[{property,value}]` | `applied`, `errors`, object state |
| `gameobject.delete` | `path` | deleted path |
| `screenshot.annotated` | `width?`, `height?`, `annotate?`, `maxLabels?` | `imagePath` (read it!), `objects[{screenRect, worldPosition}]` |

- **Paths** are `Root/Child/Leaf` within the active scene.
- `object.modify` properties: `name`, `active`, `position`, `localPosition`, `rotation` (euler),
  `localRotation`, `scale`; UI: `anchoredPosition`, `sizeDelta`, `anchorMin`, `anchorMax`, `pivot`.
  Vector values comma-separated (`"1,2,0"`).
- All edits register Undo.

## Recommended loop

1. **Orient:** `scene.dump` and/or `screenshot.annotated` (then read the PNG at `result.imagePath`).
2. **Resolve "this":** `selection.get` or read `selection.json`.
3. **Act:** create / add / wire / modify / delete.
4. **Verify:** `screenshot.annotated` again and read the PNG — look, don't assume.

Full field reference: the package `README.md`.
brainstormingobra/superpowersYou MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or planning anything new, in software or out of it (a talk, a business, a renovation).Stars: 322kUpdated Claude CodeCodexVerifiedInstall
brand-guidelinesanthropics/skillsApplies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand colors or style guidelines, visual formatting, or company design standards apply.Stars: 197kUpdated Claude CodeCodexVerifiedInstall
frontend-designanthropics/skillsGuidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making choices that don't read as templated defaults.Stars: 197kUpdated Claude CodeCodexVerifiedInstall
mcp-builderanthropics/skillsGuide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when building MCP servers to integrate external APIs or services, whether in Python (FastMCP) or Node/TypeScript (MCP SDK).Stars: 197kUpdated Claude CodeCodexVerifiedInstall