@playcraft/cli 0.0.42 → 0.0.43
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/atom-plan/validate-asr-coverage.js +317 -0
- package/dist/commands/prad.js +61 -0
- package/dist/commands/remix.js +4 -2
- package/dist/commands/skills.js +24 -0
- package/dist/prad/atom-ref.js +23 -0
- package/dist/prad/check.js +377 -0
- package/dist/prad/check.test.js +27 -0
- package/dist/prad/explain.js +109 -0
- package/dist/prad/load-spec.js +23 -0
- package/dist/prad/paths.js +83 -0
- package/dist/prad/skills-index.js +60 -0
- package/package.json +3 -3
- package/project-template/.claude/agents/designer.md +26 -22
- package/project-template/.claude/agents/developer.md +2 -0
- package/project-template/.claude/agents/pm.md +3 -1
- package/project-template/.claude/agents/refs/designer-deliverable-spec.md +46 -7
- package/project-template/.claude/agents/refs/designer-handoff-v2-checklist.md +21 -13
- package/project-template/.claude/agents/refs/designer-style-exploration-flow.md +39 -9
- package/project-template/.claude/agents/refs/developer-dev-handoff.md +1 -1
- package/project-template/.claude/agents/refs/pm-workflow-detail.md +18 -2
- package/project-template/.claude/agents/refs/reviewer-convergence-eval.md +17 -5
- package/project-template/.claude/agents/refs/ta-pipeline-cookbook.md +42 -6
- package/project-template/.claude/agents/reviewer.md +8 -5
- package/project-template/.claude/agents/technical-artist.md +2 -0
- package/project-template/.claude/hooks/README.md +34 -6
- package/project-template/.claude/hooks/asr-coverage-validate.mjs +381 -0
- package/project-template/.claude/hooks/validate-workflow-stop.mjs +113 -7
- package/project-template/.claude/skills/playcraft-asset-state-sheet/SKILL.md +76 -22
- package/project-template/.claude/skills/playcraft-image-generation/SKILL.md +19 -0
- package/project-template/docs/team/agent-runtime-matrix.md +71 -39
- package/project-template/docs/team/atom-plan-format.md +68 -0
- package/project-template/docs/team/core-model.md +20 -19
- package/project-template/docs/team/workflow-consistency-checklist.md +52 -0
- package/project-template/templates/atom-plan.template.json +18 -0
- package/project-template/templates/designer-log.template.md +78 -5
- package/project-template/templates/layout-spec.template.md +48 -8
- package/project-template/templates/ta-log.template.md +50 -22
|
@@ -48,19 +48,67 @@ Repeat this section for each atom.
|
|
|
48
48
|
Fill in details as you complete each one.
|
|
49
49
|
-->
|
|
50
50
|
|
|
51
|
+
## Image Production Preflight (Phase 1 — Gate #2b)
|
|
52
|
+
|
|
53
|
+
> **Mandatory before MC/ASR generation and before `#2b` STOP.** Read all three Skills; record key decisions.
|
|
54
|
+
|
|
55
|
+
| Skill / Check | 已读 | 关键决策摘要 |
|
|
56
|
+
| --------------------------- | ---- | -------------------------------------------------------- |
|
|
57
|
+
| playcraft-storyboard | ☐ | MC 45:16 · model whitelist · Panel 1 all element types |
|
|
58
|
+
| playcraft-asset-state-sheet | ☐ | ASR grid · isolated cells · sheet #808080 · cell chroma |
|
|
59
|
+
| playcraft-image-generation | ☐ | §3 chroma matrix · §3.1 ASR branch · no remove-bg on ASR |
|
|
60
|
+
|
|
61
|
+
<!--
|
|
62
|
+
MUST be filled before generating ASR (Step 4) and before Gate #2b STOP.
|
|
63
|
+
Hook validate-workflow-stop enforces this section in style_exploration stage.
|
|
64
|
+
-->
|
|
65
|
+
|
|
51
66
|
## ASR Coverage Matrix (designer-handoff-v2 — 100% contract rows)
|
|
52
67
|
|
|
53
68
|
> UI: `assets/images/reference/ui_state_sheet_{{option}}.png`
|
|
54
69
|
> Element: `assets/images/reference/element_state_sheet_{{option}}.png`
|
|
55
70
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
|
59
|
-
|
|
|
71
|
+
### Sheet grid metadata (供 TA crop 计算)
|
|
72
|
+
|
|
73
|
+
| Sheet | Total rows | Total cols | Cell W×H (px) | Cell padding (px) | Origin |
|
|
74
|
+
| -------------------------------------- | ------------- | ---------- | ------------- | ----------------- | ----------------- |
|
|
75
|
+
| `ui_state_sheet_{{option}}.png` | 2 | 4 | 800×800 | 80 | top-left (R1, C1) |
|
|
76
|
+
| `element_state_sheet_{{option}}.png` | 2 | 4 | 800×800 | 80 | top-left (R1, C1) |
|
|
77
|
+
| `element_state_sheet_{{option}}_2.png` | (if overflow) | | | | |
|
|
78
|
+
|
|
79
|
+
<!--
|
|
80
|
+
Grid coordinates use 1-based indexing, row-major.
|
|
81
|
+
Cell W×H = visible cell area (without padding). Padding = margin between cells AND outer margin.
|
|
82
|
+
Pixel coordinates of cell (R, C):
|
|
83
|
+
x = (C - 1) × (cellW + padding) + padding
|
|
84
|
+
y = (R - 1) × (cellH + padding) + padding
|
|
85
|
+
TA uses these for `playcraft image crop --x ... --y ... --width cellW --height cellH`.
|
|
86
|
+
-->
|
|
87
|
+
|
|
88
|
+
### Coverage
|
|
89
|
+
|
|
90
|
+
| Contract id | elementType | Type | CoverageLayer | ASR sheet | Grid (row,col) | State(s) | TA extends? |
|
|
91
|
+
| -------------------------------- | ----------- | ------ | ----------------------------- | ------------ | -------------- | ----------- | ----------- |
|
|
92
|
+
| {{element_id_from_assetMapping}} | {{type}} | visual | on-asr / mc-crop / ta-extends | ui / element | {{R1C1}} | {{default}} | {{yes/no}} |
|
|
93
|
+
| {{static_text_id}} | — | text | mc-crop or on-asr | ui / MC-crop | — | baked | {{yes/no}} |
|
|
60
94
|
|
|
61
95
|
<!--
|
|
62
96
|
One row per layout-spec assetMapping elementId and per static text id.
|
|
63
|
-
|
|
97
|
+
CoverageLayer:
|
|
98
|
+
on-asr — physical slot on ASR PNG; Grid required; mirror atoms[].asrSlot
|
|
99
|
+
mc-crop — MC Panel 1 only; ASR sheet = MC-crop
|
|
100
|
+
ta-extends — variant/extra states; TA extends? = yes + Style Intent note
|
|
101
|
+
|
|
102
|
+
Type rule: each distinct elementType must have ≥1 row with on-asr OR mc-crop.
|
|
103
|
+
Grid syntax: R{row}C{col}, e.g. R1C2, 1-based, row-major.
|
|
104
|
+
TA crop + Phase 2 VisualAtom actualOutput: ASR:<sheet>:R#C#
|
|
105
|
+
|
|
106
|
+
After filling this table, MIRROR each visual row into atom-plan.json:
|
|
107
|
+
atoms[].asrSlot = { "sheet": "ui" | "element", "row": <n>, "col": <n> }
|
|
108
|
+
|
|
109
|
+
This lets TA batch-crop from atom-plan.json directly (see ta-pipeline-cookbook.md
|
|
110
|
+
§ ASR 提取方法 "优先路径") instead of manually re-reading this Coverage table.
|
|
111
|
+
See docs/team/atom-plan-format.md § `asrSlot` for full schema + crop formula.
|
|
64
112
|
-->
|
|
65
113
|
|
|
66
114
|
## Palette Locked (from MC option {{option}})
|
|
@@ -90,6 +138,31 @@ TA crop index + Phase 2 VisualAtom actualOutput: ASR:sheet:R#C#
|
|
|
90
138
|
mediaGroups: list each .aiaudio match disposition (linked/skipped + reason).
|
|
91
139
|
-->
|
|
92
140
|
|
|
141
|
+
## mediaGroups Reuse (Phase 2)
|
|
142
|
+
|
|
143
|
+
> **Mandatory before any audio generation.** Filter `atom-plan.json` → `skillsMatch.mediaGroups` by `extension`; Designer is responsible for **`.aiaudio` only** (TA handles `.aiimage` / `.aisprite`).
|
|
144
|
+
|
|
145
|
+
| mediaGroup atomId | extension | Matches Designer atom? | Disposition | Reason (if skipped) | Output path (if linked) |
|
|
146
|
+
| ----------------- | --------- | ---------------------- | ------------- | ---------------------------------- | ----------------------- |
|
|
147
|
+
| {{mg_atomId}} | .aiaudio | {{atom_id / —}} | linked / skip | {{mood mismatch / wrong loop / —}} | {{path / —}} |
|
|
148
|
+
|
|
149
|
+
<!--
|
|
150
|
+
Designer scope (this table):
|
|
151
|
+
.aiaudio — BGM / SFX bundles → link or skip (with reason)
|
|
152
|
+
|
|
153
|
+
Out of Designer scope (do NOT fill rows for these — TA owns them):
|
|
154
|
+
.aiimage — single-shot image atoms
|
|
155
|
+
.aisprite — sprite-sheet atoms (multi-frame)
|
|
156
|
+
.aigameplay / .aiconfig — Developer reads via skillRef
|
|
157
|
+
|
|
158
|
+
Filter command:
|
|
159
|
+
cat docs/atom-plan.json | jq '.skillsMatch.mediaGroups[] | select(.extension == ".aiaudio")'
|
|
160
|
+
|
|
161
|
+
Disposition rules:
|
|
162
|
+
linked → playcraft skills link → verify mood matches MC → status: done
|
|
163
|
+
skip → quality / mood / loop mismatch → document reason → generate from scratch
|
|
164
|
+
-->
|
|
165
|
+
|
|
93
166
|
## Style Consistency Self-Check
|
|
94
167
|
|
|
95
168
|
- [ ] All visual assets share the same art style?
|
|
@@ -82,6 +82,24 @@ Single large assets (full-screen bg) → one webp path only. Digit strip → sep
|
|
|
82
82
|
Each elementId in assetMapping uses atlasPath + frameId OR single visualAsset path.
|
|
83
83
|
-->
|
|
84
84
|
|
|
85
|
+
Single-element groups stay as single-file paths; do not invent atlases for one texture.
|
|
86
|
+
|
|
87
|
+
---
|
|
88
|
+
|
|
89
|
+
## Element Type Registry (ASR capacity budget)
|
|
90
|
+
|
|
91
|
+
Group `assetMapping` elementIds by **visual type** before Gate #1 lock. Designer needs **one representative per type** on ASR or MC Panel 1; color variants are `ta-extends`.
|
|
92
|
+
|
|
93
|
+
| typeId | elementIds (variants) | Notes |
|
|
94
|
+
| -------- | ---------------------------- | ------------------------------- |
|
|
95
|
+
| {{type}} | {{id_a}}, {{id_b}}, {{id_c}} | e.g. tile colors share one type |
|
|
96
|
+
|
|
97
|
+
**Budget**: aim for **≤ 20 unique types** and **≤ ~24 ASR physical slots** (ui board ~12 + element board ~12). If types > 12, plan `element_state_sheet_[X]_2.png` or extra `mc-crop` + `ta-extends` rows.
|
|
98
|
+
|
|
99
|
+
Designer Coverage Matrix **elementType** column should match `typeId` here.
|
|
100
|
+
|
|
101
|
+
---
|
|
102
|
+
|
|
85
103
|
## Asset Mapping
|
|
86
104
|
|
|
87
105
|
| elementId | visualAsset / atlas | frameId | sfx |
|
|
@@ -131,16 +149,38 @@ TA extracts each text element using segment and saves to the specified path.
|
|
|
131
149
|
|
|
132
150
|
### Digit Sprite Strip (for dynamic numbers)
|
|
133
151
|
|
|
134
|
-
- **Characters**: `{{digit_characters}}`
|
|
152
|
+
- **Characters**: `{{digit_characters}}` _(typical "0123456789" — frameCount = 10)_
|
|
135
153
|
- **Cell size**: {{cell_w}}x{{cell_h}}
|
|
136
|
-
- **Asset path**: `assets/images/
|
|
154
|
+
- **Asset path**: `assets/images/txt/digits.webp` _(recommended: text-class lives under `images/txt/` per Transparency Classification)_
|
|
155
|
+
- **Sidecar path (optional)**: `assets/images/txt/digits.json` _(only when laid out as multi-row grid; single-row strip can omit)_
|
|
156
|
+
- **Layout**: single-row horizontal strip (default) — total width = `cell_w × frameCount`, height = `cell_h`
|
|
157
|
+
- **Alpha**: required (channels = 4); TA uses **bluescreen** chroma (text typically gold/white — avoid green key)
|
|
137
158
|
|
|
138
159
|
<!--
|
|
139
160
|
PM defines the character set based on what dynamic text the game needs.
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
- Score
|
|
143
|
-
- Score +
|
|
144
|
-
|
|
145
|
-
|
|
161
|
+
|
|
162
|
+
Common sets (always include digits 0–9 first, then any symbols):
|
|
163
|
+
- Score only: "0123456789" (frameCount = 10)
|
|
164
|
+
- Score + timer: "0123456789:." (frameCount = 12)
|
|
165
|
+
- Score + multiplier: "0123456789x+,." (frameCount = 14)
|
|
166
|
+
|
|
167
|
+
Path convention (TA Transparency Classification + Compliance Gate):
|
|
168
|
+
- `assets/images/txt/digits.webp` — preferred (text class → bluescreen, channels=4)
|
|
169
|
+
- `assets/images/txt/digits_{{label}}.webp` — when multiple digit styles exist (score / countdown / level)
|
|
170
|
+
- Legacy `assets/images/ui/digits.webp` works but TA must still classify it as text (bluescreen, not greenscreen).
|
|
171
|
+
|
|
172
|
+
Layout (default single horizontal row):
|
|
173
|
+
- Total width = cell_w × frameCount
|
|
174
|
+
- Total height = cell_h
|
|
175
|
+
- Cell origin (0-based, row-major): x = index × cell_w, y = 0
|
|
176
|
+
- Developer slices at runtime: char_x = index × cell_w
|
|
177
|
+
|
|
178
|
+
Multi-row digit grid (rare — e.g. small + large digits in one sheet) MUST supply a `.json` sidecar
|
|
179
|
+
describing each frame; Compliance Gate then checks dimensions against that sidecar.
|
|
180
|
+
|
|
181
|
+
Compliance Gate (TA verifies before STOP):
|
|
182
|
+
- frameCount = character count above
|
|
183
|
+
- total width × height matches the layout (single-row or sidecar)
|
|
184
|
+
- channels = 4 (alpha)
|
|
185
|
+
- dark-bg verify: no chroma residue around digit edges
|
|
146
186
|
-->
|
|
@@ -34,16 +34,27 @@
|
|
|
34
34
|
|
|
35
35
|
## mediaGroups Reuse
|
|
36
36
|
|
|
37
|
-
> **Step 0 Pre — mandatory before Skill Discovery.**
|
|
37
|
+
> **Step 0 Pre — mandatory before Skill Discovery.** Filter `atom-plan.json` → `skillsMatch.mediaGroups` by `extension`; TA is responsible for **`.aiimage` + `.aisprite`** (Designer handles `.aiaudio`).
|
|
38
38
|
|
|
39
|
-
| mediaGroup atomId | Matches TA atom? | Disposition | Reason (if skipped)
|
|
40
|
-
| ----------------- | ---------------- | ------------- |
|
|
41
|
-
| {{mg_atomId}} | {{atom_id / —}} | linked / skip | {{style mismatch /
|
|
39
|
+
| mediaGroup atomId | extension | Matches TA atom? | Disposition | Reason (if skipped) | Output path (if linked) |
|
|
40
|
+
| ----------------- | ------------------ | ---------------- | ------------- | ------------------------------- | ----------------------- |
|
|
41
|
+
| {{mg_atomId}} | .aiimage/.aisprite | {{atom_id / —}} | linked / skip | {{style mismatch / wrong dims}} | {{path / —}} |
|
|
42
42
|
|
|
43
43
|
<!--
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
44
|
+
TA scope (this table):
|
|
45
|
+
.aiimage — single-shot image bundles (bg, single ui element, single tile)
|
|
46
|
+
.aisprite — sprite-sheet bundles (multi-frame: tile sets, vfx, animations)
|
|
47
|
+
|
|
48
|
+
Out of TA scope (do NOT fill rows for these — Designer owns them):
|
|
49
|
+
.aiaudio — BGM / SFX → see designer-log.md § mediaGroups Reuse
|
|
50
|
+
|
|
51
|
+
Filter command:
|
|
52
|
+
cat docs/atom-plan.json | jq '.skillsMatch.mediaGroups[] | select(.extension == ".aiimage" or .extension == ".aisprite")'
|
|
53
|
+
|
|
54
|
+
Disposition rules:
|
|
55
|
+
linked → playcraft skills link → post-process (resize/convert/transparency) → status=done
|
|
56
|
+
skip → quality / style / wrong dimensions → document reason → generate from scratch
|
|
57
|
+
|
|
47
58
|
This section MUST be filled before proceeding to Step 0 Skill Discovery.
|
|
48
59
|
-->
|
|
49
60
|
|
|
@@ -80,12 +91,17 @@
|
|
|
80
91
|
| {{n}} | "{{designer_quote}}" | {{my_interpretation}} | high/medium/low | proceed / clarify |
|
|
81
92
|
|
|
82
93
|
<!--
|
|
83
|
-
Confidence rules:
|
|
94
|
+
Confidence rules (atom-granularity — hold only the affected asset type, not the whole Wave 2):
|
|
84
95
|
high → proceed with completion
|
|
85
96
|
medium → proceed, but include style interpretation in --reference-image prompt
|
|
86
|
-
low →
|
|
87
|
-
|
|
88
|
-
|
|
97
|
+
low → HOLD that asset type only: write question to docs/intent-clarifications.md
|
|
98
|
+
(routeTo: designer if style ambiguity; routeTo: pm if contract ambiguity)
|
|
99
|
+
→ continue producing OTHER asset types where confidence ≥ medium
|
|
100
|
+
→ resume the held type only after ICP answer (or Designer supplementary PNG per
|
|
101
|
+
designer-deliverable-spec.md § "ICP supplementary PNG — when (and only when)")
|
|
102
|
+
|
|
103
|
+
You may STOP only when EVERY remaining asset type is held at confidence=low — otherwise keep
|
|
104
|
+
making progress on the producible ones in parallel with the ICP wait.
|
|
89
105
|
-->
|
|
90
106
|
|
|
91
107
|
## Production Plan
|
|
@@ -289,17 +305,29 @@ Every row must be PASS before advancing to integration.
|
|
|
289
305
|
|
|
290
306
|
### Spec Compliance Summary
|
|
291
307
|
|
|
292
|
-
| Check
|
|
293
|
-
|
|
|
294
|
-
| Background dimensions
|
|
295
|
-
| Tile dimensions
|
|
296
|
-
| UI element dimensions
|
|
297
|
-
|
|
|
298
|
-
|
|
|
299
|
-
|
|
|
300
|
-
|
|
|
301
|
-
|
|
|
302
|
-
|
|
|
308
|
+
| Check | Target | Actual | Result |
|
|
309
|
+
| -------------------------- | ---------------------------------------------------------- | ---------- | ------------- |
|
|
310
|
+
| Background dimensions | {{assetSpec}} | {{actual}} | {{PASS/FAIL}} |
|
|
311
|
+
| Tile dimensions | {{assetSpec}} | {{actual}} | {{PASS/FAIL}} |
|
|
312
|
+
| UI element dimensions | {{assetSpec}} | {{actual}} | {{PASS/FAIL}} |
|
|
313
|
+
| **Text dimensions** | `images/txt/*` per `layout-spec` text spec (W×H per label) | {{actual}} | {{PASS/FAIL}} |
|
|
314
|
+
| **Digit Strip dimensions** | `images/txt/digits*` cellW × cellH × frameCount (0–9 = 10) | {{actual}} | {{PASS/FAIL}} |
|
|
315
|
+
| Background file size | < 500KB | {{actual}} | {{PASS/FAIL}} |
|
|
316
|
+
| Tile file size | < 100KB per tile | {{actual}} | {{PASS/FAIL}} |
|
|
317
|
+
| BGM file size | < 300KB | {{actual}} | {{PASS/FAIL}} |
|
|
318
|
+
| SFX file size | < 50KB per SFX | {{actual}} | {{PASS/FAIL}} |
|
|
319
|
+
| Total assets size | ≤ 2-3MB | {{actual}} | {{PASS/FAIL}} |
|
|
320
|
+
| Sprite sheet JSON paired | Every .png sheet has .json | {{yes/no}} | {{PASS/FAIL}} |
|
|
321
|
+
|
|
322
|
+
<!--
|
|
323
|
+
Text dimensions: every `images/txt/*` asset must match per-label W×H from layout-spec § Static text (or atlas grouping for text atlas).
|
|
324
|
+
Digit Strip dimensions: digit sprite (typically `images/txt/digits.webp` or `images/ui/digits.webp`) must satisfy:
|
|
325
|
+
- frameCount = 10 (0–9) — for score / countdown / level display
|
|
326
|
+
- width == cellW × frameCount (when laid out as a single row)
|
|
327
|
+
- height == cellH (single-row strip) OR width × height matches multi-row grid in JSON sidecar
|
|
328
|
+
- channels = 4 (alpha for overlay)
|
|
329
|
+
If digit strip is split across multiple paths (e.g. small + large) each needs its own row.
|
|
330
|
+
-->
|
|
303
331
|
|
|
304
332
|
### Transparency Compliance
|
|
305
333
|
|