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.
Set up the repository
Section titled “Set up the repository”-
Run
rudder loginand approve the sign-in in the browser. -
Run the following in the root of your game repository.
Terminal window rudder agent init
| File | What it holds |
|---|---|
.agents/skills/rudder/SKILL.md | The Rudder skill used by coding agents. |
AGENTS.md | A 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.
Assemble and test a feature
Section titled “Assemble and test a feature”- Describe the game feature. The agent creates or selects a project and reads available
modules with
module listand their contracts withmodule show. - 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.
- It runs
release check, corrects the reported problems and publishes the checked revision withrelease publish --expected-revision. - 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. - It runs the feature through the generated SDK and reads
rudder logsto 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.
A good first task
Section titled “A good first task”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.
Pages, edits and recovery
Section titled “Pages, edits and recovery”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.
Writing your own modules
Section titled “Writing your own modules”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.
CLI output
Section titled “CLI output”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.
A complete example
Section titled “A complete example”Sample: Lanternmoor Expeditions combines marketplace modules with its own mechanic in a playable game.