@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,37 @@
1
+ # Designer — Style exploration flow (Phase 1, steps 2–5)
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.
4
+ >
5
+ > **Deliverable shapes & tables**: `refs/designer-deliverable-spec.md`.
6
+
7
+ **Trigger**: `project-state.md` stage = `style_exploration`
8
+
9
+ ## Step 2 — Generate Master Composite only (one image per option A/B[/C])
10
+
11
+ - 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`)
13
+ - 生成后立即 `playcraft image info`:总比例 **width/height ≈ 2.81**,**(width÷5)/height ≈ 0.5625**;不合格则重生成
14
+ - **Review the auto-generated `.json` sidecar** — 确认 `aspectRatio` / `imageSize` / 实际像素正确
15
+
16
+ ## Step 3 — Gate #2a package(MC 选型材料)
17
+
18
+ 1. 写入 `docs/style-exploration.md` 的 **Master Composite 部分**(每套方案的路径、风格关键词、体验流文字说明;**此时不写 ASR 路径**)
19
+ 2. 更新 handoff + `gates.#2a = pending`(见 `agents/designer.md` **Runtime**)
20
+ 3. **STOP** — 禁止 ASR(资产状态参考精灵图板)
21
+
22
+ ## Step 4 — Generate ASR sheets(仅针对 `project-state.selectedMcOption`)
23
+
24
+ - 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` 检查;若槽位重叠,必须重生成
29
+
30
+ ## Step 5 — Gate #2b Handoff Pack
31
+
32
+ > **Checklist**: `refs/designer-handoff-v2-checklist.md`
33
+
34
+ 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
@@ -0,0 +1,109 @@
1
+ # Developer Dev Handoff (L2)
2
+
3
+ Use during **Phase 2 integration** and before marking `devStatus: ready`.
4
+
5
+ ## Dev command
6
+
7
+ ```bash
8
+ cat package.json # read scripts.dev (webpack / vite / etc.)
9
+ npm run dev
10
+ ```
11
+
12
+ - **Not** `playcraft start` — Dev is the project's `scripts.dev`.
13
+ - Record the URL from terminal output (e.g. `http://localhost:5173`) in `project-state.md` → `devUrl`.
14
+ - Prefer leaving the server running for Reviewer; if it stops, Reviewer or orchestrator may restart and refresh `devUrl`.
15
+
16
+ ## Dev iteration rhythm
17
+
18
+ During integration, repeat:
19
+
20
+ 1. Change code / wire assets
21
+ 2. `npm run dev` (restart if HMR is insufficient)
22
+ 3. Self-check UI + gameplay + runtime (checklists below)
23
+ 4. Log in `developer-log.md` → **Dev self-check**
24
+ 5. If upstream issue → blockers + ICP + STOP (orchestrator routes TA/Designer)
25
+
26
+ **Do not** wait until the last minute for a single Dev pass.
27
+
28
+ ## UI checklist (vs MC + layout-spec)
29
+
30
+ | Check | Source |
31
+ | -------------------------------------------------- | --------------------------------------- |
32
+ | Zones and hierarchy match layout-spec | `docs/layout-spec.md` |
33
+ | Colors / mood match approved style | `docs/style-exploration.md`, Gate #2 MC |
34
+ | Element placement matches storyboard Visual Intent | Master Composite frames |
35
+ | Text-as-image assets visible, correct aspect | `assetMapping` paths |
36
+ | No broken images / wrong sprites / style drift | Dev browser |
37
+ | Mobile viewport (e.g. 750×1334) acceptable | Dev browser resize |
38
+
39
+ ## Gameplay checklist (vs design-brief + PGS)
40
+
41
+ | Check | Source |
42
+ | ------------------------------------------ | ---------------------- |
43
+ | Hook → Tutorial → Gameplay → End Card flow | `docs/design-brief.md` |
44
+ | Rules, scoring, win/lose match PM contract | design-brief + PGS |
45
+ | **First level guaranteed success** | atom-plan / PGS |
46
+ | Near-Win and difficulty feel as specified | design-brief |
47
+ | CTA on End Card | runtime test |
48
+
49
+ ## Runtime checklist
50
+
51
+ - No white screen or blocking console errors
52
+ - Full playthrough without dead ends
53
+ - BGM/SFX at correct events
54
+ - State machine stable; CTA handler fires (`mraid` / `FbPlayableAd` / `ExitApi` as applicable)
55
+
56
+ ## devUrl recording
57
+
58
+ In `docs/project-state.md` → **Dev Preview**:
59
+
60
+ | Field | When |
61
+ | ---------------- | ---------------------------------------------------- |
62
+ | `devUrl` | After `npm run dev` shows listening URL |
63
+ | `devStatus` | `pending` → `ready` or `blocked_upstream` / `failed` |
64
+ | `devStartedBy` | `developer` |
65
+ | `devLastChecked` | ISO timestamp after each meaningful Dev pass |
66
+
67
+ Also note devUrl in `docs/developer-log.md` → **Dev self-check**.
68
+
69
+ ## Upstream blocker template
70
+
71
+ Add to `developer-log.md` → **## Upstream blockers**:
72
+
73
+ ```markdown
74
+ | Path | Issue | Expected | routeTo | Status |
75
+ | ----------------- | ------- | ---------------------------------- | ------- | ------ |
76
+ | assets/ui/foo.png | missing | 256×256 PNG per layout-spec zone A | TA | open |
77
+ ```
78
+
79
+ In `docs/intent-clarifications.md`:
80
+
81
+ - **Context**: what Dev showed (screenshot description or path)
82
+ - **Gap**: vs MC / contract / design-brief
83
+ - **Acceptance**: exact path, dimensions, style, or audio mood required
84
+ - **routeTo**: TA | Designer | PM
85
+
86
+ Set `project-state.md`:
87
+
88
+ - `devStatus: blocked_upstream`
89
+ - `devBlockers`: same rows as log
90
+
91
+ **STOP** after filing — wait for orchestrator to re-invoke upstream role, then **re-run Dev loop**.
92
+
93
+ ## After rework — re-verify checklist
94
+
95
+ 1. Confirm blocker paths exist on disk (`ls`, `playcraft image info` if needed)
96
+ 2. `npm run dev`
97
+ 3. Re-run UI + gameplay + runtime checklists for affected areas
98
+ 4. Close blocker rows (`status: resolved`) or escalate if still wrong
99
+ 5. Only then set `devStatus: ready` and stage → `review`
100
+
101
+ ## Dev ready checklist (`devStatus: ready` — all required)
102
+
103
+ - [ ] UI checklist pass in Dev
104
+ - [ ] Gameplay checklist pass in Dev
105
+ - [ ] Runtime checklist pass in Dev
106
+ - [ ] No open rows in Upstream blockers / `devBlockers`
107
+ - [ ] `devUrl` recorded and server reachable
108
+ - [ ] `developer-log.md` Dev self-check complete
109
+ - [ ] **Not** required: `playcraft build`, user running terminal commands
@@ -0,0 +1,134 @@
1
+ # Developer Implementation Cookbook
2
+
3
+ > Read before writing index.html (Phase 1 Step 4) and during Phase 2 asset integration. Contains index.html skeleton, CTA handler patterns, and integration binding checklist.
4
+
5
+ ## Atlas binding (Phase 1 + Phase 2)
6
+
7
+ When `layout-spec` (or atom-plan handoff) defines **`atlasPath` + `frameId`** for an element or tile set, treat it as the source of truth for sprite geometry — **not** ad-hoc single-file crops.
8
+
9
+ - **Load the atlas image** as **WebP** at the path given by `atlasPath` (or the paired TA-delivered file beside the JSON).
10
+ - **Load the frame map** from the **JSON sidecar** shipped with the atlas (frame rectangles / pivots / names keyed by `frameId`).
11
+ - **Phase 1**: stub or procedural placeholders are acceptable only where the contract is path + id; still wire code to read `atlasPath` / `frameId` so Phase 2 is a file drop-in.
12
+ - **Phase 2**: verify WebP + JSON exist at the contract paths, then bind textures using `frameId` → sub-rect from the sidecar (same pattern in Integration checklist below).
13
+
14
+ ---
15
+
16
+ ## index.html Skeleton (Phase 1)
17
+
18
+ ```html
19
+ <!DOCTYPE html>
20
+ <html lang="en">
21
+ <head>
22
+ <meta charset="UTF-8" />
23
+ <meta
24
+ name="viewport"
25
+ content="width=device-width, initial-scale=1.0, user-scalable=no"
26
+ />
27
+ <title>Playable Ad</title>
28
+ <style>
29
+ * {
30
+ margin: 0;
31
+ padding: 0;
32
+ box-sizing: border-box;
33
+ }
34
+ html,
35
+ body {
36
+ width: 100%;
37
+ height: 100%;
38
+ overflow: hidden;
39
+ }
40
+ canvas {
41
+ display: block;
42
+ width: 100%;
43
+ height: 100%;
44
+ }
45
+ </style>
46
+ </head>
47
+ <body>
48
+ <canvas id="game"></canvas>
49
+ <script>
50
+ // Game initialization — asset loading will be added in Phase 2
51
+ // Gameplay logic from game/gameplay/
52
+ // Config from game/config/
53
+
54
+ // CTA handler (required — multi-platform fallback)
55
+ function onCTAClick() {
56
+ if (typeof mraid !== "undefined") {
57
+ mraid.open("{{store_url}}");
58
+ } else if (typeof FbPlayableAd !== "undefined") {
59
+ FbPlayableAd.onCTAClick();
60
+ } else if (typeof ExitApi !== "undefined") {
61
+ ExitApi.exit();
62
+ } else {
63
+ window.open("{{store_url}}");
64
+ }
65
+ }
66
+ </script>
67
+ </body>
68
+ </html>
69
+ ```
70
+
71
+ **Phase 2 additions**: add asset loading (inline base64 or relative paths), connect gameplay logic, wire audio triggers, ensure ALL resources are inline (zero external requests).
72
+
73
+ ---
74
+
75
+ ## Phase 2: Asset Integration Binding Checklist
76
+
77
+ Connect Designer's assets to gameplay code:
78
+
79
+ | Check | Source |
80
+ | -------------------------------------------------------------------- | ---------------------- |
81
+ | Every `tileColors[].id` has image file at `assetMapping.visualAsset` | layout-spec + `ls` |
82
+ | Board position = `zones["board"].rect` | layout-spec |
83
+ | Tile size = `assetSpec.tileSize` | layout-spec |
84
+ | All sfx files exist per `assetMapping` | layout-spec + `ls` |
85
+ | Background at correct path | layout-spec + `ls` |
86
+ | Sprite sheet atlas bound with JSON frame data | atom-plan + TA handoff |
87
+
88
+ **Binding pattern**:
89
+
90
+ 1. Load images at paths from `assetMapping`; for atlas-backed assets, load **WebP atlas + JSON sidecar** and resolve **`frameId`** from `layout-spec` (see § Atlas binding).
91
+ 2. Bind visuals to game entities: element ID → texture (or atlas sub-rect)
92
+ 3. Bind audio to gameplay events: match → sfx, level complete → success sfx
93
+ 4. Position elements per `zones[].rect` coordinates
94
+
95
+ ---
96
+
97
+ ## Phase 2: Dev iteration (integration complete)
98
+
99
+ | Requirement | How to Verify |
100
+ | ------------------------------------ | ------------------------------------------------------------- |
101
+ | Entry point: `game/index.html` | `ls game/index.html` |
102
+ | All asset references: relative paths | Read game code |
103
+ | No Node.js APIs | Code review |
104
+ | No dynamic imports or CDN references | `grep -r "import(" game/` |
105
+ | Zero external requests in Dev | Browser console + `grep -r "http" game/` |
106
+ | UI + gameplay + runtime in Dev | `npm run dev` + checklists in `refs/developer-dev-handoff.md` |
107
+ | No open upstream blockers | `developer-log.md` + `project-state.devBlockers` |
108
+
109
+ ```bash
110
+ npm run dev
111
+ # Record devUrl in project-state.md; leave server running for Reviewer when possible
112
+ ```
113
+
114
+ > **`playcraft build` is not required** for `devStatus: ready` or project `done`. See `refs/developer-dev-handoff.md` for Dev ready checklist.
115
+
116
+ ---
117
+
118
+ ## PGS Implementation Pattern
119
+
120
+ ```
121
+ 1. Load reference: playcraft skills match --engine <engine> --intent "<gameplay>" --json
122
+ 2. Write PGS JSON:
123
+ - entities[] — from layout-spec colorPalette.tileColors[].id
124
+ - rules[] — from design-brief experience flow
125
+ - algorithm{} — matching/gravity/refill logic
126
+ - testCases[] — write FIRST, then implement rules
127
+ 3. Validate logic passes all testCases
128
+ ```
129
+
130
+ Key constraints (all from layout-spec, NOT invented):
131
+
132
+ - Grid dimensions = `zones["board"].rect` / `assetSpec.tileSize`
133
+ - Element types = `colorPalette.tileColors[]`
134
+ - Element IDs = `colorPalette.tileColors[].id`
@@ -0,0 +1,136 @@
1
+ # Developer Flow — ui_pass + gameplay_pass (L2)
2
+
3
+ > **Trigger**: `docs/project-state.md` stage = `ui_pass`, `ui_rework`, or `gameplay_pass`.
4
+ > Agent context + STOP rules: [`../developer.md`](../developer.md).
5
+
6
+ ---
7
+
8
+ # Part A: ui_pass (UI shell only)
9
+
10
+ > **Goal:** Runnable UI matching MC — scene switching, asset binding, simple states. **No core gameplay rules.**
11
+
12
+ ## Step 0: Upstream Intake (mandatory)
13
+
14
+ Read each file; fill **`logs/developer-log.md` § Upstream Intake** before any `game/` edit.
15
+
16
+ | Doc | You need from it |
17
+ | ------------------- | -------------------------------------------------- |
18
+ | `project-state` | Wave 2 done, stage `ui_pass`, dev fields |
19
+ | `design-brief` | Experience flow scene names (for navigation only) |
20
+ | `layout-spec` | Zones, elementIds, assetMapping, atlasPath/frameId |
21
+ | `atom-plan.json` | Developer atoms, skillRef, dependsOn |
22
+ | `atom-plan.md` | Acceptance + Impl Context |
23
+ | `style-exploration` | MC panels — primary UI reference |
24
+ | `designer-log` | Palette / motion notes |
25
+ | `ta-log` | Compliance / atlas params |
26
+
27
+ ## Step 1: Spec Quick-Check (30s)
28
+
29
+ - Every referenced `elementId` exists in `assetMapping`
30
+ - Gaps → `spec-gap` in project-state → wait for PM
31
+
32
+ ## Step 2: Experience Flow → Code Mapping
33
+
34
+ Write to `developer-log.md` — map MC panels to scenes (Hook / Tutorial / EndCard / CTA). See template.
35
+
36
+ ## Step 3: Skill Preflight + Scaffold
37
+
38
+ Per `atom-plan.json` Developer `skillRef` entries — read `.claude/skills/<skillRef>/` or CLI fallback; run `playcraft skills scaffold --out ./game` once.
39
+
40
+ Fill **`§ Skill Preflight`** in developer-log.
41
+
42
+ ## Step 3b: UI Pass Plan (mandatory before `game/` edits)
43
+
44
+ Write **`logs/developer-log.md` § UI Pass Plan**:
45
+
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]`
50
+
51
+ **Forbidden in ui_pass:** PGS rules, scoring, elimination, win/lose, Near-Win logic.
52
+
53
+ Hook validates § UI Pass Plan on STOP.
54
+
55
+ ## Step 4: Implement UI shell
56
+
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
61
+
62
+ ## Step 5: Dev self-check (ui_pass)
63
+
64
+ ```bash
65
+ npm run dev
66
+ ```
67
+
68
+ - All MC-reachable scenes render with real assets
69
+ - No white screen; layout matches zones
70
+ - Record devUrl in developer-log
71
+
72
+ ## Step 6: ui_pass STOP
73
+
74
+ - `devStatus: ui_ready` (not `ready`)
75
+ - handoff: `Invoke @reviewer ui_diff`
76
+ - **Do not** set mainline `stage`
77
+
78
+ ---
79
+
80
+ # Part B: ui_rework
81
+
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`
85
+
86
+ If `routeTo: ta` or `designer` — STOP; orchestrator invokes them first.
87
+
88
+ ---
89
+
90
+ # Part C: gameplay_pass (core gameplay)
91
+
92
+ > **Prerequisites:** `uiReviewStatus: passed` (or max ui rework rounds). **Do not rewrite UI layout.**
93
+
94
+ ## Step 0: Read UI baseline
95
+
96
+ - Confirm `devStatus` was `ui_ready` / UI diff passed
97
+ - Read existing `game/` scenes — extend, do not replace layout
98
+
99
+ ## Step 1: Gameplay Pass Plan (mandatory)
100
+
101
+ Write **`logs/developer-log.md` § Gameplay Pass Plan**:
102
+
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]`
107
+
108
+ Hook validates § Gameplay Pass Plan on STOP.
109
+
110
+ ## Step 2: Implement GameplayAtom + ConfigAtom
111
+
112
+ - Write testCases FIRST
113
+ - Core rules, scoring, Near-Win, CTA handler
114
+ - First level MUST guarantee player success
115
+
116
+ ## Step 3: Dev self-check (gameplay_pass)
117
+
118
+ ```bash
119
+ npm run dev
120
+ ```
121
+
122
+ - Gameplay loop works; CTA fires; audio loads
123
+ - Record devUrl
124
+
125
+ ## Step 4: gameplay_pass STOP
126
+
127
+ - `devStatus: ready`
128
+ - handoff: `Invoke @reviewer load_check`
129
+ - **Do not** set Gate #3 or `stage: done`
130
+
131
+ ---
132
+
133
+ ## Shared references
134
+
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)