@genex-ai/cli-demo 1.30.0-dev.645 → 1.31.1

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 (47) hide show
  1. package/README.md +0 -18
  2. package/dist/index.js +2839 -4768
  3. package/package.json +3 -3
  4. package/templates/controllers/character/follow-camera.ts +1 -16
  5. package/templates/controllers/character/meshy/meshy-loader.ts +2 -3
  6. package/templates/controllers/quality/pick-asset.ts +16 -49
  7. package/templates/controllers/shared/physics-world.ts +4 -6
  8. package/templates/skills/genex-ai-character/SKILL.md +15 -77
  9. package/templates/skills/genex-ai-menu/SKILL.md +11 -15
  10. package/templates/skills/genex-ai-model/SKILL.md +7 -45
  11. package/templates/skills/genex-ai-texture/SKILL.md +1 -1
  12. package/templates/skills/genex-ai-video/SKILL.md +17 -75
  13. package/templates/skills/genex-game-director/SKILL.md +46 -112
  14. package/templates/skills/genex-game-director/references/design-contract.md +5 -13
  15. package/templates/skills/genex-game-director/references/routing-map.md +45 -30
  16. package/templates/skills/genex-getting-started/SKILL.md +2 -2
  17. package/templates/skills/genex-monetization/SKILL.md +177 -0
  18. package/templates/skills/genex-threejs-adaptive-quality/SKILL.md +0 -21
  19. package/templates/skills/genex-threejs-character-controller/SKILL.md +5 -17
  20. package/templates/skills/genex-threejs-creatures/SKILL.md +1 -8
  21. package/templates/skills/genex-threejs-embed-auth/SKILL.md +57 -8
  22. package/templates/skills/genex-threejs-game-ui/SKILL.md +6 -55
  23. package/templates/skills/genex-threejs-procedural-assets/SKILL.md +10 -17
  24. package/templates/skills/genex-threejs-visual-validation/SKILL.md +2 -12
  25. package/templates/skills/genex-tool-audio/SKILL.md +2 -3
  26. package/templates/skills/genex-tool-character/SKILL.md +5 -36
  27. package/templates/skills/genex-tool-image/SKILL.md +2 -4
  28. package/templates/skills/genex-tool-model/SKILL.md +6 -32
  29. package/templates/skills/genex-tool-texture/SKILL.md +1 -1
  30. package/templates/skills/genex-tool-video/SKILL.md +5 -28
  31. package/templates/skills/genex-tool-workflow/SKILL.md +1 -4
  32. package/templates/skills/genex-updates/SKILL.md +1 -1
  33. package/dist/blender-mcp-Q6PSFYSE.js +0 -241
  34. package/dist/blender-serve-BF4FZ55Z.js +0 -244
  35. package/dist/chunk-2COG4P3T.js +0 -968
  36. package/dist/chunk-HYCSNWYX.js +0 -126
  37. package/templates/blender-service/demo/castle.py +0 -117
  38. package/templates/blender-service/gpu_witness.py +0 -245
  39. package/templates/blender-service/ops.py +0 -225
  40. package/templates/blender-service/pool.py +0 -910
  41. package/templates/blender-service/server.py +0 -611
  42. package/templates/blender-service/supervisor.py +0 -221
  43. package/templates/blender-service/views.py +0 -281
  44. package/templates/controllers/quality/deadline.ts +0 -117
  45. package/templates/skills/genex-blender-scene/SKILL.md +0 -243
  46. package/templates/skills/genex-lane-card/SKILL.md +0 -78
  47. package/templates/skills/genex-tool-publish/SKILL.md +0 -100
@@ -1,19 +1,14 @@
1
1
  ---
2
2
  name: genex-game-director
3
- description: The Genex request router. Read the latest game, tool, component, or focused-change request; ask only genuinely unresolved build forks; keep DESIGN.md current; and load each owning lane BEFORE the first file of the subsystem it owns — only the lanes the work touches, never the whole pack, and never fewer than the work needs. Use first for new work, resumed work, or whenever ownership is unclear.
3
+ description: The lightweight Genex request router. Read the latest game, tool, component, or focused-change request; ask only genuinely unresolved build forks; keep DESIGN.md current; and load only the Genex skills that the requested work actually needs. Use first for new work, resumed work, or whenever ownership is unclear.
4
4
  ---
5
5
 
6
6
  # Genex Game Director
7
7
 
8
8
  The player chooses what to build and in what order. You route that request;
9
- the owning Genex skills control how their lanes run.
10
-
11
- Routing binds in BOTH directions: load only the lanes the requested work
12
- touches — never the whole pack by default, and never unrelated work because an
13
- old workflow listed it — and load a lane BEFORE the first file of the subsystem
14
- it owns. A matching row in the routing map is not a suggestion: each lane
15
- exists because writing that subsystem without it ships a known defect.
16
- Loading one lane never commissions another.
9
+ the owning Genex skills control how their lanes run. Load only skills that
10
+ change the requested result—never the whole pack by default, and never
11
+ commission unrelated work because an old workflow listed it.
17
12
 
18
13
  **After any context compaction or session resume**, re-read the project's
19
14
  `AGENTS.md`, `DESIGN.md` when present, and the skill for the work you are
@@ -41,13 +36,6 @@ paths. Building, previewing, promoting and publishing use `genex preview` /
41
36
 
42
37
  Use the request in front of you, not the oldest description of the project.
43
38
 
44
- - **Explicit Blender authoring**, including a standalone prop, owns the
45
- `$genex-blender-scene` lane. Keep the requested scope: Python scripts, an
46
- exported GLB and a browser preview for an asset request. Do not invent
47
- gameplay, a character controller or a game concept to justify the hosted
48
- workspace. Blender in this sentence names the authoring tool; a kitchen
49
- blender requested as a prop follows the ordinary asset rows.
50
-
51
39
  - **Clear focused request**—“work on the UI,” “fix movement,” “add one enemy,”
52
40
  “make this prop,” “publish this”—read the touched implementation and
53
41
  `DESIGN.md`, load only the owning skills, update `Now:`, and start. Do not
@@ -66,10 +54,6 @@ Use the request in front of you, not the oldest description of the project.
66
54
  invent or propose game concepts for them.
