@playcraft/cli 0.1.33 → 0.1.35-prod

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 (346) hide show
  1. package/README.md +3 -56
  2. package/dist/agent/local-backend.js +1 -1
  3. package/dist/cli-root-help.js +0 -2
  4. package/dist/commands/build.js +4 -9
  5. package/dist/commands/create.js +33 -26
  6. package/dist/commands/image.js +6 -2
  7. package/dist/commands/login.js +42 -84
  8. package/dist/commands/skills.js +0 -2
  9. package/dist/commands/tools-3d.js +0 -11
  10. package/dist/commands/tools-generation.js +109 -68
  11. package/dist/commands/tools-image-context.js +23 -0
  12. package/dist/commands/tools.js +2 -2
  13. package/dist/config.js +4 -59
  14. package/dist/index.js +3 -36
  15. package/dist/remix/clone.js +0 -2
  16. package/dist/remix/init-template.js +0 -2
  17. package/dist/remix/pull.js +0 -2
  18. package/dist/remix/push.js +1 -21
  19. package/dist/utils/agent-api-client.js +30 -185
  20. package/dist/utils/image-asset-context.js +105 -0
  21. package/dist/utils/playcraft-http-client.js +4 -6
  22. package/package.json +5 -14
  23. package/project-template/.claude/agents/refs/ta-image-generation-detail.md +67 -123
  24. package/project-template/.claude/skills/playcraft-image-generation/SKILL.md +105 -44
  25. package/project-template/.claude/skills/playcraft-image-generation/reference/gen-batch-sprite.template.mjs +42 -33
  26. package/project-template/.claude/skills/playcraft-image-generation/reference/gen-batch.template.mjs +18 -20
  27. package/project-template/.claude/skills/playcraft-image-generation/reference/process-batch.template.mjs +6 -7
  28. package/project-template/.claude/skills/playcraft-image-generation/reference/prompt-cookbook.md +36 -39
  29. package/project-templates/phaser/.claude/agents/refs/ta-image-generation-detail.md +59 -59
  30. package/project-templates/phaser/.claude/skills/playcraft-image-generation/SKILL.md +105 -44
  31. package/project-templates/phaser/.claude/skills/playcraft-image-generation/reference/gen-batch-sprite.template.mjs +42 -33
  32. package/project-templates/phaser/.claude/skills/playcraft-image-generation/reference/gen-batch.template.mjs +18 -20
  33. package/project-templates/phaser/.claude/skills/playcraft-image-generation/reference/process-batch.template.mjs +6 -7
  34. package/project-templates/phaser/.claude/skills/playcraft-image-generation/reference/prompt-cookbook.md +36 -39
  35. package/project-templates/threejs/.claude/agents/refs/ta-image-generation-detail.md +59 -59
  36. package/project-templates/threejs/.claude/skills/playcraft-image-generation/SKILL.md +105 -44
  37. package/project-templates/threejs/.claude/skills/playcraft-image-generation/reference/gen-batch-sprite.template.mjs +42 -33
  38. package/project-templates/threejs/.claude/skills/playcraft-image-generation/reference/gen-batch.template.mjs +18 -20
  39. package/project-templates/threejs/.claude/skills/playcraft-image-generation/reference/process-batch.template.mjs +6 -7
  40. package/project-templates/threejs/.claude/skills/playcraft-image-generation/reference/prompt-cookbook.md +36 -39
  41. package/dist/auth/account-activation.js +0 -157
  42. package/dist/auth/messages.js +0 -30
  43. package/dist/commands/platform-skills.generated.js +0 -19
  44. package/dist/commands/playable.js +0 -53
  45. package/dist/commands/tools-batch.js +0 -87
  46. package/dist/commands/video.js +0 -111
  47. package/dist/commands/workspace-runtime.js +0 -54
  48. package/dist/commands/workspace.js +0 -35
  49. package/dist/project-skills/builtin-import.js +0 -225
  50. package/dist/project-skills/commands.js +0 -77
  51. package/dist/project-skills/lifecycle.js +0 -28
  52. package/dist/project-skills/local-run.js +0 -112
  53. package/dist/project-skills/local-store.js +0 -221
  54. package/dist/project-skills/messages.js +0 -80
  55. package/dist/project-skills/reconcile.js +0 -62
  56. package/dist/project-skills/remote-cache.js +0 -51
  57. package/dist/project-skills/validation.js +0 -19
  58. package/dist/recording/messages.js +0 -40
  59. package/dist/recording/project-digest.js +0 -85
  60. package/dist/recording/recorder.js +0 -293
  61. package/dist/recording/scenario.js +0 -50
  62. package/dist/utils/environment-endpoints.js +0 -17
  63. package/dist/utils/tool-operation-journal.js +0 -124
  64. package/dist/utils/video-evidence-git.js +0 -81
  65. package/dist/video-replication/client.js +0 -222
  66. package/dist/video-replication/comparison-evidence.js +0 -149
  67. package/dist/video-replication/comparison-files.js +0 -57
  68. package/dist/video-replication/comparison-log.js +0 -72
  69. package/dist/video-replication/comparison-messages.js +0 -104
  70. package/dist/video-replication/comparison-output.js +0 -63
  71. package/dist/video-replication/comparison-preflight.js +0 -66
  72. package/dist/video-replication/comparison.js +0 -216
  73. package/dist/video-replication/evidence.js +0 -165
  74. package/dist/video-replication/media.js +0 -111
  75. package/dist/video-replication/messages.js +0 -89
  76. package/dist/workspace/messages.js +0 -35
  77. package/dist/workspace/transfer-client.js +0 -174
  78. package/dist/workspace-runtime/codex/app-server.js +0 -965
  79. package/dist/workspace-runtime/codex/compact.js +0 -46
  80. package/dist/workspace-runtime/codex/config-toml.js +0 -107
  81. package/dist/workspace-runtime/codex/jsonrpc-stdio.js +0 -145
  82. package/dist/workspace-runtime/codex/launcher-client.js +0 -177
  83. package/dist/workspace-runtime/codex/loopback.js +0 -146
  84. package/dist/workspace-runtime/codex/mcp-config.js +0 -39
  85. package/dist/workspace-runtime/codex/model-broker.js +0 -263
  86. package/dist/workspace-runtime/codex/native-adapter.js +0 -9
  87. package/dist/workspace-runtime/codex/permissions.js +0 -70
  88. package/dist/workspace-runtime/codex/work-mode.js +0 -15
  89. package/dist/workspace-runtime/main.js +0 -10
  90. package/dist/workspace-runtime/persistence/journal.js +0 -355
  91. package/dist/workspace-runtime/persistence/native-subagents.js +0 -162
  92. package/dist/workspace-runtime/persistence/sqlite-client.js +0 -77
  93. package/dist/workspace-runtime/persistence/sqlite-worker.js +0 -1096
  94. package/dist/workspace-runtime/previews/output.js +0 -36
  95. package/dist/workspace-runtime/previews/publish.js +0 -262
  96. package/dist/workspace-runtime/previews/single-file.js +0 -43
  97. package/dist/workspace-runtime/processes/managed-writes.js +0 -69
  98. package/dist/workspace-runtime/production/contracts.js +0 -17
  99. package/dist/workspace-runtime/production/controller.js +0 -207
  100. package/dist/workspace-runtime/production/dependencies.js +0 -60
  101. package/dist/workspace-runtime/production/native.js +0 -203
  102. package/dist/workspace-runtime/production/processes.js +0 -86
  103. package/dist/workspace-runtime/production/save-command.js +0 -35
  104. package/dist/workspace-runtime/production/source-copy.js +0 -91
  105. package/dist/workspace-runtime/production/stages.js +0 -205
  106. package/dist/workspace-runtime/production/storage.js +0 -60
  107. package/dist/workspace-runtime/serve.js +0 -207
  108. package/dist/workspace-runtime/server/auth.js +0 -21
  109. package/dist/workspace-runtime/server/connectivity.js +0 -201
  110. package/dist/workspace-runtime/server/desktop-host.js +0 -429
  111. package/dist/workspace-runtime/server/desktop-preview-config.js +0 -81
  112. package/dist/workspace-runtime/server/desktop-preview-service.js +0 -157
  113. package/dist/workspace-runtime/server/desktop-preview-static.js +0 -53
  114. package/dist/workspace-runtime/server/desktop-preview.js +0 -189
  115. package/dist/workspace-runtime/server/dispatch.js +0 -1174
  116. package/dist/workspace-runtime/server/endpoints.js +0 -19
  117. package/dist/workspace-runtime/server/execution-group.js +0 -85
  118. package/dist/workspace-runtime/server/http.js +0 -1127
  119. package/dist/workspace-runtime/server/lock.js +0 -53
  120. package/dist/workspace-runtime/server/rfb-watch-gate.js +0 -168
  121. package/dist/workspace-runtime/server/terminal-host.js +0 -366
  122. package/dist/workspace-runtime/server/types.js +0 -1
  123. package/dist/workspace-runtime/server/workspace-transfer.js +0 -99
  124. package/dist/workspace-runtime/workspaces/archive.js +0 -207
  125. package/dist/workspace-runtime/workspaces/artifact-events.js +0 -55
  126. package/dist/workspace-runtime/workspaces/artifact-files.js +0 -197
  127. package/dist/workspace-runtime/workspaces/artifact-receipts.js +0 -89
  128. package/dist/workspace-runtime/workspaces/artifacts.js +0 -282
  129. package/dist/workspace-runtime/workspaces/attachment-content.js +0 -123
  130. package/dist/workspace-runtime/workspaces/attachments.js +0 -181
  131. package/dist/workspace-runtime/workspaces/batch-commit.js +0 -142
  132. package/dist/workspace-runtime/workspaces/cli-context.js +0 -23
  133. package/dist/workspace-runtime/workspaces/cli-credentials.js +0 -111
  134. package/dist/workspace-runtime/workspaces/composer-context.js +0 -125
  135. package/dist/workspace-runtime/workspaces/context-error.js +0 -2
  136. package/dist/workspace-runtime/workspaces/dependencies.js +0 -264
  137. package/dist/workspace-runtime/workspaces/developer-command.js +0 -64
  138. package/dist/workspace-runtime/workspaces/directories.js +0 -123
  139. package/dist/workspace-runtime/workspaces/directory-access.js +0 -37
  140. package/dist/workspace-runtime/workspaces/directory-attachments.js +0 -245
  141. package/dist/workspace-runtime/workspaces/directory-maintenance.js +0 -111
  142. package/dist/workspace-runtime/workspaces/directory-stats.js +0 -49
  143. package/dist/workspace-runtime/workspaces/disk-snapshot.js +0 -31
  144. package/dist/workspace-runtime/workspaces/empty-template.js +0 -40
  145. package/dist/workspace-runtime/workspaces/files-search.js +0 -116
  146. package/dist/workspace-runtime/workspaces/files.js +0 -120
  147. package/dist/workspace-runtime/workspaces/git-credential-broker.js +0 -312
  148. package/dist/workspace-runtime/workspaces/git-credential-helper.js +0 -68
  149. package/dist/workspace-runtime/workspaces/git-direct-store.js +0 -155
  150. package/dist/workspace-runtime/workspaces/git.js +0 -658
  151. package/dist/workspace-runtime/workspaces/instructions.js +0 -56
  152. package/dist/workspace-runtime/workspaces/json5-edit.js +0 -170
  153. package/dist/workspace-runtime/workspaces/library-attachments.js +0 -268
  154. package/dist/workspace-runtime/workspaces/parameters.js +0 -272
  155. package/dist/workspace-runtime/workspaces/prepare.js +0 -264
  156. package/dist/workspace-runtime/workspaces/registry.js +0 -236
  157. package/dist/workspace-runtime/workspaces/revisions.js +0 -31
  158. package/dist/workspace-runtime/workspaces/skill-artifact-loader.js +0 -91
  159. package/dist/workspace-runtime/workspaces/skills.js +0 -189
  160. package/dist/workspace-runtime/workspaces/transfer.js +0 -288
  161. package/dist/workspace-runtime/workspaces/turn-changes.js +0 -72
  162. package/dist/workspace-runtime/workspaces/video-attachments.js +0 -49
  163. package/project-template/.claude/skills/playcraft-replica-validation/SKILL.md +0 -25
  164. package/project-template/.claude/skills/playcraft-replica-validation/references/contracts.md +0 -79
  165. package/project-template/.claude/skills/playcraft-video-understanding/SKILL.md +0 -29
  166. package/project-template/.claude/skills/playcraft-video-understanding/references/contracts.md +0 -37
  167. package/project-template-v2/.claude/agents/artist.md +0 -82
  168. package/project-template-v2/.claude/agents/developer.md +0 -153
  169. package/project-template-v2/.claude/agents/game-designer.md +0 -264
  170. package/project-template-v2/.claude/agents/refs/artist-art-style-catalog.md +0 -533
  171. package/project-template-v2/.claude/agents/refs/artist-color-audio-recipes.md +0 -153
  172. package/project-template-v2/.claude/agents/refs/artist-dimension-axis.md +0 -27
  173. package/project-template-v2/.claude/agents/refs/artist-master-composite-recipes.md +0 -208
  174. package/project-template-v2/.claude/agents/refs/atom-skill-library.md +0 -81
  175. package/project-template-v2/.claude/agents/refs/developer-impl-cookbook.md +0 -432
  176. package/project-template-v2/.claude/agents/refs/framework-5-component-filter.md +0 -252
  177. package/project-template-v2/.claude/agents/refs/framework-game-feel-juice.md +0 -266
  178. package/project-template-v2/.claude/agents/refs/framework-mda.md +0 -147
  179. package/project-template-v2/.claude/agents/refs/game-designer-gameplay-sufficiency.md +0 -123
  180. package/project-template-v2/.claude/agents/refs/ta-3d-flip-recipe.md +0 -88
  181. package/project-template-v2/.claude/agents/refs/ta-atlas-deliverable-standard.md +0 -67
  182. package/project-template-v2/.claude/agents/refs/ta-batch-pipeline-recipes.md +0 -120
  183. package/project-template-v2/.claude/agents/refs/ta-image-generation-detail.md +0 -300
  184. package/project-template-v2/.claude/agents/refs/ta-image-ops-reference.md +0 -495
  185. package/project-template-v2/.claude/agents/refs/ta-pipeline-cookbook.md +0 -1141
  186. package/project-template-v2/.claude/agents/refs/ta-tools-reference.md +0 -111
  187. package/project-template-v2/.claude/agents/refs/ta-vfx-preset-catalog.md +0 -365
  188. package/project-template-v2/.claude/agents/refs/threejs-cannon-pitfalls.md +0 -412
  189. package/project-template-v2/.claude/agents/reviewer.md +0 -75
  190. package/project-template-v2/.claude/agents/technical-artist.md +0 -86
  191. package/project-template-v2/.claude/hooks/snapshot-milestone.mjs +0 -243
  192. package/project-template-v2/.claude/hooks/user-prompt.mjs +0 -133
  193. package/project-template-v2/.claude/settings.json +0 -33
  194. package/project-template-v2/.claude/skills/brainstorming/SKILL.md +0 -161
  195. package/project-template-v2/.claude/skills/brainstorming/scripts/frame-template.html +0 -270
  196. package/project-template-v2/.claude/skills/brainstorming/scripts/helper.js +0 -177
  197. package/project-template-v2/.claude/skills/brainstorming/scripts/server.cjs +0 -354
  198. package/project-template-v2/.claude/skills/brainstorming/scripts/start-server.sh +0 -148
  199. package/project-template-v2/.claude/skills/brainstorming/scripts/stop-server.sh +0 -56
  200. package/project-template-v2/.claude/skills/brainstorming/scripts/wait-for-selection.sh +0 -62
  201. package/project-template-v2/.claude/skills/brainstorming/spec-document-reviewer-prompt.md +0 -49
  202. package/project-template-v2/.claude/skills/brainstorming/visual-companion.md +0 -309
  203. package/project-template-v2/.claude/skills/playcraft-ad-psychology/SKILL.md +0 -182
  204. package/project-template-v2/.claude/skills/playcraft-art-style-guide/SKILL.md +0 -123
  205. package/project-template-v2/.claude/skills/playcraft-asset-state-sheet/SKILL.md +0 -205
  206. package/project-template-v2/.claude/skills/playcraft-audio-generation/SKILL.md +0 -280
  207. package/project-template-v2/.claude/skills/playcraft-batch-pipeline/SKILL.md +0 -184
  208. package/project-template-v2/.claude/skills/playcraft-build-optimizer/SKILL.md +0 -306
  209. package/project-template-v2/.claude/skills/playcraft-image-generation/SKILL.md +0 -298
  210. package/project-template-v2/.claude/skills/playcraft-image-generation/reference/build-sprite-sheet.template.mjs +0 -123
  211. package/project-template-v2/.claude/skills/playcraft-image-generation/reference/compare-style.template.mjs +0 -254
  212. package/project-template-v2/.claude/skills/playcraft-image-generation/reference/gen-batch-sprite.template.mjs +0 -324
  213. package/project-template-v2/.claude/skills/playcraft-image-generation/reference/gen-batch.template.mjs +0 -97
  214. package/project-template-v2/.claude/skills/playcraft-image-generation/reference/gen-edit-variants.template.mjs +0 -118
  215. package/project-template-v2/.claude/skills/playcraft-image-generation/reference/process-batch.template.mjs +0 -137
  216. package/project-template-v2/.claude/skills/playcraft-image-generation/reference/prompt-cookbook.md +0 -397
  217. package/project-template-v2/.claude/skills/playcraft-image-generation/reference/validate-sprite-sheet.template.mjs +0 -296
  218. package/project-template-v2/.claude/skills/playcraft-image-ops/SKILL.md +0 -122
  219. package/project-template-v2/.claude/skills/playcraft-image-processing/SKILL.md +0 -219
  220. package/project-template-v2/.claude/skills/playcraft-masking/SKILL.md +0 -373
  221. package/project-template-v2/.claude/skills/playcraft-playable-optimization/SKILL.md +0 -161
  222. package/project-template-v2/.claude/skills/playcraft-research/SKILL.md +0 -215
  223. package/project-template-v2/.claude/skills/playcraft-skill-recommender/SKILL.md +0 -382
  224. package/project-template-v2/.claude/skills/playcraft-sprite-generation/SKILL.md +0 -423
  225. package/project-template-v2/.claude/skills/playcraft-sprite-remix/SKILL.md +0 -158
  226. package/project-template-v2/.claude/skills/playcraft-sprite-sheet/SKILL.md +0 -100
  227. package/project-template-v2/.claude/skills/playcraft-storyboard/SKILL.md +0 -167
  228. package/project-template-v2/.claude/skills/playcraft-style-qa/SKILL.md +0 -270
  229. package/project-template-v2/.claude/skills/playcraft-text-rendering/SKILL.md +0 -236
  230. package/project-template-v2/.claude/skills/playcraft-vfx-animation/SKILL.md +0 -130
  231. package/project-template-v2/.claude/skills/playwright-cli/SKILL.md +0 -390
  232. package/project-template-v2/.claude/skills/playwright-cli/references/element-attributes.md +0 -23
  233. package/project-template-v2/.claude/skills/playwright-cli/references/playwright-tests.md +0 -39
  234. package/project-template-v2/.claude/skills/playwright-cli/references/request-mocking.md +0 -87
  235. package/project-template-v2/.claude/skills/playwright-cli/references/running-code.md +0 -240
  236. package/project-template-v2/.claude/skills/playwright-cli/references/session-management.md +0 -226
  237. package/project-template-v2/.claude/skills/playwright-cli/references/spec-driven-testing.md +0 -308
  238. package/project-template-v2/.claude/skills/playwright-cli/references/storage-state.md +0 -275
  239. package/project-template-v2/.claude/skills/playwright-cli/references/test-generation.md +0 -134
  240. package/project-template-v2/.claude/skills/playwright-cli/references/tracing.md +0 -142
  241. package/project-template-v2/.claude/skills/playwright-cli/references/video-recording.md +0 -153
  242. package/project-template-v2/.claude/skills/session-analyzer/SKILL.md +0 -386
  243. package/project-template-v2/.claude/skills/session-analyzer/scripts/execution-breakdown.mjs +0 -182
  244. package/project-template-v2/.claude/skills/session-analyzer/scripts/find-turns.mjs +0 -72
  245. package/project-template-v2/.claude/skills/session-analyzer/scripts/heavy-output.mjs +0 -121
  246. package/project-template-v2/.claude/skills/session-analyzer/scripts/resolve-session.mjs +0 -102
  247. package/project-template-v2/.claude/skills/session-analyzer/scripts/subagent-stats.mjs +0 -127
  248. package/project-template-v2/.claude/skills/session-analyzer/scripts/subagent-tool-timeline.mjs +0 -106
  249. package/project-template-v2/.claude/skills/session-analyzer/scripts/time-gaps.mjs +0 -128
  250. package/project-template-v2/.claude/skills/session-analyzer/scripts/turn-timeline.mjs +0 -67
  251. package/project-template-v2/.claude/snapshot.mjs +0 -263
  252. package/project-template-v2/.playcraft/skills.lock.json +0 -152
  253. package/project-template-v2/CLAUDE.md +0 -146
  254. package/project-template-v2/assets/audio/bgm/.gitkeep +0 -0
  255. package/project-template-v2/assets/audio/sfx/.gitkeep +0 -0
  256. package/project-template-v2/assets/bundles/.gitkeep +0 -0
  257. package/project-template-v2/assets/images/bg/.gitkeep +0 -0
  258. package/project-template-v2/assets/images/reference/.gitkeep +0 -0
  259. package/project-template-v2/assets/images/storyboard/.gitkeep +0 -0
  260. package/project-template-v2/assets/images/tiles/.gitkeep +0 -0
  261. package/project-template-v2/assets/images/ui/.gitkeep +0 -0
  262. package/project-template-v2/assets/images/vfx/.gitkeep +0 -0
  263. package/project-template-v2/assets/models/.gitkeep +0 -0
  264. package/project-template-v2/docs/harness/iteration-1/context-flow.md +0 -254
  265. package/project-template-v2/docs/harness/iteration-1/generate-flow.md +0 -91
  266. package/project-template-v2/docs/harness/iteration-1/ideate-flow.md +0 -214
  267. package/project-template-v2/docs/harness/iteration-1/optimize-flow.md +0 -75
  268. package/project-template-v2/docs/harness/iteration-1/wrapup-flow.md +0 -63
  269. package/project-template-v2/docs/harness/iteration-2/context-flow.md +0 -223
  270. package/project-template-v2/docs/harness/iteration-2/generate-flow.md +0 -129
  271. package/project-template-v2/docs/harness/iteration-2/ideate-flow.md +0 -267
  272. package/project-template-v2/docs/harness/iteration-2/optimize-flow.md +0 -164
  273. package/project-template-v2/docs/harness/iteration-2/wrapup-flow.md +0 -115
  274. package/project-template-v2/docs/harness/orchestrator-flow.md +0 -364
  275. package/project-template-v2/docs/project-state.json +0 -60
  276. package/project-template-v2/docs/project-state.md +0 -72
  277. package/project-template-v2/docs/standards/README.md +0 -225
  278. package/project-template-v2/docs/standards/agent-behavior-standards.md +0 -174
  279. package/project-template-v2/docs/standards/artifacts/design-brief.md +0 -19
  280. package/project-template-v2/docs/standards/artifacts/design.md +0 -22
  281. package/project-template-v2/docs/standards/artifacts/game-code.md +0 -41
  282. package/project-template-v2/docs/standards/artifacts/todo-list.md +0 -41
  283. package/project-template-v2/docs/standards/iter1-agent-behavior-standards.md +0 -343
  284. package/project-template-v2/game/index.ts +0 -18
  285. package/project-template-v2/globals.d.ts +0 -51
  286. package/project-template-v2/index.css +0 -34
  287. package/project-template-v2/index.html +0 -18
  288. package/project-template-v2/main.ts +0 -9
  289. package/project-template-v2/package.json +0 -46
  290. package/project-template-v2/skills/_shared/scripts/dispatch-clear.mjs +0 -31
  291. package/project-template-v2/skills/_shared/scripts/dispatch-set.mjs +0 -86
  292. package/project-template-v2/skills/_shared/scripts/dod-check.mjs +0 -153
  293. package/project-template-v2/skills/_shared/scripts/handoff-append.mjs +0 -70
  294. package/project-template-v2/skills/_shared/scripts/lib/validator-artifacts.mjs +0 -91
  295. package/project-template-v2/skills/_shared/scripts/pipeline/dod-config.mjs +0 -131
  296. package/project-template-v2/skills/_shared/scripts/pipeline/index.mjs +0 -80
  297. package/project-template-v2/skills/_shared/scripts/pipeline/iteration-1-core.mjs +0 -90
  298. package/project-template-v2/skills/_shared/scripts/pipeline/iteration-2-wrap.mjs +0 -93
  299. package/project-template-v2/skills/_shared/scripts/pipeline/iteration-3-visual.mjs +0 -23
  300. package/project-template-v2/skills/_shared/scripts/render-project-state.mjs +0 -230
  301. package/project-template-v2/skills/_shared/scripts/state-advance-stage.mjs +0 -58
  302. package/project-template-v2/skills/_shared/scripts/state-get.mjs +0 -339
  303. package/project-template-v2/skills/_shared/scripts/state-handoff.mjs +0 -39
  304. package/project-template-v2/skills/_shared/scripts/state-set.mjs +0 -94
  305. package/project-template-v2/skills/_shared/scripts/state-store.mjs +0 -783
  306. package/project-template-v2/skills/_shared/scripts/todo-add.mjs +0 -88
  307. package/project-template-v2/skills/_shared/scripts/todo-get.mjs +0 -130
  308. package/project-template-v2/skills/_shared/scripts/todo-remove.mjs +0 -33
  309. package/project-template-v2/skills/_shared/scripts/todo-set.mjs +0 -47
  310. package/project-template-v2/skills/_shared/scripts/verify-asset-code-sync.mjs +0 -268
  311. package/project-template-v2/skills/_shared/scripts/verify-env.mjs +0 -285
  312. package/project-template-v2/skills/_shared/scripts/verify-placeholders.mjs +0 -161
  313. package/project-template-v2/skills/playable-autoplay/SKILL.md +0 -176
  314. package/project-template-v2/skills/playable-autoplay/agents/openai.yaml +0 -4
  315. package/project-template-v2/skills/playable-debug/SKILL.md +0 -116
  316. package/project-template-v2/skills/playable-debug/agents/openai.yaml +0 -4
  317. package/project-template-v2/skills/playable-debug/references/debug-config.md +0 -40
  318. package/project-template-v2/skills/playable-record/SKILL.md +0 -140
  319. package/project-template-v2/skills/playable-record/scripts/lib/dev-server.mjs +0 -104
  320. package/project-template-v2/skills/playable-record/scripts/lib/record-audio-bridge.js +0 -141
  321. package/project-template-v2/skills/playable-record/scripts/record-playable.mjs +0 -425
  322. package/project-template-v2/skills/playable-record/scripts/verify-contract.mjs +0 -261
  323. package/project-template-v2/skills/playable-record/scripts/verify-firstwin.mjs +0 -398
  324. package/project-template-v2/skills/playable-record/scripts/verify-fusion.mjs +0 -322
  325. package/project-template-v2/skills/playable-record/scripts/verify-lifecycle.mjs +0 -105
  326. package/project-template-v2/skills/playable-record/scripts/verify-vlm-video.mjs +0 -230
  327. package/project-template-v2/skills/playable-validate/SKILL.md +0 -61
  328. package/project-template-v2/skills/playable-validate/validation-rules.md +0 -14
  329. package/project-template-v2/skills/playable-verify-ui/SKILL.md +0 -63
  330. package/project-template-v2/skills/playable-verify-ui/scripts/lib/__init__.py +0 -1
  331. package/project-template-v2/skills/playable-verify-ui/scripts/lib/config_expr.js +0 -218
  332. package/project-template-v2/skills/playable-verify-ui/scripts/lib/node_utils.js +0 -51
  333. package/project-template-v2/skills/playable-verify-ui/scripts/lib/profile_loader.py +0 -59
  334. package/project-template-v2/skills/playable-verify-ui/scripts/lib/report.py +0 -106
  335. package/project-template-v2/skills/playable-verify-ui/scripts/lib/runtime_contract.js +0 -116
  336. package/project-template-v2/skills/playable-verify-ui/scripts/verify_fetch_antipatterns.py +0 -59
  337. package/project-template-v2/skills/playable-verify-ui/scripts/verify_hardcoded_layout.js +0 -64
  338. package/project-template-v2/skills/playable-verify-ui/scripts/verify_runtime_contract.js +0 -58
  339. package/project-template-v2/skills/playable-verify-ui/scripts/verify_text_overlap.py +0 -333
  340. package/project-template-v2/ta-workspace/scripts/.gitkeep +0 -0
  341. package/project-template-v2/tsconfig.json +0 -20
  342. package/project-template-v2/vite.config.ts +0 -27
  343. package/project-templates/batch-locks/phaser.yaml +0 -922
  344. package/project-templates/batch-locks/threejs.yaml +0 -978
  345. package/project-templates/empty/AGENTS.md +0 -39
  346. package/project-templates/empty/gitignore +0 -33
