create-threenative 0.2.15 → 0.2.18

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 (488) hide show
  1. package/agent-docs/kit-mcp.md +10 -0
  2. package/agent-docs/kit-router.md +14 -0
  3. package/agent-docs/kit-stuck.md +7 -0
  4. package/agent-docs/references/assertion-reference.md +54 -110
  5. package/agent-docs/references/capability-reference.md +1740 -254
  6. package/agent-docs/references/conventions.md +299 -0
  7. package/agent-docs/references/kit-action-rpg.md +40 -0
  8. package/agent-docs/references/kit-adventure.md +40 -0
  9. package/agent-docs/references/kit-collectathon.md +38 -0
  10. package/agent-docs/references/kit-kart.md +31 -0
  11. package/agent-docs/references/kit-minimal.md +29 -0
  12. package/agent-docs/references/kit-platformer.md +34 -0
  13. package/agent-docs/references/kit-puzzle.md +22 -0
  14. package/agent-docs/references/kit-racing.md +26 -0
  15. package/agent-docs/references/kit-rain.md +31 -0
  16. package/agent-docs/references/kit-rts.md +34 -0
  17. package/agent-docs/references/kit-runner.md +32 -0
  18. package/agent-docs/references/kit-sailing.md +41 -0
  19. package/agent-docs/references/kit-shooter.md +33 -0
  20. package/agent-docs/references/kit-snow.md +33 -0
  21. package/agent-docs/references/kit-starter.md +55 -0
  22. package/agent-docs/references/kit-tower-defense.md +27 -0
  23. package/agent-docs/references/performance-basics.md +8 -4
  24. package/agent-docs/references/terrain-authoring.md +2 -1
  25. package/agent-files/.agents/skills/ponytail/SKILL.md +1 -1
  26. package/agent-files/.agents/skills/prd-creator/SKILL.md +3 -2
  27. package/agent-files/.agents/skills/threenative-capabilities/SKILL.md +84 -59
  28. package/agent-files/.claude/hooks/discovery-gate.mjs +125 -0
  29. package/agent-files/.claude/hooks/ponytail-context.mjs +1 -1
  30. package/agent-files/.claude/settings.json +25 -0
  31. package/agent-files/.codex/hooks.json +18 -1
  32. package/dist/index.d.ts +97 -6
  33. package/dist/index.js +899 -271
  34. package/dist/terrain-kit.d.ts +7 -0
  35. package/dist/terrain-kit.js +82 -0
  36. package/dist/threenative.js +114 -16
  37. package/dist/web-engine-ccd-ik-solver.js +127 -0
  38. package/dist/web-engine-gltf-loader.js +71 -20
  39. package/dist/web-engine-post-effects.js +39 -14
  40. package/dist/web-engine-runtime.js +10011 -4101
  41. package/package.json +15 -9
  42. package/template-assets/clearwater/README.md +1 -1
  43. package/template-assets/patches/manifest.json +18 -0
  44. package/template-assets/patches/three@0.187.0.patch +2004 -407
  45. package/template-assets/terrain/alpine/assets.json +12 -0
  46. package/template-assets/terrain/alpine/bake.mjs +6 -0
  47. package/template-assets/terrain/alpine/credits.json +164 -0
  48. package/template-assets/terrain/alpine/heightmap.r16 +0 -0
  49. package/template-assets/terrain/alpine/recipe.json +119 -0
  50. package/template-assets/terrain/alpine/surface.json +53 -0
  51. package/template-assets/terrain/coastal/assets.json +11 -0
  52. package/template-assets/terrain/coastal/bake.mjs +6 -0
  53. package/template-assets/terrain/coastal/credits.json +117 -0
  54. package/template-assets/terrain/coastal/heightmap.r16 +0 -0
  55. package/template-assets/terrain/coastal/recipe.json +113 -0
  56. package/template-assets/terrain/coastal/surface.json +41 -0
  57. package/template-assets/terrain/desert/assets.json +12 -0
  58. package/template-assets/terrain/desert/bake.mjs +6 -0
  59. package/template-assets/terrain/desert/credits.json +164 -0
  60. package/template-assets/terrain/desert/heightmap.r16 +0 -0
  61. package/template-assets/terrain/desert/recipe.json +108 -0
  62. package/template-assets/terrain/desert/surface.json +54 -0
  63. package/template-assets/terrain/forest/assets.json +65 -0
  64. package/template-assets/terrain/forest/bake.mjs +8 -0
  65. package/template-assets/terrain/forest/credits.json +225 -0
  66. package/template-assets/terrain/forest/heightmap.r16 +0 -0
  67. package/template-assets/terrain/forest/recipe.json +350 -0
  68. package/template-assets/terrain/forest/surface.json +79 -0
  69. package/template-assets/terrain/tundra/assets.json +12 -0
  70. package/template-assets/terrain/tundra/bake.mjs +6 -0
  71. package/template-assets/terrain/tundra/credits.json +164 -0
  72. package/template-assets/terrain/tundra/heightmap.r16 +0 -0
  73. package/template-assets/terrain/tundra/recipe.json +277 -0
  74. package/template-assets/terrain/tundra/surface.json +54 -0
  75. package/templates/action-rpg/AGENTS.md +103 -84
  76. package/templates/action-rpg/CLAUDE.md +103 -84
  77. package/templates/action-rpg/kit.json +1 -0
  78. package/templates/action-rpg/package.json +7 -7
  79. package/templates/action-rpg/playtests/spells.playtest.json +20 -0
  80. package/templates/action-rpg/src/game.ts +2 -1
  81. package/templates/action-rpg/src/render/atmosphere.ts +11 -16
  82. package/templates/action-rpg/src/render/backlightControls.ts +10 -0
  83. package/templates/action-rpg/src/render/backlightMaterial.ts +4 -4
  84. package/templates/action-rpg/src/render/clouds.ts +13 -0
  85. package/templates/action-rpg/src/render/gpuSky.ts +4 -7
  86. package/templates/action-rpg/src/render/materialLighting.ts +5 -5
  87. package/templates/action-rpg/src/render/quality.ts +10 -33
  88. package/templates/action-rpg/src/scenes/Play.ts +30 -1
  89. package/templates/action-rpg/src/style.css +4 -0
  90. package/templates/action-rpg/src/ui/AbilityBar.tsx +1 -1
  91. package/templates/action-rpg/threenative.config.ts +0 -3
  92. package/templates/action-rpg/vite.config.ts +2 -0
  93. package/templates/adventure/AGENTS.md +92 -44
  94. package/templates/adventure/CLAUDE.md +92 -44
  95. package/templates/adventure/kit.json +5 -1
  96. package/templates/adventure/package.json +7 -7
  97. package/templates/adventure/src/game.ts +1 -1
  98. package/templates/adventure/src/style.css +4 -0
  99. package/templates/adventure/tsconfig.json +1 -1
  100. package/templates/adventure/vite.config.ts +2 -0
  101. package/templates/collectathon/AGENTS.md +93 -42
  102. package/templates/collectathon/CLAUDE.md +93 -42
  103. package/templates/collectathon/package.json +7 -7
  104. package/templates/collectathon/src/game.ts +1 -1
  105. package/templates/collectathon/src/level/Course.ts +55 -9
  106. package/templates/collectathon/src/level/terrain.ts +27 -6
  107. package/templates/collectathon/src/main.ts +1 -0
  108. package/templates/collectathon/src/render/foliage.ts +359 -98
  109. package/templates/collectathon/src/render/sky.ts +76 -12
  110. package/templates/collectathon/src/render/water.ts +32 -10
  111. package/templates/collectathon/src/scenes/Play.ts +18 -5
  112. package/templates/collectathon/src/style.css +4 -0
  113. package/templates/collectathon/tsconfig.json +1 -1
  114. package/templates/collectathon/vite.config.ts +2 -0
  115. package/templates/kart/AGENTS.md +87 -42
  116. package/templates/kart/CLAUDE.md +87 -42
  117. package/templates/kart/package.json +6 -6
  118. package/templates/kart/src/game.ts +1 -1
  119. package/templates/kart/src/main.ts +1 -0
  120. package/templates/kart/src/style.css +4 -0
  121. package/templates/kart/tsconfig.json +1 -1
  122. package/templates/kart/vite.config.ts +2 -0
  123. package/templates/minimal/AGENTS.md +105 -84
  124. package/templates/minimal/CLAUDE.md +105 -84
  125. package/templates/minimal/package.json +6 -6
  126. package/templates/minimal/playtests/stands-still.playtest.json +30 -0
  127. package/templates/minimal/src/game.ts +1 -1
  128. package/templates/minimal/src/render/atmosphere.ts +11 -16
  129. package/templates/minimal/src/render/backlightControls.ts +10 -0
  130. package/templates/minimal/src/render/backlightMaterial.ts +4 -4
  131. package/templates/minimal/src/render/camera.ts +13 -2
  132. package/templates/minimal/src/render/clouds.ts +13 -0
  133. package/templates/minimal/src/render/gpuSky.ts +4 -7
  134. package/templates/minimal/src/render/lighting.ts +4 -2
  135. package/templates/minimal/src/render/materialLighting.ts +5 -5
  136. package/templates/minimal/src/render/materials.ts +10 -0
  137. package/templates/minimal/src/render/quality.ts +7 -32
  138. package/templates/minimal/src/scenes/Play.ts +4 -1
  139. package/templates/minimal/vite.config.ts +7 -1
  140. package/templates/platformer/AGENTS.md +95 -46
  141. package/templates/platformer/CLAUDE.md +95 -46
  142. package/templates/platformer/index.html +1 -1
  143. package/templates/platformer/main.html +12 -0
  144. package/templates/platformer/package.json +7 -7
  145. package/templates/platformer/playtests/gamepad-idle.playtest.json +21 -0
  146. package/templates/platformer/playtests/gamepad.playtest.json +30 -0
  147. package/templates/platformer/src/entities/Fox.ts +21 -6
  148. package/templates/platformer/src/game.ts +1 -1
  149. package/templates/platformer/src/main.ts +1 -0
  150. package/templates/platformer/src/render/backlightControls.ts +10 -0
  151. package/templates/platformer/src/render/backlightMaterial.ts +4 -4
  152. package/templates/platformer/src/render/materialLighting.ts +5 -5
  153. package/templates/platformer/src/render/quality.ts +7 -32
  154. package/templates/platformer/src/scenes/Play.ts +2 -1
  155. package/templates/platformer/src/style.css +4 -0
  156. package/templates/platformer/src/worker-page.ts +29 -0
  157. package/templates/platformer/src/worker.ts +5 -0
  158. package/templates/platformer/tsconfig.json +1 -1
  159. package/templates/platformer/vite.config.ts +4 -0
  160. package/templates/puzzle/AGENTS.md +97 -80
  161. package/templates/puzzle/CLAUDE.md +97 -80
  162. package/templates/puzzle/package.json +7 -7
  163. package/templates/puzzle/src/game.ts +1 -1
  164. package/templates/puzzle/src/render/backlightControls.ts +10 -0
  165. package/templates/puzzle/src/render/backlightMaterial.ts +4 -4
  166. package/templates/puzzle/src/render/materialLighting.ts +5 -5
  167. package/templates/puzzle/src/render/quality.ts +7 -32
  168. package/templates/puzzle/src/scenes/Play.ts +1 -1
  169. package/templates/puzzle/src/style.css +4 -0
  170. package/templates/puzzle/tsconfig.json +1 -1
  171. package/templates/puzzle/vite.config.ts +2 -0
  172. package/templates/racing/AGENTS.md +100 -82
  173. package/templates/racing/CLAUDE.md +100 -82
  174. package/templates/racing/package.json +7 -7
  175. package/templates/racing/src/game.ts +1 -1
  176. package/templates/racing/src/render/atmosphere.ts +11 -16
  177. package/templates/racing/src/render/backlightControls.ts +10 -0
  178. package/templates/racing/src/render/backlightMaterial.ts +4 -4
  179. package/templates/racing/src/render/clouds.ts +13 -0
  180. package/templates/racing/src/render/gpuSky.ts +4 -7
  181. package/templates/racing/src/render/materialLighting.ts +5 -5
  182. package/templates/racing/src/render/quality.ts +7 -32
  183. package/templates/racing/src/scenes/Race.ts +4 -1
  184. package/templates/racing/src/style.css +4 -0
  185. package/templates/racing/tsconfig.json +1 -1
  186. package/templates/racing/vite.config.ts +2 -0
  187. package/templates/rain/AGENTS.md +96 -84
  188. package/templates/rain/CLAUDE.md +96 -84
  189. package/templates/rain/native-playtests/lightning.playtest.json +85 -10
  190. package/templates/rain/package.json +6 -6
  191. package/templates/rain/playtests/reduced-motion.playtest.json +6 -0
  192. package/templates/rain/src/game.ts +1 -1
  193. package/templates/rain/src/scenes/Boot.ts +1 -0
  194. package/templates/rain/src/state.ts +7 -0
  195. package/templates/rain/src/ui/GameUi.tsx +7 -1
  196. package/templates/rain/vite.config.ts +6 -0
  197. package/templates/rts/AGENTS.md +100 -85
  198. package/templates/rts/CLAUDE.md +100 -85
  199. package/templates/rts/package.json +6 -6
  200. package/templates/rts/src/game.ts +1 -1
  201. package/templates/rts/src/render/backlightControls.ts +10 -0
  202. package/templates/rts/src/render/backlightMaterial.ts +4 -4
  203. package/templates/rts/src/render/materialLighting.ts +5 -5
  204. package/templates/rts/src/render/quality.ts +7 -31
  205. package/templates/rts/src/scenes/Play.ts +1 -1
  206. package/templates/rts/src/style.css +4 -0
  207. package/templates/rts/vite.config.ts +2 -0
  208. package/templates/runner/AGENTS.md +97 -80
  209. package/templates/runner/CLAUDE.md +97 -80
  210. package/templates/runner/package.json +7 -7
  211. package/templates/runner/playtests/performance.playtest.json +1 -1
  212. package/templates/runner/src/game.ts +1 -1
  213. package/templates/runner/src/render/atmosphere.ts +11 -16
  214. package/templates/runner/src/render/backlightControls.ts +10 -0
  215. package/templates/runner/src/render/backlightMaterial.ts +4 -4
  216. package/templates/runner/src/render/clouds.ts +13 -0
  217. package/templates/runner/src/render/gpuSky.ts +4 -7
  218. package/templates/runner/src/render/lighting.ts +53 -11
  219. package/templates/runner/src/render/materialLighting.ts +5 -5
  220. package/templates/runner/src/render/quality.ts +7 -32
  221. package/templates/runner/src/scenes/Run.ts +8 -4
  222. package/templates/runner/src/style.css +4 -0
  223. package/templates/runner/threenative.config.ts +0 -3
  224. package/templates/runner/tsconfig.json +1 -1
  225. package/templates/runner/vite.config.ts +2 -0
  226. package/templates/sailing/AGENTS.md +96 -79
  227. package/templates/sailing/CLAUDE.md +96 -79
  228. package/templates/sailing/package.json +7 -7
  229. package/templates/sailing/playtests/sails.playtest.json +1 -0
  230. package/templates/sailing/src/game.ts +1 -1
  231. package/templates/sailing/src/render/backlightControls.ts +10 -0
  232. package/templates/sailing/src/render/backlightMaterial.ts +4 -4
  233. package/templates/sailing/src/render/environmentSetup.ts +1 -1
  234. package/templates/sailing/src/render/materialLighting.ts +5 -5
  235. package/templates/sailing/src/render/quality.ts +7 -32
  236. package/templates/sailing/src/render/sky.ts +4 -0
  237. package/templates/sailing/src/style.css +5 -0
  238. package/templates/sailing/threenative.config.ts +0 -3
  239. package/templates/sailing/vite.config.ts +6 -0
  240. package/templates/shooter/AGENTS.md +97 -68
  241. package/templates/shooter/CLAUDE.md +97 -68
  242. package/templates/shooter/package.json +7 -7
  243. package/templates/shooter/src/game.ts +3 -2
  244. package/templates/shooter/src/render/atmosphere.ts +11 -16
  245. package/templates/shooter/src/render/backlightControls.ts +10 -0
  246. package/templates/shooter/src/render/backlightMaterial.ts +4 -4
  247. package/templates/shooter/src/render/clouds.ts +13 -0
  248. package/templates/shooter/src/render/gpuSky.ts +4 -7
  249. package/templates/shooter/src/render/materialLighting.ts +5 -5
  250. package/templates/shooter/src/render/quality.ts +10 -33
  251. package/templates/shooter/src/scenes/Play.ts +4 -1
  252. package/templates/shooter/src/style.css +4 -0
  253. package/templates/shooter/vite.config.ts +2 -0
  254. package/templates/snow/AGENTS.md +95 -76
  255. package/templates/snow/CLAUDE.md +95 -76
  256. package/templates/snow/package.json +7 -7
  257. package/templates/snow/src/game.ts +1 -1
  258. package/templates/snow/src/render/backlightControls.ts +10 -0
  259. package/templates/snow/src/render/backlightMaterial.ts +4 -4
  260. package/templates/snow/src/render/materialLighting.ts +5 -5
  261. package/templates/snow/src/render/quality.ts +7 -32
  262. package/templates/snow/src/style.css +5 -0
  263. package/templates/snow/threenative.config.ts +0 -3
  264. package/templates/snow/vite.config.ts +6 -0
  265. package/templates/starter/AGENTS.md +109 -88
  266. package/templates/starter/CLAUDE.md +109 -88
  267. package/templates/starter/native-playtests/render-chain.playtest.json +24 -24
  268. package/templates/starter/native-playtests/smooth-motion.playtest.json +3 -3
  269. package/templates/starter/package.json +7 -7
  270. package/templates/starter/src/entities/Crate.ts +5 -2
  271. package/templates/starter/src/entities/Player.ts +10 -22
  272. package/templates/starter/src/game.ts +4 -3
  273. package/templates/starter/src/render/adaptiveQuality.ts +17 -0
  274. package/templates/starter/src/render/atmosphere.ts +11 -16
  275. package/templates/starter/src/render/backlightControls.ts +10 -0
  276. package/templates/starter/src/render/backlightMaterial.ts +4 -4
  277. package/templates/starter/src/render/clouds.ts +13 -0
  278. package/templates/starter/src/render/contactShadow.ts +1 -1
  279. package/templates/starter/src/render/gpuSky.ts +4 -7
  280. package/templates/starter/src/render/lighting.ts +54 -4
  281. package/templates/starter/src/render/materialLighting.ts +5 -5
  282. package/templates/starter/src/render/postprocessing.ts +11 -10
  283. package/templates/starter/src/render/quality.ts +14 -1
  284. package/templates/starter/src/render/temporalAA.ts +8 -7
  285. package/templates/starter/src/render/temporalAAFrame.ts +30 -9
  286. package/templates/starter/src/render/temporalAAResolve.ts +15 -1
  287. package/templates/starter/src/render/temporalClampRelease.ts +183 -0
  288. package/templates/starter/src/render/temporalHistoryResolve.ts +90 -0
  289. package/templates/starter/src/render/temporalMoire.ts +190 -0
  290. package/templates/starter/src/render/temporalResolve.ts +75 -16
  291. package/templates/starter/src/render/temporalResolveDepth.ts +2 -0
  292. package/templates/starter/src/scenes/Play.ts +53 -32
  293. package/templates/starter/src/state.ts +2 -0
  294. package/templates/starter/src/style.css +4 -0
  295. package/templates/starter/src/ui/Menu.tsx +5 -1
  296. package/templates/starter/vite.config.ts +2 -0
  297. package/templates/tower-defense/AGENTS.md +97 -81
  298. package/templates/tower-defense/CLAUDE.md +97 -81
  299. package/templates/tower-defense/package.json +7 -7
  300. package/templates/tower-defense/src/game.ts +1 -1
  301. package/templates/tower-defense/src/render/backlightControls.ts +10 -0
  302. package/templates/tower-defense/src/render/backlightMaterial.ts +4 -4
  303. package/templates/tower-defense/src/render/materialLighting.ts +5 -5
  304. package/templates/tower-defense/src/render/quality.ts +7 -32
  305. package/templates/tower-defense/src/scenes/Battle.ts +1 -1
  306. package/templates/tower-defense/src/style.css +4 -0
  307. package/templates/tower-defense/tsconfig.json +1 -1
  308. package/templates/tower-defense/vite.config.ts +2 -0
  309. package/capabilities.json +0 -9197
  310. package/templates/AGENTS.md +0 -21
  311. package/templates/CLAUDE.md +0 -23
  312. package/templates/action-rpg/.codex/config.toml +0 -23
  313. package/templates/action-rpg/.cursor/mcp.json +0 -38
  314. package/templates/action-rpg/.gemini/settings.json +0 -38
  315. package/templates/action-rpg/.mcp.json +0 -38
  316. package/templates/action-rpg/.vscode/mcp.json +0 -43
  317. package/templates/action-rpg/.zed/settings.json +0 -43
  318. package/templates/action-rpg/opencode.json +0 -49
  319. package/templates/action-rpg/src/render/environmentContribution.ts +0 -188
  320. package/templates/action-rpg/src/render/environmentRadiance.ts +0 -36
  321. package/templates/action-rpg/src/render/environmentSampleCache.ts +0 -43
  322. package/templates/action-rpg/src/render/environmentSampling.ts +0 -193
  323. package/templates/action-rpg/src/render/environmentSnapshot.ts +0 -53
  324. package/templates/adventure/.codex/config.toml +0 -23
  325. package/templates/adventure/.cursor/mcp.json +0 -38
  326. package/templates/adventure/.gemini/settings.json +0 -38
  327. package/templates/adventure/.mcp.json +0 -38
  328. package/templates/adventure/.vscode/mcp.json +0 -43
  329. package/templates/adventure/.zed/settings.json +0 -43
  330. package/templates/adventure/opencode.json +0 -49
  331. package/templates/collectathon/.codex/config.toml +0 -23
  332. package/templates/collectathon/.cursor/mcp.json +0 -38
  333. package/templates/collectathon/.gemini/settings.json +0 -38
  334. package/templates/collectathon/.mcp.json +0 -38
  335. package/templates/collectathon/.vscode/mcp.json +0 -43
  336. package/templates/collectathon/.zed/settings.json +0 -43
  337. package/templates/collectathon/opencode.json +0 -49
  338. package/templates/kart/.codex/config.toml +0 -23
  339. package/templates/kart/.cursor/mcp.json +0 -38
  340. package/templates/kart/.gemini/settings.json +0 -38
  341. package/templates/kart/.mcp.json +0 -38
  342. package/templates/kart/.vscode/mcp.json +0 -43
  343. package/templates/kart/.zed/settings.json +0 -43
  344. package/templates/kart/opencode.json +0 -49
  345. package/templates/minimal/.codex/config.toml +0 -23
  346. package/templates/minimal/.cursor/mcp.json +0 -38
  347. package/templates/minimal/.gemini/settings.json +0 -38
  348. package/templates/minimal/.mcp.json +0 -38
  349. package/templates/minimal/.vscode/mcp.json +0 -43
  350. package/templates/minimal/.zed/settings.json +0 -43
  351. package/templates/minimal/opencode.json +0 -49
  352. package/templates/minimal/src/render/environmentContribution.ts +0 -188
  353. package/templates/minimal/src/render/environmentRadiance.ts +0 -36
  354. package/templates/minimal/src/render/environmentSampleCache.ts +0 -43
  355. package/templates/minimal/src/render/environmentSampling.ts +0 -193
  356. package/templates/minimal/src/render/environmentSnapshot.ts +0 -53
  357. package/templates/platformer/.codex/config.toml +0 -23
  358. package/templates/platformer/.cursor/mcp.json +0 -38
  359. package/templates/platformer/.gemini/settings.json +0 -38
  360. package/templates/platformer/.mcp.json +0 -38
  361. package/templates/platformer/.vscode/mcp.json +0 -43
  362. package/templates/platformer/.zed/settings.json +0 -43
  363. package/templates/platformer/opencode.json +0 -49
  364. package/templates/platformer/src/render/environmentContribution.ts +0 -188
  365. package/templates/platformer/src/render/environmentRadiance.ts +0 -36
  366. package/templates/platformer/src/render/environmentSampleCache.ts +0 -43
  367. package/templates/platformer/src/render/environmentSampling.ts +0 -193
  368. package/templates/platformer/src/render/environmentSnapshot.ts +0 -53
  369. package/templates/puzzle/.codex/config.toml +0 -23
  370. package/templates/puzzle/.cursor/mcp.json +0 -38
  371. package/templates/puzzle/.gemini/settings.json +0 -38
  372. package/templates/puzzle/.mcp.json +0 -38
  373. package/templates/puzzle/.vscode/mcp.json +0 -43
  374. package/templates/puzzle/.zed/settings.json +0 -43
  375. package/templates/puzzle/opencode.json +0 -49
  376. package/templates/puzzle/src/render/environmentContribution.ts +0 -188
  377. package/templates/puzzle/src/render/environmentRadiance.ts +0 -36
  378. package/templates/puzzle/src/render/environmentSampleCache.ts +0 -43
  379. package/templates/puzzle/src/render/environmentSampling.ts +0 -193
  380. package/templates/puzzle/src/render/environmentSnapshot.ts +0 -53
  381. package/templates/racing/.codex/config.toml +0 -23
  382. package/templates/racing/.cursor/mcp.json +0 -38
  383. package/templates/racing/.gemini/settings.json +0 -38
  384. package/templates/racing/.mcp.json +0 -38
  385. package/templates/racing/.vscode/mcp.json +0 -43
  386. package/templates/racing/.zed/settings.json +0 -43
  387. package/templates/racing/opencode.json +0 -49
  388. package/templates/racing/src/render/environmentContribution.ts +0 -188
  389. package/templates/racing/src/render/environmentRadiance.ts +0 -36
  390. package/templates/racing/src/render/environmentSampleCache.ts +0 -43
  391. package/templates/racing/src/render/environmentSampling.ts +0 -193
  392. package/templates/racing/src/render/environmentSnapshot.ts +0 -53
  393. package/templates/rain/.codex/config.toml +0 -23
  394. package/templates/rain/.cursor/mcp.json +0 -38
  395. package/templates/rain/.gemini/settings.json +0 -38
  396. package/templates/rain/.mcp.json +0 -38
  397. package/templates/rain/.vscode/mcp.json +0 -43
  398. package/templates/rain/.zed/settings.json +0 -43
  399. package/templates/rain/opencode.json +0 -49
  400. package/templates/rts/.codex/config.toml +0 -23
  401. package/templates/rts/.cursor/mcp.json +0 -38
  402. package/templates/rts/.gemini/settings.json +0 -38
  403. package/templates/rts/.mcp.json +0 -38
  404. package/templates/rts/.vscode/mcp.json +0 -43
  405. package/templates/rts/.zed/settings.json +0 -43
  406. package/templates/rts/opencode.json +0 -49
  407. package/templates/rts/src/render/environmentContribution.ts +0 -188
  408. package/templates/rts/src/render/environmentRadiance.ts +0 -36
  409. package/templates/rts/src/render/environmentSampleCache.ts +0 -43
  410. package/templates/rts/src/render/environmentSampling.ts +0 -193
  411. package/templates/rts/src/render/environmentSnapshot.ts +0 -53
  412. package/templates/runner/.codex/config.toml +0 -23
  413. package/templates/runner/.cursor/mcp.json +0 -38
  414. package/templates/runner/.gemini/settings.json +0 -38
  415. package/templates/runner/.mcp.json +0 -38
  416. package/templates/runner/.vscode/mcp.json +0 -43
  417. package/templates/runner/.zed/settings.json +0 -43
  418. package/templates/runner/README.md +0 -43
  419. package/templates/runner/opencode.json +0 -49
  420. package/templates/runner/src/render/environmentContribution.ts +0 -188
  421. package/templates/runner/src/render/environmentRadiance.ts +0 -36
  422. package/templates/runner/src/render/environmentSampleCache.ts +0 -43
  423. package/templates/runner/src/render/environmentSampling.ts +0 -193
  424. package/templates/runner/src/render/environmentSnapshot.ts +0 -53
  425. package/templates/sailing/.codex/config.toml +0 -23
  426. package/templates/sailing/.cursor/mcp.json +0 -38
  427. package/templates/sailing/.gemini/settings.json +0 -38
  428. package/templates/sailing/.mcp.json +0 -38
  429. package/templates/sailing/.vscode/mcp.json +0 -43
  430. package/templates/sailing/.zed/settings.json +0 -43
  431. package/templates/sailing/README.md +0 -28
  432. package/templates/sailing/opencode.json +0 -49
  433. package/templates/sailing/src/render/environmentContribution.ts +0 -188
  434. package/templates/sailing/src/render/environmentRadiance.ts +0 -36
  435. package/templates/sailing/src/render/environmentSampleCache.ts +0 -43
  436. package/templates/sailing/src/render/environmentSampling.ts +0 -193
  437. package/templates/sailing/src/render/environmentSnapshot.ts +0 -53
  438. package/templates/shooter/.codex/config.toml +0 -23
  439. package/templates/shooter/.cursor/mcp.json +0 -38
  440. package/templates/shooter/.gemini/settings.json +0 -38
  441. package/templates/shooter/.mcp.json +0 -38
  442. package/templates/shooter/.vscode/mcp.json +0 -43
  443. package/templates/shooter/.zed/settings.json +0 -43
  444. package/templates/shooter/opencode.json +0 -49
  445. package/templates/shooter/src/render/environmentContribution.ts +0 -188
  446. package/templates/shooter/src/render/environmentRadiance.ts +0 -36
  447. package/templates/shooter/src/render/environmentSampleCache.ts +0 -43
  448. package/templates/shooter/src/render/environmentSampling.ts +0 -193
  449. package/templates/shooter/src/render/environmentSnapshot.ts +0 -53
  450. package/templates/snow/.codex/config.toml +0 -23
  451. package/templates/snow/.cursor/mcp.json +0 -38
  452. package/templates/snow/.gemini/settings.json +0 -38
  453. package/templates/snow/.mcp.json +0 -38
  454. package/templates/snow/.vscode/mcp.json +0 -43
  455. package/templates/snow/.zed/settings.json +0 -43
  456. package/templates/snow/README.md +0 -26
  457. package/templates/snow/opencode.json +0 -49
  458. package/templates/snow/src/render/environmentContribution.ts +0 -188
  459. package/templates/snow/src/render/environmentRadiance.ts +0 -36
  460. package/templates/snow/src/render/environmentSampleCache.ts +0 -43
  461. package/templates/snow/src/render/environmentSampling.ts +0 -193
  462. package/templates/snow/src/render/environmentSnapshot.ts +0 -53
  463. package/templates/starter/.codex/config.toml +0 -23
  464. package/templates/starter/.cursor/mcp.json +0 -38
  465. package/templates/starter/.gemini/settings.json +0 -38
  466. package/templates/starter/.mcp.json +0 -38
  467. package/templates/starter/.vscode/mcp.json +0 -43
  468. package/templates/starter/.zed/settings.json +0 -43
  469. package/templates/starter/opencode.json +0 -49
  470. package/templates/starter/src/render/environmentContribution.ts +0 -188
  471. package/templates/starter/src/render/environmentRadiance.ts +0 -36
  472. package/templates/starter/src/render/environmentSampleCache.ts +0 -43
  473. package/templates/starter/src/render/environmentSampling.ts +0 -193
  474. package/templates/starter/src/render/environmentSnapshot.ts +0 -53
  475. package/templates/starter/src/render/rendererGate.ts +0 -36
  476. package/templates/tower-defense/.codex/config.toml +0 -23
  477. package/templates/tower-defense/.cursor/mcp.json +0 -38
  478. package/templates/tower-defense/.gemini/settings.json +0 -38
  479. package/templates/tower-defense/.mcp.json +0 -38
  480. package/templates/tower-defense/.vscode/mcp.json +0 -43
  481. package/templates/tower-defense/.zed/settings.json +0 -43
  482. package/templates/tower-defense/README.md +0 -16
  483. package/templates/tower-defense/opencode.json +0 -49
  484. package/templates/tower-defense/src/render/environmentContribution.ts +0 -188
  485. package/templates/tower-defense/src/render/environmentRadiance.ts +0 -36
  486. package/templates/tower-defense/src/render/environmentSampleCache.ts +0 -43
  487. package/templates/tower-defense/src/render/environmentSampling.ts +0 -193
  488. package/templates/tower-defense/src/render/environmentSnapshot.ts +0 -53
