Skip to content
Skill

Game rules engine

Builds deterministic, seeded game rules engines for React Native games

Game rules engine is an open-source agent skill for developer tools. It is available on Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose.

Scripts
JavaScript, TypeScript
Platforms
Claude Code, Codex, Cursor
GitHub stars
16
Last commit
License
MIT
Listing updated

Similar skills

About Game rules engine

This skill sets up a pure, deterministic TypeScript rules engine for each game, behind a single shared contract of create, listMoves, applyMove and outcome functions. Because the same seed and moves produce the same states on every platform and in tests, bots, solvers, saves, undo and replays can rely on the engine.

The workflow installs a core kit (contract types, a difficulty scale and test helpers), a seeded RNG with pinned golden values, and a template game based on Lights Out. A checker script verifies the kit, the RNG outputs and each game's rules by running them, and reports failures with file and fix guidance.

It expects a Node-based project with Jest, fast-check, ESLint, Prettier and TypeScript, plus an app with i18n catalogs for player-facing messages. It relies on companion skills for gestures, rendering and level generation.

When your agent uses it

Builds game rules as a pure seeded engine: create, listMoves, applyMove, outcome, events, property tests. Use when writing game rules, moves, scoring or in-game randomness. Not for levels (level-generation-and-solvers).

From the skill's SKILL.md. Your agent reads this description to decide when to load the skill.

What it can access

From a static check of its 93 files (419 KB) on GitHub on 5 December 2026. Nothing was run. Read the files before you install a skill: it can tell your agent to run anything its tools allow.

Check another skill before you install it.

Install

This skill ships in the react-native-games plugin. In Claude Code, add the marketplace and install the plugin (it may include other skills too):

/plugin marketplace add zakariaf/ReactNative-Skills
/plugin install react-native-games@react-native-skills

Or copy only this skill to ~/.claude/skills/game-rules-engine:

tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/zakariaf/ReactNative-Skills.git "$tmp" &&
mkdir -p ~/.claude/skills &&
rm -rf ~/.claude/skills/game-rules-engine &&
cp -R "$tmp/skills/game-rules-engine" ~/.claude/skills/game-rules-engine &&
rm -rf "$tmp"

For one project only, put the folder in .claude/skills/game-rules-engine inside it instead.

Claude Code docs on skills

Copy the skill folder to ~/.agents/skills/game-rules-engine to use it in every repository:

tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/zakariaf/ReactNative-Skills.git "$tmp" &&
mkdir -p ~/.agents/skills &&
rm -rf ~/.agents/skills/game-rules-engine &&
cp -R "$tmp/skills/game-rules-engine" ~/.agents/skills/game-rules-engine &&
rm -rf "$tmp"

For one repository only, put the folder in .agents/skills/game-rules-engine inside it instead.

Codex docs on skills

Copy the skill folder to ~/.cursor/skills/game-rules-engine to use it in every project:

tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/zakariaf/ReactNative-Skills.git "$tmp" &&
mkdir -p ~/.cursor/skills &&
rm -rf ~/.cursor/skills/game-rules-engine &&
cp -R "$tmp/skills/game-rules-engine" ~/.cursor/skills/game-rules-engine &&
rm -rf "$tmp"

For one project only, put the folder in .cursor/skills/game-rules-engine inside it instead.

Cursor docs on skills

Run in a terminal (add --scope workspace to install it for the current workspace only):

gemini skills install https://github.com/zakariaf/ReactNative-Skills.git --path skills/game-rules-engine

Or copy the folder to ~/.gemini/skills/game-rules-engine yourself.

Gemini CLI docs on skills

For GitHub Copilot in VS Code, copy the skill folder to ~/.copilot/skills/game-rules-engine:

tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/zakariaf/ReactNative-Skills.git "$tmp" &&
mkdir -p ~/.copilot/skills &&
rm -rf ~/.copilot/skills/game-rules-engine &&
cp -R "$tmp/skills/game-rules-engine" ~/.copilot/skills/game-rules-engine &&
rm -rf "$tmp"

