qa-game
БесплатноБез исполняемых скриптовНе проверенAdd browser QA tests to a game — visual regression, gameplay verification, and performance. Use when the user says "add tests", "test my game", "add QA"…
от PlayableIntelligence★ 383 звезды на GitHubОб этом скилле
QA Game
Add automated browser QA testing (Chrome over the DevTools protocol, no npm dependency) to an existing game project. Tests verify your game boots, scenes work, scoring functions, and visuals haven't broken — like a safety net for your game.
Instructions
Analyze the game at $ARGUMENTS (or the current directory if no path given).
First, load the game-qa skill to get the full testing patterns and fixtures.
Step 1: Audit testability
- Read
package.jsonto identify the engine and dev server port - Read
vite.config.jsfor the server port - Read
src/main.jsto check ifwindow.__GAME__,window.__GAME_STATE__,window.__EVENT_BUS__are exposed - Read
src/core/GameState.jsto understand what state is available - Read
src/core/EventBus.jsto understand what events exist - Read
src/core/Constants.jsto understand game parameters (rates, speeds, durations, max values) - Read all scene files to understand the game flow
- Read
design-brief.mdif it exists — it documents expected mechanics, magnitudes, and win/lose reachability
Step 2: Setup browser tests
- Copy the helpers from the plugin:
mkdir -p scripts && cp <plugin-root>/scripts/cdp.mjs <plugin-root>/scripts/browser-test.mjs scripts/(needs Node 22+ or Bun and Google Chrome; no npm install), and add thetest,test:headedandtest:update-snapshotsscripts from thegame-qaskill topackage.json - Create
browser.config.mjswith the correct dev server port and webServer config - Expose
window.__GAME__,window.__GAME_STATE__,window.__EVENT_BUS__,window.__EVENTS__insrc/main.jsif not already present - Create the test directory structure:
tests/ ├── e2e/ │ ├── game.spec.js │ ├── visual.spec.js │ └── perf.spec.js ├── fixtures/ │ └── game-test.js └── helpers/ └── seed-random.js - Add npm scripts:
test,test:ui,test:headed,test:update-snapshots
Step 3: Generate tests
Write tests based on what the game actually does:
- game.spec.js: Boot test, scene transitions, input handling, scoring, game over, restart
- visual.spec.js: Screenshot regression for stable scenes (gameplay initial state, game over). Skip active gameplay screenshots — moving objects make them unstable.
- perf.spec.js: Load time budget, FPS during gameplay, canvas dimensions
Follow the game-qa skill patterns. Use gamePage fixture. Use page.evaluate() to read game state. Use page.keyboard.press() for input.
Step 4: Design-intent tests
Add a test.describe('Design Intent') block to game.spec.js. These tests catch
mechanics that technically exist but are too weak to matter.
Lose condition: Detect deterministically whether the game has a lose state. Read
GameState.js— if it has awon,result, or similar boolean/enum field, the game distinguishes win from loss. Also checkrender_game_to_text()inmain.js— if it returns distinct outcome modes (e.g.,'win'vs'game_over'), the game has a lose state.If a lose state exists: start the game, provide NO input, let it run to completion (use
page.waitForFunctionwith the round duration from Constants.js). Assert the outcome is the losing one (e.g.,won === false,mode === 'game_over').This assertion is non-negotiable. Do NOT write a test that passes when the player wins by doing nothing. If the current game behavior is "player wins with no input," that is a bug — write the test to catch it.
Opponent/AI pressure: If an AI-driven mechanic exists (auto-climbing bar, enemy spawning, difficulty ramp), test that it produces substantial state changes. Run the game for half its duration without player input. Assert the opponent's state reaches at least 25% of its maximum. If
design-brief.mdexists, use its expected magnitudes for thresholds. Otherwise, derive from Constants.js: calculaterate * durationand assert it reaches meaningful levels.Win condition: Test that active player input leads to a win. Provide rapid input throughout the round and assert the outcome is a win.
Step 5: Entity interaction audit
Audit collision and interaction logic for asymmetries that would confuse a first-time player.
If design-brief.md has an "Entity Interactions" section, use it as the
checklist. Otherwise, audit GameScene.js directly:
- Find all collision handlers, overlap checks, or distance-based interactions
- Map which entities interact with which others
- Flag any visible moving entity that interacts with one side (player OR
opponent) but not the other — add a
// QA FLAG: asymmetric interactioncomment in the test file noting the entity name and the asymmetry
This is a flag, not a hard fail. Some asymmetries are intentional (e.g., hazards that only affect the player). The flag ensures the asymmetry is a conscious design choice, not an oversight.
Step 6: Run and verify
- Run `npm
Установить qa-game в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл qa-game?
Add browser QA tests to a game — visual regression, gameplay verification, and performance. Use when the user says "add tests", "test my game", "add QA", "check for bugs", or "add visual regression tests". Do NOT use for manual playtesting or gameplay design.
Как установить скилл qa-game?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл qa-game запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic