playproof

io.github.EmirhanOzl由 GitHub 帳號 EmirhanOzl 發布v0.3.2更新於 Oct 30, 2026

See and playtest browser games: frame-by-frame motion, crash hunting, phone layouts, frame pacing.

概覽

AI 產生的概覽

替助手試玩瀏覽器遊戲:逐幀動作圖、腳本化操作、崩潰搜尋、手機版面與影格節奏,結果以圖片回傳。

可以做什麼
  • 在虛擬時鐘上逐幀拍攝動作,產生接觸表、洋蔥皮圖與改動前後對照
  • 依腳本執行點擊、拖曳、按鍵與等待,回傳分鏡圖
  • 用可重現種子的隨機輸入搜尋崩潰、卡死、軟鎖與渲染迴圈停止,並附上重現指令
  • 在九種螢幕上載入遊戲,回報畫布模糊或被裁切、觸控目標過小等版面問題
  • 量測影格時間、掉幀、長任務與堆積成長,可在本機或透過 USB 連接的 Android 手機執行
  • 依設定的情境與已提交的基準比對,作為動作快照測試
適用情境
當助手修改網頁遊戲後需要真正看到結果時使用:檢查動畫、流程、多次點擊後的崩潰、手機版面或流暢度,再判斷改動是否有效。也適合在 CI 中檢查動作回歸。
執行需求
以 npx 啟動的本機程序;需要 Node.js 22.18 或更新版本。需要 Chromium 核心瀏覽器(已安裝的 Chrome 或 Edge,或自行下載的 Chromium)。Android 相關功能需要 adb 與開啟 USB 偵錯的手機。未宣告帳號、API 金鑰或環境變數。
安裝前請注意
它會驅動真實瀏覽器並向遊戲送出輸入,Android 模式會先重新載入應用程式頁面再還原。check 工具在啟用 update 時會改寫基準檔案。執行會在 .playproof 目錄寫入圖片與報告。動作偵測屬於啟發式判斷,本機效能數據來自無 GPU 的模擬。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 playproof,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

[圖片]

playproof

Eyes and hands for browser games.

[npm] [CI] [License: MIT] [Node]

Coding agents can write a web game in minutes, but they can't watch it move. playproof lets them (and you) see a game frame by frame, play it with scripted input, hunt for crashes, check it on phone screens and measure how smoothly it runs, on desktop or on a real Android phone. Everything comes back as images made to be read, with a short summary that points at what looks wrong.

[A contact sheet of a buggy game: two white flicker frames and a teleporting ball are outlined in red and explained under the chart]

Tested with Canvas 2D, DOM, Phaser 3, PixiJS 8, three.js, Godot 4 web exports and Unity WebGL builds: two runs of each give identical frames (npm run test:engines).

Install

Ask your agent

Paste this into Claude Code, Codex, Cursor, Gemini CLI or any other coding agent:

text
Install playproof from https://github.com/EmirhanOzl/playproof

It will pick the right command below for itself.

Claude Code

bash
claude plugin marketplace add EmirhanOzl/playproofclaude plugin install playproof@playproof

Codex

bash
codex plugin marketplace add EmirhanOzl/playproofcodex plugin add playproof@playproof

Gemini CLI

bash
gemini extensions install https://github.com/EmirhanOzl/playproof

Cursor, OpenCode, GitHub Copilot and other agents

bash
npx skills add EmirhanOzl/playproof

Claude Desktop and other MCP apps

For apps that call tools instead of running commands, playproof is also an MCP server whose tools return the images directly. Add it to the app's MCP config:

json
{  "mcpServers": {    "playproof": { "command": "npx", "args": ["-y", "playproof", "mcp"] }  }}

Without an agent

Nothing to install. npx playproof init in your game's folder writes a playproof.config.json (it finds your dev server, build folder or HTML file); or point any command at a dev server, a build folder or an HTML file directly:

sh
npx playproof frames http://localhost:5173 --device "Pixel 8" --do "tap 50%,50%" --duration 1s

playproof uses your installed Chrome or Edge. npx playproof install-browser downloads its own Chromium if you prefer.

Why

A screenshot catches one random instant, so the things that make a game feel broken stay invisible: a jump without anticipation, a sprite that teleports, a one-frame flicker, a button that does nothing, a crash after a hundred taps, a canvas that is blurry on every phone.