@@ -1,24 +1,25 @@
1
- # TA 图片生成进阶参考
1
+ # TA (Technical Artist, 技术美术师) 图片生成进阶参考
2
2
 
3
3
  > 本文件供 TA/Designer 在需要精灵图直出、Edit 模型变体、错误恢复等进阶场景时按需查阅。核心决策逻辑见 `playcraft-image-generation` skill。
4
4
 
5
5
  ---
6
6
 
7
- ## 1. gpt-image-2 精灵图直出 + 批量出图策略
7
+ ## 1. 精灵图直出 + 批量出图策略
8
8
 
9
9
  ### 策略一:直接生成整张精灵图(最高效)
10
10
 
11
- **gpt-image-2 可以一次 API 调用就生成一张包含多个元素的网格图**,后续用 `sprite-split` 切分。避免逐个生成的低效循环。
11
+ **一次 API (Application Programming Interface, 应用程序编程接口) 调用生成包含多个元素的网格图**,后续用 `sprite-split` 切分。使用主文选定的模型,不因批量生成自动改用旧模型。
12
12
 
13
- > gpt-image-2 本身就慢(单图 7-8 分钟正常,精灵图 90-150 秒正常)。**调用 gpt-image-2 时不要设 `--timeout`**,让它自然完成。"慢"不是卡死,不要中途 Ctrl+C 换模型。真正的失败是 `API 500` 或 `fetch failed`,那才需要切换 provider。
13
+ > 保留命令行默认等待时间。等待本身不表示请求失败;本地超时也不表示后端已停止,确认原请求状态后再决定下一步,避免重复计费。
14
14
 
