← 返回 Skills 市场
abczsl520

Game Quality Gates

作者 abczsl520 · GitHub ↗ · v1.1.0
cross-platform ✓ 安全检测通过
383
总下载
0
收藏
3
当前安装
2
版本数
在 OpenClaw 中安装
/install game-quality-gates
功能描述
Game development quality gates and mandatory checks. Activate when building, reviewing, debugging, or deploying any game project (H5/Canvas/WebGL/Phaser/Thre...
使用说明 (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.

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 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, \x3C2s) → 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.

安全使用建议
This skill is a docs/checklist package for game dev best practices and appears internally consistent. Before installing: (1) note that it auto-triggers on 'game-related' tasks per the Installation doc — ensure you want that behavior in your agent; (2) review the checklist items to confirm they match your project's engines and CI/QA workflows; (3) understand the guidance references public CDNs and example endpoints (no secrets required); and (4) the skill is advisory — it does not enforce fixes automatically, so integrate the checks into your review or CI processes if you want automated enforcement.
功能分析
Type: OpenClaw Skill Name: game-quality-gates Version: 1.1.0 The bundle is a legitimate set of quality assurance guidelines and checklists for game development (Phaser, Three.js, and general H5). It focuses on preventing common bugs like memory leaks, state conflicts, and basic cheating through architectural best practices. No malicious logic, data exfiltration, or harmful prompt injection attempts were identified in the code or instructions.
能力评估
Purpose & Capability
Name/description (game quality gates) match the provided artifacts: SKILL.md, engine-specific guides, and checklists. No unrelated credentials, binaries, or config paths are requested.
Instruction Scope
The SKILL.md and docs are purely guidance and checklists for game development, referencing diagnostics (DevTools heap snapshots) and engine-specific practices. They do not instruct the agent to read arbitrary host files, exfiltrate data, or call unknown remote endpoints. The Installation doc notes the skill 'auto-triggers' on game-related tasks — this is a behavioral note but not an instruction to access secrets or system files.
Install Mechanism
No install spec or code to download/execute is provided (instruction-only). All file contents are Markdown; nothing will be written or executed on install by the skill itself.
Credentials
The skill declares no required environment variables, credentials, or config paths. References to external resources (e.g., DRACOLoader decoder CDN, GitHub wiki links) are documentation examples only and do not require secrets.
Persistence & Privilege
The skill does not request always:true and does not modify other skills or system-wide settings in its content. Installation instructions show a local clone into the user's skills directory (manual install), which is standard for OpenClaw instruction-only skills.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install game-quality-gates
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /game-quality-gates 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.1.0
Added AI Dev Quality Suite cross-references, expanded Related links
v2.0.0
v2.0: 12 universal rules + Phaser/Three.js engine guides + anti-cheat patterns + pre-deploy checklists. Based on 70+ real bug fixes.
元数据
Slug game-quality-gates
版本 1.1.0
许可证
累计安装 3
当前安装数 3
历史版本数 2
常见问题

Game Quality Gates 是什么?

Game development quality gates and mandatory checks. Activate when building, reviewing, debugging, or deploying any game project (H5/Canvas/WebGL/Phaser/Thre... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 383 次。

如何安装 Game Quality Gates?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install game-quality-gates」即可一键安装,无需额外配置。

Game Quality Gates 是免费的吗?

是的,Game Quality Gates 完全免费(开源免费),可自由下载、安装和使用。

Game Quality Gates 支持哪些平台?

Game Quality Gates 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Game Quality Gates?

由 abczsl520(@abczsl520)开发并维护,当前版本 v1.1.0。

💬 留言讨论