@developerz.ai/ts23d 0.0.0-stage → 0.2.0

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 (567) hide show
  1. package/.claude/agents/bug-hunter.md +21 -0
  2. package/.claude/agents/docs-author.md +13 -0
  3. package/.claude/agents/dx-auditor.md +14 -0
  4. package/.claude/agents/primitive-author.md +22 -0
  5. package/.claude/agents/recipe-author.md +36 -0
  6. package/.claude/agents/visual-reviewer.md +23 -0
  7. package/.claude/commands/feature.md +28 -0
  8. package/.claude/commands/new-recipe.md +19 -0
  9. package/.claude/commands/release.md +14 -0
  10. package/.claude/commands/verify.md +9 -0
  11. package/.claude/skills/author-recipe/SKILL.md +93 -0
  12. package/CHANGELOG.md +90 -0
  13. package/CLAUDE.md +85 -0
  14. package/LICENSE +21 -0
  15. package/README.md +385 -2
  16. package/dist/chunk-6b05mnmx.js +19 -0
  17. package/dist/chunk-6b05mnmx.js.map +11 -0
  18. package/dist/chunk-7rtfjh9f.js +45 -0
  19. package/dist/chunk-7rtfjh9f.js.map +10 -0
  20. package/dist/chunk-8j4c28jt.js +4085 -0
  21. package/dist/chunk-8j4c28jt.js.map +46 -0
  22. package/dist/chunk-d1fv6hrm.js +2532 -0
  23. package/dist/chunk-d1fv6hrm.js.map +43 -0
  24. package/dist/chunk-dbq4qf52.js +902 -0
  25. package/dist/chunk-dbq4qf52.js.map +25 -0
  26. package/dist/chunk-drna2rny.js +836 -0
  27. package/dist/chunk-drna2rny.js.map +17 -0
  28. package/dist/chunk-dxvypr7y.js +89 -0
  29. package/dist/chunk-dxvypr7y.js.map +11 -0
  30. package/dist/chunk-f6yme003.js +1589 -0
  31. package/dist/chunk-f6yme003.js.map +30 -0
  32. package/dist/chunk-hg7pf34j.js +465 -0
  33. package/dist/chunk-hg7pf34j.js.map +19 -0
  34. package/dist/chunk-jq4e17tj.js +1031 -0
  35. package/dist/chunk-jq4e17tj.js.map +21 -0
  36. package/dist/chunk-y63c6zcv.js +2668 -0
  37. package/dist/chunk-y63c6zcv.js.map +53 -0
  38. package/dist/cli/args.d.ts +30 -0
  39. package/dist/cli/bin.d.ts +2 -0
  40. package/dist/cli/bin.js +348 -0
  41. package/dist/cli/bin.js.map +15 -0
  42. package/dist/cli/load.d.ts +2 -0
  43. package/dist/cli/manifest.d.ts +53 -0
  44. package/dist/cli/render-cmds.d.ts +12 -0
  45. package/dist/cli/run.d.ts +1 -0
  46. package/dist/cli/texture-cache.d.ts +4 -0
  47. package/dist/core/asset.d.ts +10 -0
  48. package/dist/core/definition.d.ts +155 -0
  49. package/dist/core/errors.d.ts +17 -0
  50. package/dist/core/family.d.ts +23 -0
  51. package/dist/core/index.d.ts +9 -0
  52. package/dist/core/index.js +69 -0
  53. package/dist/core/index.js.map +9 -0
  54. package/dist/core/mesh.d.ts +35 -0
  55. package/dist/core/part.d.ts +114 -0
  56. package/dist/core/png.d.ts +1 -0
  57. package/dist/core/rng.d.ts +12 -0
  58. package/dist/core/transform.d.ts +20 -0
  59. package/dist/core/vec.d.ts +11 -0
  60. package/dist/core/world.d.ts +16 -0
  61. package/dist/export/bin-writer.d.ts +16 -0
  62. package/dist/export/container.d.ts +3 -0
  63. package/dist/export/credits.d.ts +4 -0
  64. package/dist/export/glb-options.d.ts +48 -0
  65. package/dist/export/glb.d.ts +8 -0
  66. package/dist/export/hierarchy.d.ts +23 -0
  67. package/dist/export/index.d.ts +5 -0
  68. package/dist/export/index.js +40 -0
  69. package/dist/export/index.js.map +9 -0
  70. package/dist/export/lights.d.ts +8 -0
  71. package/dist/export/lod-coverage.d.ts +12 -0
  72. package/dist/export/materials.d.ts +23 -0
  73. package/dist/export/merge-pivots.d.ts +6 -0
  74. package/dist/export/metadata.d.ts +21 -0
  75. package/dist/export/motion.d.ts +9 -0
  76. package/dist/export/optimize-parts.d.ts +26 -0
  77. package/dist/export/primitive.d.ts +3 -0
  78. package/dist/export/tangents.d.ts +2 -0
  79. package/dist/export/textures.d.ts +22 -0
  80. package/dist/export/version.d.ts +2 -0
  81. package/dist/grammar/index.d.ts +2 -0
  82. package/dist/grammar/index.js +16 -0
  83. package/dist/grammar/index.js.map +9 -0
  84. package/dist/grammar/split.d.ts +21 -0
  85. package/dist/grammar/whyte.d.ts +5 -0
  86. package/dist/index.d.ts +11 -0
  87. package/dist/index.js +457 -0
  88. package/dist/index.js.map +9 -0
  89. package/dist/kinds/building.d.ts +44 -0
  90. package/dist/kinds/faces.d.ts +27 -0
  91. package/dist/kinds/head-armour.d.ts +5 -0
  92. package/dist/kinds/head-beard.d.ts +6 -0
  93. package/dist/kinds/head-bust.d.ts +5 -0
  94. package/dist/kinds/head-extras.d.ts +15 -0
  95. package/dist/kinds/head-face.d.ts +8 -0
  96. package/dist/kinds/head-garb.d.ts +4 -0
  97. package/dist/kinds/head-geom.d.ts +7 -0
  98. package/dist/kinds/head-hair.d.ts +4 -0
  99. package/dist/kinds/head-layout.d.ts +29 -0
  100. package/dist/kinds/head-mesh.d.ts +31 -0
  101. package/dist/kinds/head-mouth.d.ts +4 -0
  102. package/dist/kinds/head-params.d.ts +116 -0
  103. package/dist/kinds/head-presets.d.ts +19 -0
  104. package/dist/kinds/head-rim.d.ts +10 -0
  105. package/dist/kinds/head-tone.d.ts +10 -0
  106. package/dist/kinds/head-torso.d.ts +35 -0
  107. package/dist/kinds/head.d.ts +39 -0
  108. package/dist/kinds/hull-lines.d.ts +65 -0
  109. package/dist/kinds/hull-skin.d.ts +6 -0
  110. package/dist/kinds/hull.d.ts +14 -0
  111. package/dist/kinds/index.d.ts +16 -0
  112. package/dist/kinds/index.js +78 -0
  113. package/dist/kinds/index.js.map +9 -0
  114. package/dist/kinds/mass.d.ts +15 -0
  115. package/dist/kinds/openings.d.ts +30 -0
  116. package/dist/kinds/planned.d.ts +6 -0
  117. package/dist/kinds/roof-chimney.d.ts +16 -0
  118. package/dist/kinds/roof-shape.d.ts +64 -0
  119. package/dist/kinds/roof.d.ts +31 -0
  120. package/dist/kinds/vegetation-fronds.d.ts +15 -0
  121. package/dist/kinds/vegetation-impostor.d.ts +9 -0
  122. package/dist/kinds/vegetation-leaves.d.ts +15 -0
  123. package/dist/kinds/vegetation-mesh.d.ts +21 -0
  124. package/dist/kinds/vegetation-params.d.ts +90 -0
  125. package/dist/kinds/vegetation-presets.d.ts +20 -0
  126. package/dist/kinds/vegetation-skeleton.d.ts +20 -0
  127. package/dist/kinds/vegetation.d.ts +42 -0
  128. package/dist/kinds/vehicle.d.ts +42 -0
  129. package/dist/material/cc0.d.ts +4 -0
  130. package/dist/material/define.d.ts +34 -0
  131. package/dist/material/generator.d.ts +4 -0
  132. package/dist/material/index.d.ts +9 -0
  133. package/dist/material/index.js +70 -0
  134. package/dist/material/index.js.map +9 -0
  135. package/dist/material/library.d.ts +7 -0
  136. package/dist/material/material-def.d.ts +30 -0
  137. package/dist/material/paint/bond.d.ts +3 -0
  138. package/dist/material/paint/canvas.d.ts +39 -0
  139. package/dist/material/paint/cell.d.ts +4 -0
  140. package/dist/material/paint/cells-round.d.ts +5 -0
  141. package/dist/material/paint/cells.d.ts +7 -0
  142. package/dist/material/paint/compose.d.ts +5 -0
  143. package/dist/material/paint/concrete.d.ts +3 -0
  144. package/dist/material/paint/courses.d.ts +31 -0
  145. package/dist/material/paint/decode-png.d.ts +6 -0
  146. package/dist/material/paint/default-sheet.d.ts +4 -0
  147. package/dist/material/paint/fabric.d.ts +4 -0
  148. package/dist/material/paint/foliage-broad.d.ts +5 -0
  149. package/dist/material/paint/foliage-common.d.ts +35 -0
  150. package/dist/material/paint/foliage-compound.d.ts +4 -0
  151. package/dist/material/paint/foliage-conifer.d.ts +5 -0
  152. package/dist/material/paint/foliage-raster.d.ts +26 -0
  153. package/dist/material/paint/foliage.d.ts +3 -0
  154. package/dist/material/paint/image-strip.d.ts +4 -0
  155. package/dist/material/paint/kit.d.ts +5 -0
  156. package/dist/material/paint/masks.d.ts +3 -0
  157. package/dist/material/paint/metal.d.ts +3 -0
  158. package/dist/material/paint/noise.d.ts +9 -0
  159. package/dist/material/paint/normal.d.ts +8 -0
  160. package/dist/material/paint/orm.d.ts +8 -0
  161. package/dist/material/paint/planks.d.ts +3 -0
  162. package/dist/material/paint/plates.d.ts +3 -0
  163. package/dist/material/paint/shapes.d.ts +8 -0
  164. package/dist/material/paint/slate.d.ts +3 -0
  165. package/dist/material/paint/stamp.d.ts +3 -0
  166. package/dist/material/paint/strip.d.ts +3 -0
  167. package/dist/material/paint/surface.d.ts +5 -0
  168. package/dist/material/paint/types.d.ts +65 -0
  169. package/dist/material/paint/validate.d.ts +3 -0
  170. package/dist/material/palette.d.ts +14 -0
  171. package/dist/material/shader-godot.d.ts +2 -0
  172. package/dist/material/shader-three.d.ts +2 -0
  173. package/dist/material/shader.d.ts +46 -0
  174. package/dist/material/slots.d.ts +5 -0
  175. package/dist/material/texture-source.d.ts +34 -0
  176. package/dist/material/trim-sheet.d.ts +38 -0
  177. package/dist/neural/generator.d.ts +25 -0
  178. package/dist/neural/images.d.ts +17 -0
  179. package/dist/neural/index.d.ts +2 -0
  180. package/dist/neural/index.js +14 -0
  181. package/dist/neural/index.js.map +9 -0
  182. package/dist/passes/bake-ao.d.ts +17 -0
  183. package/dist/passes/grime.d.ts +15 -0
  184. package/dist/passes/index.d.ts +6 -0
  185. package/dist/passes/index.js +22 -0
  186. package/dist/passes/index.js.map +9 -0
  187. package/dist/passes/livery.d.ts +19 -0
  188. package/dist/passes/optimize-cache.d.ts +15 -0
  189. package/dist/passes/optimize-weld.d.ts +15 -0
  190. package/dist/passes/optimize.d.ts +28 -0
  191. package/dist/passes/ray-grid.d.ts +23 -0
  192. package/dist/passes/weighted-normals.d.ts +8 -0
  193. package/dist/primitives/beam.d.ts +17 -0
  194. package/dist/primitives/bevel-box.d.ts +13 -0
  195. package/dist/primitives/box.d.ts +16 -0
  196. package/dist/primitives/cell.d.ts +20 -0
  197. package/dist/primitives/check.d.ts +12 -0
  198. package/dist/primitives/closed.d.ts +11 -0
  199. package/dist/primitives/erosion.d.ts +22 -0
  200. package/dist/primitives/font-5x7.d.ts +3 -0
  201. package/dist/primitives/heightfield.d.ts +16 -0
  202. package/dist/primitives/index.d.ts +23 -0
  203. package/dist/primitives/index.js +81 -0
  204. package/dist/primitives/index.js.map +9 -0
  205. package/dist/primitives/lathe-facets.d.ts +8 -0
  206. package/dist/primitives/lathe.d.ts +26 -0
  207. package/dist/primitives/lattice.d.ts +30 -0
  208. package/dist/primitives/loft.d.ts +15 -0
  209. package/dist/primitives/mc-table.d.ts +2 -0
  210. package/dist/primitives/member.d.ts +19 -0
  211. package/dist/primitives/noise.d.ts +34 -0
  212. package/dist/primitives/planar.d.ts +10 -0
  213. package/dist/primitives/prism.d.ts +13 -0
  214. package/dist/primitives/sculpt-edit.d.ts +56 -0
  215. package/dist/primitives/sculpt-tree.d.ts +23 -0
  216. package/dist/primitives/sculpt.d.ts +27 -0
  217. package/dist/primitives/sdf-grid.d.ts +17 -0
  218. package/dist/primitives/sdf-ops.d.ts +37 -0
  219. package/dist/primitives/sdf.d.ts +21 -0
  220. package/dist/primitives/strip-uv.d.ts +11 -0
  221. package/dist/primitives/surface-nets.d.ts +7 -0
  222. package/dist/primitives/sweep.d.ts +19 -0
  223. package/dist/primitives/terrain-color.d.ts +30 -0
  224. package/dist/primitives/terrain-grid.d.ts +36 -0
  225. package/dist/primitives/text-layout.d.ts +22 -0
  226. package/dist/primitives/text.d.ts +27 -0
  227. package/dist/primitives/tiled.d.ts +22 -0
  228. package/dist/primitives/transport.d.ts +17 -0
  229. package/dist/primitives/triangulate.d.ts +2 -0
  230. package/dist/primitives/value-noise.d.ts +10 -0
  231. package/dist/qa/checks.d.ts +11 -0
  232. package/dist/qa/clash.d.ts +2 -0
  233. package/dist/qa/floating.d.ts +5 -0
  234. package/dist/qa/gates.d.ts +12 -0
  235. package/dist/qa/geometry.d.ts +21 -0
  236. package/dist/qa/index.d.ts +12 -0
  237. package/dist/qa/index.js +78 -0
  238. package/dist/qa/index.js.map +9 -0
  239. package/dist/qa/inside.d.ts +12 -0
  240. package/dist/qa/inspect.d.ts +18 -0
  241. package/dist/qa/lods.d.ts +12 -0
  242. package/dist/qa/measures.d.ts +4 -0
  243. package/dist/qa/occlusion.d.ts +3 -0
  244. package/dist/qa/sanity.d.ts +7 -0
  245. package/dist/qa/types.d.ts +12 -0
  246. package/dist/render/beauty.d.ts +40 -0
  247. package/dist/render/camera.d.ts +33 -0
  248. package/dist/render/depth-map.d.ts +38 -0
  249. package/dist/render/font.d.ts +1 -0
  250. package/dist/render/ground.d.ts +13 -0
  251. package/dist/render/index.d.ts +10 -0
  252. package/dist/render/index.js +47 -0
  253. package/dist/render/index.js.map +9 -0
  254. package/dist/render/lighting.d.ts +27 -0
  255. package/dist/render/lod-strip.d.ts +5 -0
  256. package/dist/render/metrics.d.ts +37 -0
  257. package/dist/render/options.d.ts +28 -0
  258. package/dist/render/photo-match.d.ts +19 -0
  259. package/dist/render/raster.d.ts +25 -0
  260. package/dist/render/resolve.d.ts +11 -0
  261. package/dist/render/review-prompt.d.ts +2 -0
  262. package/dist/render/review-warnings.d.ts +34 -0
  263. package/dist/render/review.d.ts +24 -0
  264. package/dist/render/scene.d.ts +18 -0
  265. package/dist/render/shade.d.ts +22 -0
  266. package/dist/render/sheet.d.ts +15 -0
  267. package/dist/render/texture.d.ts +15 -0
  268. package/dist/render/thumbnail.d.ts +8 -0
  269. package/dist/render/vis-buffer.d.ts +18 -0
  270. package/dist/testing/assert.d.ts +21 -0
  271. package/dist/testing/compiled.d.ts +15 -0
  272. package/dist/testing/hash.d.ts +1 -0
  273. package/dist/testing/index.d.ts +4 -0
  274. package/dist/testing/index.js +134 -0
  275. package/dist/testing/index.js.map +13 -0
  276. package/dist/testing/snapshot.d.ts +13 -0
  277. package/docs/README.md +56 -0
  278. package/docs/architecture/README.md +68 -0
  279. package/docs/architecture/adding-a-kind.md +44 -0
  280. package/docs/architecture/adding-a-primitive.md +49 -0
  281. package/docs/architecture/errors.md +47 -0
  282. package/docs/architecture/glb-production.md +214 -0
  283. package/docs/architecture/gltf-capabilities.md +117 -0
  284. package/docs/architecture/materials.md +151 -0
  285. package/docs/decisions/001-recipe-compiler-over-ai-meshes.md +27 -0
  286. package/docs/decisions/002-typescript-not-json.md +22 -0
  287. package/docs/decisions/003-shared-trim-sheet.md +21 -0
  288. package/docs/decisions/004-z-up-metres.md +21 -0
  289. package/docs/decisions/005-zero-runtime-deps.md +21 -0
  290. package/docs/decisions/006-single-package-subpath-exports.md +20 -0
  291. package/docs/decisions/007-cpu-contact-sheets.md +21 -0
  292. package/docs/decisions/008-surface-materials.md +21 -0
  293. package/docs/decisions/009-gltf-front-axis.md +21 -0
  294. package/docs/decisions/README.md +15 -0
  295. package/docs/idea/01-vision.md +117 -0
  296. package/docs/idea/02-dsl.md +343 -0
  297. package/docs/idea/03-ir.md +97 -0
  298. package/docs/idea/04-materials.md +114 -0
  299. package/docs/idea/05-agent-loop.md +141 -0
  300. package/docs/idea/06-qa.md +101 -0
  301. package/docs/idea/07-what-fits.md +45 -0
  302. package/docs/idea/08-neural-adapters.md +78 -0
  303. package/docs/idea/09-kinds.md +105 -0
  304. package/docs/idea/10-sculpting.md +166 -0
  305. package/docs/idea/11-materials-authoring.md +132 -0
  306. package/docs/idea/12-blender-bridge.md +136 -0
  307. package/docs/idea/13-asset-pipeline-research.md +89 -0
  308. package/docs/landscape.md +49 -0
  309. package/docs/plans/roadmap.md +139 -0
  310. package/examples/build-with-bun.ts +41 -0
  311. package/llms.txt +47 -0
  312. package/package.json +100 -4
  313. package/recipes/README.md +38 -0
  314. package/recipes/asteroid/README.md +46 -0
  315. package/recipes/asteroid/asteroid.ts +336 -0
  316. package/recipes/boulders/README.md +28 -0
  317. package/recipes/boulders/boulders.ts +117 -0
  318. package/recipes/boxcar/README.md +53 -0
  319. package/recipes/boxcar/boxcar.ts +1000 -0
  320. package/recipes/cargo_container_scifi/README.md +52 -0
  321. package/recipes/cargo_container_scifi/cargo_container_scifi.ts +461 -0
  322. package/recipes/dropship/README.md +84 -0
  323. package/recipes/dropship/dropship.ts +1144 -0
  324. package/recipes/eiffel_tower/README.md +110 -0
  325. package/recipes/eiffel_tower/eiffel_tower.ts +781 -0
  326. package/recipes/goblin_head/README.md +75 -0
  327. package/recipes/goblin_head/goblin_head.ts +38 -0
  328. package/recipes/human_head/README.md +68 -0
  329. package/recipes/human_head/human_head.ts +38 -0
  330. package/recipes/loco_440/README.md +32 -0
  331. package/recipes/loco_440/loco_440.ts +1404 -0
  332. package/recipes/material_swatches/README.md +21 -0
  333. package/recipes/material_swatches/material_swatches.ts +189 -0
  334. package/recipes/mountain_range/README.md +45 -0
  335. package/recipes/mountain_range/mountain_range.ts +128 -0
  336. package/recipes/oak/README.md +30 -0
  337. package/recipes/oak/oak.ts +19 -0
  338. package/recipes/orc_head/README.md +78 -0
  339. package/recipes/orc_head/orc_head.ts +41 -0
  340. package/recipes/palm/README.md +30 -0
  341. package/recipes/palm/palm.ts +19 -0
  342. package/recipes/pine/README.md +29 -0
  343. package/recipes/pine/pine.ts +19 -0
  344. package/recipes/signal_gantry/README.md +36 -0
  345. package/recipes/signal_gantry/signal_gantry.ts +522 -0
  346. package/recipes/station_halt/README.md +39 -0
  347. package/recipes/station_halt/station_halt.ts +722 -0
  348. package/recipes/t34/README.md +44 -0
  349. package/recipes/t34/t34.ts +1068 -0
  350. package/recipes/tiger_1/README.md +75 -0
  351. package/recipes/tiger_1/tiger_1.ts +1370 -0
  352. package/recipes/water_tower/README.md +40 -0
  353. package/recipes/water_tower/water_tower.ts +542 -0
  354. package/src/cli/args.ts +125 -0
  355. package/src/cli/bin.ts +7 -0
  356. package/src/cli/load.ts +17 -0
  357. package/src/cli/manifest.ts +95 -0
  358. package/src/cli/render-cmds.ts +66 -0
  359. package/src/cli/run.ts +192 -0
  360. package/src/cli/texture-cache.ts +24 -0
  361. package/src/core/asset.ts +129 -0
  362. package/src/core/definition.ts +156 -0
  363. package/src/core/errors.ts +50 -0
  364. package/src/core/family.ts +50 -0
  365. package/src/core/index.ts +66 -0
  366. package/src/core/mesh.ts +114 -0
  367. package/src/core/part.ts +130 -0
  368. package/src/core/png.ts +49 -0
  369. package/src/core/rng.ts +49 -0
  370. package/src/core/transform.ts +90 -0
  371. package/src/core/vec.ts +26 -0
  372. package/src/core/world.ts +80 -0
  373. package/src/export/bin-writer.ts +79 -0
  374. package/src/export/container.ts +35 -0
  375. package/src/export/credits.ts +25 -0
  376. package/src/export/glb-options.ts +53 -0
  377. package/src/export/glb.ts +187 -0
  378. package/src/export/hierarchy.ts +122 -0
  379. package/src/export/index.ts +34 -0
  380. package/src/export/lights.ts +49 -0
  381. package/src/export/lod-coverage.ts +71 -0
  382. package/src/export/materials.ts +126 -0
  383. package/src/export/merge-pivots.ts +146 -0
  384. package/src/export/metadata.ts +62 -0
  385. package/src/export/motion.ts +70 -0
  386. package/src/export/optimize-parts.ts +80 -0
  387. package/src/export/primitive.ts +35 -0
  388. package/src/export/tangents.ts +75 -0
  389. package/src/export/textures.ts +88 -0
  390. package/src/export/version.ts +6 -0
  391. package/src/grammar/index.ts +4 -0
  392. package/src/grammar/split.ts +87 -0
  393. package/src/grammar/whyte.ts +20 -0
  394. package/src/index.ts +14 -0
  395. package/src/kinds/building.ts +153 -0
  396. package/src/kinds/faces.ts +138 -0
  397. package/src/kinds/head-armour.ts +181 -0
  398. package/src/kinds/head-beard.ts +133 -0
  399. package/src/kinds/head-bust.ts +184 -0
  400. package/src/kinds/head-extras.ts +150 -0
  401. package/src/kinds/head-face.ts +242 -0
  402. package/src/kinds/head-garb.ts +181 -0
  403. package/src/kinds/head-geom.ts +31 -0
  404. package/src/kinds/head-hair.ts +193 -0
  405. package/src/kinds/head-layout.ts +63 -0
  406. package/src/kinds/head-mesh.ts +195 -0
  407. package/src/kinds/head-mouth.ts +111 -0
  408. package/src/kinds/head-params.ts +162 -0
  409. package/src/kinds/head-presets.ts +155 -0
  410. package/src/kinds/head-rim.ts +128 -0
  411. package/src/kinds/head-tone.ts +52 -0
  412. package/src/kinds/head-torso.ts +230 -0
  413. package/src/kinds/head.ts +176 -0
  414. package/src/kinds/hull-lines.ts +160 -0
  415. package/src/kinds/hull-skin.ts +83 -0
  416. package/src/kinds/hull.ts +209 -0
  417. package/src/kinds/index.ts +63 -0
  418. package/src/kinds/mass.ts +110 -0
  419. package/src/kinds/openings.ts +141 -0
  420. package/src/kinds/planned.ts +12 -0
  421. package/src/kinds/roof-chimney.ts +100 -0
  422. package/src/kinds/roof-shape.ts +230 -0
  423. package/src/kinds/roof.ts +250 -0
  424. package/src/kinds/vegetation-fronds.ts +126 -0
  425. package/src/kinds/vegetation-impostor.ts +118 -0
  426. package/src/kinds/vegetation-leaves.ts +168 -0
  427. package/src/kinds/vegetation-mesh.ts +174 -0
  428. package/src/kinds/vegetation-params.ts +147 -0
  429. package/src/kinds/vegetation-presets.ts +184 -0
  430. package/src/kinds/vegetation-skeleton.ts +168 -0
  431. package/src/kinds/vegetation.ts +199 -0
  432. package/src/kinds/vehicle.ts +144 -0
  433. package/src/material/cc0.ts +41 -0
  434. package/src/material/define.ts +130 -0
  435. package/src/material/generator.ts +63 -0
  436. package/src/material/index.ts +60 -0
  437. package/src/material/library.ts +196 -0
  438. package/src/material/material-def.ts +84 -0
  439. package/src/material/paint/bond.ts +60 -0
  440. package/src/material/paint/canvas.ts +101 -0
  441. package/src/material/paint/cell.ts +39 -0
  442. package/src/material/paint/cells-round.ts +119 -0
  443. package/src/material/paint/cells.ts +111 -0
  444. package/src/material/paint/compose.ts +53 -0
  445. package/src/material/paint/concrete.ts +62 -0
  446. package/src/material/paint/courses.ts +85 -0
  447. package/src/material/paint/decode-png.ts +106 -0
  448. package/src/material/paint/default-sheet.ts +73 -0
  449. package/src/material/paint/fabric.ts +63 -0
  450. package/src/material/paint/foliage-broad.ts +126 -0
  451. package/src/material/paint/foliage-common.ts +93 -0
  452. package/src/material/paint/foliage-compound.ts +135 -0
  453. package/src/material/paint/foliage-conifer.ts +143 -0
  454. package/src/material/paint/foliage-raster.ts +196 -0
  455. package/src/material/paint/foliage.ts +23 -0
  456. package/src/material/paint/image-strip.ts +88 -0
  457. package/src/material/paint/kit.ts +37 -0
  458. package/src/material/paint/masks.ts +46 -0
  459. package/src/material/paint/metal.ts +109 -0
  460. package/src/material/paint/noise.ts +52 -0
  461. package/src/material/paint/normal.ts +52 -0
  462. package/src/material/paint/orm.ts +108 -0
  463. package/src/material/paint/planks.ts +101 -0
  464. package/src/material/paint/plates.ts +72 -0
  465. package/src/material/paint/shapes.ts +28 -0
  466. package/src/material/paint/slate.ts +52 -0
  467. package/src/material/paint/stamp.ts +40 -0
  468. package/src/material/paint/strip.ts +48 -0
  469. package/src/material/paint/surface.ts +60 -0
  470. package/src/material/paint/types.ts +94 -0
  471. package/src/material/paint/validate.ts +74 -0
  472. package/src/material/palette.ts +46 -0
  473. package/src/material/shader-godot.ts +77 -0
  474. package/src/material/shader-three.ts +103 -0
  475. package/src/material/shader.ts +100 -0
  476. package/src/material/slots.ts +18 -0
  477. package/src/material/texture-source.ts +86 -0
  478. package/src/material/trim-sheet.ts +166 -0
  479. package/src/neural/generator.ts +37 -0
  480. package/src/neural/images.ts +27 -0
  481. package/src/neural/index.ts +10 -0
  482. package/src/passes/bake-ao.ts +183 -0
  483. package/src/passes/grime.ts +37 -0
  484. package/src/passes/index.ts +8 -0
  485. package/src/passes/livery.ts +66 -0
  486. package/src/passes/optimize-cache.ts +175 -0
  487. package/src/passes/optimize-weld.ts +147 -0
  488. package/src/passes/optimize.ts +85 -0
  489. package/src/passes/ray-grid.ts +237 -0
  490. package/src/passes/weighted-normals.ts +125 -0
  491. package/src/primitives/beam.ts +60 -0
  492. package/src/primitives/bevel-box.ts +140 -0
  493. package/src/primitives/box.ts +90 -0
  494. package/src/primitives/cell.ts +115 -0
  495. package/src/primitives/check.ts +49 -0
  496. package/src/primitives/closed.ts +74 -0
  497. package/src/primitives/erosion.ts +183 -0
  498. package/src/primitives/font-5x7.ts +117 -0
  499. package/src/primitives/heightfield.ts +101 -0
  500. package/src/primitives/index.ts +56 -0
  501. package/src/primitives/lathe-facets.ts +45 -0
  502. package/src/primitives/lathe.ts +174 -0
  503. package/src/primitives/lattice.ts +131 -0
  504. package/src/primitives/loft.ts +174 -0
  505. package/src/primitives/mc-table.ts +41 -0
  506. package/src/primitives/member.ts +130 -0
  507. package/src/primitives/noise.ts +157 -0
  508. package/src/primitives/planar.ts +55 -0
  509. package/src/primitives/prism.ts +85 -0
  510. package/src/primitives/sculpt-edit.ts +212 -0
  511. package/src/primitives/sculpt-tree.ts +226 -0
  512. package/src/primitives/sculpt.ts +80 -0
  513. package/src/primitives/sdf-grid.ts +131 -0
  514. package/src/primitives/sdf-ops.ts +145 -0
  515. package/src/primitives/sdf.ts +83 -0
  516. package/src/primitives/strip-uv.ts +26 -0
  517. package/src/primitives/surface-nets.ts +161 -0
  518. package/src/primitives/sweep.ts +162 -0
  519. package/src/primitives/terrain-color.ts +85 -0
  520. package/src/primitives/terrain-grid.ts +137 -0
  521. package/src/primitives/text-layout.ts +85 -0
  522. package/src/primitives/text.ts +197 -0
  523. package/src/primitives/tiled.ts +93 -0
  524. package/src/primitives/transport.ts +85 -0
  525. package/src/primitives/triangulate.ts +42 -0
  526. package/src/primitives/value-noise.ts +62 -0
  527. package/src/qa/checks.ts +110 -0
  528. package/src/qa/clash.ts +177 -0
  529. package/src/qa/floating.ts +63 -0
  530. package/src/qa/gates.ts +126 -0
  531. package/src/qa/geometry.ts +187 -0
  532. package/src/qa/index.ts +28 -0
  533. package/src/qa/inside.ts +114 -0
  534. package/src/qa/inspect.ts +107 -0
  535. package/src/qa/lods.ts +97 -0
  536. package/src/qa/measures.ts +67 -0
  537. package/src/qa/occlusion.ts +166 -0
  538. package/src/qa/sanity.ts +137 -0
  539. package/src/qa/types.ts +17 -0
  540. package/src/render/beauty.ts +115 -0
  541. package/src/render/camera.ts +142 -0
  542. package/src/render/depth-map.ts +191 -0
  543. package/src/render/font.ts +76 -0
  544. package/src/render/ground.ts +87 -0
  545. package/src/render/index.ts +34 -0
  546. package/src/render/lighting.ts +121 -0
  547. package/src/render/lod-strip.ts +34 -0
  548. package/src/render/metrics.ts +147 -0
  549. package/src/render/options.ts +81 -0
  550. package/src/render/photo-match.ts +28 -0
  551. package/src/render/raster.ts +143 -0
  552. package/src/render/resolve.ts +109 -0
  553. package/src/render/review-prompt.ts +59 -0
  554. package/src/render/review-warnings.ts +92 -0
  555. package/src/render/review.ts +103 -0
  556. package/src/render/scene.ts +119 -0
  557. package/src/render/shade.ts +204 -0
  558. package/src/render/sheet.ts +88 -0
  559. package/src/render/texture.ts +97 -0
  560. package/src/render/thumbnail.ts +75 -0
  561. package/src/render/vis-buffer.ts +119 -0
  562. package/src/testing/assert.ts +115 -0
  563. package/src/testing/compiled.ts +31 -0
  564. package/src/testing/hash.ts +14 -0
  565. package/src/testing/index.ts +14 -0
  566. package/src/testing/snapshot.ts +37 -0
  567. package/src/types/gltf-validator.d.ts +13 -0
