---
name: castle.aiimage
description: 城堡背景图封包 - 奇幻城堡/中世纪场景，适合逃脱益智类游戏的史诗风格背景贴图
triggers: 城堡,castle,奇幻,fantasy,中世纪,medieval,背景,background,宫殿,palace
---

# castle.aiimage

奇幻城堡主题背景图封包。适合逃脱益智、停车逃脱等类型游戏，营造史诗奇幻氛围。

## Recipe

- **基础 prompt**：`majestic fantasy castle on a hill, mystical atmosphere, casual mobile game style, flat design, vibrant colors, blue sky`
- **宽高比**：9:16
- **风格**：cartoon / flat design
- **可 fork 变体**：
  - 黑暗城堡：`dark gothic castle, ominous clouds, bats, dramatic lighting`
  - 冰雪城堡：`ice crystal palace, frozen landscape, blue and white tones`
  - 废墟城堡：`ruined castle, overgrown with vines, mysterious fog`

**生成步骤：**
1. 确认尺寸约束（1080×1920 PNG）
2. 调用图像生成 API
3. 验证输出尺寸 ≥ 1080px 宽
4. 写入 `background.png`，更新 manifest

## Result

- **产物文件**：`background.png`
- **格式**：PNG，最小 1080×1920

## Binding

- **Binding Role**：`backgroundTexture`
- **挂载目标**：`scene://entities/Background/element/textureAsset`
- **引用类型**：`texture-asset-reference`

## 生成方式

Platform Skill: `playcraft-image-generation`

```bash
# 1. 生成图片（参考 ref/ 中的参考图）
playcraft tools generate-image \
     --prompt "majestic fantasy castle on a hill, mystical atmosphere, casual mobile game style, flat design, vibrant colors, blue sky" \
     --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 a castle background image for a mobile game.
  Follow the Recipe to call the image generation API. Verify output meets Result constraints, then apply Binding.
