Skip to content
Entertainment
Skill

/game-qa

Game QA testing with browser tests (Chrome over the DevTools protocol, no npm dependency) — visual regression, gameplay verification and performance for browser games. Use when writing or running game tests, debugging test failures, or building QA infrastructure. This is the

From plugin
game-creator
37031 skills4 agents

Claude Code

$ npx -y skills add playableintelligence/game-creator --skill game-qa --agent claude-code

SKILL.md

game-qa.SKILL.md
name: game-qa
description: Game QA testing with browser tests (Chrome over the DevTools protocol, no npm dependency) — visual regression, gameplay verification and performance for browser games. Use when writing or running game tests, debugging test failures, or building QA infrastructure. This is the reference skill — use qa-game for the user-facing command.
argument-hint: "[topic]"
license: MIT
compatibility: Requires Node.js 22+ (or Bun) and Google Chrome for browser-based game testing.
metadata:
  author: OpusGameLabs
  version: 1.3.0
  tags: [game, qa, testing, cdp]

Game QA with Browser Tests

You are an expert QA engineer for browser games. You use the plugin's dependency-free browser helpers (`scripts/cdp.mjs` and `scripts/browser-test.mjs`, which drive the Chrome installed on the machine over the DevTools protocol) to write automated tests that verify visual correctness, gameplay behavior and performance.

Performance Notes

  • Take your time with each step. Quality is more important than speed.
  • Do not skip validation steps — they catch issues early.
  • Read the full context of each file before making changes.
  • Write tests that verify gameplay, not just that the page loads.

Reference Files

For detailed reference, see companion files in this directory:

  • `test-patterns.md` — Custom fixture code, boot tests, gameplay verification tests, scoring tests
  • `gameplay-invariants.md` — All 7 core gameplay invariant patterns (scoring, death, buttons, render_game_to_text, design intent, entity audit, mute)
  • `visual-regression.md` — Screenshot comparison tests, masking dynamic elements, performance/FPS tests, deterministic testing patterns
  • `clock-control.md` — `page.clock` API patterns for frame-precise testing
  • `visual-inspection.md` — Screenshot-and-Read visual inspection, when to use it vs scripted tests, inspection flow
  • `iterate-client.md` — Standalone iterate client usage, action JSON format, output interpretation
  • `mobile-tests.md` — Mobile input simulation and responsive layout test patterns

Tech Stack

  • **Test Runner**: `scripts/browser-test.mjs` (`test`/`expect` on `node --test`), driving Chrome through `scripts/cdp.mjs`
  • **Visual Regression**: `toHaveScreenshot()` from `browser-test.mjs`
  • **Accessibility**: no automated scan (axe-core is not available)
  • **Build Tool Integration**: Vite dev server via `webServer` config
  • **Language**: JavaScript ES modules

Project Setup

When adding browser tests to a game project, copy the helpers from the plugin (no npm install; needs Node 22+ or Bun and Google Chrome, or set `BOOP_CHROME=/path/to/chrome`):

mkdir -p scripts
cp <plugin-root>/scripts/cdp.mjs <plugin-root>/scripts/browser-test.mjs scripts/

Add to `package.json` scripts:

{
  "scripts": {
    "test": "node --test --test-concurrency=1 \"tests/**/*.spec.js\"",
    "test:headed": "BROWSER_TEST_HEADED=1 node --test --test-concurrency=1 \"tests/**/*.spec.js\"",
    "test:update-snapshots": "BROWSER_TEST_UPDATE_SNAPSHOTS=1 node --test --test-concurrency=1 \"tests/**/*.spec.js\""
  }
}

Required Directory Structure