playproof runs the game on a virtual clock. Time only moves when playproof moves it, one exact frame at a time, so it can film any moment and every run gives the same pixels. Then it lays the frames out where a model (or a person) can actually look at them. Because runs repeat exactly, an agent can film a motion, change the code, film it again and see precisely what its change did.

What it does

frames: watch an animation

Films the game frame by frame and builds a contact sheet: dashed boxes show what changed since the previous tile, and the bar chart shows how much of the screen changed in every frame. playproof flags sudden jumps (teleports, missing tweens), one-frame flicker (draw-order bugs, half-updated state), holds (stalls) and nothing moving at all.

sh
npx playproof frames ./dist --device "Pixel 8" --do "tap @Play; wait 400ms; key Space" --duration 700ms

[Contact sheet of a jump: 14 tiles over 700 ms with dashed boxes around what moved, and a bar per frame]

Add --animate to also get the film as an animated PNG at real speed, to watch it yourself or drop into a pull request. Add --zoom auto when the thing that moves is small: playproof captures at full device resolution and crops every frame to where most of the motion happens, so a character's squash and stretch fill the tiles.

It also draws an onion skin: the whole motion in one picture, oldest moments faintest. The gaps between the ghosts are the easing (wide gaps are fast, tight gaps are slow), which is exactly what animators look at to judge an arc, an anticipation or an overshoot.

[Onion skin of the jump: ghosts bunch up near the top of the arc, where the character slows down]

frames --compare: see what a change did

Film, change the code, film again with --compare <earlier run>. Every sampled frame of the earlier run sits above the same frame now, with the differences outlined, and the earlier run's motion is drawn as a line over the new bars. Because runs are deterministic, "identical" means identical.

sh
npx playproof frames http://localhost:5173 --do "tap @Play; key Space" --out .playproof/before# ...change the jump...npx playproof frames http://localhost:5173 --do "tap @Play; key Space" --compare .playproof/before

[Before and after a snappier jump: the new frames reach the top sooner and land earlier]

play: run a script, get a storyboard

sh
npx playproof play http://localhost:5173 --device "Pixel 8" \  --do "shot title; tap @Play; wait 400ms; key Space; film 600ms; until window.playproof.state().screen === 'over' 20s; shot game over; tap @Retry; shot retry"

[Storyboard: title screen, four frames of a jump, the game over screen, and the retry]

monkey: random play that hunts for crashes

Taps, drags, long presses, rapid triple taps, keys, and sending the tab to the background, all at random but repeatable by seed. It reports uncaught errors, failed requests, hangs (infinite loops), soft-locks (input keeps coming, nothing changes) and a render loop that stops. Every error comes with a command that reproduces it exactly, and the whole run is saved as repro.steps, a script play --script replays action by action: delete lines until only the ones that matter are left.

When the game exposes its buttons (see the hook below), the monkey explores: on each screen it tries buttons it has not pressed yet before repeating itself. screens.png shows every distinct screen it reached, so you can see how far a random player gets, and what it never reached.

