К основному содержанию
скилл CX Codex

qa-game — скилл для Claude Code: что делает и как установить

Скилл настраивает автотесты на Playwright для веб-игры: проверяет запуск, переход между сценами, счёт, снимки экранов и FPS. Пригодится для быстрой проверки механики без ручных тестов.

Установить в Claude Code · Через Skills CLI (Vercel) Все способы и платформы ↓
npx skills add PlayableIntelligence/game-creator --skill qa-game -a claude-code
Открыть на GitHub

Что делает qa-game

Скилл анализирует файлы проекта, включая package.json, конфигурацию Vite, логику GameState.js и константы. Сначала он дописывает в src/main.js экспорт глобальных объектов window.__GAME__ и window.__GAME_STATE__, чтобы браузерные тесты могли считывать состояние через page.evaluate(). Затем устанавливает зависимости @playwright/test и @axe-core/playwright, загружает Chromium и генерирует файл playwright.config.js.

В папке tests/ появляются три набора проверок: game.spec.js для циклов перезапуска, сцен и логики победы, visual.spec.js для снимков экрана и perf.spec.js для замера FPS и времени загрузки. Скилл специально исключает скриншоты во время динамичного геймплея, потому что движущиеся объекты дают ложные сбои. Дополнительно создаются сценарии проверки баланса: игра запускается вообще без нажатия клавиш, чтобы подтвердить, что игрок не выигрывает при полном бездействии.

Какие задачи решает

  • настроить запуск Playwright и Chromium в веб-проекте
  • проверить условия победы и поражения без ручного прокликивания
  • отследить просадки FPS и превышение лимита времени загрузки
  • выявить поломки интерфейса на статичных сценах через снимки

Примеры запросов агенту

  • /qa-game examples/flappy-bird
  • Настрой тесты на Playwright для игры в текущей папке
  • Проверь механику и добавь скриншотные тесты для ./games/runner

Как установить qa-game

1Через Skills CLI (Vercel)

npx skills add PlayableIntelligence/game-creator --skill qa-game -a claude-code

2Вручную: положить файлы

~/.claude/skills/qa-game/SKILL.md

Папка скилла целиком; для одного проекта — .claude/skills/qa-game/

По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов

Вопросы о qa-game

Как установить qa-game в Claude Code?

Выполните команду в терминале: npx skills add PlayableIntelligence/game-creator --skill qa-game -a claude-code.

Что делает скилл qa-game?

Он разворачивает тестовый контур на Playwright для веб-игры: настраивает зависимости, создаёт сценарии проверки механик, замеряет FPS и сравнивает скриншоты стабильных сцен.

Почему скриншотные тесты не снимают активный геймплей?

Движущиеся спрайты и анимации делают снимки нестабильными и вызывают ложные падения тестов. Поэтому скилл фотографирует только статичные состояния вроде начального экрана и экрана окончания игры.

Исходный текст

SKILL.md · MIT
---
name: qa-game
description: Add Playwright 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.
argument-hint: "[path-to-game]"
license: MIT
metadata:
  author: OpusGameLabs
  version: 1.3.0
  tags: [game, qa, testing, playwright, visual-regression]
---

# QA Game

Add automated QA testing with Playwright 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.json` to identify the engine and dev server port
- Read `vite.config.js` for the server port
- Read `src/main.js` to check if `window.__GAME__`, `window.__GAME_STATE__`, `window.__EVENT_BUS__` are exposed
- Read `src/core/GameState.js` to understand what state is available
- Read `src/core/EventBus.js` to understand what events exist
- Read `src/core/Constants.js` to understand game parameters (rates, speeds, durations, max values)
- Read all scene files to understand the game flow
- Read `design-brief.md` if it exists — it documents expected mechanics, magnitudes, and win/lose reachability

### Step 2: Setup Playwright

1. Install dependencies: `npm install -D @playwright/test @axe-core/playwright && npx playwright install chromium`
2. Create `playwright.config.js` with the correct dev server port and webServer config
3. Expose `window.__GAME__`, `window.__GAME_STATE__`, `window.__EVENT_BUS__`, `window.__EVENTS__` in `src/main.js` if not already present
4. Create the test directory structure:
   ```
   tests/
   ├── e2e/
   │   ├── game.spec.js
   │   ├── visual.spec.js
   │   └── perf.spec.js
   ├── fixtures/
   │   └── game-test.js
   └── helpers/
       └── seed-random.js
   ```
5. 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.

1. **Lose condition**: Detect deterministically whether the game has a lose state.
   Read `GameState.js` — if it has a `won`, `result`, or similar boolean/enum
   field, the game distinguishes win from loss. Also check `render_game_to_text()`
   in `main.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.waitForFunction` with 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.

2. **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.md`
   exists, use its expected magnitudes for thresholds. Otherwise, derive from
   Constants.js: calculate `rate * duration` and assert it reaches meaningful
   levels.

