@playcraft/cli 0.0.40 → 0.0.41

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 (117) 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 +454 -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 +164 -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/package.json +9 -3
  20. package/project-template/.claude/agents/designer.md +116 -0
  21. package/project-template/.claude/agents/developer.md +133 -0
  22. package/project-template/.claude/agents/pm.md +164 -0
  23. package/project-template/.claude/agents/refs/README.md +67 -0
  24. package/project-template/.claude/agents/refs/designer-art-style-catalog.md +533 -0
  25. package/project-template/.claude/agents/refs/designer-color-audio-recipes.md +153 -0
  26. package/project-template/.claude/agents/refs/designer-deliverable-spec.md +167 -0
  27. package/project-template/.claude/agents/refs/designer-dimension-axis.md +27 -0
  28. package/project-template/.claude/agents/refs/designer-handoff-v2-checklist.md +68 -0
  29. package/project-template/.claude/agents/refs/designer-master-composite-recipes.md +216 -0
  30. package/project-template/.claude/agents/refs/designer-style-exploration-flow.md +37 -0
  31. package/project-template/.claude/agents/refs/developer-dev-handoff.md +109 -0
  32. package/project-template/.claude/agents/refs/developer-impl-cookbook.md +134 -0
  33. package/project-template/.claude/agents/refs/developer-phase1-flow.md +211 -0
  34. package/project-template/.claude/agents/refs/pm-workflow-detail.md +545 -0
  35. package/project-template/.claude/agents/refs/reviewer-six-dimension-eval.md +286 -0
  36. package/project-template/.claude/agents/refs/ta-3d-flip-recipe.md +85 -0
  37. package/project-template/.claude/agents/refs/ta-atlas-deliverable-standard.md +46 -0
  38. package/project-template/.claude/agents/refs/ta-batch-pipeline-recipes.md +120 -0
  39. package/project-template/.claude/agents/refs/ta-image-generation-detail.md +356 -0
  40. package/project-template/.claude/agents/refs/ta-image-ops-reference.md +495 -0
  41. package/project-template/.claude/agents/refs/ta-pipeline-cookbook.md +699 -0
  42. package/project-template/.claude/agents/refs/ta-tools-reference.md +111 -0
  43. package/project-template/.claude/agents/refs/ta-vfx-preset-catalog.md +365 -0
  44. package/project-template/.claude/agents/reviewer.md +103 -0
  45. package/project-template/.claude/agents/technical-artist.md +111 -0
  46. package/project-template/.claude/hooks/README.md +36 -0
  47. package/project-template/.claude/hooks/validate-atom-plan.mjs +224 -0
  48. package/project-template/.claude/hooks/validate-workflow-stop.mjs +258 -0
  49. package/project-template/.claude/settings.json +32 -0
  50. package/project-template/.claude/settings.local.json +4 -0
  51. package/project-template/.claude/skills/playcraft-ad-psychology/SKILL.md +182 -0
  52. package/project-template/.claude/skills/playcraft-art-style-guide/SKILL.md +123 -0
  53. package/project-template/.claude/skills/playcraft-asset-state-sheet/SKILL.md +141 -0
  54. package/project-template/.claude/skills/playcraft-audio-generation/SKILL.md +280 -0
  55. package/project-template/.claude/skills/playcraft-batch-pipeline/SKILL.md +184 -0
  56. package/project-template/.claude/skills/playcraft-build-optimizer/SKILL.md +306 -0
  57. package/project-template/.claude/skills/playcraft-image-generation/SKILL.md +229 -0
  58. package/project-template/.claude/skills/playcraft-image-generation/reference/build-sprite-sheet.template.mjs +123 -0
  59. package/project-template/.claude/skills/playcraft-image-generation/reference/compare-style.template.mjs +254 -0
  60. package/project-template/.claude/skills/playcraft-image-generation/reference/gen-batch-sprite.template.mjs +235 -0
  61. package/project-template/.claude/skills/playcraft-image-generation/reference/gen-batch.template.mjs +97 -0
  62. package/project-template/.claude/skills/playcraft-image-generation/reference/gen-edit-variants.template.mjs +118 -0
  63. package/project-template/.claude/skills/playcraft-image-generation/reference/process-batch.template.mjs +137 -0
  64. package/project-template/.claude/skills/playcraft-image-generation/reference/prompt-cookbook.md +397 -0
  65. package/project-template/.claude/skills/playcraft-image-generation/reference/validate-sprite-sheet.template.mjs +296 -0
  66. package/project-template/.claude/skills/playcraft-image-ops/SKILL.md +122 -0
  67. package/project-template/.claude/skills/playcraft-masking/SKILL.md +373 -0
  68. package/project-template/.claude/skills/playcraft-research/SKILL.md +212 -0
  69. package/project-template/.claude/skills/playcraft-sprite-generation/SKILL.md +423 -0
  70. package/project-template/.claude/skills/playcraft-storyboard/SKILL.md +148 -0
  71. package/project-template/.claude/skills/playcraft-style-qa/SKILL.md +270 -0
  72. package/project-template/.claude/skills/playcraft-text-rendering/SKILL.md +236 -0
  73. package/project-template/.claude/skills/playcraft-vfx-animation/SKILL.md +130 -0
  74. package/project-template/.claude/skills/playcraft-workflow/SKILL.md +396 -0
  75. package/project-template/.cursor/hooks.json +17 -0
  76. package/project-template/.cursor/rules/playcraft-orchestrator.mdc +87 -0
  77. package/project-template/.cursor/rules/playcraft-subagent-boundary.mdc +18 -0
  78. package/project-template/CLAUDE.md +240 -0
  79. package/project-template/assets/audio/bgm/.gitkeep +0 -0
  80. package/project-template/assets/audio/sfx/.gitkeep +0 -0
  81. package/project-template/assets/bundles/.gitkeep +0 -0
  82. package/project-template/assets/images/bg/.gitkeep +0 -0
  83. package/project-template/assets/images/reference/.gitkeep +0 -0
  84. package/project-template/assets/images/storyboard/.gitkeep +0 -0
  85. package/project-template/assets/images/tiles/.gitkeep +0 -0
  86. package/project-template/assets/images/ui/.gitkeep +0 -0
  87. package/project-template/assets/images/vfx/.gitkeep +0 -0
  88. package/project-template/assets/models/.gitkeep +0 -0
  89. package/project-template/docs/team/agent-conduct.md +105 -0
  90. package/project-template/docs/team/agent-runtime-matrix.md +62 -0
  91. package/project-template/docs/team/atom-plan-format.md +74 -0
  92. package/project-template/docs/team/collaboration.md +288 -0
  93. package/project-template/docs/team/core-model.md +50 -0
  94. package/project-template/docs/team/platform-capabilities.md +15 -0
  95. package/project-template/docs/team/workflow-changelog.md +51 -0
  96. package/project-template/docs/team/workflow-consistency-checklist.md +128 -0
  97. package/project-template/game/config/.gitkeep +0 -0
  98. package/project-template/game/gameplay/.gitkeep +0 -0
  99. package/project-template/game/scenes/.gitkeep +0 -0
  100. package/project-template/logs/.gitkeep +0 -0
  101. package/project-template/ta-workspace/logs/.gitkeep +0 -0
  102. package/project-template/ta-workspace/scripts/.gitkeep +0 -0
  103. package/project-template/ta-workspace/tmp/.gitkeep +0 -0
  104. package/project-template/templates/atom-plan.template.json +26 -0
  105. package/project-template/templates/atom-plan.template.md +76 -0
  106. package/project-template/templates/design-brief.template.md +195 -0
  107. package/project-template/templates/design-lens-checklist.reference.md +117 -0
  108. package/project-template/templates/design-methodology.md +99 -0
  109. package/project-template/templates/designer-log.template.md +98 -0
  110. package/project-template/templates/developer-log.template.md +140 -0
  111. package/project-template/templates/five-axis-framework.md +186 -0
  112. package/project-template/templates/intent-clarifications.template.md +58 -0
  113. package/project-template/templates/layout-spec.template.md +132 -0
  114. package/project-template/templates/project-state.template.md +219 -0
  115. package/project-template/templates/review-report.template.md +166 -0
  116. package/project-template/templates/style-exploration.template.md +93 -0
  117. package/project-template/templates/ta-log.template.md +205 -0
