Skip to main content
skill CX Codex GP ChatGPT official · OpenAI

web-game-foundations — Codex skill: what it does, how to install

Defines browser game architecture before coding begins. Helps choose an engine and decouple simulation from rendering.

Install into Codex · Skills CLI (Vercel) All methods and platforms ↓
npx skills add openai/plugins --skill web-game-foundations -a codex
Open on GitHub

What web-game-foundations does

This skill enforces architectural boundaries before implementation starts. It treats simulation state as separate from the renderer. Game logic, entity states, collisions, timers, and saves stay independent of the visual layer. UI belongs in the DOM overlay by default, keeping the canvas focused on the playfield.

The rules provide clear engine defaults. Phaser serves 2D arcade flows and grid games. Vanilla Three.js fits explicit 3D scenes requiring direct loop control. React Three Fiber fits 3D scenes nested inside a React UI. For 3D assets, it mandates GLB or glTF 2.0. Input handling maps hardware keys to explicit action tokens like move or pause.

Use this during early technical planning. If the tech stack is already set to Phaser or pure Three.js, skip this guide and use runtime-specific skills instead.

What it helps with

  • choose an engine between Phaser, Three.js, and React Three Fiber
  • isolate simulation state from the rendering pipeline
  • map physical inputs to explicit action names
  • organize game asset loading by domain manifests
  • separate browser HUD overlays from canvas rendering

Example prompts for the agent

  • Help me pick an engine for a top-down 2D browser game.
  • Define simulation and render boundaries for my Three.js project.
  • Create an architectural checklist before implementing game logic.

How to install web-game-foundations

1Skills CLI (Vercel)

npx skills add openai/plugins --skill web-game-foundations -a codex

2Manually: put the files in place

.agents/skills/web-game-foundations/SKILL.md

For all projects use ~/.agents/skills/

From the same set201

The whole set →
supabase official supabase Guides the agent through database configuration and strict RLS policies in Supabase. CX Codex GP ChatGPT 8installs remotion-render official Remotion Exports videos and static stills from Remotion projects using CLI commands. CX Codex GP ChatGPT 3installs figma-create-new-file official Figma Creates blank Figma, FigJam, or Slides files inside draft folders. It resolves planKey and editor types before invoking Figma MCP tools. CX Codex GP ChatGPT 6installs swiftui-performance-audit official OpenAI Pinpoints SwiftUI runtime issues like frame drops, unresponsive taps, and excessive view body computations. Works code-first and guides Instruments profiling. CX Codex GP ChatGPT 109installs swiftui-liquid-glass official OpenAI This skill helps build and review SwiftUI Liquid Glass interfaces for iOS 26+. Use it when adopting the API or checking fallbacks, interaction, and design fit. CX Codex GP ChatGPT 121installs swiftui-ui-patterns official OpenAI This skill helps build and refactor SwiftUI interfaces, from navigation and state to layouts and controls. Use it for new screens or changes to an existing project. CX Codex GP ChatGPT 114installs swiftui-view-refactor official OpenAI Refactors SwiftUI view files into clean, testable structures with dedicated subview types and proper Observation ownership. CX Codex GP ChatGPT 113installs ios-memgraph-leaks official OpenAI Captures and inspects iOS leaks from a simulator process or .memgraph. Useful for tracing retained objects and checking a fix with before-and-after evidence. CX Codex GP ChatGPT 1,054installs

Similar

Questions about web-game-foundations

How to install web-game-foundations in Codex?

Run npx skills add openai/plugins --skill web-game-foundations in your terminal.

What does web-game-foundations do?

It defines module boundaries, engine choices, input mappings, and asset formats for web games before coding begins.

When should you skip web-game-foundations?

Skip it once the runtime stack is already chosen as Phaser, Three.js, or React Three Fiber, or when the task is only about 3D assets.

Source text

SKILL.md · MIT
---
name: web-game-foundations
description: Set browser-game architecture before implementation. Use when the user needs engine choice, simulation and render boundaries, input model, asset organization, or save/debug/performance strategy.
---