sh
npx playproof monkey ./dist --device "Pixel 8" --steps 300
ERROR   Uncaught error: TypeError: Cannot read properties of undefined (reading 'activate')        during: action 13: tap 699,820, wait 119ms        at HTMLCanvasElement.<anonymous> (http://127.0.0.1:52009/:51:40)        Reproduce: playproof monkey "./dist" --seed 1 --steps 13 --device "Pixel 8"

devices: phones, tablet and desktop side by side

Loads the game on nine screens and checks for the layout bugs that only show up there: blurry canvas (no devicePixelRatio scaling), stretched canvas, canvas cut off, page scrolling, missing viewport meta, missing touch-action: none, clipped text and tiny touch targets. The same problem on several devices is reported once.

sh
npx playproof devices http://localhost:5173

[Six devices side by side; the stretched ball on landscape and desktop is obvious, and findings are listed underneath]

On a real Android phone, in Chrome or inside your app

frames, play, monkey and perf run on a USB-connected Android phone with --android (a tab in Chrome) or --app <package>, which attaches to the WebView inside an app built with Capacitor, Cordova or Ionic. playproof reloads the app's page with the virtual clock, so you get the same frame-exact sheets from the real app on the real device, and reloads it back to normal when it is done. Localhost is forwarded to the phone automatically.

sh
npx playproof frames http://localhost:5173 --android --do "tap 50%,60%" --duration 800msnpx playproof monkey --app com.example.mygame --steps 200npx playproof perf --app com.example.mygame --duration 10s --monkey

Debug builds of Capacitor and Cordova apps have WebView debugging on; for other builds see webContentsDebuggingEnabled. In Chrome, playproof opens its own tab, talks only to that tab and closes it afterwards; it never lists or reads your other tabs.

perf: frame pacing, locally or on a real phone

Measures real frame times while the game idles, runs a script (--do) or takes random taps (--monkey): fps, p95/p99, dropped frames against the display's refresh rate, long main-thread tasks and heap growth. Locally the CPU is slowed 4× to approximate a mid-range phone. With --android it measures Chrome on a USB-connected Android phone; localhost is forwarded to the phone automatically.

sh
npx playproof perf ./dist --duration 10s --monkeynpx playproof perf http://localhost:5173 --android

[Frame-time chart with most bars over the 16.7 ms budget line, marked red]

Scenarios and check: snapshot tests for motion

Put the game's defaults and the moments worth watching in playproof.config.json (your editor autocompletes it from the schema):

json
{  "$schema": "https://unpkg.com/playproof/schema/config.schema.json",  "target": "http://localhost:5173",  "device": "Pixel 8",  "scenarios": {    "title": { "duration": "800ms" },    "jump": { "do": "tap @Play; wait 400ms; key Space", "duration": "700ms", "zoom": "auto" }  },  "check": { "monkey": { "steps": 200 }, "devices": true }}

Then the target can be left out, and --scenario jump replaces the whole step list:

sh
npx playproof frames --scenario jump

playproof check films every scenario and compares it with its baseline in playproof-baselines/, then runs monkey and devices. The first run writes the baselines (commit them). After that, any change to how a scenario moves fails the check with a compare.png that shows exactly what changed, until you accept it with --update. Baselines are kept per operating system, because fonts and anti-aliasing differ between them.

sh
npx playproof check                 # everythingnpx playproof check --only jump     # one scenarionpx playproof check --update        # accept the current motion

In CI

yaml
- uses: actions/checkout@v7- uses: EmirhanOzl/playproof@v0  with:    start: npm run preview    wait-for-url: http://localhost:4173

The action installs Chromium, runs playproof check (or any command via command and args), writes the summary to the job page and uploads the images as an artifact. Generate the Linux baselines once in CI (the first run writes them; download them from the artifact or run --update there) so they match the machine that checks them.

Steps

Used by --do and --script <file> (one step per line there). Separate steps with ;. Points are relative to the game area (the largest canvas, or --area <selector>).

StepMeaning
wait 500mslet time pass (instant and exact on the virtual clock)
tap 50%,80% / tap 120,300 / tap @Playtap or click; @label uses targets the game exposes
press 50%,50% 800mslong press
drag 10%,50% 90%,50% 300msswipe
key Space [200ms]press a key (held 50 ms by default)
type hellotype text
click #startclick a DOM element
shot [label]screenshot for the storyboard
film 1s [30]capture frames while time passes
until <js> [5s]advance time until the expression is true
expect <js>fail the run unless the expression is true (says what the left side was)
background 5ssend the game to the background (no frames), then bring it back
js <js>evaluate and log a value

Times: 500, 500ms, 1.5s.

Optional: a hook in your game

None of this is required, but four small functions make tests sharper:

js
window.playproof = {  ready: () => assetsLoaded,               // boolean, function or promise: when to start  state: () => ({ screen, level, score }), // logged; used to tell a soft-lock from a busy screen  targets: () => [{ x, y, width, height, label: "Play" }], // CSS px; enables "tap @Play" and aims the monkey at buttons  area: () => ({ x, y, width, height }),   // the game world inside a letterboxed canvas; crops every capture};

Without it, use --ready "<js expression>" or --wait-for <selector> to wait for loading, and percentages for taps. examples/jumper shows the hook in a complete game.

How it works

  • Virtual clock. Before any game script runs, playproof replaces requestAnimationFrame, setTimeout/setInterval, performance.now and Date, and stops the CSS animation timeline. Time starts frozen. Advancing it runs timers and frames in exact order at 60 fps, which is why wait 2s takes milliseconds and why two runs produce identical frames.
  • Repeatable loading. While the page loads, playproof advances frames itself. Whenever the game has work in flight that takes real time (network requests, WebAssembly compilation, image and audio decoding, IndexedDB), virtual time waits for it, so a slow machine or connection gives the same frames as a fast one. The settle time counts from the moment the game's render loop starts, which is when engines like Unity and Godot start their own clocks.
  • Seeded randomness. Math.random is seeded (--seed, or --seed off).
  • Real input. Touch devices get real touch events (with the pointer and mouse events Chrome derives from them); others get mouse events. Key presses are held for a few frames so games that poll input see them.
  • Images, not logs. Contact sheets, onion skins, storyboards and charts are drawn in a blank Chromium page, so playproof has a single dependency (playwright-core) and no native image libraries.

Output

Each run writes to .playproof/<time>-<command>/ (or --out <dir>): the images, report.json with all the numbers (per-frame motion, step log, frame times), summary.txt, and the sampled frames in tiles/ for later comparisons. Add .playproof/ to your .gitignore. --json prints the report instead of the summary.

Exit codes: 0 nothing serious found, 1 errors found (crashes, failed requests, failed steps, frame drops on a real phone), 2 playproof itself could not run. That makes monkey and devices usable as CI checks.

Requirements

  • Node.js 22.18 or newer.
  • A Chromium-based browser: your installed Chrome or Edge, or npx playproof install-browser. Pick one with --browser chromium|chrome|msedge|<path>.
  • For --android and --app: adb (Android platform-tools), a phone with USB debugging allowed, the screen on and unlocked.

Limitations

  • Audio, video, Web Workers and WebAssembly threads keep real time; a game whose simulation runs in a worker will not be frame-exact.
  • Local perf numbers come from emulation without a GPU: good for comparing before and after a change, not for promising a frame rate. Use --headed for GPU rendering or --android for the real thing.
  • Motion findings are heuristics. A sudden jump may be an intended cut and a one-frame flash may be a deliberate hit flash, which is why they are worded as things to look at.
  • Chromium only, for now.

Development

sh
npm installnode src/cli.ts install-browser   # oncenpm run check                     # type check + unit and end-to-end testsnpm run docs:images               # regenerate the README images with playproof itself

The two example games are also the test targets: examples/jumper is a small, clean game; examples/buggy has eight planted bugs that the tests expect playproof to catch.

Issues and pull requests are welcome. See CONTRIBUTING.md.

License

MIT

來源:README.md,提交 6eb0a4e

工具

6

frames

Film an animation frame by frame

Runs the game on a virtual clock, optionally performs steps to trigger something, then films it frame by frame. Returns a contact sheet (tiles with frame number and time, dashed boxes around what moved, a bar per frame of how much changed) and an onion-skin image (the whole motion ghosted into one picture), plus flagged sudden jumps, one-frame flicker and stalls. Runs are deterministic: pass compare = the folder of an earlier run to see exactly what a code change did.

輸入參數fpsareazoomreadystepsdevicetargetcomparewaitFordurationscenario

play

Play a scripted sequence

Plays a script of taps, drags, keys and waits on the virtual clock and returns a storyboard of every "shot" and "film" step. Use "until <js> <time>" to wait for game states instead of guessing.

輸入參數areareadystepsdevicetargetwaitForscenario

check

Check every scenario against its baseline

Films every scenario in playproof.config.json and compares it with its committed baseline (a snapshot test for motion), then runs monkey and devices. Changed motion is an error with a compare image; update = true accepts the current motion as the new baseline (rewrites files: only when the change is intended).

輸入參數onlyupdate

monkey

Hunt for crashes with random play

Random taps, drags, keys and backgrounding, repeatable by seed. Reports uncaught errors, failed requests, hangs, soft-locks and a render loop that stops, each with a command that reproduces it.

輸入參數areaseedreadydevicetargetactionswaitForscenario

devices

Check phones, tablet and desktop

Loads the game on nine screens and returns them side by side, with layout findings: blurry or stretched canvas, canvas cut off, page scrolling, missing viewport meta, missing touch-action, clipped text, small touch targets.

輸入參數areareadystepsdevicetargetdeviceswaitForscenario

perf

Measure frame pacing

Measures real frame times (fps, p95/p99, dropped frames at the display's refresh rate, long tasks, heap growth) while the game idles, runs steps, or takes random taps. Locally the CPU is slowed 4x; android = true measures Chrome on a USB-connected Android phone.

輸入參數cpuareareadystepsdevicemonkeytargetandroidwaitFordurationscenario

版本歷史

1
  1. v0.3.2最新Oct 22, 2026

評分

已滿足適用檢查項的 90%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分
  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具必需15 分
  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分