{
  "schemaVersion": 1,
  "atomId": "phaser.aicomponent",
  "bundleType": "aicomponent",
  "category": "engine",
  "mode": "fixed",
  "label": { "zh": "Phaser 3 游戏引擎", "en": "Phaser 3 game engine" },
  "tags": ["phaser", "game-engine", "webgl", "2d", "canvas", "scene", "runtime", "skeleton", "responsive", "mobile"],
  "bindingRoles": ["gameEngine"],
  "scaffold": {
    "files": {
      "src/index.ts": {
        "source": "ref/main.ts",
        "mode": "full",
        "weight": 10,
        "_comment": "webpack 入口：import CSS + 调用 StartGame + 监听 resize"
      },
      "src/index.html": {
        "source": "ref/index.html",
        "mode": "full",
        "weight": 10,
        "_comment": "HTML 容器，包含 viewport meta + #game-container"
      },
      "src/index.css": {
        "source": "ref/index.css",
        "mode": "full",
        "weight": 10,
        "_comment": "全屏样式：移动端适配、安全区、禁止选中/回弹"
      },
      "globals.d.ts": {
        "source": "ref/globals.d.ts",
        "mode": "full",
        "weight": 10,
        "_comment": "资源模块声明（*.webp, *.mp3 等）+ __DEV__ 全局变量"
      },
      "tsconfig.json": {
        "source": "ref/tsconfig.json",
        "mode": "merge-json",
        "weight": 10,
        "_comment": "TypeScript 配置：target es5, moduleResolution bundler, paths assets/*"
      },
      "src/game/index.ts": {
        "source": "ref/index.ts",
        "mode": "full",
        "weight": 10,
        "_comment": "StartGame(parent) 游戏入口，2× 设计分辨率 + Scale.FIT"
      },
      "src/game/GameConfig.ts": {
        "source": "ref/GameConfig.ts",
        "mode": "full",
        "weight": 10,
        "_comment": "通用游戏配置：设计稿基准、UI 缩放范围、安全区、调试开关"
      },
      "src/game/SceneKeys.ts": {
        "source": "ref/SceneKeys.ts",
        "mode": "full",
        "weight": 10,
        "_comment": "场景名枚举，避免字符串硬编码"
      },
      "src/game/scenes/BootScene.ts": {
        "source": "ref/BootScene.ts",
        "mode": "full",
        "weight": 10,
        "_comment": "Boot 场景：全局初始化 + 场景路由"
      },
      "src/game/scenes/PreloaderScene.ts": {
        "source": "ref/PreloaderScene.ts",
        "mode": "full",
        "weight": 10,
        "_comment": "预加载场景：进度条 + Loading 文字"
      },
      "src/game/scenes/GameScene.ts": {
        "source": "ref/GameScene.ts",
        "mode": "full",
        "weight": 10,
        "_comment": "空白主场景：Hello Phaser + 布局参考信息"
      },
      "src/game/utils/UiLayout.ts": {
        "source": "ref/UiLayout.ts",
        "mode": "full",
        "weight": 10,
        "_comment": "自适应布局：computeUiLayout() — uiScale/vScale/centerX/centerY"
      },
      "src/game/utils/SoundUtils.ts": {
        "source": "ref/SoundUtils.ts",
        "mode": "full",
        "weight": 10,
        "_comment": "安全音效播放封装：缺失音效键时静默返回"
      },
      "package.json": {
        "source": "ref/package.json",
        "mode": "merge-json",
        "weight": 10,
        "_comment": "项目依赖：phaser + webpack + ts-loader + html-webpack-plugin 等"
      },
      "webpack.config.js": {
        "source": "ref/webpack.config.js",
        "mode": "full",
        "weight": 10,
        "_comment": "Webpack 5 配置：ts-loader + asset/resource + HtmlWebpackPlugin + __DEV__"
      }
    },
    "packageJson": {
      "dependencies": {
        "phaser": { "version": "^3.90.0", "weight": 10 }
      }
    }
  },
  "exports": [
    { "name": "StartGame",       "kind": "function",  "location": "src/game/index.ts" },
    { "name": "GameConfig",      "kind": "object",    "location": "src/game/GameConfig.ts" },
    { "name": "SceneKeys",       "kind": "object",    "location": "src/game/SceneKeys.ts" },
    { "name": "BootScene",       "kind": "class",     "location": "src/game/scenes/BootScene.ts" },
    { "name": "PreloaderScene",  "kind": "class",     "location": "src/game/scenes/PreloaderScene.ts" },
    { "name": "GameScene",       "kind": "class",     "location": "src/game/scenes/GameScene.ts" },
    { "name": "computeUiLayout", "kind": "function",  "location": "src/game/utils/UiLayout.ts" },
    { "name": "UiLayoutConfig",  "kind": "interface", "location": "src/game/utils/UiLayout.ts" },
    { "name": "UiLayoutResult",  "kind": "interface", "location": "src/game/utils/UiLayout.ts" },
    { "name": "safePlaySound",   "kind": "function",  "location": "src/game/utils/SoundUtils.ts" }
  ],
  "neutralDescriptor": {
    "geometry": "2D WebGL game engine runtime with complete project skeleton: 3-scene lifecycle (Boot→Preloader→Game), responsive layout system (750×1334 design base), mobile adaptation (safe areas, touch, HiDPI), sound utilities",
    "layers": ["rendering", "scene-management", "input-system", "responsive-layout", "sound-utils", "project-scaffold"],
    "replaceable": ["renderer type (WEBGL/CANVAS)", "scene list", "design resolution", "HTML title", "background color"]
  },
  "usageHints": [
    "本 skill 提供完整 Phaser 空项目骨架（15 个文件），包含 package.json + webpack.config.js，scaffold 后 pnpm install && pnpm dev 即可运行",
    "项目结构：package.json / webpack.config.js / tsconfig.json / globals.d.ts + src/ (13个源文件) + assets/images/ + assets/sounds/",
    "三场景生命周期：Boot（全局初始化）→ Preloader（资源加载 + 进度条）→ Game（主游戏场景）",
    "computeUiLayout(scene) 统一计算 uiScale/vScale/centerX/centerY，所有 UI 元素必须使用此函数的输出定位",
    "设计稿基准 750×1334，运行时 2× viewport 作为设计分辨率（HiDPI 适配）+ Scale.FIT",
    "移动端已处理：viewport meta（禁缩放）、安全区 padding、禁止选中/回弹/长按菜单、双指输入",
    "globals.d.ts 已包含所有常见资源类型的模块声明（图片/音频/JSON），无需额外 skill",
    "webpack.config.js 内置 __DEV__ 全局变量注入，开发模式自动为 true",
    "safePlaySound(scene, key, config?) 封装安全音效播放，缺失音效键不抛异常",
    "assets/ 目录约定：assets/images/（图片）+ assets/sounds/（音频），webpack alias 已配置为 'assets' 短路径"
  ],
  "files": {
    "skill":          "SKILL.md",
    "mainEntry":      "ref/main.ts",
    "html":           "ref/index.html",
    "css":            "ref/index.css",
    "globals":        "ref/globals.d.ts",
    "tsconfig":       "ref/tsconfig.json",
    "packageJson":    "ref/package.json",
    "webpackConfig":  "ref/webpack.config.js",
    "gameEntry":      "ref/index.ts",
    "gameConfig":     "ref/GameConfig.ts",
    "sceneKeys":      "ref/SceneKeys.ts",
    "bootScene":      "ref/BootScene.ts",
    "preloaderScene": "ref/PreloaderScene.ts",
    "gameScene":      "ref/GameScene.ts",
    "uiLayout":       "ref/UiLayout.ts",
    "soundUtils":     "ref/SoundUtils.ts"
  }
}