3. **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:

1. Find all collision handlers, overlap checks, or distance-based interactions
2. Map which entities interact with which others
3. Flag any visible moving entity that interacts with one side (player OR
   opponent) but not the other — add a `// QA FLAG: asymmetric interaction`
   comment 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

1. Run `npx playwright test` to execute all tests
2. If visual tests fail on first run, that's expected — generate baselines with `npx playwright test --update-snapshots`
3. Run again to verify all tests pass
4. Summarize results

### Step 7: Report

Tell the user in plain English:

- How many tests were created and what they check
- How to run them: `npm test` (headless), `npm run test:headed` (see the browser), `npm run test:ui` (interactive dashboard)
- "These tests are your safety net. Run them after making changes to make sure nothing broke."

## Example Usage

```
/qa-game examples/flappy-bird
```
Result: Installs Playwright → creates 15 tests (boot, scene transitions, input, scoring, restart, game-over, visual regression, FPS, load time) → generates `tests/` directory with fixtures and helpers → all tests pass. Run `npm test` anytime after changes.

## Next Step

Tell the user:

> Your game now has automated tests! Finally, run `/game-creator:review-game` for a full architecture review — it checks your code structure, performance patterns, and gives you a score with specific improvement suggestions.
>
> **Pipeline progress:** ~~/viral-game~~ → ~~/design-game~~ → ~~/add-audio~~ → ~~/qa-game~~ → `/review-game`
>
> *(This is the `/viral-game` one-shot pipeline — not the `/make-game` multi-session, milestone-driven workflow.)*

© OpusGameLabs · MIT · PlayableIntelligence/game-creator

Похожие скиллы

Всё по теме «Тесты и QA» →
improve-codebase-architecture Matt Pocock Скилл ищет архитектурные узкие места в кодовой базе и показывает варианты углубления модулей в HTML-отчёте. Подойдёт для ревью перед рефакторингом. 1 163 035установок design-taste-frontend Leonxlnx Скилл задаёт арт-дирекцию для публичных страниц и рабочих экранов, а затем проверяет результат в браузере по скриншотам. Нужен, когда интерфейс выглядит шаблонным или недоработанным. CX Codex +1 678 700установок tdd Matt Pocock Скилл управляет циклом красный-зелёный в TDD: проверяет, что тесты пишутся до кода, держит их на уровне публичных интерфейсов и не завязывает на внутреннюю структуру. 1 141 062установок skill-creator официальный anthropics Помогает создать новый скилл, доработать существующий и проверить результат через тестовые промпты и оценки. 414 180установок agent-browser vercel-labs Скилл управляет браузером через CLI: открывает страницы, заполняет формы, нажимает кнопки и проверяет веб-приложения. Подходит для задач, где агенту нужно действовать в интерфейсе. CX Codex +1 1 200 000установок prototype Matt Pocock Создаёт временный прототип, чтобы проверить логику, модель состояния или вид интерфейса до работы над основным кодом. 986 201установок

Из того же набора27

add-assets Заменяет круги и прямоугольники в 2D-игре на пиксель-арт спрайты персонажей, врагов и предметов. Пригодится, когда прототип уже играется, а смотреть на него больно. CX Codex +1 997установок add-feature Добавляет игровую механику в браузерную игру на Three.js или Phaser. Пригодится, когда нужно внедрить бонусы, комбо или двойной прыжок без поломки архитектуры проекта. CX Codex +1 977установок review-game Проводит аудит игрового проекта: архитектура, производительность, качество кода и готовность к монетизации. Только чтение, без правок. CX Codex +1 954установок add-3d-assets Меняет примитивы вроде BoxGeometry на настоящие GLB-модели: персонажи с анимацией, дома, деревья, бочки. Пригодится, когда игра на Three.js выглядит как набор коробок. CX Codex +1 938установок meshyai Генерирует 3D-модели из текста или картинки через Meshy AI, ставит скелет на гуманоидов и добавляет анимации ходьбы и бега для Three.js. CX Codex +1 907установок quick-game Генерирует черновой играбельный прототип на Phaser или Three.js без графики, звука и полировки. Пригодится, когда нужно сразу запустить и проверить базовую механику. CX Codex +1 866установок monetize-game Регистрирует браузерную игру на Play.fun, подключает клиентский SDK с очками и таблицей лидеров, а затем выдаёт ссылку для игроков. CX Codex +1 862установок promo-video Записывает автономный промо-ролик игры на Phaser в MP4 50 FPS, вертикально 9:16. Пригодится, когда нужен клип для соцсетей без ручной съёмки. CX Codex +1 857установок

Спонсоры проекта

Компании, которые помогают держать аналитику открытой