15
15
  #### 先判断:元素需要透明背景吗?
16
16
 
17
17
  ```
18
18
  需要透明背景(独立元素:角色、车、道具、图标)?
19
- ├─ YES → 绿幕策略:prompt 所有格子加 "solid bright green #00FF00 background"
20
- │ 切分后对每帧跑 remove-background --tolerance 25
21
- └─ NO → 白底策略:prompt 加 "white background"(卡牌/棋盘/UI 面板适用)
19
+ ├─ 常规透明交付 → --remove-background;按主文第 2 节准备源图背景
20
+ │ 切分后保留透明通道,不重复去背
21
+ ├─ 不透明牌面/场景 → --no-remove-background;白色牌面属于主体
22
+ └─ 明确选择独立色幕 → 仅限主文第 3 节;关闭整板自动去背,切分后逐格去背
22
23
  ```
23
24
 
24
25
  #### 白底示例(卡牌,不需要去背景)
@@ -28,8 +29,8 @@ playcraft tools generate-image \
28
29
  --prompt "Sprite sheet grid, 4 columns × 2 rows. Each cell: one playing card face, flat 2D, white card face, uniform size. Row 1: Ace of Spades, 2 of Spades, 3 of Spades, 4 of Spades. Row 2: 5 of Spades, 6 of Spades, 7 of Spades, 8 of Spades. Grid layout, equal cell size, no border between cells." \
