# rea-games: 다시 만든 게임을 원본 기록과 대조
# rea-games: checking a rebuilt game against a recording of the original

- Site: https://select1.dev/2026-11-26 (English), https://select1.dev/ko/2026-11-26 (Korean)
- Entry: 047
- Published: 2026-11-26 (KST). Launch date: 2026-11-25
- Pick: rea-games <https://github.com/erkamyaman/rea-games> (source: GitHub)
- Verified: ran
- What: rea-games 는 다른 엔진으로 다시 만든 게임을 검사하는 프로덕트다. 먼저 원본 게임의 동작을 기록한다. 그다음 다시 만든 게임을 그 기록과 비교한다. 코딩 에이전트가 기록부터 이식, 검사까지 맡을 수 있게 스킬도 제공한다.
- What (en): rea-games is a product that checks a game rebuilt in another engine. First it records how the original game behaves. Then it compares the rebuild with that recording. It also comes with a skill that lets a coding agent record, port and check a game.
- Why: 오늘의 픽으로 선정한 이유는 에이전트가 이식한 게임을 직접 플레이하지 않고도 확인할 수 있기 때문이다.
- Why (en): It is today’s pick because you can check an agent’s game port without playing it.
- Verdict: 작동한다. 버그를 넣은 2048 이식판은 기록 19개 가운데 16개에서 검사에 실패했다.
- Verdict (en): It works. A 2048 port with an added bug failed the check on 16 of its 19 recordings.
- Tags: games, testing, agent-skills, verification

## Checked against the README

- [pass] 이식판에 일부러 버그를 넣으면 verify 가 실패한다. 2048 에서 새 타일이 2 일 확률을 0.9 에서 0.8 로 바꾸면 기록 19개 가운데 3개만 통과한다(3 of 19 for 2048 with the spawn odds changed from 0.9 to 0.8) — games/2048/ports/web/game2048.mjs 41행의 0.9 를 0.8 로 바꾸고 verify 2048 --port web 을 실행했다. 3/19 cases identical 이 출력됐다
- [pass] 원본은 고치지 않고 시간 함수와 난수 함수만 실행할 때 교체하므로, 같은 입력으로 다시 실행하면 같은 결과가 나온다(Its clock and Math.random are replaced from outside, so a run can be repeated) — 새로 클론한 저장소에서 record 2048 을 실행했다. 새로 만든 기록 19개를 저장소의 기록과 cmp 로 비교하니 모두 같았다
- [fail] `verify` 는 기록과 처음 달라진 값의 경로를 출력한다(The first difference is printed with its path) — 버그를 넣은 2048 이식판은 기록 16개에서 실패했다. 그 가운데 7개에서는 trace differs at [13].grid[2][0] 처럼 경로가 출력됐다. 9개에서는 port exited 1 과 Node.js v22.23.5 만 출력됐다. 그 9개를 이식판에 하나씩 직접 넣자 모두 port asked for more random numbers than the original used 오류가 출력됐다

## Measured

- verify 로 웹 이식판 6개를 기록 170개와 대조하는 데 걸린 시간: 24.6초 (verify all --port web 을 time 으로 한 번 실행했다. 기록 170개에 들어 있는 입력은 모두 667,561개다)

## Progress (days after launch; full history https://select1.dev/2026-11-26/progress)

- day 3 (checked 2026-11-28) [active] commits since launch 106, stars 412, releases 2, contributors 20, last commit 2026-11-27
  - When a game port fails, `verify` now shows the actual error instead of the Node.js version line. Entry 047 found this problem.
  - CI now checks that the published play pages match the web ports.
  - A game with no recordings now fails the check.
  - Added Mines, a minesweeper game, with its behavior spec, recordings and a web port.
  - Screen readers now read the board and game state of Mines, Bricks and Paddles.

## 한국어

## 무엇이 문제인가

코딩 에이전트에게 게임을 다른 엔진으로 이식하게 하면, 이식한 게임이 원본과 똑같이 동작하는지 확인하기 어렵다. Anthropic 은 Claude Code 문서에서 통과나 실패로 끝나는 검사를 에이전트에게 제공하라고 권장한다. 예로는 테스트 파일, 출력을 기대 결과와 비교하는 스크립트, 디자인 시안과 비교할 브라우저 스크린샷을 든다. 게임의 상태는 시간과 난수에 따라 계속 바뀌어서, 스크린샷 한 장으로는 그중 한 순간만 확인할 수 있다. 원본의 동작을 기록한 기대 결과가 없으면, 이식한 게임이 수천 프레임 동안 원본과 같은 규칙으로 움직이는지는 사용자가 직접 플레이해 확인해야 한다.