# Web Game Foundations

## Overview

Use this skill to establish the non-negotiable architecture before implementation starts. Browser games degrade quickly when simulation, rendering, UI, asset loading, and input handling are mixed together.

Default rule: simulation state is owned outside the renderer, browser UI is not forced into the canvas unless there is a clear reason, and shipped 3D assets default to GLB or glTF 2.0 rather than ad hoc model formats.

## Use This Skill When

- the user has not settled the engine or renderer choice
- the task is about boundaries, module shape, state ownership, or asset policy
- multiple specialist skills need one shared architectural frame

## Do Not Stay Here When

- the runtime track is clearly Phaser
- the runtime track is clearly vanilla Three.js
- the runtime track is clearly React Three Fiber
- the task is purely about shipped 3D assets

Once the stack is clear, hand off to the runtime or asset specialist skill.

## Architecture Rules

1. Separate simulation from rendering.
   - Simulation owns entities, turns, timers, collisions, progression, and saveable state.
   - The renderer owns scene composition, animation playback, camera, particles, and input plumbing.
2. Keep input mapping explicit.
   - Define actions such as `move`, `confirm`, `cancel`, `ability-1`, and `pause`.
   - Map physical inputs to actions in one place.
3. Treat asset loading as a first-class system.
   - Use stable manifest keys.
   - Group by domain: characters, environment, UI, audio, FX.
   - For 3D content, standardize on GLB or glTF 2.0 unless the chosen engine ecosystem requires another format upstream.
4. Define save/debug/perf boundaries up front.
   - Save serializable simulation state, not renderer objects.
   - Keep debug overlays and perf probes easy to toggle.
5. Use DOM overlays for menus and HUD by default.
   - Canvas or WebGL should handle the playfield.
   - DOM should handle text-heavy HUD, menus, settings, and accessibility-sensitive controls.
   - In 3D, keep the persistent UI budget small so the scene stays readable and interactive.
6. Lock 3D runtime conventions early.
   - Choose consistent units, origins, pivots, and naming conventions.
   - Decide how collision proxies, LODs, and baked lighting data are authored before runtime integration starts.

## Engine Selection

- Default to Phaser for 2D games with sprites, tilemaps, top-down or side-view action, turn-based grids, and classic browser arcade flows.
- Default to vanilla Three.js for explicit 3D scenes that want direct scene, camera, renderer, and loop control in plain TypeScript or Vite.
- Default to React Three Fiber when the 3D scene lives inside a React application and needs declarative composition, shared app state, or React-first UI coordination.
- Use raw WebGL only for shader-heavy or renderer-first projects where engine abstractions would get in the way.
- Keep Babylon.js and PlayCanvas as alternative-engine paths rather than the default code-generation target.

See `../../references/engine-selection.md` for the default decision table.

## Implementation Checklist

Define these before writing core code:

- Player fantasy and primary verbs
- Core loop and loss or reset states
- Camera model
- Input action map
- Simulation modules
- Renderer modules
- Asset manifest layout
- 3D asset format and optimization rules
- HUD and menu surfaces
- Save data boundary
- Debug and perf surfaces

## Anti-Patterns

- Mixing gameplay rules directly into scene callbacks
- Treating the renderer as the source of truth for game state
- Putting all HUD and menu UI into the canvas by default
- Letting asset filenames become the public API instead of manifest keys
- Shipping unoptimized 3D assets straight from the DCC tool into the browser
- Mixing camera-control state and menu or modal state without an explicit input boundary
- Rebuilding architecture every time the game changes genre

## References

- Engine selection: `../../references/engine-selection.md`
- Phaser structure: `../../references/phaser-architecture.md`
- Three.js structure: `../../references/three-webgl-architecture.md`
- Three.js ecosystem stack: `../../references/threejs-stack.md`
- React Three Fiber stack: `../../references/react-three-fiber-stack.md`
- 3D asset shipping: `../../references/web-3d-asset-pipeline.md`

© OpenAI · MIT · openai/plugins

See also

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor