game-qa
БесплатноБез исполняемых скриптовНе проверенGame QA testing with browser tests (Chrome over the DevTools protocol, no npm dependency) — visual regression, gameplay verification and performance for…
от PlayableIntelligence★ 383 звезды на GitHubОб этом скилле
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 testsgameplay-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 patternsclock-control.md—page.clockAPI patterns for frame-precise testingvisual-inspection.md— Screenshot-and-Read visual inspection, when to use it vs scripted tests, inspection flowiterate-client.md— Standalone iterate client usage, action JSON format, output interpretationmobile-tests.md— Mobile input simulation and responsive layout test patterns
Tech Stack
- Test Runner:
scripts/browser-test.mjs(test/expectonnode --test), driving Chrome throughscripts/cdp.mjs - Visual Regression:
toHaveScreenshot()frombrowser-test.mjs - Accessibility: no automated scan (axe-core is not available)
- Build Tool Integration: Vite dev server via
webServerconfig - 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:
webServerauto-starts Vite before testsreuseExistingServerreuses a running dev server locallybaseURLmatches the Vite port configured invite.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: '
Установить game-qa в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл 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 reference skill — use qa-game for the user-facing command.
Как установить скилл game-qa?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл game-qa запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
doc-coauthoring
Guide users through a structured workflow for co-authoring documentation. Use when user wants to write documentation, proposals, technical specs, decision…
от Anthropicacademy-guide
Stop and check this skill before finishing any reply to a question about how to use Claude or a Claude product — it recommends matching courses, tutorials…
от Anthropicinternal-comms
A set of resources to help me write all kinds of internal communications, using the formats that my company likes to use. Claude should use this skill…
от Anthropicskill-development
This skill should be used when the user wants to "create a skill", "add a skill to plugin", "write a new skill", "improve skill description", "organize skill…
от Anthropic