## 어떻게 해결했나

Erkam Yaman 이 2026년 11월 25일 GitHub 에 rea-games 를 공개했다.

rea-games 는 원본 게임의 동작을 기록하는 CLI 다. 다시 만든 게임을 이 기록과 비교해 검사한다. 원본 코드는 고치지 않고, 시간 함수와 난수 함수만 교체한다. 그래서 같은 입력으로 다시 실행하면 같은 결과가 나온다. 기록에는 입력, 원본이 생성한 난수 전부, 단계별 게임 상태가 들어간다. 이식판은 엔진과 언어가 달라도 검사할 수 있다. 기록을 표준 입력으로 받아 상태 목록을 JSON 으로 출력하면 된다. `verify` 명령은 모든 상태가 기록과 같은지 확인한다. 난수를 원본과 같은 횟수만큼 썼는지도 본다. 다르면 처음 달라진 값의 경로를 출력한다. Claude Code 와 Codex 용 스킬도 제공한다. 에이전트는 이 스킬로 게임을 기록하고 게임 규칙을 명세로 정리한다. 그 뒤 이식과 검사를 차례로 실행한다.

## 무엇이 다른가

첫째, 비교하는 기준이 다르다. Claude Code 문서의 예에서는 사용자가 준비한 테스트, 기대 결과, 시안이 기준이다. rea-games 에서는 원본을 고치지 않고 실행해 만든 기록이 기준이다. 난수는 시드로 다시 만들지 않고, 원본이 생성한 값을 기록해 이식판에 차례로 넘긴다. 제작자는 DECISIONS.md 에서 그 이유로, 이식판은 원본과 언어가 달라 원본의 난수 생성기를 재현할 수 없다는 점을 든다. 트레이드오프는 시간 함수와 난수 함수를 교체했을 때 같은 입력에 같은 결과를 내는 게임만 기록할 수 있다는 점이다. README 에 따르면 네트워크 게임과 상태를 외부에서 읽을 수 없는 게임은 아직 지원하지 않는다.

둘째, 비교하는 범위가 다르다. 스크린샷으로는 한 순간의 화면만 비교할 수 있다. rea-games 는 기록한 모든 단계의 게임 상태를 비교하고, 이식판이 난수를 사용한 횟수까지 확인한다. 2048 의 기록 전체에서는 입력 24,044개마다 그 뒤의 상태를 비교한다. 트레이드오프는 화면에 렌더링된 결과는 비교하지 않는다는 점이다. 저장소의 pitfalls.md 에 따르면, 떨어지는 블록을 쌓는 게임 Blocks 의 이식판은 번들링 스크립트의 버그로 플레이 페이지에 쌓인 블록과 격자선을 그리지 못했다. 그때도 `verify` 검사는 통과했다.

## 어떻게 만들었나

- 커밋은 75개이고 날짜는 모두 2026년 11월 25일이다. 작성자 이름은 Kam(59개), Pure Tech, renovate[bot] 등이다. Co-authored-by 트레일러가 있는 커밋은 없다.
- DECISIONS.md 에 따르면 저장소는 제작자의 감독 없이 만들어졌고, 첫 버전은 한 세션에서 작성됐다. 어떤 도구를 썼는지는 나와 있지 않다. 확인한 내용과 확인하지 못한 내용은 docs/STATUS.md 에 정리돼 있다.
- CLI 와 기록 스크립트는 npm 패키지 없이 Node 22 만 사용한다.

## 실행해 보니

저장소를 별도 디렉토리에 클론해, 환경 변수를 비운 셸에서 Node 22 로 실행했다.