For one project only, put the folder in .github/skills/game-rules-engine inside it instead.

VS Code docs on skills

Get the folder:

git clone --depth 1 https://github.com/zakariaf/ReactNative-Skills.git

Then copy ReactNative-Skills/skills/game-rules-engine into your agent's skills folder as game-rules-engine. Agents that support SKILL.md read one folder per skill.

The SKILL.md format

What it does

Seeded deterministic RNG
Provides a 32-bit seeded generator whose golden outputs are pinned so levels and replays match across devices.
Shared engine contract
Defines the game contract with create, listMoves, applyMove, outcome, events and difficulty scaling.
Template game
Includes a complete small game, Lights Out with a move budget, to copy and adapt.
Property-based test guidance
Describes example tests, fast-check properties and pinned golden values for every rules folder.
Persistence and saves
Covers JSON-safe state, parsing saved runs back into typed values and migrating older shapes.
Engine checker script
Runs a checker that validates kit files, purity, determinism, events and the seeded play of each game.

Good for

  • Write rules and scoring for a new puzzle game in React Native
  • Add seeded randomness to a game so daily levels match on every device
  • Check that a game's engine never lets an illegal move through
  • Set up a shared rules kit and test helpers for a mobile game project
  • Make saved game runs reload reliably after an app update

Game rules engine FAQ

What does the skill need before Game rules engine runs?

It expects an app with Jest, TypeScript and i18n catalogs, and it pins fast-check as a dev dependency during setup.

Which parts of the rules code are restricted?

Rules may use only basic arithmetic, bitwise operators and a short list of Math functions, with no Math.random, Date, locale APIs or other non-deterministic calls.

Where does randomness come from in a game?

All randomness comes from the sfc32 generator, stored as state in the game and advanced on each draw.

Does Game rules engine change how the game looks on screen?

No. Rendering, gestures and level generation are handled by related skills; this one covers the rules engine.

How do I install Game rules engine in Claude Code?

Copy the skill folder from GitHub to ~/.claude/skills/game-rules-engine to use it in all your projects, or to .claude/skills/game-rules-engine in one project. Or install the react-native-games plugin, which includes it: /plugin marketplace add zakariaf/ReactNative-Skills, then /plugin install react-native-games@react-native-skills.

Does Game rules engine run scripts?

Yes. It runs JavaScript and TypeScript scripts. No network calls were found in its scripts. This comes from a static check of the files on GitHub; nothing was run. Read the files before you install it.

Which AI agents can use Game rules engine?

Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose. Each reads skills in the SKILL.md format from its own folder; the install steps on this page list them.

What are the best alternatives to Game rules engine?

The closest alternatives to Game rules engine are Game balance and bots, Game session host, Vercel react native skills, React patterns and Debug menu and test hooks.

Where this comes from

  • Description: from the skill's own SKILL.md.

More from zakariaf/ReactNative-Skills

  1. Turns canvas taps, swipes and drags into typed intents hit-tested on the drawn layout

    • Open source
    • 16 GitHub stars
    • Developer tools
  2. Adds a gated debug menu, debug deep link and simulated clock and offline mode to React

    • Open source
    • 16 GitHub stars
    • Developer tools
  3. Checks React Native code for accessibility labels, touch targets, text scaling

    • Open source
    • 16 GitHub stars
    • Developer tools
  4. Sells a one-time Premium unlock through the App Store and Google Play

    • Open source
    • 16 GitHub stars
    • Finance and payments
  5. Walks an Expo app through an SDK, Xcode or Android toolchain upgrade in one commit

    • Open source
    • 16 GitHub stars
    • Developer tools
  6. Builds React Native forms with one valibot schema, catalog-key errors and keyboard-aware

    • Open source
    • 16 GitHub stars
    • Developer tools