@@ -0,0 +1,21 @@
1
+ ---
2
+ name: bug-hunter
3
+ description: Hunts real correctness bugs in a named scope (modules or files) — wrong geometry, broken determinism, bad GLB output, QA gates that pass broken assets. Read-only; reports file:line + reproduction.
4
+ tools: Read, Grep, Glob, Bash
5
+ model: opus
6
+ ---
7
+
8
+ Audit only the scope the brief names. A finding is a defect with evidence: wrong output, a crash, a
9
+ non-deterministic byte, a contract the file's header comment states and the code breaks, a gate that
10
+ passes an asset it should fail.
11
+
12
+ Hunt list for this repo:
13
+ - winding/normal orientation (backfaces after `place` with negative scale or mirrored frames)
14
+ - UV wrap and metres→UV scale mistakes; trim-sheet regions bleeding into each other
15
+ - GLB layout: alignment, accessor min/max, byteLength, node hierarchy vs parent order
16
+ - world-transform chains (yaw through parents) disagreeing between qa, render and export
17
+ - `ctx.use` prefixing, seed propagation, duplicate names after composition
18
+ - anything reading ambient state (`Math.random`, time, locale, Map iteration order assumptions)
19
+
20
+ Each finding: `file:line` · one-sentence defect · failing input → wrong output · a minimal repro
21
+ command (`bun -e '…'`). Drop what you can't reproduce. No edits, no git.
@@ -0,0 +1,13 @@
1
+ ---
2
+ name: docs-author
3
+ description: Keeps README, docs/, CHANGELOG and llms.txt true to the code after a change. Give it the diff or the feature; it edits docs only.
4
+ tools: Read, Write, Edit, Glob, Grep, Bash
5
+ model: sonnet
6
+ ---
7
+
8
+ Docs follow code, never the reverse. Read the changed code first, then fix every doc that now lies:
9
+ `README.md`, `docs/**`, `CHANGELOG.md` (`## [Unreleased]`), `llms.txt`, `CLAUDE.md` if a rule changed (`AGENTS.md` is a symlink to it).
10
+ Style: lead with the rule, fragments over sentences, tables for ≥3 rows, no fluff, date load-bearing
11
+ claims (`As of YYYY-MM`). Planned features are labelled planned — never describe a stub as shipped.
12
+ Positioning is neutral: ts23d is a free, code-based generator; never claim to beat other tools.
13
+ No git.
@@ -0,0 +1,14 @@
1
+ ---
2
+ name: dx-auditor
3
+ description: Audits the agent developer experience — gate speed, error messages (code + fix), CLI --json, docs an agent needs, friction in the recipe loop. Read-only; proposes concrete fixes.
4
+ tools: Read, Glob, Grep, Bash
5
+ model: sonnet
6
+ ---
7
+
8
+ Run the loop an agent runs: `bun run setup`, write a tiny recipe in `tmp/`, `bun run t3d build`,
9
+ `bun run t3d shot`, break it on purpose (duplicate part, floating part, wrong grammar string, bad
10
+ name) and read what comes back. Time `bun run verify` and each step (`--json` prints ms).
11
+
12
+ Report friction ranked by cost-per-turn: an error without a `fix:`, a command without `--json`, a step
13
+ over its target (lint < 5 s, unit < 10 s, full gate < 2 min), a doc an agent needed and didn't find, a
14
+ convention enforced only in prose (propose the guard script). No edits, no git.
@@ -0,0 +1,22 @@
1
+ ---
2
+ name: primitive-author
3
+ description: Adds or completes one geometry primitive or pass in src/primitives or src/passes (e.g. sweep, loft, tiled, cell, sdf) with tests, UVs onto the trim sheet, and LOD knobs. Give it the primitive and its signature in src/primitives/planned.ts.
4
+ tools: Read, Write, Edit, Glob, Grep, Bash
5
+ model: opus
6
+ ---
7
+
8
+ Read `CLAUDE.md` and `docs/architecture/adding-a-primitive.md`. You own the primitive's file, its test,
9
+ and its line in the module's `index.ts`. The signature in `planned.ts` is the contract recipes were
10
+ written against — keep it unless the brief says otherwise, and delete the stub when the real one lands.
11
+
12
+ Requirements:
13
+ - Emits the core `Mesh` IR via `MeshBuilder`; flat or smooth normals deliberately chosen and stated in
14
+ the header; UVs map onto the trim sheet at true metres (`stripRect`/`cellRect`).
15
+ - Deterministic; no allocation-heavy per-vertex closures in hot loops.
16
+ - One file < 200 LOC; split helpers (like `triangulate.ts`) into siblings.
17
+ - Tests first: bounds, triangle count as a function of the LOD knob, normal orientation, a degenerate
18
+ input that must throw `Ts23dError` with a fix.
19
+ - `bunx biome check --write <your files>`, `bun test <your test file>`, then `bun run typecheck` once.
20
+ - Use it in one recipe only if the brief gives you that recipe. No git.
21
+
22
+ Report: the API, test names, triangle formula, and anything the docs must now say.
@@ -0,0 +1,36 @@
1
+ ---
2
+ name: recipe-author
3
+ description: Writes or upgrades ONE asset recipe (recipes/<name>.ts) to real-asset quality — sourced real dimensions, dense LOD0 detail, lean LOD2 — iterating on contact sheets until it reads as the real thing. Give it the asset, its references, and the file it owns.
4
+ tools: Read, Write, Edit, Glob, Grep, Bash, WebSearch, WebFetch
5
+ model: opus
6
+ ---
7
+
8
+ You author one recipe in `recipes/`. Read `CLAUDE.md`, `docs/idea/02-dsl.md`, `docs/idea/05-agent-loop.md`
9
+ and `src/index.ts` first. Your file set is the one recipe the brief names; never edit `src/`. A missing
10
+ primitive is a finding for your report, not a reason to patch the library.
11
+
12
+ ## The loop — do not skip a step
13
+ 1. **Research → dossier.** Spec tables + real photos per view into `recipes/<name>/README.md` (template in
14
+ `recipes/README.md`; you own that file too). Copy the numbers into `sources`, `real` and 4–8 `measures`.
15
+ 2. **Masses first.** Hull/body/tiers with `prism` from real profiles, at true scale. `bun run t3d build
16
+ recipes/<name>.ts --out out` until QA PASS — `proportions` holds you to `real` ±5%.
17
+ 3. **Shoot and LOOK.** `bun run t3d shot recipes/<name>.ts --out renders`, then Read the PNG. Six labelled
18
+ ortho views on a metre grid. Compare silhouette per view against your references; fix proportions
19
+ before adding a single detail.
20
+ 4. **Detail pass, LOD-gated.** Build each detail once in local space, `place` it N times, `merge` into
21
+ the part. LOD0: everything a player sees up close (track links, bolts, hatches, handles, cables,
22
+ tools, vents, rivets). LOD1: drop small parts, fewer segments. LOD2: silhouette, a few hundred tris.
23
+ 5. **Grime** (`/passes`) near the ground and at exhausts/chimneys.
24
+ 6. Re-shoot, re-read, iterate until a stranger would name the object from the 3/4 view.
25
+
26
+ ## Rules
27
+ - Named parts are the engine contract: `turret`, `gun`, `axle_0`, `wheel_l_3`, `prop_main`, `door_l`.
28
+ Moving parts get `motion`; yawed parents never also carry motion.
29
+ - `ctx.rng` only. No `Math.random`, no clocks.
30
+ - Budgets are measurements: set them from what LOD0/1/2 actually need, with headroom ≤ 20%.
31
+ - Check only your file: `bunx biome check --write recipes/<name>.ts`, `bun run t3d build …`. Typecheck once at the end.
32
+ - No git operations.
33
+
34
+ ## Report
35
+ Triangles per LOD, QA output, the final contact sheet path, which details are still missing vs the
36
+ references, and any library gap with a concrete API proposal.
@@ -0,0 +1,23 @@
1
+ ---
2
+ name: visual-reviewer
3
+ description: Fresh-eyes visual QA of recipes from their contact sheets against real references. Read-only. Use after a recipe-author finishes, or on a PR's `contact-sheets` artifact.
4
+ tools: Read, Glob, Grep, Bash, WebSearch, WebFetch
5
+ model: opus
6
+ ---
7
+
8
+ You review assets by LOOKING at them. You did not write them; do not assume they are right.
9
+
10
+ For each recipe in scope: `bun run t3d shot recipes/<name>.ts --out renders` and Read the PNG. Find
11
+ 2–3 real reference images/drawings yourself. Judge, per view (3/4 front, front, side, top, 3/4 rear,
12
+ far LOD2):
13
+
14
+ | Check | Fail when |
15
+ |---|---|
16
+ | silhouette | a stranger could not name it from the 3/4 view |
17
+ | proportions | any major length off the reference by > 5% (use the metre grid) |
18
+ | signature features | the 3 things that make this object THIS object are missing (T-34: sloped glacis, Christie wheels, turret shape) |
19
+ | LOD2 | not recognisable at thumbnail size, or wastes triangles on invisible detail |
20
+ | floating / clipping | visible gaps or interpenetration the QA gate missed |
21
+
22
+ Report findings as: recipe · view · defect (one sentence) · concrete fix (which part, which number).
23
+ Drop anything you cannot point at in the image. No edits, no git.
@@ -0,0 +1,28 @@
1
+ ---
2
+ description: Build a feature or sweep with a hive of agents in this ONE checkout — understand, slice by path, build, gate, PR
3
+ argument-hint: <what to build or fix, plain language>
4
+ allowed-tools: Read, Write, Edit, Glob, Grep, Bash, Agent, SendMessage, TaskCreate, TaskUpdate, TaskList
5
+ ---
6
+
7
+ Request: $ARGUMENTS
8
+
9
+ You are the **coordinator**. Read `CLAUDE.md`. Done = `bun run verify` green → PR → merged → CI green
10
+ on main (→ released, if asked).
11
+
12
+ 1. **Understand + falsify.** Read the code the request touches. Docs and plans can be stale; check
13
+ claims against the code before planning on them.
14
+ 2. **Hive only if it pays** (gold-standards hive-mind): broad search or path-separable scale. A change
15
+ you understand in one or two files — do it yourself.
16
+ 3. **Slice by path.** Each slice = an exclusive file set. Two agents needing one file are one slice.
17
+ Keep an UNOWNED bucket for findings that land outside every slice.
18
+ 4. **Brief each agent with the WHY + the nine points:** exclusive files · who else is live on which
19
+ paths · findings as file:line + failure scenario · permission to drop contradicted findings ·
20
+ evidence before hypothesis (hypotheses labelled unverified) · house rules (CLAUDE.md) · tests ship
21
+ with code, failure case first · checks scoped to its own files · **no git at all**.
22
+ Agents never ask you questions: decide-and-flag, or stop-and-report.
23
+ 5. **Never git worktrees.** One checkout, many hands. Only you spawn agents; agents never delegate.
24
+ Max 4 parallel agents per sweep.
25
+ 6. **Collect, interrogate, integrate.** `SendMessage` follow-ups to the agent that owns the files.
26
+ Look for causal chains across reports. Then ONE `bun run verify`, in the background.
27
+ 7. **Ship.** Branch, commit, `gh pr create` (body: what/why, agents × files, contact sheets for
28
+ recipe changes, deferred items named). Merge on green CI.
@@ -0,0 +1,19 @@
1
+ ---
2
+ description: Research a real thing (specs + photos) and build it as a ts23d recipe at real-asset quality
3
+ argument-hint: <thing, e.g. "Tiger I mid-production 1943" or "Chrysler Building"> [reference URLs]
4
+ ---
5
+
6
+ Thing: $ARGUMENTS
7
+
8
+ The human names it; you research it; the library builds it; the gates prove it.
9
+
10
+ 1. **Research first — no code yet.** WebSearch for spec tables (manufacturer data, museum pages,
11
+ rosters, drawings) and real photos per view (side elevation, front, top, 3/4, details). Pick ONE
12
+ variant and stay consistent. Write `recipes/<snake_name>/README.md` from the template in `recipes/README.md` (the recipe goes next to it as `recipes/<snake_name>/<snake_name>.ts`):
13
+ every number with a URL, every photo by view, signature features, engine parts, open questions.
14
+ 2. **Recipe.** `recipes/<snake_name>.ts`: copy `sources` and `real` (overall box + 4–8 `measures`)
15
+ from the dossier. Then follow `.claude/skills/author-recipe/SKILL.md`: masses → QA PASS → shoot →
16
+ READ the PNG against the dossier photos → LOD-gated detail → grime → iterate.
17
+ 3. Big things (a city block, a ship) split into sub-recipes composed with `ctx.use`; one
18
+ `recipe-author` agent per sub-recipe (disjoint files), then a `visual-reviewer`.
19
+ 4. `bun run verify`. Summary: variant, dossier path, tris per LOD (`bun run bench`), contact sheet.
@@ -0,0 +1,14 @@
1
+ ---
2
+ description: Cut a release of @developerz.ai/ts23d (stamp → PR → merge = publish via OIDC)
3
+ argument-hint: <x.y.z>
4
+ ---
5
+
6
+ Version: $ARGUMENTS — follow `PUBLISHING.md`.
7
+
8
+ 1. `bun run verify` on fresh main.
9
+ 2. `bun run release $ARGUMENTS` (stamps package.json + CHANGELOG), review the CHANGELOG section.
10
+ 3. Branch `release/$ARGUMENTS`, commit `chore: release $ARGUMENTS`, `gh pr create --fill`.
11
+ 4. Merge on green. `release-tag.yml` tags `v$ARGUMENTS`, creates the GitHub Release, dispatches
12
+ `release.yml` → npm publish with provenance via OIDC. Never tag, `gh release create` or
13
+ `npm publish` by hand.
14
+ 5. Confirm: `npm view @developerz.ai/ts23d version` and `gh release view v$ARGUMENTS`.
@@ -0,0 +1,9 @@
1
+ ---
2
+ description: Run the gate and fix what it reports
3
+ ---
4
+
5
+ Run `bun run verify` (add `--json` if you want machine-readable output; `--only <step>` to re-run one).
6
+
7
+ Fix every failure at its root, then re-run until green. Never narrow the gate, loosen a Biome rule,
8
+ drop a strict tsconfig flag, raise a budget without a measured reason, or widen a QA tolerance to get
9
+ green. Every `T3D_*` error prints a `fix:` — do that first.
@@ -0,0 +1,93 @@
1
+ ---
2
+ name: author-recipe
3
+ description: The closed agent loop for writing a ts23d asset recipe in TypeScript — research real dimensions, block out masses, compile until QA PASS, render a six-view contact sheet, READ it, add LOD-gated detail, grime, iterate. Use whenever creating or improving anything in recipes/.
4
+ ---
5
+
6
+ # Authoring a recipe
7
+
8
+ The human names a thing; you research it (specs + real photos) into `recipes/<name>/README.md`; then you build
9
+ it here; the gates prove the model matches the research.
10
+
11
+ A recipe is a TypeScript module exporting one `defineAsset(...)`. It is code: loops, helpers,
12
+ `ctx.use` composition, `ctx.lod` gating. Never JSON.
13
+
14
+ ## Skeleton
15
+
16
+ ```ts
17
+ // <Name> — <one line>. Real: L × W × H m. Sources below.
18
+ import { beam, box, defineAsset, grime, hex, lathe, merge, place, prism } from '@developerz.ai/ts23d';
19
+
20
+ const paint = hex('#4b5320');
21
+
22
+ export const my_asset = defineAsset({
23
+ name: 'my_asset',
24
+ kind: 'vehicle',
25
+ description: '…',
26
+ tags: ['…'],
27
+ sources: ['https://…spec table…', 'https://…side elevation…'],
28
+ real: {
29
+ length: 6.68, width: 3.0, height: 2.45,
30
+ measures: [ // spec-sheet numbers, checked on LOD0 to ±2%
31
+ { label: 'road wheel diameter', axis: 'z', value: 0.83, parts: ['road_wheel_l_0'], source: '…' },
32
+ { label: 'track centres', axis: 'y', value: 2.45, between: ['track_l', 'track_r'] },
33
+ ],
34
+ },
35
+ budget: { triangles: [40000, 12000, 800] },
36
+ build(ctx) {
37
+ const seg = [24, 12, 6][ctx.lod] ?? 6;
38
+ ctx.part('hull', prism({ plane: 'xz', depth: 3.0, profile: [/* side profile from the drawing */], color: paint }));
39
+ if (ctx.lod === 0) {
40
+ const bolt = lathe({ profile: [[0.02, 0], [0.02, 0.01], [0, 0.015]], segments: 6, color: paint });
41
+ ctx.part('bolts', merge(Array.from({ length: 24 }, (_, i) => place(bolt, { at: [i * 0.2, 1.5, 1.2] }))));
42
+ }
43
+ },
44
+ });
45
+ ```
46
+
47
+ ## Loop
48
+ | Step | Command | Exit criterion |
49
+ |---|---|---|
50
+ | 1 research | WebSearch + WebFetch: the spec table (manufacturer sheet, museum page, roster, drawing) and real photos per view (side elevation, front, 3/4, top, close-ups of signature details) → `recipes/<name>/README.md` (template: `recipes/README.md`). Link photos, never commit them (licences); Wikimedia Commons is the best first stop. Invented assets (sci-fi, fantasy) get a design dossier instead: scale references from real things, shape language, palette | dossier: every number sourced, one variant chosen, photos linked per view |
51
+ | 2 masses | `bun run t3d build recipes/x/x.ts --out out` | QA PASS: proportions ±5%, measures ±2%, every part's surface touches what holds it, no moving part clashes |
52
+ | 3 look | `bun run t3d shot recipes/x/x.ts --out renders` → Read the sheet PNG; `bun run t3d hero recipes/x/x.ts --out renders` → Read the beauty render | silhouette right in all six views; reads as the real thing in the 3/4 beauty shot |
53
+ | 4 detail | LOD0 dense, LOD1 lean, LOD2 silhouette. Hard surface: `box({ bevel: ctx.pick([0.02, 0.01, 0]) })` + `weightedNormals` (the mid-poly trick); walls: `tiled` / `mass` / `opening` (true-scale masonry, recessed windows); trusses: `lattice`; organic: `sculpt` | budgets met, QA PASS |
54
+ | 5 grime | `grime(mesh, { ground: 1, zones })`; `bakeAo` for crevices | darker near ground / exhausts / creases |
55
+ | 6 review | `bun run t3d review recipes/x/x.ts --out review` → Read `review/*.png`, follow `review/review.md`, clear `review.json` warnings (LOD popping, exposure, tiny-in-frame) | no warnings you can't explain |
56
+ | 7 iterate | repeat 3–6 | a stranger names it from the 3/4 view |
57
+ | 8 publish | `bun run shots <name>` → commit `recipes/<name>/out/` | the recipes gate checks the committed outputs match the recipe |
58
+
59
+ ## Contact sheet layout
60
+ Row 1: 3/4 FRONT · FRONT +X · SIDE -Y. Row 2: TOP · 3/4 REAR · FAR LOD2. Header: name, overall
61
+ dimensions, grid step, LOD. Grid = ground plane, step chosen from the asset size.
62
+
63
+ ## QA gates (all must pass at every LOD)
64
+ | Gate | Fails when | Fix |
65
+ |---|---|---|
66
+ | triangle-budget | LOD over `budget` | drop detail at that LOD |
67
+ | floating-parts | a part's SURFACE is > 2 cm from anything grounded | the support must exist at that LOD too |
68
+ | clashes | anything cuts > 1 cm into a moving part's swept volume | running clearance; `clearOf` only for real interlocks |
69
+ | proportions | overall box off `real` by > 5% | rescale from sources |
70
+ | measures | a spec dimension off by > 2% | rebuild the part — never edit the spec |
71
+ | part-names | not snake_case | rename |
72
+ | check | one of the recipe's own `checks` fails | fix the geometry the check names |
73
+
74
+ ## State your physical intent in code
75
+ Gates can't know that tracks must clear the hull or that wheels interleave without touching —
76
+ the recipe says so, and QA enforces it at every LOD:
77
+
78
+ ```ts
79
+ checks: [
80
+ clear('track_*', 'hull_*'), // no sinking into closed solids (+ optional min gap, m)
81
+ noOverlap('road_wheel_l_*'), // siblings never interpenetrate
82
+ touches('turret_body', 'hull_top'),// seated within 2 cm
83
+ symmetric('_l', '_r', 'y'), // left mirrors right
84
+ ],
85
+ ```
86
+
87
+ Debug with `inspect(compile(asset))` in a scratch script: `distance(a, b)`, `penetration(a, b)`,
88
+ `bounds(glob)`, `parts(glob)` — find the exact offender, fix the cause, never loosen the selector.
89
+
90
+ ## Conventions
91
+ Metres, Z up, +X = front. Named parts are the engine contract. `ctx.rng` only. One asset per
92
+ folder: `recipes/<name>/<name>.ts` + `README.md` + committed `out/`.
93
+ Detail is built once in local space and `place`d N times — never hand-copied coordinates.
package/CHANGELOG.md ADDED
@@ -0,0 +1,90 @@
1
+ # Changelog
2
+
3
+ All notable changes to `@developerz.ai/ts23d`. Format: [Keep a Changelog](https://keepachangelog.com/en/1.1.0/). Versioning: [SemVer](https://semver.org/); in 0.x a minor bump may break. `bun run release <x.y.z>` turns `[Unreleased]` into the dated version section ([PUBLISHING.md](PUBLISHING.md)).
4
+
5
+ ## [Unreleased]
6
+
7
+ ## [0.2.0] - 2026-11-07
8
+
9
+ ### Added
10
+ - Package published as `@developerz.ai/ts23d` (the npm organisation's scope).
11
+ - Material library v2: 16 new PBR strips on a 2048² trim sheet (oak, pine, weathered and painted wood; rusty, cast, painted and galvanised iron/steel; brass, copper, aluminium, chrome; rubber, canvas, leather, plastic) with their own roughness and metalness. `defineMaterial()` registers project materials; opt-in CC0 photo strips (Poly Haven) via `bun run textures` — sha256-pinned, offline compile, credited in the GLB. The beauty renderer reflects metals. `t3d` paints the sheet at 2048² by default.
12
+ - Orc and goblin busts re-sculpted (anatomy, faces, mouths, gear, collectible plinth, painted tone pass); `head` gains `bust.mass`, `wrinkles`, `'vest'` bust style.
13
+ - Boxcar reads as painted planks, weathered roof walk, cast and rusty iron.
14
+ - Gallery: per-category studio lighting, PBR Neutral tone mapping, contact shadows, GTAO + MSAA on a high-quality tier with a phone fallback.
15
+ - Research docs: sculpting, material authoring, Blender bridge design, pro asset pipeline and CC0 libraries.
16
+ - One GLB with all three LODs: `t3d build` also writes `<out>/<asset>/<asset>.glb` — LOD0 in the scene, LOD1/LOD2 as `MSFT_lod` alternates outside it (listed in `extensionsUsed`, never required, so viewers without the extension show LOD0 only), `MSFT_screencoverage` view-distance hints, one shared material/texture set, motion channels on every LOD. `--lods split|single|both` (default `both`); the manifest records `files.single` and `lodCoverage`. API: `toLodGlb` / `exportLodGlb`; recipes may set `lodCoverage: [lod0→1, lod1→2, cull]`, otherwise it is derived from triangle density and size. tiger_1: one 7.07 MB file vs 7.09 MB for three split files (shared sheet); with `--sheet embed`, 10.7 MB vs 17.9 MB.
17
+
18
+ ## [0.1.0] - 2026-11-07
19
+
20
+ ### Added
21
+ - Primitives: `tiled` (true-scale strip tiling, V banded to the strip's real height), `cell` (decal quad with `inset` reveals or raised plaques), `lattice` (Warren / Pratt / Howe / X trusses, square or angle-iron members, planar or box, tapered), `box({ bevel })` (one-segment chamfer for the mid-poly hard-surface look; `bevel: 0` is byte-identical to before).
22
+ - Lettering: `text` sets name boards, wagon lettering, hull markings and signs as geometry from a built-in 5×7 font (Latin, digits, punctuation, Cyrillic; `block` weight), flush or raised, aligned, fitted to `maxWidth`, and kept on top of stepped surfaces with `surface(u, v)`; `measureText` gives the width. `lathe({ uv: 'metres' })` maps the strip at true scale; `lathe({ faceted: true })` makes flat-shaded n-sided solids.
23
+ - Sculpt edits may be groups (`{ group, op, blend, color }`: a subtract inside a group trims only that group); `sculpt({ mirror: 'y' })` / `sdf({ symmetry: 'y' })` give exactly mirror-symmetric meshes; evaluation skips edits whose bounds cannot affect a point (2.4× faster, bit-identical). `bakeAo` reuses its ray grid and walks it allocation-free: 3–4× faster, byte-identical (tiger_1 LOD0 7.2 s → 2.4 s).
24
+ - Organic modelling: `sdf` (surface nets by default, marching cubes on request, gradient normals, sparse evaluation), `sd.*` combinators (sphere, ellipsoid, box, capsule, cone, torus, union, smooth union / subtract, displace), seeded `valueNoise`, and `sculpt` — a Dreams-style ordered edit list (add / subtract / intersect / paint, smooth blends, per-edit colour, `mirror: 'y'`).
25
+ - Characters: `head` kind — a parametric stylised head and bust sculpted from SDF edits, with race presets (`HEADS`: orc, goblin, human, dwarf, elf), a separately pivoted `jaw` (optional sway), aimable `eye_l` / `eye_r`, baked vertex AO, and `headParams` / `headEdits` / `checkHead` for custom races.
26
+ - Terrain: seeded `gradientNoise2` / `valueNoise2`, `fbm`, `billow`, `ridged` (Musgrave), `warp` (domain warping), `terrace`; `terrainGrid`, `sampler`, `slopeMap`; `hydraulicErosion` (droplet erosion with flow and deposit maps; 100k droplets on 257² in ≈0.4 s) and `thermalErosion` (talus); `terrainColor` (forest / grass / scree / rock / snow by altitude, slope and flow); `heightfield({ skirt })` closes a tile into a solid.
27
+ - Kinds: `roof` / `roofMesh` (gable, hip, pyramid, mansard, gambrel, shed; slab, soffit, fascia, ridge and hip caps, gable infill, chimneys; LOD-gated), `opening` window/door kit and `facade({ kit })`, `mass` (true-scale masonry block), `hull` / `hullMesh` / `hullLines` (lofted vessel hull: sheer, stem, round or transom stern, bulwarks, plank deck, waterline and boot-top bands, fenders).
28
+ - Passes: `optimize` (weld, degenerate and duplicate triangle removal, Forsyth vertex-cache order, vertex-fetch order; reports ACMR / ATVR) — on by default in GLB export (tiger_1 LOD0: 254k → 95k vertices, ACMR 2.88 → 1.16, 15.4 → 6.3 MB); `weightedNormals` (face-area × angle weighted, hard-edge split); `bakeAo` / `bakeAoAsset` (deterministic per-vertex ambient occlusion in vertex colour).
29
+ - Export: `exportGlb` returns the bytes plus an optimiser report; `KHR_lights_punctual` from light sockets; emissive glow materials (`KHR_materials_emissive_strength`) from `glow` rules; `KHR_xmp_json_ld` provenance (title, creators, licence, sources) and `asset.copyright`; `asset.generator` names the package version. The glTF-Validator test now demands zero warnings, not just zero errors.
30
+ - Motion: `oneWay: true` on `slide` / `sway` moves from rest to the peak and back (a sliding door, a signal arm dropping) instead of to both sides; the `clashes` gate sweeps a `sway` through its real sector (5° bins) instead of a full revolution, and a one-way slide only along its stroke.
31
+ - Asset definition: `license`, `copyright`, `creators` and `glow` fields; `description` and `sources` travel into the GLB.
32
+ - QA: gates `non-finite`, `vertex-colors`, `hidden-parts`, `normals-winding` (default), `degenerate-triangles`, `z-fighting` (opt-in); cross-LOD gates `lod-triangles` (default, run by the recipes gate), `lod-silhouette`, `lod-pivots` (opt-in).
33
+ - Render: `beauty` / `t3d hero` — a zero-GPU product shot (perspective, trim-sheet textures, sun with soft shadows, sky fill, AO, 2× supersampling, ground contact shadow; tiger_1 at 1600×900 in ≈2.8 s, byte-deterministic). `t3d build` writes `hero.png` too.
34
+ - AI visual QA: `t3d review` writes a review pack — hero, contact sheet, close-ups, an LOD0/1/2 strip, `review.md` (a checklist prompt for a vision agent, pointing at the recipe's dossier) and `review.json` (silhouette coverage, LOD popping IoU per view, exposure, crushed blacks; warnings past thresholds). `maskIoU` is the silhouette core `photoMatch` will use.
35
+ - Site: presentation-first gallery — a live orbiting showcase above the fold, category filters, cards from the committed hero renders (WebP), asset pages with a Studio / Scene viewer, LOD switch, wireframe, part outlines on hover, measures with Δ%, dossier links and GLB downloads; `bun run site:shots` regenerates `docs/media/*.png` with headless Chrome.
36
+ - Recipes are folders: `recipes/<name>/<name>.ts` + `README.md` (the sourced dossier) + committed `out/<asset>/{hero.png, sheet.png, manifest.json}`, refreshed by `bun run shots`; the recipes gate fails on a missing dossier, a stray file or stale outputs.
37
+ - Gallery: `station_halt` (GWR Toddington), `water_tower` (Frisco Beaumont tank), `boxcar` + `boxcar_nw` (USRA single-sheathed), `signal_gantry` + `signal_gantry_4`, `dropship`, `cargo_container_scifi` (ISO 668), `asteroid` ×3, `mountain_range` ×3 (eroded alpine tiles), `boulders`, `orc_head`, `goblin_head`, `human_head`.
38
+ - `@developerz.ai/ts23d/testing`: `assertQaPass`, `assertBudget`, `assertParts`, `assertMeasure`, `assertMotionClear`, `assertDeterministic`, `snapshotHash` — framework-agnostic helpers for your own recipe tests.
39
+ - Docs: [glTF capability map](docs/architecture/gltf-capabilities.md) — every ratified extension, skins and morph targets, physics drafts, what ts23d writes and what is next.
40
+ - `AGENTS.md` is now a link to `CLAUDE.md`: one brain for every coding agent; `CLAUDE.md` gained the "using the library" loop.
41
+
42
+ ### Fixed
43
+ - `applyAffine` / `place` / `frame` with a mirror (negative determinant) left triangles wound inside-out; they are flipped back now (tiger_1's mirrored spare track links).
44
+ - `lathe` smoothed normals across sharp profile folds (the T-34 idler's lip shaded dark); a `creaseDeg` option (default 50°) splits them. Profiles without a fold keep identical bytes.
45
+ - `heightfield` V wrapped per vertex, stretching texture across any triangle that crossed the wrap; it mirrors continuously now.
46
+ - `lathe` / `cylinder` on axis `x` or `y` were wound inside-out (a mirrored frame): every wheel and gun barrel rendered hollow in engines that cull back faces.
47
+ - `SolidIndex` cell size scales with the mesh: the Eiffel tower's 28 solids index in 228 ms (was 4.2 s), which speeds up `clashes` too.
48
+
49
+ ### Added (0.0.x scaffold)
50
+ - Programmatic builds without the CLI documented in the README, with a runnable `examples/build-with-bun.ts` that CI executes.
51
+ - CLI `--lods <list>`: build only the detail levels you need (`--lods 0` for the hero mesh alone); QA, GLBs and `manifest.json` cover exactly those. Every output is opt-in or opt-out: `--sheet none|external|embed`, `--no-animations`, `--no-shot`.
52
+ - Asset DSL: `defineAsset` (with `real` dimensions + `sources`), `compile`, `ctx.part` / `ctx.group` / `ctx.use`, LODs by re-running the recipe.
53
+ - Core: Mesh IR, `MeshBuilder`, seeded forkable RNG, vector math, mesh transforms (`place`, `affine`, `frame`, `applyAffine`), `Ts23dError` with code + cause + fix.
54
+ - Grammar: CGA-style split grammar, Whyte notation.
55
+ - Material: shared trim-sheet layout, era/region palettes, `hex()`.
56
+ - Primitives: `box`, `lathe`, `cylinder`, `prism`, `beam`, `planar`, `triangulate`.
57
+ - Kinds: `facade`, `setbacks`, `axle`, `trackRun`, `whyteAxles`, `propeller`.
58
+ - Passes: `grime`.
59
+ - QA gates: `triangle-budget`, `floating-parts` (true surface contact), `clashes` (moving parts swept through their motion; `clearOf` for intended interlocks), `part-names`, `proportions`, `measures` (`real.measures` spec-sheet dimensions).
60
+ - Export: zero-dependency GLB writer, one material, baked `run` loop; `mergeToPivots` batches static geometry into its nearest pivot by default (`toGlb(asset, { keepParts: true })` opts out).
61
+ - Render: zero-GPU contact sheet (six orthographic views, metre grid).
62
+ - CLI: `t3d build | shot | list` with `--out` and `--json`.
63
+ - Materials: `paintTrimSheet(recipe = DEFAULT_SHEET)` paints albedo / normal / ORM (RGBA8; 1024² ≈ 0.8 s). Strips bond, planks, plates, noise, flat, slate, concrete, glass; 6 decal cells, 11 foliage cells (coloured, alpha leaf mask). `toGlb(a, { sheet })` embeds or `{ sheet: { external: true, prefix } }` references shared PNGs; `TANGENT` only with a sheet.
64
+ - Shader sources: `threeMaterialSource(hints)` (TSL) and `godotShaderSource(hints)` (.gdshader): wind, window glow, wear.
65
+ - CLI: `--sheet external|embed|none` (default external: `out/trim_sheet_{albedo,normal,orm}.png` once, GLBs reference `../trim_sheet_*.png`), `--sheet-size 512|1024|2048`.
66
+ - Primitives: `sweep` (parallel-transport frames, taper, twist), `loft` over `rings` + `ringXY` with wobble; `beam` gains `up` and `caps`.
67
+ - Vegetation: Weber–Penn `tree` kind, presets oak / pine / palm / birch / willow, `trees` family, `treeReal`.
68
+ - Recipes: `tiger_1`, `t34` + `t34_1941`, `loco_440` (4-4-0 Jupiter), `eiffel_tower`, `oak`, `pine`, `palm`, `material_swatches`. Asset gallery site.
69
+ - README benchmarks block filled by `bun run bench --write`.
70
+ - Declared, not built (throw `T3D_NOT_IMPLEMENTED`): `creature`, `localGenerator`, `importGlb`, `kubeezImages`.
71
+ - `defineFamily`: one typed build, many variants (`variant`), derived families (`extend`).
72
+ - `ctx.emitter`: smoke / steam / dust / muzzle / fire / sparks sources as named nodes with `extras.ts23d.emitter`.
73
+ - `sway` motion (`axis`, `degrees`, `hz`); the `clashes` gate sweeps it as a full revolution.
74
+ - `heightfield` primitive for terrain and dioramas.
75
+ - glTF-Validator (Khronos) runs in the test suite on every exported shape: 0 errors required.
76
+ - Recipe checks: `checks: Check[]` on `defineAsset`; builders `clear`, `noOverlap`, `touches`, `symmetric` in `/qa`; gate `check` at every LOD.
77
+ - `inspect(compiled)`: `parts`, `mesh`, `bounds`, `distance`, `penetration` by glob, plus `glob()` and `insideSolid()`, for debugging scripts.
78
+ - `ctx.socket`: seat / mount / camera / audio / attach / spawn / interact / light points as named nodes with `extras.ts23d.socket`.
79
+ - Surfaces: `surface: 'opaque' | 'cutout' | 'glass' | 'translucent'` per part; at most 4 shared materials (glass and translucent via `KHR_materials_transmission`, `_volume`, `_ior`); batching splits per pivot and surface.
80
+
81
+ ### Changed
82
+ - Bun 1.4.4 is the floor (`.bun-version`, `engines.bun`).
83
+ - The site is an asset gallery only; the play mode was removed. ts23d produces assets for your engine and ships no engine or game code.
84
+ - `merge` preallocates its buffers. `symmetric` matches side tokens as whole name segments. `touches` skips LODs where either part is absent. The boundaries guard skips tests and `src/types`.
85
+ - **Breaking:** exported GLBs now face glTF +Z. Root rotation is `[-0.5, -0.5, -0.5, 0.5]` (authoring +X front → glTF +Z, +Z up → +Y). GLBs placed by hand before this face 90° off; rotate them −90° about Y ([ADR 009](docs/decisions/009-gltf-front-axis.md)).
86
+ - Seamless loops: the `run` clip is 4 s, every motion rounded to whole cycles, spins ≥ 12 keys per turn. A static `rest` clip comes first so viewers open paused.
87
+ - Smaller GLBs, core glTF only: u16 indices when ≤ 65,535 vertices; `COLOR_0` as normalised u16 RGBA; shared animation time accessors. tiger_1 LOD0: 13.0 MB → 11.0 MB.
88
+ - QA is much faster: indexed point-in-solid with short-circuited majority rays, cached world meshes and samples, a numeric triangle grid with per-triangle AABB rejection, incremental distance radius. tiger_1 LOD0 QA: minutes → 1.35 s.
89
+ - Animations: `toGlb()` exports none unless `{ animations: true }` (glTF has no autoplay flag; engines drive named pivots from code). `t3d build` bakes the `run` clip by default so viewers show play controls; `--no-animations` skips it.
90
+ - CLI output is one folder per asset: `out/<asset>/{lod0,lod1,lod2}.glb`, `sheet.png`, `manifest.json`, plus `out/index.json`. `t3d build` renders the sheet too (`--no-shot` to skip); `t3d shot` writes sheet + manifest only.
package/CLAUDE.md ADDED
@@ -0,0 +1,85 @@
1
+ # CLAUDE.md
2
+
3
+ `AGENTS.md` links here: one brain for Claude Code, Codex, Cursor and the rest, in this repo or in a
4
+ project that installed the package.
5
+
6
+ ## Rules first
7
+ - **Generate assets, not engines.** Output ends at GLB + textures + manifest for Unity, Unreal, Godot, three.js, Babylon or any glTF reader. No game, engine or runtime code here; the site is an asset gallery, never a game.
8
+ - **Code, not data.** Recipes are TypeScript (`recipes/<name>/<name>.ts`), never JSON: loops, functions, `ctx.use` composition.
9
+ - **Deterministic or broken.** Same source + seed = same bytes. `ctx.rng` only; `bun run determinism` refuses the rest.
10
+ - **Real units and references.** Metres, Z up, +X front. Vehicles/buildings declare `real` + `sources` + spec `measures`; gates: `proportions` ±5%, `measures` ±2%. Parts touch their supports (`floating-parts`); moving parts clear everything (`clashes`).
11
+ - **LOD-gate, never decimate.** Recipes read `ctx.lod` and choose what to emit.
12
+ - **One material.** Shared trim sheet, vertex colour, one draw call per asset.
13
+ - **See the result.** Every asset has a contact sheet and a beauty render (`hero.png`); every error has a code and `fix:`.
14
+ - **Enforce rules.** A rule without a script in `bun run verify` is a suggestion.
15
+
16
+ ## Project and stack
17
+ `@developerz.ai/ts23d`: free, coding-agent-driven 3D asset generator. Deterministic game-ready GLB: named pivoted parts, baked motion, 3 LODs from one source, shared trim-sheet material, build-failing QA and zero-GPU six-view contact sheets the agent reads.
18
+
19
+ | Area | Stack / constraint |
20
+ |---|---|
21
+ | Library | TypeScript; Bun only (pin: `.bun-version`); zero runtime dependencies |
22
+ | Gallery | Vite + three.js; site may depend on three/vite; compiles recipes in-browser |
23
+ | Status | 0.x; anything unbuilt throws `T3D_NOT_IMPLEMENTED` on purpose; `docs/plans/roadmap.md` owns delivery |
24
+
25
+ ## Non-negotiables
26
+ - **No `any`, non-null `!` or default exports; `import type` for types.** Biome fails the build.
27
+ - **No bare `Error` in `src/`.** Use `Ts23dError(code, { cause, fix })`; shipped `T3D_*` codes stay stable.
28
+ - **SRP.** One file, one job; target < 200 LOC, ceiling 300 (`bun run filesize`); header comment states the job.
29
+ - **Tests beside source, failure case first.** A test that can't fail isn't one.
30
+ - **Planned ≠ shipped.** Label stubs as planned; `notImplemented()` names the plan.
31
+ - **Neutral positioning.** Never claim to beat Meshy/Tripo/etc.; we're the free, code-based option.
32
+
33
+ ## Commands (repo root)
34
+ | Task | Command |
35
+ |---|---|
36
+ | Fresh clone → ready | `bun run setup` |
37
+ | Gate (≡ CI) | `bun run verify` · one step: `bun run verify --only <step>` · `--json` |
38
+ | Compile + QA recipe | `bun run t3d build recipes/t34/t34.ts --out out` (lod0/1/2.glb + one `<asset>.glb` with all LODs via MSFT_lod; `--lods split\|single\|both`) |
39
+ | Contact sheet (READ the PNG) | `bun run t3d shot recipes/t34/t34.ts --out renders` |
40
+ | Beauty render (3/4, textured, shadowed) | `bun run t3d hero recipes/t34/t34.ts --out renders` |
41
+ | AI review pack (READ `review/*.png`, follow `review.md`) | `bun run t3d review recipes/t34/t34.ts --out review` |
42
+ | Refresh committed `recipes/*/out/` | `bun run shots [name…]` (the recipes gate fails on stale outputs) |
43
+ | One test file | `bun test src/primitives/prism.test.ts` |
44
+ | Lint fix | `bun run lint:fix` |
45
+ | Gallery | `bun run site:dev` · `bun run site:build` |
46
+ | Release | `bun run release <x.y.z>` → PR `chore: release x.y.z` → merge; see `PUBLISHING.md` |
47
+
48
+ Gate order (`STEPS` in `scripts/verify.ts`): lint · typecheck · boundaries · determinism · filesize · test · recipes · build.
49
+
50
+ ## Layout
51
+ | Path | Responsibility |
52
+ |---|---|
53
+ | `src/<module>/` | Library; one responsibility per module, tiered below |
54
+ | `src/index.ts` | Public barrel; subpaths `@developerz.ai/ts23d/<module>` |
55
+ | `recipes/<name>/` | One folder per asset: `<name>.ts` · `README.md` (sourced specs + photo links, written first) · `out/<asset>/` (committed hero.png, sheet.png, manifest.json); CI-gated |
56
+ | `apps/site/` | GitHub Pages asset gallery |
57
+ | `scripts/` | Gate/guards, release/build/setup; tested Bun TypeScript |
58
+ | `docs/` | `idea/` (what+why), `decisions/` (ADRs), `architecture/`, `plans/roadmap.md` |
59
+ | `.claude/` · `.dz/` | Repo agents/commands/skills · developerz.ai bot policy |
60
+
61
+ ## Module tiers — imports only go DOWN
62
+ | Tier | Modules |
63
+ |---|---|
64
+ | 0 | `core` (IR, asset DSL, transforms, rng, errors) |
65
+ | 1 | `grammar` (split, Whyte) · `material` (trim sheet, palettes, generator) |
66
+ | 2 | `primitives` · `passes` · `neural` (optional AI adapters) |
67
+ | 3 | `kinds` · `qa` · `export` · `render` |
68
+ | 4 | `cli` · `testing` (assertions for users' recipe tests) |
69
+
70
+ Cross-module imports use `../<module>/index.ts` only. `bun run boundaries` enforces this; `scripts/lib/tiers.ts` is the executable tier table.
71
+
72
+ ## Recipe loop
73
+ Human names a thing → research specs + real photos into `recipes/<name>/README.md` → `real` + `sources` + `measures` → masses → `t3d build` until QA PASS → `t3d shot` + `t3d hero` → **Read the PNGs** → `t3d review` → LOD-gated detail (build once, `place` N times, `merge`) → `grime` → iterate → `bun run shots <name>`. Full skill: `.claude/skills/author-recipe/SKILL.md`. Quality: competes with real game assets up close; a few hundred triangles at LOD2.
74
+
75
+ ## Coordination and CI
76
+ - **Finish the job:** fix, test, document, run the gate. Decide and state decisions rather than asking what code/docs answer. Ask only before irreversible/outward-facing acts.
77
+ - **Hive** (big tasks: `/feature`): one checkout, never git worktrees; only the top-level agent spawns; exclusive file sets, no git for agents; max 4 parallel; coordinator runs the full gate once at the end.
78
+ - **CI:** free GitHub runners, < 5 min. `ci.yml`: `verify` (= `bun run verify`) + `shots` (contact-sheet artifact per PR). `pages.yml`: gallery to developerz-ai.github.io/ts23d. `release-tag.yml` + `release.yml`: release PR merge → tag → npm via OIDC (no tokens). Every action SHA-pinned; Dependabot moves pins.
79
+
80
+ ## Using the library in another project
81
+ `bun add @developerz.ai/ts23d`, write `assets/<name>.ts` exporting `defineAsset({...})`, then
82
+ `bunx t3d build assets/<name>.ts --out out` (GLB × 3 LODs + QA, exit 1 on a finding) and
83
+ `bunx t3d shot` / `hero` / `review` to look. Fix what QA prints (every finding has a `fix:`) and what
84
+ you see. No CLI needed: the same steps are functions (`compile`, `runQa`, `toGlb`, `contactSheet`,
85
+ `beauty`), see `examples/build-with-bun.ts`; test helpers in `@developerz.ai/ts23d/testing`.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 developerz.ai
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.