@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,130 @@
1
+ # Reviewer: Convergence Evaluation (design_check / ui_diff / load_check)
2
+
3
+ > **Read before executing any Reviewer mode.** Replaces six-dimension final review in `convergence-v1`.
4
+ > Invoked from `agents/reviewer.md` — orchestrator specifies mode per invoke.
5
+
6
+ ---
7
+
8
+ ## Mode: design_check
9
+
10
+ Soft checklist only — **do not judge subjective design quality**.
11
+
12
+ ### Gate #1 checklist (PM four docs)
13
+
14
+ ```
15
+ [ ] design-brief exists; Style Direction has Dimension / Modality / Arc
16
+ [ ] layout-spec exists; assetMapping non-empty
17
+ [ ] atom-plan.json exists; skillsMatch non-empty
18
+ [ ] every atom has assignTo + dependsOn
19
+ [ ] no obvious cross-doc contradictions (assetMapping paths align with atoms)
20
+ ```
21
+
22
+ **Fail →** list missing items + `routeTo: pm` (or `designer` if visual doc gap).
23
+
24
+ ### Gate #2b additional checklist
25
+
26
+ ```
27
+ [ ] MC five panels complete (concept + 4 storyboard)
28
+ [ ] MC aspect ratio correct — verify with: playcraft image info <mc-path>
29
+ [ ] ASR dual sheets (UI + element) exist under assets/images/reference/
30
+ [ ] ASR covers main assetMapping element ids
31
+ ```
32
+
33
+ **Pass →** handoff `Run Gate #1` or `Run Gate #2b`. **Fail →** routeTo PM/Designer with specific gaps.
34
+
35
+ ---
36
+
37
+ ## Mode: ui_diff
38
+
39
+ > **Read `playwright-cli` skill first.** Save all screenshots under `logs/`.
40
+
41
+ ### Procedure
42
+
43
+ 1. Read MC panel paths from `style-exploration.md` / `assets/images/reference/`.
44
+ 2. `npm run dev` if devUrl down; read devUrl from `project-state.md`.
45
+ 3. For each scene Developer exposed (URL param or UI button):
46
+
47
+ ```bash
48
+ playwright-cli open <devUrl>[?scene=hook|tutorial|endcard|cta]
49
+ playwright-cli resize 390 844
50
+ playwright-cli screenshot --filename=logs/ui-diff-<scene>.png
51
+ ```
52
+
53
+ 4. Compare each screenshot vs corresponding MC panel:
54
+
55
+ | Scene | MC panel | Check |
56
+ | ---------- | --------------- | --------------------------------------- |
57
+ | Initial | Panel 1 Concept | Layout, hierarchy, element completeness |
58
+ | Hook | Panel 2 | Color mood, hook composition |
59
+ | Onboarding | Panel 3 | Tutorial UI, low-pressure layout |
60
+ | EndCard | Panel 4 | CTA zone, unresolved emotion |
61
+ | CTA | Panel 5 | Button prominence, accent color |
62
+
63
+ 5. `playwright-cli console` — log errors (informational for ui_diff; critical only if UI broken).
64
+ 6. `playwright-cli close`.
65
+
66
+ ### UI Diff Report (write to review-report.md)
67
+
68
+ For each difference:
69
+
70
+ - Screenshot path + MC reference path
71
+ - Description + severity (`critical` / `major` / `minor`)
72
+ - `routeTo: developer | ta | designer`
73
+ - Fix suggestion
74
+
75
+ **Pass:** no critical/major diffs (minor logged, do not block).
76
+ **Fail:** `uiReworkRound` +1; handoff orchestrator to `ui_rework`.
77
+
78
+ ### Routing guide
79
+
80
+ | Issue type | routeTo |
81
+ | ---------------------------------- | --------- |
82
+ | Layout, code binding, scene switch | developer |
83
+ | Wrong asset color/size/style | ta |
84
+ | Ambiguous design intent | designer |
85
+
86
+ ---
87
+
88
+ ## Mode: load_check
89
+
90
+ Minimal pre-Gate #3 sanity check — **not gameplay QA**.
91
+
92
+ ### Procedure
93
+
94
+ 1. `npm run dev` if needed; `playwright-cli open <devUrl>`.
95
+ 2. Wait for load (≤10s); confirm not white screen.
96
+ 3. `playwright-cli console` — fail if any **Error**-level log.
97
+ 4. `playwright-cli screenshot --filename=logs/load-check.png`.
98
+ 5. `playwright-cli close`.
99
+
100
+ ### Checklist
101
+
102
+ ```
103
+ [ ] Page loads within 10s (not white screen)
104
+ [ ] Console has no Error-level messages
105
+ [ ] game/index.html reachable
106
+ ```
107
+
108
+ **Pass →** `loadCheck: passed`, handoff `Run Gate #3 with devUrl`.
109
+ **Fail →** routeTo Developer with console error summary.
110
+
111
+ ---
112
+
113
+ ## Severity (ui_diff only)
114
+
115
+ | Severity | Meaning | Blocks pass? |
116
+ | -------- | --------------------------- | ------------ |
117
+ | critical | UI broken / missing | Yes |
118
+ | major | Clear visual mismatch vs MC | Yes |
119
+ | minor | Polish / slight drift | No (log) |
120
+
121
+ ---
122
+
123
+ ## project-state fields (Reviewer writes)
124
+
125
+ | Field | Mode | Values |
126
+ | ---------------- | ------------ | ------------------------- |
127
+ | `uiReviewStatus` | ui_diff | pending / passed / failed |
128
+ | `uiReworkRound` | ui_diff fail | 0–5 |
129
+ | `loadCheck` | load_check | pending / passed / failed |
130
+ | `loadCheckNotes` | load_check | console + load summary |
@@ -0,0 +1,6 @@
1
+ # Reviewer: Six-Dimension Evaluation (deprecated)
2
+
3
+ > **Superseded by [`reviewer-convergence-eval.md`](./reviewer-convergence-eval.md)** in `convergence-v1`.
4
+ > Do not use six-dimension scoring or final `review`/`rework` stages.
5
+
6
+ See `agents/reviewer.md` for the three modes: `design_check`, `ui_diff`, `load_check`.
@@ -0,0 +1,85 @@
1
+ # TA 3D Flip & Material Reskin Recipe
2
+
3
+ > Read by Technical Artist when dealing with:
4
+ > - Material/texture swap while preserving symbols (mahjong white→ice/metal/wood)
5
+ > - Card/tile flip animations (16-frame sprite sheets)
6
+ > - Any task requiring the 3D white model pipeline
7
+
8
+ ---
9
+
10
+ ## Option C: Material Reskin — Preserve Symbols, Swap Base Texture
11
+
12
+ **THE most common TA task for sprite sheet style variants.**
13
+ - Use when: mahjong white→ice, white→metal, white→wood
14
+ - Key insight: symbols are face textures, base material is a separate layer
15
+
16
+ ```bash
17
+ # Step 1: Split the original sprite sheet into individual tiles
18
+ playcraft image sprite-split \
19
+ --input assets/images/tiles/original_sheet.png \
20
+ --output-dir assets/images/tiles/split_frames \
21
+ --auto-detect --hint "mahjong tiles, uniform grid"
22
+ # → 44 individual PNGs + split-meta.json
23
+
24
+ # Step 2: Generate ONE new base material texture (reused for all tiles)
25
+ playcraft tools generate-image \
26
+ --prompt "ice crystal frosted glass texture, blue-white cold, seamless, top-down" \
27
+ --output assets/textures/ice_base.png
28
+
29
+ # Step 3: Create white model with new base material
30
+ playcraft 3d apply-texture \
31
+ --model plane \
32
+ --texture assets/textures/ice_base.png \
33
+ --output assets/models/ice_tile_base.glb
34
+
35
+ # Step 4: For EACH tile — render white model + original symbol as face texture
36
+ # (Uses the software rasterizer from playcraft-3d-flip-sprite SKILL)
37
+ # face texture = the split frame from Step 1 (preserves symbol exactly)
38
+ node render.mjs assets/models/ice_tile_base.glb \
39
+ assets/images/tiles/reskinned/tile_001.png \
40
+ assets/images/tiles/split_frames/frame_r0_c0.png
41
+ # Repeat for all 44 tiles — write a ta-workspace script for this step
42
+
43
+ # Step 5: Reassemble into sprite sheet (same grid as original)
44
+ playcraft image sprite-sheet \
45
+ --inputs assets/images/tiles/reskinned/tile_001.png,tile_002.png,... \
46
+ --output assets/images/tiles/ice_sheet \
47
+ --columns <original_columns> \
48
+ --cell-width <W> --cell-height <H>
49
+ ```
50
+
51
+ **Style switching efficiency**:
52
+ - To switch to METAL: only redo Step 2 (new texture) + Step 3-5
53
+ - To switch to WOOD: same — just one new base texture
54
+ - Symbols never change, never touch AI regeneration
55
+
56
+ ---
57
+
58
+ ## Option D: Batch 3D Flip Sprite Sheet (e.g., 34 mahjong flip animations)
59
+
60
+ Read `playcraft-3d-flip-sprite` SKILL for the full rendering pipeline.
61
+ (Software rasterizer: no Puppeteer/headless-gl needed)
62
+
63
+ **Per-tile workflow**: white model GLB + face texture → 16-frame flip sprite sheet
64
+
65
+ ```
66
+ 1. Flatten base GLB (remove surface geometry of original design)
67
+ 2. Generate face texture per tile variant
68
+ 3. Render 16-frame flip animation with soft rasterizer
69
+ 4. Output sprite sheet PNG
70
+ ```
71
+
72
+ See `.claude/skills/playcraft-3d-flip-sprite/` for complete instructions.
73
+
74
+ ---
75
+
76
+ ## Mahjong Tile Example: All 4 Workflows Compared
77
+
78
+ | Scenario | Method | When |
79
+ |---------|--------|------|
80
+ | One concept mockup → all 34 tiles | Sprite Generation (AI batch with reference-image) | Starting from scratch |
81
+ | Existing white tiles → Ice style (symbols preserved) | 3D path (Option C above) | Material/texture swap |
82
+ | Existing white tiles → Metal style | 3D path (swap ice→metal texture, rerun Step 3-5) | Style variant |
83
+ | Existing tiles → Pixel art style (symbols redrawn) | Sprite Remix (per-frame AI) | Full creative restyle |
84
+ | Existing tiles → Darker mood | Image Processing (`tint` + `overlay`) | Color/mood shift |
85
+ | Flip animation (16 frames per tile) | Option D (3D flip sprite, playcraft-3d-flip-sprite SKILL) | Animation |
@@ -0,0 +1,67 @@
1
+ # TA Atlas Deliverable Standard
2
+
3
+ > **When**: `stage: production` branch in `technical-artist.md` § Runtime.
4
+ > **Contract source**: `layout-spec.md` atlas groups + `assetMapping` (Gate #1 locked).
5
+
6
+ ## Defaults
7
+
8
+ | Asset type | Delivery format |
9
+ | ------------------- | -------------------------------------------------------------------------------------------- |
10
+ | Runtime images | **WebP** (`.webp`) — not PNG for final runtime assets |
11
+ | Multi-element class | **One atlas per logical group** → `.webp` + `.json` sidecar (`playcraft image sprite-sheet`) |
12
+ | Single large asset | One `.webp` (full-screen bg, etc.) |
13
+ | Audio (BGM/SFX) | **MP3** only after TA post-process |
14
+ | Digit strip | Single horizontal **WebP** at `layout-spec` path (not merged into UI atlas) |
15
+
16
+ ## Atlas grouping rules
17
+
18
+ 1. Read PM's **atlas grouping table** in `layout-spec.md` (group name → elementIds → `atlasPath`).
19
+ 2. **≥2 elements in same group** → TA MUST deliver **one** `.webp` + `.json`; map each element via `frameId` in assetMapping.
20
+ 3. **Do not** split one group into scattered files.
21
+ 4. **Exceptions** (single file OK): full-screen background, digit strip, MC/ASR reference (non-runtime), animation-only atlases (one animation = one atlas).
22
+
23
+ ## Production pipeline
24
+
25
+ 1. Spec Quick-Check → Style Interpretation → micro-batch (≥3) per group.
26
+ 2. Batch generate frames → `playcraft image sprite-sheet` → convert to **WebP** if needed:
27
+ ```bash
28
+ playcraft image convert --input atlas.png --output assets/images/tiles/tiles_atlas.webp --quality 85
29
+ ```
30
+ 3. Validate sidecar JSON: frame count = element count in group; grid params in `ta-log.md`.
31
+ 4. Audio: Designer MP3 → `playcraft audio compress/trim/loop/fade` → output **MP3**; verify with `playcraft audio info`.
32
+
33
+ ## Transparency requirements
34
+
35
+ | Asset category | Alpha required | Chroma key strategy | Post-verify |
36
+ | ----------------------------- | -------------- | ---------------------------------------------------- | ----------------------------------------- |
37
+ | UI overlay (icons, text, HUD) | ✅ channels=4 | Per color conflict matrix (see ta-pipeline-cookbook) | Dark-bg overlay verify (no white/residue) |
38
+ | VFX atlas (glow, particles) | ✅ channels=4 | Blue screen #0000FF (VFX常含金/橙色) | Per-frame dark-bg verify |
39
+ | Game element atlas (tiles) | ✅ channels=4 | Per color conflict matrix | Dark-bg overlay verify |
40
+ | Card/board piece (rect body) | ❌ opaque OK | N/A (white bg is part of the asset) | N/A |
41
+ | Full-screen background | ❌ opaque OK | N/A | Edge-to-edge full-coverage check |
42
+ | Digit strip | ✅ channels=4 | Blue screen #0000FF (digits often gold/white) | Dark-bg overlay verify |
43
+
44
+ **Color conflict matrix** — choose chroma key color to avoid edge residue:
45
+
46
+ - Gold/yellow/orange/green assets → **blue screen #0000FF** (never green)
47
+ - Blue/purple assets → **green screen #00FF00** (never blue)
48
+ - Multi-color/rainbow → **magenta #FF00FF** (last resort)
49
+ - All others → green screen #00FF00 (default)
50
+
51
+ ## Compliance (TA)
52
+
53
+ | Check | Pass criteria |
54
+ | --------------- | ------------------------------------------------------------------------------ |
55
+ | Atlas coverage | Every runtime element resolves to atlas+frame or single webp path |
56
+ | Sidecar | `.json` exists beside each multi-element atlas |
57
+ | Format | WebP for images; MP3 for audio (unless layout-spec explicit exception) |
58
+ | ta-log | One manifest row per atlas group: path, frames, cols/frameW/frameH/frameCount |
59
+ | **Alpha check** | All transparent assets have `channels=4` (verified via `playcraft image info`) |
60
+ | **Dark-bg OK** | All transparent assets pass dark-background (#1A1A2E) overlay — no residue |
61
+ | **BG coverage** | Full-screen backgrounds: edge-to-edge, no fade/vignette/white corners |
62
+
63
+ ## Developer handoff
64
+
65
+ Developer loads `atlasPath` once, uses `frameId` from layout-spec / JSON — not per-element file paths for grouped assets.
66
+
67
+ See also: `ta-pipeline-cookbook.md`, `playcraft-sprite-generation` SKILL (final delivery extension = `.webp`).
@@ -0,0 +1,120 @@
1
+ > 本文件是 batch/pipeline 的实用配方集。选型决策树和基础语法见 `playcraft-batch-pipeline` skill。
2
+
3
+ # Batch / Pipeline 实用配方集
4
+
5
+ ---
6
+
7
+ ## Batch 配方
8
+
9
+ ### 批量 resize + 转换格式
10
+
11
+ ```bash
12
+ playcraft image batch \
13
+ --input-dir assets/images/raw_tiles/ \
14
+ --output-dir assets/images/tiles/ \
15
+ --glob "*.png" \
16
+ --steps "resize --width 128 --height 128, trim" \
17
+ --parallel 8
18
+ ```
19
+
20
+ ### 批量去背(绿幕)
21
+
22
+ ```bash
23
+ playcraft image batch \
24
+ --input-dir assets/images/raw_sprites/ \
25
+ --output-dir assets/images/sprites/ \
26
+ --steps "remove-background --method floodfill --tolerance 40" \
27
+ --parallel 4
28
+ ```
29
+
30
+ ### 批量统一色调(制作主题变体)
31
+
32
+ ```bash
33
+ # 生成蓝色主题版本
34
+ playcraft image batch \
35
+ --input-dir assets/images/tiles/ \
36
+ --output-dir assets/images/tiles_blue_theme/ \
37
+ --steps "tint --color #4466BB" \
38
+ --parallel 6
39
+ ```
40
+
41
+ ### 断点续传(大批量任务中断后恢复)
42
+
43
+ ```bash
44
+ # 第一次运行中断了
45
+ playcraft image batch \
46
+ --input-dir assets/images/raw/ \
47
+ --output-dir assets/images/processed/ \
48
+ --steps "resize --width 256 --height 256, grayscale" \
49
+ --parallel 4 \
50
+ --skip-existing # 再次运行时跳过已完成的文件
51
+ ```
52
+
53
+ ---
54
+
55
+ ## Pipeline 配方
56
+
57
+ ### 配方 A: 去背 + 统一尺寸 + 合并精灵图
58
+
59
+ ```yaml
60
+ # ta-workspace/tile_pipeline.yaml
61
+ input:
62
+ dir: assets/images/raw_tiles/
63
+ glob: "*.png"
64
+
65
+ steps:
66
+ - command: remove-background
67
+ method: floodfill
68
+ tolerance: 40
69
+ - command: trim
70
+ threshold: 10
71
+ - command: resize
72
+ width: 128
73
+ height: 128
74
+ - command: pad
75
+ all: 4
76
+
77
+ output:
78
+ dir: ta-workspace/tmp/tiles_processed/
79
+
80
+ assemble:
81
+ sprite-sheet:
82
+ output: assets/images/tiles_atlas
83
+ columns: 6
84
+ padding: 2
85
+ ```
86
+
87
+ ```bash
88
+ playcraft image pipeline --config ta-workspace/tile_pipeline.yaml
89
+ ```
90
+
91
+ ### 配方 B: 多个主题色版本
92
+
93
+ 为同一套素材生成不同色调的主题变体:
94
+
95
+ ```bash
96
+ # 蓝色主题
97
+ playcraft image pipeline --config ta-workspace/theme_blue.yaml
98
+
99
+ # 红色主题(修改 tint color 即可)
100
+ sed 's/#4466BB/#BB4444/' ta-workspace/theme_blue.yaml > ta-workspace/theme_red.yaml
101
+ playcraft image pipeline --config ta-workspace/theme_red.yaml
102
+ ```
103
+
104
+ ### 配方 C: 批量缩略图生成
105
+
106
+ ```yaml
107
+ input:
108
+ dir: assets/images/concept/
109
+ glob: "*.png"
110
+ steps:
111
+ - command: resize
112
+ width: 240
113
+ height: 240
114
+ fit: cover
115
+ - command: convert
116
+ format: webp
117
+ quality: 80
118
+ output:
119
+ dir: assets/images/thumbnails/
120
+ ```