.claude/skills/record-golden-test/SKILL.md
Records a play session as a golden replay for visual regression testing. Use after a game is playable to capture a reference session for automated visual validation.
npx skillsauth add punkfuncgames/tetris-clone record-golden-testInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
| Tool | Purpose |
|------|---------|
| start_replay_recording | Enter Play Mode and begin capturing inputs + keyframe screenshots |
| stop_replay_recording | Stop recording, exit Play Mode, return replay JSON |
| play_golden_replay | Replay a saved session by injecting recorded inputs |
| validate_golden_replay | Replay + capture at keyframe timestamps + AI vision comparison |
Replays are stored as JSON files:
{
"gameName": "my-game",
"recordedAt": "2026-04-01T12:00:00Z",
"duration": 45.2,
"resolution": { "width": 1920, "height": 1080 },
"inputEvents": [
{
"timestamp": 0.0,
"type": "KeyDown",
"key": "Space",
"position": null
},
{
"timestamp": 1.25,
"type": "MouseClick",
"key": null,
"position": { "x": 960, "y": 540 }
}
],
"keyframes": [
{
"timestamp": 0.0,
"screenshot": "keyframes/0000_main-menu.png",
"description": "Main menu displayed with Play button centered"
},
{
"timestamp": 5.0,
"screenshot": "keyframes/0001_gameplay-start.png",
"description": "Gameplay started, player spawned at center, score shows 0"
},
{
"timestamp": 30.0,
"screenshot": "keyframes/0002_wave-3.png",
"description": "Wave 3 active, 5 enemies on screen, score shows 1500"
}
]
}
start_replay_recording with:
stop_replay_recordingSave the replay JSON and keyframe screenshots to:
Tests/GoldenReplays/{game-name}-golden-{timestamp}.json
Tests/GoldenReplays/keyframes/{nnnn}_{description}.png
Screenshots are stored as separate PNG files referenced by relative path in the JSON (not base64-embedded) to keep diffs readable and repo size manageable.
Create the directories if they do not exist:
mkdir -p Tests/GoldenReplays/keyframes
Review each keyframe screenshot and add semantic descriptions:
For each keyframe:
description field in the JSONGood descriptions enable semantic comparison during regression:
| Good (Semantic) | Bad (Pixel) | |----------------|-------------| | "3 enemies visible in upper half, player at bottom center" | "Red sprite at x:480 y:900" | | "Score displays 1500, health bar at ~75%" | "Text reads 1500 at position 100,50" | | "Game over screen with final score and retry button" | "Dark overlay with white text" |
play_golden_replay with the saved JSON file pathvalidate_golden_replay to run the full validation:
If validation fails on a keyframe:
git add Tests/GoldenReplays/
git commit -m "test({game-name}): record golden replay session"
After future changes, run regression by invoking validate_golden_replay:
This catches:
The golden replay file path, keyframe count, duration, and validation result (pass/fail per keyframe).
development
WalletModule reference — currency management with BigDouble support, reactive properties, caps, lifetime stats, and persistence. Use when working with currencies, wallets, or financial systems.
development
UnlockConditionModule reference — composable unlock conditions using ScriptableObjects with AND/OR/NOT logic, stat/currency/upgrade/prestige/gamestate/boolean checks, reactive service layer with progress tracking. Use when implementing unlock systems, gating, or progression requirements.
development
UndoModule reference — command pattern with undo/redo stacks, command merging, and reactive state. Use when implementing undo/redo, undoable actions, or command patterns.
tools
Unity UI Toolkit reference — UXML documents, USS styling, MVVM pattern (ViewModel + Presenter), custom VisualElements, responsive layout, animations, performance guidelines, and complete Figma-to-UI-Toolkit property mapping. Use when building or modifying UI with UI Toolkit, creating UXML/USS files, writing ViewModels or Presenters, designing screens/panels/components, or converting Figma designs to UI Toolkit.