67
55
  - **Existing project** respects its renderer, physics, file conventions, and
68
56
  working systems unless the player asks to change them.
69
- - **A tagged reference** (source under `.genex/refs/<slug>/`) owns the
70
- subsystem it was tagged for: read its `_map.md` and implementing files
71
- before choosing a lane — it outranks the default lane, including the
72
- vendored controllers, for that subsystem.
73
57
 
74
58
  Ask one decision at a time. Never ask the player to choose an SDK, engine,
75
59
  renderer, file layout, provider, or other implementation detail. Product
@@ -115,69 +99,40 @@ Never invent a provider generation ID for local code. Sections for gameplay,
115
99
  content, UI, world, assets, multiplayer, character/animation, tools, or
116
100
  modules are conditional on the request and existing project.
117
101
 
118
- ## 4. Routing map — load the owning lane before the first file
119
-
120
- For every subsystem the current milestone touches, find its row below, load
121
- that skill, and write the lane beside the work in `DESIGN.md` — a `Lane` cell
122
- on the module's row in the Modules table, or a `Lane:` line under `Now:` in
123
- focused or step-by-step work. `Lane: none <why>` is the only way to write a
124
- subsystem with no lane. Then write the code. Never reconstruct a lane's API or
125
- vendored code from memory of another engine.
126
-
127
- | Work needed | Load |
128
- | --- | --- |
129
- | **your first `npx genex model` or `npx genex character` this session** — the command, what comes back, how to scale and ground it, and what to do when a lane is dead. One page, thirty seconds. The full lanes below are long; measured across 105 generation-lane invocations, 94% ran without the owning skill open, and placement is where that showed | `$genex-lane-card` |
130
- | shot composition, chase/side/orbit rigs, camera handoffs, projection ownership, pointer look, mouse-aimed action, mouse-look, the screen-direction contract for hand-rolled steering/pan/look input signs, floating origins | `$genex-threejs-camera-direction` |
131
- | on-foot player movement: walk/run/jump/crouch, third-person character, slopes, stairs, moving platforms, the player's body loader, directional locomotion, transitions, action motion | `$genex-threejs-character-controller` |
132
- | **attacking, casting, aiming or reloading WHILE moving** — any action the legs must keep running under; a weapon carry stance over stock locomotion; a wind-up the character holds while walking | `$genex-threejs-character-controller` (`references/animations.md`, upper-body layering) |
133
- | dash, dodge, roll, blink, backstep, a lunging attack — any burst that moves the character itself | `$genex-threejs-character-controller` (`references/tuning-and-presets.md`, dash recipe) |
134
- | the game's own generated character—the player's body wherever a human body appears—or Meshy animation coverage beyond the stock pack: reference-informed A-pose concepts, exact action IDs, same-rig adapter | `$genex-ai-character` + `$genex-threejs-character-controller` (first time this session: `$genex-lane-card`) |
135
- | a character/enemy needs motion the catalog lacks—a signature move, boss telegraph, death, full 8-way set, or the player's footage; free plan before spend | `$genex-ai-character` motion section + `references/motion-generation.md` |
136
- | remote player bodies in multiplayer—never hand-built primitives: the game's generated character when it has one, otherwise the player's `p.avatarUrl` VRM | `$genex-threejs-multiplayer` + `$genex-threejs-character-controller` |
137
- | enemies, NPCs, or creatures: rigged bipeds via `npx genex creature`; non-biped body plans (quadruped, flier, serpent, aquatic, multi-leg) via `npx genex model rig` + `model animate`; static plus procedural motion only for shapes with no body plan; collider, facing, hit reaction, death | `$genex-threejs-creatures` |
138
- | cars, drones, vehicle physics, gearbox, character↔vehicle enter/exit | `$genex-threejs-vehicle-controllers` |
139
- | playable on phones: joystick, virtual buttons, drag zones, genre touch recipes, rotate-device overlay | `$genex-threejs-touch-controls` |
140
- | phone-survivable rendering: device tiers, DPR/shadow/post budgets, runtime governor, generated-asset rungs, Quality picker, dispose-on-swap | `$genex-threejs-adaptive-quality` |
141
- | anything falls, collides, gets pushed, or needs colliders/events | `$genex-threejs-physics-rapier` |
142
- | launch/docking timelines, authored transform phases, springs, convergence, deterministic prop/debris motion | `$genex-threejs-procedural-animation` |
143
- | a level, arena, interior or map to walk through — the SPACE ITSELF: its ground plan, rooms, lanes, walls, paths and sites, from a description or a floor plan; a blockout. This row claims the space, never the things standing in it — the buildings, props, creatures and characters a player walks up to are separate rows below, and routing the space does not route them | `$genex-blender-scene` — probe the lane first (`npx genex blender scene`); when it is off, the same space is built as code via `$genex-threejs-procedural-assets` |
144
- | rebuild a reference prop, hard-surface object, modular decoration, or structural environment piece (kits, fences, walls, paving) as editable parameterized Three.js code — held to the asset bar at the end of this section | `$genex-threejs-procedural-assets` |
145
- | stylized/abstract shader-authored materials, the procedural/PBR material boundary | `$genex-threejs-procedural-assets` |
146
- | particles, trails, plasma, shockwaves, pooled bursts, and event effects | `$genex-threejs-procedural-vfx` |
147
- | stable large-world shadows, cascades, clipmaps, cached updates | `$genex-threejs-shadow-systems` |
148
- | eye adaptation, tone mapping, output color, LUT grading, and proven static grain | `$genex-threejs-exposure-color-grading` |
149
- | fixed-view screenshots, input direction, facing, temporal and budget evidence | `$genex-threejs-visual-validation` |
150
- | **a model the player already has** — a `.glb` they exported, bought or made elsewhere: it is IMPORTED, never rebuilt. `npx genex model import <file.glb>` (free) for props and non-biped bodies (then `model rig`/`model animate`), `npx genex character import <file.glb>` for a humanoid that should walk (Uthana auto-rig, then `character animate --locomotion`) | `$genex-ai-model` · `$genex-ai-character` |
151
- | the default for a concrete object the player looks at up close: a generated GLB for a prop, vehicle, building, or object — from text or a reference image (`--image`); split into named parts (`model segment`); rig + animate any mesh (`model rig` / `model animate`). A space routed to code above does NOT settle these: a village's ground plan can be code while the forge you walk up to is generated | `$genex-ai-model` (first time this session: `$genex-lane-card`) |
152
- | generated surface or terrain texture with real-world UV scale | `$genex-ai-texture` |
153
- | sky, skybox, horizon, time of day, weather mood, night or space backdrop | build it in code in the scene—there is no sky command and no owning skill, so pick the technique this game needs |
154
- | poster, sign, sprite, decal, reference sheet, or other 2D art | `$genex-ai-image` |
155
- | in-world motion art or another requested video | `$genex-ai-video` |
156
- | sound effect, one looping music bed, or a short spoken line | `$genex-ai-sfx`, `$genex-ai-music`, or `$genex-ai-voice` |
157
- | requested UI/HUD/menu/interface work, a visible UI problem, or an interface you decided this game wants built with generated art | `$genex-threejs-game-ui` |
158
- | selling anything for platform coin: a shop, an item catalog, boosts, cosmetics, "make it earn"; also any request for a loot box, gacha, wager, casino mechanic or donation prompt, which that skill refuses and replaces | `$genex-monetization` |
159
- | cinematic menu/title/pause/victory/defeat/lobby/credits video treatment | `$genex-ai-menu` |
160
- | drawn HUD chrome the game's style wants—one element or a matched set of frames, masks, and icons | `$genex-ai-hud` |
161
- | the game works but feels flat, floaty, or unresponsive: input response, camera, impacts, cooldowns, difficulty, fail/retry | `$genex-threejs-game-feel` |
162
- | realtime multiplayer: movement sync, shared ball/NPC, host-run scores/enemies, shots/emotes, persistence | `$genex-threejs-multiplayer` |
163
- | players talking to each other by TEXT — chat, room chat, "let them type to each other" (`room.chat` + `npx genex controller chat`) | `$genex-threejs-multiplayer` |
164
- | players TALKING — voice chat, mic, "hear each other", proximity/positional voice (`room.voice` + `npx genex controller voice`; party-sized, max 6 per room — say that number out loud before building the feature) | `$genex-threejs-multiplayer` |
165
- | player identity, sign-in, guests, saves/progress, per-player state, shared persistent world, leaderboards—mandatory for every game | `$genex-threejs-embed-auth` |
166
- | the player EXPLICITLY asks to make an asset or publish something from their game as an asset for the free library | `$genex-asset-author` (`genex asset new`) — never offer this unprompted; no game duty routes here |
167
-
168
- Request-shape rules, working modes and the protected-lane handoffs stay in the
169
- [routing map](references/routing-map.md); read it when the request shape, not
170
- the subsystem, is what is unclear.
102
+ ## 4. Route to the owning lane
103
+
104
+ Use the [routing map](references/routing-map.md) for exact ownership. The main
105
+ Genex asset and runtime lanes are:
106
+
107
+ - `npx genex model "<prompt>"`—a generated GLB (also `--image` from a
108
+ reference picture, `model segment` into named parts, `model rig` +
109
+ `model animate` for non-biped bodies) `$genex-ai-model`
110
+ - `npx genex texture "<prompt>"`—a generated surface → `$genex-ai-texture`
111
+ - sky, horizon, time of day, weather mood—built in code, never generated; no
112
+ command and no skill owns it, so pick what this game needs
113
+ - `npx genex sfx "<prompt>"` / `music` / `voice`
114
+ `$genex-ai-sfx`, `$genex-ai-music`, `$genex-ai-voice`
115
+ - `npx genex image "<prompt>"` / `video`—2D and motion art
116
+ `$genex-ai-image`, `$genex-ai-video`
117
+ - UI, HUD, and menu requests `$genex-threejs-game-ui`,
118
+ `$genex-ai-hud`, `$genex-ai-menu`
119
+ - `npx genex character`, `creature`, and their motion commands
120
+ `$genex-ai-character`, `$genex-threejs-creatures`
121
+ - movement and vehicles `$genex-threejs-character-controller`,
122
+ `$genex-threejs-vehicle-controllers`
123
+ - phone input and phone-survivable rendering
124
+ `$genex-threejs-touch-controls`, `$genex-threejs-adaptive-quality`
125
+ - structures, buildings, modular kits, repeated or varied environment pieces,
126
+ and parameterized objects code is often the more efficient engine for
127
+ these `$genex-threejs-procedural-assets`
171
128
 
