@playcraft/cli 0.0.41 → 0.0.43

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 (69) hide show
  1. package/dist/atom-plan/validate-asr-coverage.js +317 -0
  2. package/dist/commands/prad.js +61 -0
  3. package/dist/commands/remix.js +4 -2
  4. package/dist/commands/skills.js +24 -0
  5. package/dist/commands/tools-generation.js +2 -4
  6. package/dist/commands/tools-utils.js +19 -0
  7. package/dist/prad/atom-ref.js +23 -0
  8. package/dist/prad/check.js +377 -0
  9. package/dist/prad/check.test.js +27 -0
  10. package/dist/prad/explain.js +109 -0
  11. package/dist/prad/load-spec.js +23 -0
  12. package/dist/prad/paths.js +83 -0
  13. package/dist/prad/skills-index.js +60 -0
  14. package/dist/utils/version-checker.js +8 -11
  15. package/package.json +3 -3
  16. package/project-template/.claude/agents/designer.md +34 -26
  17. package/project-template/.claude/agents/developer.md +55 -62
  18. package/project-template/.claude/agents/pm.md +3 -1
  19. package/project-template/.claude/agents/refs/README.md +21 -15
  20. package/project-template/.claude/agents/refs/designer-deliverable-spec.md +70 -7
  21. package/project-template/.claude/agents/refs/designer-handoff-v2-checklist.md +21 -13
  22. package/project-template/.claude/agents/refs/designer-master-composite-recipes.md +20 -28
  23. package/project-template/.claude/agents/refs/designer-style-exploration-flow.md +39 -9
  24. package/project-template/.claude/agents/refs/developer-dev-handoff.md +1 -1
  25. package/project-template/.claude/agents/refs/developer-phase1-flow.md +81 -156
  26. package/project-template/.claude/agents/refs/pm-workflow-detail.md +24 -2
  27. package/project-template/.claude/agents/refs/reviewer-convergence-eval.md +142 -0
  28. package/project-template/.claude/agents/refs/reviewer-six-dimension-eval.md +4 -284
  29. package/project-template/.claude/agents/refs/ta-atlas-deliverable-standard.md +27 -6
  30. package/project-template/.claude/agents/refs/ta-pipeline-cookbook.md +474 -29
  31. package/project-template/.claude/agents/reviewer.md +65 -38
  32. package/project-template/.claude/agents/technical-artist.md +38 -25
  33. package/project-template/.claude/hooks/README.md +40 -4
  34. package/project-template/.claude/hooks/asr-coverage-validate.mjs +381 -0
  35. package/project-template/.claude/hooks/validate-workflow-stop.mjs +196 -5
  36. package/project-template/.claude/settings.json +4 -0
  37. package/project-template/.claude/skills/playcraft-asset-state-sheet/SKILL.md +76 -22
  38. package/project-template/.claude/skills/playcraft-image-generation/SKILL.md +84 -15
  39. package/project-template/.claude/skills/playcraft-storyboard/SKILL.md +26 -7
  40. package/project-template/.claude/skills/playcraft-workflow/SKILL.md +104 -15
  41. package/project-template/.claude/skills/playwright-cli/SKILL.md +390 -0
  42. package/project-template/.claude/skills/playwright-cli/references/element-attributes.md +23 -0
  43. package/project-template/.claude/skills/playwright-cli/references/playwright-tests.md +39 -0
  44. package/project-template/.claude/skills/playwright-cli/references/request-mocking.md +87 -0
  45. package/project-template/.claude/skills/playwright-cli/references/running-code.md +240 -0
  46. package/project-template/.claude/skills/playwright-cli/references/session-management.md +226 -0
  47. package/project-template/.claude/skills/playwright-cli/references/spec-driven-testing.md +312 -0
  48. package/project-template/.claude/skills/playwright-cli/references/storage-state.md +275 -0
  49. package/project-template/.claude/skills/playwright-cli/references/test-generation.md +138 -0
  50. package/project-template/.claude/skills/playwright-cli/references/tracing.md +142 -0
  51. package/project-template/.claude/skills/playwright-cli/references/video-recording.md +157 -0
  52. package/project-template/.cursor/rules/playcraft-orchestrator.mdc +74 -24
  53. package/project-template/.cursor/rules/playcraft-subagent-boundary.mdc +1 -1
  54. package/project-template/CLAUDE.md +99 -59
  55. package/project-template/docs/team/agent-conduct.md +42 -26
  56. package/project-template/docs/team/agent-runtime-matrix.md +71 -39
  57. package/project-template/docs/team/atom-plan-format.md +101 -2
  58. package/project-template/docs/team/collaboration.md +57 -48
  59. package/project-template/docs/team/core-model.md +20 -19
  60. package/project-template/docs/team/workflow-changelog.md +28 -14
  61. package/project-template/docs/team/workflow-consistency-checklist.md +64 -0
  62. package/project-template/templates/atom-plan.template.json +18 -0
  63. package/project-template/templates/atom-plan.template.md +35 -3
  64. package/project-template/templates/designer-log.template.md +94 -5
  65. package/project-template/templates/developer-log.template.md +95 -101
  66. package/project-template/templates/layout-spec.template.md +62 -8
  67. package/project-template/templates/project-state.template.md +51 -33
  68. package/project-template/templates/review-report.template.md +76 -151
  69. package/project-template/templates/ta-log.template.md +180 -14
