@playcraft/cli 0.0.39 → 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.
- package/README.md +66 -3
- package/dist/atom-plan/validate-atom-plan.js +298 -0
- package/dist/cli-root-help.js +1 -1
- package/dist/commands/3d.js +363 -0
- package/dist/commands/create.js +337 -0
- package/dist/commands/fix-ids.js +17 -3
- package/dist/commands/fix-ids.test.js +264 -0
- package/dist/commands/image.js +1337 -43
- package/dist/commands/login.js +60 -2
- package/dist/commands/recommend.js +1 -1
- package/dist/commands/remix.js +213 -0
- package/dist/commands/skills.js +1379 -0
- package/dist/commands/tools-3d.js +473 -0
- package/dist/commands/tools-generation.js +454 -0
- package/dist/commands/tools-project.js +400 -0
- package/dist/commands/tools-research.js +37 -0
- package/dist/commands/tools-research.test.js +216 -0
- package/dist/commands/tools-utils.js +164 -0
- package/dist/commands/tools.js +7 -616
- package/dist/config.js +2 -0
- package/dist/index.js +20 -2
- package/dist/utils/agent-api-client.js +52 -16
- package/package.json +9 -3
- package/project-template/.claude/agents/designer.md +116 -0
- package/project-template/.claude/agents/developer.md +133 -0
- package/project-template/.claude/agents/pm.md +164 -0
- package/project-template/.claude/agents/refs/README.md +67 -0
- package/project-template/.claude/agents/refs/designer-art-style-catalog.md +533 -0
- package/project-template/.claude/agents/refs/designer-color-audio-recipes.md +153 -0
- package/project-template/.claude/agents/refs/designer-deliverable-spec.md +167 -0
- package/project-template/.claude/agents/refs/designer-dimension-axis.md +27 -0
- package/project-template/.claude/agents/refs/designer-handoff-v2-checklist.md +68 -0
- package/project-template/.claude/agents/refs/designer-master-composite-recipes.md +216 -0
- package/project-template/.claude/agents/refs/designer-style-exploration-flow.md +37 -0
- package/project-template/.claude/agents/refs/developer-dev-handoff.md +109 -0
- package/project-template/.claude/agents/refs/developer-impl-cookbook.md +134 -0
- package/project-template/.claude/agents/refs/developer-phase1-flow.md +211 -0
- package/project-template/.claude/agents/refs/pm-workflow-detail.md +545 -0
- package/project-template/.claude/agents/refs/reviewer-six-dimension-eval.md +286 -0
- package/project-template/.claude/agents/refs/ta-3d-flip-recipe.md +85 -0
- package/project-template/.claude/agents/refs/ta-atlas-deliverable-standard.md +46 -0
- package/project-template/.claude/agents/refs/ta-batch-pipeline-recipes.md +120 -0
- package/project-template/.claude/agents/refs/ta-image-generation-detail.md +356 -0
- package/project-template/.claude/agents/refs/ta-image-ops-reference.md +495 -0
- package/project-template/.claude/agents/refs/ta-pipeline-cookbook.md +699 -0
- package/project-template/.claude/agents/refs/ta-tools-reference.md +111 -0
- package/project-template/.claude/agents/refs/ta-vfx-preset-catalog.md +365 -0
- package/project-template/.claude/agents/reviewer.md +103 -0
- package/project-template/.claude/agents/technical-artist.md +111 -0
- package/project-template/.claude/hooks/README.md +36 -0
- package/project-template/.claude/hooks/validate-atom-plan.mjs +224 -0
- package/project-template/.claude/hooks/validate-workflow-stop.mjs +258 -0
- package/project-template/.claude/settings.json +32 -0
- package/project-template/.claude/settings.local.json +4 -0
- package/project-template/.claude/skills/playcraft-ad-psychology/SKILL.md +182 -0
- package/project-template/.claude/skills/playcraft-art-style-guide/SKILL.md +123 -0
- package/project-template/.claude/skills/playcraft-asset-state-sheet/SKILL.md +141 -0
- package/project-template/.claude/skills/playcraft-audio-generation/SKILL.md +280 -0
- package/project-template/.claude/skills/playcraft-batch-pipeline/SKILL.md +184 -0
- package/project-template/.claude/skills/playcraft-build-optimizer/SKILL.md +306 -0
- package/project-template/.claude/skills/playcraft-image-generation/SKILL.md +229 -0
- package/project-template/.claude/skills/playcraft-image-generation/reference/build-sprite-sheet.template.mjs +123 -0
- package/project-template/.claude/skills/playcraft-image-generation/reference/compare-style.template.mjs +254 -0
- package/project-template/.claude/skills/playcraft-image-generation/reference/gen-batch-sprite.template.mjs +235 -0
- package/project-template/.claude/skills/playcraft-image-generation/reference/gen-batch.template.mjs +97 -0
- package/project-template/.claude/skills/playcraft-image-generation/reference/gen-edit-variants.template.mjs +118 -0
- package/project-template/.claude/skills/playcraft-image-generation/reference/process-batch.template.mjs +137 -0
- package/project-template/.claude/skills/playcraft-image-generation/reference/prompt-cookbook.md +397 -0
- package/project-template/.claude/skills/playcraft-image-generation/reference/validate-sprite-sheet.template.mjs +296 -0
- package/project-template/.claude/skills/playcraft-image-ops/SKILL.md +122 -0
- package/project-template/.claude/skills/playcraft-masking/SKILL.md +373 -0
- package/project-template/.claude/skills/playcraft-research/SKILL.md +212 -0
- package/project-template/.claude/skills/playcraft-sprite-generation/SKILL.md +423 -0
- package/project-template/.claude/skills/playcraft-storyboard/SKILL.md +148 -0
- package/project-template/.claude/skills/playcraft-style-qa/SKILL.md +270 -0
- package/project-template/.claude/skills/playcraft-text-rendering/SKILL.md +236 -0
- package/project-template/.claude/skills/playcraft-vfx-animation/SKILL.md +130 -0
- package/project-template/.claude/skills/playcraft-workflow/SKILL.md +396 -0
- package/project-template/.cursor/hooks.json +17 -0
- package/project-template/.cursor/rules/playcraft-orchestrator.mdc +87 -0
- package/project-template/.cursor/rules/playcraft-subagent-boundary.mdc +18 -0
- package/project-template/CLAUDE.md +240 -0
- package/project-template/assets/audio/bgm/.gitkeep +0 -0
- package/project-template/assets/audio/sfx/.gitkeep +0 -0
- package/project-template/assets/bundles/.gitkeep +0 -0
- package/project-template/assets/images/bg/.gitkeep +0 -0
- package/project-template/assets/images/reference/.gitkeep +0 -0
- package/project-template/assets/images/storyboard/.gitkeep +0 -0
- package/project-template/assets/images/tiles/.gitkeep +0 -0
- package/project-template/assets/images/ui/.gitkeep +0 -0
- package/project-template/assets/images/vfx/.gitkeep +0 -0
- package/project-template/assets/models/.gitkeep +0 -0
- package/project-template/docs/team/agent-conduct.md +105 -0
- package/project-template/docs/team/agent-runtime-matrix.md +62 -0
- package/project-template/docs/team/atom-plan-format.md +74 -0
- package/project-template/docs/team/collaboration.md +288 -0
- package/project-template/docs/team/core-model.md +50 -0
- package/project-template/docs/team/platform-capabilities.md +15 -0
- package/project-template/docs/team/workflow-changelog.md +51 -0
- package/project-template/docs/team/workflow-consistency-checklist.md +128 -0
- package/project-template/game/config/.gitkeep +0 -0
- package/project-template/game/gameplay/.gitkeep +0 -0
- package/project-template/game/scenes/.gitkeep +0 -0
- package/project-template/logs/.gitkeep +0 -0
- package/project-template/ta-workspace/logs/.gitkeep +0 -0
- package/project-template/ta-workspace/scripts/.gitkeep +0 -0
- package/project-template/ta-workspace/tmp/.gitkeep +0 -0
- package/project-template/templates/atom-plan.template.json +26 -0
- package/project-template/templates/atom-plan.template.md +76 -0
- package/project-template/templates/design-brief.template.md +195 -0
- package/project-template/templates/design-lens-checklist.reference.md +117 -0
- package/project-template/templates/design-methodology.md +99 -0
- package/project-template/templates/designer-log.template.md +98 -0
- package/project-template/templates/developer-log.template.md +140 -0
- package/project-template/templates/five-axis-framework.md +186 -0
- package/project-template/templates/intent-clarifications.template.md +58 -0
- package/project-template/templates/layout-spec.template.md +132 -0
- package/project-template/templates/project-state.template.md +219 -0
- package/project-template/templates/review-report.template.md +166 -0
- package/project-template/templates/style-exploration.template.md +93 -0
- package/project-template/templates/ta-log.template.md +205 -0
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
# Developer Dev Handoff (L2)
|
|
2
|
+
|
|
3
|
+
Use during **Phase 2 integration** and before marking `devStatus: ready`.
|
|
4
|
+
|
|
5
|
+
## Dev command
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
cat package.json # read scripts.dev (webpack / vite / etc.)
|
|
9
|
+
npm run dev
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
- **Not** `playcraft start` — Dev is the project's `scripts.dev`.
|
|
13
|
+
- Record the URL from terminal output (e.g. `http://localhost:5173`) in `project-state.md` → `devUrl`.
|
|
14
|
+
- Prefer leaving the server running for Reviewer; if it stops, Reviewer or orchestrator may restart and refresh `devUrl`.
|
|
15
|
+
|
|
16
|
+
## Dev iteration rhythm
|
|
17
|
+
|
|
18
|
+
During integration, repeat:
|
|
19
|
+
|
|
20
|
+
1. Change code / wire assets
|
|
21
|
+
2. `npm run dev` (restart if HMR is insufficient)
|
|
22
|
+
3. Self-check UI + gameplay + runtime (checklists below)
|
|
23
|
+
4. Log in `developer-log.md` → **Dev self-check**
|
|
24
|
+
5. If upstream issue → blockers + ICP + STOP (orchestrator routes TA/Designer)
|
|
25
|
+
|
|
26
|
+
**Do not** wait until the last minute for a single Dev pass.
|
|
27
|
+
|
|
28
|
+
## UI checklist (vs MC + layout-spec)
|
|
29
|
+
|
|
30
|
+
| Check | Source |
|
|
31
|
+
| -------------------------------------------------- | --------------------------------------- |
|
|
32
|
+
| Zones and hierarchy match layout-spec | `docs/layout-spec.md` |
|
|
33
|
+
| Colors / mood match approved style | `docs/style-exploration.md`, Gate #2 MC |
|
|
34
|
+
| Element placement matches storyboard Visual Intent | Master Composite frames |
|
|
35
|
+
| Text-as-image assets visible, correct aspect | `assetMapping` paths |
|
|
36
|
+
| No broken images / wrong sprites / style drift | Dev browser |
|
|
37
|
+
| Mobile viewport (e.g. 750×1334) acceptable | Dev browser resize |
|
|
38
|
+
|
|
39
|
+
## Gameplay checklist (vs design-brief + PGS)
|
|
40
|
+
|
|
41
|
+
| Check | Source |
|
|
42
|
+
| ------------------------------------------ | ---------------------- |
|
|
43
|
+
| Hook → Tutorial → Gameplay → End Card flow | `docs/design-brief.md` |
|
|
44
|
+
| Rules, scoring, win/lose match PM contract | design-brief + PGS |
|
|
45
|
+
| **First level guaranteed success** | atom-plan / PGS |
|
|
46
|
+
| Near-Win and difficulty feel as specified | design-brief |
|
|
47
|
+
| CTA on End Card | runtime test |
|
|
48
|
+
|
|
49
|
+
## Runtime checklist
|
|
50
|
+
|
|
51
|
+
- No white screen or blocking console errors
|
|
52
|
+
- Full playthrough without dead ends
|
|
53
|
+
- BGM/SFX at correct events
|
|
54
|
+
- State machine stable; CTA handler fires (`mraid` / `FbPlayableAd` / `ExitApi` as applicable)
|
|
55
|
+
|
|
56
|
+
## devUrl recording
|
|
57
|
+
|
|
58
|
+
In `docs/project-state.md` → **Dev Preview**:
|
|
59
|
+
|
|
60
|
+
| Field | When |
|
|
61
|
+
| ---------------- | ---------------------------------------------------- |
|
|
62
|
+
| `devUrl` | After `npm run dev` shows listening URL |
|
|
63
|
+
| `devStatus` | `pending` → `ready` or `blocked_upstream` / `failed` |
|
|
64
|
+
| `devStartedBy` | `developer` |
|
|
65
|
+
| `devLastChecked` | ISO timestamp after each meaningful Dev pass |
|
|
66
|
+
|
|
67
|
+
Also note devUrl in `docs/developer-log.md` → **Dev self-check**.
|
|
68
|
+
|
|
69
|
+
## Upstream blocker template
|
|
70
|
+
|
|
71
|
+
Add to `developer-log.md` → **## Upstream blockers**:
|
|
72
|
+
|
|
73
|
+
```markdown
|
|
74
|
+
| Path | Issue | Expected | routeTo | Status |
|
|
75
|
+
| ----------------- | ------- | ---------------------------------- | ------- | ------ |
|
|
76
|
+
| assets/ui/foo.png | missing | 256×256 PNG per layout-spec zone A | TA | open |
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
In `docs/intent-clarifications.md`:
|
|
80
|
+
|
|
81
|
+
- **Context**: what Dev showed (screenshot description or path)
|
|
82
|
+
- **Gap**: vs MC / contract / design-brief
|
|
83
|
+
- **Acceptance**: exact path, dimensions, style, or audio mood required
|
|
84
|
+
- **routeTo**: TA | Designer | PM
|
|
85
|
+
|
|
86
|
+
Set `project-state.md`:
|
|
87
|
+
|
|
88
|
+
- `devStatus: blocked_upstream`
|
|
89
|
+
- `devBlockers`: same rows as log
|
|
90
|
+
|
|
91
|
+
**STOP** after filing — wait for orchestrator to re-invoke upstream role, then **re-run Dev loop**.
|
|
92
|
+
|
|
93
|
+
## After rework — re-verify checklist
|
|
94
|
+
|
|
95
|
+
1. Confirm blocker paths exist on disk (`ls`, `playcraft image info` if needed)
|
|
96
|
+
2. `npm run dev`
|
|
97
|
+
3. Re-run UI + gameplay + runtime checklists for affected areas
|
|
98
|
+
4. Close blocker rows (`status: resolved`) or escalate if still wrong
|
|
99
|
+
5. Only then set `devStatus: ready` and stage → `review`
|
|
100
|
+
|
|
101
|
+
## Dev ready checklist (`devStatus: ready` — all required)
|
|
102
|
+
|
|
103
|
+
- [ ] UI checklist pass in Dev
|
|
104
|
+
- [ ] Gameplay checklist pass in Dev
|
|
105
|
+
- [ ] Runtime checklist pass in Dev
|
|
106
|
+
- [ ] No open rows in Upstream blockers / `devBlockers`
|
|
107
|
+
- [ ] `devUrl` recorded and server reachable
|
|
108
|
+
- [ ] `developer-log.md` Dev self-check complete
|
|
109
|
+
- [ ] **Not** required: `playcraft build`, user running terminal commands
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
# Developer Implementation Cookbook
|
|
2
|
+
|
|
3
|
+
> Read before writing index.html (Phase 1 Step 4) and during Phase 2 asset integration. Contains index.html skeleton, CTA handler patterns, and integration binding checklist.
|
|
4
|
+
|
|
5
|
+
## Atlas binding (Phase 1 + Phase 2)
|
|
6
|
+
|
|
7
|
+
When `layout-spec` (or atom-plan handoff) defines **`atlasPath` + `frameId`** for an element or tile set, treat it as the source of truth for sprite geometry — **not** ad-hoc single-file crops.
|
|
8
|
+
|
|
9
|
+
- **Load the atlas image** as **WebP** at the path given by `atlasPath` (or the paired TA-delivered file beside the JSON).
|
|
10
|
+
- **Load the frame map** from the **JSON sidecar** shipped with the atlas (frame rectangles / pivots / names keyed by `frameId`).
|
|
11
|
+
- **Phase 1**: stub or procedural placeholders are acceptable only where the contract is path + id; still wire code to read `atlasPath` / `frameId` so Phase 2 is a file drop-in.
|
|
12
|
+
- **Phase 2**: verify WebP + JSON exist at the contract paths, then bind textures using `frameId` → sub-rect from the sidecar (same pattern in Integration checklist below).
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
## index.html Skeleton (Phase 1)
|
|
17
|
+
|
|
18
|
+
```html
|
|
19
|
+
<!DOCTYPE html>
|
|
20
|
+
<html lang="en">
|
|
21
|
+
<head>
|
|
22
|
+
<meta charset="UTF-8" />
|
|
23
|
+
<meta
|
|
24
|
+
name="viewport"
|
|
25
|
+
content="width=device-width, initial-scale=1.0, user-scalable=no"
|
|
26
|
+
/>
|
|
27
|
+
<title>Playable Ad</title>
|
|
28
|
+
<style>
|
|
29
|
+
* {
|
|
30
|
+
margin: 0;
|
|
31
|
+
padding: 0;
|
|
32
|
+
box-sizing: border-box;
|
|
33
|
+
}
|
|
34
|
+
html,
|
|
35
|
+
body {
|
|
36
|
+
width: 100%;
|
|
37
|
+
height: 100%;
|
|
38
|
+
overflow: hidden;
|
|
39
|
+
}
|
|
40
|
+
canvas {
|
|
41
|
+
display: block;
|
|
42
|
+
width: 100%;
|
|
43
|
+
height: 100%;
|
|
44
|
+
}
|
|
45
|
+
</style>
|
|
46
|
+
</head>
|
|
47
|
+
<body>
|
|
48
|
+
<canvas id="game"></canvas>
|
|
49
|
+
<script>
|
|
50
|
+
// Game initialization — asset loading will be added in Phase 2
|
|
51
|
+
// Gameplay logic from game/gameplay/
|
|
52
|
+
// Config from game/config/
|
|
53
|
+
|
|
54
|
+
// CTA handler (required — multi-platform fallback)
|
|
55
|
+
function onCTAClick() {
|
|
56
|
+
if (typeof mraid !== "undefined") {
|
|
57
|
+
mraid.open("{{store_url}}");
|
|
58
|
+
} else if (typeof FbPlayableAd !== "undefined") {
|
|
59
|
+
FbPlayableAd.onCTAClick();
|
|
60
|
+
} else if (typeof ExitApi !== "undefined") {
|
|
61
|
+
ExitApi.exit();
|
|
62
|
+
} else {
|
|
63
|
+
window.open("{{store_url}}");
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
</script>
|
|
67
|
+
</body>
|
|
68
|
+
</html>
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
**Phase 2 additions**: add asset loading (inline base64 or relative paths), connect gameplay logic, wire audio triggers, ensure ALL resources are inline (zero external requests).
|
|
72
|
+
|
|
73
|
+
---
|
|
74
|
+
|
|
75
|
+
## Phase 2: Asset Integration Binding Checklist
|
|
76
|
+
|
|
77
|
+
Connect Designer's assets to gameplay code:
|
|
78
|
+
|
|
79
|
+
| Check | Source |
|
|
80
|
+
| -------------------------------------------------------------------- | ---------------------- |
|
|
81
|
+
| Every `tileColors[].id` has image file at `assetMapping.visualAsset` | layout-spec + `ls` |
|
|
82
|
+
| Board position = `zones["board"].rect` | layout-spec |
|
|
83
|
+
| Tile size = `assetSpec.tileSize` | layout-spec |
|
|
84
|
+
| All sfx files exist per `assetMapping` | layout-spec + `ls` |
|
|
85
|
+
| Background at correct path | layout-spec + `ls` |
|
|
86
|
+
| Sprite sheet atlas bound with JSON frame data | atom-plan + TA handoff |
|
|
87
|
+
|
|
88
|
+
**Binding pattern**:
|
|
89
|
+
|
|
90
|
+
1. Load images at paths from `assetMapping`; for atlas-backed assets, load **WebP atlas + JSON sidecar** and resolve **`frameId`** from `layout-spec` (see § Atlas binding).
|
|
91
|
+
2. Bind visuals to game entities: element ID → texture (or atlas sub-rect)
|
|
92
|
+
3. Bind audio to gameplay events: match → sfx, level complete → success sfx
|
|
93
|
+
4. Position elements per `zones[].rect` coordinates
|
|
94
|
+
|
|
95
|
+
---
|
|
96
|
+
|
|
97
|
+
## Phase 2: Dev iteration (integration complete)
|
|
98
|
+
|
|
99
|
+
| Requirement | How to Verify |
|
|
100
|
+
| ------------------------------------ | ------------------------------------------------------------- |
|
|
101
|
+
| Entry point: `game/index.html` | `ls game/index.html` |
|
|
102
|
+
| All asset references: relative paths | Read game code |
|
|
103
|
+
| No Node.js APIs | Code review |
|
|
104
|
+
| No dynamic imports or CDN references | `grep -r "import(" game/` |
|
|
105
|
+
| Zero external requests in Dev | Browser console + `grep -r "http" game/` |
|
|
106
|
+
| UI + gameplay + runtime in Dev | `npm run dev` + checklists in `refs/developer-dev-handoff.md` |
|
|
107
|
+
| No open upstream blockers | `developer-log.md` + `project-state.devBlockers` |
|
|
108
|
+
|
|
109
|
+
```bash
|
|
110
|
+
npm run dev
|
|
111
|
+
# Record devUrl in project-state.md; leave server running for Reviewer when possible
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
> **`playcraft build` is not required** for `devStatus: ready` or project `done`. See `refs/developer-dev-handoff.md` for Dev ready checklist.
|
|
115
|
+
|
|
116
|
+
---
|
|
117
|
+
|
|
118
|
+
## PGS Implementation Pattern
|
|
119
|
+
|
|
120
|
+
```
|
|
121
|
+
1. Load reference: playcraft skills match --engine <engine> --intent "<gameplay>" --json
|
|
122
|
+
2. Write PGS JSON:
|
|
123
|
+
- entities[] — from layout-spec colorPalette.tileColors[].id
|
|
124
|
+
- rules[] — from design-brief experience flow
|
|
125
|
+
- algorithm{} — matching/gravity/refill logic
|
|
126
|
+
- testCases[] — write FIRST, then implement rules
|
|
127
|
+
3. Validate logic passes all testCases
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
Key constraints (all from layout-spec, NOT invented):
|
|
131
|
+
|
|
132
|
+
- Grid dimensions = `zones["board"].rect` / `assetSpec.tileSize`
|
|
133
|
+
- Element types = `colorPalette.tileColors[]`
|
|
134
|
+
- Element IDs = `colorPalette.tileColors[].id`
|
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
# Developer Integration Flow — Gameplay + Assets (L2)
|
|
2
|
+
|
|
3
|
+
> **Trigger**: `docs/project-state.md` stage = `integration`. Agent context + STOP rules: [`../developer.md`](../developer.md).
|
|
4
|
+
> **Prerequisites**: Production Pipeline Wave 1 (Designer Ph.2) + Wave 2 (TA) both `done`; TA Compliance green; contract paths have real files on disk.
|
|
5
|
+
|
|
6
|
+
> **Before implementation**, read [`developer-impl-cookbook.md`](./developer-impl-cookbook.md) for PGS patterns, `index.html` skeleton, CTA handler, and **atlas binding** (`atlasPath` + `frameId` + WebP + JSON sidecar). Dev ready gate: [`developer-dev-handoff.md`](./developer-dev-handoff.md).
|
|
7
|
+
|
|
8
|
+
## Step 0: Upstream Intake (mandatory, before Spec Quick-Check)
|
|
9
|
+
|
|
10
|
+
> **Purpose:** Know what happened before `integration` — PM contracts, Designer visual lock, TA delivery — so gameplay and UI match intent.
|
|
11
|
+
|
|
12
|
+
Read each file (Read tool or shell), then fill **`logs/developer-log.md` § Upstream Intake** before any `game/` edit or Spec Quick-Check.
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
cat docs/project-state.md
|
|
16
|
+
cat docs/design-brief.md
|
|
17
|
+
cat docs/layout-spec.md
|
|
18
|
+
cat docs/atom-plan.json docs/atom-plan.md
|
|
19
|
+
cat docs/style-exploration.md
|
|
20
|
+
cat logs/designer-log.md
|
|
21
|
+
cat logs/ta-log.md
|
|
22
|
+
# Spot-check contract paths exist:
|
|
23
|
+
ls assets/images/ assets/audio/ assets/bundles/ assets/models/ 2>/dev/null | head
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
| Doc | You need from it (one line in developer-log) |
|
|
27
|
+
| ------------------- | -------------------------------------------------- |
|
|
28
|
+
| `project-state` | Pipeline complete, `devBlockers`, dev fields |
|
|
29
|
+
| `design-brief` | Gameplay type, flow, first-level success, Near-Win |
|
|
30
|
+
| `layout-spec` | Zones, elementIds, assetMapping, atlasPath/frameId |
|
|
31
|
+
| `atom-plan.json` | Developer atoms, `skillRef`, `dependsOn`(机器源) |
|
|
32
|
+
| `atom-plan.md` | Acceptance criteria + Impl/Asset/TA Context |
|
|
33
|
+
| `style-exploration` | MC + experience flow — input for Step 2 mapping |
|
|
34
|
+
| `designer-log` | Palette / motion / ASR coverage notes |
|
|
35
|
+
| `ta-log` | Compliance status, atlas params |
|
|
36
|
+
|
|
37
|
+
**MUST NOT** proceed to Step 1 until every row is ticked with a concrete takeaway.
|
|
38
|
+
|
|
39
|
+
---
|
|
40
|
+
|
|
41
|
+
## Step 1: Spec Quick-Check (30s, mandatory)
|
|
42
|
+
|
|
43
|
+
> Formerly Step 0a.
|
|
44
|
+
|
|
45
|
+
Before any implementation, validate Layout Spec:
|
|
46
|
+
|
|
47
|
+
- Every GameplayAtom's referenced `elementId` exists in `assetMapping`
|
|
48
|
+
- Every code-referenced path has a corresponding assetMapping entry
|
|
49
|
+
- If gaps found → write `spec-gap` to `project-state.md`, wait for PM to supplement (≤ 5 min)
|
|
50
|
+
|
|
51
|
+
## Step 2: Experience Flow Visual Mapping (mandatory)
|
|
52
|
+
|
|
53
|
+
> Formerly Step 0c.
|
|
54
|
+
|
|
55
|
+
**Read `docs/style-exploration.md` Master Composite + experience flow design before any implementation.**
|
|
56
|
+
|
|
57
|
+
The Master Composite is five 9:16 panels in one image: **Panel 1 = concept panel** (Main Gameplay — full UI + all element types); **Panels 2–5 = storyboard** (Hook, Onboarding, End Card, CTA). TA extracts from concept panel / ASR state sheets; study each panel for per-stage visual intent.
|
|
58
|
+
|
|
59
|
+
Write to `logs/developer-log.md` "Experience Flow → Code Mapping":
|
|
60
|
+
|
|
61
|
+
| Storyboard Frame | Scene/State | Code Location | Visual Intent |
|
|
62
|
+
| ------------------------- | ---------------- | ------------------------- | ------------------------------------------------------- |
|
|
63
|
+
| Hook (0-3s) | `scene.hook` | `game/scenes/hook.ts` | {{from storyboard: contrast, pace, first interaction}} |
|
|
64
|
+
| Tutorial (3-10s) | `scene.tutorial` | `game/scenes/tutorial.ts` | {{from storyboard: low pressure, guaranteed success}} |
|
|
65
|
+
| Gameplay+NearWin (10-25s) | `scene.gameplay` | `game/scenes/gameplay.ts` | {{from storyboard: core mechanic, near-win visual cue}} |
|
|
66
|
+
| EndCard (25-30s) | `scene.endcard` | `game/scenes/endcard.ts` | {{from storyboard: CTA prominence, unresolved emotion}} |
|
|
67
|
+
|
|
68
|
+
**Rules**:
|
|
69
|
+
|
|
70
|
+
- Every scene file MUST have a top comment: `// Visual reference: Master Composite (frame: [position])`
|
|
71
|
+
- If storyboard visuals conflict with layout-spec zones → storyboard takes precedence; ask PM in `intent-clarifications.md`
|
|
72
|
+
- Visual Intent captures EMOTION and ATTENTION FLOW, not just mechanics
|
|
73
|
+
|
|
74
|
+
## Step 3: 读活 DAG + Skill Discovery + 统一 Scaffold(必须先做,只做一次)
|
|
75
|
+
|
|
76
|
+
> Formerly Step 0b.
|
|
77
|
+
|
|
78
|
+
**第一步:读取骨架与已有上下文**
|
|
79
|
+
|
|
80
|
+
```bash
|
|
81
|
+
cat docs/design-brief.md # gameplayType, engine, StyleDirection
|
|
82
|
+
cat docs/atom-plan.json # atoms[] skillRef + dependsOn
|
|
83
|
+
cat docs/atom-plan.md # Asset Skill Context + acceptance criteria
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
**第二步:读取 PM 已标注的 skillRef 内容(必须)**
|
|
87
|
+
|
|
88
|
+
> **Skill 获取优先级**(见 [`atom-plan-format.md`](../../../docs/team/atom-plan-format.md)):
|
|
89
|
+
>
|
|
90
|
+
> 1. **Project Skills**(PM 已执行 `playcraft skills link`):`.claude/skills/<skillRef>/SKILL.md` + `ref/`
|
|
91
|
+
> 2. **兜底**:软链不存在或断链 → `playcraft skills read <skillRef>`(自动读 `playcraft.config.json` → `skillsDir`)
|
|
92
|
+
> 3. `skillRef` 为空 → 独立 `playcraft skills match` 搜索
|
|
93
|
+
> 4. 完全无匹配 → `playcraft-research` 后自行实现
|
|
94
|
+
|
|
95
|
+
对 `atoms[]` 中每个 `assignTo: Developer` 且 `skillRef` 非空的 atom,逐一读取 Recipe:
|
|
96
|
+
|
|
97
|
+
```bash
|
|
98
|
+
# 优先:项目内软链(PM 应在 Gate #1 前已 link)
|
|
99
|
+
test -f .claude/skills/memory_match.aigameplay/SKILL.md && echo "linked OK"
|
|
100
|
+
|
|
101
|
+
# 读 Recipe(二选一,link 正常时用文件路径即可)
|
|
102
|
+
cat .claude/skills/memory_match.aigameplay/SKILL.md
|
|
103
|
+
|
|
104
|
+
# 仅当上面 test 失败时兜底:
|
|
105
|
+
playcraft skills read memory_match.aigameplay
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
**访问 ref/ 文件**(同样优先 Project Skills):
|
|
109
|
+
|
|
110
|
+
```bash
|
|
111
|
+
cat .claude/skills/memory_match.aigameplay/ref/pgs-schema.json
|
|
112
|
+
|
|
113
|
+
# 兜底:playcraft skills read 输出的 skillDir,或 playcraft.config.json 中的 skillsDir
|
|
114
|
+
# cat <skillsDir>/memory_match.aigameplay/ref/pgs-schema.json
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
不读 SKILL.md 就 scaffold 或实现 = 丢弃 PM 的规则蓝图。Skill Preflight 须记录每个 `skillRef` 用的是 `linked` 还是 `cli-fallback`。
|
|
118
|
+
|
|
119
|
+
**STOP 门槛**:`logs/developer-log.md` 的 **§ Skill Preflight** 必须已填(每个 `skillRef` 一行 + CLI 输出摘要)。未填则不得编辑 `game/**`,不得将 atom 标为 `done`,handoff 不得写 Ph.1 完成。
|
|
120
|
+
|
|
121
|
+
**第三步:补充搜索你域内的 Skills**
|
|
122
|
+
|
|
123
|
+
```bash
|
|
124
|
+
# 按引擎 + 玩法类型搜索(可发现 PM 未找到的组件层 Skill)
|
|
125
|
+
playcraft skills match --engine <engine> --intent "<gameplayType>,rules,algorithm" --json
|
|
126
|
+
# 搜索代码组件层
|
|
127
|
+
playcraft skills match --engine <engine> --intent "<layout>,<ui_components>,<state>" --json
|
|
128
|
+
# 列出配置封包
|
|
129
|
+
playcraft skills list --category config --json
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
**第四步:富集 `## Impl Skill Context`(写入 atom-plan.md)**
|
|
133
|
+
|
|
134
|
+
```markdown
|
|
135
|
+
### {{atom_id}} — {{slot_name}}
|
|
136
|
+
|
|
137
|
+
- 实现方案:(简述,基于 SKILL.md Recipe)
|
|
138
|
+
- 匹配 Skills:`memory_match.aigameplay` — 提供 PGS 规则 schema + reducer 接口约束
|
|
139
|
+
- ref 文件:ref/pgs-schema.json(规则骨架)、ref/reducer.template.ts(接口模板)
|
|
140
|
+
- Scaffold 路径:game/gameplay/reducer.ts
|
|
141
|
+
- 实现决策:与 Skill 模板的差异点(如网格从 4×4 改为 4×3)
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
**第五步:统一 Scaffold(一次性执行,不拆分)**
|
|
145
|
+
|
|
146
|
+
```bash
|
|
147
|
+
playcraft skills scaffold \
|
|
148
|
+
--engine <engine> \
|
|
149
|
+
--atoms <skillRef1>,<skillRef2>,<skillRef3> \
|
|
150
|
+
--out ./game
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
注:scaffold 对标注了 `merge-json` 的文件(package.json / tsconfig.json)会自动合并而非覆盖。
|
|
154
|
+
|
|
155
|
+
若某 Atom 本地无结果:参阅 `playcraft-research` SKILL → 执行定向网络研究 → 写入 Impl Skill Context → 标注"候选新 Skill" → 基于研究方案实现。
|
|
156
|
+
|
|
157
|
+
## Step 4: Validate Prerequisites
|
|
158
|
+
|
|
159
|
+
```bash
|
|
160
|
+
ls docs/project-state.md docs/design-brief.md docs/layout-spec.md docs/atom-plan.md
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
Verify: stage is `integration`, Production Pipeline Wave 2 = `done`, you have atoms with `assignTo: Developer`, Layout Spec has element IDs / grid size / zones.
|
|
164
|
+
|
|
165
|
+
**Use real assets on disk** at Asset Contract paths from `assetMapping` (TA Wave 2 must have completed):
|
|
166
|
+
|
|
167
|
+
```
|
|
168
|
+
Layout Spec assetMapping:
|
|
169
|
+
{ elementId: "strawberry", visualAsset: "assets/images/tiles/strawberry_atlas.webp", frameId: "strawberry_01" }
|
|
170
|
+
|
|
171
|
+
Your code:
|
|
172
|
+
loadAtlas('assets/images/tiles/strawberry_atlas.webp', 'assets/images/tiles/strawberry_atlas.json', 'strawberry_01')
|
|
173
|
+
|
|
174
|
+
If file missing → devStatus: blocked_upstream, routeTo TA (do not placeholder)
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
## Step 5: Implement GameplayAtom + ConfigAtom
|
|
178
|
+
|
|
179
|
+
- **GameplayAtom**: entities from `colorPalette.tileColors[].id`, rules from design-brief flow, write testCases FIRST
|
|
180
|
+
- **ConfigAtom**: number of levels, difficulty progression, score targets — **first level MUST guarantee player success**
|
|
181
|
+
|
|
182
|
+
## Text-as-Image Rendering
|
|
183
|
+
|
|
184
|
+
**All visible text in the game is image assets — no font files, no CSS text.** Static text is loaded as images from `layout-spec.md` `textAssets` paths. Dynamic numbers use a Digit Sprite Strip with runtime frame-cutting.
|
|
185
|
+
|
|
186
|
+
> **Invoke the `playcraft-text-rendering` skill** for the full spec, rendering code templates (Canvas 2D + PlayCanvas), alignment helpers, and per-role responsibilities.
|
|
187
|
+
|
|
188
|
+
## Step 6: Write index.html Skeleton
|
|
189
|
+
|
|
190
|
+
> **Read [`developer-impl-cookbook.md`](./developer-impl-cookbook.md)** for the complete skeleton with multi-platform CTA handler.
|
|
191
|
+
|
|
192
|
+
Key requirements: viewport meta with `user-scalable=no`, CTA handler with mraid/FbPlayableAd/ExitApi fallbacks, all CSS/JS inline.
|
|
193
|
+
|
|
194
|
+
## Step 7: Early Dev smoke (recommended)
|
|
195
|
+
|
|
196
|
+
After scaffold + core scenes exist:
|
|
197
|
+
|
|
198
|
+
```bash
|
|
199
|
+
cat package.json # confirm scripts.dev exists
|
|
200
|
+
npm run dev
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
Fix fatal errors early. Record devUrl in `developer-log.md` when useful.
|
|
204
|
+
|
|
205
|
+
## Step 8: Integration completion
|
|
206
|
+
|
|
207
|
+
> **Exit criteria**: see [`../developer.md`](../developer.md) → **Goals** → `integration` row.
|
|
208
|
+
|
|
209
|
+
1. All GameplayAtom + ConfigAtom marked `done` in `atom-plan.json` `atoms[]`
|
|
210
|
+
2. `developer-log.md` includes Experience Flow → Code Mapping + **UI/gameplay self-check notes**
|
|
211
|
+
3. Complete [`developer-dev-handoff.md`](./developer-dev-handoff.md) → `devStatus: ready` + devUrl → handoff `Invoke @reviewer` — **do not** set `stage: review` yourself.
|