172
129
  For “make this image 3D,” ask **one** route question only when both results
173
130
  honestly fit: a generated GLB built from the picture itself
174
131
  (`npx genex model --image <path>`), or editable parameterized Three.js code.
175
132
  If the request says procedural, parametric, code-built, reusable variations,
176
133
  or names a GLB, start the corresponding route directly. An image alone never
177
- auto-triggers the procedural lane. A floor plan, a room photo or a map sketch
178
- is a SPACE, not an object: it goes to `$genex-blender-scene` with no route
179
- question. Player bodies, rigged characters/creatures, and animation stay with
180
- their protected owners.
134
+ auto-triggers the procedural lane. Player bodies, rigged characters/creatures,
135
+ and animation stay with their protected owners.
181
136
 
182
137
  If a procedural request has a private reference, use it locally and do not
183
138
  upload, publish, or commit it without explicit permission. If no reference was
@@ -186,36 +141,16 @@ supplied and creating one is part of the requested work, use the existing
186
141
  Assets row.
187
142
 
188
143
  The request sets the floor for the asset plan, never the ceiling: a world
189
- should feel dressed and alive, so plan the detail its genre implies — and
190
- choose the engine per object, never per category. The bar is the same for both
191
- engines: whatever the player looks at must read as the thing it is, in this
192
- game's own style a building as that building, a person as a person, a prop as
193
- that prop. A coloured box, a capsule or a flat grey block is not a finished
194
- version of any of them. Generation is the default route to that bar wherever
195
- code will not honestly reach it: the player's character, anything the request
196
- names, anything the player walks up to, enters, or interacts with, and the
197
- music and sound under it. Procedural code (`$genex-threejs-procedural-assets`)
198
- is a first-class engine for what is structural, repeated, distant, or
199
- parametric — terrain, sky (never generated), fences, paving, modular kits,
200
- filler — and for anything else only when the result meets the same bar and you
201
- have checked it in a capture before its row says `landed`. Write the route on
202
- each Assets row: the paid flow for generated pieces, the procedural flow with
203
- its local path for code-built ones — the table is where the per-object decision
204
- lives, and a table with no generated row records
205
- `Generation: none — <why code alone reaches the bar here>` beside it. Mixing
144
+ should feel dressed and alive, so plan the detail its genre implies — and pick
145
+ the more efficient engine per object. Paid generation buys hero pieces (the
146
+ player's character, key props, music); procedural code is the
147
+ unlimited detail engine for structures, buildings, modular kits, and repeated
148
+ or varied dressing (`$genex-threejs-procedural-assets` owns that lane) and
149
+ for the sky, which is never generated at all. Mixing
206
150
  both in one scene is the normal way to build, never a fallback. In focused
207
- work, stay inside the touched scope. Generate in batches you can finish. The first
208
- batch is the smallest set that makes the scene read — the player's body,
209
- whatever the request names, and the first thing they walk up to — enqueued
210
- together with `--no-wait` while you scaffold. Before a second batch starts,
211
- every id in the first is collected with `npx genex wait --all`, loaded from a
212
- file in `src/`, and seen in a capture. A batch begun while the previous one is
213
- still uncollected is how a game ends up with an asset library and an empty
214
- world. This is enforced, not merely advised: unshipped generations are counted
215
- and the generate commands refuse past a ceiling, which `npx genex preview`
216
- resets to zero. There is no total — preview between batches and generate as
217
- much as the game needs. Preserve every id, URL and wiring state across a
218
- compaction.
151
+ work, stay inside the touched scope. Run independent planned generations with
152
+ `--no-wait`, scaffold while they land, and preserve their IDs, URLs, and
153
+ wiring state.
219
154
 
220
155
  ## 5. Execute by working mode
221
156
 
@@ -373,14 +308,13 @@ your pick. The announced pick carries the lane:
373
308
 
374
309
  `npx genex character preview <concept-id> --candidate <1|2|3> --user-approved`
375
310
 
376
- Meshy 7 Image-to-3D first produces an unremeshed high-detail model. Show its
311
+ Meshy Image-to-3D first produces an unremeshed high-detail model. Show its
377
312
  front, back, left, and right views and report its measured face count.
378
- Preserve that model in R2. A triangle remesh at the face budget you approve
379
- (10000-100000; 10000 for crowds, 20000-30000 for a third-person player
380
- body)—not the high-detail source—is rigged and animated. In the default lane,
381
- the pick authorizes that remesh:
313
+ Preserve that model in R2. The 10,000-face triangle remesh—not the high-detail
314
+ source—is rigged and animated. In the default lane, the pick authorizes that
315
+ remesh:
382
316
 
383
- `npx genex character finalize <preview-id> --user-approved --approve-remesh <faces> [--animation <action-id>…]`
317
+ `npx genex character finalize <preview-id> --user-approved --approve-remesh 10000 [--animation <action-id>…]`
384
318
 
385
319
  When the player explicitly requested a custom character, keep the existing
386
320
  two stops: wait for their explicit candidate selection before Image-to-3D,
@@ -37,15 +37,11 @@ so it survives a long pause, context compaction, handoff, and remix.
37
37
  status flow `proposed → planned → generating (id) → landed (URL) → wired`.
38
38
  A landed asset is unfinished until wired or visibly cancelled. Preserve
39
39
  generation IDs, permanent URLs, local outputs, and wiring state across
40
- compaction. Every row shows its route: generated rows carry the paid flow;
41
- code-built rows carry the procedural flow and a local path. A table with no
42
- generated row at all carries `Generation: none — <why code alone reaches the
43
- bar here>` beside it (build contract, law 22).
40
+ compaction.
44
41
  - **Code-built procedural assets use their own truthful status flow:**
45
42
  `proposed → planned → building (blockout | detail | material | runtime) →
46
43
  landed (<local TypeScript path>) → wired`. They never invent a provider
47
- generation ID. `landed` on a code-built row means a capture at gameplay
48
- distance showed it reads as the thing it is. A generated reference image is a separate normal Assets row.
44
+ generation ID. A generated reference image is a separate normal Assets row.
49
45
  - Sections are request-driven. Gameplay, content, UI, assets, world,
50
46
  multiplayer, character/animation, tools, modules, and procedural assets
51
47
  appear only when the request or existing project uses them.
@@ -77,7 +73,6 @@ or explicitly re-scope it.>
77
73
  Working mode: <whole coordinated build | step by step | focused change>
78
74
  Now: ▶ <number/name of the current milestone or focused task>
79
75
  Done when: <one plain, observable condition for the current work>
80
- Lane: <$genex-… owning the current subsystem | none — why no row matches>
81
76
  1. <milestone> — ✅ → previewed
82
77
  2. <milestone> — ▶ in progress (<main agent | sub-agent>)
83
78
  3. <milestone> — ⏸ paused (<reason>)
@@ -126,10 +121,7 @@ Menu video: <generation id/URL, or the still standing in while it renders>
126
121
  | <asset> | <model/image/texture/…> | planned | — |
127
122
  | <asset> | <kind> | generating (<id>) | — |
128
123
  | <asset> | <kind> | landed → <URL> | yes/no |
129
- | <asset> | procedural-code | building (blockout) | — |
130
124
  Status flow: proposed → planned → generating (id) → landed (URL) → wired.
131
- Code-built rows: proposed → planned → building (…) → landed (<local path>) → wired.
132
- Generation: none — <why code alone reaches the bar in this game> (only when no row is generated)
133
125
 
134
126
  **HUD pipeline state (only while the sprites lane is running) — keep this
135
127
  current; it is how that pipeline survives a context compaction.**
@@ -160,9 +152,9 @@ Play-button rule: nothing connects before the click when a Play screen exists.
160
152
  Verification still open: <two-identity/netcode evidence>
161
153
 
162
154
  ## Modules (whole coordinated mode or another useful split only)
163
- | Module | Lane | Owns files | Built by | Done when |
164
- |---|---|---|---|---|
165
- | <request-derived stream> | <$genex-… or none — why> | <disjoint paths> | <parallel/serial + reason> | <observable result> |
155
+ | Module | Owns files | Built by | Done when |
156
+ |---|---|---|---|
157
+ | <request-derived stream> | <disjoint paths> | <parallel/serial + reason> | <observable result> |
166
158
 
167
159
  ## Verification evidence
168
160
  - <preview URL/date and what it proves>
@@ -28,23 +28,52 @@ copy demo architecture.
28
28
  3D,” ask one plain question: normal generated GLB, or editable parameterized
29
29
  Three.js code? Explicit `GLB`, `procedural`, `parametric`, `code-built`, or
30
30
  `variations` language chooses directly.
31
- - **Tagged reference:** source under `.genex/refs/<slug>/` owns the subsystem
32
- it was tagged for — read its `_map.md` and implementing files before choosing
33
- a lane; it outranks the default lane, vendored controllers included.
34
31
 
35
32
  ## Route by system
36
33
 
37
- The ownership table lives in **SKILL.md §4** so it is in front of you the
38
- moment the director loads, rather than behind a link you have to decide to
39
- open. This file keeps the request-shape and working-mode rules; read it when
40
- the shape of the request, not the owning subsystem, is what is unclear.
34
+ | Work needed | Load |
35
+ | --- | --- |
36
+ | shot composition, chase/side/orbit rigs, camera handoffs, projection ownership, pointer look, mouse-aimed action, mouse-look, the screen-direction contract for hand-rolled steering/pan/look input signs, floating origins | `$genex-threejs-camera-direction` |
37
+ | on-foot player movement: walk/run/jump/crouch, third-person character, slopes, stairs, moving platforms, the player's body loader, directional locomotion, transitions, action motion | `$genex-threejs-character-controller` |
38
+ | **attacking, casting, aiming or reloading WHILE moving** — any action the legs must keep running under; a weapon carry stance over stock locomotion; a wind-up the character holds while walking | `$genex-threejs-character-controller` (`references/animations.md`, upper-body layering) |
39
+ | dash, dodge, roll, blink, backstep, a lunging attack — any burst that moves the character itself | `$genex-threejs-character-controller` (`references/tuning-and-presets.md`, dash recipe) |
40
+ | the game's own generated character—the player's body wherever a human body appears—or Meshy animation coverage beyond the stock pack: reference-informed A-pose concepts, exact action IDs, same-rig adapter | `$genex-ai-character` + `$genex-threejs-character-controller` |
41
+ | a character/enemy needs motion the catalog lacks—a signature move, boss telegraph, death, full 8-way set, or the player's footage; free plan before spend | `$genex-ai-character` motion section + `references/motion-generation.md` |
42
+ | remote player bodies in multiplayer—never hand-built primitives: the game's generated character when it has one, otherwise the player's `p.avatarUrl` VRM | `$genex-threejs-multiplayer` + `$genex-threejs-character-controller` |
43
+ | enemies, NPCs, or creatures: rigged bipeds via `npx genex creature`; non-biped body plans (quadruped, flier, serpent, aquatic, multi-leg) via `npx genex model rig` + `model animate`; static plus procedural motion only for shapes with no body plan; collider, facing, hit reaction, death | `$genex-threejs-creatures` |
44
+ | cars, drones, vehicle physics, gearbox, character↔vehicle enter/exit | `$genex-threejs-vehicle-controllers` |
45
+ | playable on phones: joystick, virtual buttons, drag zones, genre touch recipes, rotate-device overlay | `$genex-threejs-touch-controls` |
46
+ | phone-survivable rendering: device tiers, DPR/shadow/post budgets, runtime governor, generated-asset rungs, Quality picker, dispose-on-swap | `$genex-threejs-adaptive-quality` |
47
+ | anything falls, collides, gets pushed, or needs colliders/events | `$genex-threejs-physics-rapier` |
48
+ | launch/docking timelines, authored transform phases, springs, convergence, deterministic prop/debris motion | `$genex-threejs-procedural-animation` |
49
+ | rebuild a reference prop, hard-surface object, modular decoration, or simple environment piece as editable parameterized Three.js code | `$genex-threejs-procedural-assets` |
50
+ | stylized/abstract shader-authored materials, the procedural/PBR material boundary | `$genex-threejs-procedural-assets` |
51
+ | particles, trails, plasma, shockwaves, pooled bursts, and event effects | `$genex-threejs-procedural-vfx` |
52
+ | stable large-world shadows, cascades, clipmaps, cached updates | `$genex-threejs-shadow-systems` |
53
+ | eye adaptation, tone mapping, output color, LUT grading, and proven static grain | `$genex-threejs-exposure-color-grading` |
54
+ | fixed-view screenshots, input direction, facing, temporal and budget evidence | `$genex-threejs-visual-validation` |
55
+ | a generated GLB for a concrete prop, vehicle, building, or object — from text or a reference image (`--image`); split into named parts (`model segment`); rig + animate any mesh (`model rig` / `model animate`) | `$genex-ai-model` |
56
+ | generated surface or terrain texture with real-world UV scale | `$genex-ai-texture` |
57
+ | sky, skybox, horizon, time of day, weather mood, night or space backdrop | build it in code in the scene—there is no sky command and no owning skill, so pick the technique this game needs |
58
+ | poster, sign, sprite, decal, reference sheet, or other 2D art | `$genex-ai-image` |
59
+ | in-world motion art or another requested video | `$genex-ai-video` |
60
+ | sound effect, one looping music bed, or a short spoken line | `$genex-ai-sfx`, `$genex-ai-music`, or `$genex-ai-voice` |
61
+ | requested UI/HUD/menu/interface work, a visible UI problem, or an interface you decided this game wants built with generated art | `$genex-threejs-game-ui` |
62
+ | selling anything for platform coin: a shop, an item catalog, boosts, cosmetics, "make it earn"; also any request for a loot box, gacha, wager, casino mechanic or donation prompt, which that skill refuses and replaces | `$genex-monetization` |
63
+ | cinematic menu/title/pause/victory/defeat/lobby/credits video treatment | `$genex-ai-menu` |
64
+ | drawn HUD chrome the game's style wants—one element or a matched set of frames, masks, and icons | `$genex-ai-hud` |
65
+ | the game works but feels flat, floaty, or unresponsive: input response, camera, impacts, cooldowns, difficulty, fail/retry | `$genex-threejs-game-feel` |
66
+ | realtime multiplayer: movement sync, shared ball/NPC, host-run scores/enemies, shots/emotes, persistence | `$genex-threejs-multiplayer` |
67
+ | players talking to each other by TEXT — chat, room chat, "let them type to each other" (`room.chat` + `npx genex controller chat`) | `$genex-threejs-multiplayer` |
68
+ | players TALKING — voice chat, mic, "hear each other", proximity/positional voice (`room.voice` + `npx genex controller voice`; party-sized, max 6 per room — say that number out loud before building the feature) | `$genex-threejs-multiplayer` |
69
+ | player identity, sign-in, guests, saves/progress, per-player state, shared persistent world, leaderboards—mandatory for every game | `$genex-threejs-embed-auth` |
70
+ | the player EXPLICITLY asks to make an asset or publish something from their game as an asset for the free library | `$genex-asset-author` (`genex asset new`) — never offer this unprompted; no game duty routes here |
41
71
 
42
72
  ## Request-sized execution
43
73
 
44
74
  ### Focused work
45
75
 
46
- Load the owning row or rows before the first file of each subsystem, and
47
- none beyond the work — preserve the current architecture, implement
76
+ Load only the owning row or rows, preserve the current architecture, implement
48
77
  the requested result, and run its relevant check. UI work routes directly to
49
78
  UI; movement routes directly to movement; publishing routes directly to the
50
79
  existing publish flow. Do not add a concept, unrelated asset batch, full-game
@@ -100,28 +129,14 @@ flow and state what remains.
100
129
 
101
130
  ## Procedural assets (code-built)
102
131
 
103
- Use `$genex-threejs-procedural-assets` whenever code will honestly make the
104
- object read as the thing it is structural pieces, modular kits, repeated or
105
- varied props, parameterized objects — or when the player asks for procedural,
106
- parametric, or code-built work. It is a first-class lane, not a fallback, held
107
- to the same bar as a generated GLB, and mixing it with generated GLBs in one
108
- scene is the normal way to build a detailed world. An image alone still doesn't decide the route (ask the one
132
+ Use `$genex-threejs-procedural-assets` whenever code is the more efficient
133
+ engine for an objectstructures, buildings, modular kits, repeated or varied
134
+ props, parameterized objects — or when the player asks for procedural,
135
+ parametric, or code-built work. It is a first-class lane, not a fallback, and
136
+ mixing it with generated GLBs in one scene is the normal way to build a
137
+ detailed world. An image alone still doesn't decide the route (ask the one
109
138
  route question when both honestly fit), and never use it for player bodies,
