Agent Skillsvudovn/ag-kit › web-games

web-games

GitHub

提供Web浏览器游戏开发指南,涵盖框架选型(Phaser/Three.js等)、WebGPU适配、性能优化策略、资源压缩加载及PWA部署原则。

.agents/skills/game-development/web-games/SKILL.md vudovn/ag-kit

Trigger Scenarios

询问前端游戏引擎推荐 需要WebGPU兼容性方案 游戏性能优化咨询 PWA游戏配置需求

Install

npx skills add vudovn/ag-kit --skill web-games -g -y
More Options

Non-standard path

npx skills add https://github.com/vudovn/ag-kit/tree/main/.agents/skills/game-development/web-games -g -y

Use without installing

npx skills use vudovn/ag-kit@web-games

指定 Agent (Claude Code)

npx skills add vudovn/ag-kit --skill web-games -a claude-code -g -y

安装 repo 全部 skill

npx skills add vudovn/ag-kit --all -g -y

预览 repo 内 skill

npx skills add vudovn/ag-kit --list

SKILL.md

Frontmatter
{
    "name": "web-games",
    "description": "Web browser game development principles. Framework selection, WebGPU, optimization, PWA.",
    "allowed-tools": "Read, Write, Edit, Glob, Grep"
}

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

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

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.

Version History

  • 211561c Current 2026-08-20 11:39

Same Skill Collection

.agents/skills/api-patterns/SKILL.md
.agents/skills/app-builder/SKILL.md
.agents/skills/app-builder/templates/SKILL.md
.agents/skills/architecture/SKILL.md
.agents/skills/bash-linux/SKILL.md
.agents/skills/batch-operations/SKILL.md
.agents/skills/behavioral-modes/SKILL.md
.agents/skills/brainstorming/SKILL.md
.agents/skills/clean-code/SKILL.md
.agents/skills/code-review-checklist/SKILL.md
.agents/skills/code-review-graph/SKILL.md
.agents/skills/context-compression/SKILL.md
.agents/skills/coordinator-mode/SKILL.md
.agents/skills/database-design/SKILL.md
.agents/skills/deployment-procedures/SKILL.md
.agents/skills/design-spec/SKILL.md
.agents/skills/documentation-templates/SKILL.md
.agents/skills/frontend-architecture/SKILL.md
.agents/skills/frontend-design/SKILL.md
.agents/skills/game-development/2d-games/SKILL.md
.agents/skills/game-development/3d-games/SKILL.md
.agents/skills/game-development/game-art/SKILL.md
.agents/skills/game-development/game-audio/SKILL.md
.agents/skills/game-development/game-design/SKILL.md
.agents/skills/game-development/mobile-games/SKILL.md
.agents/skills/game-development/multiplayer/SKILL.md
.agents/skills/game-development/pc-games/SKILL.md
.agents/skills/game-development/SKILL.md
.agents/skills/game-development/vr-ar/SKILL.md
.agents/skills/geo-fundamentals/SKILL.md
.agents/skills/i18n-localization/SKILL.md
.agents/skills/intelligent-routing/SKILL.md
.agents/skills/lint-and-validate/SKILL.md
.agents/skills/mcp-builder/SKILL.md
.agents/skills/memory-system/SKILL.md
.agents/skills/mobile-design/SKILL.md
.agents/skills/nextjs-react-expert/SKILL.md
.agents/skills/nodejs-best-practices/SKILL.md
.agents/skills/parallel-agents/SKILL.md
.agents/skills/performance-profiling/SKILL.md
.agents/skills/plan-writing/SKILL.md
.agents/skills/powershell-windows/SKILL.md
.agents/skills/python-patterns/SKILL.md
.agents/skills/red-team-tactics/SKILL.md
.agents/skills/rust-pro/SKILL.md
.agents/skills/seo-fundamentals/SKILL.md
.agents/skills/server-management/SKILL.md
.agents/skills/simplify-code/SKILL.md
.agents/skills/skillify/SKILL.md

Metadata

Files
0
Version
211561c
Hash
1431bf2f
Indexed
2026-08-20 11:39

- 위키
Copyright © 2011-2026 iteam. Current version is 2.155.2. UTC+08:00, 2026-08-25 11:17
浙ICP备14020137号-1 $방문자$