develop-web-game/SKILL.md
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 skillsauth add lidge-jun/cli-jaw-skills develop-web-gameInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Build games in small steps: implement → act → pause → observe → adjust.
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"
window.render_game_to_text, and window.advanceTime(ms) (deterministic stepping prevents flaky tests).Original prompt: at top, note prior TODOs. If missing, create with Original prompt: <prompt>.npx playwright availability before first run.$WEB_GAME_CLIENT after each meaningful change. Base actions on $WEB_GAME_ACTIONS.render_game_to_text matches screen state.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):
{
"steps": [
{ "buttons": ["left_mouse_button"], "frames": 2, "mouse_x": 120, "mouse_y": 80 },
{ "buttons": [], "frames": 6 },
{ "buttons": ["right"], "frames": 8 },
{ "buttons": ["space"], "frames": 4 }
]
}
Test new features and any areas affected by logic changes:
render_game_to_text output: Verify it matches what screenshots show.Fix-and-rerun in a tight loop until screenshots, text state, and controls are all correct. Re-test all interactions after fixes to catch regressions.
Return a concise JSON of current game state — enough to play without visuals.
```js
function 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;
Include: coordinate system, player state, active entities, score, mode flags. Prefer current/visible data over history.
Expose window.advanceTime(ms) for deterministic frame stepping during Playwright tests.
window.advanceTime = (ms) => {
const steps = Math.max(1, Math.round(ms / (1000 / 60)));
for (let i = 0; i < steps; i++) update(1 / 60);
render();
};
f to toggle, Esc to exit. Resize canvas/rendering on toggle so visuals and input mapping stay correct.Update progress.md after each meaningful chunk of work. Preserve the Original prompt: line at top. Leave TODOs and suggestions for the next agent.
playwright dependency if already in project.npm install -g @playwright/mcp@latest$WEB_GAME_CLIENT), not @playwright/test.$WEB_GAME_CLIENT — Playwright action loop with time-stepping, screenshots, console error capture. Pass actions via --actions-file, --actions-json, or --click.$WEB_GAME_ACTIONS — Example action payloads (keyboard + mouse, per-frame capture).tools
Use only on the Codex CLI for native image generation or image editing without an API key. Save final PNG files under ~/.cli-jaw/uploads, report web-ready absolute-path markdown, and send to Telegram or Discord only when explicitly requested.
tools
Ranked repository structure map via `cli-jaw map`. Use for codebase overview, structure map, symbol overview, unfamiliar codebase exploration, architecture orientation. Triggers: repo map, structure map, codebase overview, 와꾸, project structure, unfamiliar code.
tools
cli-jaw Design workspace: create, preview, run, and export design pages from the right sidebar. Covers panel UX, direct-write workflow, artifact lifecycle, wireframe generation, design system, and Open Design adapter.
development
MUST USE for infrastructure and delivery work — container builds, deploy pipelines, Kubernetes, Infrastructure as Code, SRE foundations, edge/serverless, ML infrastructure. Triggers: Dockerfile, K8s manifests, CI/CD pipeline, Terraform/IaC, release/deploy, devops/infra/deploy or release_cd task_tags.