110
- rigged characters/creatures, or animation. An OBJECT is this lane's unit; a
111
- SPACE the player moves through — a level, an interior, a whole building — is
112
- `$genex-blender-scene`'s, which falls back to this lane when the Blender lane
113
- is off on the stand.
114
-
115
- **That fallback claims the SPACE, never the things standing in it.** MEASURED
116
- 2026-09-03: a village brief matched the space row, the Blender lane was off, and
117
- the whole world — every house, the forge, the well, and five villagers — was
118
- built as code with no Assets table written and not one generation run. Routing
119
- the ground plan to this lane is not a decision about the forge the player walks
120
- up to, the smith they talk to, or the props they pick up: those are their own
121
- rows (`$genex-ai-model`, `$genex-ai-character`, `$genex-threejs-creatures`) and
122
- they are still decided per object against the asset bar. A village's layout in
123
- code with generated buildings and characters standing on it is the normal shape,
124
- not a contradiction.
139
+ rigged characters/creatures, or animation.
125
140
 
126
141
  - Prefer a supplied reference. A private attachment stays local unless the
127
142
  player explicitly permits upload, publication, or commit.
@@ -161,7 +161,7 @@ downloads the game too, binary assets and all:
161
161
 
162
162
  ```bash
163
163
  mkdir my-game && cd my-game
164
- npx @genex-ai/cli-demo@dev link <slug> # slug = the name in the play URL
164
+ npx @genex-ai/cli-demo@latest link <slug> # slug = the name in the play URL
165
165
  npm install
166
166
  ```
