game-quality-gates
Game development quality gates and mandatory checks. Activate when building, reviewing, debugging, or deploying any game project (H5/Canvas/WebGL/Phaser/Three.js/2D/3D). Covers state cleanup, lifecycle management, input handling, audio, persistence, networking, anti-cheat, and performance. Use as pre-deploy checklist or when diagnosing game-specific bugs (state leaks, phantom timers, buff conflicts, memory growth, touch issues).
Best use case
game-quality-gates is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Game development quality gates and mandatory checks. Activate when building, reviewing, debugging, or deploying any game project (H5/Canvas/WebGL/Phaser/Three.js/2D/3D). Covers state cleanup, lifecycle management, input handling, audio, persistence, networking, anti-cheat, and performance. Use as pre-deploy checklist or when diagnosing game-specific bugs (state leaks, phantom timers, buff conflicts, memory growth, touch issues).
Teams using game-quality-gates should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/game-quality-gates/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How game-quality-gates Compares
| Feature / Agent | game-quality-gates | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Game development quality gates and mandatory checks. Activate when building, reviewing, debugging, or deploying any game project (H5/Canvas/WebGL/Phaser/Three.js/2D/3D). Covers state cleanup, lifecycle management, input handling, audio, persistence, networking, anti-cheat, and performance. Use as pre-deploy checklist or when diagnosing game-specific bugs (state leaks, phantom timers, buff conflicts, memory growth, touch issues).
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
AI Agents for Coding
Browse AI agent skills for coding, debugging, testing, refactoring, code review, and developer workflows across Claude, Cursor, and Codex.
Cursor vs Codex for AI Workflows
Compare Cursor and Codex for AI coding workflows, repository assistance, debugging, refactoring, and reusable developer skills.
AI Agents for Marketing
Discover AI agents for marketing workflows, from SEO and content production to campaign research, outreach, and analytics.
SKILL.md Source
# Game Quality Gates
Mandatory quality standards for all game projects. Based on 70+ real bugs and industry best practices.
## Core Principle
> Bugs come from **cross-state interactions**, not individual features.
> Each feature works alone; they break in combination.
## 12 Universal Rules (all games)
### 1. Single Cleanup Entry Point 🔄
All exit paths (death/level-complete/quit/pause/scene-switch) call ONE cleanup method with options.
```js
cleanupGameState(opts) {
// Fixed order: sub-objects → buffs+timers → UI → projectiles → (optional) enemies/controls/events
}
// Every exit: resetBall(), levelComplete(), gameOver(), onShutdown() → calls this
```
**New feature = add one line here. Never scatter cleanup across exits.**
### 2. Respect Active Buffs ⚡
Any code modifying attributes (speed/attack/size/defense) must check for active temporary effects first.
```js
// ❌ speed = Math.max(speed, BASE_SPEED); // ignores slow buff
// ✅ speed = Math.max(speed, this._currentBaseSpeed); // buff-aware baseline
```
### 3. Cache Before Destroy 📦
Extract all needed data before `destroy()`/`dispose()`/`remove()`.
```js
const { x, y } = obj; const color = obj.getData('color');
obj.destroy();
spawnParticles(x, y, color);
```
### 4. Timers Follow Lifecycle ⏰
Track all `setTimeout`/`setInterval`/`delayedCall`/`rAF`. Cancel in cleanup.
```js
this.activeTimers.push(this.time.delayedCall(10000, cb));
// In cleanup: this.activeTimers.forEach(t => t.remove(false));
```
### 5. Frame-Rate Independent Logic 🖥️
Multiply all time-dependent logic by delta. Never assume 60fps.
```js
// ✅ player.x += speed * (delta / 1000);
```
- Phaser `update(time, delta)`: delta in ms, divide by 1000
- Three.js `clock.getDelta()`: returns seconds
- Physics: prefer fixed timestep (accumulate delta, step every 16.67ms)
### 6. Scene Transition = Full Cleanup 🚪
On scene/level switch, clean: event listeners, timers, rAF, audio nodes, object pools, WebGL resources (geometry/material/texture dispose), global state, pending fetch/XHR.
Verify: Chrome DevTools → Memory → heap snapshots before/after transition.
### 7. Audio Lifecycle 🔊
- iOS: AudioContext must `resume()` inside a user interaction event
- `visibilitychange` → pause all audio when hidden, resume when visible
- WeChat WebView: `WeixinJSBridge.invoke('getNetworkType')` before autoplay
- Pool short sound effects; manage background music separately
### 8. Input Safety 👆
- Purchase/consume actions: mutex lock + visual disable
- Attack/fire: cooldown timer
- State toggles (pause/resume): state machine guard
- See **Phaser reference** for multi-touch pointer ID tracking
### 9. Save State Persistence 💾
- Include `version` field for migration when game updates
- Only persist meaningful state (not particles/temp animations)
- Auto-save on: level end, manual save, `visibilitychange` (hidden)
- localStorage limit 5MB; use IndexedDB for larger saves
- WeChat: use `wx.setStorage` (not localStorage)
### 10. Network Fault Tolerance 🌐
All network calls (leaderboard/share/ads/sync): 5s timeout + local cache fallback + no blocking game flow on failure.
### 11. Asset Loading Strategy 📦
Three tiers: critical (startup, <2s) → level assets (loading screen) → deferred (background lazy load).
Fatal error only for critical failures; degrade gracefully for non-critical.
Compression: GLB+Draco, WebP images, MP3+OGG dual audio, sprite atlases.
### 12. Anti-Cheat Baseline 🛡️
Client is untrusted. Server validates:
- One-time raid tokens (bind user+timestamp, single use)
- Play duration sanity check (can't finish 30 levels in 3 seconds)
- Score range validation
- See `references/anti-cheat.md` for implementation patterns
---
## Engine-Specific Rules
For Phaser-specific rules (pointer ID tracking, physics group cleanup, OVERLAP_BIAS, time vs physics pause):
→ Read `references/phaser.md`
For Three.js-specific rules (dispose trio, GLB compression pipeline, animation state machine, prune pitfalls):
→ Read `references/threejs.md`
---
## Pre-Deploy Checklist
Run this checklist before every deployment:
### 🔴 Universal (all games)
- [ ] New objects cleaned in `cleanupGameState()`?
- [ ] New timers cancelled in cleanup?
- [ ] Attribute changes respect active buffs?
- [ ] Data cached before destroy?
- [ ] Movement/animation uses delta time?
- [ ] No memory leaks across scene transitions? (DevTools verify)
- [ ] Audio pauses on background/lock?
- [ ] Purchase/consume has duplicate-click prevention?
- [ ] Save has version number + migration?
- [ ] Network calls have timeout + fallback?
- [ ] Asset load failure has graceful degradation?
- [ ] Critical operations (spend/settle) server-validated?
### 🟡 Mobile Extra
- [ ] Multi-touch: each finger tracked independently?
- [ ] iOS AudioContext resumed after first interaction?
- [ ] WeChat WebView compatible (no advanced CSS like backdrop-filter)?
- [ ] Virtual joystick/buttons don't overlap game area?
- [ ] Orientation change handled?
### 🔵 Engine-specific
→ See `references/phaser.md` or `references/threejs.md` for engine checklists.Related Skills
game-light-tracker
Track live NFL, NBA, NHL, or MLB games and automatically change Hue light colors based on which team is leading. Use when user wants to sync smart lights with live sports scores for visual game tracking. Supports NFL, NBA, NHL, and MLB games with customizable team colors.
high-quality-info-sources
Build, curate, score, and maintain high-quality information source lists for AI, technology, business, or any topic. Use when the user asks to create a skill for trusted sources, make a watchlist of people/sites/accounts to follow, filter noisy sources into a smaller high-signal set, turn a link dump into a reusable monitoring system, or design a repeatable workflow for tracking official accounts, researchers, critics, and market signals.
code-quality-guard
Professional pre-deployment code review and quality enforcement. Ensures imports are valid, tags are closed, and logic follows best practices before announcing a build is live.
AutoGame Tales
Generates short, atmospheric ghost stories or micro-fiction based on random prompts.
quality-convergence-engine
Multi-dimensional Quality Acceptance and Problem Convergence Engine - Deeply deconstruct requirements, eliminate extreme defects, define absolutely objective acceptance and failure criteria.
gameclaw
Tell users what terminal games exist in GameClaw and how to download the released CLI binaries from GitHub. Use this when users ask what games are available, want a GameClaw game, need Linux/macOS download links, or want quick run instructions for a released game.
epic-free-games
Auto-claim free games from Epic Games Store. 2026 latest page adaptation with persistent login state, completes the full claim process (Get → Place Order → Confirm). 自动领取 Epic Games Store 每周免费游戏。2026年最新页面适配,支持持久化登录状态, 自动完成完整领取流程(获取 → 下订单 → 确认领取)。
clawsgames
Play games against AI or other agents on ClawsGames. Compete in chess, tic-tac-toe and more. Results ranked on Ranking of Claws leaderboard.
quality-manager-qms-iso13485
ISO 13485 Quality Management System implementation and maintenance for medical device organizations. Provides QMS design, documentation control, internal auditing, CAPA management, and certification support. Use when working with medical device quality systems, preparing for ISO 13485 audits, managing regulatory compliance documentation, setting up corrective actions, or building audit preparation programs. Useful for quality management, audit preparation, regulatory compliance, medical device documentation, and corrective action workflows.
quality-manager-qmr
Senior Quality Manager Responsible Person (QMR) for HealthTech and MedTech companies. Provides quality system governance, management review leadership, regulatory compliance oversight, and quality performance monitoring per ISO 13485 Clause 5.5.2.
quality-documentation-manager
Document control system management for medical device QMS. Covers document numbering, version control, change management, and 21 CFR Part 11 compliance. Use for document control procedures, change control workflow, document numbering, version management, electronic signature compliance, or regulatory documentation review.
tianyi-cloud-game
天翼云游戏 - 一键打开天翼云游戏H5平台,畅玩云端游戏