remix-game-sdk

Reference for the current @remix-gg/sdk runtime. Use when generating or repairing Remix game code, shop item integrations, save-state flows, multiplayer hooks, or host-safe mobile UI behavior.

8 stars

Best use case

remix-game-sdk is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Reference for the current @remix-gg/sdk runtime. Use when generating or repairing Remix game code, shop item integrations, save-state flows, multiplayer hooks, or host-safe mobile UI behavior.

Teams using remix-game-sdk should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/remix-game-sdk/SKILL.md --create-dirs "https://raw.githubusercontent.com/farworld-labs/remix-skills/main/skills/remix-game-sdk/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/remix-game-sdk/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How remix-game-sdk Compares

Feature / Agentremix-game-sdkStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Reference for the current @remix-gg/sdk runtime. Use when generating or repairing Remix game code, shop item integrations, save-state flows, multiplayer hooks, or host-safe mobile UI behavior.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# Remix Game SDK Reference (`@remix-gg/sdk`)

Use this file when generating or repairing game code for Remix.

## Runtime model

- In Remix-hosted uploads, the SDK is available as `window.RemixSDK`.
- `window.FarcadeSDK` is still assigned as a backward-compatible alias, but new code should use `window.RemixSDK`.
- Include SDK script in the HTML `<head>`:
  - `<script src="https://cdn.jsdelivr.net/npm/@remix-gg/sdk@latest/dist/index.min.js"></script>`
- Do not rely on package imports in uploaded single-file game code.
- Always call `await window.RemixSDK.ready()` before reading player/game data.

## Required hooks for v1 agent validation

These checks are required by `GET /v1/games/{gameId}/versions/{versionId}/validate`:

- `window.RemixSDK.singlePlayer.actions.gameOver({ score })`
- `window.RemixSDK.onPlayAgain(() => { ... })`
- `window.RemixSDK.onToggleMute(({ isMuted }) => { ... })`

## Commonly used SDK surface

Properties/getters:

- `window.RemixSDK.player`
- `window.RemixSDK.players`
- `window.RemixSDK.gameState`
- `window.RemixSDK.gameInfo`
- `window.RemixSDK.purchasedItems`
- `window.RemixSDK.inventory`
- `window.RemixSDK.shopItems`
- `window.RemixSDK.isReady`
- `window.RemixSDK.hasItem(itemId)`
- `window.RemixSDK.getItemPurchaseCount(itemId)`
- `window.RemixSDK.getShopItem(slug)`

Useful `gameInfo` fields:

- `viewContext` for feed/full-screen/challenge/tournament context
- `contentSafeAreaInset` for overlay-safe mobile layout
- `initialGameState` for persisted state hydration

Single-player actions:

- `window.RemixSDK.singlePlayer.actions.gameOver({ score })`
- `window.RemixSDK.singlePlayer.actions.saveGameState({ gameState })`
- `window.RemixSDK.purchase({ item })`
- `window.RemixSDK.onPurchaseComplete(({ success, item }) => { ... })`
- `window.RemixSDK.singlePlayer.actions.reportError({ message, ... })`
- `window.RemixSDK.hapticFeedback()`

Multiplayer actions:

- `window.RemixSDK.multiplayer.actions.gameOver({ scores })`
- `window.RemixSDK.onGameStateUpdated(callback)`

Multiplayer actions/events are optional for basic single-player games.

## Minimal integration template

```javascript
async function initGame() {
  const sdk = window.RemixSDK
  await sdk.ready()

  let muted = true
  sdk.onToggleMute(({ isMuted }) => {
    muted = isMuted
  })

  sdk.onPlayAgain(() => {
    restart()
  })

  function finish(score) {
    sdk.singlePlayer.actions.gameOver({ score })
  }

  function save(state) {
    sdk.singlePlayer.actions.saveGameState({ gameState: state })
  }

  function restart() {
    // reset local game state and render
  }

  // start gameplay loop...
}

initGame()
```

## Mistakes to avoid

- Calling SDK getters before `ready()` resolves.
- Omitting one of the required validation hooks (`gameOver`, `onPlayAgain`, `onToggleMute`).
- Using non-existent SDK methods such as `vibrate`, `checkpoint`, or `save`.
- Using `singlePlayer.actions.purchase(...)` in new code when the SDK exposes `sdk.purchase(...)`.
- Ignoring `contentSafeAreaInset` when HUD or controls can collide with mobile overlays.
- Using `localStorage`/`sessionStorage` as primary persistence instead of `saveGameState`.

Related Skills

remix-upload-game

8
from farworld-labs/remix-skills

Upload and validate HTML game code for Remix. Use when creating or updating a draft version through the CLI, MCP tools, or direct REST calls.

remix-upload-asset

8
from farworld-labs/remix-skills

Upload images, audio, or 3D models as hosted game assets

remix-submission-rules

8
from farworld-labs/remix-skills

Validation and publish constraints for Remix game submissions

remix-shop-items

8
from farworld-labs/remix-skills

Create, update, delete, and integrate Remix shop items. Use when a game needs Bits items, consumables, one-time unlocks, tier unlocks, store icons, or purchase handling in @remix-gg/sdk code.

remix-save-game

8
from farworld-labs/remix-skills

Add save and load game state functionality via RemixSDK

remix-rest-snippets

8
from farworld-labs/remix-skills

REST client snippets for Remix agent publishing

remix-open-game

8
from farworld-labs/remix-skills

Open a game in the Remix Studio browser for preview and editing

remix-multiplayer

8
from farworld-labs/remix-skills

Enable multiplayer support for a Remix game

remix-game-creation

8
from farworld-labs/remix-skills

Create a new game draft via the Remix API

remix-game-best-practices

8
from farworld-labs/remix-skills

Mobile-first game creation best practices for Remix

remix-cli

8
from farworld-labs/remix-skills

Use the official Remix CLI for authentication, config inspection, game creation, uploads, and analytics. Trigger this skill when a task involves `remix login`, `remix whoami`, `.remix-cli.json`, `REMIX_API_KEY`, or terminal-based game management on Remix.

remix-api-reference

8
from farworld-labs/remix-skills

OpenAPI-first endpoint reference for Remix game publishing REST routes