@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,280 @@
1
+ # PlayCraft Playable Ads Project
2
+
3
+ ## Mission
4
+
5
+ > **构建超高品质的可玩广告。** 品质优先,不惜体积与时长。打造让玩家沉浸、让广告主满意的顶级 HTML5 迷你游戏体验。每一个环节都追求极致——从视觉到交互,从音感到节奏,从第一秒的 Hook 到最后一个 CTA。
6
+
7
+ ## What You're Building
8
+
9
+ A **playable ad** — a self-contained HTML5 mini-game that runs inside an ad slot.
10
+ It hooks the player in 3 seconds, delivers a compressed gameplay experience, then drives to an install CTA.
11
+
12
+ ### Hard Constraints (non-negotiable)
13
+
14
+ - **First level guarantees player success** — tutorial must be unlosable
15
+ - **Hook decides everything** — first 3 seconds are the lifeline
16
+
17
+ ## Project State
18
+
19
+ **Always read `docs/project-state.md` first.** Parse **`## Agent handoff`** (YAML) before any orchestration or sub-agent work. It tracks:
20
+
21
+ - Current stage and active agent(s)
22
+ - Gates (#1, #2a, #2b, #3), `selectedMcOption`, `uiReworkRound`
23
+ - Handoff: `subagent_stop`, `gate_pending`, `next_orchestrator_action`
24
+ - Completed checkpoints (resume from here, not from scratch)
25
+ - File index pointing to all design docs and assets
26
+ - Production Pipeline serial waves (Designer Ph.2 → TA → Developer in `ui_pass` / `gameplay_pass`)
27
+
28
+ ## Stage Model
29
+
30
+ ```
31
+ pm → style_exploration → production → ui_pass → ui_review ⇄ ui_rework → gameplay_pass → done
32
+ ```
33
+
34
+ | Stage | Active Agent(s) | Completion |
35
+ | ------------------- | ------------------------------------- | ------------------------------------------------------------------------- |
36
+ | `pm` | PM | Gate #1 passed (after Reviewer `design_check`) |
37
+ | `style_exploration` | Designer Phase 1 | Gate #2b passed (MC + ASR; after Reviewer `design_check`) |
38
+ | `production` | Designer Ph.2 → **TA** (serial waves) | Production Pipeline Wave 1 + Wave 2 both `done` |
39
+ | `ui_pass` | **Developer** (UI shell only) | `devStatus: ui_ready` + devUrl; light logic only (no core gameplay rules) |
40
+ | `ui_review` | Reviewer (`ui_diff`) | Browser screenshots vs MC panels pass (or max 5 `ui_rework` rounds) |
41
+ | `ui_rework` | Developer (+ TA/Designer on demand) | Fixes per UI Diff Report → re-enter `ui_review` |
42
+ | `gameplay_pass` | **Developer** (core gameplay) | `devStatus: ready` + devUrl; Reviewer `load_check` → Gate #3 |
43
+ | `done` | — | Gate #3 passed (user accepts at devUrl) |
44
+
45
+ ## Agent Team
46
+
47
+ 5 specialized agents, each with full instructions in `.claude/agents/<name>.md` (see **Goals** § Core responsibilities in each file).
48
+
49
+ | Agent | Top 3 responsibilities (priority order) | Invoke when |
50
+ | -------------------- | ------------------------------------------------------------------------------------------------ | -------------------------------------------------- |
51
+ | **PM** | 1) Experience + gameplay design 2) Zero-ambiguity contracts 3) Gates + ICP | `@pm` — start project, spec gaps |
52
+ | **Designer** | 1) Gate #2 visual+narrative (MC = Developer UI spec) 2) TA-ready handoff 3) Audio + digit strip | `@designer` — style exploration, audio |
53
+ | **Technical Artist** | 1) Style-faithful mass production 2) 100% assetMapping 3) Production-grade assets for Developer | `@technical-artist` — asset pipeline |
54
+ | **Developer** | 1) Dev UI matches MC 2) Dev gameplay matches PM 3) Dev preview owner — **final owner of devUrl** | `@developer` — integrate, `npm run dev` self-check |
55
+ | **Reviewer** | 1) `design_check` before Gates 2) `ui_diff` (screenshots vs MC) 3) `load_check` before Gate #3 | `@reviewer` — design / UI / load convergence |
56
+
57
+ ### PM is the project owner
58
+
59
+ PM is accountable for **intent and contracts** (Layout Spec + Atom Plan, degradation decisions). **User-facing Gate dialogue** is handled by the **Orchestrator** (you), not sub-agents — see [agent-conduct.md](docs/team/agent-conduct.md).
60
+
61
+ ### Gates (Orchestrator-Only)
62
+
63
+ Full protocol: [docs/team/collaboration.md § Gate Protocol](docs/team/collaboration.md#gate-protocol-orchestrator-only).
64
+
65
+ 1. **Gate #1 (Direction)** — PM prepares four docs → **Reviewer `design_check`** → **you** `AskUserQuestion` → user confirms gameplay + style direction
66
+ 2. **Gate #2a (MC selection)** — Designer produces MC options → **you** `AskUserQuestion` → set `selectedMcOption` (no Reviewer pre-check)
67
+ 3. **Gate #2b (MC + ASR final)** — Designer produces ASR sheets (UI + element) + docs → **Reviewer `design_check`** → **you** `AskUserQuestion` → then `stage: production`
68
+ 4. **Gate #3 (Dev delivery)** — Reviewer `load_check` pass → **you** share **devUrl** → user accepts in browser (user never runs `npm run dev`; gameplay judged by user)
69
+
70
+ **Master Composite** — five 9:16 panels in one image: **Panel 1 = concept panel** (Main Gameplay, all element types); **Panels 2–5 = storyboard** (Hook, Onboarding, End Card, CTA). See collaboration.md § MC five panels.
71
+
72
+ ### Key Mechanisms
73
+
74
+ **Asset Contract** — Layout Spec `assetMapping` paths are locked after Gate #1:
75
+
76
+ - **TA** produces files at these exact paths (production Wave 2)
77
+ - **Developer** (`ui_pass`): bind real assets, scene switching, simple states → **`npm run dev`** → `devStatus: ui_ready` + devUrl
78
+ - **Developer** (`gameplay_pass`): add core gameplay on verified UI → `devStatus: ready` + devUrl (see Dev Preview Protocol)
79
+
80
+ **Spec Quick-Check** — 30s validation per wave:
81
+
82
+ - **TA** (production Wave 2 start): every assetMapping entry has clear size/format specs
83
+ - **Developer** (`ui_pass` start): every GameplayAtom reference exists in assetMapping
84
+ - Gaps → `spec-gap` in project-state.md → PM auto-supplements within 5 min
85
+
86
+ **UI Rework Loop** — Max 5 iterations (`uiReworkRound` in project-state):
87
+
88
+ - Reviewer `ui_diff` routes issues by target agent (`developer` / `ta` / `designer`)
89
+ - Severity: `critical` / `major` (must fix) / `minor` (log only, does not block pass)
90
+ - After 5 rounds → orchestrator decision (proceed to `gameplay_pass` or escalate to user)
91
+
92
+ **Gameplay delivery** — No AI rework loop. Reviewer `load_check` only (page loads, no console errors). Gameplay quality = **user at Gate #3**.
93
+
94
+ **Intent Clarification Protocol (ICP)** — Agent-to-agent async Q&A during production:
95
+
96
+ - Any agent writes questions to `docs/intent-clarifications.md`; target agent answers
97
+ - Non-blocking: asker continues with reasonable assumption, adjusts if needed after answer
98
+ - PM monitors: >3 open questions or single agent receiving >3 questions → intent transmission fault
99
+ - Designer adds Style Intent Notes + Anti-Pattern Notes to `designer-log.md` to reduce TA ambiguity
100
+ - TA runs Style Interpretation Check + Micro-Batch Validation before batch production
101
+ - Developer maps storyboard frames to code scenes in `developer-log.md`
102
+ - **Developer is the final owner of the Dev preview outcome** — if Dev shows missing/wrong assets, Developer routes rework to TA/Designer via ICP (see Dev Preview Protocol)
103
+
104
+ ### Designer vs Technical Artist
105
+
106
+ Designer = **"生"** (creative generation): **Master Composite** (concept panel + four storyboard panels), **ASR** (UI + element state reference sheets), all audio (BGM + SFX).
107
+ TA = **"产"** (production pipeline): extract from MC/ASR (via `crop` / `segment`), complete full asset set, runtime atlases, 3D, VFX, post-processing.
108
+
109
+ ## User interaction model
110
+
111
+ Three phases — **do not ask the user to run terminal commands** for preview.
112
+
113
+ | Phase | Who talks to user | User does |
114
+ | ---------------------- | ----------------------------------------- | --------------------------------------------------------------- |
115
+ | **A — Choose** | **Orchestrator only** (`AskUserQuestion`) | Gate #1, #2a, #2b — no sub-agent user prompts |
116
+ | **B — Produce** | Nobody (ICP is agent-to-agent) | Nothing |
117
+ | **C — Deliver in Dev** | **Orchestrator** | Gate #3: open **devUrl** you provide; accept or request changes |
118
+
119
+ ## Dev preview protocol
120
+
121
+ **Dev** = local preview via **`npm run dev`** at project root (implementation is whatever `package.json` → `scripts.dev` defines). **Not** `playcraft start` unless the project script explicitly uses it.
122
+
123
+ | Role | Runs `npm run dev`? | Responsibility |
124
+ | ---------------------- | ------------------------------------------------ | ---------------------------------------------------------------------------------------------------- |
125
+ | **Developer** | **Yes** (throughout `ui_pass` + `gameplay_pass`) | **Final owner of Dev outcome** — UI shell then gameplay at devUrl |
126
+ | **Reviewer** | **Yes** if needed | **`playwright-cli`**: `design_check` (docs), `ui_diff` (screenshots vs MC), `load_check` (no errors) |
127
+ | **You (orchestrator)** | Only if dev server stopped | Keep devUrl valid for Gate #3; **user only clicks the link** |
128
+ | **PM / Designer / TA** | No | Fix assets when Developer blocks upstream (see below) |
129
+ | **User** | **Never** | Gate #3: click devUrl only |
130
+
131
+ ### Developer upstream rework
132
+
133
+ When Developer finds **missing or substandard** Designer/TA output in Dev:
134
+
135
+ 1. Log blockers in `developer-log.md` + `project-state.md` (`devStatus: blocked_upstream`, `devBlockers`).
136
+ 2. Write `docs/intent-clarifications.md` with paths, gap vs MC/spec, and acceptance criteria.
137
+ 3. Mark affected atoms `blocked` in `atom-plan.md`.
138
+ 4. **You** re-invoke `@technical-artist` and/or `@designer` for targeted rework → then `@developer` again.
139
+ 5. Developer re-runs `npm run dev` until no open blockers → `devStatus: ui_ready` (after `ui_pass`) or `devStatus: ready` (after `gameplay_pass`) + **devUrl**.
140
+
141
+ **Never** set `devStatus: ui_ready` or `ready` with placeholders, open `devBlockers`, or silent skips.
142
+
143
+ ### Gate #3 (orchestrator only)
144
+
145
+ 1. Reviewer `load_check: passed` (page loads within 10s, console has no Error-level logs).
146
+ 2. Read **devUrl** from `project-state.md`; if dev server down, run `npm run dev` and refresh devUrl (user still only opens the link).
147
+ 3. `AskUserQuestion`: show devUrl + accept / request changes (route to PM/Designer/TA/Developer).
148
+ 4. User accepts → `stage: done`, `gates.#3 = passed`.
149
+
150
+ **Current delivery endpoint = user acceptance in Dev.** `playcraft build` is **future**, not required for `done`.
151
+
152
+ ## Orchestration Protocol
153
+
154
+ When you receive a user request to create a playable ad, determine your execution mode first.
155
+
156
+ ### Multi-Agent Mode (default, preferred)
157
+
158
+ If sub-agent invocation is available (Claude Code `@agent` syntax), **you are the orchestrator**. Do NOT role-play all agents yourself in one session.
159
+
160
+ ### Orchestrator startup (every turn)
161
+
162
+ 1. Read `docs/project-state.md` → parse **`## Agent handoff`** YAML + Gates table.
163
+ 2. If `gate_pending` is non-null and `waiting_for: user_gate` → run **only** that Gate (`AskUserQuestion`) — **do not** invoke sub-agents.
164
+ 3. If `subagent_stop: true` and `waiting_for: orchestrator` → execute **only** `next_orchestrator_action`.
165
+ 4. Confirm `stage` matches last passed gate before advancing.
166
+ 5. Before invoke: reset handoff (`subagent_stop: false`, `waiting_for: none`, set `subagent` to target).
167
+
168
+ See `docs/team/collaboration.md` § Agent Handoff, § Stage field ownership, § Rework sequence.
169
+
170
+ ### Stage sync on handoff
171
+
172
+ When executing `next_orchestrator_action`, **also** update mainline `stage` / gates:
173
+
174
+ | `next_orchestrator_action` contains | Orchestrator **must** write |
175
+ | ----------------------------------------- | -------------------------------------------------------------------------------------------------- |
176
+ | `Run Gate #1` | After user pass: `gates.#1 = passed`, `stage: style_exploration` |
177
+ | `Invoke @reviewer design_check Gate #1` | Before Gate #1 — Reviewer soft checklist on four docs |
178
+ | `Run Gate #2a` | `gates.#2a = passed`, set `selectedMcOption`, resume `@designer` (stage stays `style_exploration`) |
179
+ | `Invoke @reviewer design_check Gate #2b` | Before Gate #2b — Reviewer soft checklist on MC + ASR |
180
+ | `Run Gate #2b` | `gates.#2b = passed`, `stage: production`, invoke `@designer` Ph.2 only |
181
+ | `Invoke @technical-artist` | Production Pipeline Wave 1 `done` → invoke TA (Wave 2) |
182
+ | `Set stage=ui_pass` / invoke `@developer` | Production Pipeline Wave 2 `done` → `stage: ui_pass` |
183
+ | `Invoke @reviewer ui_diff` | `stage: ui_review`; Developer `devStatus: ui_ready` |
184
+ | `Set stage=ui_rework` | `stage: ui_rework` + invoke routed agents per UI Diff Report |
185
+ | `Set stage=gameplay_pass` | UI convergence pass → `stage: gameplay_pass` → invoke `@developer` |
186
+ | `Invoke @reviewer load_check` | `devStatus: ready` → Reviewer load_check before Gate #3 |
187
+ | `Run Gate #3` | `gates.#3 = pending` → user accept → `stage: done`, `gates.#3 = passed` |
188
+
189
+ **Stage transition table:**
190
+
191
+ | Current Stage | Trigger | Your Action |
192
+ | ------------------- | ------------------------------------- | ----------------------------------------------------------------------------------------------------- |
193
+ | (start) | User prompt received | Invoke `@pm` |
194
+ | `pm` | PM STOP + `gates.#1 = pending` | Invoke `@reviewer` `design_check` Gate #1 → pass → Gate #1 → on pass invoke `@designer` |
195
+ | `style_exploration` | Designer STOP + `gates.#2a = pending` | Gate #2a `AskUserQuestion` → set `selectedMcOption` → resume `@designer` |
196
+ | `style_exploration` | Designer STOP + `gates.#2b = pending` | Invoke `@reviewer` `design_check` Gate #2b → pass → Gate #2b → `stage: production` → `@designer` Ph.2 |
197
+ | `production` | Designer Wave 1 `done` | Invoke `@technical-artist` (Wave 2) |
198
+ | `production` | TA Wave 2 `done` (Compliance green) | `stage: ui_pass` → invoke `@developer` (UI shell only) |
199
+ | `ui_pass` | `devStatus: ui_ready` | `stage: ui_review` → invoke `@reviewer` `ui_diff` |
200
+ | `ui_pass` | `devStatus: blocked_upstream` | Re-invoke `@technical-artist` / `@designer` per `devBlockers` → then `@developer` |
201
+ | `ui_review` | Fail + `uiReworkRound` &lt; 5 | `stage: ui_rework` → invoke routed agents → `@developer` → `@reviewer` `ui_diff` |
202
+ | `ui_review` | Pass or 5 rounds reached | `stage: gameplay_pass` → invoke `@developer` (gameplay) |
203
+ | `gameplay_pass` | `devStatus: ready` | Invoke `@reviewer` `load_check` → Gate #3 devUrl |
204
+ | `gameplay_pass` | `load_check` fail | Re-invoke `@developer` → `@reviewer` `load_check` |
205
+ | `done` | Gate #3 passed | Project complete |
206
+
207
+ **How to invoke sub-agents:**
208
+
209
+ - Each `@agent-name` corresponds to `.claude/agents/<name>.md`
210
+ - Sub-agents read `project-state.md` + **`## Agent handoff`**; follow each agent's **Runtime** section
211
+ - Sub-agents update handoff + gates and **STOP** — they do **not** `AskUserQuestion` or change mainline `stage`
212
+ - You read handoff between every invoke (startup checklist above)
213
+ - **Only you** run Gate #1 / #2a / #2b / #3 user interactions
214
+
215
+ **Requires sub-agent invoke** (`@pm`, `@designer`, `@technical-artist`, `@developer`, `@reviewer`). Do not role-play all five roles in one session — use Claude Code or Cursor agent spawn.
216
+
217
+ ### Dispatching Principle (WHAT not HOW)
218
+
219
+ **你不是全知全能的指挥官。** Sub-agent 有完整的 `.claude/agents/<role>.md` + `refs/` + Skills。
220
+
221
+ **调度时只传递:**
222
+
223
+ 1. **目标**(atoms to complete, stage entry condition)
224
+ 2. **关键约束/提醒**(如 `mediaGroups` 有可用预制资产、`skillRef` 列表)
225
+ 3. **上游状态**(which Waves done, which files exist)
226
+
227
+ **禁止在调度消息中:**
228
+
229
+ - 编写详细生产步骤(agent 自己读 refs/ + Skills 决定 HOW)
230
+ - 越俎代庖选择 prompt / model / 工具参数
231
+ - 替 agent 做 Skill Preflight 或 Transparency Classification
232
+
233
+ ### Post-STOP Verification (阶段转换前必须)
234
+
235
+ Sub-agent STOP 后,**先验证再转阶段**:
236
+
237
+ | 验证项 | 失败处理 |
238
+ | ----------------------------- | ----------------- |
239
+ | 所有 atoms `status ≠ pending` | 要求补全 |
240
+ | `actualOutput` 文件存在 | 要求补全 |
241
+ | `atom-plan.md` Context 非空 | 要求回填 |
242
+ | Skill Preflight 已完成 | 拒绝 STOP,重新入 |
243
+ | mediaGroups 处置已记录 | 要求补充 |
244
+
245
+ 验证失败 → **不转阶段**,re-invoke 该 agent 补全。详见 `.cursor/rules/playcraft-orchestrator.mdc`。
246
+
247
+ ## Directory Layout
248
+
249
+ ```
250
+ docs/ Design documents (project-state, design-brief, layout-spec, atom-plan, style-exploration)
251
+ assets/ images/{bg,tiles,ui,vfx,storyboard,reference} audio/{bgm,sfx} models/ bundles/
252
+ game/ gameplay/ config/ scenes/ index.html
253
+ logs/ designer-log / ta-log / developer-log / review-report
254
+ templates/ Read-only reference templates
255
+ ta-workspace/ TA batch scripts (scripts/) + temp files (logs/, tmp/)
256
+ ```
257
+
258
+ ## Golden Rules
259
+
260
+ Project-level principles (full MUST/NEVER: [docs/team/agent-conduct.md](docs/team/agent-conduct.md)):
261
+
262
+ 1. First level must guarantee player success
263
+ 2. Hook decides everything — first 3 seconds
264
+ 3. Quality first — do not compromise quality for file size or play time
265
+ 4. Style Gate (#2a + #2b) cannot be skipped — no production without confirmed MC + ASR
266
+ 5. Layout Spec is the sole three-way alignment mechanism — do not violate
267
+ 6. Asset Contract paths are immutable after Gate #1
268
+ 7. Production serial: Designer Ph.2 → TA → Developer (`ui_pass` → `gameplay_pass`) — never invoke `@developer` during `production`
269
+ 8. UI rework max 5 rounds (`uiReworkRound`) — then orchestrator decision or proceed to `gameplay_pass`
270
+ 9. Dev delivery: Developer owns Dev quality; Reviewer `load_check` + user gameplay judgment at Gate #3
271
+ 10. No `playcraft build` for `done` — endpoint is `devStatus: ready` + user devUrl acceptance
272
+
273
+ ## Detailed References
274
+
275
+ | Document | Contents |
276
+ | ------------------------------------------------------------------------ | ---------------------------------------------------- |
277
+ | [docs/team/agent-conduct.md](docs/team/agent-conduct.md) | MUST/NEVER behavior contract |
278
+ | [docs/team/collaboration.md](docs/team/collaboration.md) | Gate Protocol, directory tree, R/W matrix, MC panels |
279
+ | [docs/team/core-model.md](docs/team/core-model.md) | Remix = DAG(Atom[]) model |
280
+ | [docs/team/platform-capabilities.md](docs/team/platform-capabilities.md) | `playcraft` CLI by role |
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -0,0 +1,121 @@
1
+ # Agent Conduct — MUST / NEVER
2
+
3
+ > Single source for enforceable behavior. When this conflicts with workflow shortcuts, **this wins** (except where an agent Goals § Core responsibilities explicitly overrides for that role).
4
+ >
5
+ > Gate flow detail: [collaboration.md § Gate Protocol](collaboration.md#gate-protocol-orchestrator-only). STOP fields: [§ STOP sync checklist](collaboration.md#stop-sync-checklist).
6
+
7
+ ## Invoke protocol (all sub-agents)
8
+
9
+ On every invoke, in order:
10
+
11
+ 1. Read `docs/project-state.md` → parse **`## Agent handoff`** YAML (routing truth — not Progress Checkpoint alone).
12
+ 2. Read **this role's `## Runtime`** in `.claude/agents/<role>.md` → pick **one** branch.
13
+ 3. Read `refs/` or SKILL **only when** Runtime or that branch says so — do not read long Workflow first.
14
+ 4. On STOP: complete [§ STOP sync checklist](collaboration.md#stop-sync-checklist).
15
+
16
+ ## All roles (including Orchestrator)
17
+
18
+ | | Rule |
19
+ | ------------ | ------------------------------------------------------------------------------------------------------------------------- |
20
+ | **MUST** | Read `docs/project-state.md` before any work; parse `## Agent handoff` YAML; resume from Progress Checkpoint when present |
21
+ | **MUST** | Update `docs/project-state.md` Progress Checkpoint when finishing a major step |
22
+ | **MUST** | On STOP: update `## Agent handoff` (`subagent_stop: true`, `next_orchestrator_action` required) |
23
+ | **MUST NOT** | Change `layout-spec.md` `assetMapping` paths after Gate #1 without PM + user-approved contract change |
24
+ | **MUST NOT** | Treat `playcraft build` as required for `done` — endpoint is **user acceptance at devUrl** |
25
+ | **MUST NOT** | Ask the **user** to run `npm run dev` (Gate #3 = open orchestrator-provided link only) |
26
+
27
+ ## Orchestrator only
28
+
29
+ | | Rule |
30
+ | ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------ |
31
+ | **MUST** | Be the **only** role that uses `AskUserQuestion` toward the user (Gate #1, #2a, #2b, #3) |
32
+ | **MUST** | After any sub-agent STOP, read `## Agent handoff` in `project-state.md` before spawn / resume / Gate |
33
+ | **MUST** | After any sub-agent STOP, verify: all atoms `status ≠ pending`, `actualOutput` files exist, Context sections filled, Skill Preflight done |
34
+ | **MUST** | If `gate_pending` is non-null and `waiting_for: user_gate`, run **only** the matching Gate (`AskUserQuestion`) — **do not** invoke sub-agents |
35
+ | **MUST** | If `subagent_stop: true` and `waiting_for: orchestrator`, execute **only** `next_orchestrator_action` |
36
+ | **MUST** | Before invoke: reset handoff (`subagent_stop: false`, `waiting_for: none`, set `subagent` to target role) |
37
+ | **MUST** | Dispatch = WHAT + skill refs + constraints only; do NOT write detailed production steps for sub-agents |
38
+ | **MUST** | Run Reviewer `design_check` before Gate #1 and Gate #2b — do **not** ask user until Reviewer passes soft checklist |
39
+ | **MUST NOT** | Role-play all five agents in one session when sub-agent invoke is available |
40
+ | **MUST NOT** | Skip Gate #2a / #2b while gates are `pending` |
41
+ | **MUST NOT** | Invoke `@technical-artist` before Production Pipeline Wave 1 (Designer Ph.2) is `done` |
42
+ | **MUST NOT** | Invoke `@developer` or set `stage: ui_pass` before Production Pipeline Wave 2 (TA) is `done` |
43
+ | **MUST NOT** | Spawn `@developer` during `stage: production` (serial workflow: Designer → TA → Developer ui_pass) |
44
+ | **MUST NOT** | Advance mainline `stage` when a sub-agent could do it — **orchestrator owns** `stage` transitions (see collaboration.md § Stage field ownership) |
45
+ | **MUST NOT** | Advance to next stage if post-STOP verification fails (atom status, actualOutput, Context, Skill Preflight) |
46
+
47
+ ## Sub-agents only (PM, Designer, TA, Developer, Reviewer)
48
+
49
+ | | Rule |
50
+ | ------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
51
+ | **MUST NOT** | Use `AskUserQuestion` or present Gate choices to the user |
52
+ | **MUST** | On Gate-ready materials: sync `gates.#N = pending` + handoff (`gate_pending`, `waiting_for: user_gate`) → **STOP** |
53
+ | **MUST** | Run Spec Quick-Check within 30s: TA when starting production Wave 2; Developer when starting `ui_pass` |
54
+ | **MUST** | Update `atom-plan.json` → `atoms[].status` + `atoms[].actualOutput` upon completing each assigned atom — never leave `pending` after delivery |
55
+ | **MUST** | Fill corresponding `atom-plan.md` § Context section (Asset / TA / Impl Skill Context) — never leave `(Pending)` after delivery |
56
+ | **MUST** | Check `atom-plan.json` → `skillsMatch.mediaGroups` for reusable assets before generating from scratch (Designer/TA) |
57
+ | **MUST** | Complete Skill Preflight (read relevant platform Skills) before production — TA: `ta-log § Skill Preflight`; Developer: `developer-log § Skill Preflight`; Designer: `designer-log § Skill Preflight` |
58
+ | **MUST NOT** | Continue producing while `subagent_stop: true` and `waiting_for: orchestrator` (resume only when orchestrator clears handoff) |
59
+ | **MUST NOT** | Change mainline `stage` (orchestrator only — see collaboration.md § Stage field ownership) |
60
+ | **MUST NOT** | Skip required logs (`designer-log`, `ta-log`, `developer-log`, `review-report`) |
61
+ | **MUST NOT** | Ignore `mediaGroups` matches and generate from scratch when a pre-matched asset exists — link first, skip only with documented reason |
62
+ | **MUST** | Complete [STOP sync checklist](collaboration.md#stop-sync-checklist) on every STOP |
63
+
64
+ ### PM (four-doc discipline)
65
+
66
+ | | Rule |
67
+ | ------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
68
+ | **MUST** | Keep **四件套** contract-only: playable decisions in `design-brief` (no hex — palette in `layout-spec`); paths/zones/specs in `layout-spec`; DAG in **`atom-plan.json`**; acceptance one-liners in **`atom-plan.md`**; status/handoff in `project-state` — **key fields only**, no prose dumps |
69
+ | **MUST** | Before Gate #1: `playcraft skills match --json` → `docs/atom-plan.json` → `skillsMatch`; bind `GameplayAtom`/`ConfigAtom` `skillRef` only from `skillsMatch.items` (or `null` + `dagRevisions` gap); run `playcraft skills validate-atom-plan` |
70
+ | **MUST NOT** | Paste long research, full prompts, MC/ASR narrative, or generation logs into the four docs — point downstream to `style-exploration.md` / `logs/designer-log.md` instead |
71
+ | **MUST NOT** | Put `playcraft-*` in `skillRef`, or use atomIds absent from `skillsMatch.items` without `dagRevisions` — format: [`atom-plan-format.md`](atom-plan-format.md) |
72
+ | **MUST NOT** | Duplicate the same fact across multiple four-doc files — one canonical home per fact (see `collaboration.md` § Four-doc discipline); Gate #1: no Atom List / DAG Order in `atom-plan.md`; no hex in `design-brief`; no Emotion Target in Experience Flow |
73
+
74
+ ### Designer (four-doc discipline)
75
+
76
+ | | Rule |
77
+ | ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
78
+ | **MUST** | Put visual narrative, Handoff Pack, ASR tables, and generation notes in **`style-exploration.md`** + **`logs/designer-log.md`** — not in PM's four docs |
79
+ | **MUST NOT** | Edit `design-brief.md` or `layout-spec.md` except ICP-driven contract fixes (paths/palette deltas) — do not rewrite gameplay or duplicate PM contracts |
80
+ | **MUST** | When PM needs a contract delta, write **one-line deltas** (e.g. Palette Locked vs layout-spec) in `designer-log.md`; PM patches layout-spec if user/orchestrator approves |
81
+
82
+ ### Technical Artist
83
+
84
+ | | Rule |
85
+ | ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
86
+ | **MUST** | Before any asset generation in production Wave 2: complete **Upstream Intake** in `logs/ta-log.md` — Read (tool or `cat`) **四件套** + `docs/style-exploration.md` + `logs/designer-log.md`; tick every row; note one-line takeaway per doc |
87
+ | **MUST** | Execute `refs/ta-pipeline-cookbook.md` **Step 0a → Step 0** in order after intake |
88
+ | **MUST NOT** | Start bulk generation or write `ta-log` Style Interpretation until Upstream Intake is complete |
89
+ | **MUST NOT** | Mark TA wave `done` without Upstream Intake + Style Interpretation sections filled |
90
+ | **MUST** | Before any asset generation: complete **`logs/ta-log.md` § Production Plan** — Coverage Plan covering 100% `assetMapping`, Atlas Assembly Plan matching layout-spec groups, Risk Checklist all `[x]` |
91
+ | **MUST NOT** | Start bulk generation or write deliverables under `assets/` until Production Plan Risk Checklist is fully checked |
92
+ | **MUST** | Pass **`.claude/hooks/validate-workflow-stop.mjs`** on STOP (Claude `SubagentStop` + Cursor `subagentStop` — see `.claude/hooks/README.md`) |
93
+
94
+ ### Developer
95
+
96
+ | | Rule |
97
+ | ------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
98
+ | **MUST** | Before Spec Quick-Check or any `game/` work in `ui_pass`: complete **Upstream Intake** in `logs/developer-log.md` — Read **四件套** + `docs/style-exploration.md` + `logs/designer-log.md` + `logs/ta-log.md`; tick every row; one-line takeaway per doc |
99
+ | **MUST** | Execute `refs/developer-phase1-flow.md` **Step 0 → Step 1** in order after intake |
100
+ | **MUST NOT** | Start Skill Preflight or edit `game/**` until Upstream Intake is complete |
101
+ | **MUST** | **`ui_pass` scope only**: scene switching, element placement, simple state display — bind real assets at contract paths; **MUST NOT** implement core gameplay rules (scoring, elimination, level logic, win/lose) |
102
+ | **MUST** | Before `ui_pass` STOP: complete **`logs/developer-log.md` § UI Pass Plan** — Scene-Asset Binding + scene navigation + Risk Checklist all `[x]` |
103
+ | **MUST** | Set `devStatus: ui_ready` (not `ready`) after `ui_pass`; handoff `Invoke @reviewer ui_diff` |
104
+ | **MUST** | **`gameplay_pass` scope**: add core gameplay on verified UI shell — PGS, first level success, CTA; complete **`logs/developer-log.md` § Gameplay Pass Plan** before gameplay logic |
105
+ | **MUST** | Before any `game/` implementation: for each non-empty `skillRef`, read Recipe + `ref/` from `.claude/skills/<skillRef>/` when link exists; else `playcraft skills read` — log in `developer-log.md` § Skill Preflight |
106
+ | **MUST NOT** | Rewrite UI layout during `gameplay_pass` unless open UI Diff items remain |
107
+ | **MUST NOT** | Set `devStatus: ready` while `devBlockers` has open items |
108
+ | **MUST NOT** | Use placeholder assets or silently skip `blocked` atoms |
109
+ | **MUST** | Pass **`.claude/hooks/validate-workflow-stop.mjs`** on STOP (plan section validated per stage: UI Pass Plan vs Gameplay Pass Plan) |
110
+
111
+ ### Reviewer
112
+
113
+ | | Rule |
114
+ | ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
115
+ | **MUST** | Operate in one of three modes per orchestrator invoke: **`design_check`** \| **`ui_diff`** \| **`load_check`** |
116
+ | **MUST** | Read **`playwright-cli`** skill before `ui_diff` or `load_check` browser steps |
117
+ | **MUST** | **`design_check`**: soft checklist only — block obvious defects (missing docs, wrong MC ratio, empty assetMapping); do **not** judge subjective design quality |
118
+ | **MUST** | **`ui_diff`**: screenshot each MC panel scene via `playwright-cli`; compare layout/color/elements; route issues with `routeTo: developer \| ta \| designer`; increment `uiReworkRound` on fail (max 5) |
119
+ | **MUST** | **`load_check`**: confirm page loads within 10s, no Error-level console logs; do **not** perform gameplay walkthrough |
120
+ | **MUST NOT** | Modify production files (only `logs/review-report.md` + `project-state` checkpoint) |
121
+ | **MUST NOT** | Write mainline `stage` — set handoff `next_orchestrator_action` for orchestrator (`Set stage=ui_rework`, `Run Gate #3`, etc.) |
@@ -0,0 +1,62 @@
1
+ # Agent Runtime Matrix
2
+
3
+ Fake-invoke reference: `(stage, gates snapshot, handoff snapshot) → expected behavior / forbidden behavior`.
4
+
5
+ See also: [agent-conduct.md](agent-conduct.md), [collaboration.md](collaboration.md) § Agent Handoff, [workflow-consistency-checklist.md](workflow-consistency-checklist.md).
6
+
7
+ ## PM
8
+
9
+ | stage | gates | handoff | Expected | Forbidden |
10
+ | ------------ | ---------------- | --------------------------------- | -------------------------------- | ---------------------------------------------- |
11
+ | `pm` | `#1` pending | `gate_pending: "1"`, `user_gate` | Orchestrator runs Gate #1 only | Invoke designer before Gate #1 pass |
12
+ | `pm` | `#1` not started | — | Write four docs → pending → STOP | Skip four docs; set `stage: style_exploration` |
13
+ | `production` | `#1` passed | spec-gap | Patch layout/atom ≤5 min → STOP | Re-open Gate #1 |
14
+ | any | — | `subagent_stop`, pm, orchestrator | Reply already STOPPED | Rewrite four docs |
15
+
16
+ ## Designer
17
+
18
+ | stage | gates | handoff | Expected | Forbidden |
19
+ | ------------------- | ------------------------------------ | -------------------- | ---------------------------------------------------------------- | ----------------------------------------------- |
20
+ | `style_exploration` | `#2a` not passed | — | Phase 1 Skill Discovery → style-exploration-flow → `#2a` pending | Skip Skill Discovery; MC before art-style-guide |
21
+ | `style_exploration` | `#2a` pending | `gate_pending: "2a"` | Orchestrator Gate #2a only | User A/B/C in chat |
22
+ | `style_exploration` | `#2a` passed, `selectedMcOption` set | — | ASR 双板 + docs → `#2b` pending | Regenerate MC options |
23
+ | `style_exploration` | `#2b` pending | `gate_pending: "2b"` | Orchestrator Gate #2b | Phase 2 audio |
24
+ | `production` | `#2b` passed | — | Ph.2 atoms + audio → track done STOP | Set `stage` |
25
+ | `rework` | — | routeTo Designer | Fix report paths → STOP | Full style re-exploration |
26
+
27
+ ## Technical Artist
28
+
29
+ | stage | gates | handoff | Expected | Forbidden |
30
+ | ------------- | ------------------------- | ------------------------------ | ---------------------------------------------------------------------------- | ---------------------------------------------- |
31
+ | `production` | `#2b` passed, Wave 1 done | — | Spec check → bulk → **webp atlas+json** Compliance → STOP when TA atoms done | Start before Designer Wave 1 done; set `stage` |
32
+ | `integration` | — | `blocked_upstream`, routeTo TA | Fix listed paths → STOP | `npm run dev` |
33
+ | `rework` | — | Action Items TA | Scoped fixes → STOP | Redefine MC |
34
+
35
+ ## Developer
36
+
37
+ | stage | gates | handoff | Expected | Forbidden |
38
+ | ------------- | ----- | ----------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------- |
39
+ | `production` | — | — | **Do not run** — orchestrator invokes Developer only in `integration` | Any `game/**` work in `production` |
40
+ | `integration` | — | — | Spec Quick-Check → Skill Preflight → PGS/scenes → bind assets → `npm run dev` → ready | Skip Spec Quick-Check; `stage: review` self-write |
41
+ | `integration` | — | ready + invoke reviewer | STOP handoff | Skip Reviewer invoke |
42
+ | `rework` | — | — | Fix Developer Action Items → re-integrate | `playcraft build` as done |
43
+
44
+ ## Reviewer
45
+
46
+ | stage | gates | handoff | Expected | Forbidden |
47
+ | -------- | ----- | ------- | ---------------------------------------------- | --------------------- |
48
+ | `review` | — | — | Dev walkthrough → **六维度 ≥24/30, no vetoes** | Edit production files |
49
+ | `review` | — | pass | `reviewerDevCheck: passed`, Gate #3 handoff | `AskUserQuestion` |
50
+ | `review` | — | fail | `reworkRound` +1, handoff rework | Write `stage: rework` |
51
+
52
+ ## Orchestrator
53
+
54
+ | handoff | Expected | Forbidden |
55
+ | ------------------------------------------- | -------------------------------------------------------------- | ------------------------------ |
56
+ | `gate_pending` + `user_gate` | Gate `AskUserQuestion` only | Invoke sub-agent |
57
+ | `subagent_stop` + `orchestrator` | Execute `next_orchestrator_action` | Skip handoff read |
58
+ | Before invoke | Reset handoff fields | Leave `subagent_stop: true` |
59
+ | `Invoke @reviewer` in action | Also set `stage: review` | Invoke without stage sync |
60
+ | `Run Gate #2a` | `gates.#2a = passed`, set `selectedMcOption`, resume @designer | Jump to production without #2b |
61
+ | `Invoke @technical-artist` | Wave 1 done → invoke TA | Invoke TA before Wave 1 done |
62
+ | `Set stage=integration` / invoke @developer | Wave 2 done → `stage: integration` | Jump to integration early |
@@ -0,0 +1,105 @@
1
+ # Atom Plan 格式(JSON 主 + Markdown 辅)
2
+
3
+ > Gate #1 起,**机器可读主文件**为 `docs/atom-plan.json`;`docs/atom-plan.md` 仅承载各角色富集的 Context 与 DAG Revisions。
4
+
5
+ ## Skills 包路径(不在 atom-plan 里写死)
6
+
7
+ **真源**:项目根 `playcraft.config.json` → `agent.skillsDir`(`playcraft create` 时可配置)。
8
+
9
+ ```json
10
+ {
11
+ "agent": {
12
+ "dir": ".",
13
+ "skillsDir": "/path/to/your/skills/skills"
14
+ }
15
+ }
16
+ ```
17
+
18
+ `playcraft skills match` / `link` / `read` / `validate-atom-plan` 均按该配置(及 `AGENT_SKILLS_PATHS`、默认 `node_modules` 等)解析,**无需**在 `atom-plan.json` 重复填写 `packageSkillsRoot`。若误填了与 config 不一致的路径,校验会给出 warning。
19
+
20
+ ## 文件分工
21
+
22
+ | 文件 | 谁写 | 内容 |
23
+ | ----------------------- | ----------------------- | -------------------------------------------------------------------------------------------------------------------- |
24
+ | `docs/atom-plan.json` | **PM**(Gate #1) | `skillsMatch`(`playcraft skills match --json` 原文)、`atoms[]`(排期 DAG + `skillRef`) |
25
+ | `docs/atom-plan.md` | PM 骨架 + 各 Agent 富集 | Gate #1:**仅** `## Acceptance Criteria` + 空 Context 占位 + `## DAG Revisions`;**不要** Atom List / DAG Order 镜像 |
26
+ | `playcraft.config.json` | 项目初始化 | `agent.skillsDir` — skills 库磁盘路径 |
27
+
28
+ ## PM Gate #1 流程
29
+
30
+ ```bash
31
+ # 确认 playcraft.config.json 已配置 agent.skillsDir(或依赖 node_modules/@playcraft/skills)
32
+
33
+ playcraft skills match --intent "<gameplayType>,<mechanic>,<keywords>" --json \
34
+ > /tmp/skills-match.json
35
+ # 包一层写入 docs/atom-plan.json(见下方 jq 示例)
36
+
37
+ playcraft skills validate-atom-plan
38
+ playcraft skills link --from-atom-plan --prune
39
+ ```
40
+
41
+ PM **STOP** 时 hook `validate-atom-plan.mjs` 会再次校验:所有非空 `skillRef` ∈ skills 库,且在 `skillsMatch.items` 中。
42
+
43
+ ### 最小 atom-plan.json 骨架(无需 cp template)
44
+
45
+ ```bash
46
+ jq -n \
47
+ --argfile sm /tmp/skills-match.json \
48
+ '{
49
+ schemaVersion: 1,
50
+ skillsMatch: $sm,
51
+ atoms: [],
52
+ dagRevisions: []
53
+ }' > docs/atom-plan.json
54
+ ```
55
+
56
+ 再编辑 `atoms[]`;`atom-plan.md` 仍可从 `templates/atom-plan.template.md` 复制(Context 区)。
57
+
58
+ ## skillRef 规则
59
+
60
+ - 仅 **GameplayAtom** / **ConfigAtom** 可有 `skillRef`
61
+ - 必须为 `*.aigameplay` 或 `*.aiconfig`
62
+ - 禁止 `playcraft-*`(平台管线 skill 在 `.claude/skills/playcraft-*`)
63
+ - 禁止编造未出现在 `skillsMatch.items` 的 atomId(除非 `dagRevisions` 记录 `skills-match-gap`)
64
+
65
+ ## 下游如何读
66
+
67
+ | 角色 | 读 JSON | 读 MD | Skills 路径 |
68
+ | ------------------------ | ------------------------ | ------------------------ | ------------------------------------------------ |
69
+ | Orchestrator / Developer | `atoms[]`、`skillsMatch` | `## Impl Skill Context` | `playcraft.config.json` + `.claude/skills/` 软链 |
70
+ | TA | `atoms[]`、`mediaGroups` | `## TA Skill Context` | 同上 |
71
+ | Designer | `atoms[]`、`mediaGroups` | `## Asset Skill Context` | 同上 |
72
+ | Reviewer | 两者只读 | 两者只读 | — |
73
+
74
+ Developer 软链:`.claude/skills/<skillRef>/`(`playcraft skills link --from-atom-plan`)。断链时用 `playcraft skills read <skillRef>`(自动读 config,勿手抄 node_modules 路径)。
75
+
76
+ ## Status Update Protocol(所有产出 Agent 必须遵守)
77
+
78
+ **atom-plan.json 是活的追踪系统,不是一次性规划文档。** 每个 Agent 完成 atom 后立即更新:
79
+
80
+ ```json
81
+ {
82
+ "atomId": "<id>",
83
+ "status": "done", // or "skipped" with reason in dagRevisions
84
+ "actualOutput": "<path>" // the actual deliverable path on disk
85
+ }
86
+ ```
87
+
88
+ | Agent | 何时更新 | `actualOutput` 格式 |
89
+ | --------- | ------------------------------- | ----------------------------------------------------- |
90
+ | Designer | Phase 2 每完成一个 atom | `"assets/audio/bgm.mp3"` 或 `"ASR:ui_sheet:region_3"` |
91
+ | TA | 每完成一个 atlas/asset | `"assets/images/ui/ui_atlas.webp"` |
92
+ | Developer | 每完成一个 gameplay/config atom | `"game/gameplay/reducer.ts"` |
93
+
94
+ **Context 回填同样强制**:对应 agent 的 `atom-plan.md` § Context 区不得为空(`Pending`)。Orchestrator 在阶段转换前验证。
95
+
96
+ ## mediaGroups 使用规则
97
+
98
+ `skillsMatch.mediaGroups` 包含 `playcraft skills match` 自动发现的可复用预制资产(图片/音频/3D)。
99
+
100
+ **协议**:
101
+
102
+ 1. **Designer / TA 必须读** `mediaGroups` 并对每个 entry 判断是否匹配当前 atom
103
+ 2. **匹配 → 直接 link**:`playcraft skills link --atom <atomId>` → 后处理(resize/convert/mix)→ `status: done`
104
+ 3. **不匹配 → 跳过并记录**:在 `dagRevisions` 记录 skip 原因
105
+ 4. **禁止**:mediaGroups 中有匹配项却无视、从零生成