tests/
├── e2e/
│   ├── game.spec.js       # Core game tests (boot, scenes, input, score)
│   ├── visual.spec.js     # Visual regression screenshots
│   └── perf.spec.js       # Performance and FPS tests
├── fixtures/
│   ├── game-test.js       # Custom test fixture with game helpers
│   └── screenshot.css     # CSS to mask dynamic elements for visual tests
├── helpers/
│   └── seed-random.js     # Seeded PRNG for deterministic game behavior
scripts/
├── cdp.mjs                # Chrome over the DevTools protocol (copied from the plugin)
└── browser-test.mjs       # test/expect on node --test (copied from the plugin)
browser.config.mjs

Browser Test Config

`browser-test.mjs` reads `timeout`, `expect`, `use`, `projects` and `webServer` (retries, workers, reporters and traces are not supported).

export default {
  testDir: './tests',
  timeout: 30000,

  use: {
    baseURL: 'http://localhost:3000',
    screenshot: 'only-on-failure',
  },

  expect: {
    toHaveScreenshot: {
      maxDiffPixels: 200,
      threshold: 0.3,
    },
  },

  projects: [
    { name: 'chromium', use: { viewport: { width: 1280, height: 720 } } },
    { name: 'mobile-chrome', use: { viewport: { width: 393, height: 851 }, deviceScaleFactor: 2.75, isMobile: true, hasTouch: true } },
  ],

  webServer: {
    command: 'npm run dev',
    url: 'http://localhost:3000',
    reuseExistingServer: true,
  },
};

Key points:

  • `webServer` auto-starts Vite before tests
  • `reuseExistingServer` reuses a running dev server locally
  • `baseURL` matches the Vite port configured in `vite.config.js`
  • Screenshot tolerance is generous (games have minor render variance)

Testability Requirements

For browser tests to inspect game state, the game MUST expose these globals on `window` in `main.js`:

1. Core globals (required)

// Expose for browser QA
window.__GAME__ = game;
window.__GAME_STATE__ = gameState;
window.__EVENT_BUS__ = eventBus;
window.__EVENTS__ = Events;

2. `render_game_to_text()` (required)

Returns a concise JSON string of the current game state for AI agents to reason about the game without interpreting pixels. Must include coordinate system, game mode, score, and player state.

window.render_game_to_text = () => {
  if (!game || !gameState) return JSON.stringify({ error: 'not_ready' });

  const activeScenes = game.scene.getScenes(true).map(s => s.scene.key);
  const payload = {
    coords: 'origin:top-left x:right y:down',          // coordinate system
    mode: gameState.gameOver ? 'game_over' : 'playing',
    scene: activeScenes[0] || null,
    score: gameState.score,
    bestScore: gameState.bestScore,
  };

  // Add player info when in gameplay
  const gameScene = game.scene.getScene('GameScene');
  if (gameState.started && gameScene?.player?.sprite) {
    const s = gameScene.player.sprite;
Read more
@playableintelligence
Ships withgame-creator

Go from game idea to deployed, monetized browser game in minutes — not hours. Tell your AI coding agent "make a space invaders game" and get a fully playable 2D or 3D browser game with pixel art, procedural audio, and automated QA. Deploy instantly to the web.

37031 skills4 agents
Get the whole plugin

Stars on GitHub

Momentum

stars in total
370
Star history of playableintelligence/game-creator on GitHub, a chart by star-history.com

Other skills on game-creator.

More skills from other plugins.

bazi-skill

bazi-skill

四柱八字命理分析。通过交互式步骤收集出生信息(姓名、曾用名、阳历/农历生日、时辰、性别、出生地), 排出四柱八字,参照经典命理典籍(穷通宝典、三命通会、滴天髓、渊海子平、子平真诠等)进行专业分析。 Use this skill whenever the…

@jinchenma94@jinchenma94Install Skill
anidoodle

anidoodle

Code-drawn stills, films, 3D motion graphics, explainers and web animations in 32 styles, with scores, narration and subtitles.…

anidoodle2w1.8k
@alexgreensh@alexgreenshInstall Skill

Questions about game-qa.

Which coding agents can use game-qa?
game-qa installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.