web-games

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

31,392 stars
Complexity: easy

About this skill

This skill equips an AI agent with comprehensive, up-to-date principles for developing web browser games. It acts as a knowledge base, enabling the agent to provide expert advice on crucial aspects such as selecting appropriate game development frameworks (e.g., Phaser, PixiJS for 2D; Three.js, Babylon.js for 3D) based on game type and desired features. The skill also incorporates best practices for leveraging modern web technologies like WebGPU for high-performance graphics, implementing optimization techniques for smooth gameplay, and integrating PWA features for enhanced reach and user experience. It's designed for agents to serve as an informed consultant, assisting users in navigating the complexities of modern web game development.

Best use case

An AI agent can utilize this skill when a user requires guidance on starting a web game project, comparing different game development frameworks, understanding modern web graphics APIs like WebGPU, or exploring optimization strategies and PWA implementation for their web game.

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

The AI agent will provide well-structured, knowledgeable, and contextually relevant advice, recommendations, or explanations regarding web browser game development principles, framework selection, and modern web technologies, based on the detailed information contained within the skill.

Practical example

Example input

I'm planning to build a simple 2D web game with rich animations and physics. Which JavaScript framework would you recommend, and why?

Example output

Based on your requirements for a simple 2D web game with rich animations and physics, I would recommend **Phaser 4**.

Phaser is an excellent choice for 2D games as it offers a comprehensive suite of 'full game engine features,' including a robust rendering system, physics engines, animation managers, and more. This makes it ideal for projects where you need more than just raw rendering power and benefit from integrated systems for game logic and interactivity.

If your primary focus was just high-performance rendering or building custom UI components, PixiJS might be considered, but for full game features like physics and animations, Phaser is generally preferred.

When to use this skill

  • Use this skill when the user's query pertains to strategic decisions, technical principles, or best practices in web browser game development, such as: * Recommending a 2D or 3D game framework. * Explaining the benefits of WebGPU or PWA for games. * Advising on general optimization techniques for web-based games. * Comparing the features and use cases of various web game engines/libraries.

When not to use this skill

  • Do not use this skill if the user's request is to: * Actually write code for a web game. * Debug specific game code issues. * Perform game asset creation (e.g., drawing sprites, modeling 3D objects). * Execute any game development tools or build processes directly.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/web-games/SKILL.md --create-dirs "https://raw.githubusercontent.com/sickn33/antigravity-awesome-skills/main/plugins/antigravity-awesome-skills-claude/skills/game-development/web-games/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/web-games/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How web-games Compares

Feature / Agentweb-gamesStandard Approach
Platform SupportClaudeLimited / Varies
Context Awareness High Baseline
Installation ComplexityeasyN/A

Frequently Asked Questions

What does this skill do?

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

Which AI agents support this skill?

This skill is designed for Claude.

How difficult is it to install?

The installation complexity is rated as easy. You can find the installation instructions above.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

Related Guides

SKILL.md Source

# 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

### Requirements

- Service worker for caching
- Web app manifest
- HTTPS

---

## 6. Audio Handling

### Browser Requirements

- Audio context requires user interaction
- Create AudioContext on first click/tap
- Resume context if suspended

### Best Practices

- Use Web Audio API
- Pool audio sources
- Preload common sounds
- Compress with WebM/Opus

---

## 7. Anti-Patterns

| ❌ Don't | ✅ Do |
|----------|-------|
| Load all assets upfront | Progressive loading |
| Ignore tab visibility | Pause when hidden |
| Block on audio load | Lazy load audio |
| Skip compression | Compress everything |
| Assume fast connection | Handle slow networks |

---

> **Remember:** Browser is the most accessible platform. Respect its constraints.

## When to Use
This skill is applicable to execute the workflow or actions described in the overview.

Related Skills

pc-games

31392
from sickn33/antigravity-awesome-skills

PC and console game development principles. Engine selection, platform features, optimization strategies.

Game DevelopmentClaude

vr-ar

31392
from sickn33/antigravity-awesome-skills

VR/AR development principles. Comfort, interaction, performance requirements.

Game DevelopmentClaude

game-design

31392
from sickn33/antigravity-awesome-skills

Game design principles. GDD structure, balancing, player psychology, progression.

Game DevelopmentClaude

game-development

31392
from sickn33/antigravity-awesome-skills

Game development orchestrator. Routes to platform-specific skills based on project needs.

Game DevelopmentClaude

bevy-ecs-expert

31392
from sickn33/antigravity-awesome-skills

Master Bevy's Entity Component System (ECS) in Rust, covering Systems, Queries, Resources, and parallel scheduling.

Game DevelopmentClaude

nft-standards

31392
from sickn33/antigravity-awesome-skills

Master ERC-721 and ERC-1155 NFT standards, metadata best practices, and advanced NFT features.

Web3 & BlockchainClaude

nextjs-app-router-patterns

31392
from sickn33/antigravity-awesome-skills

Comprehensive patterns for Next.js 14+ App Router architecture, Server Components, and modern full-stack React development.

Web FrameworksClaude

new-rails-project

31392
from sickn33/antigravity-awesome-skills

Create a new Rails project

Code GenerationClaude

networkx

31392
from sickn33/antigravity-awesome-skills

NetworkX is a Python package for creating, manipulating, and analyzing complex networks and graphs.

Network AnalysisClaude

network-engineer

31392
from sickn33/antigravity-awesome-skills

Expert network engineer specializing in modern cloud networking, security architectures, and performance optimization.

Network EngineeringClaude

nestjs-expert

31392
from sickn33/antigravity-awesome-skills

You are an expert in Nest.js with deep knowledge of enterprise-grade Node.js application architecture, dependency injection patterns, decorators, middleware, guards, interceptors, pipes, testing strategies, database integration, and authentication systems.

Frameworks & LibrariesClaude

nerdzao-elite

31392
from sickn33/antigravity-awesome-skills

Senior Elite Software Engineer (15+) and Senior Product Designer. Full workflow with planning, architecture, TDD, clean code, and pixel-perfect UX validation.

Software DevelopmentClaude