Loading...
Loading...
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.
npx skill4agent add davila7/claude-code-templates develop-web-gameexport 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"$CODEX_HOME/skills~/.codex/skillswindow.render_game_to_textwindow.advanceTime(ms)progress.mdOriginal prompt:Original prompt: <prompt>playwrightnpx$WEB_GAME_CLIENT$WEB_GAME_ACTIONSrender_game_to_textnode "$WEB_GAME_CLIENT" --url http://localhost:5173 --actions-file "$WEB_GAME_ACTIONS" --click-selector "#start-btn" --iterations 3 --pause-ms 250{
"steps": [
{ "buttons": ["left_mouse_button"], "frames": 2, "mouse_x": 120, "mouse_y": 80 },
{ "buttons": [], "frames": 6 },
{ "buttons": ["right"], "frames": 8 },
{ "buttons": ["space"], "frames": 4 }
]
}render_game_to_textwindow.render_game_to_textfunction renderGameToText() {
const payload = {
mode: state.mode,
player: { x: state.player.x, y: state.player.y, r: state.player.r },
entities: state.entities.map((e) => ({ x: e.x, y: e.y, r: e.r })),
score: state.score,
};
return JSON.stringify(payload);
}
window.render_game_to_text = renderGameToText;window.advanceTime(ms)window.advanceTime = (ms) => {
const steps = Math.max(1, Math.round(ms / (1000 / 60)));
for (let i = 0; i < steps; i++) update(1 / 60);
render();
};fEscprogress.mdprogress.mdprogress.mdprogress.mdplaywrightnpxcommand -v npx >/dev/null 2>&1npxnpm install -g @playwright/mcp@latest@playwright/test$WEB_GAME_CLIENT$CODEX_HOME/skills/develop-web-game/scripts/web_game_playwright_client.js--actions-file--actions-json--click$WEB_GAME_ACTIONS$CODEX_HOME/skills/develop-web-game/references/action_payloads.json