๐ฎ Game Quality Gates
Stop shipping games with phantom timers, memory leaks, and double-spend exploits. A battle-tested quality standard for H5/Canvas/WebGL games.
๐ The Problem
Every feature works fine alone. They break in combination:
| Feature A | + Feature B | = Bug |
|---|---|---|
| Slow powerup | Paddle collision | Speed value overwritten |
| Multi-ball | Main ball death | Orphan sub-balls still scoring |
| Power-up falling | Player dies | Ghost objects after game over |
| Game over | Buff timers | Phantom timer modifies destroyed object ๐ฅ |
These aren't edge cases โ they're the #1 cause of game bugs. After fixing 70+ of these bugs in production H5 games, we encoded the prevention patterns into 12 universal rules.
๐ The 12 Universal Rules
| # | Rule | Prevents |
|---|---|---|
| 1 | ๐ Single Cleanup Entry Point | "Fixed in A, forgot in B" |
| 2 | โก Respect Active Buffs | Buff silently overwritten |
| 3 | ๐ฆ Cache Before Destroy | Reading dead object props |
| 4 | โฐ Timers Follow Lifecycle | Phantom timers after game over |
| 5 | ๐ฅ๏ธ Frame-Rate Independent | 30fps device = half speed |
| 6 | ๐ช Scene Switch = Full Cleanup | Memory grows per restart |
| 7 | ๐ Audio Lifecycle | iOS silent, background still playing |
| 8 | ๐ Input Safety | Double-buy, rapid-fire exploits |
| 9 | ๐พ Save State Versioning | Broken saves after update |
| 10 | ๐ Network Fault Tolerance | Game freezes on bad network |
| 11 | ๐ฆ Asset Loading Strategy | White screen, missing textures |
| 12 | ๐ก๏ธ Anti-Cheat Baseline | Score injection, payment bypass |
๐ Read full details in the Wiki โ
๐ฏ Engine-Specific Guides
Phaser 3 (Arcade Physics)
- Multi-touch
pointer.idtracking (the finger-swap bug) physics.pause()โtimepause (the phantom timer gotcha)OVERLAP_BIAStuning (3-4 recommended)- Physics group
clear(true, true)between levels
Three.js (WebGL/3D)
- The dispose trio: geometry + material + texture (VRAM leak prevention)
- GLB compression pipeline: 14MB โ 800KB (94% reduction)
gltf-transform pruneSkin deletion pitfall on rigged models- Animation crossfade state machine
Anti-Cheat
- One-time raid tokens (link start โ submit)
- Duration + score sanity checks
- Atomic purchase endpoints (no split deduct/grant)
โก Install
OpenClaw users:
clawhub install game-quality-gates
Manual:
git clone https://github.com/abczsl520/game-quality-gates.git ~/.openclaw/skills/game-quality-gates
Not using OpenClaw? The wiki is pure knowledge โ useful for any game developer. Just read the docs.
โ Pre-Deploy Checklist (Quick)
๐ด Universal (every game)
โก New objects in cleanupGameState()?
โก New timers cancelled in cleanup?
โก Buffs respected when modifying attributes?
โก Data cached before destroy()?
โก Delta time used for movement?
โก No memory leaks across scenes?
โก Audio pauses on background?
โก Purchase has click-lock?
โก Saves have version + migration?
โก Network has timeout + fallback?
โก Asset failure degrades gracefully?
โก Critical ops server-validated?
๐ก Mobile: multi-touch IDs, iOS audio resume, WeChat WebView compat
๐ต Phaser: clear(true,true), OVERLAP_BIAS, time+physics pause sync
๐ฃ Three.js: dispose trio, Draco loader, fadeIn/fadeOut transitions
๐ Full checklist with details โ
๐ Documentation
๐ Full Wiki โ
| Page | What You'll Learn |
|---|---|
| Universal Rules | The 12 core rules with code examples |
| Phaser Guide | Phaser 3 specific patterns |
| Three.js Guide | WebGL/3D specific patterns |
| Anti-Cheat Patterns | Server-side validation |
| Pre-Deploy Checklist | Copy-paste before every release |
| Real Bug Examples | Actual production bugs & fixes |
| Installation | Setup guide |
๐ Skill Structure
game-quality-gates/
โโโ SKILL.md # 12 rules + checklists (auto-loaded by OpenClaw)
โโโ references/
โโโ phaser.md # Phaser-specific (loaded on demand)
โโโ threejs.md # Three.js-specific (loaded on demand)
โโโ anti-cheat.md # Anti-cheat patterns (loaded on demand)
๐ Origin
- Source: Pixel Bounce (ๅ็ด ๅผน็็) โ 70+ bugs across 10 audit rounds
- Source: Tripo 3D Demo (ๆฏๅบ่ท้ ท3D) โ GLB compression + animation
- References: Phaser forum best practices, Three.js dispose docs, web game anti-cheat literature (2024-2025)
๐ Related
- Browser-Use Skill โ AI browser automation for OpenClaw
- Bug Audit โ Dynamic bug hunting (200+ patterns)
- Debug Methodology โ Root-cause debugging
- OpenClaw โ The AI agent platform
๐ Part of the AI Dev Quality Suite
| Skill | Purpose | Install |
|---|---|---|
| bug-audit | Dynamic bug hunting, 200+ pitfall patterns | clawhub install bug-audit |
| codex-review | Three-tier code review with adversarial testing | clawhub install codex-review |
| debug-methodology | Root-cause debugging, prevents patch-chaining | clawhub install debug-methodology |
| nodejs-project-arch | AI-friendly architecture, 70-93% token savings | clawhub install nodejs-project-arch |
| game-quality-gates (this) | 12 universal game dev quality checks | clawhub install game-quality-gates |
๐ค Contributing
Found a missing pattern? Have engine-specific rules for PixiJS, Babylon.js, or Unity WebGL? Open an issue or submit a PR!
๐ License
MIT โ Use freely, attribution appreciated.
โญ If this saved you from a production bug, star the repo โ help other game devs find it!