29
30
  --output assets/gen/cards_sheet.png \
30
31
  --aspect-ratio 3:2 \
31
- --image-model iegg-litellm/gpt-image-2
32
- # gpt-image-2 不设 --timeout,精灵图 90-150s 正常,等待即可
32
+ --image-model iegg-litellm/gpt-image-2.5-sunburst \
33
+ --no-remove-background
33
34
 
34
35
  # 查尺寸再切分(frame-width=总宽/列数, frame-height=总高/行数)
35
36
  playcraft image info --input assets/gen/cards_sheet.png
@@ -40,36 +41,51 @@ playcraft image sprite-split \
40
41
  --frame-width <总宽/4> --frame-height <总高/2>
41
42
  ```
42
43
 
43
- #### 绿幕示例(独立元素,需要透明背景)
44
+ #### 自动透明示例(独立元素)
44
45
 
45
46
  ```bash
46
- # Step 1:生成绿幕精灵图
47
+ # Step 1:Image 2.5 由后端组装源图背景并验收透明交付
47
48
  playcraft tools generate-image \
48
- --prompt "Sprite sheet grid, 3 columns × 1 row. Each cell: one car, flat 2D vector, bold outline, centered, isolated on solid bright green #00FF00 background. [Row1,Col1]: red sports car front view; [Row1,Col2]: blue SUV front view; [Row1,Col3]: yellow taxi front view. Grid layout, equal cell size, no border between cells." \
49
+ --prompt "Sprite sheet grid, 3 columns × 1 row. Each cell: one car, flat 2D vector, bold outline, centered, isolated subject. [Row1,Col1]: red sports car front view; [Row1,Col2]: blue SUV front view; [Row1,Col3]: yellow taxi front view. Grid layout, equal cell size, no border between cells." \
49
50
  --output assets/gen/cars_sheet.png \
50
51
  --aspect-ratio 3:2 \
51
- --image-model iegg-litellm/gpt-image-2
52
- # gpt-image-2 不设 --timeout,精灵图 90-150s 正常,等待即可
52
+ --image-model iegg-litellm/gpt-image-2.5-sunburst \
53
+ --remove-background
53
54
 
54
55
  # Step 2:切分
55
56
  playcraft image info --input assets/gen/cars_sheet.png
56
57
  playcraft image sprite-split \
57
58
  --input assets/gen/cars_sheet.png \
58
- --output-dir assets/gen/cars-split/ \
59
+ --output-dir assets/images/cars/ \
59
60
  --rows 1 --columns 3 \
60
61
  --frame-width <总宽/3> --frame-height <总高>
61
62
 
