{
  "schemaVersion": 1,
  "atomId": "threejs.aicomponent",
  "bundleType": "aicomponent",
  "category": "engine",
  "mode": "fixed",
  "label": { "zh": "Three.js 3D 引擎", "en": "Three.js 3D engine" },
  "tags": ["three", "threejs", "game-engine", "webgl", "3d", "scene", "runtime", "skeleton", "responsive", "mobile"],
  "bindingRoles": ["gameEngine"],
  "scaffold": {
    "files": {
      "src/main.ts": {
        "source": "ref/main.ts",
        "mode": "full",
        "weight": 10,
        "_comment": "webpack 入口：import CSS + 调用 StartGame"
      },
      "src/index.html": {
        "source": "ref/index.html",
        "mode": "full",
        "weight": 10,
        "_comment": "HTML 容器，包含 viewport meta + #game-container + #loading-overlay"
      },
      "src/index.css": {
        "source": "ref/index.css",
        "mode": "full",
        "weight": 10,
        "_comment": "全屏样式：移动端适配、安全区、Loading overlay"
      },
      "globals.d.ts": {
        "source": "ref/globals.d.ts",
        "mode": "full",
        "weight": 10,
        "_comment": "资源模块声明（图片/音频/3D模型/HDR）+ __DEV__ 全局变量"
      },
      "tsconfig.json": {
        "source": "ref/tsconfig.json",
        "mode": "merge-json",
        "weight": 10,
        "_comment": "TypeScript 配置：target es2020, moduleResolution bundler, paths assets/*"
      },
      "src/game/index.ts": {
        "source": "ref/index.ts",
        "mode": "full",
        "weight": 10,
        "_comment": "StartGame(containerId) 游戏入口，配置 Renderer + Camera + SceneManager + 主循环"
      },
      "src/game/GameConfig.ts": {
        "source": "ref/GameConfig.ts",
        "mode": "full",
        "weight": 10,
        "_comment": "通用游戏配置：渲染参数、相机、灯光、调试开关"
      },
      "src/game/SceneKeys.ts": {
        "source": "ref/SceneKeys.ts",
        "mode": "full",
        "weight": 10,
        "_comment": "场景名枚举，避免字符串硬编码"
      },
      "src/game/SceneManager.ts": {
        "source": "ref/SceneManager.ts",
        "mode": "full",
        "weight": 10,
        "_comment": "场景生命周期管理器：注册、切换、更新、销毁"
      },
      "src/game/scenes/BaseScene.ts": {
        "source": "ref/BaseScene.ts",
        "mode": "full",
        "weight": 10,
        "_comment": "场景基类：统一 init/enter/update/exit/dispose 生命周期"
      },
      "src/game/scenes/PreloaderScene.ts": {
        "source": "ref/PreloaderScene.ts",
        "mode": "full",
        "weight": 10,
        "_comment": "预加载场景：HTML overlay 进度条 + AssetLoader 批量加载"
      },
      "src/game/scenes/MainScene.ts": {
        "source": "ref/MainScene.ts",
        "mode": "full",
        "weight": 10,
        "_comment": "主游戏场景：Hello Three.js（旋转 Torus Knot + 网格 + 坐标轴）"
      },
      "src/game/utils/ViewportManager.ts": {
        "source": "ref/ViewportManager.ts",
        "mode": "full",
        "weight": 10,
        "_comment": "响应式视口管理：ResizeObserver 自动更新 Renderer 尺寸与 Camera 宽高比"
      },
      "src/game/utils/AssetLoader.ts": {
        "source": "ref/AssetLoader.ts",
        "mode": "full",
        "weight": 10,
        "_comment": "统一资源加载器：Texture/GLTF/Audio/CubeTexture 批量加载 + 进度回调"
      },
      "package.json": {
        "source": "ref/package.json",
        "mode": "merge-json",
        "weight": 10,
        "_comment": "项目依赖：three + @types/three + webpack + ts-loader 等"
      },
      "webpack.config.js": {
        "source": "ref/webpack.config.js",
        "mode": "full",
        "weight": 10,
        "_comment": "Webpack 5 配置：ts-loader + 3D 模型资源 + HDR + __DEV__"
      }
    },
    "packageJson": {
      "dependencies": {
        "three": { "version": "^0.172.0", "weight": 10 }
      },
      "devDependencies": {
        "@types/three": { "version": "^0.172.0", "weight": 10 }
      }
    }
  },
  "exports": [
    { "name": "StartGame",        "kind": "function",  "location": "src/game/index.ts" },
    { "name": "GameInstance",      "kind": "type",      "location": "src/game/index.ts" },
    { "name": "GameConfig",        "kind": "object",    "location": "src/game/GameConfig.ts" },
    { "name": "SceneKeys",         "kind": "object",    "location": "src/game/SceneKeys.ts" },
    { "name": "SceneManager",      "kind": "class",     "location": "src/game/SceneManager.ts" },
    { "name": "BaseScene",         "kind": "class",     "location": "src/game/scenes/BaseScene.ts" },
    { "name": "PreloaderScene",    "kind": "class",     "location": "src/game/scenes/PreloaderScene.ts" },
    { "name": "MainScene",         "kind": "class",     "location": "src/game/scenes/MainScene.ts" },
    { "name": "ViewportManager",   "kind": "class",     "location": "src/game/utils/ViewportManager.ts" },
    { "name": "AssetLoader",       "kind": "class",     "location": "src/game/utils/AssetLoader.ts" }
  ],
  "neutralDescriptor": {
    "geometry": "3D WebGL game engine runtime with complete project skeleton: scene lifecycle manager (Preloader→Main), PBR rendering pipeline (shadows, tone mapping), responsive viewport (ResizeObserver), asset loading (Texture/GLTF/Audio/CubeTexture), OrbitControls",
    "layers": ["rendering", "scene-management", "input-system", "responsive-viewport", "asset-loading", "project-scaffold"],
    "replaceable": ["camera type/position", "lighting setup", "scene list", "background color", "tone mapping", "renderer settings"]
  },
  "usageHints": [
    "本 skill 提供完整 Three.js 空项目骨架（15 个文件），包含 package.json + webpack.config.js，scaffold 后 pnpm install && pnpm dev 即可运行",
    "项目结构：package.json / webpack.config.js / tsconfig.json / globals.d.ts + src/ (12个源文件) + assets/models/ + assets/textures/ + assets/sounds/",
    "场景生命周期：PreloaderScene（资源加载 + HTML 进度条）→ MainScene（主游戏场景）",
    "BaseScene 抽象类提供 onInit/onEnter/onUpdate/onExit/onDispose 五个可覆盖方法",
    "ViewportManager 使用 ResizeObserver 自动处理窗口大小变化，无需刷新页面",
    "AssetLoader 支持 Texture/GLTF/Audio/CubeTexture 四种资源类型的批量加载 + 进度回调",
    "PBR 渲染管线：ACES Filmic 色调映射 + PCF 软阴影 + HiDPI 像素比限制",
    "globals.d.ts 已包含 3D 模型（glb/gltf/fbx/obj）和 HDR/EXR 环境贴图的模块声明",
    "GameConfig.enableOrbitControls 控制 OrbitControls 开关，带阻尼平滑",
    "assets/ 目录约定：assets/models/（3D 模型）+ assets/textures/（贴图）+ 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",
    "sceneManager":     "ref/SceneManager.ts",
    "baseScene":        "ref/BaseScene.ts",
    "preloaderScene":   "ref/PreloaderScene.ts",
    "mainScene":        "ref/MainScene.ts",
    "viewportManager":  "ref/ViewportManager.ts",
    "assetLoader":      "ref/AssetLoader.ts"
  }
}
