playtester
Skill4 starsChanged 7 months agoMITView on GitHub
Boots a generated Phaser game in headless Chromium (Playwright), drives input scenarios, captures canvas screenshots, diffs against baselines (pixelmatch), and emits a structured QA report with typed failures. Pure deterministic — no LLM. Use after codesmith writes Game.js, before refiner.
- Reads credentials
In this repository22 other files it gives its agents.
- action-platformerSkill
- audio-composerSkill
- beat-em-upSkill
- bg-artistSkill
- codesmithSkill
- game-designerSkill
- gameforgeSkill
- gap-checkerSkill
- iso-city-builderSkill
- iso-living-worldSkill
- manifest-auditorSkill
- mobile-compat-checkerSkill
- multiplayerSkill
- palette-enforcerSkill
- parallel-qa-orchestraSkill
- physics-debug-validatorSkill
- pixel-action-adventureSkill
- refinerSkill
- rpg-overworldSkill
- sprite-artistSkill
- tile-artistSkill
- world-architectSkill
The file
We split this skill into the rules it gives an agent
4 rules. About 0 are common, 2 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 12
After every codesmith / refiner write.
- Very specific: line 53
Update baselines: --update-baselines overwrites and returns recorded.
- Very specific: line 57
Read game-state.json to get GDD (for scenario filtering).
- Distinctive: line 90
After the pixelmatch scenarios pass, run a second QA pass that uses Claude Haiku to judge whether the screenshot visually matches the …
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Playtester
Headless QA harness. Boots, drives, captures, diffs, asserts. Emits structured failures the refiner can act on.
When to use
After every codesmith / refiner write. Always before declaring a game complete.
Output contract — qa/qa-report.json
{
"ts": "<ISO>",
"url": "<dev server url>",
"passed": <bool>,
"scenarios": [
{
"scenario": "boot",
"observations": { "blank": false, "fps": 60, "booted": true, "activeScenes": ["Game"], "gameState": {...} },
"diff": { "status": "pass" | "fail" | "recorded", "ratio": <0..1>, "mismatched": <int> }
}
],
"failures": [
{ "scenario": "<name>", "kind": "<failure-kind>", "message": "<human-readable>" }
]
}Failure kinds: boot-timeout, exception, console-error, screenshot-diff, low-fps, blank-canvas, no-movement, no-jump, scenario-crash.
Default scenarios
| Name | Inputs | Asserts | Applies to |
boot | (waits 60 frames) | Game scene active, fps ≥ 25, canvas non-blank, no errors | always |
walk-right | hold ArrowRight 600ms | playerX delta > 0 | always |
walk-down | hold ArrowDown 600ms | playerY delta > 0 | non-platformer |
jump | press Space (held 50ms) | playerY drops then recovers | platformer |
attack | press Space (held 50ms) | no exceptions | when GDD has attack/fire/shoot action |
appliesTo(gdd) filter on each scenario picks the relevant subset for the genre.
Screenshot diff
- Engine: Playwright
page.locator('canvas').screenshot()→ pixelmatch - Threshold:
0.1YIQ delta per pixel; 5% pixel-ratio cap - Baselines:
qa/__baselines__/<scenario>.png. First run with no baseline →recorded(counts as pass). - Update baselines:
--update-baselinesoverwrites and returnsrecorded.
Process
- Read
game-state.jsonto get GDD (for scenario filtering). - Spawn dev server (
vite) on a free port; wait forLocal: http://...(ANSI-stripped). - Launch headless Chromium (system Chrome via
channel: 'chrome', fallback to bundled). goto(url). Wait forwindow.__gameReady === true && Game scene status === 5.- Focus canvas (Phaser keyboard target).
- For each applicable scenario: register error listeners, run, snapshot, diff, run assertions.
- Write
qa/qa-report.json. - Append report to
state.qa[](keep last 5). - Kill dev server.
- Exit code:
0ifpassed, else5.
Filtering noise
Console messages matching /Failed to load resource:.*404|favicon\.ico|\[vite\]/ are NOT counted as errors (browser noise unrelated to game logic).
Custom scenarios
To add a scenario, append to references/scenarios.md and register in the runner. Scenario shape:
{
name: '<id>',
description: '<one line>',
appliesTo: (gdd) => bool, // optional
async run({ page, log }) {
// do stuff with page.keyboard, page.mouse, page.evaluate
return { observations: {...}, screenshot?: <Buffer> };
}
}VLM intent alignment pass
After the pixelmatch scenarios pass, run a second QA pass that uses Claude Haiku to judge whether the screenshot visually matches the original description:
node scripts/intent_qa.mjs <project-dir>
# Uses the boot scenario baseline screenshot by default.
# Requires ANTHROPIC_API_KEY in env.Returns a score 0–10. Threshold: ≥ 6 = pass. Issues found by the VLM are appended to qa/qa-report.json as intent-mismatch failures for the refiner to act on.
The VLM checks: genre feel, player visibility, world rendering, entity presence. It does NOT check mechanics — only visual intent.
Integrate into the full pipeline:
node scripts/run_qa.mjs <project-dir> && node scripts/intent_qa.mjs <project-dir>Scripts
scripts/run_qa.mjs <project-dir> [--url URL] [--update-baselines]— the full runner.scripts/boot_check.mjs <project-dir> [--port N]— minimal smoke (justbootscenario).scripts/diff_one.mjs <baseline.png> <actual.png> [--out diff.png]— ad-hoc diff utility.scripts/intent_qa.mjs <project-dir> [--screenshot path]— VLM intent alignment pass.
References
references/scenarios.md— full scenario catalog with code samples.references/baseline-workflow.md— when to update baselines, what's in them, gitignore conventions.references/known-noise.md— patterns of browser console noise we filter.
Dependencies
playwright— browser automation (uses system Chrome viachannel: 'chrome'to skip 170MB Chromium download).pixelmatch+pngjs— pure-JS diff.- Generated game must have
phaser+viteinstalled (handled byscripts/init_project.mjs).
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

