Game asset pipeline

From xiayu519/Tyou · View interactive version

Game asset pipeline is an AI agent skill from the GitHub repository xiayu519/Tyou. 在 Tyou Cocos Creator 3.8.7 项目中只使用 Codex imagegen 与本地确定性脚本生成、编辑、处理、验证并接入游戏图片素材。用于 Pixel/HD 角色与道具、八方向角色、透明 PNG、背景移除、Perfect Pixel、UI sheet 与 bbox 拆分、无缝纹理、Dual-grid 15 tileset、Isometric/Hex、横版三层视差背景、Sprite sheet、帧动画和 Cocos bundle 接入;不调用 Meowa 或其他外部图片 API,也不用于音效、BGM 或纯视频生成。

How to use this skill

Skill file

游戏图片流水线

核心边界

开始任务

  1. 读取 references/routing.md,选择 imagegen 生成/编辑与本地处理路径。
  2. 像素素材读取 references/pixel-art.md;八方向或动画读取 references/multiview-animation.md。
  3. 需要具体提示词结构时读取 references/prompts.md。
  4. 运行能力检查:

~~~powershell

python .agents/skills/game-asset-pipeline/scripts/asset_pipeline.py capabilities

~~~

  1. Pillow 缺失时明确报错并安装:

~~~powershell

python -m pip install "Pillow>=10,<13"

~~~

标准流程

  1. 固定素材规格:用途、画布、风格、方向、帧布局、锚点、目标 bundle 和 chroma key 色。
  2. 从洋红、绿色、蓝色等候选中选择与主体调色板明显冲突的纯色背景;不要要求 imagegen 直接返回透明 PNG。
  3. 先生成一个代表样本;确认轮廓、配色、纯色背景和主体未使用 key 色后再批量生成。
  4. 调用 imagegen。编辑已有图片时必须携带目标图片,不要用 Pillow 代替语义编辑。
  5. 使用 view_image 检查内容、布局、文字、裁切、key 色污染和明显语义漂移。
  6. sprite sheet 优先使用 prepare-sheet 一次完成抠色、透明补边、拆分、缩放、锚点归一化和重组;多方向角色为正方向与斜方向指定相同 --subject-height,动画继续使用共享比例保留体积变化;UI 先 chroma-key 再 split-components。
  7. 不合格时携带原图、角色设定图或完整 sheet 让 imagegen 定向编辑,再重新检查。
  8. 按 references/validation.md 验收;只有用户要求正式接入时才读取 references/cocos-creator.md。

专项原则

常用命令

~~~powershell

python .agents/skills/game-asset-pipeline/scripts/asset_pipeline.py inspect --input image.png

python .agents/skills/game-asset-pipeline/scripts/asset_pipeline.py chroma-key --input source.png --output transparent.png --key "#FF00FF" --tolerance 64

python .agents/skills/game-asset-pipeline/scripts/asset_pipeline.py prepare-sheet --input directions.png --output-dir prepared --cols 4 --rows 2 --target-width 128 --target-height 128 --subject-height 108 --key "#FF00FF"

python .agents/skills/game-asset-pipeline/scripts/asset_pipeline.py perfect-pixel --input source.png --output sprite.png --target-width 64 --colors 32

python .agents/skills/game-asset-pipeline/scripts/asset_pipeline.py split-grid --input directions.png --output-dir directions --cols 4 --rows 2 --pad-to-grid

python .agents/skills/game-asset-pipeline/scripts/asset_pipeline.py split-components --input ui-sheet.png --output-dir ui-components --padding 2

python .agents/skills/game-asset-pipeline/scripts/asset_pipeline.py normalize-frames --inputs directions/*.png --output-dir normalized --width 128 --height 128 --subject-height 108 --margin 2 --fit contain --resize-filter nearest

python .agents/skills/game-asset-pipeline/scripts/asset_pipeline.py validate-multiview --inputs normalized/*.png --mode eight

python .agents/skills/game-asset-pipeline/scripts/asset_pipeline.py make-seamless-blend --input texture.png --output texture-loop.png --horizontal --vertical

python .agents/skills/game-asset-pipeline/scripts/asset_pipeline.py dual-grid-15 --foreground grass.png --background water.png --output grass-water.png

python .agents/skills/game-asset-pipeline/scripts/asset_pipeline.py to-isometric --input tile.png --output tile-iso.png

python .agents/skills/game-asset-pipeline/scripts/asset_pipeline.py make-hex --input tile.png --output tile-hex.png

python .agents/skills/game-asset-pipeline/scripts/asset_pipeline.py parallax-pack --foreground fg.png --midground mid.png --background bg.png --output-dir parallax

python .agents/skills/game-asset-pipeline/scripts/asset_pipeline.py validate-animation --inputs frames/*.png

~~~

失败规则

参考资料

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.