62
- # Step 3:逐帧去背景(绿幕用 tolerance 25)
63
- for f in assets/gen/cars-split/frame_*.png; do
64
- name=$(basename "$f")
65
- playcraft image remove-background \
66
- --input "$f" \
67
- --output "assets/images/cars/$name" \
68
- --tolerance 25
69
- done
63
+ # Step 3:验证每格主体完整及深浅背景上的透明边缘,不重复去背
64
+ ```
65
+
66
+ 明确选用其他模型时,同样传 `--remove-background`,但首次 prompt 需追加单一 `on a uniform solid pure white background for subsequent background removal`;后端不会像 Image 2.5 那样自动补源图背景。
67
+
68
+ #### 独立色幕示例(仅限明确选择的制作流程)
69
+
70
+ 先按主文第 3 节选与主体不冲突的色幕。参考图和交付规格来自目标字段时先读取,再显式传给中间图请求,省略 `--target-asset`,避免字段透明要求覆盖保留色幕的开关。
71
+
72
+ ```bash
73
+ # 已明确锁定不支持原生透明的模型与品红色幕;常规流程不使用此分支
74
+ playcraft tools generate-image \
75
+ --prompt "Sprite sheet grid, 3 columns × 1 row. [Row1,Col1]: red sports car; [Row1,Col2]: blue SUV; [Row1,Col3]: yellow taxi. Each car isolated, centered on a uniform solid #FF00FF background, equal cell size, no borders, no shadows." \
76
+ --output assets/gen/cars_chroma.png \
77
+ --aspect-ratio 3:2 \
78
+ --image-model mulerouter/gpt-image-2 \
79
+ --no-remove-background
80
+
81
+ # 读取实际尺寸并 sprite-split 后,逐格去背;品红使用 tolerance 20
82
+ playcraft image remove-background \
83
+ --input assets/gen/cars-split/frame_r0_c0.png \
84
+ --output assets/images/cars/red_car.png \
85
+ --tolerance 20
70
86
  ```
71
87
 
72
- **Provider 选择**:iegg-litellm/gpt-image-2 质量最高;google/gemini-3.1-flash-image-preview 最稳定且参考图正常工作。
88
+ 其他格同样处理,并分别验收。自动透明图使用 `backgroundMode='automatic'`;独立色幕脚本设 `backgroundMode='chroma'`、`chromaColor` 和 `chromaTolerance`,不要把两种流程混用。
73
89
 
74
90
  **Prompt 关键词**:`sprite sheet grid, N columns × M rows, grid layout, equal cell size, uniform size`
75
91
 
@@ -173,34 +189,16 @@ node ta-workspace/scripts/gen-<name>-variants.mjs
173
189
 
174
190
  ## 3. 错误恢复策略
175
191
 
176
- > **gpt-image-2 超时规则(最重要)**:gpt-image-2 慢是设计如此,不是故障。单图 7-8 分钟、精灵图 90-150 秒均属正常范围。**调用 gpt-image-2 时永远不要设 `--timeout`**,也不要因为"等了很久"就 Ctrl+C 中断。只有收到 `API 500` 或 `fetch failed` 才切换 provider。
177
-
178
- | 错误现象 | 模型 | 原因 | 立即行动 |
179
- | ---------------------- | ------------------------------------------- | --------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- |
180
- | `API 500` | 任意 | 该 provider 节点不可用 | **立即换同模型的另一个 provider**(如 `iegg-litellm/gpt-image-2` → `mulerouter/gpt-image-2` → `302/gpt-image-2`) |
181
- | `fetch failed` | 任意 | provider 网络不通 | 换另一个 provider |
182
- | 等待 7-8 分钟还未返回 | **gpt-image-2** | 正常现象,模型本身就慢 | **继续等待,不要中断**;若超过 15 分钟仍无响应则换同模型另一 provider |
183
- | 等待 >120s 无响应 | **非 gpt-image-2**(gemini/nano-banana 等) | 请求卡死 | Ctrl+C 中止,换另一个 provider 或换模型;可加 `--timeout 60` 防止下次卡住 |
184
- | 精灵图等待 90-150s | **gpt-image-2** | 正常现象 | 继续等待;**不要设 `--timeout`** |
185
- | `--count N` 触发限流 | 任意 | 并发提交多任务超过 provider 限制 | 降低 count 或改用精灵图直出策略 |
186
- | `reference-image` 报错 | 任意 | 模型 CAPABILITY 为 `text→image`,不支持参考图 | 换 CAPABILITY 为 `text+image` 或 `image→image` 的模型 |
187
- | 风格偏差大 | 任意 | Prompt 不够具体 | 参考 prompt-cookbook.md 对应素材类型模板 |
188
- | 质量不达标 | 非 gpt-image-2 | 模型能力不够 | 换 gpt-image-2(最高质量)+ 参考 prompt-cookbook 质量修饰词 |
189
-
190
- ### 模型回退顺序
192
+ 后端统一限制模型、供应商与重生成的总尝试次数;命令行默认不额外重试。普通素材默认模型选择、原生透明优先与剩余一次干净底图重生成均以主文第 2 节为准,脚本不再叠加模型回退链。
191
193
 
192
- ```
193
- gpt-image-2(最高质量,三个 provider 互为回退):
194
- 1. iegg-litellm/gpt-image-2
195
- 2. mulerouter/gpt-image-2
196
- 3. 302/gpt-image-2
197
-
198
- 稳定回退(非 gpt-image-2):
199
- 4. google/gemini-3.1-flash-image-preview
200
- 5. mulerouter/nano-banana-2
201
- ```
202
-
203
- **同一个 provider 最多重试 1 次**,失败立即切换到同模型的另一个 provider,不要等待。
194
+ | 错误现象 | 立即行动 |
195
+ | ---------------------- | ----------------------------------------------------------------------------------------------- |
196
+ | 仍在等待 / 本地超时 | 确认原请求状态,等待或核实后端已结束;不要并发重发,也不要仅因等待改模型。 |
197
+ | 上游错误 / 网络失败 | 记录请求编号、实际 provider/model 与尝试次数,报告后端诊断;用户或流程锁定的模型不静默更换。 |
198
+ | 透明源图或最终验收失败 | 报告失败阶段并停止;不把棋盘格、补边或未完成的去背当成功,不自行改用色幕。 |
199
+ | 去背处理失败 | 报告处理错误并停止,不重复生图或降低最终透明要求。 |
200
+ | 参考图 / 交付参数错误 | 修正路径或参数后再发送;保留用户及字段约束,不丢弃参考图继续生成。 |
201
+ | 风格或内容偏差 | 参考 prompt-cookbook 的主体模板,检查实际模型、参考图与交付规格;新一轮生成仍保留最终背景要求。 |
204
202
 
205
203
  ---
206
204
 
@@ -208,7 +206,7 @@ gpt-image-2(最高质量,三个 provider 互为回退):
208
206
 
209
207
  ### 首选策略:精灵图直出(见第 1 节)
210
208
 
211
- **优先让 gpt-image-2 直接生成包含多个元素的网格图**,然后用 `sprite-split` 切分。这是最高效的做法,避免逐个 API 调用。只有在以下情况才退化为逐个调用:
209
+ **优先用本次选定的模型生成包含多个元素的网格图**,然后用 `sprite-split` 切分,避免逐个 API 调用。只有在以下情况才退化为逐个调用:
212
210
 
213
211
  - 需要 reference-image 一致性(网格 prompt 不稳定)
214
212
  - 每个元素差异太大,一张图放不下
@@ -239,6 +237,8 @@ cp .claude/skills/playcraft-image-generation/reference/process-batch.template.mj
239
237
  node ta-workspace/scripts/process-<name>.mjs
240
238
  ```
241
239
 
240
+ 已由生成工具验证透明的图使用 `skipRemoveBg=true`,保留透明边缘;不透明牌面/场景同样跳过去背。只有独立色幕中间图才设为 `false`,按所选色幕设置容差。
241
+
242
242
  ### 合并精灵图
243
243
 
244
244
  参见 [build-sprite-sheet.template.mjs](../../skills/playcraft-image-generation/reference/build-sprite-sheet.template.mjs)。
@@ -277,13 +277,13 @@ ta-workspace/
277
277
 
278
278
  ### 脚本模板目录
279
279
 
