Skip to content

AI agents: write a game module

A coding agent such as Claude Code, Codex or Cursor can discover Rudder modules, configure items and quests, publish staging, generate your game client and verify the feature through the SDK. Its reference is the skill installed in your game repository.

  1. Install the CLI.

  2. Run rudder login and approve the sign-in in the browser.

  3. Run the following in the root of your game repository.

    Terminal window
    rudder agent init
FileWhat it holds
.agents/skills/rudder/SKILL.mdThe Rudder skill used by coding agents.
AGENTS.mdA Rudder block pointing to the skill alongside your own project instructions.

Run rudder agent init again after updating the CLI to refresh the instructions. The agent uses the CLI for configuration and the official SDK with the generated project client for game calls. It reports an operation missing from those interfaces and uses the Dashboard when available.

  1. Describe the game feature. The agent creates or selects a project and reads available modules with module list and their contracts with module show.
  2. It installs the ready modules and their dependencies. It reads catalog schemas and existing records before adding currencies, items, objectives and rewards through the CLI.
  3. It runs release check, corrects the reported problems and publishes the checked revision with release publish --expected-revision.
  4. It reads the staging SDK key, configures the local game’s origin for a web game, installs the SDK and generates the client with the returned --release-version.
  5. It runs the feature through the generated SDK and reads rudder logs to verify the outcome and release. You review the resulting feature in your game.

Marketplace projects can follow this path on Free. You can ask the agent to configure ready modules to match your game before considering an own module.

Add an inventory and a daily quest to my game using ready Rudder modules. The quest should award a potion and 50 gold after the player finishes one match. Configure the project with the CLI, publish it to staging, generate the TypeScript client and verify the reward on a test player. Read the available schemas and explain which game event reports the progress.

Use the corresponding C# output path for a Unity project. The agent needs an owner to change allowed origins. A browser check verifies that your localhost origin is allowed, while a native check uses the same SDK key.

Lists return one page with items and an optional next. The agent follows next with the same filters when it needs more data. The page size defaults to 50 and is at most 200. A draft edit expires a continuation with cursor_expired, so the agent restarts that list.

The agent reads a row’s ID and version before updating it. A row_changed error includes the current record for reconciliation. A draft_changed error during publication requires a fresh read and successful check. release check checks the whole draft, including records outside pages the agent has read.

After a network failure during creation, applying a sample or publication, the agent reads current state before repeating the action. The action can finish before the reply is lost.

The skill also covers module new, local generation, tests and publication. A Free project can write and test an own module locally. Publishing its own code needs Pro. Review the contract in manifest.json, functions marked server and changes to rudder.lock.json with your game requirements. See Own modules.

Use --json for automation. Errors retain error.code, error.message, path when known, and the server’s structured problems or conflicting row. See CLI reference for the commands and exit codes.

Sample: Lanternmoor Expeditions combines marketplace modules with its own mechanic in a playable game.