1. 검사. `verify all --port web` 으로 웹 이식판 6개를 검사했다. 기록 170개 모두에서 이식판의 상태가 기록과 같았다. 검사에는 24.6초가 걸렸다. Godot 와 Rust(Bevy) 이식판은 실행하지 않았다.
2. 일부러 버그 넣기. 2048 이식판에서 새 타일이 2 일 확률을 0.9 에서 0.8 로 바꿨다. README 의 예와 같이 기록 19개 가운데 3개만 통과했다. 통과한 3개는 입력이 5~30개인 짧은 기록이다. 실패 16개 가운데 7개에서는 `[13].grid[2][0]` 처럼 처음 달라진 값의 경로가 출력됐다.
3. 표시되지 않은 원인. 나머지 9개에서는 `port exited 1` 과 `Node.js v22.23.5` 만 출력됐다. 이 9개 기록을 하나씩 이식판에 직접 넣자, 모두 원본보다 난수를 더 많이 요청했다는 오류가 출력됐다. `verify` 는 이식판이 오류로 끝나면 표준 오류의 마지막 두 줄만 보여 준다. Node 22 는 처리되지 않은 오류로 끝날 때 오류 메시지 뒤에 빈 줄과 버전 줄을 출력한다. 그래서 마지막 두 줄에는 원인을 알려 주는 오류 메시지가 들어가지 않는다. 제작자는 pitfalls.md 에서 실패마다 원인을 읽으라고 권하지만, 이 9개의 원인을 보려면 이식판을 따로 실행해야 했다. 제작자는 rea-games 를 공개한 날 이 문제를 이슈 #7 로 등록했다. 이 이슈는 아직 열려 있다.
4. 다시 기록하기. 원본 2048 을 `record 2048` 로 다시 기록하자, 새 기록 19개가 저장소의 기록과 바이트 단위로 같았다. 0.2초 걸렸다.
5. 테스트. `node --test` 를 실행하자 테스트 26개가 모두 통과했다.

```text title="터미널, 확률을 바꾼 2048 이식판"
$ node bin/rea-games.mjs verify 2048 --port web
2048 / web
  ok   board-fills-then-over.json  (5 inputs)
  FAIL corner-3.json: port exited 1:  | Node.js v22.23.5
  => 3/19 cases identical, 44 inputs, 47 recorded states
```

```text title="터미널, corner-3 을 이식판에 직접 넣은 결과"
$ node games/2048/ports/web/run.mjs < corner-3.json
Error: port asked for more random numbers than the original used
    at Game2048.rng (file:///tmp/run/app/games/2048/ports/web/run.mjs:6:54)
    at Game2048.addTile (file:///tmp/run/app/games/2048/ports/web/game2048.mjs:41:24)

Node.js v22.23.5
```

## 확인하지 못한 것

- 에이전트가 처음부터 작성한 이식판. Claude Code 에 rea-games 플러그인을 설치하고, 저장소에 없는 오픈소스 게임으로 스킬을 실행해 보자.
- 브라우저에서 기록하는 게임. Playwright 로 원본을 실행하는 Dino 를 `record dino` 로 다시 기록해, 저장소의 기록과 같은지 확인해 보자.
- Godot 와 Rust(Bevy) 이식판. 다른 언어의 이식판도 기록한 난수만으로 같은 결과를 내는지, cargo 와 Godot 4.4 를 설치하고 `verify all` 을 실행해 확인해 보자.

## 판정

작동한다. 버그를 넣은 2048 이식판은 기록 19개 가운데 16개에서 검사에 실패했다. 다만 1.1.0 에서는 실패한 기록 가운데 절반 넘게는 원인 대신 Node.js 버전 줄만 표시됐다. 원인을 보려면 이식판을 따로 실행해야 했다. 제작자는 11월 26일 커밋 3c9984c 를 머지해 이 문제를 수정했다. 에이전트가 다른 엔진으로 옮긴 게임을 확인하려는 경우에 써 볼 만하다.

## 얻어갈 것

- 다시 만든 게임을 원본과 비교할 때는, 원본이 생성한 난수를 기록해 그대로 넘기자. rea-games 의 웹 이식판 6개는 기록의 난수를 받아, 모든 단계의 상태가 원본과 같았다.
- 검사를 일부러 실패시켜 볼 때는 실패마다 원인이 출력되는지도 확인하자. 2048 이식판에서 확률 하나를 바꾸자, 실패한 기록 가운데 절반 넘게는 원인이 출력되지 않았다.

### 용어

- 에이전트 스킬: AI 에이전트가 특정 작업을 할 때 읽는 지침 파일과 실행하는 스크립트의 묶음.

## English