280
- | 模板 | 用途 | 关键 CONFIG |
281
- | -------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------- | --------------------------------------------- |
282
- | [gen-batch-sprite.template.mjs](../../skills/playcraft-image-generation/reference/gen-batch-sprite.template.mjs) | 精灵图直出(gpt-image-2 网格图 → sprite-split) | `columns`, `rows`, `BATCHES[]` |
283
- | [gen-batch.template.mjs](../../skills/playcraft-image-generation/reference/gen-batch.template.mjs) | 批量从零 AI 生图(reference-image 模式) | `model`, `referenceImage`, `style`, `ITEMS[]` |
284
- | [gen-edit-variants.template.mjs](../../skills/playcraft-image-generation/reference/gen-edit-variants.template.mjs) | 基图 + edit 模型生成变体 | `baseImage`, `editModel`, `VARIANTS[]` |
285
- | [process-batch.template.mjs](../../skills/playcraft-image-generation/reference/process-batch.template.mjs) | 批量去背景 / trim + resize | `inputDir`, `outputDir`, `skipRemoveBg` |
286
- | [build-sprite-sheet.template.mjs](../../skills/playcraft-image-generation/reference/build-sprite-sheet.template.mjs) | 精灵图合并 + JSON 验证 | `processedDir`, `columns`, `ORDERED_NAMES[]` |
280
+ | 模板 | 用途 | 关键 CONFIG |
281
+ | -------------------------------------------------------------------------------------------------------------------- | --------------------------------------------- | ------------------------------------------------------------- |
282
+ | [gen-batch-sprite.template.mjs](../../skills/playcraft-image-generation/reference/gen-batch-sprite.template.mjs) | 精灵图直出,自动透明或独立色幕 → sprite-split | `model`, `removeBg`, `backgroundMode`, `columns`, `BATCHES[]` |
283
+ | [gen-batch.template.mjs](../../skills/playcraft-image-generation/reference/gen-batch.template.mjs) | 批量从零 AI 生图(reference-image 模式) | `model`, `referenceImage`, `style`, `ITEMS[]` |
284
+ | [gen-edit-variants.template.mjs](../../skills/playcraft-image-generation/reference/gen-edit-variants.template.mjs) | 基图 + edit 模型生成变体 | `baseImage`, `editModel`, `VARIANTS[]` |
285
+ | [process-batch.template.mjs](../../skills/playcraft-image-generation/reference/process-batch.template.mjs) | 批量去背景 / trim + resize | `inputDir`, `outputDir`, `skipRemoveBg` |
286
+ | [build-sprite-sheet.template.mjs](../../skills/playcraft-image-generation/reference/build-sprite-sheet.template.mjs) | 精灵图合并 + JSON 验证 | `processedDir`, `columns`, `ORDERED_NAMES[]` |
287
287
 
288
288
  每个模板均包含:CONFIG/DATA/LOGIC 三段式结构、`existsSync` 幂等跳过、`appendFileSync` 日志、try/catch 错误统计。
289
289
 
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: playcraft-image-generation
3
- description: PlayCraft AI 图片生成核心决策指南。涵盖模型选择决策树、核心命令模板、背景处理决策树(绿幕策略)、脚本决策规则。精灵图直出/Edit 模型/错误恢复/批量实践等进阶内容见 refs/ta-image-generation-detail.md。
3
+ description: PlayCraft AI (Artificial Intelligence, 人工智能) 图片生成与素材替换指南。默认使用可用的 Image 2.5;替换素材时读取参考图,全新素材可无参考文生图;验证背景要求、目标尺寸和最终文件。
4
4
  triggers: 生成图片,generate image,选模型,model selection,reference image,参考图,风格一致,图生图,文生图,AI生图,图片质量,模型选择,500错误,模型失败,generate-image,list-image-models,ta-workspace,batch,批量,脚本,nodejs,edit模型,变体,绿幕,去背景,透明PNG,prompt,提示词,prompt套路,提示词技巧
5
5
  ---
6
6
 
@@ -8,7 +8,13 @@ triggers: 生成图片,generate image,选模型,model selection,reference image,
8
8
 
9
9
  ## 0. 开始前必读
10
10
 
11
- 生图前**必须先运行模型发现命令**:
11
+ 替换现有素材时先读取目标字段的 schema 配置(resolution、ratio、prompt、remove_background、reference_image)及当前素材。全新素材按用户需求确定尺寸、格式和输出路径,不假定所有素材都是透明 PNG (Portable Network Graphics, 便携式网络图形)。
12
+
13
+ 项目没有素材 schema 时,从目标素材的尺寸、格式和用户需求确定交付规格;参考图只提供内容和风格,不改变目标画布。不要套用其他游戏的字段、路径或尺寸。
14
+
15
+ 替换现有素材时传 `targetAssetPath`(命令行为 `--target-asset`):工具在生成前自动读取字段的 reference_image、当前素材、尺寸、格式、fit_mode、remove_background 与 padding_color。字段没有参考图时使用当前素材;读取失败立即停止,不丢弃参考图后继续生成。显式 referenceImagePath / --reference-image 可以覆盖默认参考图;用户明确要求无参考生成时才设 useTargetReference=false / --no-target-reference,交付约束仍保留。查看图片或在对话中选中素材不等于传入参考图。仅调整风格时保留原有文字、构图和用途;用户要求重新命名或重做构图时再改变。
16
+
17
+ 生图前运行模型发现命令,核实当前账号可用的模型与透明输出能力:
12
18
 
13
19
  ```bash
14
20
  playcraft tools list-image-models
@@ -18,7 +24,8 @@ playcraft tools list-image-models
18
24
 
19
25
  ```
20
26
  MODEL CAPABILITY ALPHA PROVIDERS
21
- gpt-image-2 text+image no 3 (iegg-litellm, mulerouter, 302)
27
+ gpt-image-2.5-sunburst text+image yes iegg-litellm
28
+ gpt-image-2.5-flare text+image yes iegg-litellm
22
29
  gemini-3.1-flash-image-preview text+image no 2 (google, iegg-litellm)
23
30
  hy-image-v3.0 text+image no 1 (tencent-cloud)
24
31
  flux-kontext-pro text+image no 1 (302)
