web-games

A guide to building games that run in web browsers. It covers choosing a 2D or 3D framework, using WebGPU or WebGL for graphics, browser limits, and performance practices.

In plain words
What is it for?
Use it when planning browser games, selecting Phaser, PixiJS, Three.js, Babylon.js, or Canvas/WebGL, and optimizing graphics and runtime behavior.
Why use it?
It helps developers choose suitable browser game technology and account for limits such as background-tab throttling, device support, and restricted local file access.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/felipeslo/opencode-kit/web-games
Any agent
npx skills add felipeslo/opencode-kit --skill web-games
Clone the repo
git clone --depth 1 https://github.com/felipeslo/opencode-kit

Made for: Claude Code, Codex.

Per session 20 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 774 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin 92% copy Near-identical to another mod in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00020 $0.00774
Opus 5 $0.00010 $0.00387
Sonnet 5 $0.00004 $0.00155
Haiku 4.5 $0.00002 $0.00077

Measured yesterday against content hash 5bd59d080da3, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

web-games scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

Origin

This is a copy

92% identical to web-games — 5 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.

.opencode/skills/game-development/web-games/SKILL.md · 150 lines

How it starts

The opening of the file, as written. The whole thing — 150 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Web Browser Game Development

Framework selection and browser-specific principles.


1. Framework Selection

Decision Tree

What type of game?
│
├── 2D Game
│   ├── Full game engine features? → Phaser
│   └── Raw rendering power? → PixiJS
│
├── 3D Game
│   ├── Full engine (physics, XR)? → Babylon.js
│   └── Rendering focused? → Three.js
│
└── Hybrid / Canvas
    └── Custom → Raw Canvas/WebGL

Comparison (2025)

Framework Type Best For
Phaser 4 2D Full game features
PixiJS 8 2D Rendering, UI
Three.js 3D Visualizations, lightweight
Babylon.js 7 3D Full engine, XR

2. WebGPU Adoption

Browser Support (2025)

Browser Support
Chrome ✅ Since v113
Edge ✅ Since v113
Firefox ✅ Since v131
Safari ✅ Since 18.0
Total ~73% global

Decision

  • New projects: Use WebGPU with WebGL fallback
  • Legacy support: Start with WebGL
  • Feature detection: Check navigator.gpu

3. Performance Principles

Browser Constraints

Constraint Strategy
No local file access Asset bundling, CDN
Tab throttling Pause when hidden
Mobile data limits Compress assets
Audio autoplay Require user interaction

Optimization Priority

  1. Asset compression - KTX2, Draco, WebP
  2. Lazy loading - Load on demand
  3. Object pooling - Avoid GC
  4. Draw call batching - Reduce state changes
  5. Web Workers - Offload heavy computation

4. Asset Strategy

Compression Formats

Type Format
Textures KTX2 + Basis Universal
Audio WebM/Opus (fallback: MP3)
3D Models glTF + Draco/Meshopt

Loading Strategy

Phase Load
Startup Core assets, <2MB
Gameplay Stream on demand
Background Prefetch next level

5. PWA for Games

Benefits

  • Offline play
  • Install to home screen
  • Full screen mode
  • Push notifications

Read the full file on GitHub · 150 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 150 lines · 20 tokens per session scan A 5bd59d080da3

Subscribe to this mod's changes

web-games is a skill published in the GitHub repository felipeslo/opencode-kit (2 stars, last pushed 5mo ago), licensed MIT. It adds 20 tokens to every session and 774 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 0 findings. It is 92% identical to web-games, differing in 5 lines, and is treated as a copy.

Related

Other skills, from other repositories

scale-and-responsive

Use this skill when making a Phaser 4 game responsive or handling display scaling. Covers ScaleManager, scale modes (FIT, RESIZE, EXPAND, ENVELOP), auto-center, fullscreen, and browser resize handling. Triggers on: ScaleManager, responsive, resize, fullscreen, FIT, scale mode.

phaserjs/phaser · 66 tokens

web-games

Web browser game development principles. Framework selection, WebGPU, optimization, PWA.

vudovn/ag-kit · 20 tokens

html-to-ugui

HTML 原型转 Unity UGUI 智能 Prefab 生成管线。通过 AI 生成符合 UI-DSL 的 HTML,用 Playwright/浏览器烘焙 JSON v2 坐标、图片和适配意图,再导入 Unity 由 HtmlToUGUIBaker 生成可维护、多终端适配的 UGUI Prefab。触发场景:(1) 需要从自然语言生成 Unity UGUI 界面 (2) 需要从 HTML 原型烘焙 UGUI (3) UI 中包含图片并希望一键导入/绑定 Sprite (4) 需要 PC/mobile/pad 多终端适配 Prefab。.

Alex-Rachel/TEngine · 150 tokens

asset-management

Import/export textures crash-safely, query the Content Browser selection, and check if an asset is open (AssetDiscoveryService). Search, load, save, move, rename, duplicate, and delete assets are handled by Unreal's native AssetTools toolset or EditorAssetLibrary. Use when the user asks to import an image from disk…

kevinpbuckley/VibeUE · 92 tokens

threejs-gameplay-systems

Build and iterate playable Three.js game systems. Combines starter scaffold creation, architecture, game design, level design, gameplay implementation, combat/encounter design, and game-feel tuning (hitstop, screenshake, easing, impact feedback). Use for first playable slices, new Vite/TypeScript/Three.js game setup…

majidmanzarpour/threejs-game-skills · 128 tokens

new-littlejs-game

Scaffold a brand-new, complete playable game project — LittleJS engine included, opens straight from disk in a browser with no server, smallest playable loop written for you. TRIGGER on ANY request to make/create/start/build a game when no other engine or framework is named — "make me a pong game", "make a breakout…

KilledByAPixel/LittleJS-AI · 211 tokens