speckit.game-embeddedlisted
Install: claude install-skill wedabro/bro-skills
## Mission
Architect, optimize, and integrate embedded game engines (Unity WebGL, Godot 4 HTML5/WASM, PlayCanvas, Defold, or Iframe sandboxes) into modern Web Platforms (React, Next.js, Vue, Vanilla TS). Ensure seamless 2-way communication, optimal WASM loading performance, proper security headers for multi-threading, and responsive container scaling.
## Inputs and Outputs
- Read `.agents/specs/[feature]/spec.md`, `plan.md`, `tasks.md`, target engine export artifacts, bridge event schemas, and platform SDK specifications.
- Produce typed bridge dispatcher (`GameBridge.ts`), responsive shell container component (`GameContainer.tsx`/`vue`), loading screen with lifecycle hooks, server headers (COOP/COEP, Brotli), and platform connectors.
## Protocol
### 1. Two-Way Bridge Architecture (Web ⇋ Engine)
- **Type-Safe Dispatcher**: Define strict TypeScript interfaces for all outbound actions and inbound events.
- **Web ➔ Engine (Call into Game)**:
- *Unity*: Use `unityInstance.SendMessage(gameObjectName, methodName, jsonPayload)`.
- *Godot*: Use `JavaScriptBridge.eval()` or trigger registered callback handlers.
- *Iframe / Web Worker*: Use `window.postMessage` with strict `targetOrigin` verification (never use `*` in production).
- **Engine ➔ Web (Game Events to Shell)**:
- *Unity*: Implement C# `.jslib` plugins calling global bridge functions: `window.dispatchGameEvent(eventName, data)`.
- *Godot*: Use `JavaScriptBridge.get_interface("window").dispatchGameEvent(eventName