Skip to content
Skill

develop-web-game

by openai

AI Summary

A skill for iteratively developing and testing web-based games in HTML/JavaScript using Playwright automation and screenshot inspection. Developers building browser games benefit from this structured test-driven development loop.

Install

Copy this and paste it into Claude Code, Cursor, or any AI assistant:

I want to install the "develop-web-game" skill in my project.

Please run this command in my terminal:
# Install skill into your project (7 files)
mkdir -p .claude/skills/develop-web-game && curl --retry 3 --retry-delay 2 --retry-all-errors -o .claude/skills/develop-web-game/SKILL.md "https://raw.githubusercontent.com/openai/skills/main/skills/.curated/develop-web-game/SKILL.md" && curl --retry 3 --retry-delay 2 --retry-all-errors -o .claude/skills/develop-web-game/LICENSE.txt "https://raw.githubusercontent.com/openai/skills/main/skills/.curated/develop-web-game/LICENSE.txt" && mkdir -p .claude/skills/develop-web-game/agents && curl --retry 3 --retry-delay 2 --retry-all-errors -o .claude/skills/develop-web-game/agents/openai.yaml "https://raw.githubusercontent.com/openai/skills/main/skills/.curated/develop-web-game/agents/openai.yaml" && mkdir -p .claude/skills/develop-web-game/assets && curl --retry 3 --retry-delay 2 --retry-all-errors -o .claude/skills/develop-web-game/assets/game-small.svg "https://raw.githubusercontent.com/openai/skills/main/skills/.curated/develop-web-game/assets/game-small.svg" && mkdir -p .claude/skills/develop-web-game/assets && curl --retry 3 --retry-delay 2 --retry-all-errors -o .claude/skills/develop-web-game/assets/game.png "https://raw.githubusercontent.com/openai/skills/main/skills/.curated/develop-web-game/assets/game.png" && mkdir -p .claude/skills/develop-web-game/references && curl --retry 3 --retry-delay 2 --retry-all-errors -o .claude/skills/develop-web-game/references/action_payloads.json "https://raw.githubusercontent.com/openai/skills/main/skills/.curated/develop-web-game/references/action_payloads.json" && mkdir -p .claude/skills/develop-web-game/scripts && curl --retry 3 --retry-delay 2 --retry-all-errors -o .claude/skills/develop-web-game/scripts/web_game_playwright_client.js "https://raw.githubusercontent.com/openai/skills/main/skills/.curated/develop-web-game/scripts/web_game_playwright_client.js"

Then restart Claude Code (or reload the window in Cursor) so the skill is picked up.

Description

Use when Codex is building or iterating on a web game (HTML/JS) and needs a reliable development + testing loop: implement small changes, run a Playwright-based test script with short input bursts and intentional pauses, inspect screenshots/text, and review console errors with render_game_to_text.

Playwright Prerequisites

• Prefer a local playwright dependency if the project already has it. • If unsure whether Playwright is available, check for npx: ` command -v npx >/dev/null 2>&1 ` • If npx is missing, install Node/npm and then install Playwright globally: ` npm install -g @playwright/mcp@latest ` • Do not switch to @playwright/test unless explicitly asked; stick to the client script.

Develop Web Game

Build games in small steps and validate every change. Treat each iteration as: implement → act → pause → observe → adjust.

Skill paths (set once)

`bash export CODEX_HOME="${CODEX_HOME:-$HOME/.codex}" export WEB_GAME_CLIENT="$CODEX_HOME/skills/develop-web-game/scripts/web_game_playwright_client.js" export WEB_GAME_ACTIONS="$CODEX_HOME/skills/develop-web-game/references/action_payloads.json" ` User-scoped skills install under $CODEX_HOME/skills (default: ~/.codex/skills).

Workflow

• Pick a goal. Define a single feature or behavior to implement. • Implement small. Make the smallest change that moves the game forward. • Ensure integration points. Provide a single canvas and window.render_game_to_text so the test loop can read state. • Add window.advanceTime(ms). Strongly prefer a deterministic step hook so the Playwright script can advance frames reliably; without it, automated tests can be flaky. • Initialize progress.md. If progress.md exists, read it first and confirm the original user prompt is recorded at the top (prefix with Original prompt:). Also note any TODOs and suggestions left by the previous agent. If missing, create it and write Original prompt: <prompt> at the top before appending updates. • Verify Playwright availability. Ensure playwright is available (local dependency or global install). If unsure, check npx first. • Run the Playwright test script. You must run $WEB_GAME_CLIENT after each meaningful change; do not invent a new client unless required. • Use the payload reference. Base actions on $WEB_GAME_ACTIONS to avoid guessing keys. • Inspect state. Capture screenshots and text state after each burst. • Inspect screenshots. Open the latest screenshot, verify expected visuals, fix any issues, and rerun the script. Repeat until correct. • Verify controls and state (multi-step focus). Exhaustively exercise all important interactions. For each, think through the full multi-step sequence it implies (cause → intermediate states → outcome) and verify the entire chain works end-to-end. Confirm render_game_to_text reflects the same state shown on screen. If anything is off, fix and rerun. Examples of important interactions: move, jump, shoot/attack, interact/use, select/confirm/cancel in menus, pause/resume, restart, and any special abilities or puzzle actions defined by the request. Multi-step examples: shooting an enemy should reduce its health; when health reaches 0 it should disappear and update the score; collecting a key should unlock a door and allow level progression. • Check errors. Review console errors and fix the first new issue before continuing. • Reset between scenarios. Avoid cross-test state when validating distinct features. • Iterate with small deltas. Change one variable at a time (frames, inputs, timing, positions), then repeat steps 7–13 until stable. Example command (actions required): ` node "$WEB_GAME_CLIENT" --url http://localhost:5173 --actions-file "$WEB_GAME_ACTIONS" --click-selector "#start-btn" --iterations 3 --pause-ms 250 ` Example actions (inline JSON): `json { "steps": [ { "buttons": ["left_mouse_button"], "frames": 2, "mouse_x": 120, "mouse_y": 80 }, { "buttons": [], "frames": 6 }, { "buttons": ["right"], "frames": 8 }, { "buttons": ["space"], "frames": 4 } ] } `

Discussion

0/2000
Loading comments...

Health Signals

MaintenanceCommitted 4d ago
Active
Adoption1K+ stars on GitHub
16.8k ★ · Popular
DocsREADME + description
Well-documented

GitHub Signals

Stars16.8k
Forks1.0k
Issues188
Updated4d ago
View on GitHub
No License

My Fox Den

Community Rating

Sign in to rate this booster

Works With

Claude Code