develop-web-game

Build and validate HTML/JS web games using a Playwright-driven test loop with screenshots and state inspection.

Updated Feb 4, 2026
One-click install
npx skills add https://github.com/pchemguy/AISandbox --skill develop-web-game-pchemguy
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: develop-web-game
Source: https://github.com/pchemguy/AISandbox/tree/main/docs/AgentSkills/openai/skills/skills/.curated/develop-web-game
Command: npx skills add https://github.com/pchemguy/AISandbox --skill develop-web-game-pchemguy

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires playwright, and includes scripts (resource) and references (resource) components.

What problem does it solve? Iterating on a web game without automated feedback leads to broken controls, visual regressions, and undetected console errors. This Skill enforces a disciplined implement-act-pause-observe loop so every change to an HTML/JS game is verified through real browser interaction before moving on. ## Core Features & Use Cases - Playwright Action Loop: Runs scripted keyboard and mouse input bursts against the game via a Node.js client, capturing screenshots, text state, and console errors after each iteration. - Deterministic Time Stepping: Uses a window.advanceTime(ms) hook and virtual-time shim so frames advance predictably during automated tests instead of relying on wall-clock timing. - Text-Based State Inspection: Reads a window.render_game_to_text JSON payload to verify game state (positions, score, entities) matches what screenshots show. - Progress Handoff: Maintains a progress.md file with the original prompt, TODOs, and notes so another agent can continue the work seamlessly. - Use Case: Ask the agent to add a jump mechanic to a platformer; it implements the change, runs the Playwright client with arrow-key and spacebar payloads, inspects the screenshots and state JSON, fixes any console errors, and repeats until the mechanic works end-to-end. ## Quick Start Ask the agent to build a small canvas game in this workspace and validate each change by running the Playwright test client with action payloads, reviewing screenshots and console errors after every iteration.

Frequently Asked Questions about develop-web-game

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I test a web game automatically with Playwright?▼

Run the web_game_playwright_client.js script with Node, passing --url, an actions file or inline JSON of button presses, and iteration count. It executes the inputs, advances frames deterministically, and saves screenshots, state JSON, and console errors per iteration.

What is render_game_to_text and why does my game need it?▼

render_game_to_text is a window function your game exposes that returns a JSON string of current state such as player position, entities, and score. It lets the automated test loop verify game logic without relying solely on visual screenshots.

Does the Playwright test client work without window.advanceTime?▼

The client checks for window.advanceTime and calls it to step frames; without it, frame advancement is not deterministic and tests can be flaky. The skill strongly recommends adding this hook that forwards to your game update loop.

What input actions can the Playwright game client simulate?▼

The client supports arrow keys, Enter, Space, and A/B keys, plus left and right mouse buttons with optional x/y coordinates relative to the canvas. Actions are defined as JSON steps with buttons and frame counts.

Why are my headless Playwright game screenshots blank or transparent?▼

Blank captures usually come from WebGL rendering issues in headless Chromium or a transparent canvas. The client falls back from canvas toDataURL to element or page screenshots, and you can rerun in headed mode to verify actual rendering.