@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,123 @@
1
+ ---
2
+ name: playcraft-art-style-guide
3
+ description: 可玩广告美术风格选择与应用指南。涵盖 9 种主流风格的视觉特征、选型决策树(按游戏类型/受众/品牌调性)、风格对生产流水线的影响、以及各风格的 prompt 核心策略。Designer 在 Phase 1 确定美术方向前必读。
4
+ triggers: 美术风格,art style,像素风,pixel art,写实,realistic,卡通,cartoon,扁平,flat,科技风,tech,科幻,sci-fi,赛博朋克,cyberpunk,奇幻,fantasy,中国风,chinese,水彩,watercolor,手绘,Q版,chibi,风格选择,style direction,视觉风格
5
+ ---
6
+
7
+ # PlayCraft 美术风格选择与应用指南
8
+
9
+ ## 0. 风格选择的设计思考
10
+
11
+ 美术风格不是"好看就行"——它直接影响:
12
+
13
+ - **CTR 表现**:风格与目标受众的审美期待是否匹配
14
+ - **生产成本**:不同风格对 AI 生图质量要求和后处理复杂度差异极大
15
+ - **文件体积**:像素风天然小,写实风天然大——直接影响 5MB 预算分配
16
+ - **TA 管线**:像素风需要整数倍缩放 + 限色板;写实风需要高分辨率 + 精细抠图
17
+
18
+ **风格决策时机**:PM 在 `design-brief.md` 的 StyleDirection 中定义方向,Designer 在 Phase 1 具体化并生成样本验证。
19
+
20
+ ---
21
+
22
+ ## 1. 风格选型决策树
23
+
24
+ ```
25
+ 游戏类型 + 目标受众?
26
+
27
+ ├─ 休闲消除/益智 + 全年龄
28
+ │ ├─ 追求高辨识度/IP感 → Q版/Chibi
29
+ │ ├─ 追求简洁现代 → 扁平卡通
30
+ │ └─ 追求怀旧/独特 → 像素风
31
+
32
+ ├─ 卡牌/棋牌/麻将 + 成年用户
33
+ │ ├─ 中国市场 → 中国传统风
34
+ │ ├─ 全球市场/高端感 → 写实/半写实
35
+ │ └─ 年轻用户/轻量感 → 扁平卡通
36
+
37
+ ├─ 动作/射击/跑酷 + 年轻男性
38
+ │ ├─ 现代/都市 → 赛博朋克/科技风
39
+ │ ├─ 太空/未来 → 科幻风
40
+ │ └─ 魔法/剑与盾 → 奇幻风
41
+
42
+ ├─ 模拟经营/养成 + 女性/全年龄
43
+ │ ├─ 追求温暖治愈 → 水彩/手绘
44
+ │ ├─ 追求可爱萌系 → Q版/Chibi
45
+ │ └─ 追求清新文艺 → 扁平卡通
46
+
47
+ └─ RPG/冒险 + 核心玩家
48
+ ├─ 西方奇幻 → 奇幻风
49
+ ├─ 东方仙侠 → 中国传统风
50
+ └─ 暗黑/硬核 → 写实/半写实
51
+ ```
52
+
53
+ ---
54
+
55
+ ## 2. 九种风格速览
56
+
57
+ | # | 风格 | 视觉特征 | 体积倾向 | AI 生图难度 | 最佳模型 |
58
+ | --- | ------------------- | ------------------------------------ | -------- | ---------------- | -------------------- |
59
+ | 1 | **像素风** | 方块化、限色板(8-32色)、无抗锯齿 | 极小 | 中(需严格限色) | gpt-image-2 |
60
+ | 2 | **扁平卡通** | 粗描边、纯色填充、几何化、无渐变阴影 | 小 | 低 | 任意模型 |
61
+ | 3 | **Q版/Chibi** | 大头身比(2-3头)、圆润形状、夸张表情 | 小-中 | 低 | 任意模型 |
62
+ | 4 | **写实/半写实** | 真实光影、材质细节、自然比例 | 大 | 高(细节要求高) | gpt-image-2 |
63
+ | 5 | **中国传统风** | 水墨笔触、留白、金色装饰、书法元素 | 中 | 中(需文化细节) | gpt-image-2 |
64
+ | 6 | **赛博朋克/科技风** | 霓虹光、暗底、几何线条、HUD 叠加 | 中 | 中 | gpt-image-2 / gemini |
65
+ | 7 | **科幻风** | 金属质感、星空、全息UI、冷色调 | 中 | 中 | gpt-image-2 |
66
+ | 8 | **奇幻/魔法** | 发光粒子、魔法阵、饱和色彩、神秘光 | 中-大 | 中 | gpt-image-2 |
67
+ | 9 | **水彩/手绘** | 纸质纹理、渗透感、不规则边缘、柔和 | 中 | 中(边缘控制难) | gpt-image-2 |
68
+
69
+ ---
70
+
71
+ ## 3. 风格对 TA 管线的影响
72
+
73
+ | 风格 | 缩放策略 | 抠图难度 | VFX 适配 | 特殊注意 |
74
+ | ----------- | ------------------------------------- | ----------------- | ------------------------ | ------------------------------- |
75
+ | 像素风 | 整数倍(`--scale 2/4/8`),禁止分数缩放 | 低(硬边) | `pixelate` 后 VFX | 缩放后禁用抗锯齿 |
76
+ | 扁平卡通 | 任意缩放 | 低(粗描边清晰) | 所有 VFX 兼容 | 描边粗细要统一 |
77
+ | Q版/Chibi | 任意缩放 | 低-中 | 所有 VFX 兼容 | 头身比一致性 |
78
+ | 写实/半写实 | 只降不升(原图需高分辨率) | 高(毛发/半透明) | 写实 VFX 慎用卡通预设 | 需 AI 去背(--method ai) |
79
+ | 中国传统风 | 任意缩放 | 中(水墨渐变边) | glow/sparkle 适合 | 文字必须楷体/行书 |
80
+ | 赛博朋克 | 任意缩放 | 中(发光溢出) | glow/starburst 适合 | 发光边缘保留,不要过度 trim |
81
+ | 科幻风 | 任意缩放 | 中 | glow/impact_ring 适合 | 金属质感需 reference-image 锁定 |
82
+ | 奇幻/魔法 | 任意缩放 | 中(魔法粒子) | sparkle/glow/starburst | 粒子效果保留半透明 |
83
+ | 水彩/手绘 | 任意缩放 | 高(不规则边缘) | 慎用——VFX 可能破坏手绘感 | trim threshold 要高(30+) |
84
+
85
+ ---
86
+
87
+ ## 4. Prompt 核心策略(按风格)
88
+
89
+ 每种风格的 prompt 都遵循公式:`[主体] + [风格关键词] + [技术约束] + [负面约束]`
90
+
91
+ | 风格 | 核心关键词 | 必加约束 | 必加负面 |
92
+ | --------- | ------------------------------------------------------------------------------ | ----------------------- | ----------------------------------------------------- |
93
+ | 像素风 | `pixel art, 8-bit, limited N-color palette, sharp pixels, no anti-aliasing` | 指定色板数量 | `no smooth gradients, no anti-aliasing, no blur` |
94
+ | 扁平卡通 | `flat 2D vector, bold outlines, solid color fills, minimal shading` | 描边粗细(如 3px) | `no gradient, no 3D effect, no realistic shading` |
95
+ | Q版/Chibi | `chibi style, cute, 2.5-head proportion, round shapes, big eyes` | 头身比 | `no realistic proportion, no thin limbs` |
96
+ | 写实 | `photorealistic, detailed textures, natural lighting, high resolution` | 光源方向 | `no cartoon, no flat color, no cel-shading` |
97
+ | 中国传统 | `Chinese traditional ink painting, brush strokes, elegant, gold accents` | 留白比例 | `no western fantasy, no neon, no modern UI` |
98
+ | 赛博朋克 | `cyberpunk, neon glow, dark background, holographic, circuit patterns` | 发光色(如 cyan/magenta) | `no nature, no warm colors, no daylight` |
99
+ | 科幻 | `sci-fi, metallic surfaces, space, holographic UI, cold blue lighting` | 材质(金属/玻璃) | `no organic textures, no warm wood, no fantasy magic` |
100
+ | 奇幻 | `fantasy art, magical glow, ethereal, mystical atmosphere, rich colors` | 光源类型(魔法光) | `no modern technology, no sci-fi, no urban` |
101
+ | 水彩 | `watercolor painting, soft edges, paper texture, transparent washes, artistic` | 纸张纹理 | `no hard edges, no digital look, no sharp outlines` |
102
+
103
+ ---
104
+
105
+ ## 5. 风格一致性检查点
106
+
107
+ 生成样本后,对照以下维度确认风格执行是否到位:
108
+
109
+ | 维度 | 检查方法 | 不通过时调整 |
110
+ | -------- | ---------------------------- | ------------------------ |
111
+ | **色板** | 肉眼对比概念图主色 | prompt 加具体 hex 值 |
112
+ | **描边** | 放大看边缘处理 | 加/减 `bold outline Npx` |
113
+ | **光影** | 对比光源方向和阴影风格 | 明确光照描述 |
114
+ | **材质** | 对比表面纹理(哑光/光泽/粗糙) | 加材质修饰词 |
115
+ | **比例** | 对比元素间大小关系 | 加尺寸约束描述 |
116
+
117
+ ---
118
+
119
+ ## 6. 详细参考
120
+
121
+ 每种风格的完整 prompt 示例、模型推荐、TA 管线详细配置、常见错误与修正:
122
+
123
+ > **Read `refs/designer-art-style-catalog.md`**
@@ -0,0 +1,141 @@
1
+ ---
2
+ name: playcraft-asset-state-sheet
3
+ description: PlayCraft 资产状态参考精灵图板(ASR / Asset State Reference Sheet)生成指南。Designer 在 Gate #2a 后输出两张 4K 参考精灵图:UI 组件状态板 + 玩法元素状态板,供 TA crop 量产。
4
+ triggers: ASR,asset state reference,state reference sheet,UI state sheet,element state sheet,组件状态图,状态精灵图,精灵图板,参考精灵图,authoring sprite sheet,design handoff sheet,TA参考图,状态参考板,playcraft-asset-state-sheet
5
+ ---
6
+
7
+ # PlayCraft 资产状态参考精灵图板(ASR)
8
+
9
+ > **ASR** = **Asset State Reference Sheet**(资产状态参考精灵图板)
10
+ > **Authoring sprite sheet**(制作期精灵图板):单张 PNG、规则网格、每格一种状态;与 TA 产出的 **runtime atlas**(`.webp` + `.json`)不同。
11
+
12
+ ## 0. 前置条件(硬门禁)
13
+
14
+ - **仅在 Gate #2a 通过、`selectedMcOption` 已写入 `project-state.md` 之后** 才能生成 ASR
15
+ - **禁止**为未选中的 MC 方案生成 ASR
16
+ - 两张板均使用已确认 MC 作 `--reference-image`,且 `--image-model` 与 MC 一致
17
+
18
+ ## 1. 交付物:两张状态参考板
19
+
20
+ | 交付物 | 文件 | 内容 |
21
+ | --------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- |
22
+ | **UI State Reference Sheet** | `assets/images/reference/ui_state_sheet_[X].png` | 各 **UI/HUD 组件** 在所需交互态下的外观(非玩法棋子) |
23
+ | **Element State Reference Sheet** | `assets/images/reference/element_state_sheet_[X].png` | 各 **玩法视觉元素** 在特殊/事件态下的外观 |
24
+
25
+ `[X]` = `selectedMcOption`(A/B/C)。
26
+
27
+ ### UI State Reference Sheet — 放什么
28
+
29
+ - CTA 按钮、安装条、HUD 条、进度/分数框、手指引导、高亮框、徽章、弹窗底板等
30
+ - 每个组件占 **一个或多个相邻槽位**,每槽 **一种状态**,例如:
31
+ - `cta_install`: default | pressed | disabled
32
+ - `finger_guide`: idle | tap-down
33
+ - `highlight_frame`: off | on
34
+
35
+ ### Element State Reference Sheet — 放什么
36
+
37
+ - 棋子、牌面、角色、道具、匹配特效关键帧等(MC 概念面板里出现的玩法元素)
38
+ - 每个元素类型 **2–3 个代表状态**(完整全集由 TA 在 `production` 扩展),例如:
39
+ - `tile_gold`: idle | selected | matched
40
+ - `panda_char`: idle | happy | win
41
+
42
+ **元素总数**:每张板独立统计,每板 **8–12 个状态槽**(宁可少槽、加大间距,也不要重叠)。
43
+
44
+ ## 2. 布局策略 — 规则网格、零重叠
45
+
46
+ 1. **零重叠**:任意两格 bounding box 不得相交
47
+ 2. **网格化**:每行 3–4 槽;每槽固定矩形空白区;元素居中;四周 **≥80px** 边距
48
+ 3. **行间距 ≥120px**,**列间距 ≥100px**
49
+ 4. 禁止层叠、散落堆叠、透视干扰
50
+
51
+ ### UI 板示例布局
52
+
53
+ ```
54
+ Row 1: [CTA default] [CTA pressed] [CTA disabled] [HUD bar]
55
+ Row 2: [finger idle] [finger tap] [badge] [highlight on]
56
+ ```
57
+
58
+ ### 元素板示例布局
59
+
60
+ ```
61
+ Row 1: [tile A idle] [tile A selected] [tile A matched] [tile B idle]
62
+ Row 2: [char idle] [char happy] [char win] (empty)
63
+ ```
64
+
65
+ ## 3. Prompt 模板
66
+
67
+ **UI 板** — 在 prompt 中显式写 `UI component state reference sprite sheet`:
68
+
69
+ ```
70
+ UI component state reference sprite sheet for [GAME_TYPE] playable ad.
71
+ 3840x1152 canvas, [BG_COLOR] flat background.
72
+
73
+ STRICT LAYOUT: orthographic grid, fixed non-overlapping cells. Each UI widget state in exactly one cell, 80px margin, 100px column gap, 120px row gap. NO overlapping.
74
+
75
+ Row 1 — CTA / HUD:
76
+ - CTA install button, default state: ...
77
+ - CTA install button, pressed state: ...
78
+ ...
79
+
80
+ Art style: [SAME as Master Composite]. Front-facing UI, crisp edges, consistent lighting.
81
+ ```
82
+
83
+ **元素板** — 写 `gameplay element state reference sprite sheet`:
84
+
85
+ ```
86
+ Gameplay element state reference sprite sheet for [GAME_TYPE].
87
+ [same STRICT LAYOUT block]
88
+
89
+ Row 1 — Core tiles/items:
90
+ - [Element] idle: ...
91
+ - [Element] selected: ...
92
+ - [Element] matched: ...
93
+ ...
94
+
95
+ Art style: [SAME as Master Composite].
96
+ ```
97
+
98
+ **Prompt 必须包含**:`sprite sheet` 或 `state reference sheet`、`STRICT LAYOUT`、`non-overlapping cells`、具体 gap 像素。
99
+
100
+ ## 4. 生成命令
101
+
102
+ ```bash
103
+ # UI 组件状态板
104
+ playcraft tools generate-image \
105
+ --prompt "<UI sheet prompt>" \
106
+ --output assets/images/reference/ui_state_sheet_[X].png \
107
+ --reference-image assets/images/storyboard/master_composite_option_[X].png \
108
+ --image-model <与 MC 相同> \
109
+ --aspect-ratio 16:9 \
110
+ --image-size 4K
111
+
112
+ # 玩法元素状态板
113
+ playcraft tools generate-image \
114
+ --prompt "<Element sheet prompt>" \
115
+ --output assets/images/reference/element_state_sheet_[X].png \
116
+ --reference-image assets/images/storyboard/master_composite_option_[X].png \
117
+ --image-model <与 MC 相同> \
118
+ --aspect-ratio 16:9 \
119
+ --image-size 4K
120
+ ```
121
+
122
+ ## 5. 核查清单
123
+
124
+ | # | 核查项 | 标准 |
125
+ | --- | ------ | ---------------------------------------- |
126
+ | 1 | 时机 | `selectedMcOption` 已设置 |
127
+ | 2 | 数量 | UI 板 + 元素板各一张 |
128
+ | 3 | 视觉 | 两板均无重叠;有重叠则重生成 |
129
+ | 4 | 语义 | UI 板无玩法棋子;元素板无整屏 HUD 截屏 |
130
+ | 5 | 清单 | `designer-log` 含每张板的状态→槽位映射表 |
131
+
132
+ ## 6. 与 TA 的协作协议
133
+
134
+ Designer:风格与 MC 一致;在 `designer-log.md` 标注每张 ASR **已覆盖的状态** vs **TA 需扩展的状态**。
135
+
136
+ TA 提取(详见 `playcraft-masking`):
137
+
138
+ | 来源图 | 推荐方式 | 说明 |
139
+ | -------------------- | -------------------------- | ----------------------------------------------------------------------------------- |
140
+ | **ASR**(规则网格) | `playcraft image crop` | 槽位坐标来自 `designer-log` ASR State Inventory;**禁止**对 ASR 用纯 text `segment` |
141
+ | **Master Composite** | `decompose-layers` 或 crop | ASR 未覆盖的类型从此补提取 |
@@ -0,0 +1,280 @@
1
+ ---
2
+ name: playcraft-audio-generation
3
+ description: PlayCraft AI 音频生成完整指南。涵盖 SFX 音效生成、BGM 背景音乐生成(prompt 套路、时长、风格参数)、本地音频后处理(compress/fade/loop/normalize/mix),以及完整的音频管线。Designer 和 TA 在生成音频资产前必读。
4
+ triggers: 生成音效,生成bgm,生成背景音乐,generate sfx,generate bgm,generate audio,音频,音效,背景音乐,sfx,bgm,loop音频,音频压缩,音频处理,audio,compress audio,fade,normalize,音频后处理,音频管线
5
+ ---
6
+
7
+ # PlayCraft AI 音频生成指南
8
+
9
+ ## 0. 开始前必读
10
+
11
+ 音频资产分两类,使用不同工具:
12
+
13
+ | 类型 | 工具 | 是否需要后端 |
14
+ | ------------------ | ------------------------------ | ------------ |
15
+ | AI 生成音效(SFX) | `playcraft tools generate-sfx` | 是 |
16
+ | AI 生成 BGM | `playcraft tools generate-bgm` | 是 |
17
+ | 本地音频处理 | `playcraft audio <子命令>` | 否 |
18
+
19
+ > ⚠️ **重要**:`generate-sfx` 的 `--prompt` **只支持英文**。BGM 的 prompt 可以用中文描述风格,但英文效果更稳定。
20
+
21
+ ---
22
+
23
+ ## 1. SFX 音效生成
24
+
25
+ ### 基本用法
26
+
27
+ ```bash
28
+ playcraft tools generate-sfx \
29
+ --prompt "short coin collect chime, game UI, bright and crisp" \
30
+ --output assets/audio/sfx/coin.mp3 \
31
+ --duration 1.0
32
+ ```
33
+
34
+ ### 常用参数
35
+
36
+ | 参数 | 说明 | 建议值 |
37
+ | ------------ | --------------------------- | -------------------------- |
38
+ | `--prompt` | 音效描述(**必须英文**) | 见下方 prompt 套路 |
39
+ | `--output` | 保存路径(`.mp3` / `.wav`) | — |
40
+ | `--duration` | 时长(秒) | SFX:0.3–3.0;环境音:3–10 |
41
+ | `--loop` | 是否循环友好 | 环境音、引擎声用 `--loop` |
42
+
43
+ ### SFX Prompt 套路
44
+
45
+ **结构**:`[音效描述], [场景/用途], [音色特征], [可选:情绪/风格]`
46
+
47
+ | 用途 | Prompt 示例 |
48
+ | -------------- | -------------------------------------------------------------------------- |
49
+ | UI 点击 | `"button click, game UI, soft and satisfying, short"` |
50
+ | 金币收集 | `"coin collect chime, arcade game, bright metallic, 0.5 seconds"` |
51
+ | 爆炸 | `"explosion impact, action game, deep bass rumble with debris scatter"` |
52
+ | 卡牌翻转 | `"card flip whoosh, card game, crisp paper sound"` |
53
+ | 胜利提示 | `"victory fanfare, casual mobile game, cheerful and upbeat, short jingle"` |
54
+ | 失败提示 | `"fail sound, game over, descending tone, simple"` |
55
+ | 跳跃 | `"jump sound, platform game, light spring bounce"` |
56
+ | 魔法施放 | `"magic spell cast, fantasy game, sparkling shimmer with whoosh"` |
57
+ | 麻将碰牌 | `"mahjong tile click, ceramic tap sound, sharp and clear"` |
58
+ | 环境音(循环) | `"forest ambient, birds chirping, peaceful, seamless loop"` |
59
+
60
+ **质量修饰词**(加在末尾):
61
+
62
+ - 追求干净:`"clean, no reverb, game-ready"`
63
+ - 追求丰富:`"rich, layered, cinematic"`
64
+ - 追求复古:`"8-bit, chiptune, retro game"`
65
+
66
+ ### 批量 SFX 生成脚本
67
+
68
+ ```javascript
69
+ // ta-workspace/scripts/gen-sfx.mjs
70
+ import { execSync } from "child_process";
71
+ import { existsSync } from "fs";
72
+
73
+ const OUTPUT_DIR = "assets/audio/sfx";
74
+ const SFX_LIST = [
75
+ {
76
+ name: "coin",
77
+ prompt: "coin collect chime, arcade game, bright metallic, 0.5 seconds",
78
+ duration: 0.5,
79
+ },
80
+ {
81
+ name: "click",
82
+ prompt: "button click, game UI, soft satisfying, short",
83
+ duration: 0.3,
84
+ },
85
+ {
86
+ name: "win",
87
+ prompt: "victory fanfare, casual mobile game, cheerful upbeat jingle",
88
+ duration: 2.0,
89
+ },
90
+ {
91
+ name: "fail",
92
+ prompt: "fail sound, game over, descending tone, simple",
93
+ duration: 1.5,
94
+ },
95
+ {
96
+ name: "jump",
97
+ prompt: "jump sound, platform game, light spring bounce",
98
+ duration: 0.4,
99
+ },
100
+ ];
101
+
102
+ for (const sfx of SFX_LIST) {
103
+ const output = `${OUTPUT_DIR}/${sfx.name}.mp3`;
104
+ if (existsSync(output)) {
105
+ console.log(`[SKIP] ${sfx.name}`);
106
+ continue;
107
+ }
108
+ console.log(`[GEN] ${sfx.name}...`);
109
+ execSync(
110
+ `playcraft tools generate-sfx --prompt "${sfx.prompt}" --output "${output}" --duration ${sfx.duration}`,
111
+ { stdio: "inherit" },
112
+ );
113
+ }
114
+ ```
115
+
116
+ ---
117
+
118
+ ## 2. BGM 背景音乐生成
119
+
120
+ ### 基本用法
121
+
122
+ ```bash
123
+ playcraft tools generate-bgm \
124
+ --prompt "upbeat casual mobile game, playful and energetic, suitable for a card matching game" \
125
+ --output assets/audio/bgm/main_theme.mp3 \
126
+ --bpm 120
127
+ ```
128
+
129
+ ### 常用参数
130
+
131
+ | 参数 | 说明 | 建议值 |
132
+ | ---------- | ------------ | ---------------------------------------------- |
133
+ | `--prompt` | 音乐风格描述 | 见下方 prompt 套路 |
134
+ | `--output` | 保存路径 | — |
135
+ | `--bpm` | 节拍速度 | 轻松:90–110;激烈:130–160 |
136
+ | `--style` | 附加风格标签 | `"electronic"` / `"orchestral"` / `"chiptune"` |
137
+
138
+ ### BGM Prompt 套路
139
+
140
+ **结构**:`[游戏类型], [情绪基调], [乐器风格], [可选:特定场景]`
141
+
142
+ | 场景 | Prompt 示例 | BPM |
143
+ | ------------ | ------------------------------------------------------------------- | --- |
144
+ | 休闲手游主题 | `"casual mobile game, cheerful and bouncy, ukulele and marimba"` | 110 |
145
+ | 扑克牌游戏 | `"card game background, smooth jazz lounge, elegant and relaxed"` | 95 |
146
+ | 麻将游戏 | `"mahjong game, traditional Chinese instruments, calm and focused"` | 85 |
147
+ | 动作游戏 | `"action arcade game, intense and driving, electronic synth drums"` | 145 |
148
+ | 像素风冒险 | `"8-bit adventure game, chiptune style, heroic and nostalgic"` | 130 |
149
+ | 益智解谜 | `"puzzle game, gentle and thoughtful, soft piano and ambient pad"` | 90 |
150
+ | 胜利画面 | `"victory celebration, triumphant fanfare, short and energetic"` | 140 |
151
+ | 菜单/大厅 | `"game lobby menu, welcoming and pleasant, light and airy"` | 100 |
152
+
153
+ ### BGM 循环处理(必做!)
154
+
155
+ AI 生成的 BGM 首尾通常不能无缝循环,需要后处理:
156
+
157
+ ```bash
158
+ # 生成后检查时长
159
+ playcraft audio info --input assets/audio/bgm/main_theme.mp3
160
+
161
+ # 无缝循环处理(交叉淡化 1 秒)
162
+ playcraft audio loop \
163
+ --input assets/audio/bgm/main_theme.mp3 \
164
+ --output assets/audio/bgm/main_theme_loop.mp3 \
165
+ --crossfade 1.0
166
+
167
+ # 验证循环点
168
+ playcraft audio info --input assets/audio/bgm/main_theme_loop.mp3
169
+ ```
170
+
171
+ ---
172
+
173
+ ## 3. 本地音频后处理
174
+
175
+ 所有 `playcraft audio` 子命令**完全本地运行**,无需网络。
176
+
177
+ ### 3.1 常用处理命令
178
+
179
+ ```bash
180
+ # 查看音频信息(时长、体积、比特率、采样率)
181
+ playcraft audio info --input audio.mp3
182
+
183
+ # 压缩(减小文件体积)
184
+ playcraft audio compress \
185
+ --input audio.mp3 \
186
+ --output audio_small.mp3 \
187
+ --target-size 50KB # 或指定比特率 --bitrate 64k
188
+
189
+ # 裁剪(取片段)
190
+ playcraft audio trim \
191
+ --input audio.mp3 \
192
+ --output trimmed.mp3 \
193
+ --start 0 --end 5.0 # 取前 5 秒
194
+
195
+ # 淡入淡出
196
+ playcraft audio fade \
197
+ --input audio.mp3 \
198
+ --output audio_fade.mp3 \
199
+ --fade-in 0.3 \
200
+ --fade-out 0.5
201
+
202
+ # 无缝循环
203
+ playcraft audio loop \
204
+ --input audio.mp3 \
205
+ --output audio_loop.mp3 \
206
+ --crossfade 1.0
207
+
208
+ # 响度标准化(游戏音频建议 -16 LUFS)
209
+ playcraft audio normalize \
210
+ --input audio.mp3 \
211
+ --output audio_norm.mp3 \
212
+ --target-loudness -16
213
+
214
+ # 格式转换(WAV → MP3,或 MP3 → OGG)
215
+ playcraft audio convert \
216
+ --input audio.wav \
217
+ --output audio.mp3
218
+
219
+ # 多轨混音
220
+ playcraft audio mix \
221
+ --inputs bgm.mp3,sfx.mp3 \
222
+ --output mixed.mp3 \
223
+ --volumes 0.7,1.0 # BGM 70%,SFX 100%
224
+ --offsets 0,2.5 # SFX 在 2.5 秒处开始
225
+ ```
226
+
227
+ ### 3.2 标准音频处理管线
228
+
229
+ AI 生成后的**必做处理步骤**:
230
+
231
+ ```
232
+ SFX 管线:
233
+ generate-sfx → normalize (-16 LUFS) → compress (目标 <100KB) → convert (.mp3)
234
+
235
+ BGM 管线:
236
+ generate-bgm → normalize (-16 LUFS) → loop (--crossfade 1.0) → compress (目标 <500KB) → convert (.mp3)
237
+ ```
238
+
239
+ ---
240
+
241
+ ## 4. 错误恢复策略
242
+
243
+ | 错误现象 | 原因 | 行动 |
244
+ | ------------------------------ | ----------------- | -------------------------------------------- |
245
+ | `generate-sfx` prompt 返回错误 | Prompt 包含中文 | **改为英文** |
246
+ | SFX 时长不准 | AI 生成时长近似值 | 用 `audio trim` 裁剪到精确时长 |
247
+ | BGM 首尾断裂 | AI 未做循环 | **必须跑 `audio loop --crossfade 1.0`** |
248
+ | 音量太小/太大 | 生成音量随机 | `audio normalize --target-loudness -16` |
249
+ | 文件体积太大(>1MB) | 无压缩 | `audio compress --target-size 200KB` |
250
+ | 格式不对 | 项目要求特定格式 | `audio convert --input x.wav --output x.mp3` |
251
+
252
+ ---
253
+
254
+ ## 5. 常用命令速查
255
+
256
+ ```bash
257
+ # AI 生成 SFX(prompt 必须英文)
258
+ playcraft tools generate-sfx \
259
+ --prompt "coin collect, bright chime, 0.5 seconds" \
260
+ --output sfx/coin.mp3 \
261
+ --duration 0.5
262
+
263
+ # AI 生成 BGM
264
+ playcraft tools generate-bgm \
265
+ --prompt "casual card game, upbeat jazz, relaxed" \
266
+ --output bgm/theme.mp3 \
267
+ --bpm 110
268
+
269
+ # 无缝循环处理(BGM 必做)
270
+ playcraft audio loop --input bgm/theme.mp3 --output bgm/theme_loop.mp3 --crossfade 1.0
271
+
272
+ # 响度标准化(SFX/BGM 推荐)
273
+ playcraft audio normalize --input audio.mp3 --output audio_norm.mp3 --target-loudness -16
274
+
275
+ # 压缩减体积
276
+ playcraft audio compress --input audio.mp3 --output audio_small.mp3 --target-size 100KB
277
+
278
+ # 查看音频信息
279
+ playcraft audio info --input audio.mp3
280
+ ```