@@ -0,0 +1,240 @@
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`, `reworkRound`
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 `integration`)
27
+
28
+ ## Stage Model
29
+
30
+ ```
31
+ pm → style_exploration → production → integration → review ⇄ rework → done
32
+ ```
33
+
34
+ | Stage | Active Agent(s) | Completion |
35
+ | ------------------- | ------------------------------------- | ------------------------------------------------------------------------ |
36
+ | `pm` | PM | Gate #1 passed |
37
+ | `style_exploration` | Designer Phase 1 | Gate #2b passed (MC + ASR confirmed) |
38
+ | `production` | Designer Ph.2 → **TA** (serial waves) | Production Pipeline Wave 1 + Wave 2 both `done` |
39
+ | `integration` | **Developer** (full impl + integrate) | `devStatus: ready` + devUrl (no open upstream blockers) |
40
+ | `review` | Reviewer | Six-dimension score ≥ 24/30, or 2nd rework forced; Dev UI+gameplay check |
41
+ | `rework` | Routed agent(s) in parallel | Fixes done → `integration` → `review` |
42
+ | `done` | — | Gate #3 passed (user accepts at devUrl) |
43
+
44
+ ## Agent Team
45
+
46
+ 5 specialized agents, each with full instructions in `.claude/agents/<name>.md` (see **Goals** § Core responsibilities in each file).
47
+
48
+ | Agent | Top 3 responsibilities (priority order) | Invoke when |
49
+ | -------------------- | ------------------------------------------------------------------------------------------------ | -------------------------------------------------- |
50
+ | **PM** | 1) Experience + gameplay design 2) Zero-ambiguity contracts 3) Gates + ICP | `@pm` — start project, spec gaps |
51
+ | **Designer** | 1) Gate #2 visual+narrative (MC = Developer UI spec) 2) TA-ready handoff 3) Audio + digit strip | `@designer` — style exploration, audio |
52
+ | **Technical Artist** | 1) Style-faithful mass production 2) 100% assetMapping 3) Production-grade assets for Developer | `@technical-artist` — asset pipeline |
53
+ | **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 |
54
+ | **Reviewer** | 1) Intent delivery audit 2) Player experience (UI + gameplay fidelity) 3) Actionable verdict | `@reviewer` — quality gate before Gate #3 |
55
+
56
+ ### PM is the project owner
57
+
58
+ 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).
59
+
60
+ ### Gates (Orchestrator-Only)
61
+
62
+ Full protocol: [docs/team/collaboration.md § Gate Protocol](docs/team/collaboration.md#gate-protocol-orchestrator-only).
63
+
64
+ 1. **Gate #1 (Direction)** — PM prepares four docs → **you** `AskUserQuestion` → user confirms gameplay + style direction
65
+ 2. **Gate #2a (MC selection)** — Designer produces MC options → **you** `AskUserQuestion` → set `selectedMcOption`
66
+ 3. **Gate #2b (MC + ASR final)** — Designer produces ASR sheets (UI + element) + docs → **you** `AskUserQuestion` → then `stage: production`
67
+ 4. **Gate #3 (Dev delivery)** — Reviewer passes → **you** share **devUrl** → user accepts in browser (user never runs `npm run dev`)
68
+
69
+ **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.
70
+
71
+ ### Key Mechanisms
72
+
73
+ **Asset Contract** — Layout Spec `assetMapping` paths are locked after Gate #1:
74
+
75
+ - **TA** produces files at these exact paths (production Wave 2)
76
+ - **Developer** (`integration`): bind real assets at contract paths → **`npm run dev`** → self-check → `devStatus: ready` + devUrl (see Dev Preview Protocol)
77
+
78
+ **Spec Quick-Check** — 30s validation per wave:
79
+
80
+ - **TA** (production Wave 2 start): every assetMapping entry has clear size/format specs
81
+ - **Developer** (`integration` start): every GameplayAtom reference exists in assetMapping
82
+ - Gaps → `spec-gap` in project-state.md → PM auto-supplements within 5 min
83
+
84
+ **Rework Loop** — Max 2 iterations (`reworkRound` in project-state):
85
+
86
+ - Reviewer routes issues by target agent (can be parallel)
87
+ - Severity: `critical` (must fix) / `major` (1 round) / `minor` (log only)
88
+ - After 2 rounds → forced Gate #3, user decides
89
+
90
+ **Intent Clarification Protocol (ICP)** — Agent-to-agent async Q&A during production:
91
+
92
+ - Any agent writes questions to `docs/intent-clarifications.md`; target agent answers
93
+ - Non-blocking: asker continues with reasonable assumption, adjusts if needed after answer
94
+ - PM monitors: >3 open questions or single agent receiving >3 questions → intent transmission fault
95
+ - Designer adds Style Intent Notes + Anti-Pattern Notes to `designer-log.md` to reduce TA ambiguity
96
+ - TA runs Style Interpretation Check + Micro-Batch Validation before batch production
97
+ - Developer maps storyboard frames to code scenes in `developer-log.md`
98
+ - **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)
99
+
100
+ ### Designer vs Technical Artist
101
+
102
+ Designer = **"生"** (creative generation): **Master Composite** (concept panel + four storyboard panels), **ASR** (UI + element state reference sheets), all audio (BGM + SFX).
103
+ TA = **"产"** (production pipeline): extract from MC/ASR (via `crop` / `segment`), complete full asset set, runtime atlases, 3D, VFX, post-processing.
104
+
105
+ ## User interaction model
106
+
107
+ Three phases — **do not ask the user to run terminal commands** for preview.
108
+
109
+ | Phase | Who talks to user | User does |
110
+ | ---------------------- | ----------------------------------------- | --------------------------------------------------------------- |
111
+ | **A — Choose** | **Orchestrator only** (`AskUserQuestion`) | Gate #1, #2a, #2b — no sub-agent user prompts |
112
+ | **B — Produce** | Nobody (ICP is agent-to-agent) | Nothing |
113
+ | **C — Deliver in Dev** | **Orchestrator** | Gate #3: open **devUrl** you provide; accept or request changes |
114
+
115
+ ## Dev preview protocol
116
+
117
+ **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.
118
+
119
+ | Role | Runs `npm run dev`? | Responsibility |
120
+ | ---------------------- | -------------------------------- | ------------------------------------------------------------------------------------------------ |
121
+ | **Developer** | **Yes** (throughout integration) | **Final owner of Dev outcome** — UI, gameplay, assets must pass in Dev before `devStatus: ready` |
122
+ | **Reviewer** | **Yes** | Independent check: **① UI vs MC/layout-spec ② gameplay vs design-brief/PGS** |
123
+ | **You (orchestrator)** | Only if dev server stopped | Keep devUrl valid for Gate #3; **user only clicks the link** |
124
+ | **PM / Designer / TA** | No | Fix assets when Developer blocks upstream (see below) |
125
+ | **User** | **Never** | Gate #3: click devUrl only |
126
+
127
+ ### Developer upstream rework
128
+
129
+ When Developer finds **missing or substandard** Designer/TA output in Dev:
130
+
131
+ 1. Log blockers in `developer-log.md` + `project-state.md` (`devStatus: blocked_upstream`, `devBlockers`).
132
+ 2. Write `docs/intent-clarifications.md` with paths, gap vs MC/spec, and acceptance criteria.
133
+ 3. Mark affected atoms `blocked` in `atom-plan.md`.
134
+ 4. **You** re-invoke `@technical-artist` and/or `@designer` for targeted rework → then `@developer` again.
135
+ 5. Developer re-runs `npm run dev` until no open blockers → `devStatus: ready` + **devUrl**.
136
+
137
+ **Never** set `devStatus: ready` with placeholders, open `devBlockers`, or silent skips.
138
+
139
+ ### Gate #3 (orchestrator only)
140
+
141
+ 1. `reviewerDevCheck: passed` (or Reviewer overall pass).
142
+ 2. Read **devUrl** from `project-state.md`; if dev server down, run `npm run dev` and refresh devUrl (user still only opens the link).
143
+ 3. `AskUserQuestion`: show devUrl + accept / request changes (route to PM/Designer/TA/Developer).
144
+ 4. User accepts → `stage: done`, `gates.#3 = passed`.
145
+
146
+ **Current delivery endpoint = user acceptance in Dev.** `playcraft build` is **future**, not required for `done`.
147
+
148
+ ## Orchestration Protocol
149
+
150
+ When you receive a user request to create a playable ad, determine your execution mode first.
151
+
152
+ ### Multi-Agent Mode (default, preferred)
153
+
154
+ If sub-agent invocation is available (Claude Code `@agent` syntax), **you are the orchestrator**. Do NOT role-play all agents yourself in one session.
155
+
156
+ ### Orchestrator startup (every turn)
157
+
158
+ 1. Read `docs/project-state.md` → parse **`## Agent handoff`** YAML + Gates table.
159
+ 2. If `gate_pending` is non-null and `waiting_for: user_gate` → run **only** that Gate (`AskUserQuestion`) — **do not** invoke sub-agents.
160
+ 3. If `subagent_stop: true` and `waiting_for: orchestrator` → execute **only** `next_orchestrator_action`.
161
+ 4. Confirm `stage` matches last passed gate before advancing.
162
+ 5. Before invoke: reset handoff (`subagent_stop: false`, `waiting_for: none`, set `subagent` to target).
163
+
164
+ See `docs/team/collaboration.md` § Agent Handoff, § Stage field ownership, § Rework sequence.
165
+
166
+ ### Stage sync on handoff
167
+
168
+ When executing `next_orchestrator_action`, **also** update mainline `stage` / gates:
169
+
170
+ | `next_orchestrator_action` contains | Orchestrator **must** write |
171
+ | --------------------------------------------- | -------------------------------------------------------------------------------------------------- |
172
+ | `Run Gate #1` | After user pass: `gates.#1 = passed`, `stage: style_exploration` |
173
+ | `Run Gate #2a` | `gates.#2a = passed`, set `selectedMcOption`, resume `@designer` (stage stays `style_exploration`) |
174
+ | `Run Gate #2b` | `gates.#2b = passed`, `stage: production`, invoke `@designer` Ph.2 only |
175
+ | `Invoke @technical-artist` | Production Pipeline Wave 1 `done` → invoke TA (Wave 2) |
176
+ | `Set stage=integration` / invoke `@developer` | Production Pipeline Wave 2 `done` → `stage: integration` |
177
+ | `Invoke @reviewer` | `stage: review` |
178
+ | `Set stage=rework` | `stage: rework`, invoke per review-report |
179
+ | `Run Gate #3` | `gates.#3 = pending` → user accept → `stage: done`, `gates.#3 = passed` |
180
+
181
+ **Stage transition table:**
182
+
183
+ | Current Stage | Trigger | Your Action |
184
+ | ------------------- | ------------------------------------- | -------------------------------------------------------------------------------------------- |
185
+ | (start) | User prompt received | Invoke `@pm` |
186
+ | `pm` | PM STOP + `gates.#1 = pending` | Gate #1 `AskUserQuestion` → on pass invoke `@designer` |
187
+ | `style_exploration` | Designer STOP + `gates.#2a = pending` | Gate #2a `AskUserQuestion` → set `selectedMcOption` → resume `@designer` |
188
+ | `style_exploration` | Designer STOP + `gates.#2b = pending` | Gate #2b confirm → `stage: production` → invoke `@designer` Ph.2 only |
189
+ | `production` | Designer Wave 1 `done` | Invoke `@technical-artist` (Wave 2) |
190
+ | `production` | TA Wave 2 `done` (Compliance green) | `stage: integration` → invoke `@developer` (Skill Preflight + PGS + assets + dev) |
191
+ | `integration` | `devStatus: ready` | Invoke `@reviewer` |
192
+ | `integration` | `devStatus: blocked_upstream` | Re-invoke `@technical-artist` / `@designer` per `devBlockers` → then `@developer` |
193
+ | `review` | Fail + `reworkRound` &lt; 2 | `stage: rework` → parallel invoke per Action Items → `@developer` re-integrate → `@reviewer` |
194
+ | `rework` | Fixes done + `devStatus: ready` | `stage: integration` or invoke `@reviewer` directly per reviewer rules |
195
+ | `review` | Pass (≥24/30) or 2nd rework forced | Gate #3: present **devUrl** via `AskUserQuestion` |
196
+
197
+ **How to invoke sub-agents:**
198
+
199
+ - Each `@agent-name` corresponds to `.claude/agents/<name>.md`
200
+ - Sub-agents read `project-state.md` + **`## Agent handoff`**; follow each agent's **Runtime** section
201
+ - Sub-agents update handoff + gates and **STOP** — they do **not** `AskUserQuestion` or change mainline `stage`
202
+ - You read handoff between every invoke (startup checklist above)
203
+ - **Only you** run Gate #1 / #2a / #2b / #3 user interactions
204
+
205
+ **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.
206
+
207
+ ## Directory Layout
208
+
209
+ ```
210
+ docs/ Design documents (project-state, design-brief, layout-spec, atom-plan, style-exploration)
211
+ assets/ images/{bg,tiles,ui,vfx,storyboard,reference} audio/{bgm,sfx} models/ bundles/
212
+ game/ gameplay/ config/ scenes/ index.html
213
+ logs/ designer-log / ta-log / developer-log / review-report
214
+ templates/ Read-only reference templates
215
+ ta-workspace/ TA batch scripts (scripts/) + temp files (logs/, tmp/)
216
+ ```
217
+
218
+ ## Golden Rules
219
+
220
+ Project-level principles (full MUST/NEVER: [docs/team/agent-conduct.md](docs/team/agent-conduct.md)):
221
+
222
+ 1. First level must guarantee player success
223
+ 2. Hook decides everything — first 3 seconds
224
+ 3. Quality first — do not compromise quality for file size or play time
225
+ 4. Style Gate (#2a + #2b) cannot be skipped — no production without confirmed MC + ASR
226
+ 5. Layout Spec is the sole three-way alignment mechanism — do not violate
227
+ 6. Asset Contract paths are immutable after Gate #1
228
+ 7. Production serial: Designer Ph.2 → TA → Developer (`integration`) — never invoke `@developer` during `production`
229
+ 8. Rework max 2 rounds — then forced Gate #3
230
+ 9. Dev delivery: Developer owns Dev quality; user only opens orchestrator devUrl at Gate #3
231
+ 10. No `playcraft build` for `done` — endpoint is `devStatus: ready` + user devUrl acceptance
232
+
233
+ ## Detailed References
234
+
235
+ | Document | Contents |
236
+ | ------------------------------------------------------------------------ | ---------------------------------------------------- |
237
+ | [docs/team/agent-conduct.md](docs/team/agent-conduct.md) | MUST/NEVER behavior contract |
238
+ | [docs/team/collaboration.md](docs/team/collaboration.md) | Gate Protocol, directory tree, R/W matrix, MC panels |
239
+ | [docs/team/core-model.md](docs/team/core-model.md) | Remix = DAG(Atom[]) model |
240
+ | [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,105 @@
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** | If `gate_pending` is non-null and `waiting_for: user_gate`, run **only** the matching Gate (`AskUserQuestion`) — **do not** invoke sub-agents |
34
+ | **MUST** | If `subagent_stop: true` and `waiting_for: orchestrator`, execute **only** `next_orchestrator_action` |
35
+ | **MUST** | Before invoke: reset handoff (`subagent_stop: false`, `waiting_for: none`, set `subagent` to target role) |
36
+ | **MUST NOT** | Role-play all five agents in one session when sub-agent invoke is available |
37
+ | **MUST NOT** | Skip Gate #2a / #2b while gates are `pending` |
38
+ | **MUST NOT** | Invoke `@technical-artist` before Production Pipeline Wave 1 (Designer Ph.2) is `done` |
39
+ | **MUST NOT** | Invoke `@developer` or set `stage: integration` before Production Pipeline Wave 2 (TA) is `done` |
40
+ | **MUST NOT** | Spawn `@developer` during `stage: production` (serial workflow: Designer → TA → Developer) |
41
+ | **MUST NOT** | Advance mainline `stage` when a sub-agent could do it — **orchestrator owns** `stage` transitions (see collaboration.md § Stage field ownership) |
42
+
43
+ ## Sub-agents only (PM, Designer, TA, Developer, Reviewer)
44
+
45
+ | | Rule |
46
+ | ------------ | ----------------------------------------------------------------------------------------------------------------------------- |
47
+ | **MUST NOT** | Use `AskUserQuestion` or present Gate choices to the user |
48
+ | **MUST** | On Gate-ready materials: sync `gates.#N = pending` + handoff (`gate_pending`, `waiting_for: user_gate`) → **STOP** |
49
+ | **MUST** | Run Spec Quick-Check within 30s: TA when starting production Wave 2; Developer when starting `integration` |
50
+ | **MUST NOT** | Continue producing while `subagent_stop: true` and `waiting_for: orchestrator` (resume only when orchestrator clears handoff) |
51
+ | **MUST NOT** | Change mainline `stage` (orchestrator only — see collaboration.md § Stage field ownership) |
52
+ | **MUST NOT** | Skip required logs (`designer-log`, `ta-log`, `developer-log`, `review-report`) |
53
+ | **MUST** | Complete [STOP sync checklist](collaboration.md#stop-sync-checklist) on every STOP |
54
+
55
+ ### PM (four-doc discipline)
56
+
57
+ | | Rule |
58
+ | ------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
59
+ | **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 |
60
+ | **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` |
61
+ | **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 |
62
+ | **MUST NOT** | Put `playcraft-*` in `skillRef`, or use atomIds absent from `skillsMatch.items` without `dagRevisions` — format: [`atom-plan-format.md`](atom-plan-format.md) |
63
+ | **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 |
64
+
65
+ ### Designer (four-doc discipline)
66
+
67
+ | | Rule |
68
+ | ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
69
+ | **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 |
70
+ | **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 |
71
+ | **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 |
72
+
73
+ ### Technical Artist
74
+
75
+ | | Rule |
76
+ | ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
77
+ | **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 |
78
+ | **MUST** | Execute `refs/ta-pipeline-cookbook.md` **Step 0a → Step 0** in order after intake |
79
+ | **MUST NOT** | Start bulk generation or write `ta-log` Style Interpretation until Upstream Intake is complete |
80
+ | **MUST NOT** | Mark TA wave `done` without Upstream Intake + Style Interpretation sections filled |
81
+ | **MUST** | Pass **`.claude/hooks/validate-workflow-stop.mjs`** on STOP (Claude `SubagentStop` + Cursor `subagentStop` — see `.claude/hooks/README.md`) |
82
+
83
+ ### Developer
84
+
85
+ | | Rule |
86
+ | ------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
87
+ | **MUST** | Before Spec Quick-Check or any `game/` work in `integration`: 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 (what happened upstream + what you will implement) |
88
+ | **MUST** | Execute `refs/developer-phase1-flow.md` **Step 0 → Step 1** in order after intake |
89
+ | **MUST NOT** | Start Skill Preflight or edit `game/**` until Upstream Intake is complete |
90
+ | **MUST** | Before any `game/` implementation in Ph.1: for each non-empty `skillRef`, read Recipe + `ref/` from `.claude/skills/<skillRef>/` when link exists; else `playcraft skills read` + Package Skills Root (fallback); then `playcraft skills scaffold` — log access mode in `developer-log.md` § Skill Preflight |
91
+ | **MUST** | Base gameplay/config on Skill Recipe + `ref/` templates; deviations only with rationale in `## Impl Skill Context` |
92
+ | **MUST** | Own Dev preview quality at **devUrl** before Reviewer / Gate #3 |
93
+ | **MUST NOT** | Write or edit `game/**` in `integration` until Skill Preflight is complete (orchestrator may pass `skillRefs` in invoke prompt) |
94
+ | **MUST NOT** | Set `devStatus: ready` while `devBlockers` has open items |
95
+ | **MUST NOT** | Use placeholder assets or silently skip `blocked` atoms |
96
+ | **MUST NOT** | Record Impl Skill Context as "referenced" without having read that `skillRef`'s SKILL.md + `ref/` (via Project Skills or CLI fallback) |
97
+ | **MUST** | Pass **`.claude/hooks/validate-workflow-stop.mjs`** on STOP (same hook as TA — enforced for `developer` role) |
98
+
99
+ ### Reviewer
100
+
101
+ | | Rule |
102
+ | ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
103
+ | **MUST** | Dev walkthrough at **devUrl** before six-dimension scoring |
104
+ | **MUST NOT** | Modify production files (only `logs/review-report.md` + `project-state` checkpoint) |
105
+ | **MUST** | On fail: increment `reworkRound`, route Action Items in `review-report.md`, set handoff `next_orchestrator_action` for orchestrator to set `stage: rework` — **do not** write `stage: rework` yourself |
@@ -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,74 @@
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[]` | `## TA Skill Context` | 同上 |
71
+ | Designer | `atoms[]` | `## Asset Skill Context` | 同上 |
72
+ | Reviewer | 两者只读 | 两者只读 | — |
73
+
74
+ Developer 软链:`.claude/skills/<skillRef>/`(`playcraft skills link --from-atom-plan`)。断链时用 `playcraft skills read <skillRef>`(自动读 config,勿手抄 node_modules 路径)。