phaser-architect

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Phaser 4 Architecture

Phaser 4 架构

Use this skill to produce maintainable Phaser 4 architecture before coding or during a brownfield architecture review.
在编码前或进行遗留项目架构审查时,可使用此技能来构建可维护的Phaser 4架构。

Workflow

工作流程

  1. Read the project context first. If
    docs/GDD.md
    exists, use it as the requirements source. For existing projects, inspect
    src/main.ts
    ,
    src/scenes/
    ,
    src/objects/
    , and shared type files before proposing changes.
  2. Identify the genre, core loop, target platform, physics mode, scene count, and state boundaries. Ask one targeted question if those choices are unclear.
  3. Recommend one concrete architecture with a short rationale.
  4. Define the scene graph, module layout, shared type files, registry/event keys, asset loading plan, and phased implementation order.
  5. Include a complete typed
    Phaser.Types.Core.GameConfig
    when planning a new project.
  6. Flag Phaser 4 migration risks early, especially removed Phaser 3 APIs.
  1. 首先阅读项目上下文。若存在
    docs/GDD.md
    文件,将其作为需求来源。对于现有项目,在提出修改建议前,先检查
    src/main.ts
    src/scenes/
    src/objects/
    以及共享类型文件。
  2. 确定游戏类型、核心循环、目标平台、物理模式、场景数量和状态边界。若这些信息不明确,提出一个针对性问题。
  3. 推荐一个具体的架构并附上简短的理由。
  4. 定义场景图、模块布局、共享类型文件、注册表/事件键、资源加载计划以及分阶段的实现顺序。
  5. 在规划新项目时,需包含完整的带类型定义的
    Phaser.Types.Core.GameConfig
  6. 尽早标记Phaser 4迁移风险,尤其是已移除的Phaser 3 API。

Output Shape

输出形式

For greenfield work, return:
  • Scene flow diagram
  • GameConfig
  • Directory/module layout
  • Shared constants/types to create first
  • State management plan
  • Asset pipeline plan
  • Phased implementation plan with build checkpoints
For brownfield work, return:
  • Current architecture summary
  • Main risks or sources of coupling
  • Minimal migration/refactor plan
  • Files likely to change
  • Verification steps
针对新项目(greenfield work),返回:
  • 场景流程图
  • GameConfig
  • 目录/模块布局
  • 需优先创建的共享常量/类型
  • 状态管理方案
  • 资源流水线计划
  • 包含构建检查点的分阶段实现计划
针对遗留项目(brownfield work),返回:
  • 当前架构概述
  • 主要风险或耦合来源
  • 最小化迁移/重构计划
  • 可能需要修改的文件
  • 验证步骤

Full Guidance

完整指南

For the detailed architecture playbook, read
references/agent-guidance.md
. It is copied from the Claude subagent definition but should be applied as a portable skill; ignore Claude-only fields such as
model
,
color
, and
tools
.
如需详细的架构手册,请阅读
references/agent-guidance.md
。该内容复制自Claude子代理定义,但应作为可移植技能使用;忽略仅适用于Claude的字段,如
model
color
tools