develop-web-game

Implements and validates HTML/JS web games through a Playwright-driven test loop with screenshots and state inspection.

Updated Jul 28, 2026
One-click install
npx skills add https://github.com/IagoPrandi/zeroclaw-plugin --skill develop-web-game-iagoprandi
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: develop-web-game
Source: https://github.com/IagoPrandi/zeroclaw-plugin/tree/main/.claude/skills/develop-web-game
Command: npx skills add https://github.com/IagoPrandi/zeroclaw-plugin --skill develop-web-game-iagoprandi

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve? Building web games without automated verification leads to broken controls, invisible elements, and console errors that only surface during manual play. This Skill enforces a disciplined implement-act-pause-observe-adjust loop so every change to an HTML/JS game is exercised with real inputs and visually confirmed before moving on. ## Core Features & Use Cases - Playwright action loop: Runs scripted keyboard and mouse bursts against the game via a dedicated client script, capturing screenshots, render_game_to_text state, and console errors after each iteration. - Deterministic time stepping: Uses a window.advanceTime(ms) hook so frames advance predictably during automated tests instead of relying on flaky real-time loops. - Structured state output: Requires a window.render_game_to_text function returning concise JSON of player, entities, score, and mode so state can be verified without visuals. - Progress handoff: Maintains a progress.md file with the original prompt, TODOs, and notes so another agent can continue the work seamlessly. - Use Case: While adding a shooting mechanic to a canvas game, run the client script with an action payload, inspect the latest screenshot to confirm the enemy disappears at zero health, verify the score updates in the text state, and fix the first console error before iterating. ## Quick Start Ask the agent to build or modify the web game and run the Playwright test script with an action payload, then inspect the screenshots and render_game_to_text output to confirm the change works.

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 an HTML5 canvas game with Playwright?▼

Run the web_game_playwright_client.js script with --url pointing at your local dev server and an action payload via --actions-file or --actions-json. It executes keyboard and mouse bursts, 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 returning a concise JSON string of current game state such as player position, entities, score, and mode. It lets automated tests verify game logic without relying solely on screenshots, so state changes can be checked programmatically.

Why are my Playwright game tests flaky and how do I fix them?▼

Flakiness usually comes from real-time game loops that do not advance predictably under automation. Expose a window.advanceTime(ms) hook that steps your update loop in fixed increments so the test script can advance frames deterministically.

Does the Playwright client work with WebGL or headless browsers?▼

The client launches Chromium headless with SwiftShader GL flags and captures canvas pixels via toDataURL, falling back to element or page screenshots if the canvas reads as transparent. If you suspect a headless capture issue, rerun in headed mode to verify.

What input actions can the Playwright test script simulate?▼

The script supports arrow keys, Enter, Space, KeyA, KeyB, and left or right mouse buttons at specified canvas coordinates. Actions are defined as JSON steps with buttons, frame counts, and optional mouse positions.