@genex-ai/cli-demo 0.93.0-dev.247 → 0.94.0-dev.249

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 (53) hide show
  1. package/dist/index.js +25 -4
  2. package/package.json +1 -1
  3. package/templates/skills/genex-ai-model/SKILL.md +3 -2
  4. package/templates/skills/genex-ai-skybox/SKILL.md +3 -3
  5. package/templates/skills/genex-game-director/SKILL.md +321 -411
  6. package/templates/skills/genex-game-director/references/design-contract.md +130 -179
  7. package/templates/skills/genex-game-director/references/routing-map.md +242 -362
  8. package/templates/skills/genex-threejs-exposure-color-grading/SKILL.md +3 -7
  9. package/templates/skills/genex-threejs-procedural-assets/SKILL.md +112 -0
  10. package/templates/skills/genex-threejs-procedural-materials/SKILL.md +3 -7
  11. package/templates/skills/genex-threejs-procedural-vfx/SKILL.md +6 -11
  12. package/templates/skills/genex-threejs-shadow-systems/SKILL.md +2 -3
  13. package/templates/skills/genex-threejs-visual-validation/SKILL.md +0 -4
  14. package/templates/skills/genex-threejs-atmosphere-aerial-perspective/SKILL.md +0 -46
  15. package/templates/skills/genex-threejs-atmosphere-aerial-perspective/references/atmosphere.md +0 -213
  16. package/templates/skills/genex-threejs-bloom/SKILL.md +0 -44
  17. package/templates/skills/genex-threejs-bloom/references/bloom.md +0 -187
  18. package/templates/skills/genex-threejs-exposure-color-grading/references/exposure-grading.md +0 -205
  19. package/templates/skills/genex-threejs-game-content/SKILL.md +0 -198
  20. package/templates/skills/genex-threejs-game-content/references/content-tables.md +0 -269
  21. package/templates/skills/genex-threejs-image-pipeline/SKILL.md +0 -56
  22. package/templates/skills/genex-threejs-image-pipeline/references/image-pipeline.md +0 -197
  23. package/templates/skills/genex-threejs-lighting-design/SKILL.md +0 -144
  24. package/templates/skills/genex-threejs-lighting-design/references/light-recipes.md +0 -137
  25. package/templates/skills/genex-threejs-open-world/SKILL.md +0 -149
  26. package/templates/skills/genex-threejs-open-world/references/terrain-streaming.md +0 -215
  27. package/templates/skills/genex-threejs-precipitation-surfaces/SKILL.md +0 -59
  28. package/templates/skills/genex-threejs-precipitation-surfaces/references/precipitation-surfaces.md +0 -181
  29. package/templates/skills/genex-threejs-procedural-architecture/SKILL.md +0 -50
  30. package/templates/skills/genex-threejs-procedural-architecture/references/architecture-systems.md +0 -509
  31. package/templates/skills/genex-threejs-procedural-fields/SKILL.md +0 -61
  32. package/templates/skills/genex-threejs-procedural-fields/references/field-systems.md +0 -232
  33. package/templates/skills/genex-threejs-procedural-geometry/SKILL.md +0 -39
  34. package/templates/skills/genex-threejs-procedural-geometry/references/mesh-systems.md +0 -202
  35. package/templates/skills/genex-threejs-procedural-materials/references/material-systems.md +0 -198
  36. package/templates/skills/genex-threejs-procedural-planets/SKILL.md +0 -48
  37. package/templates/skills/genex-threejs-procedural-planets/references/planet-systems.md +0 -498
  38. package/templates/skills/genex-threejs-procedural-vegetation/SKILL.md +0 -52
  39. package/templates/skills/genex-threejs-procedural-vegetation/references/vegetation-systems.md +0 -314
  40. package/templates/skills/genex-threejs-procedural-vfx/references/vfx-systems.md +0 -218
  41. package/templates/skills/genex-threejs-raymarched-space-effects/SKILL.md +0 -37
  42. package/templates/skills/genex-threejs-raymarched-space-effects/references/space-effects.md +0 -194
  43. package/templates/skills/genex-threejs-screen-space-ambient-occlusion/SKILL.md +0 -35
  44. package/templates/skills/genex-threejs-screen-space-ambient-occlusion/references/ambient-occlusion.md +0 -441
  45. package/templates/skills/genex-threejs-spectral-ocean/SKILL.md +0 -52
  46. package/templates/skills/genex-threejs-spectral-ocean/references/spectral-ocean.md +0 -473
  47. package/templates/skills/genex-threejs-temporal-surfaces/SKILL.md +0 -41
  48. package/templates/skills/genex-threejs-temporal-surfaces/references/temporal-surfaces.md +0 -207
  49. package/templates/skills/genex-threejs-visual-validation/references/visual-validation.md +0 -427
  50. package/templates/skills/genex-threejs-volumetric-clouds/SKILL.md +0 -49
  51. package/templates/skills/genex-threejs-volumetric-clouds/references/volumetric-clouds.md +0 -579
  52. package/templates/skills/genex-threejs-water-optics/SKILL.md +0 -57
  53. package/templates/skills/genex-threejs-water-optics/references/water-optics.md +0 -195
