/vibedgames:playtestfrom vibedgames
Drives a real browser against a game for smoke checks, scripted playtests, softlock detection, screenshots, and visual diffs on localhost or deployed URLs via `vg playtest`.
Ships in vibedgames. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
A build that compiles proves nothing. A game that renders proves almost nothing. Playtesting proves it plays — that the loop runs, input moves the player, the objective is reachable, and nothing throws along the way.
vg playtestEverything here runs through one command. vg playtest is a passthrough to agent-browser, a native browser-automation CLI built for agents — vg installs it and its browser on first use, so there is nothing to add to the game's package.json to drive it. No test runner, no devDependencies, no MCP server to configure. (The one optional dependency is on the game's side: @vibedgames/playtest types and publishes the diagnostics contract below.)
vg playtest open http://localhost:5173 # launch + navigate (headless by default)
vg playtest snapshot -i # interactive elements, with @eN refs
vg playtest click @e2 # act on a ref from that snapshot
vg playtest eval "window.__GAME_DIAGNOSTICS__" --json
vg playtest screenshot /tmp/frame.png
vg playtest close
A daemon persists between invocations, so one-call-per-step is cheap and the page stays open across commands.
agent-browser ships its own skills and serves them from the installed binary, so the content always matches the version you actually have:
vg playtest skills get core # the general browser-automation guide — read before driving anything
vg playtest skills get core --full # + full command reference and templates
vg playtest skills get dogfood # systematic exploratory testing / bug hunts
vg playtest skills list # everything available on this version
skills get core is the source of truth for the generic surface — the snapshot-and-ref loop, sessions, waiting, forms, auth, troubleshooting. Don't re-derive it here, and don't trust a stale memory of it. An older agent-browser build with no skills subcommand falls back to vg playtest --help.
This skill covers only what upstream can't know: the game diagnostics contract, the scripted playtest, canvas/WebGL determinism, --game, and the traps we hit driving real games (see below). references/cli-cheatsheet.md is the game-shaped subset of commands.
Playtest a deployed game with no local setup at all:
vg playtest --game my-game # opens https://my-game.vibedgames.com
vg playtest --game # reads the slug from ./vibedgames.json
That is the fastest possible loop after vg deploy: ship it, then play it.
Before anything clever, prove the game boots and doesn't throw:
vg playtest batch \
"open http://localhost:5173" \
"wait --fn 'window.__GAME_TEST_HOOKS__ !== undefined'" \
"eval 'window.__GAME_TEST_HOOKS__.setState(\"active-play\")'" \
"wait --fn '(window.__GAME_DIAGNOSTICS__?.frame ?? 0) > 10'" \
"eval 'window.__GAME_DIAGNOSTICS__' --json" \
"screenshot /tmp/boot.png"
vg playtest errors # uncaught exceptions — must be empty
vg playtest console # console.error — treat as product failure
batch runs the whole sequence in one invocation and returns one result array.
Wait for the contract before waiting for frames. A game sitting on its menu has a frame counter that never moves until setState('active-play') starts a run — wait on frames first and you deadlock on exactly the games that implement the contract correctly. If the first wait times out, the game never published its diagnostics: it crashed on boot, or it doesn't implement the contract. If the second times out, the hooks are no-ops.
Treat any console error or failed asset request as a failure unless you can name why it's benign.
The browser can see pixels; it can't see whether the player is stuck. Games expose two globals so a playtest can measure real state instead of guessing from screenshots:
window.__GAME_DIAGNOSTICS__ — read-only per-frame telemetry (frame, score, complete, player, entities).window.__GAME_TEST_HOOKS__ — the mutations a playtest may perform (seed, setState, setReducedMotion, …).The full field list and rules live in references/scripted-playtest.md — that is the address games/lunerfall/src/sys/diag.ts and games/starfall/src/shared/diag.ts both cite, so it stays the one copy to edit.
npm install @vibedgames/playtest gives the contract as types and three publishers — publishDiagnostics(read) (a live getter), publishTestHooks(hooks), publishPlaytest(manifest) — plus isPlaytestRequested() for the ?test=1 gate and pointerTracker() for cursor-steered games. Optional: the globals are the contract, and setting them by hand is just as valid. games/pong/src/main.ts uses the package.
Two rules worth knowing before you read it: JSON-serializable primitives only, never raw engine objects; and seed(n) must restart the run, not just reseed it, or everything measured afterwards is still unseeded.
Adding this contract to a game is a prerequisite, not an optional extra. Without it a playtest can only assert "pixels changed".
A smoke check proves the game loads; a scripted playtest proves it plays. It drives real held input and measures progression:
# This skill's directory. Claude Code substitutes CLAUDE_SKILL_DIR (project, global
# or plugin install); other agents fall back to wherever `vg init` put it.
SKILL="${CLAUDE_SKILL_DIR}"
[ -d "$SKILL" ] || for d in .agents/skills .claude/skills ~/.agents/skills ~/.claude/skills; do
[ -d "$d/playtest" ] && SKILL=$d/playtest && break
done
# from the project root
node $SKILL/scripts/scripted-playtest.mjs --url http://localhost:5173 --seed 12345
The bundled script (zero dependencies — just Node and vg) drives a scripted sweep of held keys and pointer moves, samples diagnostics during each step, and prints a JSON report. It measures four things: the loop survived (framesAdvanced), input reaches the player (distanceTravelled), the objective is reachable (scoreAfter / stepOfFirstScore), and the player never wedged (longestStuckRun) — plus zero console and page errors. Exit 0 means it plays, 1 means it doesn't and the report names which check failed, 2 means the harness itself broke.
Two defaults are deliberate, and both exist so a passing game passes: objective progression is a warning until you pass --expect-progress, and a game that steers with the mouse needs pointer steps rather than the WASD default. See scripted-playtest.md.
The pass thresholds live in THRESHOLDS at the top of the script; read them there rather than from prose that can drift.
Adapt --script to the game's core verb: a runner holds forward and switches lanes, an arena game sweeps the space, a tower defense places towers through test hooks. Game-specific hooks (forceWave()) are encouraged where raw keys can't express the verb.
Metric meanings, flags, difficulty/fairness runs, and the key-dispatch trap: references/scripted-playtest.md.
The sweep proves the game can be played. It cannot tell you whether a player who is trying gets anywhere — whether the objective is findable from what the game shows, whether the first hazard is readable, whether a run ends in a wall. For that, hand the controls to a model:
vg playtest run --url http://localhost:5173 --goal "Reach the flag on the right; pits kill, jump them"
vg playtest run --game my-game --json # the deployed game, full report as JSON
run is the one vg playtest verb that is ours rather than agent-browser's, so vg playtest run --help documents it and vg playtest --help (the binary's help) does not list it.
The loop runs inside the game's page. Several times a second it reads __GAME_DIAGNOSTICS__, asks a decision-only model (straight from the page to the vibedgames API with a short-lived token — nothing to configure beyond a signed-in vg; see vg-setup) which movement to hold and which actions to take, dispatches them as real held input, and repeats. Code does perception and keystrokes; the model only decides, and the decision latency is the hold, so it plays at about a player's reaction time. For fast games, a move in __GAME_PLAYTEST__ can carry a reflex(game) that runs every frame while it is the model's intent — the model picks what to do a few times a second, the reflex does it at 60 fps. Same report shape and exit codes as the bot, plus decisions (what it chose, how sure it was, reflexFrames, and progress — the model's own 0–1 read of how close the player got to the goal, first to last), decisionsPerSecond, model (calls, tokens, latency) and a per-decision timeline.
Make the game playable by the model first — that is most of the work, and it's the game author's. Publish what a player sees in __GAME_DIAGNOSTICS__ (nearest hazard and pickup as dx/dy, where the goal is, canJump), and describe the controls and the rules in window.__GAME_PLAYTEST__ so the playtester needs no --controls file — publishDiagnostics / publishPlaytest from @vibedgames/playtest, or the bare globals. The snippet for both is in autonomous-playtest.md § Make Your Game Playable by the Model; games/pong/src/main.ts is a live example.
Two things to know before trusting a run. The model sees only the diagnostics — no pixels — so a playtester that can't decide (decisions.meanConfidence below 0.3 warns) is an audit finding about the contract, not about the model. And the goal is where the rules live: what wins, what kills, which way progress is; the model has no memory between decisions beyond the recent block the harness supplies.
Run the playtester beside the sweep, not instead of it. The sweep is deterministic and free; the playtester is for the questions that need someone trying — onboarding, readability, difficulty at two decision rates. Flags, the manifest schema, what the model sees, and how to read a run as a playtest: autonomous-playtest.md.
Two things will mislead you if you don't know them. Read the renderer string before you believe a frame rate: headless can land on the real GPU (vg playtest does on a Mac — an ANGLE Metal renderer) or on SwiftShader (bare Playwright launch()); the bot report's gpu field says which. SwiftShader means functional-only evidence — it renders lit materials black and drops heavy games to ~3–4 fps, so a multiplayer host on it reads as frozen; a hardware renderer (ANGLE Metal/D3D/Vulkan on a real device) is a desktop-GPU signal, still not a phone. A headed or Playwright-launched run needs explicit flags to land on the real GPU (references/canvas-determinism.md § Headless Footguns). And headless can't capture WebGPU canvases on Linux/Windows (the screenshot comes out black even though rendering worked) — a --headed problem with real consequences for what you report.
Determinism setup, readiness signals, flake classification, and the full footgun list: references/canvas-determinism.md.
Visual comparison is built in — there is no separate image-diff tool to install:
vg playtest screenshot /tmp/baseline.png
# … make a change, reload …
vg playtest diff screenshot --baseline /tmp/baseline.png -o /tmp/diff.png
vg playtest diff snapshot --baseline /tmp/before.txt # accessibility-tree diff, for DOM/HUD
A baseline taken without freezing the scene first is a flake generator — the freeze checklist and the "when not to take a baseline at all" judgment are in references/canvas-determinism.md.
Against a reference shot — scripts/ref-sxs.mjs puts a locked ref beside a live capture at matched height and writes a blurred twin for the blur test, which passes only when both halves read as the same genre and production tier:
node $SKILL/scripts/ref-sxs.mjs --ref refs/ref-01.png --game captures/still-01.png --out captures/sxs-01.png
The loop that consumes these — locked refs, per-game bar, fresh critic — is game-playbook → references/visual-bar.md and references/critic-loop.md.
A diff catches a change; it can't tell you the frame was wrong to begin with. For 3D, pair the screenshots with the visual-defect rubric in the threejs skill (references/debugging-and-profiling.md § Visual defects) — z-fighting, shadow acne, wrong color space, and DPR blur all render "successfully" and pass every smoke check.
Metrics and eyes, both. Appearance work reports numbers and same-camera before/after pairs; a number that improves while the frame still looks wrong is a failure. A metric is worth most on the first problem and less on every one after — alternate a measured pass with a by-eye pass that carries no number, and ask "would you show this to someone?". A harness check can be true and useless: it covers what it was written for, not the frame.
❌ Sleep-driven steps — wait 2000 then click
✅ wait --fn "window.__GAME_DIAGNOSTICS__?.frame > 10"
❌ Screenshot-only verdicts — "it looks right"
✅ Read __GAME_DIAGNOSTICS__; a screenshot is evidence, not an assertion
❌ Asserting exact pixel positions without fixed dt and seeded RNG ✅ Assert user-meaningful invariants: score rose, player moved, fail state triggered
❌ Stale refs — @e2 from a snapshot two navigations ago
✅ Re-snapshot after anything that changes the page; refs are per-snapshot
❌ keydown/keyup for game input — agent-browser 0.34 sends them with an empty code and keyCode: 0, so Phaser and friends ignore them entirely
✅ Dispatch the event via eval (what the bot script does), and always release what you hold — see references/scripted-playtest.md
❌ set device "iPhone 15" as a phone check — viewport + UA only; pointer: coarse stays false, so it's the desktop build
✅ Held CDP touch emulation, and assert coarse: true before believing anything — references/cli-cheatsheet.md § Environment
❌ Calling a game verified because it rendered ✅ Run the bot; renders ≠ plays
--script --expect-progress with the game's core verb, and reports longestStuckRun ≤ 2__GAME_PLAYTEST__ published, and vg playtest run scores within the run with meanConfidence ≥ 0.3 — or the diagnostics gained what the playtester was missingvg playtest --game <slug>, not just localhostscripts/scripted-playtest.mjs — the progression-measuring bot; run it, read the JSON reportscripts/ref-sxs.mjs — reference-vs-capture side-by-side plus blurred twin, for visual-parity reviewscripts/lib/harness.mjs — the bot's vg playtest plumbing, held-key and pointer dispatch, motion tracker, boot and seedingreferences/scripted-playtest.md — diagnostics contract, metrics, difficulty/fairness runsreferences/autonomous-playtest.md — vg playtest run: making a game playable by the model (__GAME_PLAYTEST__), flags, what the model sees, reading a run as a playtestreferences/canvas-determinism.md — deterministic mode, readiness, flake triage, Phaser/Three.js specificsreferences/cli-cheatsheet.md — the game-shaped subset of the vg playtest command surfaceFor anything generic — the snapshot/ref loop, sessions, auth, waiting, troubleshooting — read vg playtest skills get core rather than these files.
Any game becomes testable by adding one small, stable seam for readiness and state. The goal is not coverage — it's the ability to answer "does this actually play?" in under a minute, every time, without the human opening a browser.
references/autonomous-playtest.md (opens in a new tab)references/canvas-determinism.md (opens in a new tab)references/cli-cheatsheet.md (opens in a new tab)references/scripted-playtest.md (opens in a new tab)scripts/_lib/asset-tools.mjs (opens in a new tab)scripts/lib/harness.mjs (opens in a new tab)scripts/ref-sxs.mjs (opens in a new tab)scripts/scripted-playtest.mjs (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub kyh/vibedgames --plugin vibedgames35 skills in this plugin
/animated-spritesheetsGenerate a character's animation frames (idle, run, attack, death…) as one labeled pose board, then slice, key and pack them into an engine-ready spritesheet./animationMake 2D sprite animation read well: frame budgets per clip, timing and spacing, cancel windows, smears, secondary motion, wiring clips in Phaser. Generating frames is pixel-art / animated-spritesheets./asepriteParse Aseprite files (.ase/.aseprite) — layers, cels, tags, slices, palettes, tilesets — into JSON, durations and bounds for engines and tools./ask-meInterview the user about a fuzzy game idea, one question at a time, until it is build-ready. Skip when they already know what to build./asset-pipelineAudit 2D game art on disk: validate an asset manifest against PNGs, probe sprite sheets and tilesets for occupied frames, report sizes, fix sprite baselines./capacitor-iosShip a Three.js + Vite app on Capacitor iOS: GLTF loading, animation UI, OrbitControls touch mapping, Swift Package Manager, iOS sync and run troubleshooting.Other plugins' skills for the same job