@@ -7,6 +7,8 @@ import {
7
7
  isMobile,
8
8
  isTouchscreenAvailable,
9
9
  } from "@threenative/core";
10
+ import { type IEnvironmentSample, sampleEnvironment } from "@threenative/core/render/environment";
11
+ import { CastPool, SpellWorld, createFireball } from "@threenative/core/spells";
10
12
  import { CollisionShape3D, type IPhysicsContext, buildStaticColliders } from "@threenative/physics";
11
13
  import { type PerspectiveCamera, type Texture, Vector3 } from "three";
12
14
  import { Ability } from "../abilities/Ability.js";
@@ -18,8 +20,8 @@ import { describeDrops, rollDrops } from "../loot/drops.js";
18
20
  import { emitPlaytestEvent } from "../playtest-events.js";
19
21
  import { loadProgress, saveProgress } from "../progress.js";
20
22
  import { createDungeonCamera } from "../render/camera.js";
23
+ import { cloudTextures, primeCloudTextures } from "../render/clouds.js";
21
24
  import { createDungeon, isSolid } from "../render/dungeon.js";
22
- import { type IEnvironmentSample, sampleEnvironment } from "../render/environmentSampling.js";
23
25
  import { setupLighting } from "../render/lighting.js";
24
26
  import { createLoadingScreen } from "../render/loading.js";