@@ -1,509 +0,0 @@
1
- # Architecture grammar and mesh compiler
2
-
3
- Use this reference when a procedural architectural generator must retain deliberate massing, façade rhythm, construction depth, semantic placement, and inspectable ownership.
4
-
5
- ## Contents
6
-
7
- 1. Compilation boundary
8
- 2. Mass grammar
9
- 3. Compound footprints
10
- 4. Placement grammar
11
- 5. Module compilation
12
- 6. Material-slot writer
13
- 7. Structural closure
14
- 8. Assertions and limitations
15
- 9. Adaptation workflow
16
- 10. Diagnostics
17
-
18
- ## 1. Preserve the compilation boundary
19
-
20
- Do not generate triangles while deciding the building:
21
-
22
- ```text
23
- BuildingSettings
24
- → createMassTiers()
25
- → createKitPlacements()
26
- → assertGeneratorInvariants()
27
- → BuildingPlan
28
- → appendMassCaps()
29
- → compile placements through registered module builders
30
- → one BufferGeometry per material slot
31
- ```
32
-
33
- The critical intermediate representation is `BuildingPlan`:
34
-
35
- ```ts
36
- type BuildingPlan = {
37
- settings: BuildingSettings
38
- bayWidth: number
39
- floorHeight: number
40
- tiers: BuildingTier[]
41
- placements: KitPlacement[]
42
- diagnostics: {
43
- duplicateSurfaceOwners: string[]
44
- missingModuleIds: KitModuleId[]
45
- unusedModuleIds: KitModuleId[]
46
- }
47
- }
48
- ```
49
-
50
- Keep it serializable. It enables topology rendering, deterministic tests,
51
- module-usage accounting, façade ownership inspection, and module replacement
52
- without changing mass grammar.
53
-
54
- ## 2. Use dimensional constants as grammar anchors
55
-
56
- The dimensional contract fixes:
57
-
58
- ```text
59
- BAY_WIDTH = 3.2 m
60
- FLOOR_HEIGHT = 3.35 m
61
- PODIUM_FLOOR_HEIGHT = 4.45 m
62
- ```
63
-
64
- Settings express spans in bays and floors:
65
-
66
- ```text
67
- fullWidth = widthBays * 3.2
68
- fullDepth = depthBays * 3.2
69
- podiumHeight = podiumFloors * 4.45
70
- ```
71
-
72
- Seeded randomness perturbs constrained decisions:
73
-
74
- ```text
75
- towerScale = clamp(
76
- settings.towerScale + random(-0.05, 0.04),
77
- 0.62,
78
- 0.96
79
- )
80
-
81
- setbackInset =
82
- 3.2
83
- * (1 - towerScale)
84
- * random(0.86, 1.08)
85
- ```
86
-
87
- Randomness adjusts shaft floor splits, setback progression, directional
88
- insets, crown inset, and twin-tower narrowing. It does not choose arbitrary
89
- boxes.
90
-
91
- Every upper span retains at least four bays:
92
-
93
- ```text
94
- clampedSpan(span, inset) = max(4 * BAY_WIDTH, span - 2 * inset)
95
- ```
96
-
97
- Without that invariant, upper tiers collapse into non-architectural slivers.
98
-
99
- ### Exact mass patterns
100
-
101
- The mass grammar supports:
102
-
103
- ```text
104
- single tower
105
- outer ring / free court
106
- twin towers with optional skybridge
107
- ```
108
-
109
- `classic-bank` keeps one shaft slice. `corner-hq` usually creates two. The
110
- setback-tower path creates three when floor count permits.
111
-
112
- Twin towers derive:
113
-
114
- ```text
115
- gap = max(2.2 bays, 18% full width)
116
- towerWidth = max(4 bays, 46% of remaining width)
117
- towerDepth = 82% full depth
118
- towerOffset = gap / 2 + towerWidth / 2
119
- ```
120
-
121
- The optional bridge is a real `BuildingTier`:
122
-
123
- ```text
124
- y = podiumHeight + clampedBridgeFloor * FLOOR_HEIGHT
125
- height = 1.15 * FLOOR_HEIGHT
126
- depth = max(1.2 bays, 18% full depth)
127
- ```
128
-
129
- Treat bridges, podiums, shafts, and crowns as topology so façades and caps use
130
- the same contracts.
131
-
132
- ## 3. Decompose compound footprints into rectangles
133
-
134
- The footprint grammar uses rectangular pieces:
135
-
136
- ```text
137
- L:
138
- front bar depth = 58%
139
- rear wing width = 44%
140
-
141
- T:
142
- cross bar depth = 36%
143
- stem width = 46%
144
-
145
- U:
146
- front bar depth = 34%
147
- each wing width = 26%
148
-
149
- courtyard block:
150
- bar thickness = max(2 bays, 24% of smaller outer span)
151
- ```
152
-
153
- The free-court path clamps the inner court so every bar retains at least
154
- `1.8 * BAY_WIDTH`, then applies bounded X/Z offsets.
155
-
156
- Do not union the pieces before façade planning. The implementation keeps pieces and
157
- computes exposed intervals per rectangle.
158
-
159
- ### Exposed-edge subtraction
160
-
161
- For each rectangle side:
162
-
163
- 1. create its full one-dimensional interval;
164
- 2. find rectangles touching that side within `0.001`;
165
- 3. project touching rectangles into blocker intervals;
166
- 4. subtract blockers sequentially;
167
- 5. discard segments shorter than `0.25`;
168
- 6. emit one `FacadeEdge` per surviving segment.
169
-
170
- ```ts
171
- type FacadeEdge = {
172
- id: string
173
- side: "front" | "back" | "left" | "right"
174
- center: number
175
- length: number
176
- x: number
177
- z: number
178
- isOuterCornerStart: boolean
179
- isOuterCornerEnd: boolean
180
- isInnerCornerStart: boolean
181
- isInnerCornerEnd: boolean
182
- }
183
- ```
184
-
185
- This prevents façades on shared walls between courtyard bars and compound
186
- wings. Use interval subtraction, not center-point tests.
187
-
188
- Observed limitation: the implementation marks both endpoints as inner
189
- corners whenever a surviving segment is shorter than the original side. It
190
- does not preserve which endpoint was clipped. Derive endpoint flags from the
191
- subtraction result if corner semantics matter.
192
-
193
- ## 4. Compile façade roles separately
194
-
195
- `createKitPlacements()` dispatches by tier role:
196
-
197
- ```text
198
- podium → createPodiumPlacements
199
- crown → createCrownPlacements
200
- shaft/bridge → createShaftPlacements
201
- ```
202
-
203
- Roof placements attach only to the highest crowns. Without crowns, they attach
204
- to highest shaft or bridge tiers. "Highest" means matching maximum
205
- `y0 + height` within `0.001`, so both twin towers can receive roofs.
206
-
207
- ### Bay quantization
208
-
209
- ```text
210
- count = max(minimum, round(edge.length / 3.2))
211
- bayWidth = edge.length / count
212
- bayCenter(i) =
213
- edge.center - edge.length / 2 + bayWidth * (i + 0.5)
214
- ```
215
-
216
- The effective bay width adapts to the exact exposed segment. Do not append a
217
- narrow remainder bay.
218
-
219
- ### Podium
220
-
221
- Podium edges use at least five bays on front/back and three on sides.
222
-
223
- The first `0.74 m` is a granite plinth unless the fortress archetype replaces
224
- it with a `2.1 m` rusticated block.
225
-
226
- Ground-floor selection is semantic:
227
-
228
- ```text
229
- front:
230
- center revolving door
231
- paired lobby doors adjacent to center
232
- optional corner entrance
233
- optional colonnade
234
- otherwise tall lobby windows
235
-
236
- back:
237
- loading dock every third bay
238
- security doors elsewhere
239
-
240
- sides:
241
- service-bank loading docks
242
- service doors at edges
243
- lobby windows elsewhere
244
- ```
245
-
246
- Projection depth varies by module:
247
-
248
- ```text
249
- paired column 1.8 m
250
- corner entrance 1.55 m
251
- revolving door 1.5 m
252
- loading dock 1.2 m
253
- ordinary podium 1.1 m
254
- ```
255
-
256
- That depth hierarchy is part of the visual result. Coplanar façade rectangles
257
- cannot preserve the portico and entrance reading.
258
-
259
- Podium trim includes a first-floor belt, top cornice, optional intermediate
260
- cornice, corner cornices, and explicit corner-joint modules.
261
-
262
- ### Shaft
263
-
264
- Shaft edges use at least four bays. Reserve whole-height zones before filling
265
- ordinary floor bays:
266
-
267
- - front central glass shaft and side piers for tower archetypes;
268
- - structural blank/service zones on non-front sides;
269
- - full-height corner piers.
270
-
271
- Ordinary bay choice depends on side, floor and bay modulo patterns, shaft
272
- rhythm, and archetype.
273
-
274
- ```text
275
- terra-cotta arcade:
276
- floor % 4 == 0 → arcade bay
277
- else floor % 2 == 0 → arched window
278
- else → brick window
279
-
280
- paired rhythm:
281
- alternating double-window and 3 m window
282
-
283
- Chicago grid:
284
- every third center bay uses 4 m window
285
- ```
286
-
287
- High ornament density can rewrite one bay into a lower carved/spandrel module
288
- plus an upper window module. It is not a decal.
289
-
290
- Add construction rhythm independently of windows:
291
-
292
- - floor band, sill, and lintel strips;
293
- - pilaster bundles every two or three bays;
294
- - lower, middle, and upper courses;
295
- - corner-joint modules at trim endpoints.
296
-
297
- Keep ownership separate for infill, vertical structure, and horizontal trim.
298
-
299
- ### Crown and roof
300
-
301
- Crown bays combine corner parapets, window/parapet infill, lower and upper
302
- cornices, attic/cartouche panels, optional pediment, and finials.
303
-
304
- Finial spacing is authored by named rhythm:
305
-
306
- ```text
307
- edge sparse 5.2 m
308
- edge dense 2.1 m
309
- skyline spikes 3.4 m
310
- default 3.2 m
311
- ```
312
-
313
- Roof style selects:
314
-
315
- ```text
316
- pyramidal metal:
317
- sloped roof + crest
318
-
319
- statue tower:
320
- sloped roof + lantern + mast
321
-
322
- flat/service:
323
- railings + equipment gated by density thresholds
324
- ```
325
-
326
- Equipment thresholds are `0.12`, `0.32`, `0.58`, and `0.66`; each adds a
327
- specific equipment group rather than scaling one generic clutter count.
328
-
329
- ## 5. Compile modules in local frames
330
-
331
- Each placement resolves a registered runtime:
332
-
333
- ```ts
334
- type KitModuleContext = {
335
- writer: KitMeshWriter
336
- transform: (point: Vec3) => Vec3
337
- moduleId: KitModuleId
338
- width: number
339
- height: number
340
- depth: number
341
- anchors: Record<string, Vec3>
342
- moduleVariant?: string
343
- }
344
- ```
345
-
346
- The compiler chooses:
347
-
348
- ```text
349
- roof placement → roofTransform(x, y, z)
350
- façade placement → facadeTransform(side, tier dimensions, edge offsets)
351
- ```
352
-
353
- `facadeTransform()` handles orientation and winding for all four sides.
354
- Module builders author geometry in one local convention.
355
-
356
- Do not make each module understand global side placement. That duplicates
357
- orientation logic and creates inconsistent normals.
358
-
359
- The registry is asserted before compilation. Missing builders fail rather than
360
- silently producing holes.
361
-
362
- ## 6. Preserve material-slot ownership
363
-
364
- The material slots are:
365
-
366
- ```text
367
- limestone
368
- granite
369
- terra-cotta
370
- glass
371
- bronze
372
- black-metal
373
- ornament
374
- roof
375
- ```
376
-
377
- `KitMeshWriter` owns one positions/normals/UVs/colors/indices buffer per slot
378
- and emits one indexed `BufferGeometry` for each nonempty slot.
379
-
380
- This separates glass from opaque stone, metals from masonry, and ornament from
381
- base limestone while bounding draw calls by semantic material roles.
382
-
383
- ### Physical texture scale
384
-
385
- For limestone and ornament:
386
-
387
- ```text
388
- stone tile size = 1.45 m
389
- atlas = 3 columns × 2 rows
390
- padding = 0.004 UV
391
- ```
392
-
393
- Large quads are bilinearly subdivided at `ceil(length / 1.45)` along each axis.
394
- Each subquad maps no more than one atlas-cell span:
395
-
396
- ```text
397
- uSpan = min(1, subquadWorldWidth / 1.45)
398
- vSpan = min(1, subquadWorldHeight / 1.45)
399
- ```
400
-
401
- This prevents one stone sample stretching across a tower wall.
402
-
403
- Observed behavior: `chooseStoneAtlasCell()` returns cell `4` for both limestone
404
- and ornament in this implementation. The constants permit multiple cells,
405
- but the current implementation produces coherent stone rather than per-quad
406
- random variation.
407
-
408
- ## 7. Close the mass independently
409
-
410
- Before placement compilation, the mass compiler adds:
411
-
412
- - soffits under elevated tiers;
413
- - decks on podium/crown/bridge tiers;
414
- - raised deck-edge strips;
415
- - connectors between touching rectangles at equal role, `y0`, and height.
416
-
417
- This prevents holes at setbacks and compound-footprint seams.
418
-
419
- The implementation skips decks for shaft tiers but still creates their
420
- soffits. Adapt that decision if upper shaft roofs can be visible.
421
-
422
- Structural closure belongs to the mass compiler, not window or cornice
423
- modules.
424
-
425
- ## 8. Preserve exact assertions and limitations
426
-
427
- Fail generation on:
428
-
429
- ```text
430
- registered module IDs without builders
431
- duplicate surface ownership keys
432
- ```
433
-
434
- The ownership key includes side, tier, edge, X/Z offsets, horizontal interval,
435
- vertical interval, and normal offset, rounded to `0.01`.
436
-
437
- Important limitation: this catches exact duplicate regions. It does **not**
438
- perform a general rectangle-overlap test. Partially overlapping placements can
439
- survive. Add interval-overlap validation when modules can have independent
440
- widths or arbitrary offsets.
441
-
442
- Unused module IDs are reported but do not fail generation.
443
-
444
- ## 9. Adapt in this order
445
-
446
- 1. Define bay/floor constants.
447
- 2. Produce deterministic mass tiers only.
448
- 3. Render topology blocks colored by role.
449
- 4. Decompose footprints and inspect exposed-edge intervals.
450
- 5. Emit placements without geometry.
451
- 6. Validate ownership and missing builders.
452
- 7. Compile a minimal plinth/window/corner/trim/roof kit.
453
- 8. Add material-slot batching and physical atlas scale.
454
- 9. Add reserved zones and ornament rewrites.
455
- 10. Add crowns and roof equipment after façade rhythm is stable.
456
-
457
- Do not begin with dozens of decorative builders. A weak mass and edge graph
458
- cannot be repaired by ornament.
459
-
460
- ## 10. Required diagnostics
461
-
462
- Expose:
463
-
464
- ```text
465
- seed and normalized settings
466
- tier role/name/bounds/inset
467
- footprint rectangle IDs
468
- full side and blocker intervals
469
- surviving exposed edges
470
- bay count and effective bay width
471
- reserved whole-height zones
472
- placement IDs and ownership rectangles
473
- module usage counts
474
- missing and unused module IDs
475
- exact duplicate ownership keys
476
- general overlap pairs if added
477
- material slot per triangle
478
- world meters per atlas repeat
479
- triangle count per module and slot
480
- mass caps, soffits, decks, and connectors
481
- ```
482
-
483
- Failure diagnosis:
484
-
485
- ```text
486
- façades inside a courtyard:
487
- blockers were not subtracted from rectangle sides
488
-
489
- upper tiers become slivers:
490
- minimum four-bay span was removed
491
-
492
- window rhythm collides with central/service zones:
493
- reserved vertical zones were filled again
494
-
495
- cornices stop at compound corners:
496
- trim was generated per whole tier instead of per exposed edge
497
-
498
- stone scale changes across walls:
499
- quads were not subdivided at the physical tile scale
500
-
501
- holes appear under setbacks:
502
- mass caps/soffits were delegated to façade modules
503
-
504
- missing pieces fail silently:
505
- registry completeness was not asserted
506
-
507
- overlaps survive validation:
508
- exact duplicate-key detection was mistaken for general overlap testing
509
- ```
@@ -1,61 +0,0 @@
1
- ---
2
- name: genex-threejs-procedural-fields
3
- description: Create coherent procedural scalar and vector fields for Genex Three.js games. Use for terrain, masks, biome maps, water influence, cloud density, material variation, displacement, wear, normals, domain warping, and visuals where multiple channels need a shared cause.
4
- ---
5
-
6
- # Genex Three.js Procedural Fields
7
-
8
- Do not start by stacking noise. Start by defining the fields the object physically or stylistically needs.
9
-
10
- ## Field contract
11
-
12
- Before shader code, write a field bundle:
13
-
14
- ```text
15
- coordinates
16
- → macro form
17
- → meso structure
18
- → derived causes
19
- → material channels
20
- ```
21
-
22
- Example:
23
-
24
- ```text
25
- sphereDirection
26
- → warpedDirection
27
- → elevation + ridges + craterDepth
28
- → slope + cavity + latitude + moisture
29
- → biome + color + roughness + bump
30
- ```
31
-
32
- ## Required workflow
33
-
34
- 1. Choose coordinates that remain stable under camera and object motion.
35
- 2. Lock real or perceptual scale for each frequency band.
36
- 3. Create named primary fields. Never hide the whole look in one expression.
37
- 4. Derive secondary fields from causes: slope from normals, shore from sea-level distance, wear from exposure, dirt from cavity.
38
- 5. Reuse the same fields across color, roughness, normal, displacement, emission, and scattering.
39
- 6. Add debug output for every named field.
40
- 7. Filter high-frequency fields by derivatives, tessellation density, or camera distance.
41
-
42
- Read [references/field-systems.md](references/field-systems.md)
43
- before implementation. It records sphere, terrain, water, and
44
- structured-placement field contracts plus common parity defects.
45
-
46
- ## Non-negotiable rules
47
-
48
- - Independent noise per channel produces visual soup. Share structure.
49
- - Domain warp the coordinates, not every result.
50
- - Warp spherical coordinates tangentially, then renormalize.
51
- - Use different frequency bands for silhouette, regions, surface breakup, and micro-normal.
52
- - Do not displace geometry with frequencies the mesh cannot represent.
53
- - Keep categorical masks broad enough to avoid isolated “bubble” regions.
54
- - Parameter names must describe perception: `ridgeWidth`, `coastBlend`, `cavityDarkening`, not `noise3Amount`.
55
-
56
- ## Routing boundary
57
-
58
- Use this skill when the shared field model is the task. Use
59
- `$genex-threejs-procedural-materials` when the task is channel assembly and material
60
- response, and `$genex-threejs-procedural-planets` when the deliverable is a complete
61
- planetary body.