@playcraft/cli 0.0.40 → 0.0.42

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (130) hide show
  1. package/README.md +66 -3
  2. package/dist/atom-plan/validate-atom-plan.js +298 -0
  3. package/dist/cli-root-help.js +1 -1
  4. package/dist/commands/3d.js +363 -0
  5. package/dist/commands/create.js +337 -0
  6. package/dist/commands/image.js +1337 -43
  7. package/dist/commands/recommend.js +1 -1
  8. package/dist/commands/remix.js +213 -0
  9. package/dist/commands/skills.js +1379 -0
  10. package/dist/commands/tools-3d.js +473 -0
  11. package/dist/commands/tools-generation.js +452 -0
  12. package/dist/commands/tools-project.js +400 -0
  13. package/dist/commands/tools-research.js +37 -0
  14. package/dist/commands/tools-research.test.js +216 -0
  15. package/dist/commands/tools-utils.js +183 -0
  16. package/dist/commands/tools.js +7 -616
  17. package/dist/config.js +2 -0
  18. package/dist/index.js +19 -1
  19. package/dist/utils/version-checker.js +8 -11
  20. package/package.json +9 -3
  21. package/project-template/.claude/agents/designer.md +120 -0
  22. package/project-template/.claude/agents/developer.md +124 -0
  23. package/project-template/.claude/agents/pm.md +164 -0
  24. package/project-template/.claude/agents/refs/README.md +73 -0
  25. package/project-template/.claude/agents/refs/designer-art-style-catalog.md +533 -0
  26. package/project-template/.claude/agents/refs/designer-color-audio-recipes.md +153 -0
  27. package/project-template/.claude/agents/refs/designer-deliverable-spec.md +191 -0
  28. package/project-template/.claude/agents/refs/designer-dimension-axis.md +27 -0
  29. package/project-template/.claude/agents/refs/designer-handoff-v2-checklist.md +68 -0
  30. package/project-template/.claude/agents/refs/designer-master-composite-recipes.md +208 -0
  31. package/project-template/.claude/agents/refs/designer-style-exploration-flow.md +37 -0
  32. package/project-template/.claude/agents/refs/developer-dev-handoff.md +109 -0
  33. package/project-template/.claude/agents/refs/developer-impl-cookbook.md +134 -0
  34. package/project-template/.claude/agents/refs/developer-phase1-flow.md +136 -0
  35. package/project-template/.claude/agents/refs/pm-workflow-detail.md +551 -0
  36. package/project-template/.claude/agents/refs/reviewer-convergence-eval.md +130 -0
  37. package/project-template/.claude/agents/refs/reviewer-six-dimension-eval.md +6 -0
  38. package/project-template/.claude/agents/refs/ta-3d-flip-recipe.md +85 -0
  39. package/project-template/.claude/agents/refs/ta-atlas-deliverable-standard.md +67 -0
  40. package/project-template/.claude/agents/refs/ta-batch-pipeline-recipes.md +120 -0
  41. package/project-template/.claude/agents/refs/ta-image-generation-detail.md +356 -0
  42. package/project-template/.claude/agents/refs/ta-image-ops-reference.md +495 -0
  43. package/project-template/.claude/agents/refs/ta-pipeline-cookbook.md +1108 -0
  44. package/project-template/.claude/agents/refs/ta-tools-reference.md +111 -0
  45. package/project-template/.claude/agents/refs/ta-vfx-preset-catalog.md +365 -0
  46. package/project-template/.claude/agents/reviewer.md +127 -0
  47. package/project-template/.claude/agents/technical-artist.md +122 -0
  48. package/project-template/.claude/hooks/README.md +44 -0
  49. package/project-template/.claude/hooks/validate-atom-plan.mjs +224 -0
  50. package/project-template/.claude/hooks/validate-workflow-stop.mjs +343 -0
  51. package/project-template/.claude/settings.json +36 -0
  52. package/project-template/.claude/settings.local.json +4 -0
  53. package/project-template/.claude/skills/playcraft-ad-psychology/SKILL.md +182 -0
  54. package/project-template/.claude/skills/playcraft-art-style-guide/SKILL.md +123 -0
  55. package/project-template/.claude/skills/playcraft-asset-state-sheet/SKILL.md +141 -0
  56. package/project-template/.claude/skills/playcraft-audio-generation/SKILL.md +280 -0
  57. package/project-template/.claude/skills/playcraft-batch-pipeline/SKILL.md +184 -0
  58. package/project-template/.claude/skills/playcraft-build-optimizer/SKILL.md +306 -0
  59. package/project-template/.claude/skills/playcraft-image-generation/SKILL.md +279 -0
  60. package/project-template/.claude/skills/playcraft-image-generation/reference/build-sprite-sheet.template.mjs +123 -0
  61. package/project-template/.claude/skills/playcraft-image-generation/reference/compare-style.template.mjs +254 -0
  62. package/project-template/.claude/skills/playcraft-image-generation/reference/gen-batch-sprite.template.mjs +235 -0
  63. package/project-template/.claude/skills/playcraft-image-generation/reference/gen-batch.template.mjs +97 -0
  64. package/project-template/.claude/skills/playcraft-image-generation/reference/gen-edit-variants.template.mjs +118 -0
  65. package/project-template/.claude/skills/playcraft-image-generation/reference/process-batch.template.mjs +137 -0
  66. package/project-template/.claude/skills/playcraft-image-generation/reference/prompt-cookbook.md +397 -0
  67. package/project-template/.claude/skills/playcraft-image-generation/reference/validate-sprite-sheet.template.mjs +296 -0
  68. package/project-template/.claude/skills/playcraft-image-ops/SKILL.md +122 -0
  69. package/project-template/.claude/skills/playcraft-masking/SKILL.md +373 -0
  70. package/project-template/.claude/skills/playcraft-research/SKILL.md +212 -0
  71. package/project-template/.claude/skills/playcraft-sprite-generation/SKILL.md +423 -0
  72. package/project-template/.claude/skills/playcraft-storyboard/SKILL.md +167 -0
  73. package/project-template/.claude/skills/playcraft-style-qa/SKILL.md +270 -0
  74. package/project-template/.claude/skills/playcraft-text-rendering/SKILL.md +236 -0
  75. package/project-template/.claude/skills/playcraft-vfx-animation/SKILL.md +130 -0
  76. package/project-template/.claude/skills/playcraft-workflow/SKILL.md +485 -0
  77. package/project-template/.claude/skills/playwright-cli/SKILL.md +390 -0
  78. package/project-template/.claude/skills/playwright-cli/references/element-attributes.md +23 -0
  79. package/project-template/.claude/skills/playwright-cli/references/playwright-tests.md +39 -0
  80. package/project-template/.claude/skills/playwright-cli/references/request-mocking.md +87 -0
  81. package/project-template/.claude/skills/playwright-cli/references/running-code.md +240 -0
  82. package/project-template/.claude/skills/playwright-cli/references/session-management.md +226 -0
  83. package/project-template/.claude/skills/playwright-cli/references/spec-driven-testing.md +312 -0
  84. package/project-template/.claude/skills/playwright-cli/references/storage-state.md +275 -0
  85. package/project-template/.claude/skills/playwright-cli/references/test-generation.md +138 -0
  86. package/project-template/.claude/skills/playwright-cli/references/tracing.md +142 -0
  87. package/project-template/.claude/skills/playwright-cli/references/video-recording.md +157 -0
  88. package/project-template/.cursor/hooks.json +17 -0
  89. package/project-template/.cursor/rules/playcraft-orchestrator.mdc +137 -0
  90. package/project-template/.cursor/rules/playcraft-subagent-boundary.mdc +18 -0
  91. package/project-template/CLAUDE.md +280 -0
  92. package/project-template/assets/audio/bgm/.gitkeep +0 -0
  93. package/project-template/assets/audio/sfx/.gitkeep +0 -0
  94. package/project-template/assets/bundles/.gitkeep +0 -0
  95. package/project-template/assets/images/bg/.gitkeep +0 -0
  96. package/project-template/assets/images/reference/.gitkeep +0 -0
  97. package/project-template/assets/images/storyboard/.gitkeep +0 -0
  98. package/project-template/assets/images/tiles/.gitkeep +0 -0
  99. package/project-template/assets/images/ui/.gitkeep +0 -0
  100. package/project-template/assets/images/vfx/.gitkeep +0 -0
  101. package/project-template/assets/models/.gitkeep +0 -0
  102. package/project-template/docs/team/agent-conduct.md +121 -0
  103. package/project-template/docs/team/agent-runtime-matrix.md +62 -0
  104. package/project-template/docs/team/atom-plan-format.md +105 -0
  105. package/project-template/docs/team/collaboration.md +297 -0
  106. package/project-template/docs/team/core-model.md +50 -0
  107. package/project-template/docs/team/platform-capabilities.md +15 -0
  108. package/project-template/docs/team/workflow-changelog.md +65 -0
  109. package/project-template/docs/team/workflow-consistency-checklist.md +140 -0
  110. package/project-template/game/config/.gitkeep +0 -0
  111. package/project-template/game/gameplay/.gitkeep +0 -0
  112. package/project-template/game/scenes/.gitkeep +0 -0
  113. package/project-template/logs/.gitkeep +0 -0
  114. package/project-template/ta-workspace/logs/.gitkeep +0 -0
  115. package/project-template/ta-workspace/scripts/.gitkeep +0 -0
  116. package/project-template/ta-workspace/tmp/.gitkeep +0 -0
  117. package/project-template/templates/atom-plan.template.json +26 -0
  118. package/project-template/templates/atom-plan.template.md +108 -0
  119. package/project-template/templates/design-brief.template.md +195 -0
  120. package/project-template/templates/design-lens-checklist.reference.md +117 -0
  121. package/project-template/templates/design-methodology.md +99 -0
  122. package/project-template/templates/designer-log.template.md +114 -0
  123. package/project-template/templates/developer-log.template.md +134 -0
  124. package/project-template/templates/five-axis-framework.md +186 -0
  125. package/project-template/templates/intent-clarifications.template.md +58 -0
  126. package/project-template/templates/layout-spec.template.md +146 -0
  127. package/project-template/templates/project-state.template.md +237 -0
  128. package/project-template/templates/review-report.template.md +91 -0
  129. package/project-template/templates/style-exploration.template.md +93 -0
  130. package/project-template/templates/ta-log.template.md +343 -0