@@ -8,17 +8,24 @@
8
8
  - [ ] `selectedMcOption` set (Gate #2a passed)
9
9
  - [ ] MC path: `assets/images/storyboard/master_composite_option_[X].png`
10
10
  - [ ] ASR paths exist and pass zero-overlap visual check
11
+ - [ ] ASR cells: isolated elements, no white box / scene inside cells (whole sheet opaque is OK)
12
+ - [ ] § **Image Production Preflight** filled (Phase 1 — three Skills read)
11
13
 
12
- ## 1. ASR Coverage Matrix (100%)
14
+ ## 1. ASR Coverage Matrix (100% rows)
13
15
 
14
16
  In `logs/designer-log.md` § ASR Coverage Matrix:
15
17
 
16
- 1. List every `elementId` from `layout-spec.md` § Asset Mapping (and atlas `frameId` groups count as one row per logical element).
18
+ 1. List every `elementId` from `layout-spec.md` § Asset Mapping (atlas `frameId` groups = one row per logical element).
17
19
  2. List every static text `id` from § Text Assets → Static Text.
18
- 3. For each row: `ASR sheet` = `ui` | `element` | `MC-crop` | `ICP-pending`.
19
- 4. `TA extends?` = `no` only when ASR shows final representative state; else `yes`.
20
+ 3. **Row count** must equal assetMapping + static text id count (verify before STOP).
21
+ 4. For each row, set **CoverageLayer** = `on-asr` | `mc-crop` | `ta-extends`.
22
+ 5. For each row: `ASR sheet` = `ui` | `element` | `element_2` | `MC-crop` | `ICP-pending`.
23
+ 6. `TA extends?` = `no` only when on-asr shows final representative state; else `yes`.
24
+ 7. **Sheet grid metadata** table filled with real numbers (not `{{placeholder}}`).
20
25
 
21
- **Stop rule**: any row missing do not set `#2b` pending.
26
+ **Type representative rule**: each distinct **elementType** (Matrix column or `layout-spec` § Element Type Registry) must have at least one row with CoverageLayer `on-asr` or `mc-crop`.
27
+
28
+ **Stop rule**: any contract row missing → do not set `#2b` pending.
22
29
 
23
30
  ## 2. Palette Locked
24
31
 
@@ -50,9 +57,9 @@ In `docs/style-exploration.md` under confirmed option:
50
57
  ```
51
58
  For each atom-plan row where assignTo = Designer:
52
59
  ├─ VisualAtom + covered in Coverage Matrix?
53
- │ └─ yes → status=done, actualOutput=ASR:...
60
+ │ └─ yes → status=done, actualOutput=ASR:... (on-asr rows → asrSlot in atom-plan.json)
54
61
  ├─ AudioAtom?
55
- │ └─ deliver MP3 at path → done
62
+ │ └─ deliver MP3 at path → done (Phase 2 only)
56
63
  ├─ Gap / TA extract failed (ICP)?
57
64
  │ └─ generate one PNG → done with path, or blocked until answered
58
65
  └─ Never: done with only "will extract later"
@@ -60,9 +67,10 @@ For each atom-plan row where assignTo = Designer:
60
67
 
61
68
  ## 5. Files to verify before STOP
62
69
 
63
- | File | Contains |
64
- | ----------------------------------------------------- | ----------------------------------------------------------- |
65
- | `docs/style-exploration.md` | MC paths, Motion Notes, Experience Flow |
66
- | `logs/designer-log.md` | Coverage Matrix, Palette Locked, Style Intent, Anti-Pattern |
67
- | `assets/images/reference/ui_state_sheet_[X].png` | exists |
68
- | `assets/images/reference/element_state_sheet_[X].png` | exists |
70
+ | File | Contains |
71
+ | ------------------------------------------------------- | ------------------------------------------------------------------------- |
72
+ | `docs/style-exploration.md` | MC paths, Motion Notes, Experience Flow |
73
+ | `logs/designer-log.md` | Image Production Preflight, Coverage Matrix, Palette Locked, Style Intent |
74
+ | `assets/images/reference/ui_state_sheet_[X].png` | exists |
75
+ | `assets/images/reference/element_state_sheet_[X].png` | exists |
76
+ | `assets/images/reference/element_state_sheet_[X]_2.png` | if types > 12 / overflow |
@@ -2,35 +2,27 @@
2
2
 
3
3
  > 本文件供 Designer 在生成 Master Composite 时按需查阅。核心规则见 `playcraft-storyboard` skill。
4
4
 
5
- ## 模型多样性策略
5
+ ## 模型策略(MC 专用 — 仅高质量模型)
6
6
 
7
- 每个风格方案使用**不同的图片模型**,探索不同视觉可能性。先运行:
7
+ Master Composite **禁止**使用低档或实验性模型。生成前可运行 `playcraft tools list-image-models` 核对 capability,但 **MC 只允许下表**:
8
8
 
9
- ```bash
10
- playcraft tools list-image-models
11
- ```
12
-
13
- ### 推荐分配策略
9
+ | 允许 `--image-model` | 典型分配 |
10
+ | ------------------------------ | ----------------------------------------------- |
11
+ | **`mulerouter/gpt-image-2`** | Option A(主推);Option C 可复用 + 不同 prompt |
12
+ | **`mulerouter/nano-banana-2`** | Option B;或 A/B 各用一模型做画风对比 |
14
13
 
15
- | 方案 | 推荐模型类型 | 原因 |
16
- | ---------------------- | --------------------------------------------------- | ---------------------------------- |
17
- | Option A(最精细方案) | `gpt-image-2` | 最高质量,细节最丰富,适合主推方案 |
18
- | Option B(风格化方案) | `gemini-3.1-flash-image-preview` 或 `hy-image-v3.0` | 风格更鲜明、艺术感更强 |
19
- | Option C(探索方案) | `flux-kontext-pro` 或 `nano-banana-2` | 不同画风,提供对比参考 |
14
+ **禁止用于 MC**:`gemini-*`、`flux-*`、`hy-image-*`、`wan*`、`qwen*`、裸 `gpt-image-2`、以及上表以外的任何模型。
20
15
 
21
- > 若只有 1-2 个方案,仍建议用不同模型生成同一方案,对比后选最佳。
16
+ > 多方案差异应来自 **prompt / 配色 / 构图**,不是换弱模型。ASR 双板 `--image-model` 须与已选 MC **完全一致**(见 `playcraft-asset-state-sheet` skill)。
22
17
 
23
- ### 模型特性速查
18
+ ### 模型特性速查(仅白名单内)
24
19
 
25
- | 模型 | 特点 | 适合风格 |
26
- | -------------------------------- | ---------------------------------------- | ---------------------- |
27
- | `gpt-image-2` | 细节丰富、光影真实、多 provider fallback | 写实、半写实、精细卡通 |
28
- | `gemini-3.1-flash-image-preview` | 色彩鲜艳、构图清晰、速度快 | 明亮卡通、休闲风 |
29
- | `hy-image-v3.0` | 亚洲审美偏向、角色设计好 | IP 风格、Q 版角色 |
30
- | `flux-kontext-pro` | 艺术感强、风格独特 | 手绘风、艺术插画 |
31
- | `nano-banana-2` | 快速、适合探索 | 简洁图形、平面设计风 |
20
+ | 模型 | 特点 | 适合 |
21
+ | -------------------------- | ----------------------------- | ----------------------------------- |
22
+ | `mulerouter/gpt-image-2` | 细节、光影、复杂 UI、中文元素 | 写实、半写实、精细卡通、麻将/汉字类 |
23
+ | `mulerouter/nano-banana-2` | 色彩、构图、速度快 | 明亮卡通、简洁 UI、快速迭代第二方案 |
32
24
 
33
- > `--reference-image` 只能用于 CAPABILITY 为 `text+image` 或 `image→image` 的模型,先用 `list-image-models` 确认。
25
+ > `--reference-image` 只能用于 CAPABILITY 为 `text+image` 或 `image→image` 的模型;白名单内两模型均支持图生图。
34
26
 
35
27
  ---
36
28
 
@@ -56,7 +48,7 @@ Panel 5 '5. CTA Always Visible': Mid-game screenshot showing normal gameplay in
56
48
 
57
49
  [STYLE_KEYWORDS]. All 5 panels are portrait-oriented mobile screenshots arranged left-to-right. Every panel has complete game UI (HUD bar, score display, buttons). Consistent art style across all panels. Thin vertical dividers between panels. Each panel has its numbered label at the top." \
58
50
  --output assets/images/storyboard/master_composite_option_A.png \
59
- --image-model [MODEL] \
51
+ --image-model mulerouter/gpt-image-2 \
60
52
  --image-size 4K
61
53
  ```
62
54
 
@@ -80,7 +72,7 @@ Panel 5 '5. CTA Always Visible': Mid-game screenshot with character dodging obst
80
72
 
81
73
  [STYLE_KEYWORDS]. All 5 panels are portrait-oriented mobile screenshots arranged left-to-right. Every panel has complete game UI. Consistent art style across all panels. Thin vertical dividers. Numbered labels at top." \
82
74
  --output assets/images/storyboard/master_composite_option_A.png \
83
- --image-model [MODEL] \
75
+ --image-model mulerouter/gpt-image-2 \
84
76
  --image-size 4K
85
77
  ```
86
78
 
@@ -104,7 +96,7 @@ Panel 5 '5. CTA Always Visible': Mid-game screenshot showing active gameplay wit
104
96
 
105
97
  Premium casual style, warm amber lighting, traditional Chinese aesthetic with modern UI, glossy tile surfaces. All 5 panels portrait-oriented, left-to-right. Every panel has complete game UI. Consistent art style. Thin vertical dividers. Numbered labels." \
106
98
  --output assets/images/storyboard/master_composite_option_A.png \
107
- --image-model [MODEL] \
99
+ --image-model mulerouter/gpt-image-2 \
108
100
  --image-size 4K
109
101
  ```
110
102
 
@@ -128,7 +120,7 @@ Panel 5 '5. CTA Always Visible': Mid-game screenshot with active combat, 'Play N
128
120
 
129
121
  [STYLE_KEYWORDS]. All 5 panels portrait-oriented left-to-right. Every panel has complete game UI. Consistent art style. Thin vertical dividers. Numbered labels at top." \
130
122
  --output assets/images/storyboard/master_composite_option_A.png \
131
- --image-model [MODEL] \
123
+ --image-model mulerouter/gpt-image-2 \
132
124
  --image-size 4K
133
125
  ```
134
126
 
@@ -184,7 +176,7 @@ Master Composite 是 Phase 1 的**第一张生成图**,通常无前序图可
184
176
  playcraft tools generate-image \
185
177
  --prompt "<5-panel prompt>" \
186
178
  --output assets/images/storyboard/master_composite_option_A.png \
187
- --image-model gpt-image-2 \
179
+ --image-model mulerouter/gpt-image-2 \
188
180
  --image-size 4K
189
181
  ```
190
182
 
@@ -197,7 +189,7 @@ playcraft tools generate-image \
197
189
  --prompt "<方案 B prompt>" \
198
190
  --output assets/images/storyboard/master_composite_option_B.png \
199
191
  --reference-image assets/images/storyboard/master_composite_option_A.png \
200
- --image-model [不同模型] \
192
+ --image-model mulerouter/nano-banana-2 \
201
193
  --image-size 4K
202
194
  ```
203
195
 
@@ -1,15 +1,26 @@
1
1
  # Designer — Style exploration flow (Phase 1, steps 2–5)
2
2
 
3
- > **Scope**: After **Step 1 — Skill Discovery** in `agents/designer.md`, follow this document for MC generation through Gate #2b STOP. **Exit criteria** for Phase 1: see `agents/designer.md` Goals § Success criteria.
3
+ > **Scope**: After **Step 1 — Skill Discovery** in `agents/designer.md`, follow this document for **image production** (MC + ASR) through Gate #2b STOP. **Exit criteria**: see `agents/designer.md` Goals § Success criteria.
4
4
  >
5
5
  > **Deliverable shapes & tables**: `refs/designer-deliverable-spec.md`.
6
6
 
7
7
  **Trigger**: `project-state.md` stage = `style_exploration`
8
8
 
9
+ ## Step 1.5 — Image Production Preflight (before MC option B+ or before ASR)
10
+
11
+ Fill `logs/designer-log.md` § **Image Production Preflight**:
12
+
13
+ 1. Read `playcraft-storyboard`, `playcraft-asset-state-sheet`, `playcraft-image-generation` (§3 + §3.1)
14
+ 2. Mark each Skill row ✓ with one-line decision summary
15
+ 3. Read `layout-spec.md` — count assetMapping rows + note Element Type Registry (if present)
16
+
17
+ **Do not generate ASR until this section is complete.**
18
+
9
19
  ## Step 2 — Generate Master Composite only (one image per option A/B[/C])
10
20
 
11
21
  - Follow `playcraft-storyboard` skill:**每格完整 9:16 H5**;`45:16` + `--width 3600 --height 1280`(2K)或 `4096×1455`(4K);**禁止 `1:1` / `10:3`**
12
- - 每个方案用不同模型(见 `refs/designer-master-composite-recipes.md`)
22
+ - **Panel 1 must show every element type** from `layout-spec` (or Element Type Registry)
23
+ - 每个方案用不同 prompt/美术方向(模型均用白名单,见 `refs/designer-master-composite-recipes.md`)
13
24
  - 生成后立即 `playcraft image info`:总比例 **width/height ≈ 2.81**,**(width÷5)/height ≈ 0.5625**;不合格则重生成
14
25
  - **Review the auto-generated `.json` sidecar** — 确认 `aspectRatio` / `imageSize` / 实际像素正确
15
26
 
@@ -22,16 +33,35 @@
22
33
  ## Step 4 — Generate ASR sheets(仅针对 `project-state.selectedMcOption`)
23
34
 
24
35
  - Read `selectedMcOption` from `docs/project-state.md` — if missing, **STOP**
25
- - Follow `playcraft-asset-state-sheet` skill
26
- - 输出两张 4K 板:`ui_state_sheet_[X].png` + `element_state_sheet_[X].png`(见 `designer-deliverable-spec.md` §2)
27
- - `--reference-image` = `master_composite_option_[selectedMcOption].png`
28
- - 生成后 `playcraft image info` 检查;若槽位重叠,必须重生成
36
+ - **Re-read** `playcraft-asset-state-sheet` + `playcraft-image-generation` §3.1 (cell chroma / isolated)
37
+ - 输出:`ui_state_sheet_[X].png` + `element_state_sheet_[X].png`(类型 >12 时可加 `element_state_sheet_[X]_2.png`)
38
+ - `--reference-image` = `master_composite_option_[selectedMcOption].png`;`--image-model` 与 MC 一致
39
+ - Prompt:sheet `#808080` 或统一色幕;每格 **one isolated element**;金/橙格用蓝幕
40
+ - 生成后 `playcraft image info`;目视:零重叠、格内无白盒/场景底
41
+ - **Do not** `remove-background` on ASR — TA handles post-crop
29
42
 
30
43
  ## Step 5 — Gate #2b Handoff Pack
31
44
 
32
45
  > **Checklist**: `refs/designer-handoff-v2-checklist.md`
33
46
 
34
47
  1. 补全 `docs/style-exploration.md`(ASR 路径、**Motion Notes**、Experience Flow)
35
- 2. 更新 `logs/designer-log.md`:**ASR Coverage Matrix**(100% contract rows)、**Palette Locked**、Style Intent / Anti-Pattern
36
- 3. 更新 handoff + `gates.#2b = pending`
37
- 4. **STOP** 禁止 Phase 2 音频与批量视觉样本 PNG
48
+ 2. 更新 `logs/designer-log.md`:
49
+ - **ASR Coverage Matrix** — 100% contract rows + **CoverageLayer** column
50
+ - 每种 **elementType** ≥1 `on-asr` `mc-crop`
51
+ - **Palette Locked**、Style Intent / Anti-Pattern
52
+ - Mirror `on-asr` rows → `atom-plan.json` → `atoms[].asrSlot`
53
+ 3. **Self-check before STOP**:
54
+
55
+ ```bash
56
+ # MC ratio
57
+ playcraft image info --input assets/images/storyboard/master_composite_option_[X].png
58
+
59
+ # Count contract rows (adjust grep to your layout-spec format)
60
+ grep -c 'elementId\|"id":' docs/layout-spec.md # approximate — Matrix row count must match
61
+
62
+ # ASR files exist
63
+ ls assets/images/reference/ui_state_sheet_[X].png assets/images/reference/element_state_sheet_[X].png
64
+ ```
65
+
66
+ 4. 更新 handoff + `gates.#2b = pending`
67
+ 5. **STOP** — 禁止 Phase 2 音频与批量视觉样本 PNG
@@ -96,7 +96,7 @@ Set `project-state.md`:
96
96
  2. `npm run dev`
97
97
  3. Re-run UI + gameplay + runtime checklists for affected areas
98
98
  4. Close blocker rows (`status: resolved`) or escalate if still wrong
99
- 5. Only then set `devStatus: ready` and stage `review`
99
+ 5. Only then set `devStatus: ui_ready` (after `ui_pass`) or `devStatus: ready` (after `gameplay_pass`) and handoff `next_orchestrator_action: "Invoke @reviewer ui_diff"` (or `load_check`)
100
100
 
101
101
  ## Dev ready checklist (`devStatus: ready` — all required)
102
102
 
@@ -1,211 +1,136 @@
1
- # Developer Integration Flow — Gameplay + Assets (L2)
1
+ # Developer Flow — ui_pass + gameplay_pass (L2)
2
2
 
3
- > **Trigger**: `docs/project-state.md` stage = `integration`. Agent context + STOP rules: [`../developer.md`](../developer.md).
4
- > **Prerequisites**: Production Pipeline Wave 1 (Designer Ph.2) + Wave 2 (TA) both `done`; TA Compliance green; contract paths have real files on disk.
3
+ > **Trigger**: `docs/project-state.md` stage = `ui_pass`, `ui_rework`, or `gameplay_pass`.
4
+ > Agent context + STOP rules: [`../developer.md`](../developer.md).
5
5
 
6
- > **Before implementation**, read [`developer-impl-cookbook.md`](./developer-impl-cookbook.md) for PGS patterns, `index.html` skeleton, CTA handler, and **atlas binding** (`atlasPath` + `frameId` + WebP + JSON sidecar). Dev ready gate: [`developer-dev-handoff.md`](./developer-dev-handoff.md).
6
+ ---
7
7
 
8
- ## Step 0: Upstream Intake (mandatory, before Spec Quick-Check)
8
+ # Part A: ui_pass (UI shell only)
9
9
 
10
- > **Purpose:** Know what happened before `integration` PM contracts, Designer visual lock, TA delivery so gameplay and UI match intent.
10
+ > **Goal:** Runnable UI matching MCscene switching, asset binding, simple states. **No core gameplay rules.**
11
11
 
12
- Read each file (Read tool or shell), then fill **`logs/developer-log.md` § Upstream Intake** before any `game/` edit or Spec Quick-Check.
12
+ ## Step 0: Upstream Intake (mandatory)
13
13
 
14
- ```bash
15
- cat docs/project-state.md
16
- cat docs/design-brief.md
17
- cat docs/layout-spec.md
18
- cat docs/atom-plan.json docs/atom-plan.md
19
- cat docs/style-exploration.md
20
- cat logs/designer-log.md
21
- cat logs/ta-log.md
22
- # Spot-check contract paths exist:
23
- ls assets/images/ assets/audio/ assets/bundles/ assets/models/ 2>/dev/null | head
24
- ```
14
+ Read each file; fill **`logs/developer-log.md` § Upstream Intake** before any `game/` edit.
25
15
 
26
- | Doc | You need from it (one line in developer-log) |
16
+ | Doc | You need from it |
27
17
  | ------------------- | -------------------------------------------------- |
28
- | `project-state` | Pipeline complete, `devBlockers`, dev fields |
29
- | `design-brief` | Gameplay type, flow, first-level success, Near-Win |
18
+ | `project-state` | Wave 2 done, stage `ui_pass`, dev fields |
19
+ | `design-brief` | Experience flow scene names (for navigation only) |
30
20
  | `layout-spec` | Zones, elementIds, assetMapping, atlasPath/frameId |
31
- | `atom-plan.json` | Developer atoms, `skillRef`, `dependsOn`(机器源) |
32
- | `atom-plan.md` | Acceptance criteria + Impl/Asset/TA Context |
33
- | `style-exploration` | MC + experience flow input for Step 2 mapping |
34
- | `designer-log` | Palette / motion / ASR coverage notes |
35
- | `ta-log` | Compliance status, atlas params |
36
-
37
- **MUST NOT** proceed to Step 1 until every row is ticked with a concrete takeaway.
38
-
39
- ---
21
+ | `atom-plan.json` | Developer atoms, skillRef, dependsOn |
22
+ | `atom-plan.md` | Acceptance + Impl Context |
23
+ | `style-exploration` | MC panelsprimary UI reference |
24
+ | `designer-log` | Palette / motion notes |
25
+ | `ta-log` | Compliance / atlas params |
40
26
 
41
- ## Step 1: Spec Quick-Check (30s, mandatory)
27
+ ## Step 1: Spec Quick-Check (30s)
42
28
 
43
- > Formerly Step 0a.
29
+ - Every referenced `elementId` exists in `assetMapping`
30
+ - Gaps → `spec-gap` in project-state → wait for PM
44
31
 
45
- Before any implementation, validate Layout Spec:
32
+ ## Step 2: Experience Flow → Code Mapping
46
33
 
47
- - Every GameplayAtom's referenced `elementId` exists in `assetMapping`
48
- - Every code-referenced path has a corresponding assetMapping entry
49
- - If gaps found → write `spec-gap` to `project-state.md`, wait for PM to supplement (≤ 5 min)
34
+ Write to `developer-log.md` map MC panels to scenes (Hook / Tutorial / EndCard / CTA). See template.
50
35
 
51
- ## Step 2: Experience Flow Visual Mapping (mandatory)
36
+ ## Step 3: Skill Preflight + Scaffold
52
37
 
53
- > Formerly Step 0c.
38
+ Per `atom-plan.json` Developer `skillRef` entries — read `.claude/skills/<skillRef>/` or CLI fallback; run `playcraft skills scaffold --out ./game` once.
54
39
 
55
- **Read `docs/style-exploration.md` Master Composite + experience flow design before any implementation.**
40
+ Fill **`§ Skill Preflight`** in developer-log.
56
41
 
57
- The Master Composite is five 9:16 panels in one image: **Panel 1 = concept panel** (Main Gameplay — full UI + all element types); **Panels 2–5 = storyboard** (Hook, Onboarding, End Card, CTA). TA extracts from concept panel / ASR state sheets; study each panel for per-stage visual intent.
42
+ ## Step 3b: UI Pass Plan (mandatory before `game/` edits)
58
43
 
59
- Write to `logs/developer-log.md` "Experience Flow Code Mapping":
44
+ Write **`logs/developer-log.md` § UI Pass Plan**:
60
45
 
61
- | Storyboard Frame | Scene/State | Code Location | Visual Intent |
62
- | ------------------------- | ---------------- | ------------------------- | ------------------------------------------------------- |
63
- | Hook (0-3s) | `scene.hook` | `game/scenes/hook.ts` | {{from storyboard: contrast, pace, first interaction}} |
64
- | Tutorial (3-10s) | `scene.tutorial` | `game/scenes/tutorial.ts` | {{from storyboard: low pressure, guaranteed success}} |
65
- | Gameplay+NearWin (10-25s) | `scene.gameplay` | `game/scenes/gameplay.ts` | {{from storyboard: core mechanic, near-win visual cue}} |
66
- | EndCard (25-30s) | `scene.endcard` | `game/scenes/endcard.ts` | {{from storyboard: CTA prominence, unresolved emotion}} |
46
+ 1. **Architecture** engine, entry, scene flow
47
+ 2. **Scene-Asset Binding Plan** verify every path with `ls`
48
+ 3. **Scene navigation** how Reviewer reaches each MC panel (URL param or button)
49
+ 4. **Risk Checklist** all `[x]`
67
50
 
68
- **Rules**:
51
+ **Forbidden in ui_pass:** PGS rules, scoring, elimination, win/lose, Near-Win logic.
69
52
 
70
- - Every scene file MUST have a top comment: `// Visual reference: Master Composite (frame: [position])`
71
- - If storyboard visuals conflict with layout-spec zones → storyboard takes precedence; ask PM in `intent-clarifications.md`
72
- - Visual Intent captures EMOTION and ATTENTION FLOW, not just mechanics
53
+ Hook validates § UI Pass Plan on STOP.
73
54
 
74
- ## Step 3: 读活 DAG + Skill Discovery + 统一 Scaffold(必须先做,只做一次)
55
+ ## Step 4: Implement UI shell
75
56
 
76
- > Formerly Step 0b.
57
+ - Bind **real** assets at contract paths (WebP atlas + JSON sidecar)
58
+ - Implement scenes + `index.html` skeleton (see [`developer-impl-cookbook.md`](./developer-impl-cookbook.md))
59
+ - Scene switching only — static/simple interactive states OK
60
+ - Text-as-image per `playcraft-text-rendering` skill
77
61
 
78
- **第一步:读取骨架与已有上下文**
62
+ ## Step 5: Dev self-check (ui_pass)
79
63
 
80
64
  ```bash
81
- cat docs/design-brief.md # gameplayType, engine, StyleDirection
82
- cat docs/atom-plan.json # atoms[] skillRef + dependsOn
83
- cat docs/atom-plan.md # Asset Skill Context + acceptance criteria
65
+ npm run dev
84
66
  ```
85
67
 
86
- **第二步:读取 PM 已标注的 skillRef 内容(必须)**
87
-
88
- > **Skill 获取优先级**(见 [`atom-plan-format.md`](../../../docs/team/atom-plan-format.md)):
89
- >
90
- > 1. **Project Skills**(PM 已执行 `playcraft skills link`):`.claude/skills/<skillRef>/SKILL.md` + `ref/`
91
- > 2. **兜底**:软链不存在或断链 → `playcraft skills read <skillRef>`(自动读 `playcraft.config.json` → `skillsDir`)
92
- > 3. `skillRef` 为空 → 独立 `playcraft skills match` 搜索
93
- > 4. 完全无匹配 → `playcraft-research` 后自行实现
68
+ - All MC-reachable scenes render with real assets
69
+ - No white screen; layout matches zones
70
+ - Record devUrl in developer-log
94
71
 
95
- `atoms[]` 中每个 `assignTo: Developer` 且 `skillRef` 非空的 atom,逐一读取 Recipe:
72
+ ## Step 6: ui_pass STOP
96
73
 
97
- ```bash
98
- # 优先:项目内软链(PM 应在 Gate #1 前已 link)
99
- test -f .claude/skills/memory_match.aigameplay/SKILL.md && echo "linked OK"
74
+ - `devStatus: ui_ready` (not `ready`)
75
+ - handoff: `Invoke @reviewer ui_diff`
76
+ - **Do not** set mainline `stage`
100
77
 
101
- # 读 Recipe(二选一,link 正常时用文件路径即可)
102
- cat .claude/skills/memory_match.aigameplay/SKILL.md
103
-
104
- # 仅当上面 test 失败时兜底:
105
- playcraft skills read memory_match.aigameplay
106
- ```
78
+ ---
107
79
 
108
- **访问 ref/ 文件**(同样优先 Project Skills):
80
+ # Part B: ui_rework
109
81
 
110
- ```bash
111
- cat .claude/skills/memory_match.aigameplay/ref/pgs-schema.json
82
+ 1. Read `logs/review-report.md` UI Diff section
83
+ 2. Fix only Action Items with `routeTo: Developer`
84
+ 3. Re-run `npm run dev` → `devStatus: ui_ready` → handoff `Invoke @reviewer ui_diff`
112
85
 
113
- # 兜底:playcraft skills read 输出的 skillDir,或 playcraft.config.json 中的 skillsDir
114
- # cat <skillsDir>/memory_match.aigameplay/ref/pgs-schema.json
115
- ```
86
+ If `routeTo: ta` or `designer` STOP; orchestrator invokes them first.
116
87
 
117
- 不读 SKILL.md 就 scaffold 或实现 = 丢弃 PM 的规则蓝图。Skill Preflight 须记录每个 `skillRef` 用的是 `linked` 还是 `cli-fallback`。
88
+ ---
118
89
 
119
- **STOP 门槛**:`logs/developer-log.md` **§ Skill Preflight** 必须已填(每个 `skillRef` 一行 + CLI 输出摘要)。未填则不得编辑 `game/**`,不得将 atom 标为 `done`,handoff 不得写 Ph.1 完成。
90
+ # Part C: gameplay_pass (core gameplay)
120
91
 
121
- **第三步:补充搜索你域内的 Skills**
92
+ > **Prerequisites:** `uiReviewStatus: passed` (or max ui rework rounds). **Do not rewrite UI layout.**
122
93
 
123
- ```bash
124
- # 按引擎 + 玩法类型搜索(可发现 PM 未找到的组件层 Skill)
125
- playcraft skills match --engine <engine> --intent "<gameplayType>,rules,algorithm" --json
126
- # 搜索代码组件层
127
- playcraft skills match --engine <engine> --intent "<layout>,<ui_components>,<state>" --json
128
- # 列出配置封包
129
- playcraft skills list --category config --json
130
- ```
94
+ ## Step 0: Read UI baseline
131
95
 
132
- **第四步:富集 `## Impl Skill Context`(写入 atom-plan.md)**
96
+ - Confirm `devStatus` was `ui_ready` / UI diff passed
97
+ - Read existing `game/` scenes — extend, do not replace layout
133
98
 
134
- ```markdown
135
- ### {{atom_id}} — {{slot_name}}
99
+ ## Step 1: Gameplay Pass Plan (mandatory)
136
100
 
137
- - 实现方案:(简述,基于 SKILL.md Recipe)
138
- - 匹配 Skills:`memory_match.aigameplay` — 提供 PGS 规则 schema + reducer 接口约束
139
- - ref 文件:ref/pgs-schema.json(规则骨架)、ref/reducer.template.ts(接口模板)
140
- - Scaffold 路径:game/gameplay/reducer.ts
141
- - 实现决策:与 Skill 模板的差异点(如网格从 4×4 改为 4×3)
142
- ```
101
+ Write **`logs/developer-log.md` § Gameplay Pass Plan**:
143
102
 
144
- **第五步:统一 Scaffold(一次性执行,不拆分)**
103
+ 1. **PGS Strategy** — rules from design-brief + Skill recipe
104
+ 2. **First level guarantee** — how tutorial/config ensures win
105
+ 3. **State machine** — Hook → Tutorial → Gameplay → EndCard transitions with logic
106
+ 4. **Risk Checklist** — all `[x]`
145
107
 
146
- ```bash
147
- playcraft skills scaffold \
148
- --engine <engine> \
149
- --atoms <skillRef1>,<skillRef2>,<skillRef3> \
150
- --out ./game
151
- ```
108
+ Hook validates § Gameplay Pass Plan on STOP.
152
109
 
153
- 注:scaffold 对标注了 `merge-json` 的文件(package.json / tsconfig.json)会自动合并而非覆盖。
110
+ ## Step 2: Implement GameplayAtom + ConfigAtom
154
111
 
155
- 若某 Atom 本地无结果:参阅 `playcraft-research` SKILL 执行定向网络研究 → 写入 Impl Skill Context → 标注"候选新 Skill" → 基于研究方案实现。
112
+ - Write testCases FIRST
113
+ - Core rules, scoring, Near-Win, CTA handler
114
+ - First level MUST guarantee player success
156
115
 
157
- ## Step 4: Validate Prerequisites
116
+ ## Step 3: Dev self-check (gameplay_pass)
158
117
 
159
118
  ```bash
160
- ls docs/project-state.md docs/design-brief.md docs/layout-spec.md docs/atom-plan.md
161
- ```
162
-
163
- Verify: stage is `integration`, Production Pipeline Wave 2 = `done`, you have atoms with `assignTo: Developer`, Layout Spec has element IDs / grid size / zones.
164
-
165
- **Use real assets on disk** at Asset Contract paths from `assetMapping` (TA Wave 2 must have completed):
166
-
167
- ```
168
- Layout Spec assetMapping:
169
- { elementId: "strawberry", visualAsset: "assets/images/tiles/strawberry_atlas.webp", frameId: "strawberry_01" }
170
-
171
- Your code:
172
- loadAtlas('assets/images/tiles/strawberry_atlas.webp', 'assets/images/tiles/strawberry_atlas.json', 'strawberry_01')
173
-
174
- If file missing → devStatus: blocked_upstream, routeTo TA (do not placeholder)
119
+ npm run dev
175
120
  ```
176
121
 
177
- ## Step 5: Implement GameplayAtom + ConfigAtom
178
-
179
- - **GameplayAtom**: entities from `colorPalette.tileColors[].id`, rules from design-brief flow, write testCases FIRST
180
- - **ConfigAtom**: number of levels, difficulty progression, score targets — **first level MUST guarantee player success**
181
-
182
- ## Text-as-Image Rendering
183
-
184
- **All visible text in the game is image assets — no font files, no CSS text.** Static text is loaded as images from `layout-spec.md` `textAssets` paths. Dynamic numbers use a Digit Sprite Strip with runtime frame-cutting.
122
+ - Gameplay loop works; CTA fires; audio loads
123
+ - Record devUrl
185
124
 
186
- > **Invoke the `playcraft-text-rendering` skill** for the full spec, rendering code templates (Canvas 2D + PlayCanvas), alignment helpers, and per-role responsibilities.
125
+ ## Step 4: gameplay_pass STOP
187
126
 
188
- ## Step 6: Write index.html Skeleton
127
+ - `devStatus: ready`
128
+ - handoff: `Invoke @reviewer load_check`
129
+ - **Do not** set Gate #3 or `stage: done`
189
130
 
190
- > **Read [`developer-impl-cookbook.md`](./developer-impl-cookbook.md)** for the complete skeleton with multi-platform CTA handler.
191
-
192
- Key requirements: viewport meta with `user-scalable=no`, CTA handler with mraid/FbPlayableAd/ExitApi fallbacks, all CSS/JS inline.
193
-
194
- ## Step 7: Early Dev smoke (recommended)
195
-
196
- After scaffold + core scenes exist:
197
-
198
- ```bash
199
- cat package.json # confirm scripts.dev exists
200
- npm run dev
201
- ```
202
-
203
- Fix fatal errors early. Record devUrl in `developer-log.md` when useful.
204
-
205
- ## Step 8: Integration completion
131
+ ---
206
132
 
207
- > **Exit criteria**: see [`../developer.md`](../developer.md) → **Goals** → `integration` row.
133
+ ## Shared references
208
134
 
209
- 1. All GameplayAtom + ConfigAtom marked `done` in `atom-plan.json` `atoms[]`
210
- 2. `developer-log.md` includes Experience Flow → Code Mapping + **UI/gameplay self-check notes**
211
- 3. Complete [`developer-dev-handoff.md`](./developer-dev-handoff.md) → `devStatus: ready` + devUrl → handoff `Invoke @reviewer` — **do not** set `stage: review` yourself.
135
+ - PGS patterns, CTA, atlas binding: [`developer-impl-cookbook.md`](./developer-impl-cookbook.md)
136
+ - Dev ready gate details: [`developer-dev-handoff.md`](./developer-dev-handoff.md)
@@ -141,7 +141,9 @@ Design the shared contract between Designer, TA, and Developer:
141
141
  3. **Asset specifications** — size, format, naming for each type
142
142
  4. **Asset mapping** — element ID → file path (the integration bridge)
143
143
 
144
- **Critical**: `assetMapping` paths are **locked after Gate #1**. No agent may unilaterally change paths — this is the Asset Contract: TA fills paths in production Wave 2; Developer binds **real files** in `integration` after TA Compliance green.
144
+ **Critical**: `assetMapping` paths are **locked after Gate #1**. No agent may unilaterally change paths — this is the Asset Contract: TA fills paths in production Wave 2; Developer binds **real files** in `ui_pass` after TA Compliance green.
145
+
146
+ **Transparency**: TA auto-derives transparency requirements from `assetMapping` path conventions (`bg/` = opaque, `ui/`/`vfx/`/`txt/` = needs alpha, `tiles/` = needs alpha unless card faces). PM does NOT need to define transparency fields — chroma key selection and background removal are TA's technical domain. See `ta-pipeline-cookbook.md` Step 0e.
145
147
 
146
148
  ---
147
149
 
@@ -161,6 +163,22 @@ Single-element groups stay as single-file paths; do not invent atlases for one t
161
163
 
162
164
  ---
163
165
 
166
+ ## Element Type Registry + ASR budget (Gate #1)
167
+
168
+ After atlas groups, add **§ Element Type Registry** in `layout-spec.md`:
169
+
170
+ - Group variant elementIds under a shared `typeId` (e.g. `tile` → red/blue/green ids)
171
+ - Count **unique types** — target **≤ 20** for playable ads
172
+ - ASR physical slot budget: ~12 ui + ~12 element states; overflow → second element sheet or mc-crop/ta-extends plan
173
+ - If user request implies >20 types, PM degrades or splits variants to TA-extends in Gate #1 options
174
+
175
+ Pre-Write checklist addition:
176
+
177
+ - [ ] Element Type Registry present; unique type count documented
178
+ - [ ] Variant-only ids marked for TA-extends in Designer handoff notes (optional one line in atom-plan.md)
179
+
180
+ ---
181
+
164
182
  ## Step 7: Experience Flow Design
165
183
 
166
184
  Design each stage with four fields — from "what happens" to "what the player feels" (MDA player perspective):
@@ -242,7 +260,7 @@ playcraft skills link --from-atom-plan --prune
242
260
  - `validate-atom-plan`:PM 定稿前手动跑;**PM STOP** 时 hook 再拦一层(invalid skillRef 无法 STOP)。
243
261
  - `link`:读取 `atom-plan.json` 中所有非空 `skillRef`。
244
262
 
245
- **PM does not** pre-fill `atom-plan.md` § Impl Skill Context — **Developer** in `integration`.
263
+ **PM does not** pre-fill `atom-plan.md` § Impl Skill Context — **Developer** in `ui_pass` / `gameplay_pass`.
246
264
 
247
265
  ### 8e. `atom-plan.md`(可选)
248
266
 
@@ -403,6 +421,10 @@ Scheduling:
403
421
  - [ ] Every group with **≥ 2** raster elements names **one** `.webp` + **one** `.json` path in `assetMapping`
404
422
  - [ ] Audio entries specify **`.mp3`** paths where applicable
405
423
 
424
+ **Transparency (no PM action needed)**:
425
+
426
+ - [ ] `assetMapping` paths follow directory conventions (`bg/` for backgrounds, `ui/` for overlays, `vfx/` for effects, `txt/` for text images, `tiles/` for game elements) — TA derives transparency requirements from these paths automatically
427
+
406
428
  ---
407
429
 
408
430
  ## Design North Star