搜索

PythonReactSEOPDF
OpenClaw

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).

abczsl5200 来源安装数☆ 0 仓库 Stars

安装与使用

请根据来源仓库和你的 AI 工具说明安装此技能。先阅读技能文件和依赖要求,再添加到工作流。

SkillHub CLI

skillhub install abczsl520/game-quality-gates

打开来源仓库,查看说明和兼容环境后,按来源提供的命令或步骤安装。

将来源链接提供给你的 Agent,让它先读取说明、核对依赖,并向你说明将执行的安装步骤。

查看来源 ↗使用指南

技能说明

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.

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.

// ❌ 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().

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.

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.

// ✅ 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 d...

来源信息

Source
github
Repository
openclaw/skills
Path
skills/abczsl520/game-quality-gates
Version
—
Commit
d9237dc2eafb2b5285997087ab0efe67c348eb02
分类来源
rules
状态
active
可见性
public

这些信息来自收录时的来源分析,可能滞后;使用前请核对最新来源文件。

README

🎮 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.

ClawHub License: MIT Wiki OpenClaw Skill


💀 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...

来源内容

SKILL.md
# 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 d...
README
# 🎮 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.

[![ClawHub](https://img.shields.io/badge/ClawHub-game--quality--gates-blue?style=flat-square)](https://clawhub.com)
[![License: MIT](https://img.shields.io/badge/License-MIT-green?style=flat-square)](LICENSE)
[![Wiki](https://img.shields.io/badge/📖_Wiki-8_pages-purple?style=flat-square)](https://github.com/abczsl520/game-quality-gates/wiki)
[![OpenClaw Skill](https://img.shields.io/badge/OpenClaw-Agent_Skill-orange?style=flat-square)](https://github.com/openclaw/openclaw)

---

## 💀 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...

相关技能

OpenClaw

bambu-studio-ai

heyixuan2

Bambu Lab 3D printer control and automation. Activate when user mentions: printer status, 3D printing, slice, analyze model, generate 3D, AMS filament, print monitor, Bambu Lab, or any 3D printing task. Full pi...

OpenClaw

humanpages

human-pages-ai

Search and hire real humans for tasks — photography, delivery, research, and more

OpenClaw

openclaw-skills

zseven-w

Reusable skill templates for OpenClaw AI agents. Templates for API integration, data processing, web scraping, CLI tools, and file processing.

OpenClaw

geo-optimization

capt-marbles

Generative Engine Optimization (GEO) for AI search visibility. Optimize content to appear in ChatGPT, Perplexity, Claude, and Google AI Overviews. Use when optimizing websites, pages, or content for LLM discove...