@@ -29,7 +36,7 @@ qwen-image-edit-max image→image no 1 (mulerouter
29
36
  **列说明**:
30
37
 
31
38
  - `CAPABILITY`:`text→image` 仅文生图 / `image→image` 仅图生图 / `text+image` 两者均支持
32
- - `ALPHA`:`yes` = 原生透明 PNG;`no` = 需使用绿幕策略(见第 3 节)
39
+ - `ALPHA`:`yes` = 支持原生透明输出;`no` = 透明素材才需要另行去背(见第 3 节)
33
40
  - `PROVIDERS`:支持该模型的 provider 数量,多个 provider 时后端按优先级自动 fallback(顺序尝试,首个成功即返回)
34
41
 
35
42
  **Prompt 套路速查**:[reference/prompt-cookbook.md](reference/prompt-cookbook.md)
@@ -40,8 +47,11 @@ qwen-image-edit-max image→image no 1 (mulerouter
40
47
 
41
48
  ```
42
49
  需要生图?
43
- ├─ 追求最高质量(概念图、精品单图)?
44
- │ └─ gpt-image-2(3 个 provider 自动 fallback:iegg-litellm → mulerouter → 302)
50
+ ├─ 用户指定了模型,或制作流程已锁定模型?
51
+ │ └─ 使用指定模型;失败时报告原因,不静默更换
52
+ │
53
+ ├─ 普通图片生成 / 现有素材替换 / 含文字 Logo?
54
+ │ └─ 优先 iegg-litellm/gpt-image-2.5-sunburst;不可用时选择清单中的 Image 2.5 并报告实际模型
45
55
  │
46
56
  ├─ 需要 --reference-image(风格一致性批量生产)?
47
57
  │ └─ 必须选 CAPABILITY = text+image 或 image→image 的模型
@@ -53,29 +63,30 @@ qwen-image-edit-max image→image no 1 (mulerouter
53
63
  │ └─ Edit 模型工作流(见进阶参考)
54
64
  │
55
65
  └─ 不确定?
56
- └─ 先试 gpt-image-2,失败换 gemini-3.1-flash-image-preview
66
+ └─ 使用平台默认模型;透明素材优先清单中 ALPHA=yes 的模型
57
67
  ```
58
68
 
59
69
  ### 主要模型特性
60
70
 
61
- | 模型 | 特点与优势 | 最佳场景 | 速度 | 注意事项 |
62
- | ---------------------------------- | ------------------------------------------------------------------------------------------- | ----------------------------------------------- | ------------------------------- | --------------------------------------------------------------- |
63
- | **gpt-image-2** | 细节最丰富、光影最真实、网格/布局理解力最强、中文字符准确率最高、3 provider fallback 容错高 | 概念图、精灵图直出、含文字素材、写实/半写实风格 | 慢(7-8min/张),**不设 timeout** | 慢是正常的;只有 `API 500` / `fetch failed` 才切换下一 provider |
64
- | **gemini-3.1-flash-image-preview** | 速度快、色彩鲜艳、构图清晰、最稳定不易报错、reference-image 理解好 | 快速迭代、扁平卡通、明亮休闲风、超时回退 | 快(<30s) | 精细细节和文字不如 gpt-image-2 |
65
- | **hy-image-v3.0** | 亚洲审美偏向、角色设计好、Q版/IP风格擅长 | 中国风、Q版角色、IP 形象 | 中等 | 西方写实风格表现一般 |
66
- | **flux-kontext-pro** | 艺术感强、风格独特、手绘质感好 | 艺术插画、手绘风、独特画风探索 | 中等 | 网格理解弱,不适合精灵图 |
67
- | **nano-banana-2** | 最快、适合简单图形探索 | 简洁图标、平面设计、快速草稿 | 极快 | 中文字符不可靠、细节少 |
68
- | **qwen-image-edit-max** | 图生图编辑能力强、局部修改精确 | 换花色/换数字/换颜色等结构相似变体 | 中等 | CAPABILITY=image→image,必须传 reference-image |
69
- | **wan2.6-image** | 风格迁移能力好 | 将参考图风格应用到新内容 | 中等 | CAPABILITY=image→image,必须传 reference-image |
71
+ | 模型 | 特点与优势 | 最佳场景 | 速度 | 注意事项 |
72
+ | ---------------------------------- | ------------------------------------------------------------------ | ---------------------------------------- | -------------- | ----------------------------------------------------------------- |
73
+ | **gpt-image-2.5-sunburst / flare** | 当前普通生图与素材替换的优先模型,支持参考图及原生透明输出 | Logo、角色、图标、透明素材替换 | 以实际调用为准 | 使用模型清单中的 provider/model;检查返回的实际模型和透明验证结果 |
74
+ | **gpt-image-2** | 兼容已有项目和明确指定 provider 的制作流程 | 已锁定模型的概念图、故事板、精灵图 | 以实际调用为准 | 普通素材默认优先 Image 2.5;能力和可用 provider 以模型清单为准 |
75
+ | **gemini-3.1-flash-image-preview** | 速度快、色彩鲜艳、构图清晰、最稳定不易报错、reference-image 理解好 | 快速迭代、扁平卡通、明亮休闲风、超时回退 | 快(<30s) | 精细细节和文字不如 gpt-image-2 |
76
+ | **hy-image-v3.0** | 亚洲审美偏向、角色设计好、Q版/IP风格擅长 | 中国风、Q版角色、IP 形象 | 中等 | 西方写实风格表现一般 |
77
+ | **flux-kontext-pro** | 艺术感强、风格独特、手绘质感好 | 艺术插画、手绘风、独特画风探索 | 中等 | 网格理解弱,不适合精灵图 |
78
+ | **nano-banana-2** | 最快、适合简单图形探索 | 简洁图标、平面设计、快速草稿 | 极快 | 中文字符不可靠、细节少 |
79
+ | **qwen-image-edit-max** | 图生图编辑能力强、局部修改精确 | 换花色/换数字/换颜色等结构相似变体 | 中等 | CAPABILITY=image→image,必须传 reference-image |
80
+ | **wan2.6-image** | 风格迁移能力好 | 将参考图风格应用到新内容 | 中等 | CAPABILITY=image→image,必须传 reference-image |
70
81
 
71
82
  ### 选型口诀
72
83
 
73
- - 追求质量 / 含文字 / 网格图 → `gpt-image-2`
74
- - 快速迭代 / 扁平风格 / 回退备选 → `gemini-3.1-flash-image-preview`
84
+ - 普通素材 / 含文字 / 透明元素 → 可用的 `gpt-image-2.5-sunburst`,其次 Image 2.5 系列
85
+ - 已锁定的故事板或制作流程 → 沿用该流程指定模型,见下方 MC 专用规则
75
86
  - 中国风 / Q版 / 亚洲审美 → `hy-image-v3.0`
76
87
  - 艺术/手绘探索 → `flux-kontext-pro`
77
88
  - 纯 edit 变体 → `qwen-image-edit-max`
78
- - 一切都失败 → `gemini-3.1-flash-image-preview`(最稳定)
89
+ - 模型失败 → 先检查返回错误;不要把原生透明失败自动改成 Gemini 白底生成
79
90
 
80
91
  ### 为什么精灵图直出是首选批量策略?
81
92
 
@@ -91,6 +102,54 @@ qwen-image-edit-max image→image no 1 (mulerouter
91
102
 
92
103
  ## 2. 核心命令
93
104
 
105
+ ### 沙箱对话中的直接工具
106
+
107
+ 当前对话注册了 `playcraft-generate-image` 时,直接调用它。根据本次目标素材填写参数,不固定游戏名、素材类别、参考路径、尺寸或比例:
108
+
109
+ | 参数 | 本次取值 |
110
+ | ------------------------------------------- | -------------------------------------------------------------------------------------------------- |
111
+ | `prompt` | 目标字段与用户要求的主体、风格、文字、构图或状态;完整场景可描述背景内容,透明交付通过背景开关表达 |
112
+ | `targetAssetPath` | 被替换的现有素材路径;自动加载该字段参考图和全部交付约束,避免与素材弹窗行为不一致 |
113
+ | `imageModelRef` | 普通生图可省略,由后端优先选择可用 Image 2.5;用户明确指定、字段配置或制作流程已锁定时传指定模型 |
114
+ | `referenceImagePath` | 已确认可读的项目相对参考路径;优先字段 `reference_image`,其次当前素材,新素材无参考时可省略 |
115
+ | `additionalReferenceImagePaths` | 确有多个参考时传入其他可读路径,顺序与用途明确 |
116
+ | `aspectRatio` | 新素材的构图比例;现有素材由 targetAssetPath 读取字段比例和尺寸 |
117
+ | `width` / `height` | 新素材的成对像素尺寸;有 targetAssetPath 时字段尺寸优先 |
118
+ | `outputFormat` / `fitMode` / `paddingColor` | 新素材的格式、适配方式和补边颜色;有 targetAssetPath 时读取目标约束 |
119
+ | `removeBackground` | 按字段配置与素材用途决定;透明前景为 `true`,完整背景或不透明面板为 `false` |
120
+ | `outputPath` | 本次素材的中间文件路径,沿用项目工作目录约定,验证后写回实际主题引用 |
121
+
122
+ 背景、角色、道具、按钮、文字、发光状态、序列帧等各自遵守项目字段配置。成组状态或动画帧还需保持对象、风格、锚点与尺寸一致,不把单张静态图当成完整序列帧替换。
123
+
124
+ `removeBackground: true` 表示需要通过验证的透明素材,不表示必须执行一次本地去背。背景优先级为字段明确规则 → 调用开关 → 提示词背景意图 → 当前图片推断;明确的透明或不透明提示词不能被旧图片的状态覆盖。保存实际 provider/model、参考图数量、请求编号、尝试次数与透明验证结论;模型清单里的默认星号不能证明本次实际使用的模型。
125
+
126
+ 常规生图工具的透明交付通过字段配置或 `removeBackground: true`(命令行为 `--remove-background`)表达。`prompt` 保留主体、文字、风格、构图及透明玻璃、水泡等材质;源图背景按实际模型处理:
127
+
128
+ | 模型 / 流程 | 源图背景说明 |
129
+ | ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
130
+ | Image 2.5 | 后端组装原生透明指令;需要重生成时改为干净纯白底再去背。调用方不追加透明、白底或色幕后缀。 |
131
+ | 明确选用的其他模型 | 后端首次请求保留调用方提示词,不会自动补白底。要求透明交付时,追加单一 `on a uniform solid pure white background for subsequent background removal`,同时传透明交付开关;不要混入透明或色幕要求。 |
132
+ | 独立色幕制作 | 仅在第 3 节的适用条件下使用;保留色幕中间图,切分后独立去背,最终仍需透明验收。 |
133
+
134
+ Image 2.5 的透明文生图无需参考图。生成全新素材时省略 targetAssetPath;没有参考图时直接文生图,用户提供参考图时显式传入,按用户要求传背景开关。替换现有素材时传目标路径以读取参考图和交付规格。要求透明输出时使用 PNG 或 WebP;没有格式配置的旧 .jpg 素材生成透明预览时改用 PNG。
135
+
136
+ 透明素材采用原生透明优先 → 后处理去背 → 最终成品验收。有参考图与无参考图都走同一交付流程:原图不透明时由后端自动分割去背,保留主体和交付规格;发现画入的棋盘格底图时不直接去背,避免留下零散灰块。棋盘格底图或去背结果不合格时,可用剩余的一次尝试在同一模型上重生成干净底图,再去背验收。模型、供应商与重新生成合计最多尝试两次,本地后处理不增加生图次数;命令行默认没有额外重试。返回 transparencySource=native 或 background-removal,区分原生透明和后处理结果。自动检查不能代替文字、主体完整性及深浅背景下的视觉验收。最终仍失败时报告请求编号与失败阶段并停止;不要在 Agent 层自行换模型、关闭透明要求或把棋盘格、透明补边当作成功。
137
+
138
+ 未注册直接工具时使用下方 CLI (Command-Line Interface, 命令行工具) 入口。若返回 `Business tool protocol unavailable (501); no operation was sent`,本次没有发出生图请求:修复入口或使用已注册的直接工具,不要通过换模型反复重试。
139
+
140
+ ### 现有素材替换
141
+
142
+ 先用 `playcraft tools image-context --asset-path <现有素材路径>` 查看本地解析结果;新命令不存在时更新已固定版本的命令行工具,不能跳过上下文继续生成。
143
+
144
+ ```bash
145
+ playcraft tools generate-image \
146
+ --target-asset "$TARGET_ASSET_PATH" \
147
+ --prompt "$IMAGE_PROMPT" \
148
+ --output "$PREVIEW_OUTPUT_PATH"
149
+ ```
150
+
151
+ 变量填写本次素材路径、用户生成要求与工作目录中的预览路径。此入口自动传递该素材的参考图和交付约束;验证通过后再应用到目标主题。新素材没有目标文件时才手动传 `--width` / `--height`、`--output-format`、`--fit-mode`、`--padding-color` 与 `--remove-background` 或 `--no-remove-background`。不透明背景和面板用后者,避免提示词误触发透明推断。
152
+
94
153
  ### 文生图(text-to-image)
95
154
 
96
155
  ```bash
@@ -99,7 +158,7 @@ playcraft tools generate-image \
99
158
  --output assets/images/sword.png \
100
159
  --aspect-ratio 1:1 \
101
160
  --image-size 4K \
102
- --image-model gpt-image-2
161
+ --image-model iegg-litellm/gpt-image-2.5-sunburst
103
162
  ```
104
163
 
105
164
  ### 图生图(image-to-image / reference-image)
@@ -111,7 +170,7 @@ playcraft tools generate-image \
111
170
  --reference-image assets/images/sword.png \
112
171
  --aspect-ratio 1:1 \
113
172
  --image-size 4K \
114
- --image-model gpt-image-2
173
+ --image-model iegg-litellm/gpt-image-2.5-sunburst
115
174
  ```
116
175
 
117
176
  ### 参数说明
@@ -183,24 +242,16 @@ playcraft image sprite-sheet \
183
242
 
184
243
  ## 3. 背景处理决策树
185
244
 
186
- > **核心原则**:先确定素材类型,再决定是否需要去背景,再按素材主色调选择色幕颜色,最后做去背景 + 深色背景验证。
245
+ > **核心原则**:先确定素材类型与最终背景要求;常规工具按第 2 节的模型规则准备源图并由后端验收,独立色幕流程才选择色幕颜色,交付后做深浅背景验证。
187
246
 
188
247
  ```
189
248
  生成的素材需要做什么?
190
249
  │
191
250
  ├─ 需要透明背景的独立元素(角色、道具、图标、文字图片、HUD、VFX)?
192
- │ ├─ 检查模型 ALPHA 列(playcraft tools list-image-models)
193
- │ ├─ ALPHA = yes → prompt 加 "transparent background, PNG with alpha"
194
- │ └─ ALPHA = no → 色幕策略(按素材主色调选择):
195
- │ ├─ 素材为金色/黄色/橙色/绿色 → 蓝幕 #0000FF
196
- │ │ ├─ prompt 末尾加 "on solid bright blue #0000FF background, isolated, centered"
197
- │ │ └─ 后处理:remove-background(tolerance 25)→ 深色背景验证
198
- │ ├─ 素材为蓝色/紫色/靛蓝 → 绿幕 #00FF00
199
- │ │ ├─ prompt 末尾加 "on solid bright green #00FF00 background, isolated, centered"
200
- │ │ └─ 后处理:remove-background(tolerance 25)→ 深色背景验证
201
- │ └─ 其他颜色 → 绿幕 #00FF00(默认)
202
- │ ├─ prompt 末尾加 "on solid bright green #00FF00 background, isolated, centered"
203
- │ └─ 后处理:remove-background(tolerance 25)→ 深色背景验证
251
+ │ ├─ 常规工具 → removeBackground=true / --remove-background
252
+ │ │ └─ 按模型准备源图背景(第 2 节)→ 原生透明或去背 → 最终透明验收
253
+ │ └─ 已明确选择独立色幕制作流程?
254
+ │ └─ 关闭中间图自动去背 → 单一色幕 → 切分后独立去背 → 深浅背景验证
204
255
  │
205
256
  ├─ 卡牌/棋盘格子/UI 面板(本身就是矩形有边框)?
206
257
  │ ├─ 不要去背景!白色牌面就是牌的一部分
@@ -215,7 +266,16 @@ playcraft image sprite-sheet \
215
266
 
216
267
  ### 为什么需要色幕策略?
217
268
 
218
- **当前所有已接入模型均不支持原生透明 PNG(ALPHA = no)**。白色背景 + 白色物体 = floodfill 无法区分边界。纯色背景 + 非撞色游戏素材 = 抠图几乎完美。与影视 chroma-key 原理相同。
269
+ 只有用户或已锁定的制作流程明确选择独立色幕制作,且所选模型不支持原生透明时才采用该流程;仅指定其他模型并不等于选择色幕。下方色幕矩阵和后缀表仅用于该流程与 ASR (Asset State Reference, 资产状态参考板),不能用作 Image 2.5 失败后的自动回退。原生透明图验证通过后直接处理尺寸,不再重复去背;发光、半透明边缘和白色前景应保留。白色背景与白色物体会让 floodfill 混淆边界。`playcraft image remove-background` 默认使用本地 floodfill,不应描述为必然调用后端去背模型。
270
+
271
+ 色幕**中间图**使用 `removeBackground: false` / `--no-remove-background`,让生成工具保留指定色幕,再独立去背;这不改变最终素材的透明交付要求。替换现有透明字段时,先用 `image-context` 读取参考图和交付规格,生成中间图时省略 `targetAssetPath` / `--target-asset`,显式传入已读取的参考图、尺寸与格式。字段的 `remove_background=true` 优先于调用开关,绑定该字段会提前触发自动去背;`--no-target-reference` 也不会解除字段约束。色幕去背及最终验收通过后再应用到目标字段。
272
+
273
+ ### 最终文件验证
274
+
275
+ - 按字段 resolution 处理尺寸,透明前景用 `--fit contain`,确认执行的工具使用透明补边;旧版工具可能补入不透明黑色。验证不通过时更新工具或显式使用透明背景缩放。
276
+ - 按实际资源扩展名编码,不把 PNG 内容写进其他格式的文件,也不擅自改变主题引用。
277
+ - 去背、缩放、转格式后都检查透明通道与边缘,并分别在深色和浅色背景上预览。允许素材自身的黑色描边,拒绝额外黑色矩形补边或误删的发光效果。
278
+ - 达到项目的文件大小限制后再覆盖目标文件。同一 Logo 的多个尺寸从同一张母图导出,避免重复生成导致风格漂移。
219
279
 
220
280
  ### 色幕选型矩阵(Color Conflict Avoidance)
221
281
 
@@ -271,6 +331,7 @@ playcraft image overlay \
271
331
  **Artist ASR prompt 要点**:
272
332
 
273
333
  1. Sheet canvas:`solid flat #808080` 或整板统一绿幕(非渐变)
334
+ 生成整板时传 `--no-remove-background`,保留格子布局和色幕供后续裁切。
274
335
  2. 每格:`ONE isolated element, centered, NO white box, NO scene, NO ground shadow`
275
336
  3. 金/橙/黄/绿元素格 → cell 背景 `#0000FF`;蓝/紫 → `#00FF00`
276
337
  4. 生成后**目视**格内可抠性 — 不要求 `channels=4`(那是 TA 后处理产物)
@@ -280,7 +341,7 @@ playcraft image overlay \
280
341
  ## 4. 脚本决策
281
342
 
282
343
  - **<=5 个文件** → 直接使用 CLI 命令
283
- - **>5 个文件** → 编写 Node.js 脚本放入 `ta-workspace/scripts/`。脚本模板见 `reference/` 目录。
344
+ - **>5 个文件** → 编写 Node.js 脚本放入 `ta-workspace/scripts/`。脚本模板见 `reference/` 目录;使用本次选定的模型与参考图,不直接沿用脚本中旧的默认模型。
284
345
 
285
346
  ---
286
347
 
@@ -288,11 +349,11 @@ playcraft image overlay \
288
349
 
289
350
  需要以下进阶内容时,查阅 [`refs/ta-image-generation-detail.md`](../../agents/refs/ta-image-generation-detail.md):
290
351
 
291
- | 主题 | 说明 |
292
- | --------------------- | ------------------------------------------------------------------- |
293
- | 精灵图直出策略 | gpt-image-2 网格图生成 + sprite-split 切分,白底/绿幕示例,分批策略 |
294
- | Edit 模型工作流 | 基图 → edit 变体(换花色/换数字/换颜色),prompt 写法 |
295
- | 错误恢复表 | 各类错误现象、原因、立即行动;模型回退顺序 |
296
- | Provider 回退链 | gpt-image-2 三 provider 互为回退 + 非 gpt-image-2 稳定回退 |
297
- | 批量生成最佳实践 | 单张验证、Node.js 脚本推荐、脚本模板使用 |
298
- | ta-workspace 脚本驱动 | 为什么用 Node.js、目录约定、脚本模板一览表 |
352
+ | 主题 | 说明 |
353
+ | --------------------- | ---------------------------------------------------------------- |
354
+ | 精灵图直出策略 | 按选定模型生成网格图 + sprite-split 切分;自动透明与独立色幕示例 |
355
+ | Edit 模型工作流 | 基图 → edit 变体(换花色/换数字/换颜色),prompt 写法 |
356
+ | 错误恢复表 | 各类错误现象、原因、立即行动;模型回退顺序 |
357
+ | Provider 回退链 | gpt-image-2 三 provider 互为回退 + 非 gpt-image-2 稳定回退 |
358
+ | 批量生成最佳实践 | 单张验证、Node.js 脚本推荐、脚本模板使用 |
359
+ | ta-workspace 脚本驱动 | 为什么用 Node.js、目录约定、脚本模板一览表 |