coherence-baking

Automates coherence SDK bake, bindings refresh, and stale-code recovery via Unity MCP.

Updated Jul 8, 2026
One-click install
npx skills add https://github.com/cmitchellVFS/Scrabble --skill coherence-baking-cmitchellvfs
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: coherence-baking
Source: https://github.com/cmitchellVFS/Scrabble/tree/main/.claude/skills/coherence-baking
Command: npx skills add https://github.com/cmitchellVFS/Scrabble --skill coherence-baking-cmitchellvfs

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? When an AI agent edits networked prefabs, [Sync] fields, or [Command] methods in a Unity project using the coherence SDK, the generated code under Assets/coherence/baked becomes stale and Play mode fails. Unity MCP cannot read bake-state values or dismiss coherence's modal dialogs, so agents need file-level workarounds to trigger bakes, refresh bindings, and recover from failed bakes. ## Core Features & Use Cases - Trigger and verify bakes via MCP: Invoke the coherence/Bake menu item, wait out the forced domain reload, and confirm success through file mtimes on Gathered.schema and the baked folder rather than the unreliable console. - Refresh CoherenceSync bindings after refactors: Run the project-wide Update Bindings sweep or call CoherenceSyncUtils.UpdateBindings on a single prefab to avoid the blocking save modal. - Recover from failed bakes: Delete Assets/coherence/baked via manage_asset to replicate the "Delete Baked Scripts" button that MCP cannot click, then re-bake. - Use Case: An agent renames a [Sync] field on a networked prefab. It updates bindings on the prefab, triggers coherence/Bake, waits for compilation and domain reload to settle, then verifies Coherence.Generated types resolve before entering Play mode. ## Quick Start Ask the agent to re-bake the coherence schema and verify the baked code regenerated after your latest [Sync] field changes.

Frequently Asked Questions about coherence-baking

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I trigger a coherence bake from Unity MCP?▼

Call execute_menu_item with the menu path "coherence/Bake", then wait 5-10 seconds for the forced recompile and domain reload to finish. Verify success by checking file mtimes on Assets/coherence/Gathered.schema and the baked folder, since the console often shows no entries.

How do I update CoherenceSync bindings after renaming a [Sync] field?▼

Use the menu item coherence/Help/Troubleshooting/Update Bindings for a project-wide sweep, or call CoherenceSyncUtils.UpdateBindings(sync) on one prefab. The project-wide path shows a blocking modal before saving, so the single-prefab API is safer for automation. Re-bake afterward.

Can Unity MCP read BakeUtil.Outdated to check if a bake is needed?▼

No. unity_reflect returns the property's signature, not its runtime value, and IsBakingInProcess is internal. Use file-level proxies instead: a missing Assets/coherence/baked folder or Gathered.schema indicates a bake is needed, or just bake defensively since it is largely idempotent.

Why does the MCP connection drop right after triggering a bake?▼

The bake forces a script recompile and domain reload, which tears down the MCP connection mid-call. Errors like "Connection closed before reading expected bytes" are expected; wait and poll editor state until is_compiling and is_domain_reload_pending are both false.

How do I recover when the coherence bake fails with a compile-error modal?▼

MCP cannot click the "Baking should always be performed on a successfully compiling state" modal. Instead, delete Assets/coherence/baked via manage_asset (equivalent to the Delete Baked Scripts button), then run coherence/Bake again to regenerate all baked files.

When does coherence baking not work in Unity?▼

Baking fails while the editor is mid-compile, inside an AssetDatabase.StartAssetEditing scope, or in Clone Mode with ParrelSync where the bake aborts silently. Fix compile errors first and avoid asset-editing scopes before triggering a bake.