## The problem

When you ask a coding agent to port a game to another engine, it is hard to check whether the port behaves exactly like the original. In the Claude Code docs, Anthropic recommends giving the agent a check that ends in pass or fail. Their examples are a test file, a script that compares output with expected results, and a browser screenshot to compare with a design mockup. A game’s state keeps changing with time and random numbers, so one screenshot shows only one moment of it. Without expected results that record how the original behaves, you have to play the port yourself to see whether it follows the original’s rules for thousands of frames.

## How it solves it

Erkam Yaman published rea-games on GitHub on November 25, 2026.

rea-games is a CLI that records how an original game behaves. It checks a rebuild by comparing it with that recording. The original runs unmodified. rea-games replaces only the original’s time and random number functions from outside. So running it again with the same inputs gives the same result. A recording holds the inputs, every random number the original generated and the game state at each step. A rebuild can use any engine and language. For the check, it only has to read a recording on standard input and print its own states as JSON. `verify` checks that every state matches the recording. It also checks that the rebuild used random numbers as many times as the original. If a state does not match, `verify` prints the path to the first value that differs. There is also a skill for Claude Code and Codex. With it, an agent records the original and writes a spec of the game’s rules. Then it builds the port and checks it.

## What is different

First, rea-games differs in what it compares against. The Claude Code docs’ examples compare against tests, expected results or mockups that you prepare. rea-games compares against a recording made by running the original unmodified. Random numbers are not regenerated from a seed. The numbers the original generated are recorded and passed to the port in order. According to DECISIONS.md, a port cannot reproduce a random number generator from another language. The trade-off is that rea-games can only record some games. The same inputs must give the same result after it replaces the game’s time and random number functions. According to the README, network games and games whose state cannot be read from outside are not supported yet.

Second, rea-games differs in what it checks. A screenshot check can compare only one moment on screen. rea-games compares the game state at every recorded step, and it also checks how many times the port used random numbers. For 2048, it compares the state after each of the 24,044 inputs in all the recordings. The trade-off is that it does not compare what is rendered on screen. According to the repository’s pitfalls.md, the play page of the Blocks port, a falling-blocks game, did not draw the settled blocks or grid lines. A bug in the bundling script caused it. `verify` still passed.

## How it was built

- The repository has 75 commits, all dated November 25, 2026. The author names include Kam (59 commits), Pure Tech and renovate[bot]. No commit has a Co-authored-by trailer.
- DECISIONS.md says the repository was built unattended and its first version was written in one session. It does not say which tool was used. docs/STATUS.md lists what was checked and what was not.
- The CLI and the recording scripts use only Node 22, with no npm packages.

## Running it

I cloned the repository into a separate directory and ran it with Node 22 in a shell with an empty environment.

1. Checking. I checked the 6 web ports with `verify all --port web`. In all 170 recordings, each port’s states matched the recording. The check took 24.6 seconds. I did not run the Godot or Rust (Bevy) ports.
2. Adding a bug on purpose. In the 2048 port, I changed the chance that a new tile is a 2 from 0.9 to 0.8. As in the README’s example, only 3 of the 19 recordings passed. The 3 that passed are short recordings with 5 to 30 inputs. For 7 of the 16 failures, the output gave the path of the first value that differed, such as `[13].grid[2][0]`.
3. A hidden cause. The other 9 failures showed only `port exited 1` and `Node.js v22.23.5`. I fed each of those 9 recordings to the port directly. Each run printed an error saying the port asked for more random numbers than the original used. When a port ends with an error, `verify` shows only the last two lines of standard error. When Node 22 exits on an uncaught error, it prints a blank line and a version line after the error message. So the last two lines never include the message that explains the cause. In pitfalls.md, the maker recommends reading the cause of each failure. For these 9 failures, I had to run the port separately to see it. The maker filed this as issue #7 on the day rea-games was published, and it is still open.
4. Recording again. I recorded the original 2048 again with `record 2048`. The 19 new recordings were byte for byte the same as the ones in the repository. It took 0.2 seconds.
5. Tests. When I ran `node --test`, all 26 tests passed.

```text title="Terminal, the modified 2048 port"
$ node bin/rea-games.mjs verify 2048 --port web
2048 / web
  ok   board-fills-then-over.json  (5 inputs)
  FAIL corner-3.json: port exited 1:  | Node.js v22.23.5
  => 3/19 cases identical, 44 inputs, 47 recorded states
```

