@genex-ai/cli-demo 0.78.1-dev.203 → 0.80.2-dev.213

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.
@@ -1,266 +0,0 @@
1
- ---
2
- name: genex-threejs-skill-router
3
- description: Route Genex 3D browser-game work to the smallest useful Three.js skill set. Use for new game scenes, graphics upgrades, visual reference matching, game-feel passes, render-pipeline work, publishing readiness, multiplayer-aware scene architecture, or requests spanning cameras, geometry, materials, atmosphere, water, VFX, lighting, shadows, post-processing, and validation.
4
- ---
5
-
6
- # Genex Three.js Skill Router
7
-
8
- Use this skill first for broad 3D browser-game requests. Load only the skills
9
- that change the result; do not load the whole pack by default.
10
-
11
- Read [references/routing-map.md](references/routing-map.md) for the full routing
12
- map, execution order, and acceptance gate.
13
-
14
- ## Route by system
15
-
16
- | Work needed | Load |
17
- | --- | --- |
18
- | shot composition, chase/side/orbit rigs, camera handoffs, projection ownership, pointer look, mouse-aimed action (shooter, FPS/first-person, sniper, turret, crosshair/reticle), mouse-look, hand-rolled steering/pan/look input signs (screen-direction contract), floating origins | `$genex-threejs-camera-direction` |
19
- | on-foot player movement: walk/run/jump/crouch, third-person character, slopes, stairs, moving platforms, personal VRM animation, directional locomotion, transitions, action motion | `$genex-threejs-character-controller` |
20
- | a custom generated playable humanoid or Meshy animation coverage beyond UAL: reference-informed A-pose concepts, explicit candidate + 10k-remesh approvals, exact action IDs, same-rig adapter | `$genex-ai-character` + `$genex-threejs-character-controller` |
21
- | the player drives or flies something: cars, drones, vehicle physics, gearbox, enter/exit between character and vehicle | `$genex-threejs-vehicle-controllers` |
22
- | playable on phones: touch/mobile input for any game — joystick, virtual buttons, drag zones, per-genre touch recipes, rotate-device overlay — wired by default for every NEW game when a recipe fits (skip with a one-line reason) | `$genex-threejs-touch-controls` |
23
- | phone-survivable rendering — device tiers, DPR/shadow/post budgets, the runtime quality governor, per-tier asset rungs for generated skyboxes/textures, the Quality picker, dispose-on-swap discipline — **mandatory for every game at boot wiring** | `$genex-threejs-adaptive-quality` |
24
- | anything falls, collides, gets pushed, or needs physics: Rapier world setup, colliders for meshes and GLBs, collision events | `$genex-threejs-physics-rapier` |
25
- | launch and docking timelines, procedural transform phases, springs, staging, rotating-frame alignment, debris motion | `$genex-threejs-procedural-animation` |
26
- | reusable scalar/vector fields, domain warping, causal masks, procedural normals | `$genex-threejs-procedural-fields` |
27
- | atlas-filtered blocks, planetary surfaces, terrain wetness, lava/emissive procedural surfaces, authored frame PBR, specular AA | `$genex-threejs-procedural-materials` |
28
- | sculpted rails/frames, branch rings, semantic mesh writers, material groups | `$genex-threejs-procedural-geometry` |
29
- | trees, stylized grass, GPU-computed grass fields, branching organisms, roots, foliage, rooted wind deformation | `$genex-threejs-procedural-vegetation` |
30
- | buildings, façade grammars, profiles, ornaments, modular mesh writers | `$genex-threejs-procedural-architecture` |
31
- | planets, terrain, craters, biome fields, coastlines, spherical detail | `$genex-threejs-procedural-planets` |
32
- | sky scattering, planetary shells, depth-based aerial perspective | `$genex-threejs-atmosphere-aerial-perspective` |
33
- | weather-driven raymarched clouds and cloud shadows | `$genex-threejs-volumetric-clouds` |
34
- | hero open-water FFT oceans (expensive — only when open water IS the game): spectral cascades, hybrid FFT/Gerstner clear water, choppy derivatives, Jacobian whitecaps | `$genex-threejs-spectral-ocean` |
35
- | **default water**: an ocean, sea, lake, river, or pool the game plays on or around — authored analytic waves, bounded heightfield pools, object ripples, differential-area caustics, shared normals, heuristic refraction, fallback absorption, crest foam | `$genex-threejs-water-optics` |
36
- | falling snow, snow accumulation, model snow caps, wet asphalt puddles, procedural ripple normals, splash flipbooks, rain streaks, shared weather envelopes, surface wetness | `$genex-threejs-precipitation-surfaces` |
37
- | curved-ray black holes, accretion disks, wormholes | `$genex-threejs-raymarched-space-effects` |
38
- | particles, trails, plasma, shockwaves, layered event effects | `$genex-threejs-procedural-vfx` |
39
- | accumulated screen frost, touch clearing, reduced blur, and refraction masks | `$genex-threejs-temporal-surfaces` |
40
- | the light rig and where light belongs: sun/moon key, practical lights (campfire, torch, neon, lava), emissive-to-light coupling, light shafts and visible beams, fog mood, light signals, flicker, a scene that reads flat or uniformly lit | `$genex-threejs-lighting-design` |
41
- | stable large-world shadows, cascades, clipmaps, cached updates | `$genex-threejs-shadow-systems` |
42
- | GTAO, bent normals, bilateral reconstruction | `$genex-threejs-screen-space-ambient-occlusion` |
43
- | HDR bloom and selective emission contribution | `$genex-threejs-bloom` |
44
- | eye adaptation, tone mapping, LUT grading, output color | `$genex-threejs-exposure-color-grading` |
45
- | shared depth/normal/velocity ownership and multi-pass ordering | `$genex-threejs-image-pipeline` |
46
- | fixed-view diagnostics, seed sweeps, temporal and budget evidence | `$genex-threejs-visual-validation` |
47
- | game content named in the plural or a content genre: quests, objectives, NPCs, dialogue, shops, inventory, loot, XP/progression, an RPG/adventure/story game — **mandatory whenever the ask names content**, and its content contract is written before the asset batch | `$genex-threejs-game-content` |
48
- | a big/open world: kilometers of terrain, multiple regions or locations, exploration, points of interest, biomes, world streaming | `$genex-threejs-open-world` |
49
- | the 2D interface — HUD, menus, pause/win/lose screens, loaders, lobby, on-screen text and buttons, UI state flow — **mandatory for every game**, and its "Plan the UI first" gate runs right after the concept is locked | `$genex-threejs-game-ui` |
50
- | a cinematic menu — main menu/title/pause/victory/defeat/lobby/credits with a looping generated video backdrop behind DOM buttons | `$genex-ai-menu` |
51
- | a cohesive art-directed HUD — generated sprite set (matched frames, masks, icons in one style) wired with masked fills | `$genex-ai-hud` |
52
- | the game works but feels flat, floaty, or unresponsive: input response, acceleration curves, camera shake, hit feedback, hitstop, cooldowns, difficulty ramp, fail/retry loop | `$genex-threejs-game-feel` |
53
- | realtime multiplayer: movement sync, a shared ball/NPC, host-run scores/enemies, shots/emotes, persistence | `$genex-threejs-multiplayer` |
54
- | player identity, sign-in, guests, saves/progress, per-player state, a shared persistent world, leaderboards — **mandatory for every game** | `$genex-threejs-embed-auth` |
55
-
56
- **Identity is mandatory routing:** every Genex game ships with the embed SDK — load
57
- `$genex-threejs-embed-auth` unconditionally before writing boot code (it wires
58
- `initEmbed(...)` and the `waitForPlayer()` gate), and route to it whenever the task
59
- mentions sign-in, saves, progress, per-player state, a persistent world, or
60
- leaderboards. Multiplayer auth (`getColyseusAuth`) comes from it too.
61
-
62
- **Adaptive quality is mandatory routing:** every game wires the device tier at
63
- boot — `$genex-threejs-adaptive-quality` (three lines: `detectTier()` before the
64
- renderer, tier-capped `setPixelRatio`, the governor in the loop; generated
65
- skyboxes/textures load through their rungs). Phones enforce a hard GPU-memory
66
- kill desktops never show you; the tier is what keeps a phone boot alive while
67
- desktop keeps the full look. This is a completion gate like the post stack —
68
- cheap to wire, not a new testing burden (desktop-only verification stands).
69
-
70
- **Character-animation routing:** use the existing VRM + UAL character
71
- controller by default. Use `npx genex character` when the game needs a custom
72
- generated humanoid or an action unavailable in UAL. Before generating a Meshy
73
- character, discuss two or three visual directions. When the user names a visual
74
- reference, inspect references before writing the concept prompt. Recommend a
75
- neutral A-pose for characters that will be rigged.
76
-
77
- Generate concept images first and show the actual images to the user. Do not
78
- start Image-to-3D until the user explicitly selects a candidate. Generate
79
- exactly three concepts, all neutral A-pose; never use a dynamic concept pose or
80
- silently fall back to T-pose. Warn that held, slung, or overlapping props and
81
- straps can fuse into the body or obscure limbs, and recommend separate gameplay
82
- props.
83
-
84
- Meshy Image-to-3D first produces an unremeshed high-detail model. Show its
85
- front, back, left, and right views and report its measured face count. Preserve
86
- that model in R2. Before rigging, ask the user to approve a separate
87
- 10,000-face triangle remesh. The 10k remesh—not the high-detail source—is
88
- rigged and animated. Keep every pre-animation generation in the selected
89
- neutral A-pose.
90
-
91
- Load `$genex-ai-character`, search Meshy actions first with
92
- `npx genex animations search "<intent>" --json`, and use returned action IDs;
93
- never invent IDs. Meshy limb rotations play unchanged. Never freeze hand tracks
94
- or apply post-mixer arm, hand, leg, or foot corrections. Only horizontal root
95
- or hip translation may be normalized for Rapier. In both lanes, the
96
- ECCTRL-derived character controller owns collision and world translation.
97
-
98
- **UI is mandatory routing:** every game has an interface — load
99
- `$genex-threejs-game-ui` for every NEW game and run its "Plan the UI first" gate
100
- (screen inventory, one shared style brief, tier decisions) right after the game
101
- concept is locked, before any UI code. Its frame-anchored Tier-2 generations
102
- (cinematic menu, sprite HUD) are enqueued async (`--no-wait` + `npx genex wait
103
- <id>`) the moment the user approves the concept, so they land while the game is
104
- being built — they never block a playable v0, and the game is
105
- not done, published, or handed off until they've been picked up (`npx genex wait`)
106
- and wired in.
107
-
108
- **Content is mandatory routing when the ask names it:** if the request names
109
- game content in the plural — quests, enemies, bosses, locations, spells, items,
110
- factions — or a content genre (an RPG, an adventure, an open world, a story
111
- game), load `$genex-threejs-game-content` and write its **content contract**
112
- into the same plan message as the UI gate, BEFORE the asset batch: every
113
- plural noun of the request becomes a countable line (how many quests and what
114
- chain, which locations, what progression), plus the minute-ten answer. Those
115
- lines are hard floors exactly like the sprite HUD — the game is not done,
116
- published, or handed off while a contract line is missing, and shrinking one
117
- is a structured question to the user, never a silent cut ("vertical slice
118
- first" is a build order, not a smaller destination) — use your environment's
119
- structured question tool when it has one (Claude Code: `AskUserQuestion`;
120
- Codex: `request_user_input`); if it has none (e.g. Cursor), a short numbered
121
- list in chat. A request that says
122
- **big/open world** also loads `$genex-threejs-open-world` and fixes the
123
- world's scale as a number in the same plan — world size comes from streamed
124
- terrain, never from fog hiding the edges of a small plane. This routing
125
- exists because the failure it prevents is invisible to every visual gate: a
126
- "Skyrim-like big world with quests" can pass every look floor as a
127
- 300-meter single-quest vignette.
128
-
129
- **The look is planned up front too:** right after the UI gate, lock the visual
130
- direction in the same plan block — the camera rig + pointer bucket
131
- (`$genex-threejs-camera-direction`), the renderer baseline (tone mapping,
132
- exposure, output color space — set deliberately at boot; stock three.js
133
- defaults are not a look, `$genex-threejs-exposure-color-grading`), the post
134
- stack this game ships — read off the concept frame's OWN look (the grade, bloom
135
- level, haze, grain it already shows) and which post the 2–3 AAA references lean
136
- on, not a default single bloom; ONE built render-pass effect is the FLOOR
137
- against no-post for EVERY game, never the target — ship the richness the concept
138
- implies. The floor is TIER-AWARE (`$genex-threejs-adaptive-quality`): on phone
139
- tiers it is satisfied by the built tone-mapping/output pass with the light
140
- additions the tier allows (FXAA/vignette), while the full named stack remains
141
- the desktop floor — never ship the heavy stack undropped to phones (the UI
142
- vignette div or a CSS canvas filter does not count on any tier;
143
- `$genex-threejs-image-pipeline` owns ordering when 2+ compose), a decision for
144
- **every primitive surface** the game builds — walls, barriers, kerbs and
145
- platforms each get a real texture or a **shader** where that surface wants motion
146
- or energy (a pulsing force barrier, an electric fence, a scrolling hazard strip),
147
- judged one by one: a shader that gives a barrier life earns its place, the same
148
- effect everywhere disfigures, deliberate flat black is valid if you say so — but
149
- a flat-colour box beside textured geometry is the "stopped halfway" tell
150
- (`$genex-threejs-procedural-materials` / `$genex-threejs-procedural-vfx`, and SEE
151
- it in the running game), one named
152
- **ambient-motion loop** that keeps
153
- the scene alive at rest (emissive pulse, shimmer, drifting dust — shader
154
- work, zero generations), and the lighting/atmosphere mood from that
155
- same brief — walked source by source, every light with a visible cause
156
- (`$genex-threejs-lighting-design` owns that gate). Planning is not building — effects still land last in the
157
- execution order.
158
-
159
- **Multiplayer is mandatory routing:** if the game has 2+ players sharing a world, loading
160
- `$genex-threejs-multiplayer` is **required** before any networking code — the SDK auto-smooths
161
- remote players **and shared objects**, and gives you server-enforced object ownership (a ball) and
162
- a room `host` (scores, enemies). Choose the net model from the player experience before coding:
163
- `connect()` is one ongoing drop-in world; `matchmake()` forms capped rooms for fresh matches or
164
- missions with quorum/fair-start/backfill rules. Infer it when clear; ask one plain-language
165
- ongoing-world-vs-fresh-session question only when both experiences genuinely fit. A Play/Online
166
- button is always the commitment point for either API; only a truly always-online `connect()` world
167
- may join/spawn immediately, and then it must not show a fake Play screen. Only `matchmake()` requires
168
- a server-owned `genex.matchmaking` block in `package.json`, reported by preview/publish. Both models
169
- accept a fresh auth supplier, but their terminal-recovery duties differ, so follow the chosen model's
170
- section rather than mixing the two. Run that skill's netcode feel gate before handoff. The skill also
171
- covers the rules that keep it smooth and its per-genre recipes (sports/ball, shooter, co-op).
172
-
173
- ## Real (AI-generated) assets — `npx genex` commands
174
-
175
- When the user wants a **specific, recognizable asset** (a named object, a described
176
- sky, a particular sound, surface, image, or clip) rather than something authored in
177
- code, generate it with an `npx genex` command (run inside the project, where the
178
- `@genex-ai/cli-demo` dev dependency makes `genex` resolve to the right CLI). Each
179
- prints a permanent public `assets.genex.technology` URL you load straight from at
180
- runtime — the asset lives in Genex storage (R2), not your repo, so there's nothing to
181
- commit. Each skill has the exact Three.js loader code.
182
-
183
- | Work needed | Generate with | Skill |
184
- | --- | --- | --- |
185
- | a specific prop / item / non-playable static figure / vehicle body as a real mesh | `npx genex model "<prompt>"` | `$genex-ai-model` |
186
- | a custom generated playable humanoid with a rig and controller-ready animation pack | `npx genex character "<prompt>"` | `$genex-ai-character` |
187
- | a described 360° sky / backdrop + image-based lighting | `npx genex skybox "<prompt>"` | `$genex-ai-skybox` |
188
- | a specific sound effect tied to an event | `npx genex sfx "<prompt>"` | `$genex-ai-sfx` |
189
- | a photoreal surface/material on a mesh or terrain | `npx genex texture "<prompt>" [--terrain]` | `$genex-ai-texture` |
190
- | a picture on a plane/sprite — poster, sign, sprite, card art, decal/sticker | `npx genex image "<prompt>" [--transparent]` | `$genex-ai-image` |
191
- | a video clip on a surface — in-game screen, billboard, cutscene, backdrop | `npx genex video "<prompt>" [--loop]` | `$genex-ai-video` |
192
-
193
- Prefer the **procedural** skills above for abstract/parametric/animated systems
194
- (geometry, materials, sky, water, VFX) — no files, infinite variation. Prefer the
195
- **`npx genex` generators** for concrete, describable, photoreal assets. They complement
196
- each other.
197
-
198
- **Generate a core asset set by default — don't wait to be asked.** For any game that
199
- needs concrete objects or surfaces, decide a small core set from the game IDEA and start
200
- generating it **up front, in parallel** — this set is concept-INDEPENDENT (prompted from
201
- the idea, not the concept image, and it mostly survives a style change), so it does NOT
202
- wait on the concept yes (each `npx genex` is an independent ~1-minute
203
- job — launch them concurrently in the background, then scaffold the scene while they run
204
- and wire each asset in as it lands, with a procedural placeholder as fallback until then):
205
-
206
- - the **hero model** the player controls or chases (`npx genex model`),
207
- - one key **texture** for the ground/main surface (`npx genex texture --terrain` for ground),
208
- - a **skybox** when the scene is outdoors (`npx genex skybox`),
209
- - a **sfx** or two for the core action/feedback (`npx genex sfx`).
210
-
211
- Skip generation only for purely abstract/geometric games. Keep the set small and
212
- concept-driven — a richer first build beats a grey-box one.
213
-
214
- ## Routing rules
215
-
216
- - Start from the playable game target: player verb, scene scale, camera distance,
217
- input mode, and frame budget.
218
- - Pointer bucket (decide before building, state it in the plan): the bundled
219
- `FollowCamera` locks the pointer by default on desktop, so this is mostly a
220
- decision to opt OUT. **mandatory pointer lock** — first-person of any kind, and
221
- any mouse-aimed action (third-person shooter, turret/range); leave it on.
222
- **Lock by default** — third-person free-camera action/adventure; on already,
223
- drag-orbit (`pointerLockAim: false`) only with a stated reason (e.g. a
224
- cursor-heavy UI core). **Never** — cursor-core games (click-to-move, tower
225
- defense, builder, card/puzzle), orbit showcases, touch-only; these MUST pass
226
- `pointerLockAim: false`. Keyboard-only games (racer, platformer) lock too —
227
- the cursor is either a gameplay tool or locked away during play. The mechanism
228
- and the full aim contract live in `$genex-threejs-camera-direction`.
229
- - Input direction (always — every game that moves with keys or pointer):
230
- D/ArrowRight must move or turn the player screen-RIGHT, mouse-right must turn
231
- the view right, drag-pan axes share one convention. The screen-direction
232
- contract and verified copy-paste bases live in
233
- `$genex-threejs-camera-direction` — hand-rolled steering/pan/look math copies
234
- one instead of deriving signs, and the smoke check's input-direction pass
235
- verifies it.
236
- - Art direction follows THIS game's concept. The style examples inside skills
237
- are examples, not defaults — never default to neon/cyberpunk/synthwave (or any
238
- other single register) unless the concept calls for it.
239
- - Build silhouette, motion, and material readability before adding image effects.
240
- Never dress a primitive shape in glow or bloom to fake quality — authored
241
- forms first, then materials, then lighting, then effects last.
242
- - Set the renderer baseline deliberately at boot — tone mapping, exposure,
243
- output color space (`$genex-threejs-exposure-color-grading`). A game that
244
- ships on stock defaults hasn't chosen a look; a game that stacks post
245
- effects it never planned has chosen several.
246
- - Prefer deterministic seeds and named controls for every procedural system.
247
- - Keep game logic, simulation state, visual fields, and screen-space passes
248
- separated unless coupling is intentional.
249
- - Use `$genex-threejs-visual-validation` before declaring graphics/procedural-system
250
- work done. **Game fast path:** for game tasks that loaded no procedural/visual-system
251
- skill, done = a screenshot plus an interaction smoke check (load the page, press each
252
- control, see the visible response in its labeled direction) — don't run the full diagnostic gate — PLUS the
253
- floors from the routing-map's acceptance gate: the generated sprite HUD wired in
254
- (not the CSS placeholder), pause on Escape, the branded loader with its key-art
255
- background, the brief's fonts actually loaded, the renderer baseline + at least one
256
- built render-pass effect, every placed 2D/media piece screenshot-verified in
257
- situ, no UI element left as default browser CSS, and no placeholder primitive
258
- left where a generated asset was planned. These floors gate `npx genex publish`
259
- and the final handoff of a session the
260
- same way — they do not wait for the word "done" to be said.
261
- - Entering an **existing or remixed project**: read before writing — learn the
262
- current renderer choice, physics setup, and file conventions first, then
263
- extend them. Don't rebuild working systems or switch renderers mid-project.
264
- - For three.js APIs **not covered by any skill here**, consult the official
265
- three.js documentation (https://threejs.org/docs/) rather than guessing —
266
- the skills cover Genex-specific and hard-won patterns, not the whole engine.