@@ -0,0 +1,1108 @@
1
+ # TA Pipeline Cookbook
2
+
3
+ > Read by Technical Artist at **production** Wave 2 entry (**Step 0a → 0 → 1 → 2** in order). **Prerequisite:** Production Pipeline Wave 1 (Designer Ph.2) = `done` — orchestrator invokes TA only after Designer wave completes.
4
+
5
+ ## Step 0a — Upstream Intake (mandatory, before Skill Discovery)
6
+
7
+ > **Purpose:** Understand what PM locked, what Designer delivered, and what Wave 1 added — without re-reading everything in four docs (PM/Designer keep them concise; narrative lives in style-exploration + designer-log).
8
+
9
+ Read each file (Read tool or shell), then fill **`logs/ta-log.md` § Upstream Intake** before any generation.
10
+
11
+ ```bash
12
+ cat docs/project-state.md # stage, gates, Pipeline waves, spec-gap
13
+ cat docs/design-brief.md # experience flow, Style Direction, gameplay — prompt + QA context
14
+ cat docs/layout-spec.md # assetMapping, atlas groups, dimensions (contract)
15
+ cat docs/atom-plan.json # assignTo: TA, dependsOn
16
+ cat docs/atom-plan.md # TA Skill Context
17
+ cat docs/style-exploration.md
18
+ cat logs/designer-log.md
19
+ ls assets/images/reference/ # MC + ASR paths
20
+ ls assets/audio/ # Designer Ph.2 raw audio (if present)
21
+ ```
22
+
23
+ | Doc | You need from it (one line in ta-log) |
24
+ | ------------------- | ---------------------------------------------------- |
25
+ | `project-state` | Current wave, blockers, `selectedMcOption` |
26
+ | `design-brief` | Hook→EndCard beats + Style Direction for completions |
27
+ | `layout-spec` | Every path you must fill + atlas groups |
28
+ | `atom-plan.json` | TA atom list + dependencies |
29
+ | `atom-plan.md` | TA Skill Context |
30
+ | `style-exploration` | Confirmed MC path + per-panel visual intent |
31
+ | `designer-log` | Handoff Pack, Style Intent Notes, ASR inventory |
32
+
33
+ **MUST NOT** start Step 0 Skill Discovery or Step 1 gap table until Upstream Intake rows are ticked.
34
+
35
+ ---
36
+
37
+ ## Step 0 Pre: mediaGroups Asset Reuse (mandatory, before any generation)
38
+
39
+ > **Purpose:** `atom-plan.json` → `skillsMatch.mediaGroups` contains pre-matched reusable assets from the skills library. These assets have already been validated by PM's `playcraft skills match`. **TA MUST check and link available media assets before generating anything from scratch.**
40
+
41
+ ```bash
42
+ # 1. Read mediaGroups from atom-plan.json
43
+ cat docs/atom-plan.json | jq '.skillsMatch.mediaGroups'
44
+ ```
45
+
46
+ For each mediaGroup entry:
47
+
48
+ 1. **Check if the mediaGroup matches a TA-assigned atom** — compare `atomId` / description with atoms in your production list
49
+ 2. **If matched → link the asset directly**:
50
+
51
+ ```bash
52
+ # Link the pre-matched asset to the contract path
53
+ playcraft skills link --atom <atomId> --output <assetMapping_path>
54
+ # OR manually copy from skills library:
55
+ cp $(playcraft skills read <mediaGroup_atomId> --path) <assetMapping_path>
56
+ ```
57
+
58
+ 3. **Post-process the linked asset** (resize, convert, transparency) — linked assets still need format compliance
59
+ 4. **Update atom status** immediately:
60
+
61
+ ```json
62
+ { "atomId": "<id>", "status": "done", "actualOutput": "<assetMapping_path>" }
63
+ ```
64
+
65
+ 5. **If NOT matched or quality insufficient** — proceed to Step 0 Skill Discovery + Step 1 generation as normal; document reason in `dagRevisions`:
66
+
67
+ ```markdown
68
+ ### mediaGroup Skip — {{atomId}}
69
+
70
+ - **mediaGroup atomId**: {{mg_atomId}}
71
+ - **reason**: {{quality issue / style mismatch / wrong dimensions}}
72
+ - **action**: generate from scratch using Step 1 pipeline
73
+ ```
74
+
75
+ **STOP gate**: `ta-log.md` must contain a "mediaGroups Reuse" section listing each mediaGroup's disposition (linked / skipped + reason) before proceeding to generation.
76
+
77
+ ---
78
+
79
+ ## Step 0 (Skill Discovery) → Enrich TA Skill Context
80
+
81
+ Before executing any atom, run two rounds of Skill Discovery:
82
+
83
+ ---
84
+
85
+ ### Part A — Pipeline Skill Discovery(工作流决策)
86
+
87
+ ```bash
88
+ # Find relevant aiimage Skills for completion pipeline
89
+ playcraft skills list --category visual --json
90
+ playcraft skills match --intent "<style>,<element_type>,sprite,atlas" --json
91
+
92
+ # Find 3D Skills if needed
93
+ playcraft skills match --intent "3d,sprite,flip,render" --json
94
+
95
+ # Find validator Skills for compliance check
96
+ playcraft skills list --category validator --json
97
+ ```
98
+
99
+ ---
100
+
101
+ ### Part B — Atom Skill Recipe Read(生成参数提取)
102
+
103
+ For every atom assigned to TA with a non-empty `skillRef` in `atom-plan.json` `atoms[]`, read its generation recipe:
104
+
105
+ ```bash
106
+ # Read generation recipe from PM-assigned skillRef
107
+ # Replace <skillRef> with the atom's skillRef value (e.g., jewel_tile.aiimage)
108
+ playcraft skills scaffold <skillRef> --dry-run
109
+ ```
110
+
111
+ The scaffold output reveals the atom Skill's **Recipe** section: prompt template, aspect ratio, recommended model, variant directions. Use this as your **base prompt** for Stage A completions, then add `--reference-image` for style consistency.
112
+
113
+ **Example workflow** — atom `tile_02` has `skillRef: jewel_tile.aiimage`:
114
+
115
+ ```bash
116
+ # Step 1: Read the recipe
117
+ playcraft skills scaffold jewel_tile.aiimage --dry-run
118
+ # → Output:
119
+ # prompt: "isometric jewel tile, {color} gemstone, faceted crystal, soft glow, game UI style"
120
+ # aspectRatio: 1:1
121
+ # model: gpt-image-2
122
+ # variants: blue sapphire / red ruby / green emerald / yellow topaz
123
+
124
+ # Step 2: Generate using recipe prompt + Designer reference for style consistency
125
+ playcraft tools generate-image \
126
+ --prompt "isometric jewel tile, red ruby, faceted crystal, soft glow, game UI style" \
127
+ --reference-image assets/images/storyboard/master_composite_option_<selectedMcOption>.png \ # style anchor
128
+ --reference-image assets/images/tiles/tile_01.png \ # Designer's approved sample
129
+ --aspect-ratio 1:1 \
130
+ --image-model gpt-image-2 \ # recipe-recommended model
131
+ --output assets/images/tiles/tile_02.png
132
+ ```
133
+
134
+ **Key principle**: The atom Skill provides the **semantic description** (what the element is); `--reference-image` enforces **visual style** (how it matches this project's look). Both are necessary.
135
+
136
+ If `skillRef` is `—` or empty for an atom, skip Part B for that atom and rely on Designer's Style Intent Notes alone.
137
+
138
+ ---
139
+
140
+ ### Write findings into `docs/atom-plan.md` under `## TA Skill Context`
141
+
142
+ ```markdown
143
+ ### {{atom_id}} — {{slot_name}}
144
+
145
+ - **Production approach**: (e.g., "derive from Designer sample using reference-image")
146
+ - **Atom Skill recipe** (`skillRef: jewel_tile.aiimage`):
147
+ - Base prompt template: "isometric jewel tile, {color} gemstone, faceted crystal, soft glow"
148
+ - aspectRatio: 1:1
149
+ - Recommended model: gpt-image-2
150
+ - Variant directions: blue / red / green / yellow
151
+ - **Matched pipeline Skills**: `playcraft-sprite-sheet` — sprite frame merging workflow
152
+ - **Pipeline decision**: "generate 5 remaining tile colors using recipe prompt + master*composite_option*[X] / ASR crop reference"
153
+ - **Candidate new Skill**: `mahjong_tile_set.aiimage` — full 34-tile batch production
154
+ ```
155
+
156
+ ---
157
+
158
+ ### Part C — Mandatory Skill Preflight(管线 Skill 读取)
159
+
160
+ > **Purpose:** TA 在生产前必须阅读相关的 playcraft 管线 Skill,确保使用平台既定最佳实践而非"凭经验自由发挥"。
161
+
162
+ **必读 Skills(按产出类型):**
163
+
164
+ | 产出类型 | 必读 Skill | 不读的后果 |
165
+ | --------------- | ------------------------------------------------------------------------ | ---------------------------- |
166
+ | 任何图片生成 | `playcraft-image-generation`(§3 背景决策树、模型选择、reference-image) | 所有透明度问题 |
167
+ | 需要透明的素材 | `playcraft-masking`(remove-background / segment / decompose-layers) | 白底、黑块、色残留 |
168
+ | 精灵图 / Atlas | `playcraft-sprite-generation`(单帧生成→合并,非 AI 直出网格) | 帧尺寸不均、无 alpha、帧出血 |
169
+ | VFX 动画帧 | `playcraft-vfx-animation` | 发光效果黑块 |
170
+ | 批量 (>5 元素) | `playcraft-batch-pipeline` | 风格不一致、参数丢失 |
171
+ | 文字 / 数字渲染 | `playcraft-text-rendering`(绿幕策略 + 描边保护) | 文字白底、数字变绿 |
172
+ | 风格一致性验证 | `playcraft-style-qa` | 风格偏离 MC / ASR |
173
+
174
+ **执行方式:**
175
+
176
+ ```bash
177
+ # Read each relevant skill before production
178
+ cat .claude/skills/playcraft-image-generation/SKILL.md
179
+ cat .claude/skills/playcraft-masking/SKILL.md
180
+ cat .claude/skills/playcraft-sprite-generation/SKILL.md
181
+ # ... additional skills per atom type
182
+ ```
183
+
184
+ **STOP 门槛**:`logs/ta-log.md` 的 **§ Skill Preflight** 必须列出每个已读 Skill + 关键决策摘要(一行)。未填则不得执行 Step 1 批量生成。
185
+
186
+ ```markdown
187
+ ## Skill Preflight
188
+
189
+ | Skill | 已读 | 关键决策摘要 |
190
+ | --------------------------- | ---- | ----------------------------------------------------- |
191
+ | playcraft-image-generation | ✅ | 使用 gpt-image-2;所有透明素材 chroma key + ref-image |
192
+ | playcraft-masking | ✅ | floodfill 优先 (tolerance=25);复杂形状用 segment |
193
+ | playcraft-sprite-generation | ✅ | 单帧生成→去背→resize→合并;禁止 AI 直出网格 |
194
+ | playcraft-text-rendering | ✅ | 文字必须蓝幕;描边保护 + tolerance 降到 20 |
195
+ ```
196
+
197
+ ---
198
+
199
+ ## Step 1 (Asset Completion)
200
+
201
+ > **生图前请先阅读 `playcraft-image-generation` Skill**(包含模型选择决策树、reference-image 工作流和错误恢复策略)。
202
+
203
+ > **精灵图生产原则**:所有动画序列帧必须「单帧生成 → 去背景 → resize → sprite-sheet 合并」,严禁让 AI 直接生成网格图后切割(帧尺寸不均、无 alpha、帧出血)。详见本节末尾"Sprite Sheet Pipeline"。
204
+
205
+ ### Step 1: Map the Gap
206
+
207
+ ```bash
208
+ # Read the full expected asset list from layout-spec
209
+ cat docs/layout-spec.md # assetMapping defines EVERY file that must exist
210
+
211
+ # Check what Designer has already delivered
212
+ cat logs/designer-log.md
213
+ ls assets/images/tiles/
214
+ ls assets/images/bg/
215
+ ls assets/images/ui/
216
+ ```
217
+
218
+ Build a gap table: for each `assetMapping` entry, check if the file exists. Missing files are your production list.
219
+
220
+ ### Step 2: Identify Style Reference
221
+
222
+ ```bash
223
+ # The confirmed concept mockup is your master reference
224
+ cat docs/style-exploration.md # find confirmed option path
225
+ # e.g., assets/images/storyboard/master_composite_option_<selectedMcOption>.png
226
+
227
+ # Also use any approved samples as secondary references
228
+ ls assets/images/tiles/ # Designer's samples
229
+ ```
230
+
231
+ ### Step 3: Complete Missing Elements
232
+
233
+ **规则:超过 5 个元素 → 写 Node.js 脚本;5 个以内 → 直接命令行。**
234
+
235
+ **Prompt 来源优先级**(写 prompt 前先确认):
236
+
237
+ 1. **atom Skill recipe**(Step 0 Part B 已提取)— 有 skillRef → 用 recipe 的 prompt 模板,替换变量
238
+ 2. **Designer Style Intent Notes**(`logs/designer-log.md`)— 无 skillRef 或 recipe 不够具体 → 从 Style Intent Notes 提炼
239
+ 3. **design-brief StyleDirection** — 兜底,最通用
240
+
241
+ **少量元素(逐个生成)**:
242
+
243
+ ```bash
244
+ # prompt = atom Skill recipe 模板(已在 TA Skill Context 中提取)+ Designer style notes
245
+ playcraft tools generate-image \
246
+ --prompt "<recipe base prompt, e.g.: isometric jewel tile, red ruby, faceted crystal, soft glow, game UI style>" \
247
+ --reference-image assets/images/storyboard/master_composite_option_<selectedMcOption>.png \ # 风格锚定
248
+ --reference-image assets/images/tiles/<designer_sample>.png \ # Designer 样本(若有)
249
+ --output assets/images/tiles/<new_element>.png \
250
+ --aspect-ratio 1:1 \
251
+ --image-model <recipe recommended model, e.g.: gpt-image-2>
252
+ ```
253
+
254
+ **批量元素(10+ 个)→ 必须用 ta-workspace 脚本**:
255
+
256
+ ```javascript
257
+ // Write this to ta-workspace/scripts/gen-elements.mjs, then run: node ta-workspace/scripts/gen-elements.mjs
258
+ import { execSync } from "child_process";
259
+ import { existsSync, mkdirSync } from "fs";
260
+
261
+ // MODEL: from atom Skill recipe (Step 0 Part B) or fallback to gemini-flash
262
+ const MODEL = "google/gemini-3.1-flash-image-preview";
263
+ const REF =
264
+ "assets/images/storyboard/master_composite_option_<selectedMcOption>.png";
265
+ const REF2 = "assets/images/tiles/<designer_sample>.png"; // Designer approved sample (add if available)
266
+ const OUT = "assets/images/tiles";
267
+
268
+ // STYLE: atom Skill recipe base prompt (from TA Skill Context in atom-plan.md)
269
+ // e.g., "isometric jewel tile, {color} gemstone, faceted crystal surface, soft glow, game UI style"
270
+ // Replace {color} / {variant} per element
271
+ const BASE_PROMPT = "<atom Skill recipe base prompt from TA Skill Context>";
272
+
273
+ const ELEMENTS = [
274
+ { name: "element_01", variant: "<specific variant, e.g.: blue sapphire>" },
275
+ { name: "element_02", variant: "<specific variant, e.g.: red ruby>" },
276
+ // ... all elements to generate, using recipe variant directions
277
+ ];
278
+
279
+ mkdirSync(OUT, { recursive: true });
280
+ let done = 0,
281
+ skipped = 0,
282
+ failed = 0;
283
+
284
+ for (const el of ELEMENTS) {
285
+ const outPath = `${OUT}/${el.name}.png`;
286
+ if (existsSync(outPath)) {
287
+ console.log(`[SKIP] ${el.name}`);
288
+ skipped++;
289
+ continue;
290
+ }
291
+
292
+ console.log(`[GEN ] ${el.name}`);
293
+ // prompt = BASE_PROMPT with variant filled in + Designer style anchor via --reference-image
294
+ const prompt = BASE_PROMPT.replace("{variant}", el.variant).replace(
295
+ "{color}",
296
+ el.variant,
297
+ );
298
+ try {
299
+ execSync(
300
+ `playcraft tools generate-image` +
301
+ ` --prompt "${prompt}"` +
302
+ ` --output "${outPath}" --aspect-ratio 1:1` +
303
+ ` --reference-image "${REF}"` +
304
+ (existsSync(REF2) ? ` --reference-image "${REF2}"` : "") +
305
+ ` --image-model "${MODEL}"` +
306
+ ` --timeout 120`,
307
+ { stdio: "inherit" },
308
+ );
309
+ done++;
310
+ } catch (e) {
311
+ console.error(`[FAIL] ${el.name}:`, e.message);
312
+ failed++;
313
+ }
314
+ }
315
+ console.log(`Done: ${done} | Skipped: ${skipped} | Failed: ${failed}`);
316
+ if (failed > 0) process.exit(1);
317
+ ```
318
+
319
+ **Same-type elements → same model + same reference → consistent style.**
320
+
321
+ **结构相似变体(卡牌/棋子/图标集)→ Edit 模型路径**:
322
+
323
+ 当元素结构相同、只改局部(换花色、换数字、换颜色)时,Edit 模型路径比重新生成更快且局部一致性更强:
324
+
325
+ ```
326
+ Phase 1:高质量模型生成 1 张完美基图
327
+ → gpt-image-2 / gemini-flash(反复生成直到满意)
328
+
329
+ Phase 2:用参考图 + prompt 批量生成变体
330
+ → 任何 text+image 或 image→image 模型均支持 --reference-image
331
+ → 将基图作为 --reference-image,prompt 中描述变体差异
332
+ ```
333
+
334
+ 使用脚本模板:
335
+
336
+ ```bash
337
+ cp .claude/skills/playcraft-image-generation/reference/gen-edit-variants.template.mjs \
338
+ ta-workspace/scripts/gen-<name>-variants.mjs
339
+ # 修改 CONFIG.baseImage / CONFIG.editModel / VARIANTS[] 后运行
340
+ node ta-workspace/scripts/gen-<name>-variants.mjs
341
+ ```
342
+
343
+ ### Step 4: Process Assets(去背景 + resize + 验证)
344
+
345
+ > **必须先查阅 Step 0e Transparency Classification 表**,按 `bgStrategy` 列执行。不要凭直觉判断是否需要去背景。
346
+
347
+ #### 处理管线总览
348
+
349
+ ```
350
+ 按 bgStrategy 分流:
351
+
352
+ ├─ opaque → 直接 resize(skipRemoveBg = true)
353
+
354
+ ├─ full-coverage → resize → 全覆盖验证(四角四边)
355
+
356
+ ├─ greenscreen / bluescreen / magenta → 完整去背管线:
357
+ │ 1. playcraft image remove-background --method floodfill --tolerance 25
358
+ │ 2. playcraft image info --json → 确认 channels=4
359
+ │ 3. playcraft image overlay (深色背景验证)
360
+ │ 4. 验证失败? → 回退工具链(见下方)
361
+ │ 5. playcraft image resize → playcraft image convert --format webp
362
+
363
+ └─ segment → 提取管线:
364
+ 1. playcraft image crop (已知坐标) 或 segment --boxes (需精确蒙版)
365
+ 2. 若整图分层 → playcraft image decompose-layers
366
+ 3. playcraft image info --json → 确认 channels=4
367
+ 4. playcraft image overlay (深色背景验证)
368
+ 5. playcraft image resize → playcraft image convert --format webp
369
+ ```
370
+
371
+ #### bgStrategy = opaque(卡牌/棋子/矩形实体)
372
+
373
+ ```bash
374
+ playcraft image resize --input <file>.png --output <file>.png --width <W> --height <H> --fit contain
375
+ ```
376
+
377
+ 批量处理使用 `process-batch.template.mjs` 并设置 `CONFIG.skipRemoveBg = true`。
378
+
379
+ #### bgStrategy = greenscreen / bluescreen / magenta(需要透明的元素)
380
+
381
+ > ⚠️ **不要跳过去背景步骤!** 按 Step 0e 表中的 bgStrategy 选用正确的工具。
382
+
383
+ **Step 4a — 去背景(第一选择:floodfill)**:
384
+
385
+ ```bash
386
+ playcraft image remove-background \
387
+ --input <raw_asset>.png \
388
+ --output <processed_asset>.png \
389
+ --method floodfill \
390
+ --tolerance 25
391
+ ```
392
+
393
+ **Step 4b — 验证 alpha 通道**:
394
+
395
+ ```bash
396
+ playcraft image info --input <processed_asset>.png --json
397
+ # 确认: channels == 4(若 channels == 3,说明输出格式错误,确保 .png 后缀)
398
+ ```
399
+
400
+ **Step 4c — 深色背景渲染验证**:
401
+
402
+ ```bash
403
+ playcraft image overlay \
404
+ --base ta-workspace/tmp/dark_verify_bg.png \
405
+ --overlay <processed_asset>.png \
406
+ --output ta-workspace/tmp/verify_<name>.png \
407
+ --gravity center
408
+ # 目视确认:边缘干净、无色幕残留、无白色/黑色伪影
409
+ ```
410
+
411
+ **Step 4d — 验证失败时的回退工具链**:
412
+
413
+ | 验证失败现象 | 根因 | 回退工具 |
414
+ | -------------------------- | ------------------------------ | -------------------------------------------------------------------------- |
415
+ | 色幕残留少量(边缘毛刺) | tolerance 偏低 | `remove-background --tolerance 40`(+15 递增重试) |
416
+ | 色幕残留明显(大面积色块) | 素材色与色幕撞色 | **spec-gap** → PM 修改 bgStrategy → 用正确色幕重新生成 |
417
+ | 复杂边缘/不规则形状 | floodfill 无法处理复杂轮廓 | `playcraft image segment --boxes '[[x1,y1,x2,y2]]'`(精确框选,SAM3 分割) |
418
+ | 毛发/半透明/渐变边缘 | floodfill 是硬边缘算法 | `playcraft image remove-background --method ai`(AI 语义去背景) |
419
+ | 去背过度(元素被挖掉) | tolerance 过高或素材含近色区域 | 降低 tolerance 到 15-20 → 仍不行则 `segment --boxes` |
420
+ | VFX 帧出现黑色不透明块 | 发光/粒子未用色幕生成 | 用蓝幕重新生成每一帧,然后 `remove-background` |
421
+ | 白底/白边残留 | 未使用色幕策略直接白底生成 | 用正确色幕重新生成(不要试图在白底上去背景) |
422
+ | 背景图四角褪色/白边 | prompt 未加 edge-to-edge | 重新生成,prompt 加 `"full bleed, edge to edge, no vignette"` |
423
+
424
+ #### bgStrategy = segment(从 MC/ASR 提取)
425
+
426
+ 使用 PlayCraft CLI 提供的分割工具链提取,不做 AI 重新生成:
427
+
428
+ ```bash
429
+ # 方法 1: crop 直切(ASR 已知网格布局,最可靠)
430
+ playcraft image crop \
431
+ --input assets/images/reference/element_state_sheet_X.png \
432
+ --x <x> --y <y> --width <w> --height <h> \
433
+ --output <extracted>.png
434
+
435
+ # 方法 2: SAM3 语义分割(需精确蒙版时)
436
+ playcraft image segment \
437
+ --input assets/images/storyboard/master_composite.png \
438
+ --boxes '[[x1,y1,x2,y2]]' \
439
+ --output-dir ta-workspace/tmp/seg/
440
+ # → 使用 00_rgba.png(已带透明通道)
441
+
442
+ # 方法 3: 整图分层(需要从 MC 拆出多个层)
443
+ playcraft image decompose-layers \
444
+ --input assets/images/storyboard/master_composite.png \
445
+ --output-dir ta-workspace/tmp/layers \
446
+ --num-layers 4
447
+
448
+ # 提取后仍需深色背景验证
449
+ playcraft image overlay \
450
+ --base ta-workspace/tmp/dark_verify_bg.png \
451
+ --overlay <extracted>.png \
452
+ --output ta-workspace/tmp/verify_<name>.png \
453
+ --gravity center
454
+ ```
455
+
456
+ #### bgStrategy = full-coverage(全屏背景)
457
+
458
+ ```bash
459
+ playcraft image info --input <bg_asset>.png --json
460
+ # 验证:尺寸精确匹配 layout-spec 要求
461
+ # 目视检查:四角四边颜色一致,无褪色/渐变/白色边缘/暗角
462
+ ```
463
+
464
+ #### 批量处理
465
+
466
+ ```bash
467
+ cp .claude/skills/playcraft-image-generation/reference/process-batch.template.mjs \
468
+ ta-workspace/scripts/process-<name>.mjs
469
+ # 修改 CONFIG:
470
+ # skipRemoveBg = true (bgStrategy=opaque/full-coverage)
471
+ # skipRemoveBg = false (bgStrategy=greenscreen/bluescreen/magenta)
472
+ # removeBgTolerance = 25
473
+ node ta-workspace/scripts/process-<name>.mjs
474
+ ```
475
+
476
+ ---
477
+
478
+ ## Step 2 (Technical Production Pipeline)
479
+
480
+ ### Pipeline Selection — 先判断再动手
481
+
482
+ **Before choosing any specific pipeline, analyze the task's nature.**
483
+
484
+ | Task Nature | Best Pipeline | Why |
485
+ | ------------------------------------------------------------------------------------- | ------------------------------------------------------ | ------------------------------------------------- |
486
+ | **concept/mockup → generate complete asset set** | Sprite Generation (`playcraft-sprite-generation`) | AI direct generation with reference-image |
487
+ | **Structure identical, change local details only** (cards suit/rank, icon set symbol) | Edit Model Pipeline (`gen-edit-variants.template.mjs`) | 1 base image × N edits; local consistency highest |
488
+ | **Change material/texture, preserve symbols exactly** (mahjong white→ice/metal/wood) | 3D white model + texture swap | Symbols stay 100% intact as face texture |
489
+ | **Full creative restyle** (symbols also redesigned) | Sprite Remix (per-frame AI) | AI creativity needed for new symbol style |
490
+ | **Pure color/mood shift** | Image Processing (tint/blur/grayscale) | Simplest, no frame splitting needed |
491
+ | **Add animation to static elements** | `animate` presets | Built-in motion presets |
492
+ | **Add VFX effects** (explosion, sparkle) | `use-vfx` presets | Pre-built VFX sprite sheets |
493
+ | **Remix existing sprite sheet preserving grid layout** | Sprite Remix (split→regen→reassemble) | Grid topology preserved |
494
+
495
+ **Core decision rule:**
496
+
497
+ ```
498
+ Do you have a complete asset set already, or just a concept/mockup?
499
+
500
+ ├── JUST A CONCEPT → Sprite Generation pipeline (AI batch generate → smart split → assemble)
501
+
502
+ └── HAVE EXISTING ASSETS → Need to transform them
503
+
504
+ ├── Preserve symbols EXACTLY?
505
+ │ ├── YES → Can swap base material/texture?
506
+ │ │ ├── YES → 3D white model + texture swap (see ta-3d-flip-recipe.md)
507
+ │ │ └── NO → Image Processing (tint/overlay/filter)
508
+ │ │
509
+ │ └── NO (symbols also redesigned) → Sprite Remix (per-frame AI)
510
+
511
+ └── Just color/mood shift? → Image Processing (tint/blur/grayscale)
512
+ ```
513
+
514
+ ### Sprite Sheet Pipeline
515
+
516
+ **JSON 输出规则(必须了解,直接影响 Compliance Gate 和 Developer 集成):**
517
+
518
+ | 命令 | JSON 输出 | 网格参数来源 | ta-log 记录要求 |
519
+ | -------------- | ---------------- | --------------------------------------------------- | ----------------------------------------- |
520
+ | `sprite-sheet` | 自动生成 `.json` | JSON 文件本身 | 填"见 JSON" |
521
+ | `animate` | **无** | stdout `Layout: Nx × Ny \| Frame size: WxH` | **必填** columns/frameW/frameH/frameCount |
522
+ | `use-vfx` | **无** | `playcraft image list-vfx --json` 的 frames/columns | **必填** 同上 |
523
+
524
+ ```bash
525
+ # Scenario A: Generate animation frames from a static image
526
+ playcraft image animate \
527
+ --input assets/images/tiles/<element>.png \
528
+ --preset bounce # spin|bounce|pulse|shake|float|blink|swing|wobble|flip
529
+ --frames 8 \
530
+ --output assets/images/tiles/<element>_anim.png \
531
+ --columns 4
532
+ # → produces <element>_anim.png ONLY (NO JSON)
533
+ # → stdout prints: "Layout: 4x2 | Frame size: 128x128"
534
+ # → RECORD these params in ta-log.md Sprite Grid Params section immediately
535
+
536
+ # Scenario B: Merge separately generated frames (PREFERRED for animation sequences)
537
+ # Frame filenames MUST be zero-padded: f00.png, f01.png... NOT f0.png, f1.png...
538
+ # sprite-sheet sorts by filename (dictionary order): f0 < f10 < f2 without zero-padding
539
+ playcraft image sprite-sheet \
540
+ --inputs assets/images/frames/f00.png,f01.png,f02.png \
541
+ --output assets/images/tiles/<element>_sheet \
542
+ --columns 4 \
543
+ --cell-width 64 --cell-height 64
544
+ # → produces <element>_sheet.png + <element>_sheet.json (auto-generated)
545
+
546
+ # Scenario C: VFX preset sprite sheets
547
+ playcraft image list-vfx --json # shows frames + columns for each preset
548
+ playcraft image use-vfx \
549
+ --preset explosion_small \
550
+ --output assets/images/vfx/explosion.png \
551
+ --tint "#FF4400" \
552
+ --scale 1.5
553
+ # → produces explosion.png ONLY (NO JSON)
554
+ # → record from list-vfx: explosion_small has frames=8, columns=4
555
+
556
+ # Scenario D: Remix / reskin existing sprite sheet
557
+ playcraft image sprite-split \
558
+ --input assets/images/<source_sheet>.png \
559
+ --output-dir assets/images/frames_split \
560
+ --rows 4 --columns 8 --frame-width 100 --frame-height 100
561
+
562
+ playcraft image sprite-sheet \
563
+ --input-dir assets/images/frames_remix_nobg/ \
564
+ --sort name \
565
+ --output assets/images/<remixed_sheet> \
566
+ --columns 8 --cell-width 100 --cell-height 100
567
+
568
+ # Scenario E: Large batch (10+ frames) → write ta-workspace Node.js script
569
+ # See playcraft-image-generation Skill for Node.js templates.
570
+ ```
571
+
572
+ ---
573
+
574
+ ### AI 生成精灵图网格的风险警告
575
+
576
+ **严禁**让 AI 直接生成 `NxM 网格图` 后用 `sprite-split` 切割来得到动画帧。这是动画序列帧生产的错误做法:
577
+
578
+ ```
579
+ ❌ 错误做法(动画序列帧):
580
+ AI 直接生成 "4x2 grid of bouncing tile, 8 frames" 网格图
581
+ → sprite-split 切割
582
+ 失败原因:
583
+ · AI 不理解"网格约束"——每格内容大小不均匀,引擎按固定步长裁剪时错位
584
+ · 帧出血(frame bleeding)——相邻格内容互相污染边缘,padding=0 时线性过滤加剧
585
+ · 无 alpha 通道——AI 默认输出 RGB,透明区域变黑色
586
+ · 帧间视觉不一致——AI 对每格独立理解,角色比例/光照在帧间随机变化
587
+
588
+ ✅ 正确做法(动画序列帧):
589
+ 1. AI 生成单帧参考图(带绿幕背景:prompt 末尾加 "on solid bright green #00FF00 background")
590
+ 2. 去背景(remove-background --tolerance 25)→ resize(统一到精确尺寸)
591
+ 3. 对每帧执行步骤 1-2(同模型 + 同 reference,保证风格一致)
592
+ 4. sprite-sheet 合并(几何精确 + 自动输出 JSON)
593
+
594
+ 例外(静态元素集,不是动画):
595
+ gpt-image-2 精灵图直出策略(playcraft-image-generation Skill §1.2)
596
+ 适用于:麻将牌面、扑克牌面、Match-3 元素集等「同一静态元素的变体集合」
597
+ 不适用于:动画序列帧(bounce/walk/attack 等)
598
+ ```
599
+
600
+ ---
601
+
602
+ ### 精灵图技术验证(Compliance Gate 前必做)
603
+
604
+ 每张精灵图在进入 Compliance Gate 前,必须通过技术验证。不能仅检查"文件是否存在"。
605
+
606
+ **快速手动验证(所有精灵图):**
607
+
608
+ ```bash
609
+ # 1. 数学验算:实际尺寸 = 声明的网格参数推算值
610
+ playcraft image info assets/images/tiles/tile_anim.png --json
611
+ # 验证:
612
+ # width == columns × frameWidth (animate padding 固定为 0)
613
+ # height == ceil(frameCount / columns) × frameHeight
614
+ # channels == 4 (如果是 3,说明没有 alpha 通道,透明区域会渲染为黑色)
615
+
616
+ # 2. 帧名排序警告(sprite-sheet 命令)
617
+ # sprite-sheet 按文件名字典序排帧,数字后缀必须补零对齐
618
+ # ❌ f0.png f1.png f2.png ... f10.png → 字典序: f0 f1 f10 f2(f10 排在 f2 前面!)
619
+ # ✅ f00.png f01.png f02.png ... f10.png → 正确排序
620
+ ls ta-workspace/frames/ | sort # 确认排序正确
621
+
622
+ # 3. JSON 内容验证(仅 sprite-sheet 命令输出)
623
+ cat assets/images/tiles/tile_sheet.json | python3 -m json.tool
624
+ # 验证:
625
+ # frames 中 key 数量 == frameCount
626
+ # meta.size.w/h == 实际图片尺寸
627
+ # 每个 frame.x/y/w/h 坐标覆盖了正确区域
628
+ ```
629
+
630
+ **自动化验证脚本(批量验证,推荐):**
631
+
632
+ ```bash
633
+ cp .claude/skills/playcraft-image-generation/reference/validate-sprite-sheet.template.mjs \
634
+ ta-workspace/scripts/validate-sprite-sheet.mjs
635
+ # 编辑 SHEETS 数组,填入所有精灵图的 source/columns/frameWidth/frameHeight/frameCount
636
+ node ta-workspace/scripts/validate-sprite-sheet.mjs
637
+ # → 输出每张图的通过/失败详情 + 汇总
638
+ # → 失败时 exit code = 1,将问题写入 ta-workspace/logs/sprite-validate.log
639
+ ```
640
+
641
+ **常见失败及修复:**
642
+
643
+ | 失败现象 | 原因 | 修复 |
644
+ | ---------------------- | ------------------------------------------- | --------------------------------------- |
645
+ | 实际宽度 ≠ cols×frameW | frameWidth 记录错误,或帧图片 resize 不正确 | 确认所有帧已 resize 到完全相同的 W×H |
646
+ | channels = 3 | 去背景步骤缺失或输出格式为 JPEG | 确认使用 remove-background + 输出为 PNG |
647
+ | JSON 帧数不匹配 | sprite-sheet 命令未接收到所有输入帧 | 检查 --inputs 列表是否完整 |
648
+ | 帧顺序错乱 | 文件名未补零(f1.png 排在 f10.png 后面) | 重命名帧文件:f00.png f01.png... |
649
+ | 帧内容抽查发现空帧 | 裁剪坐标超出图片范围 | 确认 padding 参数与实际生成命令一致 |
650
+
651
+ ---
652
+
653
+ ### 3D Pipeline
654
+
655
+ For material/texture swap while preserving symbols or 3D flip animations, see `refs/ta-3d-flip-recipe.md`.
656
+
657
+ **Option A: AI 3D Model Generation**
658
+
659
+ ```bash
660
+ playcraft tools generate-3d \
661
+ --input assets/images/storyboard/master_composite_option_<selectedMcOption>.png \
662
+ --output assets/models/tile \
663
+ --name tile_base
664
+
665
+ playcraft 3d info assets/models/tile_base.glb
666
+ playcraft 3d optimize \
667
+ --input assets/models/tile_base.glb \
668
+ --output assets/models/tile_base_opt.glb \
669
+ --texture-size 512
670
+ ```
671
+
672
+ **Option B: White Model + Texture (fastest)**
673
+
674
+ ```bash
675
+ playcraft tools generate-image \
676
+ --prompt "<texture description, top-down, diffuse map>" \
677
+ --output assets/textures/tile_face.png
678
+
679
+ playcraft 3d apply-texture \
680
+ --model cube \ # sphere|cube|cylinder|cone|torus|plane|capsule
681
+ --texture assets/textures/tile_face.png \
682
+ --output assets/models/tile.glb
683
+ ```
684
+
685
+ ### Image Post-Processing Pipeline
686
+
687
+ ```bash
688
+ # Standard element pipeline: Generate → Resize → Remove bg → Convert
689
+ playcraft tools generate-image --prompt "..." --output <raw>.png
690
+ playcraft image resize --input <raw>.png --output <spec>.png --width W --height H --fit contain
691
+ playcraft image remove-background --input <spec>.png --output <nobg>.png
692
+ playcraft image convert --input <nobg>.png --output <final>.webp --quality 85
693
+
694
+ # Color variants (reuse same base element)
695
+ playcraft image tint --input <base>.png --output <variant_blue>.png --color "#0055FF"
696
+ playcraft image tint --input <base>.png --output <variant_red>.png --color "#FF2200"
697
+
698
+ # Pixel art style
699
+ playcraft image pixelate --input <src>.png --output <px>.png --pixel-size 8
700
+
701
+ # Overlay (UI composite)
702
+ playcraft image overlay --base bg.png --overlay icon.png --output composite.png --x 100 --y 200
703
+ ```
704
+
705
+ ### Audio Post-Processing Pipeline
706
+
707
+ ```bash
708
+ # Compress BGM to budget
709
+ playcraft audio compress --input assets/audio/bgm/bgm.mp3 --output assets/audio/bgm/bgm.mp3
710
+
711
+ # Trim SFX to target duration
712
+ playcraft audio trim --input assets/audio/sfx/match.mp3 --output assets/audio/sfx/match.mp3 --end 1.5
713
+
714
+ # Make BGM seamlessly loopable
715
+ playcraft audio loop --input assets/audio/bgm/bgm.mp3 --output assets/audio/bgm/bgm.mp3
716
+
717
+ # Add fade out
718
+ playcraft audio fade --input assets/audio/bgm/bgm.mp3 --output assets/audio/bgm/bgm.mp3 --fade-out 2.0
719
+
720
+ # Verify
721
+ playcraft audio info --input assets/audio/bgm/bgm.mp3
722
+ ```
723
+
724
+ ---
725
+
726
+ ## TA agent workflow (L1 → L2 detail)
727
+
728
+ > **Moved from `agents/technical-artist.md`** — Spec Quick-Check through Compliance Gate, reference-image matrix, DAG edits. **Atlas/WebP defaults:** see `refs/ta-atlas-deliverable-standard.md`.
729
+
730
+ ### Step 0: Spec Quick-Check (30s)
731
+
732
+ Validate inputs before any work:
733
+
734
+ - Every `assetMapping` entry has clear size/format requirements → if gaps: `spec-gap` in project-state.md
735
+ - `logs/designer-log.md` exists with Composite path + Style Intent Notes → if missing: `blocked`
736
+
737
+ ### Step 0b: Extract Representative Samples
738
+
739
+ > **Invoke `playcraft-masking` skill** for segment/remove-background decision tree.
740
+
741
+ Designer's **ASR sheets** (UI + element state reference) contain **representative states** (2-3 per type), not full sets. Your job:
742
+
743
+ 1. From **ASR** (preferred): `crop` each state slot → `resize` to spec → these become your `--reference-image` for Stage A batch generation
744
+ 2. From **Master Composite** (fallback): extract elements not covered in ASR
745
+ 3. Check `designer-log.md` **ASR State Inventory** — note which states are covered vs which need expansion
746
+ 4. Background: generate clean bg using composite as `--reference-image`
747
+ 5. Text assets: → **invoke `playcraft-text-rendering` skill**
748
+ 6. Representative quality insufficient → ICP request to Designer for supplementary samples
749
+
750
+ **ASR 提取方法(按优先级)**:
751
+
752
+ > ⚠️ **严禁对 ASR 网格布局图使用纯 text prompt 的 segment!** 使用 `designer-log` 中的槽位坐标 + `crop`。
753
+
754
+ ```
755
+ ASR 是已知网格布局?(ui_state_sheet / element_state_sheet,行列分明)
756
+ ├─ 是 → 方法 1: crop 直切(最可靠,零歧义)
757
+ │ 1. playcraft image info --input assets/images/reference/ui_state_sheet_<X>.png → 获取尺寸
758
+ │ 2. 从 designer-log ASR State Inventory 读取行列与 bbox
759
+ │ 3. playcraft image crop --input <asr_sheet> --x <x> --y <y> --width <w> --height <h> --output <out>
760
+ │ 4. 对有背景底色的元素:crop 后再 remove-background --method floodfill
761
+
762
+ ├─ 元素位置不规则但 bbox 已知 → 方法 2: segment --boxes(精确框选)
763
+ │ segment --input <asr_sheet> --boxes '[[x1,y1,x2,y2]]' --output-dir <dir>
764
+
765
+ └─ 仅 MC 有该类型 → 方法 3: decompose-layers 或 segment --text(最后手段,见 playcraft-masking)
766
+ ```
767
+
768
+ **常见踩坑**:
769
+
770
+ - ❌ `segment --text "apple tile icon"` → SAM3 可能只切出苹果图案,丢失 tile 方块底板
771
+ - ❌ `segment --text "panda character"` → 图上有 panda face tile + panda 角色,会返回多个 instance,score 最高的不一定是你要的
772
+ - ✅ `playcraft image crop --x 50 --y 50 --width 400 --height 400` → 精确、零歧义
773
+ - ✅ `segment --boxes '[[50,50,450,450]]'` → 框选已知位置的元素
774
+
775
+ ### Step 0c: Style Interpretation Check
776
+
777
+ > **Invoke `playcraft-style-qa` skill** for methodology.
778
+
779
+ Read designer-log Style Intent Notes → write interpretation table to `ta-log.md` → confidence low = blocked, medium = proceed with caution, high = proceed.
780
+
781
+ ### Step 0d: Production Plan (mandatory, before any generation)
782
+
783
+ > **Purpose:** Converge on full asset coverage and pipeline order before bulk production.
784
+
785
+ Write `logs/ta-log.md` § **Production Plan** with:
786
+
787
+ 1. **Coverage Plan** — one row per `layout-spec` `assetMapping` entry (contract path, pipeline type, reference source, priority)
788
+ 2. **Atlas Assembly Plan** — one row per atlas group from layout-spec grouping table (output `.webp` + `.json`, frameIds, grid layout)
789
+ 3. **Pipeline Order** — numbered steps (Extract → Complete → Process → Assemble → Verify)
790
+ 4. **Risk Checklist** — all items checked `[x]`
791
+
792
+ **Rules:**
793
+
794
+ - Coverage Plan row count must equal `assetMapping` entry count (no gaps)
795
+ - Atlas groups must match layout-spec § atlas grouping table
796
+ - **MUST NOT** start Step 1 bulk generation until Risk Checklist is fully checked
797
+ - `validate-workflow-stop.mjs` blocks STOP if Plan is incomplete
798
+
799
+ ---
800
+
801
+ ### Step 0e: Asset Transparency Classification (mandatory, before any generation)
802
+
803
+ > **Purpose:** 根据 `layout-spec.md` 的 `assetMapping` 路径约定 + 元素色彩分析,自动推导每个资产的透明度需求和色幕策略,确定完整的处理管线。**此步骤在 Production Plan 完成后、Step 1 批量生成前执行。**
804
+
805
+ **根因认知**:当前所有 AI 模型均不支持原生透明 PNG(`ALPHA = no`)。不做透明度处理 → 所有素材"生成就完事" → UI 叠加元素白底、VFX 黑块、HUD 数字白底、图标白底等系统性问题。**PlayCraft CLI 提供了完整的透明度工具链(`remove-background` / `segment` / `decompose-layers`),TA 必须显式使用。**
806
+
807
+ #### 1. 从路径约定推导 needsAlpha
808
+
809
+ 遍历 `layout-spec.md` 的 `assetMapping`,根据**路径目录**自动判断每个资产是否需要透明背景:
810
+
811
+ ```
812
+ assetMapping 路径所在目录?
813
+
814
+ ├─ assets/images/bg/ → needsAlpha = false(全屏背景,不透明)
815
+ ├─ assets/images/ui/ → needsAlpha = true (UI 叠加层,必须透明)
816
+ ├─ assets/images/txt/ → needsAlpha = true (文字图片,必须透明)
817
+ ├─ assets/images/vfx/ → needsAlpha = true (特效精灵图,必须透明)
818
+ ├─ assets/images/tiles/ → needsAlpha = true (默认;除非是卡牌/棋子矩形实体)
819
+ ├─ assets/audio/ → N/A(非图片)
820
+ └─ 其他路径 → 按素材用途判断:叠加在其他图层上 = true,独立全屏 = false
821
+ ```
822
+
823
+ **卡牌/棋子等矩形实体例外**:虽然路径在 `tiles/`,但白色牌面是资产本体的一部分,不需要透明。TA 根据 `design-brief` 的 Style Direction + `designer-log` 的样本判断。
824
+
825
+ #### 2. 从元素色彩推导 bgStrategy(色幕选型)
826
+
827
+ 对每个 `needsAlpha = true` 的资产,根据元素主色调选择色幕颜色。色调信息来源:
828
+
829
+ - `layout-spec.md` 的 Color Palette(elementId → hex color)
830
+ - `design-brief.md` 的 Style Direction(整体色温描述)
831
+ - `designer-log.md` 的样本(实际视觉参考)
832
+
833
+ **色幕选型矩阵**:
834
+
835
+ | 元素主色调 | ❌ 禁用色幕 | ✅ 推荐色幕 | 原因 |
836
+ | --------------------- | ------------ | ---------------- | ---------------------------------------------------- |
837
+ | 金色/黄色/橙色/琥珀色 | 绿幕 #00FF00 | **蓝幕 #0000FF** | 金色与绿色色相接近(黄绿区),floodfill 残留绿色边缘 |
838
+ | 绿色/翠绿/青色 | 绿幕 #00FF00 | **蓝幕 #0000FF** | 同色系,floodfill 无法区分边界 |
839
+ | 蓝色/靛蓝/紫色 | 蓝幕 #0000FF | **绿幕 #00FF00** | 同色系冲突 |
840
+ | 红色/粉色/白色/黑色 | — | 绿幕或蓝幕均可 | 与两者色相距离都大 |
841
+ | 多色/彩虹 | — | **品红 #FF00FF** | 品红在自然素材中最少出现(最后手段) |
842
+
843
+ **特殊规则**(不按元素色彩,按资产类型固定):
844
+
845
+ | 资产类型 | 固定色幕 | 原因 |
846
+ | ---------------------- | ---------------- | ---------------------------------------------------- |
847
+ | VFX 发光/粒子/选中高亮 | **蓝幕 #0000FF** | VFX 普遍含暖色调(金色火焰、橙色爆炸),绿幕必出残留 |
848
+ | 文字/数字图片 | **蓝幕 #0000FF** | 文字常为金色/白色/浅色,绿幕边缘污染 |
849
+ | 全屏背景 | N/A(不去背景) | prompt 加 `"full bleed, edge to edge, no vignette"` |
850
+ | 矩形实体(卡牌/棋子) | N/A(不去背景) | 白底是资产本身,skipRemoveBg = true |
851
+
852
+ #### 3. 填写 Transparency Classification 表
853
+
854
+ ```markdown
855
+ ## Transparency Classification
856
+
857
+ | assetMapping path | needsAlpha | bgStrategy | 去背工具(第一选择) | 回退工具 | 验证方法 | 验证结果 |
858
+ | ----------------------------- | ---------- | ------------- | ------------------------------------- | ------------------------------------------- | -------------------- | -------- |
859
+ | assets/images/bg/bg_main.webp | false | full-coverage | N/A | N/A | 边缘全覆盖检查 | ❓ |
860
+ | assets/images/ui/btn_cta.webp | true | greenscreen | `remove-background --floodfill -t 25` | `segment --boxes` / `remove-bg --method ai` | 深色背景 overlay | ❓ |
861
+ | assets/images/ui/digits.webp | true | bluescreen | `remove-background --floodfill -t 25` | `segment --boxes` / `remove-bg --method ai` | 深色背景 overlay | ❓ |
862
+ | assets/images/vfx/glow.webp | true | bluescreen | `remove-background --floodfill -t 25` | `segment --boxes` | 逐帧深色背景 overlay | ❓ |
863
+ | assets/images/tiles/tile.webp | true | greenscreen | `remove-background --floodfill -t 25` | `segment --boxes` / `remove-bg --method ai` | 深色背景 overlay | ❓ |
864
+ | assets/images/txt/title.webp | true | bluescreen | `remove-background --floodfill -t 25` | `remove-bg --method ai` | 深色背景 overlay | ❓ |
865
+ ```
866
+
867
+ #### 4. 去背工具链(按 bgStrategy 执行)
868
+
869
+ > **PlayCraft CLI 提供了完整的透明度处理工具链,TA 必须按决策树显式使用,不能跳过去背景步骤。**
870
+
871
+ | bgStrategy | 生成 prompt 后缀 | 第一选择去背工具 | 回退工具(第一选择效果不好时) |
872
+ | ------------- | ------------------------------------------------------------------- | -------------------------------------------------- | -------------------------------------------------- |
873
+ | greenscreen | `"on solid bright green #00FF00 background, isolated, centered"` | `playcraft image remove-background --tolerance 25` | `playcraft image segment --boxes` 或 `--method ai` |
874
+ | bluescreen | `"on solid bright blue #0000FF background, isolated, centered"` | `playcraft image remove-background --tolerance 25` | `playcraft image segment --boxes` 或 `--method ai` |
875
+ | magenta | `"on solid bright magenta #FF00FF background, isolated, centered"` | `playcraft image remove-background --tolerance 20` | `playcraft image remove-background --method ai` |
876
+ | extract | 无特殊后缀(从 MC/ASR 提取) | `playcraft image crop` 或 `segment --boxes` | `playcraft image decompose-layers`(整图分层) |
877
+ | full-coverage | `"full scene, full bleed, edge to edge, no vignette, no fade"` | N/A(不去背景) | N/A |
878
+ | opaque | `"flat 2D, no shadow, no 3D effect, clean edges, white background"` | N/A(不去背景) | N/A |
879
+
880
+ **工具选型决策树**(TA 必须按此执行,不可跳步):
881
+
882
+ ```
883
+ needsAlpha = true?
884
+ ├─ 是 → 按色幕选型矩阵确定色幕颜色
885
+ │ → Step A: 生成时 prompt 加色幕后缀
886
+ │ → Step B: playcraft image remove-background --method floodfill --tolerance 25
887
+ │ → Step C: playcraft image info --json → channels == 4?
888
+ │ ├─ channels=4 → Step D: 深色背景 overlay 验证
889
+ │ │ ├─ 通过 → ✅ 记录结果
890
+ │ │ └─ 边缘有残留 → 回退工具链:
891
+ │ │ ├─ 纯色残留少量 → 调高 tolerance (25→40→60) 重试
892
+ │ │ ├─ 复杂边缘/不规则形状 → playcraft image segment --boxes (SAM3)
893
+ │ │ ├─ 毛发/半透明/复杂背景 → playcraft image remove-background --method ai
894
+ │ │ └─ 仍然不行 → playcraft image segment --text (最后手段)
895
+ │ └─ channels=3 → 输出可能是 JPEG,确保 --output 为 .png 后缀
896
+
897
+ ├─ needsAlpha = true 且从 MC/ASR 提取(非 AI 生成)?
898
+ │ → 优先: playcraft image crop (已知网格布局/坐标)
899
+ │ → 次选: playcraft image segment --boxes (已知大致位置,需精确蒙版)
900
+ │ → 回退: playcraft image segment --text (位置未知,描述要极其具体)
901
+ │ → 整图分层: playcraft image decompose-layers (需拆出多层时)
902
+ │ → Step D: 深色背景 overlay 验证
903
+
904
+ ├─ needsAlpha = false(full-coverage 全屏背景)?
905
+ │ → 不做去背景
906
+ │ → 验证:playcraft image info 确认尺寸 → 四角四边颜色一致,无褪色/白色/渐变
907
+
908
+ └─ needsAlpha = false(opaque 矩形实体)?
909
+ → 不做去背景,直接 resize(skipRemoveBg = true)
910
+ ```
911
+
912
+ #### 4. 验证清单(生成后必做)
913
+
914
+ **每个 `needsAlpha=true` 的资产,去背景后必须做以下验证:**
915
+
916
+ ```bash
917
+ # A. Alpha 通道检查 — channels 必须 = 4
918
+ playcraft image info --input <asset>.png --json
919
+ # 验证: channels == 4 (若 channels == 3,说明没有 alpha 通道)
920
+
921
+ # B. 深色背景渲染验证 — 在 #1A1A2E 深色底上叠合查看
922
+ playcraft image overlay \
923
+ --base ta-workspace/tmp/dark_verify_bg.png \
924
+ --overlay <asset>.png \
925
+ --output ta-workspace/tmp/verify_<name>.png \
926
+ --gravity center
927
+ # 目视检查:无白边、无色幕残留、无黑块、边缘干净
928
+
929
+ # C. 背景图全覆盖检查(仅 bgStrategy=full-coverage)
930
+ playcraft image info --input <bg_asset>.png --json
931
+ # 验证:尺寸精确匹配 layout-spec 要求
932
+ # 目视检查:四角四边颜色一致,无褪色/渐变/白色边缘
933
+ ```
934
+
935
+ **验证用深色底图生成(一次即可,全项目复用)**:
936
+
937
+ ```bash
938
+ # 生成 512x512 深色验证底图
939
+ node -e "
940
+ const sharp = require('sharp');
941
+ sharp({ create: { width: 512, height: 512, channels: 4, background: { r: 26, g: 26, b: 46, alpha: 1 } } })
942
+ .png().toFile('ta-workspace/tmp/dark_verify_bg.png');
943
+ "
944
+ ```
945
+
946
+ **批量验证脚本(>5 个透明资产时推荐)**:
947
+
948
+ ```bash
949
+ # 为每个需要透明的资产批量叠合验证
950
+ for f in assets/images/ui/*.png assets/images/vfx/*.png assets/images/txt/*.png; do
951
+ name=$(basename "$f" .png)
952
+ playcraft image overlay \
953
+ --base ta-workspace/tmp/dark_verify_bg.png \
954
+ --overlay "$f" \
955
+ --output "ta-workspace/tmp/verify_${name}.png" \
956
+ --gravity center
957
+ echo "[VERIFY] $name → ta-workspace/tmp/verify_${name}.png"
958
+ done
959
+ # 逐张目视检查输出,发现问题立即记录到 ta-log
960
+ ```
961
+
962
+ #### 5. 写入 ta-log.md
963
+
964
+ 在 `logs/ta-log.md` § Transparency Classification 表中填写验证结果:
965
+
966
+ ```markdown
967
+ ## Transparency Classification
968
+
969
+ | # | Contract Path | needsAlpha | bgStrategy | 去背工具 | 验证结果 |
970
+ | --- | ----------------------------- | ---------- | ------------- | -------------------------------- | --------------------------- |
971
+ | 1 | assets/images/ui/btn_cta.webp | true | greenscreen | remove-background floodfill t=25 | ✅ channels=4, 深色验证通过 |
972
+ | 2 | assets/images/txt/title.webp | true | bluescreen | remove-background floodfill t=25 | ✅ channels=4, 深色验证通过 |
973
+ | 3 | assets/images/ui/icons.webp | true | segment | segment --boxes + crop | ✅ channels=4, 深色验证通过 |
974
+ | 4 | assets/images/bg/bg_main.webp | false | full-coverage | N/A | ✅ 全覆盖检查通过 |
975
+ ```
976
+
977
+ **MUST NOT** 进入 Step 1 批量生成,除非 Transparency Classification 表完成且无 `❓` 未决项。
978
+
979
+ ---
980
+
981
+ ### Step 1: Skill Discovery
982
+
983
+ - Part A: `playcraft skills list/match` → find pipeline Skills → write to atom-plan `## TA Skill Context`
984
+ - Part B: `playcraft skills scaffold <skillRef> --dry-run` for each atom → extract prompt/model params
985
+ (See **Step 0** above for bash examples.)
986
+
987
+ ### Pipeline model (E → T → A → B → C → D)
988
+
989
+ ```
990
+ Gate #2 → TA starts
991
+
992
+ ├─ 0a: Upstream Intake
993
+ ├─ 0b: Extract (E) — decompose-layers or segment references from composites
994
+ ├─ 0c: Style Interpretation Check
995
+ ├─ 0d: Production Plan
996
+ ├─ 0e: Transparency Classification ← NEW (classify all assets, select chroma key per color matrix)
997
+
998
+ ├─ T: Transparency-aware generation (Step 1 with correct chroma key per 0e table)
999
+ │ │
1000
+ │ ├─ C₁: generate-3d (if referenceSource="designer-sample")
1001
+ │ │
1002
+ │ ├─ A: Batch Element Generation (sprite sheet per type, chroma key per 0e)
1003
+ │ │ │
1004
+ │ │ ├──→ B: animate / sprite-sheet / use-vfx (VFX always blue screen)
1005
+ │ │ └──→ C₂: apply-texture (if referenceSource="ta-completion")
1006
+ │ │
1007
+ │ └─ (extraction insufficient → ICP → Designer supplementary)
1008
+
1009
+ ├─ Step 4: Process (remove-bg per chroma → dark-bg verify each asset)
1010
+
1011
+ ├─ D: Audio post-processing (independent, waits for Designer Ph.2 audio)
1012
+
1013
+ └─ All done → Compliance Gate (incl. Transparency checks)
1014
+ ```
1015
+
1016
+ ### Pipeline selection (quick)
1017
+
1018
+ | Situation | Pipeline | Skill/Ref |
1019
+ | ---------------------------------- | ------------------------------- | ----------------------------- |
1020
+ | Multi-element batch (>3 same type) | Sprite sheet one-shot → split | `playcraft-sprite-generation` |
1021
+ | Add animation to static element | animate presets → sprite-sheet | `playcraft-vfx-animation` |
1022
+ | Add VFX (glow/particle/trail) | use-vfx presets | `playcraft-vfx-animation` |
1023
+ | 3D model + texture | generate-3d → apply-texture | `refs/ta-3d-flip-recipe.md` |
1024
+ | Color/mood shift only | Image processing (tint/overlay) | `playcraft-image-ops` |
1025
+ | Background removal | floodfill / AI / SAM3 | `playcraft-masking` |
1026
+
1027
+ ### Stage A: Batch Element Generation
1028
+
1029
+ > **Invoke the `playcraft-sprite-generation` skill** for the complete workflow.
1030
+
1031
+ | Step | Action | Done when |
1032
+ | -------------- | -------------------------------------------------------------- | -------------------------------------------- |
1033
+ | A.1 Define | Write spec (count/grid/sizes/full element list) to `ta-log.md` | List count = assetMapping count |
1034
+ | A.2 Prompt | Write five-section prompt to `ta-log.md` | Follows Scene/Canvas/Set/Details/Constraints |
1035
+ | A.3 Review | 9-item checklist | All pass |
1036
+ | A.4 Generate | One-shot full sprite sheet | Image + .json sidecar output |
1037
+ | A.5 Verify+Fix | Check each cell → fix errors with targeted regen | Error ≤ 30% fixed; >30% redo from A.2 |
1038
+ | A.6 Split | Crop + replace fixes + final verify | File count = list count, dims match |
1039
+
1040
+ ### Stage B: Animation + VFX
1041
+
1042
+ > **Invoke `playcraft-vfx-animation` skill** for preset catalog, decision tree, and game-type recipes.
1043
+
1044
+ Triggered per Stage A output that needs animation. Output: sprite sheet with grid params recorded in `ta-log.md`.
1045
+
1046
+ ### Stage C: 3D Pipeline
1047
+
1048
+ > **Read `refs/ta-3d-flip-recipe.md`** for material reskin and 3D flip workflows.
1049
+
1050
+ - C₁ (referenceSource="designer-sample"): starts immediately after extraction
1051
+ - C₂ (referenceSource="ta-completion"): waits for Stage A output
1052
+
1053
+ ### Stage D: Audio Post-Processing
1054
+
1055
+ Independent track, waits only for Designer Ph.2 audio delivery:
1056
+
1057
+ - `playcraft audio compress/trim/loop/fade` as needed per layout-spec requirements
1058
+ - Record all processing in `ta-log.md`
1059
+
1060
+ ### Compliance Gate (full checklist)
1061
+
1062
+ | Check | Criteria |
1063
+ | --------------------------------------- | ---------------------------------------------------------------------------------------------------------------------- |
1064
+ | All assetMapping files exist | Zero missing |
1065
+ | Image dimensions match assetSpec | Exact match |
1066
+ | Image format | **WebP** for runtime deliverables per `ta-atlas-deliverable-standard`; PNG/JPG only if layout-spec explicitly requires |
1067
+ | Sprite / atlas grid params | In ta-log.md (cols/frameW/frameH/frameCount); `.json` beside each atlas |
1068
+ | **Transparency Classification** | ta-log.md has Transparency Classification table; all rows have 验证结果 (no `❓`) |
1069
+ | **Alpha channel (transparent)** | All assets marked 需要透明=✅ have `channels=4` (`playcraft image info --json`) |
1070
+ | **Dark-bg render verify (transparent)** | All transparent assets verified on #1A1A2E dark background — no white edge, no chroma residue, no black blocks |
1071
+ | **Background full-coverage** | All full-screen backgrounds: edges extend to all four sides, no fade/vignette/white corners |
1072
+ | **Atlas per-frame verify** | Each frame in atlas verified individually on dark background (especially VFX glow/particle frames) |
1073
+ | Audio format | MP3 after TA post-process |
1074
+ | No external dependencies | Standalone files |
1075
+ | Style Interpretation completed | ta-log.md has interpretation table |
1076
+ | No open TA questions | intent-clarifications.md clear |
1077
+
1078
+ > **TA 阶段不管体积。** 品质和规格合规是唯一目标。体积优化在 Developer build 阶段。
1079
+
1080
+ **Transparency compliance 不通过的常见原因及修复**:
1081
+
1082
+ | 失败现象 | 根因 | 修复 |
1083
+ | ----------------------- | ------------------------------------ | ------------------------------------------------- |
1084
+ | channels=3(无 alpha) | 去背景步骤遗漏,或输出为 JPEG | 对原图执行 remove-background,确保输出 PNG |
1085
+ | 深色验证见白边 | 生成时未用色幕,白底未完全去除 | 用正确色幕重新生成 + remove-background |
1086
+ | 深色验证见绿色/蓝色残留 | 色幕选型错误(素材色与色幕撞色) | 按色幕选型矩阵换用另一种色幕重新生成 |
1087
+ | VFX 帧出现黑色不透明块 | 发光/粒子生成时未加色幕 | 用蓝幕重新生成每一帧 |
1088
+ | 背景图四角有白色/褪色 | prompt 未约束 edge-to-edge | prompt 加 "full bleed, edge to edge, no vignette" |
1089
+ | 文字/数字图底色未去除 | 未分类为"需要透明",直接 resize 交付 | 回查 Transparency Classification → 补做去背景流程 |
1090
+
1091
+ **After compliance**: Write `logs/ta-log.md` manifest → mark atoms `✅ done` → update project-state.md.
1092
+
1093
+ ### Reference image rules
1094
+
1095
+ | CAPABILITY | `--reference-image` | Models |
1096
+ | ------------- | ------------------- | ----------------------------------------- |
1097
+ | `text+image` | ✅ optional | gpt-image-2, nano-banana-2, gemini-flash |
1098
+ | `image→image` | ✅ required | qwen-image-edit-max, wan2.6-image |
1099
+ | `text→image` | ❌ not supported | hy-image-lite, qwen-image-max, flux-2-pro |
1100
+
1101
+ **Same model for same element set** — consistency requires identical model across a batch.
1102
+
1103
+ ### DAG modification protocol
1104
+
1105
+ - Redundant atom → `⏭️ skipped`
1106
+ - Missing asset → add row, assign to TA
1107
+ - Direction changes → **STOP and report**
1108
+ - Always append to DAG Revisions