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.
- package/agent-docs/kit-mcp.md +10 -0
- package/agent-docs/kit-router.md +14 -0
- package/agent-docs/kit-stuck.md +7 -0
- package/agent-docs/references/assertion-reference.md +54 -110
- package/agent-docs/references/capability-reference.md +1740 -254
- package/agent-docs/references/conventions.md +299 -0
- package/agent-docs/references/kit-action-rpg.md +40 -0
- package/agent-docs/references/kit-adventure.md +40 -0
- package/agent-docs/references/kit-collectathon.md +38 -0
- package/agent-docs/references/kit-kart.md +31 -0
- package/agent-docs/references/kit-minimal.md +29 -0
- package/agent-docs/references/kit-platformer.md +34 -0
- package/agent-docs/references/kit-puzzle.md +22 -0
- package/agent-docs/references/kit-racing.md +26 -0
- package/agent-docs/references/kit-rain.md +31 -0
- package/agent-docs/references/kit-rts.md +34 -0
- package/agent-docs/references/kit-runner.md +32 -0
- package/agent-docs/references/kit-sailing.md +41 -0
- package/agent-docs/references/kit-shooter.md +33 -0
- package/agent-docs/references/kit-snow.md +33 -0
- package/agent-docs/references/kit-starter.md +55 -0
- package/agent-docs/references/kit-tower-defense.md +27 -0
- package/agent-docs/references/performance-basics.md +8 -4
- package/agent-docs/references/terrain-authoring.md +2 -1
- package/agent-files/.agents/skills/ponytail/SKILL.md +1 -1
- package/agent-files/.agents/skills/prd-creator/SKILL.md +3 -2
- package/agent-files/.agents/skills/threenative-capabilities/SKILL.md +84 -59
- package/agent-files/.claude/hooks/discovery-gate.mjs +125 -0
- package/agent-files/.claude/hooks/ponytail-context.mjs +1 -1
- package/agent-files/.claude/settings.json +25 -0
- package/agent-files/.codex/hooks.json +18 -1
- package/dist/index.d.ts +97 -6
- package/dist/index.js +899 -271
- package/dist/terrain-kit.d.ts +7 -0
- package/dist/terrain-kit.js +82 -0
- package/dist/threenative.js +114 -16
- package/dist/web-engine-ccd-ik-solver.js +127 -0
- package/dist/web-engine-gltf-loader.js +71 -20
- package/dist/web-engine-post-effects.js +39 -14
- package/dist/web-engine-runtime.js +10011 -4101
- package/package.json +15 -9
- package/template-assets/clearwater/README.md +1 -1
- package/template-assets/patches/manifest.json +18 -0
- package/template-assets/patches/three@0.187.0.patch +2004 -407
- package/template-assets/terrain/alpine/assets.json +12 -0
- package/template-assets/terrain/alpine/bake.mjs +6 -0
- package/template-assets/terrain/alpine/credits.json +164 -0
- package/template-assets/terrain/alpine/heightmap.r16 +0 -0
- package/template-assets/terrain/alpine/recipe.json +119 -0
- package/template-assets/terrain/alpine/surface.json +53 -0
- package/template-assets/terrain/coastal/assets.json +11 -0
- package/template-assets/terrain/coastal/bake.mjs +6 -0
- package/template-assets/terrain/coastal/credits.json +117 -0
- package/template-assets/terrain/coastal/heightmap.r16 +0 -0
- package/template-assets/terrain/coastal/recipe.json +113 -0
- package/template-assets/terrain/coastal/surface.json +41 -0
- package/template-assets/terrain/desert/assets.json +12 -0
- package/template-assets/terrain/desert/bake.mjs +6 -0
- package/template-assets/terrain/desert/credits.json +164 -0
- package/template-assets/terrain/desert/heightmap.r16 +0 -0
- package/template-assets/terrain/desert/recipe.json +108 -0
- package/template-assets/terrain/desert/surface.json +54 -0
- package/template-assets/terrain/forest/assets.json +65 -0
- package/template-assets/terrain/forest/bake.mjs +8 -0
- package/template-assets/terrain/forest/credits.json +225 -0
- package/template-assets/terrain/forest/heightmap.r16 +0 -0
- package/template-assets/terrain/forest/recipe.json +350 -0
- package/template-assets/terrain/forest/surface.json +79 -0
- package/template-assets/terrain/tundra/assets.json +12 -0
- package/template-assets/terrain/tundra/bake.mjs +6 -0
- package/template-assets/terrain/tundra/credits.json +164 -0
- package/template-assets/terrain/tundra/heightmap.r16 +0 -0
- package/template-assets/terrain/tundra/recipe.json +277 -0
- package/template-assets/terrain/tundra/surface.json +54 -0
- package/templates/action-rpg/AGENTS.md +103 -84
- package/templates/action-rpg/CLAUDE.md +103 -84
- package/templates/action-rpg/kit.json +1 -0
- package/templates/action-rpg/package.json +7 -7
- package/templates/action-rpg/playtests/spells.playtest.json +20 -0
- package/templates/action-rpg/src/game.ts +2 -1
- package/templates/action-rpg/src/render/atmosphere.ts +11 -16
- package/templates/action-rpg/src/render/backlightControls.ts +10 -0
- package/templates/action-rpg/src/render/backlightMaterial.ts +4 -4
- package/templates/action-rpg/src/render/clouds.ts +13 -0
- package/templates/action-rpg/src/render/gpuSky.ts +4 -7
- package/templates/action-rpg/src/render/materialLighting.ts +5 -5
- package/templates/action-rpg/src/render/quality.ts +10 -33
- package/templates/action-rpg/src/scenes/Play.ts +30 -1
- package/templates/action-rpg/src/style.css +4 -0
- package/templates/action-rpg/src/ui/AbilityBar.tsx +1 -1
- package/templates/action-rpg/threenative.config.ts +0 -3
- package/templates/action-rpg/vite.config.ts +2 -0
- package/templates/adventure/AGENTS.md +92 -44
- package/templates/adventure/CLAUDE.md +92 -44
- package/templates/adventure/kit.json +5 -1
- package/templates/adventure/package.json +7 -7
- package/templates/adventure/src/game.ts +1 -1
- package/templates/adventure/src/style.css +4 -0
- package/templates/adventure/tsconfig.json +1 -1
- package/templates/adventure/vite.config.ts +2 -0
- package/templates/collectathon/AGENTS.md +93 -42
- package/templates/collectathon/CLAUDE.md +93 -42
- package/templates/collectathon/package.json +7 -7
- package/templates/collectathon/src/game.ts +1 -1
- package/templates/collectathon/src/level/Course.ts +55 -9
- package/templates/collectathon/src/level/terrain.ts +27 -6
- package/templates/collectathon/src/main.ts +1 -0
- package/templates/collectathon/src/render/foliage.ts +359 -98
- package/templates/collectathon/src/render/sky.ts +76 -12
- package/templates/collectathon/src/render/water.ts +32 -10
- package/templates/collectathon/src/scenes/Play.ts +18 -5
- package/templates/collectathon/src/style.css +4 -0
- package/templates/collectathon/tsconfig.json +1 -1
- package/templates/collectathon/vite.config.ts +2 -0
- package/templates/kart/AGENTS.md +87 -42
- package/templates/kart/CLAUDE.md +87 -42
- package/templates/kart/package.json +6 -6
- package/templates/kart/src/game.ts +1 -1
- package/templates/kart/src/main.ts +1 -0
- package/templates/kart/src/style.css +4 -0
- package/templates/kart/tsconfig.json +1 -1
- package/templates/kart/vite.config.ts +2 -0
- package/templates/minimal/AGENTS.md +105 -84
- package/templates/minimal/CLAUDE.md +105 -84
- package/templates/minimal/package.json +6 -6
- package/templates/minimal/playtests/stands-still.playtest.json +30 -0
- package/templates/minimal/src/game.ts +1 -1
- package/templates/minimal/src/render/atmosphere.ts +11 -16
- package/templates/minimal/src/render/backlightControls.ts +10 -0
- package/templates/minimal/src/render/backlightMaterial.ts +4 -4
- package/templates/minimal/src/render/camera.ts +13 -2
- package/templates/minimal/src/render/clouds.ts +13 -0
- package/templates/minimal/src/render/gpuSky.ts +4 -7
- package/templates/minimal/src/render/lighting.ts +4 -2
- package/templates/minimal/src/render/materialLighting.ts +5 -5
- package/templates/minimal/src/render/materials.ts +10 -0
- package/templates/minimal/src/render/quality.ts +7 -32
- package/templates/minimal/src/scenes/Play.ts +4 -1
- package/templates/minimal/vite.config.ts +7 -1
- package/templates/platformer/AGENTS.md +95 -46
- package/templates/platformer/CLAUDE.md +95 -46
- package/templates/platformer/index.html +1 -1
- package/templates/platformer/main.html +12 -0
- package/templates/platformer/package.json +7 -7
- package/templates/platformer/playtests/gamepad-idle.playtest.json +21 -0
- package/templates/platformer/playtests/gamepad.playtest.json +30 -0
- package/templates/platformer/src/entities/Fox.ts +21 -6
- package/templates/platformer/src/game.ts +1 -1
- package/templates/platformer/src/main.ts +1 -0
- package/templates/platformer/src/render/backlightControls.ts +10 -0
- package/templates/platformer/src/render/backlightMaterial.ts +4 -4
- package/templates/platformer/src/render/materialLighting.ts +5 -5
- package/templates/platformer/src/render/quality.ts +7 -32
- package/templates/platformer/src/scenes/Play.ts +2 -1
- package/templates/platformer/src/style.css +4 -0
- package/templates/platformer/src/worker-page.ts +29 -0
- package/templates/platformer/src/worker.ts +5 -0
- package/templates/platformer/tsconfig.json +1 -1
- package/templates/platformer/vite.config.ts +4 -0
- package/templates/puzzle/AGENTS.md +97 -80
- package/templates/puzzle/CLAUDE.md +97 -80
- package/templates/puzzle/package.json +7 -7
- package/templates/puzzle/src/game.ts +1 -1
- package/templates/puzzle/src/render/backlightControls.ts +10 -0
- package/templates/puzzle/src/render/backlightMaterial.ts +4 -4
- package/templates/puzzle/src/render/materialLighting.ts +5 -5
- package/templates/puzzle/src/render/quality.ts +7 -32
- package/templates/puzzle/src/scenes/Play.ts +1 -1
- package/templates/puzzle/src/style.css +4 -0
- package/templates/puzzle/tsconfig.json +1 -1
- package/templates/puzzle/vite.config.ts +2 -0
- package/templates/racing/AGENTS.md +100 -82
- package/templates/racing/CLAUDE.md +100 -82
- package/templates/racing/package.json +7 -7
- package/templates/racing/src/game.ts +1 -1
- package/templates/racing/src/render/atmosphere.ts +11 -16
- package/templates/racing/src/render/backlightControls.ts +10 -0
- package/templates/racing/src/render/backlightMaterial.ts +4 -4
- package/templates/racing/src/render/clouds.ts +13 -0
- package/templates/racing/src/render/gpuSky.ts +4 -7
- package/templates/racing/src/render/materialLighting.ts +5 -5
- package/templates/racing/src/render/quality.ts +7 -32
- package/templates/racing/src/scenes/Race.ts +4 -1
- package/templates/racing/src/style.css +4 -0
- package/templates/racing/tsconfig.json +1 -1
- package/templates/racing/vite.config.ts +2 -0
- package/templates/rain/AGENTS.md +96 -84
- package/templates/rain/CLAUDE.md +96 -84
- package/templates/rain/native-playtests/lightning.playtest.json +85 -10
- package/templates/rain/package.json +6 -6
- package/templates/rain/playtests/reduced-motion.playtest.json +6 -0
- package/templates/rain/src/game.ts +1 -1
- package/templates/rain/src/scenes/Boot.ts +1 -0
- package/templates/rain/src/state.ts +7 -0
- package/templates/rain/src/ui/GameUi.tsx +7 -1
- package/templates/rain/vite.config.ts +6 -0
- package/templates/rts/AGENTS.md +100 -85
- package/templates/rts/CLAUDE.md +100 -85
- package/templates/rts/package.json +6 -6
- package/templates/rts/src/game.ts +1 -1
- package/templates/rts/src/render/backlightControls.ts +10 -0
- package/templates/rts/src/render/backlightMaterial.ts +4 -4
- package/templates/rts/src/render/materialLighting.ts +5 -5
- package/templates/rts/src/render/quality.ts +7 -31
- package/templates/rts/src/scenes/Play.ts +1 -1
- package/templates/rts/src/style.css +4 -0
- package/templates/rts/vite.config.ts +2 -0
- package/templates/runner/AGENTS.md +97 -80
- package/templates/runner/CLAUDE.md +97 -80
- package/templates/runner/package.json +7 -7
- package/templates/runner/playtests/performance.playtest.json +1 -1
- package/templates/runner/src/game.ts +1 -1
- package/templates/runner/src/render/atmosphere.ts +11 -16
- package/templates/runner/src/render/backlightControls.ts +10 -0
- package/templates/runner/src/render/backlightMaterial.ts +4 -4
- package/templates/runner/src/render/clouds.ts +13 -0
- package/templates/runner/src/render/gpuSky.ts +4 -7
- package/templates/runner/src/render/lighting.ts +53 -11
- package/templates/runner/src/render/materialLighting.ts +5 -5
- package/templates/runner/src/render/quality.ts +7 -32
- package/templates/runner/src/scenes/Run.ts +8 -4
- package/templates/runner/src/style.css +4 -0
- package/templates/runner/threenative.config.ts +0 -3
- package/templates/runner/tsconfig.json +1 -1
- package/templates/runner/vite.config.ts +2 -0
- package/templates/sailing/AGENTS.md +96 -79
- package/templates/sailing/CLAUDE.md +96 -79
- package/templates/sailing/package.json +7 -7
- package/templates/sailing/playtests/sails.playtest.json +1 -0
- package/templates/sailing/src/game.ts +1 -1
- package/templates/sailing/src/render/backlightControls.ts +10 -0
- package/templates/sailing/src/render/backlightMaterial.ts +4 -4
- package/templates/sailing/src/render/environmentSetup.ts +1 -1
- package/templates/sailing/src/render/materialLighting.ts +5 -5
- package/templates/sailing/src/render/quality.ts +7 -32
- package/templates/sailing/src/render/sky.ts +4 -0
- package/templates/sailing/src/style.css +5 -0
- package/templates/sailing/threenative.config.ts +0 -3
- package/templates/sailing/vite.config.ts +6 -0
- package/templates/shooter/AGENTS.md +97 -68
- package/templates/shooter/CLAUDE.md +97 -68
- package/templates/shooter/package.json +7 -7
- package/templates/shooter/src/game.ts +3 -2
- package/templates/shooter/src/render/atmosphere.ts +11 -16
- package/templates/shooter/src/render/backlightControls.ts +10 -0
- package/templates/shooter/src/render/backlightMaterial.ts +4 -4
- package/templates/shooter/src/render/clouds.ts +13 -0
- package/templates/shooter/src/render/gpuSky.ts +4 -7
- package/templates/shooter/src/render/materialLighting.ts +5 -5
- package/templates/shooter/src/render/quality.ts +10 -33
- package/templates/shooter/src/scenes/Play.ts +4 -1
- package/templates/shooter/src/style.css +4 -0
- package/templates/shooter/vite.config.ts +2 -0
- package/templates/snow/AGENTS.md +95 -76
- package/templates/snow/CLAUDE.md +95 -76
- package/templates/snow/package.json +7 -7
- package/templates/snow/src/game.ts +1 -1
- package/templates/snow/src/render/backlightControls.ts +10 -0
- package/templates/snow/src/render/backlightMaterial.ts +4 -4
- package/templates/snow/src/render/materialLighting.ts +5 -5
- package/templates/snow/src/render/quality.ts +7 -32
- package/templates/snow/src/style.css +5 -0
- package/templates/snow/threenative.config.ts +0 -3
- package/templates/snow/vite.config.ts +6 -0
- package/templates/starter/AGENTS.md +109 -88
- package/templates/starter/CLAUDE.md +109 -88
- package/templates/starter/native-playtests/render-chain.playtest.json +24 -24
- package/templates/starter/native-playtests/smooth-motion.playtest.json +3 -3
- package/templates/starter/package.json +7 -7
- package/templates/starter/src/entities/Crate.ts +5 -2
- package/templates/starter/src/entities/Player.ts +10 -22
- package/templates/starter/src/game.ts +4 -3
- package/templates/starter/src/render/adaptiveQuality.ts +17 -0
- package/templates/starter/src/render/atmosphere.ts +11 -16
- package/templates/starter/src/render/backlightControls.ts +10 -0
- package/templates/starter/src/render/backlightMaterial.ts +4 -4
- package/templates/starter/src/render/clouds.ts +13 -0
- package/templates/starter/src/render/contactShadow.ts +1 -1
- package/templates/starter/src/render/gpuSky.ts +4 -7
- package/templates/starter/src/render/lighting.ts +54 -4
- package/templates/starter/src/render/materialLighting.ts +5 -5
- package/templates/starter/src/render/postprocessing.ts +11 -10
- package/templates/starter/src/render/quality.ts +14 -1
- package/templates/starter/src/render/temporalAA.ts +8 -7
- package/templates/starter/src/render/temporalAAFrame.ts +30 -9
- package/templates/starter/src/render/temporalAAResolve.ts +15 -1
- package/templates/starter/src/render/temporalClampRelease.ts +183 -0
- package/templates/starter/src/render/temporalHistoryResolve.ts +90 -0
- package/templates/starter/src/render/temporalMoire.ts +190 -0
- package/templates/starter/src/render/temporalResolve.ts +75 -16
- package/templates/starter/src/render/temporalResolveDepth.ts +2 -0
- package/templates/starter/src/scenes/Play.ts +53 -32
- package/templates/starter/src/state.ts +2 -0
- package/templates/starter/src/style.css +4 -0
- package/templates/starter/src/ui/Menu.tsx +5 -1
- package/templates/starter/vite.config.ts +2 -0
- package/templates/tower-defense/AGENTS.md +97 -81
- package/templates/tower-defense/CLAUDE.md +97 -81
- package/templates/tower-defense/package.json +7 -7
- package/templates/tower-defense/src/game.ts +1 -1
- package/templates/tower-defense/src/render/backlightControls.ts +10 -0
- package/templates/tower-defense/src/render/backlightMaterial.ts +4 -4
- package/templates/tower-defense/src/render/materialLighting.ts +5 -5
- package/templates/tower-defense/src/render/quality.ts +7 -32
- package/templates/tower-defense/src/scenes/Battle.ts +1 -1
- package/templates/tower-defense/src/style.css +4 -0
- package/templates/tower-defense/tsconfig.json +1 -1
- package/templates/tower-defense/vite.config.ts +2 -0
- package/capabilities.json +0 -9197
- package/templates/AGENTS.md +0 -21
- package/templates/CLAUDE.md +0 -23
- package/templates/action-rpg/.codex/config.toml +0 -23
- package/templates/action-rpg/.cursor/mcp.json +0 -38
- package/templates/action-rpg/.gemini/settings.json +0 -38
- package/templates/action-rpg/.mcp.json +0 -38
- package/templates/action-rpg/.vscode/mcp.json +0 -43
- package/templates/action-rpg/.zed/settings.json +0 -43
- package/templates/action-rpg/opencode.json +0 -49
- package/templates/action-rpg/src/render/environmentContribution.ts +0 -188
- package/templates/action-rpg/src/render/environmentRadiance.ts +0 -36
- package/templates/action-rpg/src/render/environmentSampleCache.ts +0 -43
- package/templates/action-rpg/src/render/environmentSampling.ts +0 -193
- package/templates/action-rpg/src/render/environmentSnapshot.ts +0 -53
- package/templates/adventure/.codex/config.toml +0 -23
- package/templates/adventure/.cursor/mcp.json +0 -38
- package/templates/adventure/.gemini/settings.json +0 -38
- package/templates/adventure/.mcp.json +0 -38
- package/templates/adventure/.vscode/mcp.json +0 -43
- package/templates/adventure/.zed/settings.json +0 -43
- package/templates/adventure/opencode.json +0 -49
- package/templates/collectathon/.codex/config.toml +0 -23
- package/templates/collectathon/.cursor/mcp.json +0 -38
- package/templates/collectathon/.gemini/settings.json +0 -38
- package/templates/collectathon/.mcp.json +0 -38
- package/templates/collectathon/.vscode/mcp.json +0 -43
- package/templates/collectathon/.zed/settings.json +0 -43
- package/templates/collectathon/opencode.json +0 -49
- package/templates/kart/.codex/config.toml +0 -23
- package/templates/kart/.cursor/mcp.json +0 -38
- package/templates/kart/.gemini/settings.json +0 -38
- package/templates/kart/.mcp.json +0 -38
- package/templates/kart/.vscode/mcp.json +0 -43
- package/templates/kart/.zed/settings.json +0 -43
- package/templates/kart/opencode.json +0 -49
- package/templates/minimal/.codex/config.toml +0 -23
- package/templates/minimal/.cursor/mcp.json +0 -38
- package/templates/minimal/.gemini/settings.json +0 -38
- package/templates/minimal/.mcp.json +0 -38
- package/templates/minimal/.vscode/mcp.json +0 -43
- package/templates/minimal/.zed/settings.json +0 -43
- package/templates/minimal/opencode.json +0 -49
- package/templates/minimal/src/render/environmentContribution.ts +0 -188
- package/templates/minimal/src/render/environmentRadiance.ts +0 -36
- package/templates/minimal/src/render/environmentSampleCache.ts +0 -43
- package/templates/minimal/src/render/environmentSampling.ts +0 -193
- package/templates/minimal/src/render/environmentSnapshot.ts +0 -53
- package/templates/platformer/.codex/config.toml +0 -23
- package/templates/platformer/.cursor/mcp.json +0 -38
- package/templates/platformer/.gemini/settings.json +0 -38
- package/templates/platformer/.mcp.json +0 -38
- package/templates/platformer/.vscode/mcp.json +0 -43
- package/templates/platformer/.zed/settings.json +0 -43
- package/templates/platformer/opencode.json +0 -49
- package/templates/platformer/src/render/environmentContribution.ts +0 -188
- package/templates/platformer/src/render/environmentRadiance.ts +0 -36
- package/templates/platformer/src/render/environmentSampleCache.ts +0 -43
- package/templates/platformer/src/render/environmentSampling.ts +0 -193
- package/templates/platformer/src/render/environmentSnapshot.ts +0 -53
- package/templates/puzzle/.codex/config.toml +0 -23
- package/templates/puzzle/.cursor/mcp.json +0 -38
- package/templates/puzzle/.gemini/settings.json +0 -38
- package/templates/puzzle/.mcp.json +0 -38
- package/templates/puzzle/.vscode/mcp.json +0 -43
- package/templates/puzzle/.zed/settings.json +0 -43
- package/templates/puzzle/opencode.json +0 -49
- package/templates/puzzle/src/render/environmentContribution.ts +0 -188
- package/templates/puzzle/src/render/environmentRadiance.ts +0 -36
- package/templates/puzzle/src/render/environmentSampleCache.ts +0 -43
- package/templates/puzzle/src/render/environmentSampling.ts +0 -193
- package/templates/puzzle/src/render/environmentSnapshot.ts +0 -53
- package/templates/racing/.codex/config.toml +0 -23
- package/templates/racing/.cursor/mcp.json +0 -38
- package/templates/racing/.gemini/settings.json +0 -38
- package/templates/racing/.mcp.json +0 -38
- package/templates/racing/.vscode/mcp.json +0 -43
- package/templates/racing/.zed/settings.json +0 -43
- package/templates/racing/opencode.json +0 -49
- package/templates/racing/src/render/environmentContribution.ts +0 -188
- package/templates/racing/src/render/environmentRadiance.ts +0 -36
- package/templates/racing/src/render/environmentSampleCache.ts +0 -43
- package/templates/racing/src/render/environmentSampling.ts +0 -193
- package/templates/racing/src/render/environmentSnapshot.ts +0 -53
- package/templates/rain/.codex/config.toml +0 -23
- package/templates/rain/.cursor/mcp.json +0 -38
- package/templates/rain/.gemini/settings.json +0 -38
- package/templates/rain/.mcp.json +0 -38
- package/templates/rain/.vscode/mcp.json +0 -43
- package/templates/rain/.zed/settings.json +0 -43
- package/templates/rain/opencode.json +0 -49
- package/templates/rts/.codex/config.toml +0 -23
- package/templates/rts/.cursor/mcp.json +0 -38
- package/templates/rts/.gemini/settings.json +0 -38
- package/templates/rts/.mcp.json +0 -38
- package/templates/rts/.vscode/mcp.json +0 -43
- package/templates/rts/.zed/settings.json +0 -43
- package/templates/rts/opencode.json +0 -49
- package/templates/rts/src/render/environmentContribution.ts +0 -188
- package/templates/rts/src/render/environmentRadiance.ts +0 -36
- package/templates/rts/src/render/environmentSampleCache.ts +0 -43
- package/templates/rts/src/render/environmentSampling.ts +0 -193
- package/templates/rts/src/render/environmentSnapshot.ts +0 -53
- package/templates/runner/.codex/config.toml +0 -23
- package/templates/runner/.cursor/mcp.json +0 -38
- package/templates/runner/.gemini/settings.json +0 -38
- package/templates/runner/.mcp.json +0 -38
- package/templates/runner/.vscode/mcp.json +0 -43
- package/templates/runner/.zed/settings.json +0 -43
- package/templates/runner/README.md +0 -43
- package/templates/runner/opencode.json +0 -49
- package/templates/runner/src/render/environmentContribution.ts +0 -188
- package/templates/runner/src/render/environmentRadiance.ts +0 -36
- package/templates/runner/src/render/environmentSampleCache.ts +0 -43
- package/templates/runner/src/render/environmentSampling.ts +0 -193
- package/templates/runner/src/render/environmentSnapshot.ts +0 -53
- package/templates/sailing/.codex/config.toml +0 -23
- package/templates/sailing/.cursor/mcp.json +0 -38
- package/templates/sailing/.gemini/settings.json +0 -38
- package/templates/sailing/.mcp.json +0 -38
- package/templates/sailing/.vscode/mcp.json +0 -43
- package/templates/sailing/.zed/settings.json +0 -43
- package/templates/sailing/README.md +0 -28
- package/templates/sailing/opencode.json +0 -49
- package/templates/sailing/src/render/environmentContribution.ts +0 -188
- package/templates/sailing/src/render/environmentRadiance.ts +0 -36
- package/templates/sailing/src/render/environmentSampleCache.ts +0 -43
- package/templates/sailing/src/render/environmentSampling.ts +0 -193
- package/templates/sailing/src/render/environmentSnapshot.ts +0 -53
- package/templates/shooter/.codex/config.toml +0 -23
- package/templates/shooter/.cursor/mcp.json +0 -38
- package/templates/shooter/.gemini/settings.json +0 -38
- package/templates/shooter/.mcp.json +0 -38
- package/templates/shooter/.vscode/mcp.json +0 -43
- package/templates/shooter/.zed/settings.json +0 -43
- package/templates/shooter/opencode.json +0 -49
- package/templates/shooter/src/render/environmentContribution.ts +0 -188
- package/templates/shooter/src/render/environmentRadiance.ts +0 -36
- package/templates/shooter/src/render/environmentSampleCache.ts +0 -43
- package/templates/shooter/src/render/environmentSampling.ts +0 -193
- package/templates/shooter/src/render/environmentSnapshot.ts +0 -53
- package/templates/snow/.codex/config.toml +0 -23
- package/templates/snow/.cursor/mcp.json +0 -38
- package/templates/snow/.gemini/settings.json +0 -38
- package/templates/snow/.mcp.json +0 -38
- package/templates/snow/.vscode/mcp.json +0 -43
- package/templates/snow/.zed/settings.json +0 -43
- package/templates/snow/README.md +0 -26
- package/templates/snow/opencode.json +0 -49
- package/templates/snow/src/render/environmentContribution.ts +0 -188
- package/templates/snow/src/render/environmentRadiance.ts +0 -36
- package/templates/snow/src/render/environmentSampleCache.ts +0 -43
- package/templates/snow/src/render/environmentSampling.ts +0 -193
- package/templates/snow/src/render/environmentSnapshot.ts +0 -53
- package/templates/starter/.codex/config.toml +0 -23
- package/templates/starter/.cursor/mcp.json +0 -38
- package/templates/starter/.gemini/settings.json +0 -38
- package/templates/starter/.mcp.json +0 -38
- package/templates/starter/.vscode/mcp.json +0 -43
- package/templates/starter/.zed/settings.json +0 -43
- package/templates/starter/opencode.json +0 -49
- package/templates/starter/src/render/environmentContribution.ts +0 -188
- package/templates/starter/src/render/environmentRadiance.ts +0 -36
- package/templates/starter/src/render/environmentSampleCache.ts +0 -43
- package/templates/starter/src/render/environmentSampling.ts +0 -193
- package/templates/starter/src/render/environmentSnapshot.ts +0 -53
- package/templates/starter/src/render/rendererGate.ts +0 -36
- package/templates/tower-defense/.codex/config.toml +0 -23
- package/templates/tower-defense/.cursor/mcp.json +0 -38
- package/templates/tower-defense/.gemini/settings.json +0 -38
- package/templates/tower-defense/.mcp.json +0 -38
- package/templates/tower-defense/.vscode/mcp.json +0 -43
- package/templates/tower-defense/.zed/settings.json +0 -43
- package/templates/tower-defense/README.md +0 -16
- package/templates/tower-defense/opencode.json +0 -49
- package/templates/tower-defense/src/render/environmentContribution.ts +0 -188
- package/templates/tower-defense/src/render/environmentRadiance.ts +0 -36
- package/templates/tower-defense/src/render/environmentSampleCache.ts +0 -43
- package/templates/tower-defense/src/render/environmentSampling.ts +0 -193
- package/templates/tower-defense/src/render/environmentSnapshot.ts +0 -53
|
@@ -1,91 +1,116 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: threenative-capabilities
|
|
3
|
-
description: Route ThreeNative authoring: new
|
|
3
|
+
description: Route ThreeNative authoring: the kit AGENTS.md "Authoring flow" in detail. A new game follows kit, mechanics, built-ins, plan, assets, build, prove and report; a change to an existing game searches built-ins for each change and references for each gameplay mechanic.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# ThreeNative authoring route
|
|
7
7
|
|
|
8
|
-
This is the critical planning prerequisite for a new game and the routing entry for an
|
|
9
|
-
game.
|
|
10
|
-
|
|
8
|
+
This is the critical planning prerequisite for a new game and the routing entry for a change to an
|
|
9
|
+
existing game. The kit `AGENTS.md` "Authoring flow" lists the same eight steps with the exact calls;
|
|
10
|
+
this skill holds the detail. Classify the user's intent using the current project and plan: starter
|
|
11
|
+
code alone does not make a new-game request an existing-game change. Ask if intent is ambiguous.
|
|
11
12
|
Preserve the request's distinctive fantasy and infer concrete mechanics, not just a genre label.
|
|
12
13
|
|
|
13
|
-
**Tools.** Every server named below is in this game's `.mcp.json
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
14
|
+
**Tools.** Every server named below is in this game's `.mcp.json`. A session started in this folder
|
|
15
|
+
has them, and they can show as deferred: load them with `ToolSearch` `select:` plus the exact names,
|
|
16
|
+
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`.
|
|
17
|
+
A session started elsewhere (one that ran `create-threenative`) has none of them in its tool list:
|
|
18
|
+
run `node node_modules/@threenative/core/mcp/call.mjs <server> <tool> '<json>'` from this folder,
|
|
19
|
+
and `call.mjs <server>` lists that server's tools. A tool that is missing from your list never
|
|
20
|
+
skips its step.
|
|
18
21
|
|
|
19
22
|
## New game
|
|
20
23
|
|
|
21
|
-
Follow steps 1-8 in order; finish
|
|
22
|
-
|
|
24
|
+
Follow steps 1-8 in order; finish steps 2 and 3 before planning. Record actual results, including
|
|
25
|
+
explicit `none` with a reason; a blank result blocks plan approval. A session with no user
|
|
26
|
+
(`claude -p`, a script) records the plan and its assumptions, then continues; an interactive session
|
|
27
|
+
waits for approval. A hook blocks the first new file under `src/` until step 3 ran for the current
|
|
28
|
+
prompt (`TN_DISCOVERY_GATE=off` opts out).
|
|
23
29
|
|
|
24
|
-
1. **
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
the
|
|
30
|
+
1. **Kit** — read the user's complete request and any supplied reference image. Call
|
|
31
|
+
`engine_search_capabilities` with `scope: "request"` for the complete request: it returns the
|
|
32
|
+
matching starter kit first, with its `npx create-threenative <dir> --template <name>` command.
|
|
33
|
+
Inspect the installed `create-threenative` template `kit.json` fields and exact `--genre`
|
|
34
|
+
routing. Choose a matching kit; if no kit matches, use `minimal` (`--template minimal`). Record
|
|
35
|
+
the kit and why it fits. Keep the chosen kit's source as the starting point.
|
|
36
|
+
2. **Mechanics** — threenative-reverse-engineer is the mechanics-reference role: the
|
|
37
|
+
`threenative-engine` MCP serves it through `engine_search_references` and
|
|
30
38
|
`engine_reference_detail`. Search named games and the implied mechanics, inspect relevant
|
|
31
39
|
matches, and record pinned sources and feel rules. For Tier-2 matches, read the pinned repo
|
|
32
40
|
and use `engine_save_reference` for the nodes/cards actually walked; unavailable references
|
|
33
41
|
remain `none: references unavailable`, not fabricated matches.
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
42
|
+
A card states the numbers, never the arc. When the plan turns on how a mechanic looks moving
|
|
43
|
+
(jump arc, parry window, camera lag, hit reaction), watch a reference instead of inventing the
|
|
44
|
+
motion: `engine_watch_reference {query: "<game> <mechanic>", duration, frames}` returns a
|
|
45
|
+
`sheet.jpg` holding every frame in order; read it, then aim with `pick`, `from` and `at` when the
|
|
46
|
+
first sheet is a menu instead of gameplay. It needs `yt-dlp` and `ffmpeg`. Without the tool, fetch
|
|
47
|
+
`https://raw.githubusercontent.com/ThreeNativeHQ/threenative-reverse-engineer-mcp/main/scripts/watch.mjs`
|
|
48
|
+
and run it with `--duration 20 --frames 6`. Record the sheet path and the frame times with the
|
|
49
|
+
references. Frames are study material, not game assets: commit none of them, and cite a
|
|
50
|
+
mechanic from pinned `file:line`, never from a video. No network or no tools: record
|
|
51
|
+
`none: gameplay frames unavailable`.
|
|
52
|
+
3. **Built-ins** — engine_capabilities built-in discovery, served by the same MCP: call
|
|
53
|
+
`engine_search_capabilities` with `scope: "mechanic"` per mechanic, system or symptom, and read
|
|
54
|
+
every row — it carries the import path, signature, example, constraints, overrides and
|
|
55
|
+
deprecations, so call `engine_capability_detail` only for a symbol the search did not return.
|
|
56
|
+
Record installed capabilities and binding constraints. A
|
|
57
|
+
`verdict: "none"` means game-owned behavior in `src/`; do not rephrase until something matches.
|
|
58
|
+
These role names add no servers.
|
|
59
|
+
4. **Plan** — hand **Kit**, **Mechanics** and **References** to `prd-creator`. Plan the core loop
|
|
60
|
+
from both discovery passes, with controls, camera, state, acceptance checks, target platforms
|
|
61
|
+
and appearance/asset needs. With a user, get explicit approval and an instruction to implement
|
|
62
|
+
before downloads or game-source edits. Required texture selection follows the plan.
|
|
63
|
+
5. **Assets** — use threenative-asset-mcp (configured as `threenative-assets`).
|
|
64
|
+
From the mechanics matches and reference image, if provided, identify only the textures needed by the plan. Call
|
|
65
|
+
`asset_search_sources`, the returned source's search/list-files tools, then
|
|
46
66
|
`asset_download_file`; verify the returned licence and record downloaded paths/source/licence
|
|
47
67
|
in `CREDITS.md`. Follow `.agents/skills/threenative-assets/SKILL.md`; no unrelated downloads or
|
|
48
68
|
invented tool results. If no textures are required, record `none` and why. Reuse existing files.
|
|
49
|
-
6. **
|
|
69
|
+
6. **Build** — execute the plan, delegate to subagents focused on specific areas. Give each a
|
|
50
70
|
bounded task, explicit file ownership, relevant context and an acceptance check; preserve other
|
|
51
71
|
writers and avoid a single catch-all worker. The coordinator reviews and integrates the areas
|
|
52
72
|
before step 7, resolving interfaces and failures rather than trusting worker reports. Use the
|
|
53
|
-
chosen kit, discovered capabilities and downloaded textures. Keep appearance in game-owned
|
|
54
|
-
`WorldEnvironment` defaults or explicitly report named overrides.
|
|
55
|
-
no code, level layouts, character names or art; cite pinned `file:line`
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
`.agents/skills/threenative-visuals/SKILL.md` and the installed
|
|
62
|
-
`node_modules/create-threenative/agent-docs/references/dream-loop.md
|
|
63
|
-
|
|
64
|
-
image was supplied, ask for a supplied
|
|
65
|
-
as that existing contract requires; do not
|
|
66
|
-
A missing target, capture or judgment is unverified,
|
|
67
|
-
`REQUEST_CHANGES` and `NOT_OBSERVED` block completion. Fix and
|
|
73
|
+
chosen kit, discovered capabilities and downloaded textures. Keep appearance in game-owned
|
|
74
|
+
`src/render/`; use stock `WorldEnvironment` defaults or explicitly report named overrides.
|
|
75
|
+
Borrow mechanics only: no code, level layouts, character names or art; cite pinned `file:line`
|
|
76
|
+
sources.
|
|
77
|
+
7. **Prove** — follow `.agents/skills/threenative-playtest/SKILL.md`. Execute a fail-closed
|
|
78
|
+
scenario for each core mechanic with observable state, real input actions and assertions. An
|
|
79
|
+
empty assertion set or missing observation fails; a screenshot is not mechanics proof. Repair
|
|
80
|
+
failures and rerun the affected scenario. Report only platforms actually run. After mechanics
|
|
81
|
+
pass, use `.agents/skills/threenative-visuals/SKILL.md` and the installed
|
|
82
|
+
`node_modules/create-threenative/agent-docs/references/dream-loop.md` for the
|
|
83
|
+
**Reference-image visual judge**: compare a fresh, nonblank gameplay capture against the supplied
|
|
84
|
+
reference image with a fresh read-only judge. If no image was supplied, ask for a supplied
|
|
85
|
+
target or an explicitly authorized image-tool route, as that existing contract requires; do not
|
|
86
|
+
invent a target or choose a provider/model. A missing target, capture or judgment is unverified,
|
|
87
|
+
not a pass. Require `PASS`; `REQUEST_CHANGES` and `NOT_OBSERVED` block completion. Fix and
|
|
88
|
+
rejudge against the same target.
|
|
89
|
+
8. **Report** — give the user the `pnpm dev` URL, play from the spawn, and quote `TN_FRAME_BUDGET`,
|
|
90
|
+
`TN_SCENE_WARNING` and `TN_RENDER_PROJECTION`. Name every step you skipped and why.
|
|
68
91
|
|
|
69
92
|
## Existing game
|
|
70
93
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
`prd-creator` just to restart the game plan. Do not add step 8 to this route. If another binding
|
|
74
|
-
project gate conflicts, ask the user rather than silently waiving or appending it.
|
|
94
|
+
A change to an existing game skips step 1 and whole-game planning; do not invoke `prd-creator` just
|
|
95
|
+
to restart the game plan. For each change, search before you write:
|
|
75
96
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
97
|
+
- Step 3 for every change: `engine_search_capabilities` with `scope: "mechanic"`, then read every
|
|
98
|
+
row — `engine_capability_detail` only for a symbol the search did not return — so installed
|
|
99
|
+
systems are reused.
|
|
100
|
+
- Step 2 for each gameplay mechanic the change adds or alters: `engine_search_references`, then
|
|
101
|
+
`engine_reference_detail`; use `engine_watch_reference` when the motion is the question.
|
|
102
|
+
- Steps 5-8 for the change, using the existing game, plan and context: apply step 5 to the
|
|
103
|
+
requested change (reuse current assets and download only missing required textures), step 6
|
|
104
|
+
with the same ownership and acceptance checks (a coordinator, no catch-all worker), step 7 for
|
|
105
|
+
affected mechanics and their related regressions (keep real captures where needed to observe the
|
|
106
|
+
change), and step 8 for the change.
|
|
107
|
+
|
|
108
|
+
Ask a targeted question if essential context is missing instead of restarting discovery. If another
|
|
109
|
+
binding project gate conflicts, ask the user rather than silently waiving or appending it.
|
|
85
110
|
|
|
86
111
|
Returned capability constraints are binding, including `@threenative/physics/navigation` subpaths
|
|
87
112
|
and platform support. Use `attachToBone` for held weapons (add a portable `Bone` named `RightHand`
|
|
88
113
|
when needed) rather than rebuilding installed systems. If MCP
|
|
89
114
|
is unavailable, run `npx threenative doctor`; for a new game's capability pass, use the installed
|
|
90
115
|
`node_modules/create-threenative/agent-docs/references/capability-reference.md` and report missing
|
|
91
|
-
services honestly.
|
|
116
|
+
services honestly.
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// Discovery gate (PRD-827). Each user prompt records its time; the first new file under `src/`
|
|
3
|
+
// after it is blocked until `.threenative/engine-mcp.log` holds an `engine_search_capabilities`
|
|
4
|
+
// line newer than that prompt. The engine server writes the log for MCP and `call.mjs` calls
|
|
5
|
+
// alike, so one script serves Claude Code and Codex. Edits to existing files pass.
|
|
6
|
+
// `TN_DISCOVERY_GATE=off` opts out and says so once per session.
|
|
7
|
+
import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
|
|
8
|
+
import path from "node:path";
|
|
9
|
+
|
|
10
|
+
const SEARCH =
|
|
11
|
+
'mcp__threenative-engine__engine_search_capabilities {"situation": "<the mechanic or change>", "scope": "mechanic"}';
|
|
12
|
+
const BRIDGE =
|
|
13
|
+
'node node_modules/@threenative/core/mcp/call.mjs threenative-engine engine_search_capabilities \'{"situation":"<the mechanic or change>"}\'';
|
|
14
|
+
|
|
15
|
+
function readJson(file, fallback) {
|
|
16
|
+
try {
|
|
17
|
+
return JSON.parse(readFileSync(file, "utf8"));
|
|
18
|
+
} catch {
|
|
19
|
+
return fallback;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/** Every path the tool call creates: `file_path`/`path` (Write, Edit) or `*** Add File:` lines
|
|
24
|
+
* in any string of the input (Codex `apply_patch`). */
|
|
25
|
+
function targets(input) {
|
|
26
|
+
const found = [];
|
|
27
|
+
const visit = (value) => {
|
|
28
|
+
if (typeof value === "string")
|
|
29
|
+
for (const match of value.matchAll(/^\*\*\* Add File: (.+)$/gmu)) found.push(match[1].trim());
|
|
30
|
+
else if (Array.isArray(value)) value.forEach(visit);
|
|
31
|
+
else if (value && typeof value === "object") Object.values(value).forEach(visit);
|
|
32
|
+
};
|
|
33
|
+
if (input && typeof input === "object") {
|
|
34
|
+
for (const key of ["file_path", "path"])
|
|
35
|
+
if (typeof input[key] === "string") found.push(input[key]);
|
|
36
|
+
}
|
|
37
|
+
visit(input);
|
|
38
|
+
return found;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
function newSourceFiles(root, input) {
|
|
42
|
+
return targets(input)
|
|
43
|
+
.map((file) => path.resolve(root, file))
|
|
44
|
+
.filter((absolute) => !existsSync(absolute))
|
|
45
|
+
.map((absolute) => path.relative(root, absolute).split(path.sep).join("/"))
|
|
46
|
+
.filter((relative) => relative.startsWith("src/"));
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
function respond(output) {
|
|
50
|
+
process.stdout.write(`${JSON.stringify(output)}\n`);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
function deny(reason) {
|
|
54
|
+
respond({
|
|
55
|
+
hookSpecificOutput: {
|
|
56
|
+
hookEventName: "PreToolUse",
|
|
57
|
+
permissionDecision: "deny",
|
|
58
|
+
permissionDecisionReason: reason,
|
|
59
|
+
},
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
function searchedSince(log, since) {
|
|
64
|
+
return log.split("\n").some((line) => {
|
|
65
|
+
if (!line.includes("engine_search_capabilities")) return false;
|
|
66
|
+
try {
|
|
67
|
+
const entry = JSON.parse(line);
|
|
68
|
+
return entry.tool === "engine_search_capabilities" && Date.parse(entry.time) > since;
|
|
69
|
+
} catch {
|
|
70
|
+
return false;
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
let input;
|
|
76
|
+
try {
|
|
77
|
+
input = JSON.parse(readFileSync(0, "utf8") || "{}");
|
|
78
|
+
} catch {
|
|
79
|
+
process.exit(0);
|
|
80
|
+
}
|
|
81
|
+
const root = process.env.CLAUDE_PROJECT_DIR || input.cwd || process.cwd();
|
|
82
|
+
const stateFile = path.join(root, ".threenative", "discovery-gate.json");
|
|
83
|
+
const state = readJson(stateFile, {});
|
|
84
|
+
const save = (next) => {
|
|
85
|
+
mkdirSync(path.dirname(stateFile), { recursive: true });
|
|
86
|
+
writeFileSync(stateFile, `${JSON.stringify(next)}\n`);
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
if (input.hook_event_name === "UserPromptSubmit") {
|
|
90
|
+
save({ ...state, prompt: new Date().toISOString() });
|
|
91
|
+
process.exit(0);
|
|
92
|
+
}
|
|
93
|
+
if (input.hook_event_name !== "PreToolUse") process.exit(0);
|
|
94
|
+
const created = newSourceFiles(root, input.tool_input);
|
|
95
|
+
if (created.length === 0) process.exit(0);
|
|
96
|
+
|
|
97
|
+
if (process.env.TN_DISCOVERY_GATE === "off") {
|
|
98
|
+
if (state.optOutSession !== input.session_id) {
|
|
99
|
+
save({ ...state, optOutSession: input.session_id });
|
|
100
|
+
respond({
|
|
101
|
+
hookSpecificOutput: {
|
|
102
|
+
hookEventName: "PreToolUse",
|
|
103
|
+
additionalContext:
|
|
104
|
+
"TN_DISCOVERY_GATE=off: the discovery gate is off for this session, so new src/ files are written without an engine capability search. Report this opt-out to the user.",
|
|
105
|
+
},
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
process.exit(0);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
const logFile = path.join(root, ".threenative", "engine-mcp.log");
|
|
112
|
+
let log;
|
|
113
|
+
try {
|
|
114
|
+
log = readFileSync(logFile, "utf8");
|
|
115
|
+
} catch (error) {
|
|
116
|
+
deny(
|
|
117
|
+
`Discovery gate: cannot read ${path.relative(root, logFile)} (${error.code ?? error.message}), so the engine was not searched in this project. Before you create ${created.join(", ")}, run ${SEARCH} and read every row; engine_capability_detail is only for a symbol the search did not return. Outside this folder: ${BRIDGE}. Opt out with TN_DISCOVERY_GATE=off.`,
|
|
118
|
+
);
|
|
119
|
+
process.exit(0);
|
|
120
|
+
}
|
|
121
|
+
const since = Date.parse(state.prompt ?? "") || 0;
|
|
122
|
+
if (!searchedSince(log, since))
|
|
123
|
+
deny(
|
|
124
|
+
`Discovery gate: no engine_search_capabilities call since the last user prompt. Before you create ${created.join(", ")}, run ${SEARCH} and read every row — engine_capability_detail is only for a symbol the search did not return — and use what it returns. Outside this folder: ${BRIDGE}. Opt out with TN_DISCOVERY_GATE=off.`,
|
|
125
|
+
);
|
|
@@ -13,7 +13,7 @@ const RULESET = [
|
|
|
13
13
|
"",
|
|
14
14
|
"Before writing code, stop at the first rung that holds (read the code the change touches first):",
|
|
15
15
|
"1. Does this need to exist? No -> skip it (YAGNI).",
|
|
16
|
-
"2. Follow
|
|
16
|
+
"2. Follow the Authoring flow in `AGENTS.md` (`threenative-capabilities` skill): search capabilities and references before the first new `src/` file. References borrow mechanics only: no code, level layouts, character names or art.",
|
|
17
17
|
"3. Already in this game? Reuse what is in `src/`.",
|
|
18
18
|
"4. Stdlib or engine convention (loadAll, addInSlices, GroundSnap, an input vector, a physics query)? Use it.",
|
|
19
19
|
"5. Already-installed dependency? Use it; add none for a few lines.",
|
|
@@ -1,4 +1,12 @@
|
|
|
1
1
|
{
|
|
2
|
+
"enabledMcpjsonServers": [
|
|
3
|
+
"threenative-assets",
|
|
4
|
+
"threenative-sculpt",
|
|
5
|
+
"threenative-engine",
|
|
6
|
+
"threenative-terrain",
|
|
7
|
+
"threenative-animation",
|
|
8
|
+
"threenative-devtools"
|
|
9
|
+
],
|
|
2
10
|
"hooks": {
|
|
3
11
|
"SessionStart": [
|
|
4
12
|
{
|
|
@@ -19,6 +27,23 @@
|
|
|
19
27
|
"type": "command",
|
|
20
28
|
"command": "node \"$CLAUDE_PROJECT_DIR/.claude/hooks/ponytail-context.mjs\"",
|
|
21
29
|
"timeout": 5
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"type": "command",
|
|
33
|
+
"command": "node \"$CLAUDE_PROJECT_DIR/.claude/hooks/discovery-gate.mjs\"",
|
|
34
|
+
"timeout": 5
|
|
35
|
+
}
|
|
36
|
+
]
|
|
37
|
+
}
|
|
38
|
+
],
|
|
39
|
+
"PreToolUse": [
|
|
40
|
+
{
|
|
41
|
+
"matcher": "Write|Edit|MultiEdit",
|
|
42
|
+
"hooks": [
|
|
43
|
+
{
|
|
44
|
+
"type": "command",
|
|
45
|
+
"command": "node \"$CLAUDE_PROJECT_DIR/.claude/hooks/discovery-gate.mjs\"",
|
|
46
|
+
"timeout": 5
|
|
22
47
|
}
|
|
23
48
|
]
|
|
24
49
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"description": "Project-scoped ponytail activation; review and trust
|
|
2
|
+
"description": "Project-scoped ponytail activation and the discovery gate; review and trust them with /hooks.",
|
|
3
3
|
"hooks": {
|
|
4
4
|
"SessionStart": [
|
|
5
5
|
{
|
|
@@ -21,6 +21,23 @@
|
|
|
21
21
|
"type": "command",
|
|
22
22
|
"command": "node .claude/hooks/ponytail-context.mjs",
|
|
23
23
|
"timeout": 5
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"type": "command",
|
|
27
|
+
"command": "node .claude/hooks/discovery-gate.mjs",
|
|
28
|
+
"timeout": 5
|
|
29
|
+
}
|
|
30
|
+
]
|
|
31
|
+
}
|
|
32
|
+
],
|
|
33
|
+
"PreToolUse": [
|
|
34
|
+
{
|
|
35
|
+
"matcher": "apply_patch",
|
|
36
|
+
"hooks": [
|
|
37
|
+
{
|
|
38
|
+
"type": "command",
|
|
39
|
+
"command": "node .claude/hooks/discovery-gate.mjs",
|
|
40
|
+
"timeout": 5
|
|
24
41
|
}
|
|
25
42
|
]
|
|
26
43
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,41 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { IThreeNativeIconVariants, ThreeNativeOrientation, IThreeNativeBootSplash, IThreeNativeConfig, ThreeNativeUiRenderer, IThreeNativeAudioConfig, IThreeNativeLodConfig, IThreeNativeTexturesConfig } from '@threenative/core';
|
|
3
3
|
|
|
4
|
+
interface IEngineCatalogOptions {
|
|
5
|
+
/** "error" (the default) fails the edit and the build; "warn" reports, and the page throws at first use. */
|
|
6
|
+
readonly mode?: "error" | "warn";
|
|
7
|
+
}
|
|
8
|
+
interface ITransformContext {
|
|
9
|
+
error(failure: {
|
|
10
|
+
readonly message: string;
|
|
11
|
+
readonly id: string;
|
|
12
|
+
readonly loc?: {
|
|
13
|
+
readonly file: string;
|
|
14
|
+
readonly line: number;
|
|
15
|
+
readonly column: number;
|
|
16
|
+
};
|
|
17
|
+
}): never;
|
|
18
|
+
warn(message: string): void;
|
|
19
|
+
}
|
|
20
|
+
interface IEngineCatalogVitePlugin {
|
|
21
|
+
readonly name: string;
|
|
22
|
+
readonly enforce: "pre";
|
|
23
|
+
config(): {
|
|
24
|
+
worker: {
|
|
25
|
+
plugins: () => object[];
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
configResolved(config: {
|
|
29
|
+
readonly root: string;
|
|
30
|
+
}): Promise<void>;
|
|
31
|
+
transform(this: ITransformContext, code: string, id: string): Promise<null>;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Fails a game file's `import { X } from "three"` when the Wasm engine refuses `X` (PRD-830). Off,
|
|
35
|
+
* and reported once, under `engine: "threejs"` and for the native host's bundle.
|
|
36
|
+
*/
|
|
37
|
+
declare function createEngineCatalogPlugin(options?: IEngineCatalogOptions): IEngineCatalogVitePlugin;
|
|
38
|
+
|
|
4
39
|
interface IEngineFreshnessVitePlugin {
|
|
5
40
|
readonly name: string;
|
|
6
41
|
config(config: {
|
|
@@ -51,6 +86,7 @@ interface IResolvedThreeNativeConfig {
|
|
|
51
86
|
readonly orientation: ThreeNativeOrientation;
|
|
52
87
|
readonly fullscreen: boolean;
|
|
53
88
|
readonly keepScreenOn: boolean;
|
|
89
|
+
readonly priority: "game" | "normal";
|
|
54
90
|
readonly maxFps: number;
|
|
55
91
|
};
|
|
56
92
|
readonly window: {
|
|
@@ -214,8 +250,11 @@ interface IWebBrandVitePlugin {
|
|
|
214
250
|
load(id: string): Promise<string | null>;
|
|
215
251
|
configResolved(config: {
|
|
216
252
|
readonly root: string;
|
|
253
|
+
readonly command?: "build" | "serve";
|
|
217
254
|
}): Promise<void>;
|
|
218
|
-
transformIndexHtml(html: string
|
|
255
|
+
transformIndexHtml(html: string, context?: {
|
|
256
|
+
readonly bundle?: Readonly<Record<string, IBundleFile>>;
|
|
257
|
+
}): string;
|
|
219
258
|
configureServer(server: IMiddlewareServer): void;
|
|
220
259
|
configurePreviewServer(server: IMiddlewareServer): void;
|
|
221
260
|
generateBundle(this: {
|
|
@@ -237,15 +276,30 @@ interface IMiddlewareServer {
|
|
|
237
276
|
use(handler: Middleware): void;
|
|
238
277
|
};
|
|
239
278
|
}
|
|
279
|
+
interface IBundleFile {
|
|
280
|
+
readonly fileName: string;
|
|
281
|
+
readonly type: string;
|
|
282
|
+
readonly moduleIds?: readonly string[];
|
|
283
|
+
}
|
|
240
284
|
declare function renderWebManifest(root: string, config: IResolvedThreeNativeConfig): string;
|
|
241
285
|
declare function createWebBrandPlugin(): IWebBrandVitePlugin;
|
|
242
286
|
|
|
243
287
|
/**
|
|
244
|
-
* The asset decoders the web
|
|
245
|
-
*
|
|
246
|
-
*
|
|
288
|
+
* The asset decoders the web build ships, per format.
|
|
289
|
+
*
|
|
290
|
+
* Meshopt geometry decodes on both engines: on `engine: "threenative"` the engine's own glTF loader
|
|
291
|
+
* decompresses EXT/KHR_meshopt_compression with meshoptimizer, which `pnpm wasm:build` provisions
|
|
292
|
+
* and without which the `tn-native-engine-web` target refuses to link (PRD-861).
|
|
293
|
+
*
|
|
294
|
+
* KTX2 decodes on both engines too: the owned engine transcodes KHR_texture_basisu to BC7 or ETC2
|
|
295
|
+
* and uploads the blocks, or RGBA8 on a device with neither (PRD-867), and three's KTX2Loader runs
|
|
296
|
+
* on it. The web cook keeps an authored WebP a KTX2 cannot undercut, so Midway's KTX2 cook is
|
|
297
|
+
* 98,236,952 B against 125,132,608 B with WebP model textures.
|
|
298
|
+
*
|
|
299
|
+
* `threenative build` and each template's dev-server asset watch both read it, so the two cook the
|
|
300
|
+
* same bytes.
|
|
247
301
|
*/
|
|
248
|
-
declare function webRuntimeDecoders(
|
|
302
|
+
declare function webRuntimeDecoders(_config: {
|
|
249
303
|
readonly engine?: "threejs" | "threenative";
|
|
250
304
|
}): {
|
|
251
305
|
readonly ktx2: boolean;
|
|
@@ -307,8 +361,19 @@ declare function stampLoadingSource(canonical: string, template: string): string
|
|
|
307
361
|
* render-chain plumbing is not: it is the same 600 lines in every kit, and keeping seven copies by
|
|
308
362
|
* hand let one fall a revision behind without anything failing. A file belongs here only when a
|
|
309
363
|
* kit editing it would be a mistake rather than a choice.
|
|
364
|
+
*
|
|
365
|
+
* `__tests__/shared-render-drift.spec.ts` fails on any render source that ships byte-identical in
|
|
366
|
+
* two or more kits and is missing here, so a new copy cannot land unrestamped. The environment
|
|
367
|
+
* measure-and-sample mechanism and the backlight used to be seven of these copies; they live in
|
|
368
|
+
* `@threenative/core/render/environment` now (PRD-833).
|
|
310
369
|
*/
|
|
311
370
|
declare const SHARED_RENDER_SOURCES: readonly string[];
|
|
371
|
+
/**
|
|
372
|
+
* The shared sources `createProject` also writes into a kit that does not ship them. A kit owns its
|
|
373
|
+
* look, so presence is per kit: `starter` ships the temporal detail stage and the collectathon kits
|
|
374
|
+
* do not, and all four still get the same plumbing.
|
|
375
|
+
*/
|
|
376
|
+
declare const ADDED_RENDER_SOURCES: readonly string[];
|
|
312
377
|
declare function canonicalRenderSourcePath(relativePath: string, root?: string): string;
|
|
313
378
|
/** Re-copies every shared render source into each kit that ships it. */
|
|
314
379
|
declare function restampSharedRenderCopies(root?: string): Promise<readonly string[]>;
|
|
@@ -339,10 +404,36 @@ declare function projectMcpServers(target: string): string[];
|
|
|
339
404
|
*/
|
|
340
405
|
declare function referenceDigest(target: string, genre: string, run?: (args: string[]) => string): string;
|
|
341
406
|
declare function cliHelp(): string;
|
|
407
|
+
interface IAuthoringLayerStatus {
|
|
408
|
+
/** The create-threenative version running this check, which is the one the game installed. */
|
|
409
|
+
readonly installed: string;
|
|
410
|
+
readonly kit?: string;
|
|
411
|
+
/** Why the layer cannot be checked; set instead of `stale`'s meaning. */
|
|
412
|
+
readonly problem?: string;
|
|
413
|
+
/** Layer paths whose bytes differ from the installed package, and dropped files still present. */
|
|
414
|
+
readonly stale: readonly string[];
|
|
415
|
+
readonly stamped?: string;
|
|
416
|
+
}
|
|
417
|
+
interface IAuthoringLayerFix {
|
|
418
|
+
readonly deleted: readonly string[];
|
|
419
|
+
readonly kept: readonly string[];
|
|
420
|
+
readonly written: readonly string[];
|
|
421
|
+
}
|
|
422
|
+
/** How far the game's authoring layer is from what the installed create-threenative renders. */
|
|
423
|
+
declare function authoringLayerStatus(game: string, root?: string): Promise<IAuthoringLayerStatus>;
|
|
424
|
+
/**
|
|
425
|
+
* `threenative doctor --fix` (PRD-829): re-renders the authoring layer from the installed package with
|
|
426
|
+
* the scaffold's writers. A file whose bytes still match the stamp is overwritten, an edited one is
|
|
427
|
+
* kept unless `force`, and a file the package dropped is deleted only when unedited. Without a stamp,
|
|
428
|
+
* every differing file counts as edited.
|
|
429
|
+
*/
|
|
430
|
+
declare function fixAuthoringLayer(game: string, options: {
|
|
431
|
+
readonly force: boolean;
|
|
432
|
+
}, root?: string): Promise<IAuthoringLayerFix>;
|
|
342
433
|
declare function createProject(options: IScaffoldOptions, cwd?: string, root?: string): Promise<IScaffoldResult>;
|
|
343
434
|
/** The inverse of `scripts/workspace-packages.ts`'s `workspacePackageSourceFlag`; exported so
|
|
344
435
|
* the pair is gated rather than trusted. */
|
|
345
436
|
declare function packageNameFromFlag(flag: string): string | undefined;
|
|
346
437
|
declare function parseArgs(argv: readonly string[]): IScaffoldOptions;
|
|
347
438
|
|
|
348
|
-
export { type IKitManifest, type IScaffoldOptions, type IScaffoldResult, SHARED_RENDER_SOURCES, type ScaffoldTemplate, canonicalLoadingPath, canonicalRenderSourcePath, cliHelp, createEngineFreshnessPlugin, createProject, createWebBrandPlugin, discoverKitManifests, discoverStampedTemplates, discoverTemplateNames, hashEngineDist, kitManifest, packageNameFromFlag, parseArgs, projectMcpServers, referenceDigest, renderWebManifest, restampSharedRenderCopies, restampTemplateLoadingCopies, scaffoldCompletionMessage, scaffoldNextSteps, stampLoadingSource, templateForGenre, templateRoot, webRuntimeDecoders };
|
|
439
|
+
export { ADDED_RENDER_SOURCES, type IAuthoringLayerFix, type IAuthoringLayerStatus, type IKitManifest, type IScaffoldOptions, type IScaffoldResult, SHARED_RENDER_SOURCES, type ScaffoldTemplate, authoringLayerStatus, canonicalLoadingPath, canonicalRenderSourcePath, cliHelp, createEngineCatalogPlugin, createEngineFreshnessPlugin, createProject, createWebBrandPlugin, discoverKitManifests, discoverStampedTemplates, discoverTemplateNames, fixAuthoringLayer, hashEngineDist, kitManifest, packageNameFromFlag, parseArgs, projectMcpServers, referenceDigest, renderWebManifest, restampSharedRenderCopies, restampTemplateLoadingCopies, scaffoldCompletionMessage, scaffoldNextSteps, stampLoadingSource, templateForGenre, templateRoot, webRuntimeDecoders };
|