```text title="Terminal, corner-3 fed to the port directly"
$ node games/2048/ports/web/run.mjs < corner-3.json
Error: port asked for more random numbers than the original used
    at Game2048.rng (file:///tmp/run/app/games/2048/ports/web/run.mjs:6:54)
    at Game2048.addTile (file:///tmp/run/app/games/2048/ports/web/game2048.mjs:41:24)

Node.js v22.23.5
```

## Not checked

- A port an agent builds from scratch. Install the rea-games plugin in Claude Code and run its skill on an open-source game that is not in the repository.
- A game recorded in a browser. Record Dino again with `record dino`, which runs the original in Playwright. Then check that the result matches the repository’s recordings.
- The Godot and Rust (Bevy) ports. Install cargo and Godot 4.4, then run `verify all`. It shows whether ports in other languages also give the same result from the recorded random numbers alone.

## Verdict

It works. A 2048 port with an added bug failed the check on 16 of its 19 recordings. But in 1.1.0, more than half of the failures showed only a Node.js version line in place of the cause. To see the cause, I had to run the port separately. On November 26, the maker merged commit 3c9984c to fix this. It is worth trying if you want to check a game an agent ported to another engine.

## What to take away

- When you compare a rebuilt game with the original, record the random numbers the original generates and pass them to the rebuild as they are. The 6 web ports in rea-games took the recorded random numbers, and their state matched the original at every step.
- When you make a check fail on purpose, also see whether each failure shows its cause. When I changed one probability in the 2048 port, more than half of the failures did not show the cause.

### Terms

- agent skill: Instructions, sometimes with scripts, that an AI agent uses for a specific task.

## Launches the same day

- Old Nvidia and ATI tech demos <https://gpu-demo-gallery.pages.dev/> (Show HN, 310): 그래픽 데모 모음. 1998~2006년의 3dfx, NVIDIA, ATI 데모를 브라우저에서 다시 실행한다.
- Sashay <https://vcarl.com/sashay/> (Show HN, 36): React UI 라이브러리. WebOS Enyo 처럼 화면을 옆으로 밀어 넘기는 패널을 만든다.
- U.S. Interstate Weather <https://www.interstateweather.com/> (Show HN, 26): 날씨 사이트. 미국 고속도로를 따라 국립기상청의 예보와 경보를 보여 준다.
- Carry <https://carry.md/> (Show HN, 26): AI 대화 백업 도구. ChatGPT, Claude, Gemini, Grok 의 대화를 내 폴더에 Markdown 으로 저장한다.
- token-tv <https://github.com/click6067-ship-it/token-tv> (Show HN, 22): 하드웨어 프로젝트. 5달러짜리 AliExpress 시계를 Claude 사용량을 보여 주는 책상 펫으로 바꾼다.
- StikSound <https://github.com/SilverFeit/StikSound> (GitHub, 184): WhatsApp 스티커 도구. PNG 와 GIF 스티커에 5초까지 소리를 붙인다.
- rea-games <https://github.com/erkamyaman/rea-games> (GitHub, 162): 게임 이식 검사 도구. 다시 만든 게임을 원본 게임의 기록과 비교한다.
- MyClaw 3.0 <https://www.producthunt.com/products/myclaw-3-0> (Product Hunt, 250): 에이전트 팀 서비스. 기억을 공유하는 AI 에이전트 팀을 상시 운영한다고 소개한다.
- Airbot <https://www.producthunt.com/products/airbots> (Product Hunt, 215): AI 비서 서비스. 사용자에게 먼저 문자를 보내는 비서라고 소개한다.
- Snag by Parallel <https://www.producthunt.com/products/snag> (Product Hunt, 134): 쇼핑 도구. 에이전트가 상품의 최저가를 찾게 한다.

## Getting started

- Steps: git clone https://github.com/erkamyaman/rea-games ; cd rea-games && node bin/rea-games.mjs verify all --port web
- Needs: Node 22. npm 패키지는 필요 없다., 브라우저 게임을 기록하려면 Playwright 와 Chromium, Rust 이식판을 검사하려면 cargo, Godot 이식판을 검사하려면 Godot 4.4.
- Cost: 무료, MIT 라이선스.