167
167
 
@@ -225,7 +225,7 @@ Safe to run any time — genex-owned skills are refreshed to the latest version,
225
225
  and your own files are never touched:
226
226
 
227
227
  ```bash
228
- npx @genex-ai/cli-demo@dev init
228
+ npx @genex-ai/cli-demo@latest init
229
229
  ```
230
230
 
231
231
  Use `--force` only if you intentionally want your own existing files overwritten
@@ -287,6 +287,182 @@ You *can* also just buy your own item, but it costs you the full price and pays
287
287
  you nothing: your share of a sale you funded goes to the platform, never into
288
288
  your own earnings. Use the test grant instead.
289
289
 
290
+ ## Generate content during play
291
+
292
+ Use `@genex-ai/embed-sdk` 0.21.0+ when a player should generate dialogue,
293
+ creature descriptions or other text/JSON inside a game. `initEmbed()` must already
294
+ have run (see `$genex-threejs-embed-auth`), and this feature requires signed-in
295
+ production play. Keep ordinary gameplay available if runtime generation is off.
296
+
297
+ ```ts
298
+ import { generate, getGenerationModels } from '@genex-ai/embed-sdk';
299
+
300
+ // Load after identity resolves, before wiring the button as available.
301
+ const { models } = await getGenerationModels();
302
+ const model = models[0];
303
+
304
+ generateButton.addEventListener('click', async () => {
305
+ if (!model) return;
306
+ const result = await generate({
307
+ modelId: model.id,
308
+ estimateCoins: 5, // Benchmarked fixed price for a started attempt.
309
+ prompt: 'Invent a friendly creature. Return a JSON name and color.',
310
+ outputFormat: 'json',
311
+ schema: {
312
+ type: 'object',
313
+ properties: { name: { type: 'string' }, color: { type: 'string' } },
314
+ required: ['name', 'color'],
315
+ additionalProperties: false,
316
+ },
317
+ allowExternal: true,
318
+ });
319
+ showBillingReceipt(result); // your game's receipt display, including failed/canceled outcomes
320
+ if (result.status === 'succeeded') showCreature(result.output);
321
+ });
322
+ ```
323
+
324
+ Call `generate()` before any await in the click handler. The SDK opens Genex's
325
+ trusted modal or popup, showing the game, frozen request, fixed attempt price and
326
+ USD equivalent. `estimateCoins` is required (integer 0..1,000,000); the player
327
+ approves this fixed amount and the game cannot confirm. New `declared-v1`
328
+ quotes charge the full price once model work starts, even if usage costs less,
329
+ generation fails, is canceled, or reaches its budget limit before a usable result.
330
+ Fixed 5 charges 5 even if actual usage would bill 2. No model work means zero;
331
+ zero is accepted only for server-authorized free or personal options. Unknown
332
+ provider expense keeps billing pending and its hold intact. The provider budget
333
+ fits inside these coins after the frozen platform tariff. This
334
+ compute price is independent of the shop's item grid and pays no developer share.
335
+
336
+ Only server-listed OpenRouter models are accepted. The first adapter returns
337
+ text/JSON data, not meshes or images. Validate the data before using it and never
338
+ execute generated code. Creature appearance or narrative may vary; keep gameplay
339
+ stats and rewards governed by game rules rather than a paid random rarity roll.
340
+
341
+ `allowExternal: true` offers the configured personal plan matching the selected
342
+ model beside coins: Claude for Claude models, ChatGPT for ChatGPT models, and
343
+ neither for other model families. The choice belongs only in the trusted Genex approval modal;
344
+ never add a "Your Plan" row to the game's model picker. Each uses the player's
345
+ own account and plan limits for zero coin, with no paid fallback. Genex freezes
346
+ the matching choices and gives connector
347
+ instructions; never collect subscription tokens. `source: 'external'` and
348
+ `modelProvenance: 'unverified'` mean user-supplied output, not proof of a model
349
+ or authority for rewards. Omit `allowExternal` to disable optional personal choices.
350
+
351
+ Reuse an `idempotencyKey` for retries of the same operation. If waiting returns
352
+ `pending` with `wait_timeout`, persist `generationId`, then use
353
+ `getGeneration(id)` or `waitForGeneration(id)` to recover it without another
354
+ request. Execution status and billing are separate: results include
355
+ `billingStatus: 'pending'|'final'`, `chargedCoins`, `chargedDisplayUsdCents`,
356
+ `reservedCoins` and `reservedDisplayUsdCents` when available. A failed/canceled
357
+ result is not evidence of a refund. `waitForGeneration()` waits for execution;
358
+ read `getGeneration()` again while billing remains pending. Missing receipt
359
+ fields mean unavailable, never zero. Native and local-test modes return explicit unsupported errors; mock the
360
+ game's rendering separately and verify real payment on a published web game.
361
+
362
+ ### Registered multi-step workflows
363
+
364
+ Use SDK **0.21.0+** `requestWorkflow()` only when the game already has an
365
+ operator-registered Genex workflow and its trusted backend executor. Ordinary
366
+ creator API keys cannot register an executor, publish offerings or call its
367
+ provider steps. Keep using `generate()` for generic text/JSON requests; do not
368
+ invent a workflow ID or build a browser proxy for paid model calls.
369
+
370
+ Before enabling the picker, load `getWorkflowOfferings(workflowId)`. Preserve
371
+ the selected offering's `id`, `bundleId`, `modelId`, `funding`, `available`,
372
+ `estimatedModelUsd`, `priceMultiplier`, `billingPolicy`, `estimatedCoins`,
373
+ `estimatedDisplayUsdCents`, `maxCoins` and `maxPriceDisplayUsdCents` through every
374
+ catalog projection. Offering `priceCoins`/`priceDisplayUsdCents` are ESTIMATE
375
+ aliases. Choose the public fixed `estimateCoins` after server-side development
376
+ benchmarks. The quote's `priceCoins` and `maxCoins` equal that fixed attempt
377
+ price; `priceDisplayUsdCents` is its USD equivalent. Show both. An unavailable
378
+ offering disables checkout. The server still owns the tariff, funding rules,
379
+ provider budget and final settlement.
380
+
381
+ ```ts
382
+ import { requestWorkflow, getEmbedToken } from '@genex-ai/embed-sdk';
383
+
384
+ createButton.addEventListener('click', async () => {
385
+ // Saved exact input + selected authoritative offering + stable operation key.
386
+ const { workflowId, offeringId, input, estimateCoins, idempotencyKey } = pendingCreation;
387
+ const approval = await requestWorkflow({ workflowId, offeringId, input, estimateCoins, allowExternal: true, idempotencyKey });
388
+ if (approval.generationId) saveGenerationId(approval.generationId);
389
+ if (approval.status !== 'authorized' || !approval.generationId) return;
390
+ // This is your existing game-backend endpoint, not an SDK helper. The server
391
+ // claims the approved run with Genex, binds one durable job, then enqueues it.
392
+ await enqueueApprovedWorkflow({
393
+ generationId: approval.generationId, embedToken: getEmbedToken(), input,
394
+ });
395
+ });
396
+ ```
397
+
398
+ `input` is `{ operation: 'create'|'refactor', description, bundleId, creatureId?,
399
+ revisionDigest? }`; refactors require creature identity and revision digest.
400
+ Call `requestWorkflow()` before any await in the actual click handler. It
401
+ resolves on **approval**, with `status: 'authorized'|'canceled'|'expired'|
402
+ 'failed'|'pending'`, optional `generationId`, `funding`, `error` and billing receipt fields. The backend
403
+ must claim and enqueue after approval. Waiting for the completed result first
404
+ would deadlock. After enqueueing, existing `getGeneration(id)` and
405
+ `waitForGeneration(id)` read the result; an authorized replay lets the backend
406
+ recover its existing job/artifact without starting a second one.
407
+
408
+ New public workflow quotes use `kind: 'fixed'` and
409
+ `billingPolicy: 'declared-v1'`. The declared price charges a started attempt,
410
+ including failed or canceled work; no model work is zero and unresolved expense
411
+ keeps the hold pending. The frozen operator multiplier (2 or 3, default 3) derives
412
+ the model budget from the fixed coin price. The budget may stop generation before
413
+ a usable result is ready. Only the selected model runs; no fallback.
414
+
415
+ Previously issued `consumed-v1` quotes keep their actual-usage billing and
416
+ untagged quotes keep original success/refund terms. Never substitute a current
417
+ catalog policy for a saved quote. `resumeWorkflow(generationId)` reopens a
418
+ saved approval from a click using GET only, with no new price or operation.
419
+ The trusted UI sends the exact policy acknowledgement. Backend validation and
420
+ staging remain required before delivery; the browser cannot submit costs or
421
+ settle a bill.
422
+
423
+ The public workflow catalog contains API/model rows, including the designated
424
+ `google/gemini-3.8-flash` and `z-ai/glm-5.3-flash` offerings at **0 coins**.
425
+ Personal Claude/ChatGPT funding in the Genex modal also costs **0 coins**, but is
426
+ not an in-game model option. Do not infer free status from a low price or a client
427
+ flag. Personal choices use the player's own account
428
+ through the provider-specific connector shown by Genex: `/player/mcp` for Claude,
429
+ `/player/chatgpt/mcp` for ChatGPT. Account/plan limits apply; ChatGPT connector
430
+ availability also depends on workspace policy. Genex gives the stage-by-stage
431
+ instructions and keeps them open when the SDK returns approval. One external
432
+ request may be active per player. Never collect subscription tokens, use the
433
+ creator's subscription on a player's behalf, or silently switch to paid API
434
+ work. Outputs remain user-supplied and must pass the registered backend's
435
+ validation before delivery. Both APIs restrict personal funding to the selected
436
+ model's provider; already-approved personal requests keep their connector for recovery.
437
+
438
+ Persist the exact input, offering, idempotency key and generation ID through
439
+ sign-in, cancellation and reload; never store the embed token. Recovery reads
440
+ existing state and never auto-charges. A changed input or expired quote requires
441
+ a new intentional request. The Genex workflow API requires signed-in production
442
+ play even for zero-coin offerings. Keep a game's separately sponsored free guest
443
+ path separate; do not weaken Genex's paid or session checks.
444
+
445
+ ### Calibrate before choosing the public fixed price
446
+
447
+ In a trusted Node script or server, import `developmentGenerate` from
448
+ `@genex-ai/embed-sdk/development` and pass `{ apiUrl, creatorToken, projectId,
449
+ maxCoins, request: { modelId, prompt, outputFormat, schema?, idempotencyKey? } }`.
450
+ The full creator credential spends only your own wallet; never put it in a game,
451
+ Vite environment or logs. No play token is needed. The browser export is blocked.
452
+ Development bills actual usage under `consumed-v1`, including failed work,
453
+ within your explicit maximum. A maximum 5 may charge 2. Public-sponsored API
454
+ models are developer-paid at the normal tariff in this lane; personal-only
455
+ options are rejected. Inspect the authoritative charged coins/USD and `usage`
456
+ cost/unknown-exposure receipt before choosing the public fixed `estimateCoins`.
457
+
458
+ Registered workflows use `developmentRequestWorkflow({ apiUrl, creatorToken,
459
+ projectId, workflowId, maxCoins, request: { offeringId, input, idempotencyKey? } })`.
460
+ It returns the accepted workflow for the trusted executor to enqueue; then use
461
+ `waitForDevelopmentGeneration(config, id)`. Read/cancel helpers retain the same
462
+ owner/project scope. Timeout leaves the operation intact; pending billing is not
463
+ a refund. Ordinary creator credentials cannot register an executor or bypass its
464
+ validation.
465
+
290
466
  ## Checklist
