---
name: ocean.aiimage
description: 海洋背景图封包 - 热带海洋/珊瑚礁场景，适合休闲游戏的清凉蓝色背景贴图生成
triggers: 海洋,ocean,大海,sea,背景,background,蓝色,coral,珊瑚,水下,underwater
---

# ocean.aiimage

海洋主题背景图封包。适合休闲消除、泡泡龙等类型游戏，营造清凉愉快的海洋氛围。

## Recipe

生成方式：调用 AI 图像生成接口，基于以下参数生成或 fork：

- **基础 prompt**：`calm tropical ocean, turquoise water, underwater coral reef, casual mobile game style, flat design, vibrant colors`
- **宽高比**：9:16（竖屏移动端）
- **风格**：cartoon / flat design
- **可 fork 的变体方向**：
  - 深海：`deep ocean, bioluminescent sea creatures, dark blue, mysterious`
  - 海滩：`tropical beach, white sand, palm trees, sunset sky`
  - 暴风海：`stormy ocean, dramatic waves, dark clouds, tension`

**生成步骤：**
1. 确认 Prefab 容器对背景贴图的尺寸约束（默认 1080×1920 PNG）
2. 调用图像生成 API，传入 prompt 和宽高比
3. 验证输出尺寸 ≥ 1080px 宽
4. 将生成图写入封包目录为 `background.png`
5. 更新 `manifest.json` 中 `generation.prompt` 和 `generation.seed` 字段

## Result

- **产物文件**：`background.png`
- **格式**：PNG
- **最小分辨率**：1080×1920
- **引用方式**：通过 `manifest.json.result.outputFile` 引用

## Binding

- **Binding Role**：`backgroundTexture`
- **挂载目标**：`scene://entities/Background/element/textureAsset`
- **引用类型**：`texture-asset-reference`
- **约束**：format=png，minWidth=1080

## 生成方式

Platform Skill: `playcraft-image-generation`

```bash
# 1. 生成图片（参考 ref/ 中的参考图）
playcraft tools generate-image \
     --prompt "calm tropical ocean, turquoise water, underwater coral reef, casual mobile game style, flat design, vibrant colors" \
     --aspect-ratio 9:16 \
     --image-model google/imagen-3.0-generate-002 \
     --output ta-workspace/raw.png

# 2. 后处理（去白底 + 格式转换）
playcraft image remove-background --input ta-workspace/raw.png --output ta-workspace/trimmed.png
playcraft image convert --input ta-workspace/trimmed.png --output ta-workspace/background.webp --quality 85

# 3. 将产物写入 sandbox 对应路径（见 binding.target）
```
## Skill Definition

tools:
  - bash
  - write
  - read
prompt_extension: |
  You are generating an ocean background image for a mobile casual game.
  Follow the Recipe section to call the image generation API with the specified prompt and parameters.
  After generation, verify the output meets the Result constraints, then apply the Binding to wire it into the scene.