25
27
  import { createMaterialLighting } from "../render/materialLighting.js";
@@ -110,6 +112,8 @@ export class Play extends Scene<GameState, IPhysicsContext> {
110
112
  // Only the photo-sky override reads the photograph; the atmosphere sky is computed.
111
113
  SKY_OPTIONS.sky === "photo" ? ctx.assets.texture("sky.jpg") : undefined,
112
114
  ]);
115
+ // The cloud noise is the same every run of this build: generate it once, then read it back.
116
+ primeCloudTextures(await ctx.assets.memo("clouds", () => cloudTextures()));
113
117
  setupSky(ctx.scene, this.#sky, ctx.renderer.softwareAdapter !== undefined);
114
118
  this.#environmentSample = await sampleEnvironment(ctx.renderer.raw, ctx.scene, {
115
119
  web: getPlatform().runtime === "web",
@@ -225,6 +229,21 @@ export class Play extends Scene<GameState, IPhysicsContext> {
225
229
  const attackVfx = emitter(createAttackArc());
226
230
  const hitVfx = emitter(createHitBurst());
227
231
  const surgeVfx = emitter(createArcaneSurge());
232
+
233
+ // One spell slot, wired the way the kit's AGENTS.md tells a game to wire one. The world owns the
234
+ // pooled lights, the floor marks and the shake; damage stays here, in `strike`.
235
+ const spellWorld = new SpellWorld({
236
+ add: (object) => void ctx.add(object),
237
+ camera: ctx.camera,
238
+ castSlots: 8,
239
+ groundAt: () => 0,
240
+ scene: ctx.scene,
241
+ });
242
+ const casts = new CastPool(spellWorld);
243
+ const fireball = createFireball(spellWorld);
244
+ const spellTarget = new Vector3();
245
+ const spellObservations = { casts: 0 };
246
+ ctx.entities.add("spell", spellObservations);
228
247
  // A burst is a request: the engine gives it its own slots, so an older burst keeps flying where it began.
229
248
  const burst = (
230
249
  vfx: ReturnType<typeof emitter>,
@@ -519,6 +538,14 @@ export class Play extends Scene<GameState, IPhysicsContext> {
519
538
  if (frameCtx.input.justPressed("ability") || touch?.abilityPressed === true) ability.cast();
520
539
  if (frameCtx.input.justPressed("dodge") && player.dodge())
521
540
  emitPlaytestEvent({ entity: "player", name: "dodged" });
541
+ if (frameCtx.input.justPressed("spell")) {
542
+ player.mesh.getWorldDirection(spellTarget);
543
+ spellTarget.multiplyScalar(7).add(player.mesh.position).setY(0.9);
544
+ spellWorld.focus.copy(player.mesh.position).setY(1.4);
545
+ casts.cast(fireball, spellTarget);
546
+ spellObservations.casts += 1;
547
+ emitPlaytestEvent({ entity: "player", name: "vfx-spell" });
548
+ }
522
549
  }
523
550
  if (frameCtx.input.justPressed("equip")) {
524
551
  if (inventory.equip("ember-blade")) {
@@ -541,6 +568,8 @@ export class Play extends Scene<GameState, IPhysicsContext> {
541
568
 
542
569
  player.update(frameCtx, dt, touch);
543
570
  ability.update(dt);
571
+ casts.update(dt);
572
+ spellWorld.update(dt);
544
573
  // Enemies act only once first-use compilation has settled. They damage the player, and the
545
574
  // combat scenario asserts an exact health at a labelled step — so stepping them during the
546
575
  // launch makes that number a function of how long the launch took. Measured as 90 on a
@@ -2,6 +2,10 @@
2
2
 
3
3
  @source "../index.html";
4
4
  @source "./";
5
+ /* `src/render/` is shader and material source: a word in its comments ("blur", "filter",
6
+ "table") became a real utility rule, which is what made a clean HUD look like a native-css
7
+ profile failure. Tailwind scans what it is told to scan. */
8
+ @source not "./render";
5
9
 
6
10
  /* The same roles as `src/render/palette.ts`, in the two places the UI can reach: the HUD is a
7
11
  web view, so it cannot import a Three.js palette. Keep the two lists in step when you repaint. */
@@ -25,7 +25,7 @@ export function AbilityBar() {
25
25
  />
26
26
  </div>
27
27
  <div className="mt-2 text-dim">
28
- Shift roll · E cast · Q equip · U unequip · C save · uses {uses}
28
+ Shift roll · E surge · G fireball · Q equip · U unequip · C save · uses {uses}
29
29
  </div>
30
30
  </footer>
31
31
  );
@@ -1,9 +1,6 @@
1
1
  import type { IThreeNativeConfig } from "@threenative/core";
2
2
 
3
3
  const config: IThreeNativeConfig = {
4
- // Pinned to the legacy engine: the native engine does not bind three/tsl deltaTime yet (PRD-573 slice 8).
5
- // Delete this line when `pnpm build --target desktop` passes without it, and the game runs on the native engine.
6
- engine: "threejs",
7
4
  app: {
8
5
  id: "com.threenative.__PROJECT_ID__",
9
6
  name: "__PROJECT_NAME__",
@@ -2,6 +2,7 @@ import tailwindcss from "@tailwindcss/vite";
2
2
  import { watchAssets } from "@threenative/assets";
3
3
  import react from "@vitejs/plugin-react";
4
4
  import {
5
+ createEngineCatalogPlugin,
5
6
  createEngineFreshnessPlugin,
6
7
  createWebBrandPlugin,
7
8
  webRuntimeDecoders,
@@ -36,6 +37,7 @@ export default defineConfig({
36
37
  plugins: [
37
38
  createEngineFreshnessPlugin(),
38
39
  createWebBrandPlugin(),
40
+ createEngineCatalogPlugin(),
39
41
  react(),
40
42
  tailwindcss(),
41
43
  assetsWatchPlugin(),
@@ -1,60 +1,108 @@
1
- # AGENTS.md — __PROJECT_NAME__ adventure
1
+ <!-- shared: kit-identity -->
2
+ # AGENTS.md — __PROJECT_NAME__ (Lantern Vale, the adventure kit)
2
3
 
3
- Lantern Vale: Wren, a lantern-bearer, takes the Ember Blade from a chest in a walled clearing, then clears the Moss Hollow — a three-room dungeon with a push-block puzzle, a small key, a locked door and the Stone Warden, a boss that is only hurt while dazed. Mosslings hop and bite, Flicker bats circle and swoop, and Thornbacks show a thorned plate that only a cut from behind gets round. Lock-on targeting, a sword slash, a shield, a roll, half-hearts and a heart vessel. Every model is procedural, with no mesh file; five shared tiling photos (`src/render/surface.ts`, licences in `assets/tex-PROVENANCE.md`) give the floor, stone, bark and planks their grain, so a wooden, stone or bark mesh takes `surfaced(color, surface)`, not plain `lit()` (`survives` fails on one: `untexturedSurfaces`); Wren's idle, walk and run are `AnimationClip`s built in code. Instructions for the AI agent in this game; `CLAUDE.md` mirrors this file.
4
+ Wren crosses a sunlit clearing and a three-room moss dungeon with lock-on sword combat, a shield, a block-and-switch puzzle, a small key and the Stone Warden mini-boss. Routing words: adventure, zelda, ocarina, action-adventure. `CLAUDE.md` is a copy of this file.
5
+ <!-- /shared -->
4
6
 
5
- ## Ownership
7
+ <!-- shared: kit-router -->
8
+ ## Authoring flow
6
9
 
7
- ThreeNative owns bootstrap, renderer, fixed-step loop, input, loading, physics bindings, the state bridge and the default look. This repository owns the clearing and the dungeon, Wren's feel, the lock-on, the hostiles, the puzzle, the HUD and every model; `src/game.ts` is portable and React mounts from `src/main.ts`. The render camera also skips an object that projects under **0.5 px** in it; `renderer.minimumProjectedPixels` raises that threshold (`false` disables the cut, not the count) and `alwaysRender(object)` exempts an object, while camera-attached objects and shadow casters are kept. The engine also owns the per-frame world-matrix walk, and by default it does not descend into a hidden subtree — so a game that reads a hidden object's `matrixWorld` directly must use `getWorldPosition` (or call `object.updateWorldMatrix(true, false)`) first; `renderer.matrixWorld: "all"` restores three's every-node walk, and `TN_PROJECTION` reports the visited-node count either way. Physics bodies and `ctx.camera` interpolate between fixed ticks by default; `physicsInterpolation: false` disables it globally, `body.interpolate = false` disables one body, `ctx.interpolate(object)` opts in another transform, and `ctx.resetInterpolation(object)` resets game-driven teleports (`TN_PHYSICS_INTERPOLATION` reports the setting and tracked count).
10
+ Detail for each step: `threenative-capabilities` skill. Do the steps in order. A step with no result records `none: <reason>`. A blank step blocks the next. A hook blocks the first new file under `src/` until step 3 ran for the current prompt (`TN_DISCOVERY_GATE=off` opts out; Codex needs `/hooks` trust).
8
11
 
9
- ## Start every change
12
+ 1. **Kit** (new game only): `engine_search_capabilities {situation: "<the whole request>", scope: "request"}` returns the matching starter kit first. This folder is already a kit.
13
+ 2. **Mechanics**: per mechanic, `engine_search_references {situation}`, then `engine_reference_detail` on each hit for pinned constants and feel. To see a mechanic move, `engine_watch_reference {query: "<game> <mechanic>"}` returns a contact sheet of real gameplay. Borrow mechanics only: no code, level layouts, character names or art. Cite `file:line`.
14
+ 3. **Built-ins**: per mechanic, system or symptom, `engine_search_capabilities {situation, scope: "mechanic"}`; rows answer; `engine_capability_detail` only for omitted symbols. Constraints are binding. `verdict: "none"` means the game writes it in `src/`.
15
+ 4. **Plan** (new game, or a change to several systems): `prd-creator` with the kit, references and built-ins. With a user, wait for explicit approval, then implement. With no user (`claude -p`, a script), record the plan and assumptions, then continue.
16
+ 5. **Assets**: `asset_search_sources`, the source's search tool, then `asset_download_file`; record source and licence in `CREDITS.md`. Nothing fits: `sculpt_plan`. A rigged GLB: `animation_inspect` (`threenative-assets` skill).
17
+ 6. **Build**: gameplay in `src/`, look in `src/render/` (`threenative-context` and `threenative-ui` skills). For parallel work, give each subagent one area and its files, then integrate.
18
+ 7. **Prove**: one fail-closed playtest per mechanic, then `pnpm test` (`threenative-playtest` skill). A fresh judge compares a `--browser-recipe webgpu --headed` capture to the reference image (`threenative-visuals` skill; `node_modules/create-threenative/agent-docs/references/dream-loop.md`).
19
+ 8. **Report**: the `pnpm dev` URL, `TN_FRAME_BUDGET`, `TN_SCENE_WARNING`, `TN_RENDER_PROJECTION`, and each skipped step with its reason.
10
20
 
11
- 1. **Critical authoring gate:** invoke `threenative-capabilities` to choose the route. New games: steps 1-8. Existing games: steps 5-7 only, using existing context. Follow the `ponytail` ladder. References borrow mechanics only: no code, level layouts, character names or art. A session started outside this folder has no `mcp__threenative-*` tools: call them with `node node_modules/@threenative/core/mcp/call.mjs <server> <tool> '<json>'`.
12
- 2. **New game only:** run discovery in `threenative-capabilities` before `prd-creator`. Draft the core-mechanics plan from the kit, both discovery passes and binding constraints, direct the user to review it, and wait for explicit approval plus an instruction to implement it.
13
- 3. Treat returned constraints as binding. `@threenative/physics/navigation` is Recast WASM that Android and iOS refuse, so this kit does not import it: a Mossling steers with a ray to Wren and slides along the wall that ray hits (`src/entities/Mossling.ts`). Keep new hostiles on direct physics queries (`intersectRay`, `intersectShape`, `Area3D`).
14
- 4. If a build, import, device, or blank frame fails, run `npx threenative doctor` and `npx @threenative/playtest doctor`; missing observations are not zero. For *"a bullet passes through a wall"*, `RigidBody3D` defaults to continuous collision; `continuousCollision` is the named per-body override, and `body.continuousCollision` reports the effective setting on web/native.
21
+ A change to an existing game repeats steps 2-3 for that change, then steps 5-8.
22
+ <!-- /shared -->
15
23
 
16
- ## When the framework blocks you, write plain Three.js
17
-
18
- When an `@threenative/*` API is broken, missing, or does not do what you need, replace only that piece with portable Three.js/plain code. Keep the loop, scenes, input, registry, and playtest bridge; avoid DOM globals, dynamic `import()`, and raw physics handles. **Report what blocked you** (API, expectation, result, replacement); never stall the game.
19
-
20
- ## Workflow skills
21
- - `.agents/skills/prd-creator/SKILL.md` / `.claude/skills/prd-creator/SKILL.md` — game plan and approval gate.
22
- - `.agents/skills/threenative-capabilities/SKILL.md` / `.claude/skills/threenative-capabilities/SKILL.md` — capability search and classic-game mechanics references.
23
- - `.agents/skills/threenative-playtest/SKILL.md` / `.claude/skills/threenative-playtest/SKILL.md` — diagnosis and proof.
24
- - `.agents/skills/threenative-assets/SKILL.md` / `.claude/skills/threenative-assets/SKILL.md` — assets and sculpting.
25
- - `.agents/skills/threenative-visuals/SKILL.md` / `.claude/skills/threenative-visuals/SKILL.md` — captures and look.
26
- - `.agents/skills/threenative-performance/SKILL.md` / `.claude/skills/threenative-performance/SKILL.md` — measured budgets; read it first when the game is slow or stutters: `playtest trace`, then the `threenative-devtools` MCP server.
27
- - `.agents/skills/threenative-ui/SKILL.md` / `.claude/skills/threenative-ui/SKILL.md` — native-safe UI. `.agents/skills/threenative-context/SKILL.md` / `.claude/skills/threenative-context/SKILL.md` — portable ctx APIs.
28
- - Confirmed framework bugs: use `file-engine-bug` in `.agents/skills/` or `.claude/skills/` after a minimal repro. A game-side `patches/` fix is temporary: once it is settled, it moves into the engine in one PR. Lazy-first: `.agents/skills/ponytail/SKILL.md` / `.claude/skills/ponytail/SKILL.md` — smallest correct change, and its reuse rung is the capability search above. Engine: The owned C++ engine is the default for a new game: the Wasm engine on web and the engine player on desktop. This template runs on it: `threenative.config.ts` names no `engine`. `engine: "threejs"` switches to upstream Three.js only when the user asks for it; it is never a fix for a build error. Android and iOS use the legacy host.
29
-
30
- ## Commands and map
31
-
32
- ```sh
33
- pnpm dev
34
- pnpm build
35
- pnpm build --target desktop
36
- pnpm test # runs `pnpm check` first: typecheck, ESLint, Biome format
37
- pnpm typecheck
38
- ```
24
+ <!-- shared: kit-mcp -->
25
+ ## MCP servers
39
26
 
40
- Status: the web target is proven by `pnpm test`, which runs every `playtests/*.playtest.json` in a WebGPU browser. Desktop is claimed only where `native-playtests/survives.playtest.json` ran with `--target desktop`; Android and iOS have not been run for this kit.
27
+ `.mcp.json` wires six servers, and a session started in this folder loads them. Their tools can show as deferred: load them with `ToolSearch` `select:` plus the exact names, for example `select:mcp__threenative-engine__engine_search_capabilities,mcp__threenative-engine__engine_capability_detail,mcp__threenative-engine__engine_search_references,mcp__threenative-engine__engine_reference_detail,mcp__threenative-engine__engine_watch_reference`. A session started outside this folder runs `node node_modules/@threenative/core/mcp/call.mjs <server> <tool> '<json>'`; `call.mjs <server>` lists that server's tools.
41
28
 
42
- `src/entities/Hero.ts` owns Wren — `ADVENTURE_FEEL` is the one table of feel constants, and `playtests/move.playtest.json` proves run speed, stop time and turn time against it. `LockOn.ts` picks and holds a target, `Mossling.ts`, `Flicker.ts`, `Thornback.ts`, `Warden.ts` and `Dummy.ts` are the targets (each hostile telegraphs before it strikes), `Block.ts` and `Switch.ts` are the puzzle, `Door.ts` and `Chest.ts` the passages and the loot; `src/interact.ts` is the one `interact` prompt picker; `src/level/Vale.ts` and `Hollow.ts` build the places and tag the solid meshes; `valeHeight(x, z)` in `Vale.ts` is the vale's one ground (banks, outcrops, a stream bed and a rise to the dungeon, the arena and the play spaces kept level), so place every entity, pickup and `setup.place` through it, and ground steeper than 45° is rock Wren cannot climb; `src/scenes/Play.ts` wires them; `src/render/` is ordinary Three.js and every model in the game (`foliage.ts` is the vale's instanced planting, its floor and the canopy's shade, never solid; `effects.ts` the embers, sparks, fireflies and the companion's trail `Play.ts` fires through four pooled `GPUParticles3D` emitters; `props.ts` the hut, the signs, the pitcher lantern and the companion orb); `src/ui/Hud.tsx` is the one HUD (hearts in halves, keys, the prompt). The camera and the sun are written in `afterPhysics`, never in the scene's frame function, because `moveAndSlide` only queues motion. Keep `playtests/survives.playtest.json` as smoke proof and `touch-controls.ts` aligned with the input map in `src/game.ts`. Collision is the engine's, from your geometry: `buildStaticColliders(ctx, root, { predicate: isSolid })` turns the tagged meshes into fixed trimesh bodies. A `CollisionShape3D` capsule is centred on the body's origin, so the origin is Wren's waist and her rig is pushed down by `halfHeight + radius`; forget that and she floats a body-length above every floor. Entities a scenario places (`player`, `mossling.N`, `flicker.N`, `thornback.N`, `dummy.N`, `warden`, `block`, `chest.sword`, `chest.key`) are registered in `load()`, because `setup.place` runs before `enter()`.
29
+ - `threenative-engine`: before any new mechanic, helper or render stage, and on a slow frame or a wrong image. `engine_search_capabilities`, `engine_capability_detail`, `engine_search_references`, `engine_reference_detail`, `engine_watch_reference`.
30
+ - `threenative-assets`: a texture, HDRI, sound or model. `asset_search_sources`, `asset_download_file`, `audio_search_assets`, `mesh_optimize`.
31
+ - `threenative-sculpt`: a bespoke mesh or character from a reference image. `sculpt_plan`, `sculpt_spec_gate`, `sculpt_compare`, `sculpt_pass_gate`.
32
+ - `threenative-animation`: a rigged GLB with a held prop, foot slide or loop seam. `animation_inspect`, `animation_attach`, `animation_verify`.
33
+ - `threenative-terrain`: any terrain, from words. `terrain_generate`.
34
+ - `threenative-devtools`: after `npx @threenative/playtest trace` names no cause. `performance_start_trace`, `performance_analyze_insight`.
35
+ <!-- /shared -->
43
36
 
44
- Play gates: `playtests/explore.playtest.json` drives 7200 ticks of seeded random input and fails on any page error; `controls.playtest.json` presses each control the HUD shows, from the spawn, and fails when one changes nothing; `look.playtest.json` fails when mouse motion does not turn `camera.main`; `stride.playtest.json` bounds `footSlip` (`maxSlip` and `maxSlideSpeed: 1`, 1 m/s) on the sole nodes `footL`/`footR`, so the run cycle must follow ground speed: limbs use AnimationPlayer clips with strideRoot, never a timer. `performance.playtest.json` pins no frame time: the harness holds every tier to 16.7 ms p95 (60 fps) of the engine's own CPU and GPU cost (plus the frame interval on a real display), and a `TN_SCENE_WARNING` or a `TN_RENDER_PROJECTION` decline fails the run, so answer it by cutting unique geometry or materials. A new key binding joins `explore`'s `move` or `actions` and the `controls` scenario in the same change; a mouse button joins `controls` as a `pointerPosition` (`buttons` 1 left, 2 right, 4 middle), because `explore` presses keys only. Controls are the PC scheme: click slash, right-click (hold) shield, Tab or middle click lock on (again: next target, then off), space roll or hop, E open, WASD move, mouse look; J, Shift and Q (hold) stay as secondary keys the HUD omits. The left click is its own input name, `slash`, because the first click only captures the pointer (`look` is `pointerRelative`): `readHeroInput` counts it only when the pointer was already captured on the step before. Mouse look turns the camera by `input.vector("look").x` once captured; the camera never swings back by itself, so there is no auto swing to pause, and while a target is locked its framing owns the view and the mouse is ignored. The slash needs the Ember Blade, so `controls` opens the chest first and the HUD says so until Wren has it.
37
+ ## This kit
45
38
 
46
- ## Portable authoring contracts
47
- Leave `assets` absent: the cook selects target-decodable passes, with `models.sharedImages: true` deduplicating images. `sharedImages: false` embeds duplicate copies; `models.compact` (default `{ flatten: true, join: true, instance: true }`) flattens the scene graph, merges primitives by material and batches a mesh shared by several nodes as `EXT_mesh_gpu_instancing` — all lossless, keeping any node matching `protectedPattern` (or named in `protectedNames`), an animation target, or a skin joint individually addressable; `compact: false` ships the scene graph as authored. `models: "none"` / `textures: "none"` / `audio: "none"` skip those passes and report uncooked bytes. Android/iOS currently skip compression and model dedupe. `assets.exclude` defaults to `[]`; source-relative globs (for example `["unused/**"]`) omit matching files and report saved bytes. `assets.budget` accepts `{ uncooked?: number | "none", total?: number | "none" }`, default `{ uncooked: 64_000_000, total: "none" }`: only bytes left uncooked where cooking was possible count toward `uncooked`. A number sets that ceiling; `"none"` disables both gates. Either disabled gate still reports bytes. Automatic texture cooking retains unaligned source images unchanged and reports `block-size`; those bytes still count toward the uncooked budget. An explicit compression codec override must satisfy four-pixel block alignment; `codec: "none"` opts out. Cooking never silently resizes an image to fix alignment.
39
+ <!-- shared: kit-files -->
40
+ Source in `src/`: `entities/`, `game.ts`, `interact.ts`, `level/`, `main.ts`, `render/`, `scenes/`, `state.ts`, `ui/`.
41
+ 15 scenarios in `playtests/`; `playtests/survives.playtest.json` is the smoke proof.
42
+ Kit notes: `node_modules/create-threenative/agent-docs/references/kit-adventure.md`.
43
+ <!-- /shared -->
48
44
 
49
- Relative look capture: a binding with `pointerRelative: true` captures the canvas on click by default; set `captureOnClick: false` and call `ctx.input.captureMouse()` from your own gesture to opt out. Desktop mode precedence is CLI (`--windowed`, `--maximized`, `--fullscreen`) over `display.fullscreen` over `window.maximized`; with both false, `window.width`/`height` size the normal window. Scenes use `load`, `enter`, `update`, `exit`, `render`; physics nodes are Godot-named and disposable. No model here is imported, so there is no authored scale to normalise and the collider is the body: the generated scale-and-snap conventions do not apply. A weapon stays in the hand that holds it: the Ember Blade rides the rig's `RightHand` bone through `attachToBone` in `src/entities/Hero.ts`; parent any new prop the same way. `input.vector("move").y` is +up, so forward uses one explicit `-move.y` conversion. Rigged assets: put a `.glb` in `assets/`, await `ctx.assets.model("hero.glb")` in `Scene.load()`, then drive `AnimationPlayer` beside its entity. `ctx.goto(name)` rebuilds without resetting game state; from a frame function `goto` and then `return`; `ctx.state.set({ /* copy this game's initial-state shape */ })` is a partial patch. `game.goto("<scene-name>")` also rebuilds the scene, but it resets the game's state. Seeded randomness is deterministic only when `defineGame({ seed })` is configured.
45
+ `ADVENTURE_FEEL` in `src/entities/Hero.ts` is Wren's one table of feel constants; `playtests/move.playtest.json` proves it. `src/interact.ts` is the one interact prompt picker. Every model is procedural.
46
+ `pnpm test` proves the web target. Desktop is claimed only where `native-playtests/survives.playtest.json` ran with `--target desktop`; Android and iOS have not run for this kit.
50
47
 
51
- WebGPU reports `TN_GPU_CLASS` once per launch. Automatic `render.resolutionScale` starts at 0.85 for `mobile-low`, otherwise 1; a numeric value pins it. `TN_FRAME_BUDGET` reports the actual scale under both policies. No material backlighting ships: as in a stock Unreal scene, the sun, the sky light, the torches and each material's own colour are the whole light. The look is the engine's default: `src/render/postprocessing.ts` builds `new WorldEnvironment({ ...qualityPreset(tier), ...overrides })` from `@threenative/core`, which is the stock Unreal 5.8.3 look — the filmic tone curve, metered auto exposure, bloom, ambient occlusion and 4x MSAA. `TN_RENDER_CHAIN` reports what ran. To change it, add an override on that object (`tonemapMode: "aces"`, or `autoExposureEnabled: false` with a fixed `exposure`) in `quality.ts`; do not vendor the chain. `src/render/sky.ts` builds the gradient background and its environment light from `palette.ts`, the height mist on `scene.fogNode` and the sun shafts (soft additive tubes, because the core `godRays` stage does not run on the owned engine yet); `SUN_DIRECTION` aims `lighting.ts`'s sun, and `setIndoors` drops the sky light under the Hollow's roof so the torches carry the rooms. `src/render/quality.ts` owns `low`, `medium`, `high`; the GPU family from `ctx.renderer.gpuClass` sets the start (`discrete` `high`, `integrated` and `mobile-high` `medium`, other phones `low`); `isMobile()` chooses `low`, otherwise `high` when the family is `unknown`; override with `setupPost(..., { tier: "low" })`. The native production collector's explicit `--hosted-software` profile selects the existing `low` preset only when no tier override is passed; `TN_QUALITY_TIER` reports `source=hosted-software`. That smoke tier is not physical performance evidence and does not change an ordinary desktop run. Unknown tiers throw. Keep state values human-readable; the bridge flushes about 100 ms and per-frame feel stays in scene-owned Three.js.
48
+ <!-- shared: kit-commands -->
49
+ ## Commands
52
50
 
53
- Two loading conventions come from `@threenative/core`, not from your own loops: `loadAll(items, load)` fetches six at a time and returns results **in the input's order**, and `addInSlices(objects, (object) => ctx.add(object))` attaches in 8 ms slices so hundreds of objects never land in one long frame; override `concurrency`/`sliceSize`, pass `while: () => alive` to stop a torn-down scene without throwing, and `marker: false` silences `TN_LOAD_ALL`/`TN_ADD_SLICES` but never the measurement. Gate the loading curtain on a measured readiness with `ctx.startup.hold(label, () => ready)`: core polls it every rendered frame, so it settles without a physics step. Assets download on demand and stay on disk between web visits: await everything the spawn camera sees before the reveal, and `await ctx.assets.prefetch(["next-level.glb"])` before `ctx.goto` only for what is out of view (a reveal before the visible content loads shows a half-built world); the idle fill downloads the rest after the reveal. Overrides on `defineGame`'s `assets`: `cache: false`, `backgroundFill: false`, both reported on `ctx.assets.cache`; native hosts read installed files.
51
+ ```sh
52
+ pnpm dev # play in the browser
53
+ pnpm test # typecheck, lint, format, then every playtest
54
+ pnpm build --target desktop # also: web, android, ios
55
+ pnpm studio # open the game in Studio
56
+ npx threenative doctor # build, import, device or blank-frame failure
57
+ npx threenative doctor --fix # refresh agent files
58
+ ```
59
+ <!-- /shared -->
60
+
61
+ <!-- shared: kit-conventions -->
62
+ ## Conventions
63
+
64
+ Each is on by default with a named override. Detail: `node_modules/create-threenative/agent-docs/references/conventions.md#<id>`.
65
+
66
+ - **Look** `#look`: filmic curve, metered auto exposure. Override: `tonemapMode: "aces"`; `autoExposureEnabled: false` + `exposure`. Marker: `TN_WORLD_ENVIRONMENT`.
67
+ - **Ambient occlusion** `#ao-indirect`: darkens indirect light only, not the sun. Override: `gtaoIndirectOnly: false`; `gtaoEnabled: false`. Marker: `TN_WORLD_ENVIRONMENT`.
68
+ - **Quality tier (`src/render/quality.ts`)** `#quality`: GPU class picks `high`, `medium` or `low`. Override: `setupPost(..., { tier: "low" })`. Marker: `TN_QUALITY_TIER`.
69
+ - **Resolution scale** `#resolution`: `"auto"`, 0.85 on mobile-low. Override: numeric `resolutionScale`. Marker: `TN_FRAME_BUDGET`.
70
+ - **Budget real time for the look** `#frame-budget`: frame meter and scene verdict on. Override: `frameBudget: false`. Marker: `TN_FRAME_BUDGET`, `TN_SCENE_WARNING`.
71
+ - **World-matrix walk** `#matrix-world`: visible subtrees only. Override: `renderer.matrixWorld: "all"`. Marker: `TN_PROJECTION`.
72
+ - **Projected-pixel cull** `#projected-cull`: under 0.5 px. Override: `minimumProjectedPixels`; `alwaysRender(obj)`. Marker: `TN_RENDER_PROJECTION`.
73
+ - **Physics interpolation** `#interpolation`: on for bodies and `ctx.camera`. Override: `physicsInterpolation: false`. Marker: `TN_PHYSICS_INTERPOLATION`.
74
+ - **Continuous collision** `#continuous`: on for `RigidBody3D`. Override: `continuousCollision: false`. Marker: `body.continuousCollision`.
75
+ - **Loading** `#loading`: `loadAll` keeps order; `addInSlices` attaches in 8 ms slices. Override: `concurrency`, `sliceSize`, `marker: false`. Marker: `TN_LOAD_ALL`.
76
+ - **Loading curtain** `#startup`: `ctx.startup.hold(label, () => ready)`. Override: reveal on measured readiness only.
77
+ - **Asset cache** `#asset-cache`: on, with idle fill. Override: `assets: { cache: false, backgroundFill: false }`. Marker: `ctx.assets.cache`.
78
+ - **Asset cook** `#asset-cook`: compact, shared images. Override: `compact: false`; `assets.exclude`; `assets.budget`. Marker: `TN_ASSETS_CONFIG`.
79
+ - **Stride sync** `#stride-sync`: on. Override: `strideSync: false`.
80
+ - **Held prop** `#attach`: `attachToBone`. Override: a portable `Bone` named `RightHand`.
81
+ - **Rigged assets** `#rigged`: `.glb` in `assets/`; `AnimationPlayer` drives clips. Override: `ctx.assets.model("hero.glb")` in `Scene.load()`.
82
+ - **Unlit foliage** `#unlit-foliage`: warns. Override: `material.userData.tnUnlitOk = true`. Marker: `TN_UNLIT_FOLIAGE`.
83
+ - **Material backlight** `#backlight`: none, as in stock Unreal. Override: `rimGain`; `fillGain`.
84
+ - **Pointer look** `#pointer-look`: captures the canvas on click. Override: `captureOnClick: false` + `ctx.input.captureMouse()`.
85
+ - **Static scenery** `#static`: unwritten transforms stay cheap. Override: `markStatic(root)`; `invalidateStatic(obj)`. Marker: `TN_RENDERLIST_VALIDATE`.
86
+ - **Frame spans** `#spans`: off. Override: `TN_FRAME_SPANS=1`. Marker: `TN_FRAME_SPANS`.
87
+ - **Multiplayer** `#net`: none; unsupported transport rejects. Override: `connect` from `@threenative/core/net` with four limits. Marker: `TN_NET_UNAVAILABLE`.
88
+ - **Desktop window** `#desktop-mode`: CLI, then `display.fullscreen`, then `window.maximized`. Override: `--windowed`; `--maximized`; `--fullscreen`.
89
+ - **CPU priority** `#cpu-priority`: game threads first. Override: `display.priority: "normal"`. Marker: `TN_PROCESS_PRIORITY`.
90
+ - **Terrain** `#terrain`: authored in the game. Override: optional `@threenative/terrain`; `references/terrain-authoring.md`.
91
+ - **Navigation** `#navigation`: none; browser-only WASM. Override: import `@threenative/physics/navigation` on purpose.
92
+ - **Controller** `#gamepad`: W3C standard mapping on every pad, radial dead zone `0.2`, and a button press or a decisive stick move claims which pad is read. Override: `gamepadDeadZone: 0` for raw axes. Marker: `TN_GAMEPAD`.
93
+ - **Move input** `#move-axis`: `input.vector("move").y` is +up. Override: one explicit `-move.y` conversion.
94
+ - **Scene change** `#scene-change`: `ctx.goto(name)` keeps state. Override: `game.goto(name)` resets state.
95
+ - **Randomness** `#seed`: unseeded. Override: `defineGame({ seed })`.
96
+ - **Engine** `#engine`: owned C++ engine. Override: `engine: "threejs"` only when the user asks. Marker: `TN_NATIVE_ENGINE_UNBOUND`.
97
+ - **Refused imports** `#engine-catalog`: refused `three` imports fail at their line. Override: `createEngineCatalogPlugin({ mode: "warn" })`. Marker: `TN_ENGINE_CATALOG`.
98
+ <!-- /shared -->
99
+
100
+ <!-- shared: kit-stuck -->
101
+ ## When the framework blocks you, write plain Three.js
54
102
 
55
- ## Budget real time for the look
56
- Reference-driven authoring starts at `node_modules/create-threenative/agent-docs/references/dream-loop.md`. Open a capture after visual changes. A scenario with no assertions or missing observations fails. The engine warns you before a human does: `TN_SCENE_WARNING` fires when the GPU used under a third of the frame while the JS render phase ran longer than the display's own period, and names the census behind it — objects considered, draws per pass, triangles per draw, shadow-exempt casters. It is a scene-shape verdict, so answer it by moving the draw and object counts, not the engine. `npx threenative doctor` repeats the last verdict and the `DEV_MODE=true` chip shows it on screen; `TN_FRAME_SPANS=1` adds the render phase's own span tree when you need to know which part costs the milliseconds. Do not touch a transform you do not need to: three skips the per-object binding update when nothing changed. `markStatic(root)` composes a never-moving subtree once, and `invalidateStatic(object)` announces a write inside one. Recipes in the installed create-threenative: `node_modules/create-threenative/agent-docs/references/assertion-reference.md`, `node_modules/create-threenative/agent-docs/references/capture-the-frame.md`, `node_modules/create-threenative/agent-docs/references/ctx-cookbook.md`, `node_modules/create-threenative/agent-docs/references/debug-surface.md`, `node_modules/create-threenative/agent-docs/references/gameplay-recipes.md`, `node_modules/create-threenative/agent-docs/references/performance-basics.md`, `node_modules/create-threenative/agent-docs/references/rigging-characters.md`, `node_modules/create-threenative/agent-docs/references/sculpt-from-a-reference.md`, and `node_modules/create-threenative/agent-docs/references/webview-ui.md`.
103
+ When an `@threenative/*` API is broken, missing, or does not do what you need, replace only that piece with portable Three.js/plain code. Keep the loop, scenes, input, registry, and playtest bridge; avoid DOM globals, dynamic `import()`, and raw physics handles. **Report what blocked you** (API, expectation, result, replacement); do not stall the game.
57
104
 
58
- For terrain generation or editing, read `node_modules/create-threenative/agent-docs/references/terrain-authoring.md`; install optional `@threenative/terrain`, bake before play, and own its appearance in `src/render/`; test water proximity with its `createSegmentIndex` and steep ground with `slopeQuantile`, never a per-point scan or fixed degrees.
105
+ ## Stuck
59
106
 
60
- For online play only, import `connect` from `@threenative/core/net` with an HTTPS URL and nonempty identity credential; configure `connectTimeoutMs`, `maxReliableMessageBytes`, `maxQueuedReliableBytes`, and `maxQueuedDatagrams` (10s/65,536/1 MiB/256), use `reliable-ordered` for ordered reliable messages and bounded `unreliable` datagrams that may drop, and keep serialization, replication, prediction, interpolation, snapshots and rejoin in this game's `src/` and server. There is no fallback: unsupported WebTransport/native rejects with `TN_NET_UNAVAILABLE`; reference Go server: `packages/runtime-native/examples/webtransport/server`.
107
+ `npx threenative doctor`, then `npx @threenative/playtest doctor`; a missing observation is not zero. A confirmed engine bug: `file-engine-bug` skill. Smallest correct change: `ponytail` skill. Slow frame: `threenative-performance` skill.
108
+ <!-- /shared -->
@@ -1,62 +1,110 @@
1
1
  <!-- Generated mirror of AGENTS.md. Do not edit; edit AGENTS.md. -->
2
2
 
3
- # AGENTS.md — __PROJECT_NAME__ adventure
3
+ <!-- shared: kit-identity -->
4
+ # AGENTS.md — __PROJECT_NAME__ (Lantern Vale, the adventure kit)
4
5
 
5
- Lantern Vale: Wren, a lantern-bearer, takes the Ember Blade from a chest in a walled clearing, then clears the Moss Hollow — a three-room dungeon with a push-block puzzle, a small key, a locked door and the Stone Warden, a boss that is only hurt while dazed. Mosslings hop and bite, Flicker bats circle and swoop, and Thornbacks show a thorned plate that only a cut from behind gets round. Lock-on targeting, a sword slash, a shield, a roll, half-hearts and a heart vessel. Every model is procedural, with no mesh file; five shared tiling photos (`src/render/surface.ts`, licences in `assets/tex-PROVENANCE.md`) give the floor, stone, bark and planks their grain, so a wooden, stone or bark mesh takes `surfaced(color, surface)`, not plain `lit()` (`survives` fails on one: `untexturedSurfaces`); Wren's idle, walk and run are `AnimationClip`s built in code. Instructions for the AI agent in this game; `CLAUDE.md` mirrors this file.
6
+ Wren crosses a sunlit clearing and a three-room moss dungeon with lock-on sword combat, a shield, a block-and-switch puzzle, a small key and the Stone Warden mini-boss. Routing words: adventure, zelda, ocarina, action-adventure. `CLAUDE.md` is a copy of this file.
7
+ <!-- /shared -->
6
8
 
7
- ## Ownership
9
+ <!-- shared: kit-router -->
10
+ ## Authoring flow
8
11
 
9
- ThreeNative owns bootstrap, renderer, fixed-step loop, input, loading, physics bindings, the state bridge and the default look. This repository owns the clearing and the dungeon, Wren's feel, the lock-on, the hostiles, the puzzle, the HUD and every model; `src/game.ts` is portable and React mounts from `src/main.ts`. The render camera also skips an object that projects under **0.5 px** in it; `renderer.minimumProjectedPixels` raises that threshold (`false` disables the cut, not the count) and `alwaysRender(object)` exempts an object, while camera-attached objects and shadow casters are kept. The engine also owns the per-frame world-matrix walk, and by default it does not descend into a hidden subtree — so a game that reads a hidden object's `matrixWorld` directly must use `getWorldPosition` (or call `object.updateWorldMatrix(true, false)`) first; `renderer.matrixWorld: "all"` restores three's every-node walk, and `TN_PROJECTION` reports the visited-node count either way. Physics bodies and `ctx.camera` interpolate between fixed ticks by default; `physicsInterpolation: false` disables it globally, `body.interpolate = false` disables one body, `ctx.interpolate(object)` opts in another transform, and `ctx.resetInterpolation(object)` resets game-driven teleports (`TN_PHYSICS_INTERPOLATION` reports the setting and tracked count).
12
+ Detail for each step: `threenative-capabilities` skill. Do the steps in order. A step with no result records `none: <reason>`. A blank step blocks the next. A hook blocks the first new file under `src/` until step 3 ran for the current prompt (`TN_DISCOVERY_GATE=off` opts out; Codex needs `/hooks` trust).
10
13
 
11
- ## Start every change
14
+ 1. **Kit** (new game only): `engine_search_capabilities {situation: "<the whole request>", scope: "request"}` returns the matching starter kit first. This folder is already a kit.
15
+ 2. **Mechanics**: per mechanic, `engine_search_references {situation}`, then `engine_reference_detail` on each hit for pinned constants and feel. To see a mechanic move, `engine_watch_reference {query: "<game> <mechanic>"}` returns a contact sheet of real gameplay. Borrow mechanics only: no code, level layouts, character names or art. Cite `file:line`.
16
+ 3. **Built-ins**: per mechanic, system or symptom, `engine_search_capabilities {situation, scope: "mechanic"}`; rows answer; `engine_capability_detail` only for omitted symbols. Constraints are binding. `verdict: "none"` means the game writes it in `src/`.
17
+ 4. **Plan** (new game, or a change to several systems): `prd-creator` with the kit, references and built-ins. With a user, wait for explicit approval, then implement. With no user (`claude -p`, a script), record the plan and assumptions, then continue.
18
+ 5. **Assets**: `asset_search_sources`, the source's search tool, then `asset_download_file`; record source and licence in `CREDITS.md`. Nothing fits: `sculpt_plan`. A rigged GLB: `animation_inspect` (`threenative-assets` skill).
19
+ 6. **Build**: gameplay in `src/`, look in `src/render/` (`threenative-context` and `threenative-ui` skills). For parallel work, give each subagent one area and its files, then integrate.
20
+ 7. **Prove**: one fail-closed playtest per mechanic, then `pnpm test` (`threenative-playtest` skill). A fresh judge compares a `--browser-recipe webgpu --headed` capture to the reference image (`threenative-visuals` skill; `node_modules/create-threenative/agent-docs/references/dream-loop.md`).
21
+ 8. **Report**: the `pnpm dev` URL, `TN_FRAME_BUDGET`, `TN_SCENE_WARNING`, `TN_RENDER_PROJECTION`, and each skipped step with its reason.
12
22
 
13
- 1. **Critical authoring gate:** invoke `threenative-capabilities` to choose the route. New games: steps 1-8. Existing games: steps 5-7 only, using existing context. Follow the `ponytail` ladder. References borrow mechanics only: no code, level layouts, character names or art. A session started outside this folder has no `mcp__threenative-*` tools: call them with `node node_modules/@threenative/core/mcp/call.mjs <server> <tool> '<json>'`.
14
- 2. **New game only:** run discovery in `threenative-capabilities` before `prd-creator`. Draft the core-mechanics plan from the kit, both discovery passes and binding constraints, direct the user to review it, and wait for explicit approval plus an instruction to implement it.
15
- 3. Treat returned constraints as binding. `@threenative/physics/navigation` is Recast WASM that Android and iOS refuse, so this kit does not import it: a Mossling steers with a ray to Wren and slides along the wall that ray hits (`src/entities/Mossling.ts`). Keep new hostiles on direct physics queries (`intersectRay`, `intersectShape`, `Area3D`).
16
- 4. If a build, import, device, or blank frame fails, run `npx threenative doctor` and `npx @threenative/playtest doctor`; missing observations are not zero. For *"a bullet passes through a wall"*, `RigidBody3D` defaults to continuous collision; `continuousCollision` is the named per-body override, and `body.continuousCollision` reports the effective setting on web/native.
23
+ A change to an existing game repeats steps 2-3 for that change, then steps 5-8.
24
+ <!-- /shared -->
17
25
 
18
- ## When the framework blocks you, write plain Three.js
19
-
20
- When an `@threenative/*` API is broken, missing, or does not do what you need, replace only that piece with portable Three.js/plain code. Keep the loop, scenes, input, registry, and playtest bridge; avoid DOM globals, dynamic `import()`, and raw physics handles. **Report what blocked you** (API, expectation, result, replacement); never stall the game.
21
-
22
- ## Workflow skills
23
- - `.agents/skills/prd-creator/SKILL.md` / `.claude/skills/prd-creator/SKILL.md` — game plan and approval gate.
24
- - `.agents/skills/threenative-capabilities/SKILL.md` / `.claude/skills/threenative-capabilities/SKILL.md` — capability search and classic-game mechanics references.
25
- - `.agents/skills/threenative-playtest/SKILL.md` / `.claude/skills/threenative-playtest/SKILL.md` — diagnosis and proof.
26
- - `.agents/skills/threenative-assets/SKILL.md` / `.claude/skills/threenative-assets/SKILL.md` — assets and sculpting.
27
- - `.agents/skills/threenative-visuals/SKILL.md` / `.claude/skills/threenative-visuals/SKILL.md` — captures and look.
28
- - `.agents/skills/threenative-performance/SKILL.md` / `.claude/skills/threenative-performance/SKILL.md` — measured budgets; read it first when the game is slow or stutters: `playtest trace`, then the `threenative-devtools` MCP server.
29
- - `.agents/skills/threenative-ui/SKILL.md` / `.claude/skills/threenative-ui/SKILL.md` — native-safe UI. `.agents/skills/threenative-context/SKILL.md` / `.claude/skills/threenative-context/SKILL.md` — portable ctx APIs.
30
- - Confirmed framework bugs: use `file-engine-bug` in `.agents/skills/` or `.claude/skills/` after a minimal repro. A game-side `patches/` fix is temporary: once it is settled, it moves into the engine in one PR. Lazy-first: `.agents/skills/ponytail/SKILL.md` / `.claude/skills/ponytail/SKILL.md` — smallest correct change, and its reuse rung is the capability search above. Engine: The owned C++ engine is the default for a new game: the Wasm engine on web and the engine player on desktop. This template runs on it: `threenative.config.ts` names no `engine`. `engine: "threejs"` switches to upstream Three.js only when the user asks for it; it is never a fix for a build error. Android and iOS use the legacy host.
31
-
32
- ## Commands and map
33
-
34
- ```sh
35
- pnpm dev
36
- pnpm build
37
- pnpm build --target desktop
38
- pnpm test # runs `pnpm check` first: typecheck, ESLint, Biome format
39
- pnpm typecheck
40
- ```
26
+ <!-- shared: kit-mcp -->
27
+ ## MCP servers
41
28
 
42
- Status: the web target is proven by `pnpm test`, which runs every `playtests/*.playtest.json` in a WebGPU browser. Desktop is claimed only where `native-playtests/survives.playtest.json` ran with `--target desktop`; Android and iOS have not been run for this kit.
29
+ `.mcp.json` wires six servers, and a session started in this folder loads them. Their tools can show as deferred: load them with `ToolSearch` `select:` plus the exact names, for example `select:mcp__threenative-engine__engine_search_capabilities,mcp__threenative-engine__engine_capability_detail,mcp__threenative-engine__engine_search_references,mcp__threenative-engine__engine_reference_detail,mcp__threenative-engine__engine_watch_reference`. A session started outside this folder runs `node node_modules/@threenative/core/mcp/call.mjs <server> <tool> '<json>'`; `call.mjs <server>` lists that server's tools.
43
30
 
44
- `src/entities/Hero.ts` owns Wren — `ADVENTURE_FEEL` is the one table of feel constants, and `playtests/move.playtest.json` proves run speed, stop time and turn time against it. `LockOn.ts` picks and holds a target, `Mossling.ts`, `Flicker.ts`, `Thornback.ts`, `Warden.ts` and `Dummy.ts` are the targets (each hostile telegraphs before it strikes), `Block.ts` and `Switch.ts` are the puzzle, `Door.ts` and `Chest.ts` the passages and the loot; `src/interact.ts` is the one `interact` prompt picker; `src/level/Vale.ts` and `Hollow.ts` build the places and tag the solid meshes; `valeHeight(x, z)` in `Vale.ts` is the vale's one ground (banks, outcrops, a stream bed and a rise to the dungeon, the arena and the play spaces kept level), so place every entity, pickup and `setup.place` through it, and ground steeper than 45° is rock Wren cannot climb; `src/scenes/Play.ts` wires them; `src/render/` is ordinary Three.js and every model in the game (`foliage.ts` is the vale's instanced planting, its floor and the canopy's shade, never solid; `effects.ts` the embers, sparks, fireflies and the companion's trail `Play.ts` fires through four pooled `GPUParticles3D` emitters; `props.ts` the hut, the signs, the pitcher lantern and the companion orb); `src/ui/Hud.tsx` is the one HUD (hearts in halves, keys, the prompt). The camera and the sun are written in `afterPhysics`, never in the scene's frame function, because `moveAndSlide` only queues motion. Keep `playtests/survives.playtest.json` as smoke proof and `touch-controls.ts` aligned with the input map in `src/game.ts`. Collision is the engine's, from your geometry: `buildStaticColliders(ctx, root, { predicate: isSolid })` turns the tagged meshes into fixed trimesh bodies. A `CollisionShape3D` capsule is centred on the body's origin, so the origin is Wren's waist and her rig is pushed down by `halfHeight + radius`; forget that and she floats a body-length above every floor. Entities a scenario places (`player`, `mossling.N`, `flicker.N`, `thornback.N`, `dummy.N`, `warden`, `block`, `chest.sword`, `chest.key`) are registered in `load()`, because `setup.place` runs before `enter()`.
31
+ - `threenative-engine`: before any new mechanic, helper or render stage, and on a slow frame or a wrong image. `engine_search_capabilities`, `engine_capability_detail`, `engine_search_references`, `engine_reference_detail`, `engine_watch_reference`.
32
+ - `threenative-assets`: a texture, HDRI, sound or model. `asset_search_sources`, `asset_download_file`, `audio_search_assets`, `mesh_optimize`.
33
+ - `threenative-sculpt`: a bespoke mesh or character from a reference image. `sculpt_plan`, `sculpt_spec_gate`, `sculpt_compare`, `sculpt_pass_gate`.
34
+ - `threenative-animation`: a rigged GLB with a held prop, foot slide or loop seam. `animation_inspect`, `animation_attach`, `animation_verify`.
35
+ - `threenative-terrain`: any terrain, from words. `terrain_generate`.
36
+ - `threenative-devtools`: after `npx @threenative/playtest trace` names no cause. `performance_start_trace`, `performance_analyze_insight`.
37
+ <!-- /shared -->
45
38
 
46
- Play gates: `playtests/explore.playtest.json` drives 7200 ticks of seeded random input and fails on any page error; `controls.playtest.json` presses each control the HUD shows, from the spawn, and fails when one changes nothing; `look.playtest.json` fails when mouse motion does not turn `camera.main`; `stride.playtest.json` bounds `footSlip` (`maxSlip` and `maxSlideSpeed: 1`, 1 m/s) on the sole nodes `footL`/`footR`, so the run cycle must follow ground speed: limbs use AnimationPlayer clips with strideRoot, never a timer. `performance.playtest.json` pins no frame time: the harness holds every tier to 16.7 ms p95 (60 fps) of the engine's own CPU and GPU cost (plus the frame interval on a real display), and a `TN_SCENE_WARNING` or a `TN_RENDER_PROJECTION` decline fails the run, so answer it by cutting unique geometry or materials. A new key binding joins `explore`'s `move` or `actions` and the `controls` scenario in the same change; a mouse button joins `controls` as a `pointerPosition` (`buttons` 1 left, 2 right, 4 middle), because `explore` presses keys only. Controls are the PC scheme: click slash, right-click (hold) shield, Tab or middle click lock on (again: next target, then off), space roll or hop, E open, WASD move, mouse look; J, Shift and Q (hold) stay as secondary keys the HUD omits. The left click is its own input name, `slash`, because the first click only captures the pointer (`look` is `pointerRelative`): `readHeroInput` counts it only when the pointer was already captured on the step before. Mouse look turns the camera by `input.vector("look").x` once captured; the camera never swings back by itself, so there is no auto swing to pause, and while a target is locked its framing owns the view and the mouse is ignored. The slash needs the Ember Blade, so `controls` opens the chest first and the HUD says so until Wren has it.
39
+ ## This kit
47
40
 
48
- ## Portable authoring contracts
49
- Leave `assets` absent: the cook selects target-decodable passes, with `models.sharedImages: true` deduplicating images. `sharedImages: false` embeds duplicate copies; `models.compact` (default `{ flatten: true, join: true, instance: true }`) flattens the scene graph, merges primitives by material and batches a mesh shared by several nodes as `EXT_mesh_gpu_instancing` — all lossless, keeping any node matching `protectedPattern` (or named in `protectedNames`), an animation target, or a skin joint individually addressable; `compact: false` ships the scene graph as authored. `models: "none"` / `textures: "none"` / `audio: "none"` skip those passes and report uncooked bytes. Android/iOS currently skip compression and model dedupe. `assets.exclude` defaults to `[]`; source-relative globs (for example `["unused/**"]`) omit matching files and report saved bytes. `assets.budget` accepts `{ uncooked?: number | "none", total?: number | "none" }`, default `{ uncooked: 64_000_000, total: "none" }`: only bytes left uncooked where cooking was possible count toward `uncooked`. A number sets that ceiling; `"none"` disables both gates. Either disabled gate still reports bytes. Automatic texture cooking retains unaligned source images unchanged and reports `block-size`; those bytes still count toward the uncooked budget. An explicit compression codec override must satisfy four-pixel block alignment; `codec: "none"` opts out. Cooking never silently resizes an image to fix alignment.
41
+ <!-- shared: kit-files -->
42
+ Source in `src/`: `entities/`, `game.ts`, `interact.ts`, `level/`, `main.ts`, `render/`, `scenes/`, `state.ts`, `ui/`.
43
+ 15 scenarios in `playtests/`; `playtests/survives.playtest.json` is the smoke proof.
44
+ Kit notes: `node_modules/create-threenative/agent-docs/references/kit-adventure.md`.
45
+ <!-- /shared -->
50
46
 
51
- Relative look capture: a binding with `pointerRelative: true` captures the canvas on click by default; set `captureOnClick: false` and call `ctx.input.captureMouse()` from your own gesture to opt out. Desktop mode precedence is CLI (`--windowed`, `--maximized`, `--fullscreen`) over `display.fullscreen` over `window.maximized`; with both false, `window.width`/`height` size the normal window. Scenes use `load`, `enter`, `update`, `exit`, `render`; physics nodes are Godot-named and disposable. No model here is imported, so there is no authored scale to normalise and the collider is the body: the generated scale-and-snap conventions do not apply. A weapon stays in the hand that holds it: the Ember Blade rides the rig's `RightHand` bone through `attachToBone` in `src/entities/Hero.ts`; parent any new prop the same way. `input.vector("move").y` is +up, so forward uses one explicit `-move.y` conversion. Rigged assets: put a `.glb` in `assets/`, await `ctx.assets.model("hero.glb")` in `Scene.load()`, then drive `AnimationPlayer` beside its entity. `ctx.goto(name)` rebuilds without resetting game state; from a frame function `goto` and then `return`; `ctx.state.set({ /* copy this game's initial-state shape */ })` is a partial patch. `game.goto("<scene-name>")` also rebuilds the scene, but it resets the game's state. Seeded randomness is deterministic only when `defineGame({ seed })` is configured.
47
+ `ADVENTURE_FEEL` in `src/entities/Hero.ts` is Wren's one table of feel constants; `playtests/move.playtest.json` proves it. `src/interact.ts` is the one interact prompt picker. Every model is procedural.
48
+ `pnpm test` proves the web target. Desktop is claimed only where `native-playtests/survives.playtest.json` ran with `--target desktop`; Android and iOS have not run for this kit.
52
49
 
53
- WebGPU reports `TN_GPU_CLASS` once per launch. Automatic `render.resolutionScale` starts at 0.85 for `mobile-low`, otherwise 1; a numeric value pins it. `TN_FRAME_BUDGET` reports the actual scale under both policies. No material backlighting ships: as in a stock Unreal scene, the sun, the sky light, the torches and each material's own colour are the whole light. The look is the engine's default: `src/render/postprocessing.ts` builds `new WorldEnvironment({ ...qualityPreset(tier), ...overrides })` from `@threenative/core`, which is the stock Unreal 5.8.3 look — the filmic tone curve, metered auto exposure, bloom, ambient occlusion and 4x MSAA. `TN_RENDER_CHAIN` reports what ran. To change it, add an override on that object (`tonemapMode: "aces"`, or `autoExposureEnabled: false` with a fixed `exposure`) in `quality.ts`; do not vendor the chain. `src/render/sky.ts` builds the gradient background and its environment light from `palette.ts`, the height mist on `scene.fogNode` and the sun shafts (soft additive tubes, because the core `godRays` stage does not run on the owned engine yet); `SUN_DIRECTION` aims `lighting.ts`'s sun, and `setIndoors` drops the sky light under the Hollow's roof so the torches carry the rooms. `src/render/quality.ts` owns `low`, `medium`, `high`; the GPU family from `ctx.renderer.gpuClass` sets the start (`discrete` `high`, `integrated` and `mobile-high` `medium`, other phones `low`); `isMobile()` chooses `low`, otherwise `high` when the family is `unknown`; override with `setupPost(..., { tier: "low" })`. The native production collector's explicit `--hosted-software` profile selects the existing `low` preset only when no tier override is passed; `TN_QUALITY_TIER` reports `source=hosted-software`. That smoke tier is not physical performance evidence and does not change an ordinary desktop run. Unknown tiers throw. Keep state values human-readable; the bridge flushes about 100 ms and per-frame feel stays in scene-owned Three.js.
50
+ <!-- shared: kit-commands -->
51
+ ## Commands
54
52
 
55
- Two loading conventions come from `@threenative/core`, not from your own loops: `loadAll(items, load)` fetches six at a time and returns results **in the input's order**, and `addInSlices(objects, (object) => ctx.add(object))` attaches in 8 ms slices so hundreds of objects never land in one long frame; override `concurrency`/`sliceSize`, pass `while: () => alive` to stop a torn-down scene without throwing, and `marker: false` silences `TN_LOAD_ALL`/`TN_ADD_SLICES` but never the measurement. Gate the loading curtain on a measured readiness with `ctx.startup.hold(label, () => ready)`: core polls it every rendered frame, so it settles without a physics step. Assets download on demand and stay on disk between web visits: await everything the spawn camera sees before the reveal, and `await ctx.assets.prefetch(["next-level.glb"])` before `ctx.goto` only for what is out of view (a reveal before the visible content loads shows a half-built world); the idle fill downloads the rest after the reveal. Overrides on `defineGame`'s `assets`: `cache: false`, `backgroundFill: false`, both reported on `ctx.assets.cache`; native hosts read installed files.
53
+ ```sh
54
+ pnpm dev # play in the browser
55
+ pnpm test # typecheck, lint, format, then every playtest
56
+ pnpm build --target desktop # also: web, android, ios
57
+ pnpm studio # open the game in Studio
58
+ npx threenative doctor # build, import, device or blank-frame failure
59
+ npx threenative doctor --fix # refresh agent files
60
+ ```
61
+ <!-- /shared -->
62
+
63
+ <!-- shared: kit-conventions -->
64
+ ## Conventions
65
+
66
+ Each is on by default with a named override. Detail: `node_modules/create-threenative/agent-docs/references/conventions.md#<id>`.
67
+
68
+ - **Look** `#look`: filmic curve, metered auto exposure. Override: `tonemapMode: "aces"`; `autoExposureEnabled: false` + `exposure`. Marker: `TN_WORLD_ENVIRONMENT`.
69
+ - **Ambient occlusion** `#ao-indirect`: darkens indirect light only, not the sun. Override: `gtaoIndirectOnly: false`; `gtaoEnabled: false`. Marker: `TN_WORLD_ENVIRONMENT`.
70
+ - **Quality tier (`src/render/quality.ts`)** `#quality`: GPU class picks `high`, `medium` or `low`. Override: `setupPost(..., { tier: "low" })`. Marker: `TN_QUALITY_TIER`.
71
+ - **Resolution scale** `#resolution`: `"auto"`, 0.85 on mobile-low. Override: numeric `resolutionScale`. Marker: `TN_FRAME_BUDGET`.
72
+ - **Budget real time for the look** `#frame-budget`: frame meter and scene verdict on. Override: `frameBudget: false`. Marker: `TN_FRAME_BUDGET`, `TN_SCENE_WARNING`.
73
+ - **World-matrix walk** `#matrix-world`: visible subtrees only. Override: `renderer.matrixWorld: "all"`. Marker: `TN_PROJECTION`.
74
+ - **Projected-pixel cull** `#projected-cull`: under 0.5 px. Override: `minimumProjectedPixels`; `alwaysRender(obj)`. Marker: `TN_RENDER_PROJECTION`.
75
+ - **Physics interpolation** `#interpolation`: on for bodies and `ctx.camera`. Override: `physicsInterpolation: false`. Marker: `TN_PHYSICS_INTERPOLATION`.
76
+ - **Continuous collision** `#continuous`: on for `RigidBody3D`. Override: `continuousCollision: false`. Marker: `body.continuousCollision`.
77
+ - **Loading** `#loading`: `loadAll` keeps order; `addInSlices` attaches in 8 ms slices. Override: `concurrency`, `sliceSize`, `marker: false`. Marker: `TN_LOAD_ALL`.
78
+ - **Loading curtain** `#startup`: `ctx.startup.hold(label, () => ready)`. Override: reveal on measured readiness only.
79
+ - **Asset cache** `#asset-cache`: on, with idle fill. Override: `assets: { cache: false, backgroundFill: false }`. Marker: `ctx.assets.cache`.
80
+ - **Asset cook** `#asset-cook`: compact, shared images. Override: `compact: false`; `assets.exclude`; `assets.budget`. Marker: `TN_ASSETS_CONFIG`.
81
+ - **Stride sync** `#stride-sync`: on. Override: `strideSync: false`.
82
+ - **Held prop** `#attach`: `attachToBone`. Override: a portable `Bone` named `RightHand`.
83
+ - **Rigged assets** `#rigged`: `.glb` in `assets/`; `AnimationPlayer` drives clips. Override: `ctx.assets.model("hero.glb")` in `Scene.load()`.
84
+ - **Unlit foliage** `#unlit-foliage`: warns. Override: `material.userData.tnUnlitOk = true`. Marker: `TN_UNLIT_FOLIAGE`.
85
+ - **Material backlight** `#backlight`: none, as in stock Unreal. Override: `rimGain`; `fillGain`.
86
+ - **Pointer look** `#pointer-look`: captures the canvas on click. Override: `captureOnClick: false` + `ctx.input.captureMouse()`.
87
+ - **Static scenery** `#static`: unwritten transforms stay cheap. Override: `markStatic(root)`; `invalidateStatic(obj)`. Marker: `TN_RENDERLIST_VALIDATE`.
88
+ - **Frame spans** `#spans`: off. Override: `TN_FRAME_SPANS=1`. Marker: `TN_FRAME_SPANS`.
89
+ - **Multiplayer** `#net`: none; unsupported transport rejects. Override: `connect` from `@threenative/core/net` with four limits. Marker: `TN_NET_UNAVAILABLE`.
90
+ - **Desktop window** `#desktop-mode`: CLI, then `display.fullscreen`, then `window.maximized`. Override: `--windowed`; `--maximized`; `--fullscreen`.
91
+ - **CPU priority** `#cpu-priority`: game threads first. Override: `display.priority: "normal"`. Marker: `TN_PROCESS_PRIORITY`.
92
+ - **Terrain** `#terrain`: authored in the game. Override: optional `@threenative/terrain`; `references/terrain-authoring.md`.
93
+ - **Navigation** `#navigation`: none; browser-only WASM. Override: import `@threenative/physics/navigation` on purpose.
94
+ - **Controller** `#gamepad`: W3C standard mapping on every pad, radial dead zone `0.2`, and a button press or a decisive stick move claims which pad is read. Override: `gamepadDeadZone: 0` for raw axes. Marker: `TN_GAMEPAD`.
95
+ - **Move input** `#move-axis`: `input.vector("move").y` is +up. Override: one explicit `-move.y` conversion.
96
+ - **Scene change** `#scene-change`: `ctx.goto(name)` keeps state. Override: `game.goto(name)` resets state.
97
+ - **Randomness** `#seed`: unseeded. Override: `defineGame({ seed })`.
98
+ - **Engine** `#engine`: owned C++ engine. Override: `engine: "threejs"` only when the user asks. Marker: `TN_NATIVE_ENGINE_UNBOUND`.
99
+ - **Refused imports** `#engine-catalog`: refused `three` imports fail at their line. Override: `createEngineCatalogPlugin({ mode: "warn" })`. Marker: `TN_ENGINE_CATALOG`.
100
+ <!-- /shared -->
101
+
102
+ <!-- shared: kit-stuck -->
103
+ ## When the framework blocks you, write plain Three.js
56
104
 
57
- ## Budget real time for the look
58
- Reference-driven authoring starts at `node_modules/create-threenative/agent-docs/references/dream-loop.md`. Open a capture after visual changes. A scenario with no assertions or missing observations fails. The engine warns you before a human does: `TN_SCENE_WARNING` fires when the GPU used under a third of the frame while the JS render phase ran longer than the display's own period, and names the census behind it — objects considered, draws per pass, triangles per draw, shadow-exempt casters. It is a scene-shape verdict, so answer it by moving the draw and object counts, not the engine. `npx threenative doctor` repeats the last verdict and the `DEV_MODE=true` chip shows it on screen; `TN_FRAME_SPANS=1` adds the render phase's own span tree when you need to know which part costs the milliseconds. Do not touch a transform you do not need to: three skips the per-object binding update when nothing changed. `markStatic(root)` composes a never-moving subtree once, and `invalidateStatic(object)` announces a write inside one. Recipes in the installed create-threenative: `node_modules/create-threenative/agent-docs/references/assertion-reference.md`, `node_modules/create-threenative/agent-docs/references/capture-the-frame.md`, `node_modules/create-threenative/agent-docs/references/ctx-cookbook.md`, `node_modules/create-threenative/agent-docs/references/debug-surface.md`, `node_modules/create-threenative/agent-docs/references/gameplay-recipes.md`, `node_modules/create-threenative/agent-docs/references/performance-basics.md`, `node_modules/create-threenative/agent-docs/references/rigging-characters.md`, `node_modules/create-threenative/agent-docs/references/sculpt-from-a-reference.md`, and `node_modules/create-threenative/agent-docs/references/webview-ui.md`.
105
+ When an `@threenative/*` API is broken, missing, or does not do what you need, replace only that piece with portable Three.js/plain code. Keep the loop, scenes, input, registry, and playtest bridge; avoid DOM globals, dynamic `import()`, and raw physics handles. **Report what blocked you** (API, expectation, result, replacement); do not stall the game.
59
106
 
60
- For terrain generation or editing, read `node_modules/create-threenative/agent-docs/references/terrain-authoring.md`; install optional `@threenative/terrain`, bake before play, and own its appearance in `src/render/`; test water proximity with its `createSegmentIndex` and steep ground with `slopeQuantile`, never a per-point scan or fixed degrees.
107
+ ## Stuck
61
108
 
62
- For online play only, import `connect` from `@threenative/core/net` with an HTTPS URL and nonempty identity credential; configure `connectTimeoutMs`, `maxReliableMessageBytes`, `maxQueuedReliableBytes`, and `maxQueuedDatagrams` (10s/65,536/1 MiB/256), use `reliable-ordered` for ordered reliable messages and bounded `unreliable` datagrams that may drop, and keep serialization, replication, prediction, interpolation, snapshots and rejoin in this game's `src/` and server. There is no fallback: unsupported WebTransport/native rejects with `TN_NET_UNAVAILABLE`; reference Go server: `packages/runtime-native/examples/webtransport/server`.
109
+ `npx threenative doctor`, then `npx @threenative/playtest doctor`; a missing observation is not zero. A confirmed engine bug: `file-engine-bug` skill. Smallest correct change: `ponytail` skill. Slow frame: `threenative-performance` skill.
110
+ <!-- /shared -->
@@ -4,5 +4,9 @@
4
4
  "blurb": "Wren crosses a sunlit clearing and a three-room moss dungeon with lock-on sword combat, a shield, a block-and-switch puzzle, a small key and the Stone Warden mini-boss.",
5
5
  "genre": "adventure",
6
6
  "aliases": ["zelda", "ocarina", "action-adventure", "adventure"],
7
- "kit": true
7
+ "kit": true,
8
+ "scaffold": {
9
+ "mainHandWritten": true,
10
+ "reason": "its entry also binds Tab so the browser cannot move focus off the canvas; the restamp cannot express that statement, so the file stays the kit's"
11
+ }
8
12
  }
@@ -19,9 +19,9 @@
19
19
  "format:check": "biome format src"
20
20
  },
21
21
  "dependencies": {
22
- "@threenative/core": "0.3.11",
23
- "@threenative/physics": "0.3.11",
24
- "@threenative/ui": "0.3.11",
22
+ "@threenative/core": "0.3.13",
23
+ "@threenative/physics": "0.3.13",
24
+ "@threenative/ui": "0.3.13",
25
25
  "react": "19.2.0",
26
26
  "react-dom": "19.2.0",
27
27
  "three": "0.187.0"
@@ -30,11 +30,11 @@
30
30
  "@tailwindcss/vite": "4.3.3",
31
31
  "@vitejs/plugin-react": "6.0.5",
32
32
  "@types/three": "0.187.0",
33
- "@threenative/assets": "0.3.12",
34
- "@threenative/playtest": "0.3.11",
33
+ "@threenative/assets": "0.3.14",
34
+ "@threenative/playtest": "0.3.13",
35
35
  "@types/react": "19.2.0",
36
36
  "@types/react-dom": "19.2.0",
37
- "create-threenative": "0.2.15",
37
+ "create-threenative": "0.2.18",
38
38
  "esbuild": "0.27.0",
39
39
  "playwright": "1.62.1",
40
40
  "tailwindcss": "4.3.3",
@@ -45,7 +45,7 @@
45
45
  "eslint": "10.13.0"
46
46
  },
47
47
  "optionalDependencies": {
48
- "@threenative/runtime-native": "0.3.11"
48
+ "@threenative/runtime-native": "0.3.13"
49
49
  },
50
50
  "overrides": {
51
51
  "sharp": ">=0.35.4",
@@ -41,7 +41,7 @@ const game = defineGame<GameState, IPhysicsContext>({
41
41
  // of each 20 fps frame re-simulating, which made the next frame slower still.
42
42
  maxSteps: 2,
43
43
  display: config.display,
44
- render: config.renderer,
44
+ renderer: config.renderer,
45
45
  scenes: { play: Play },
46
46
  seed: 1986,
47
47
  start: "play",
@@ -2,6 +2,10 @@
2
2
 
3
3
  @source "../index.html";
4
4
  @source "./";
5
+ /* `src/render/` is shader and material source: a word in its comments ("blur", "filter",
6
+ "table") became a real utility rule, which is what made a clean HUD look like a native-css
7
+ profile failure. Tailwind scans what it is told to scan. */
8
+ @source not "./render";
5
9
 
6
10
  @theme {
7
11
  --color-ink: #1d3a5c;