291
467
 
292
468
  - [ ] Items exist (`npx genex shop list`) before the shop UI is written
@@ -296,6 +472,7 @@ your own earnings. Use the test grant instead.
296
472
  - [ ] Every price renders `priceDisplayUsdCents` beside the coin figure
297
473
  - [ ] `buy()` is called synchronously inside a click/tap handler
298
474
  - [ ] `canceled` is silent; only real failures show a message
475
+ - [ ] Runtime generation shows its authoritative receipt on every outcome; pending holds never imply a refund
299
476
  - [ ] `deliverPending()` runs on every boot, before the player can act
300
477
  - [ ] `consumeEntitlement()` is awaited BEFORE the effect is applied
301
478
  - [ ] `alreadyConsumed: true` skips the effect
@@ -217,27 +217,6 @@ the same ladder through
217
217
  KTX2-capable games can also pass `ktx2Load` to `loadTextureWithFallback` so
218
218
  textures use their `.ktx2` variants.
219
219
 
220
- **A texture that arrived through a `.ktx2` rung is NOT drawable.** Its `.image`
221
- is `{ width, height, mipmaps }`, never an `HTMLImageElement` — so
222
- `ctx.drawImage(tex.image, …)` throws *"The provided value is not of type
223
- '(CSSImageValue or HTMLCanvasElement or …)'"*. MEASURED 2026-09-07: a village
224
- build wrote its own `capTextures()` pass to cap every texture's long edge and
225
- cast `tex.image as CanvasImageSource` to silence the type error. All ten of its
226
- generated buildings and both villager bodies then failed to load behind a
227
- swallowed warning — a fully generated, fully wired world that rendered EMPTY,
228
- and scored 1/9 with the assets sitting in R2. **Do not hand-roll a texture
229
- downscaler: the rungs ARE the downscaler**, and `@1024` already did it before
230
- the bytes left our side. If you must touch pixels, skip the compressed ones
231
- first — `if ((tex as THREE.CompressedTexture).isCompressedTexture) return;`.
232
-
233
- Every generated GLB ladders — `genex model` including its `segment` / `rig` /
234
- `animate` outputs, and generated characters. If `pickModel` hands a generated
235
- model URL back unchanged, this game's vendored kit predates that role: the
236
- quality kit is copied into the game ONCE and is yours from then on, so it
237
- never updates itself. Re-vendor it with `npx genex controller quality --force`
238
- (that overwrites the kit files — keep your own edits, if any, before running
239
- it), and the ladder starts resolving for those models.
240
-
241
220
  ## Quality picker in settings
242
221
 
243
222
  The pause/settings screen (see `$genex-threejs-game-ui`) always carries a