@air-jam/cli 0.0.0-stage → 0.9.3

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 (93) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +145 -2
  3. package/bin/airjam.mjs +66 -0
  4. package/dist/ai-pack.d.ts +44 -0
  5. package/dist/ai-pack.js +15 -0
  6. package/dist/ai-pack.js.map +1 -0
  7. package/dist/chunk-A4V2N4LX.js +938 -0
  8. package/dist/chunk-A4V2N4LX.js.map +1 -0
  9. package/dist/chunk-J5MAU4QZ.js +102 -0
  10. package/dist/chunk-J5MAU4QZ.js.map +1 -0
  11. package/dist/chunk-N7AI7HZK.js +529 -0
  12. package/dist/chunk-N7AI7HZK.js.map +1 -0
  13. package/dist/development.d.ts +98 -0
  14. package/dist/development.js +33 -0
  15. package/dist/development.js.map +1 -0
  16. package/dist/documentation.d.ts +27 -0
  17. package/dist/documentation.js +7 -0
  18. package/dist/documentation.js.map +1 -0
  19. package/dist/index.d.ts +1 -0
  20. package/dist/index.js +2184 -0
  21. package/dist/index.js.map +1 -0
  22. package/dist/scaffold.d.ts +6 -0
  23. package/dist/scaffold.js +20 -0
  24. package/dist/scaffold.js.map +1 -0
  25. package/package.json +78 -3
  26. package/runtime/local-network.d.mts +8 -0
  27. package/runtime/local-network.mjs +9 -0
  28. package/runtime/vite-config.d.mts +42 -0
  29. package/runtime/vite-config.mjs +130 -0
  30. package/runtime/vite-https.d.mts +11 -0
  31. package/runtime/vite-https.mjs +41 -0
  32. package/template-assets/bootstrap/.claude/launch.json +12 -0
  33. package/template-assets/bootstrap/AGENTS.md +248 -0
  34. package/template-assets/bootstrap/CLAUDE.md +63 -0
  35. package/template-assets/bootstrap/_gitignore +6 -0
  36. package/template-assets/bootstrap/skills/airjam-docs-workflow/SKILL.md +49 -0
  37. package/template-assets/bootstrap/skills/airjam-mcp/SKILL.md +56 -0
  38. package/template-assets/bootstrap/skills/canvas-2d-gameplay/SKILL.md +47 -0
  39. package/template-assets/bootstrap/skills/controller-ui/SKILL.md +69 -0
  40. package/template-assets/bootstrap/skills/debug-and-test/SKILL.md +72 -0
  41. package/template-assets/bootstrap/skills/game-architecture/SKILL.md +58 -0
  42. package/template-assets/bootstrap/skills/game-state-and-rendering/SKILL.md +44 -0
  43. package/template-assets/bootstrap/skills/host-surface/SKILL.md +52 -0
  44. package/template-assets/bootstrap/skills/index.md +36 -0
  45. package/template-assets/bootstrap/skills/prefab-authoring/SKILL.md +48 -0
  46. package/template-assets/bootstrap/skills/r3f-3d-scene/SKILL.md +51 -0
  47. package/template-assets/documentation/for-agents/controller-ui/page.mdx +60 -0
  48. package/template-assets/documentation/for-agents/page.mdx +98 -0
  49. package/template-assets/documentation/for-agents/project-structure/page.mdx +172 -0
  50. package/template-assets/documentation/for-agents/state-and-rendering/page.mdx +79 -0
  51. package/template-assets/documentation/getting-started/debugging/page.mdx +165 -0
  52. package/template-assets/documentation/getting-started/dev-logs/page.mdx +171 -0
  53. package/template-assets/documentation/getting-started/game-ideas/page.mdx +116 -0
  54. package/template-assets/documentation/getting-started/introduction/page.mdx +183 -0
  55. package/template-assets/documentation/getting-started/migrating-legacy-games/page.mdx +427 -0
  56. package/template-assets/documentation/getting-started/quick-start/page.mdx +333 -0
  57. package/template-assets/documentation/how-it-works/architecture/page.mdx +189 -0
  58. package/template-assets/documentation/how-it-works/host-system/page.mdx +267 -0
  59. package/template-assets/documentation/manifest.json +430 -0
  60. package/template-assets/documentation/sdk/hooks/page.mdx +500 -0
  61. package/template-assets/documentation/sdk/input-system/page.mdx +270 -0
  62. package/template-assets/documentation/sdk/networked-state/page.mdx +213 -0
  63. package/template-assets/documentation/sdk/ui-components/page.mdx +227 -0
  64. package/template-assets/managed/.airjam/ai-pack.json +191 -0
  65. package/template-assets/managed/docs/airjam/agent-gold-path.md +67 -0
  66. package/template-assets/managed/docs/airjam/agent-mcp.md +135 -0
  67. package/template-assets/managed/docs/airjam/canvas-2d-gameplay.md +82 -0
  68. package/template-assets/managed/docs/airjam/composition-shell-contract.md +87 -0
  69. package/template-assets/managed/docs/airjam/debug-and-testing.md +86 -0
  70. package/template-assets/managed/docs/airjam/development-loop.md +51 -0
  71. package/template-assets/managed/docs/airjam/docs-index.md +58 -0
  72. package/template-assets/managed/docs/airjam/generated/architecture.md +178 -0
  73. package/template-assets/managed/docs/airjam/generated/controller-ui.md +61 -0
  74. package/template-assets/managed/docs/airjam/generated/debugging-and-logs.md +164 -0
  75. package/template-assets/managed/docs/airjam/generated/for-agents.md +99 -0
  76. package/template-assets/managed/docs/airjam/generated/game-ideas.md +107 -0
  77. package/template-assets/managed/docs/airjam/generated/host-system.md +251 -0
  78. package/template-assets/managed/docs/airjam/generated/input-system.md +260 -0
  79. package/template-assets/managed/docs/airjam/generated/introduction.md +175 -0
  80. package/template-assets/managed/docs/airjam/generated/migrating-legacy-games.md +426 -0
  81. package/template-assets/managed/docs/airjam/generated/networked-state.md +214 -0
  82. package/template-assets/managed/docs/airjam/generated/project-structure.md +171 -0
  83. package/template-assets/managed/docs/airjam/generated/quick-start.md +334 -0
  84. package/template-assets/managed/docs/airjam/generated/sdk-hooks.md +490 -0
  85. package/template-assets/managed/docs/airjam/generated/state-and-rendering.md +80 -0
  86. package/template-assets/managed/docs/airjam/generated/ui-components.md +222 -0
  87. package/template-assets/managed/docs/airjam/generated/unified-dev-logs.md +170 -0
  88. package/template-assets/managed/docs/airjam/iconography.md +55 -0
  89. package/template-assets/managed/docs/airjam/prefab-authoring.md +112 -0
  90. package/template-assets/managed/docs/airjam/preview-controllers.md +126 -0
  91. package/template-assets/managed/docs/airjam/r3f-3d-scene.md +97 -0
  92. package/template-assets/managed/docs/airjam/state-lanes-cookbook.md +106 -0
  93. package/template-assets/managed/docs/airjam/visual-system.md +103 -0
@@ -0,0 +1,69 @@
1
+ ---
2
+ name: controller-ui
3
+ description: Use when building or reviewing Air Jam controller surfaces so touch controls stay simple, readable, and game-appropriate instead of drifting into dense web-app UI patterns.
4
+ ---
5
+
6
+ # Controller UI
7
+
8
+ Use this skill for controller gameplay and lobby surfaces.
9
+
10
+ ## Read First
11
+
12
+ 1. `docs/airjam/generated/controller-ui.md`
13
+ 2. `docs/airjam/visual-system.md`
14
+ 3. `docs/airjam/iconography.md`
15
+ 4. `docs/airjam/composition-shell-contract.md` when the controller needs lobby/status/lifecycle shell work
16
+
17
+ ## Gameplay Rules
18
+
19
+ 1. gameplay controller UI should live inside an absolute `inset-0` root
20
+ 2. avoid scroll during active gameplay
21
+ 3. use large touch targets
22
+ 4. disable accidental text selection
23
+ 5. keep actions obvious and single-purpose
24
+
25
+ ## Lobby Rules
26
+
27
+ 1. keep the flow simple
28
+ 2. allow scroll only when it helps
29
+ 3. keep the hierarchy sparse
30
+ 4. prefer the shared shell contract for top status and lifecycle action placement unless the game has a strong reason to go fully custom
31
+
32
+ ## Shell Contract Rule
33
+
34
+ For controller shell work:
35
+
36
+ 1. prefer `RuntimeShellHeader`, `LifecycleActionGroup`, `useControllerShellStatus`, `useControllerLifecyclePermissions`, and `useControllerLifecycleIntents` for the default composition path
37
+ 2. if you need custom markup, keep the same lifecycle behavior and action ordering
38
+ 3. do not keep duplicate lifecycle controls in both a top shell and a legacy local panel
39
+
40
+ ## Design Direction
41
+
42
+ 1. build controller UI like a game control surface
43
+ 2. avoid card-heavy dashboards
44
+ 3. avoid tiny controls and dense text
45
+ 4. avoid emoji-as-icon UI
46
+ 5. if the template already defines semantic panel, shell, or touch-surface utilities, use those before inventing new visual patterns
47
+
48
+ ## Icon Rule
49
+
50
+ Prefer:
51
+
52
+ 1. `@tabler/icons-react` for general UI and system actions
53
+ 2. `react-icons` `Gi*` exports for gameplay-specific concepts such as abilities, status effects, pickups, and damage types
54
+
55
+ Do not mix icon packs casually throughout the tree.
56
+
57
+ Prefer local wrapper modules so icon usage stays curated and replaceable.
58
+
59
+ ## Attribution Note
60
+
61
+ If the project uses `react-icons` `Gi*` icons, remember that the underlying Game Icons set has its own attribution requirements.
62
+
63
+ Downstream teams remain responsible for how they satisfy those requirements.
64
+
65
+ ## Anti-Patterns
66
+
67
+ 1. generic SaaS UI for active gameplay
68
+ 2. hard-coded desktop-like layouts on mobile
69
+ 3. nested control groups that hide or shrink the main action
@@ -0,0 +1,72 @@
1
+ ---
2
+ name: debug-and-test
3
+ description: Use when debugging or validating an Air Jam project so diagnostics, logging, and tests stay intentional, structured, and aligned with the project architecture.
4
+ ---
5
+
6
+ # Debug And Test
7
+
8
+ Use this skill when adding debug helpers, using logs, or deciding what to test.
9
+
10
+ ## Read First
11
+
12
+ 1. `docs/airjam/debug-and-testing.md`
13
+ 2. `docs/airjam/development-loop.md`
14
+ 3. `docs/airjam/generated/unified-dev-logs.md`
15
+
16
+ ## Debug Order
17
+
18
+ 1. inspect the canonical Air Jam dev log stream first
19
+ 2. use framework diagnostics second
20
+ 3. use domain-level debug helpers third
21
+ 4. add custom logs only when they add clear value
22
+
23
+ ## Canonical Log Workflow
24
+
25
+ Use the unified Air Jam log stream early when debugging host/controller/server issues.
26
+
27
+ Key facts:
28
+
29
+ 1. the canonical file is `.airjam/logs/dev-latest.ndjson`
30
+ 2. it resets when the Air Jam server process restarts
31
+ 3. `pnpm exec air-jam-server logs` is the preferred path
32
+ 4. direct file reads are valid when you need the raw stream
33
+ 5. standard dev-runner failures from Vite and similar tools should also appear there as `workspace` events
34
+ 6. this should usually come before adding new temporary logs
35
+
36
+ Query order:
37
+
38
+ 1. start with `pnpm exec air-jam-server logs --view=signal`
39
+ 2. use `--trace` for host-session stories
40
+ 3. use `--room` for one multiplayer room story
41
+ 4. use `--controller` for one player/controller path
42
+ 5. use `--runtime` and `--epoch` for embedded runtime problems
43
+ 6. use `--process` when the likely failure is in one local dev process such as `platform`, `server`, or the active game
44
+ 7. use `--source` when you already know which producer layer you need
45
+ 8. fall back to raw NDJSON when signal view is still not enough
46
+
47
+ ## Test Order
48
+
49
+ 1. pure domain logic with unit tests
50
+ 2. focused gameplay systems with behavior tests
51
+ 3. targeted integration coverage only where the boundary really matters
52
+
53
+ If the starter testing layout exists, prefer:
54
+
55
+ 1. `tests/game/domain/`
56
+ 2. `tests/game/stores/`
57
+ 3. `tests/game/engine/`
58
+ 4. `tests/game/adapters/`
59
+ 5. `tests/game/ui/`
60
+
61
+ ## Structure Rules
62
+
63
+ 1. keep debug helpers under `src/game/debug/`
64
+ 2. keep debug-only code out of hot gameplay paths
65
+ 3. prefer structured logs over ad hoc console noise
66
+ 4. keep core logic testable without rendering where practical
67
+
68
+ ## Anti-Patterns
69
+
70
+ 1. bolting debug code directly into render hot paths
71
+ 2. waiting until the project is tangled before writing tests
72
+ 3. testing implementation details instead of behavior
@@ -0,0 +1,58 @@
1
+ ---
2
+ name: game-architecture
3
+ description: Use when creating or refactoring gameplay code in an Air Jam project and you need guidance on host vs controller vs domain boundaries, modular structure, and when to refactor before implementing.
4
+ ---
5
+
6
+ # Game Architecture
7
+
8
+ Use this skill when adding new systems or moving code between boundaries.
9
+
10
+ ## Read First
11
+
12
+ 1. `docs/airjam/generated/project-structure.md`
13
+ 2. `docs/airjam/generated/architecture.md`
14
+
15
+ ## Boundary Model
16
+
17
+ Prefer this split:
18
+
19
+ 1. `src/airjam.config.ts` for catalog metadata plus runtime config such as `controllerPath` and input schema
20
+ 2. `src/app.tsx` for mounting explicit host/controller runtime boundaries
21
+ 3. `src/host/` for host-only composition
22
+ 4. `src/controller/` for controller-only composition
23
+ 5. `src/game/domain/` for pure rules
24
+ 6. `src/game/engine/` for orchestration
25
+ 7. `src/game/systems/` for focused gameplay systems
26
+ 8. `src/game/adapters/` for framework integration
27
+ 9. `src/game/ui/` for reusable game-facing UI
28
+ 10. `src/game/debug/` for debug helpers
29
+
30
+ Keep runtime ownership explicit:
31
+
32
+ 1. mount `airjam.Host` / `airjam.Controller` once at the boundary
33
+ 2. use consumer hooks like `useAirJamHost()` and `useAirJamController()` only below that boundary
34
+ 3. keep gameplay code out of runtime setup and transport bootstrap
35
+
36
+ ## Decision Rule
37
+
38
+ Ask:
39
+
40
+ 1. is this pure gameplay logic
41
+ 2. is this runtime orchestration
42
+ 3. is this rendering integration
43
+ 4. is this host-only or controller-only
44
+
45
+ Put the code where the answer is clearest.
46
+
47
+ ## Refactor-First Rule
48
+
49
+ If new work would harden a mixed boundary, split the structure first or split the task into:
50
+
51
+ 1. boundary cleanup
52
+ 2. feature implementation
53
+
54
+ ## Anti-Patterns
55
+
56
+ 1. one large file that mixes host, controller, domain, and rendering concerns
57
+ 2. React components as the only home for gameplay logic
58
+ 3. adapter code becoming the real game model
@@ -0,0 +1,44 @@
1
+ ---
2
+ name: game-state-and-rendering
3
+ description: Use when changing stores, per-frame gameplay logic, React state, refs, or rendering integration in an Air Jam project so state ownership stays clear and rerenders stay controlled.
4
+ ---
5
+
6
+ # Game State And Rendering
7
+
8
+ Use this skill when a task touches state ownership, per-frame updates, or rendering hot paths.
9
+
10
+ ## Read First
11
+
12
+ 1. `docs/airjam/generated/state-and-rendering.md`
13
+ 2. `docs/airjam/generated/input-system.md`
14
+ 3. `docs/airjam/generated/networked-state.md`
15
+
16
+ ## Core Rules
17
+
18
+ 1. keep input in the input lane
19
+ 2. keep authoritative shared truth in replicated state
20
+ 3. keep coarse UX/system events in signals
21
+ 4. keep per-frame mutable values out of React state when React rendering is not needed
22
+ 5. use narrow Zustand selectors
23
+
24
+ ## Decision Guide
25
+
26
+ Use:
27
+
28
+ 1. replicated state for replayable shared truth
29
+ 2. local UI state for local view concerns
30
+ 3. refs for hot mutable runtime values
31
+ 4. pure domain modules for rules and calculations
32
+
33
+ ## R3F / Three Guidance
34
+
35
+ 1. avoid per-frame React rerenders
36
+ 2. mutate refs in frame handlers when appropriate
37
+ 3. keep scene integration separate from domain decisions
38
+
39
+ ## Anti-Patterns
40
+
41
+ 1. using store actions for high-frequency input
42
+ 2. using React state as the simulation engine
43
+ 3. selecting whole stores throughout the tree
44
+ 4. mixing debug state into hot loops
@@ -0,0 +1,52 @@
1
+ ---
2
+ name: host-surface
3
+ description: Use when building or reviewing the Air Jam host shell so the active game surface stays full-frame, overlays stay modular, and host UI does not interfere with gameplay layout.
4
+ ---
5
+
6
+ # Host Surface
7
+
8
+ Use this skill for host presentation, overlays, room chrome, and game viewport composition.
9
+
10
+ ## Read First
11
+
12
+ 1. `docs/airjam/generated/host-system.md`
13
+ 2. `docs/airjam/generated/project-structure.md`
14
+ 3. `docs/airjam/visual-system.md` if the template already ships a shared visual language
15
+ 4. `docs/airjam/generated/controller-ui.md` only if the host and controller should mirror a shared visual language
16
+ 5. `docs/airjam/composition-shell-contract.md` when the host lobby/join shell is part of the work
17
+
18
+ ## Surface Rules
19
+
20
+ 1. the active game surface should fill an absolute `inset-0` root
21
+ 2. avoid wrappers that constrain, crop, or offset the play surface accidentally
22
+ 3. keep host chrome outside the gameplay coordinate space where possible
23
+ 4. keep overlays layered above the game surface, not embedded into gameplay components
24
+
25
+ ## Composition Rules
26
+
27
+ 1. separate room bootstrap, shell, gameplay viewport, and overlays into distinct modules
28
+ 2. keep host-only orchestration in `src/host/`
29
+ 3. keep gameplay state and rendering concerns in `src/game/`
30
+ 4. prefer reusable overlay modules over inline one-off markup
31
+
32
+ ## Layout Rules
33
+
34
+ 1. avoid overflow bugs on the main host surface
35
+ 2. prefer fluid sizing over fixed panel widths and heights
36
+ 3. keep QR, room, pause, and status UI visually secondary to the active game
37
+ 4. keep readable safe margins for overlays without shrinking the gameplay surface unnecessarily
38
+
39
+ ## Lobby Contract Rule
40
+
41
+ For host lobby work:
42
+
43
+ 1. the host lobby should expose room context, QR access, join URL field, copy/open actions, and a primary start action
44
+ 2. prefer `useHostJoinControls` plus `JoinQrOverlay`, `JoinUrlField`, `JoinUrlActionButtons`, `JoinUrlControls`, and `LifecycleActionGroup` unless the game needs a fully custom shell
45
+ 3. if the shell is fully custom, preserve the same join and lifecycle behavior contract
46
+
47
+ ## Anti-Patterns
48
+
49
+ 1. gameplay rendered inside a card, panel, or centered content column
50
+ 2. host shell state mixed directly into gameplay components
51
+ 3. overlay UI positioned by guesswork inside the game scene
52
+ 4. host layout choices that make the game viewport smaller than necessary
@@ -0,0 +1,36 @@
1
+ # Skills Index
2
+
3
+ These local skills teach how to work in this repo.
4
+
5
+ Do not read every skill for every task.
6
+
7
+ Pick the one that matches the current problem.
8
+
9
+ ## Core Skills
10
+
11
+ 1. `airjam-mcp`
12
+ Use when the project includes the Air Jam MCP and the task fits Air Jam-native devtools flows such as project inspection, log reading, and quality gates.
13
+ 2. `airjam-docs-workflow`
14
+ Use when you need canonical guidance and need to know whether local docs or hosted docs should be consulted.
15
+ 3. `game-architecture`
16
+ Use when creating systems, moving code, or deciding where logic should live.
17
+ 4. `game-state-and-rendering`
18
+ Use when changing stores, frame logic, refs, React state, or rendering integration.
19
+ 5. `controller-ui`
20
+ Use when building or reviewing controller surfaces, including the shared controller shell contract, lifecycle actions, and icon choices for controller and gameplay UI.
21
+ 6. `debug-and-test`
22
+ Use when debugging with the unified dev log stream, adding diagnostics, or writing tests.
23
+ 7. `host-surface`
24
+ Use when building or reviewing the host shell, host-lobby join contract, active game viewport, overlays, and room-facing presentation.
25
+ 8. `prefab-authoring`
26
+ Use when creating reusable gameplay objects or scene presets that should stay declarative, configurable, and tool-friendly.
27
+ 9. `r3f-3d-scene`
28
+ Use when building or reviewing 3D Air Jam gameplay with React Three Fiber, lighting, shadows, grounding, particles, and physics.
29
+ 10. `canvas-2d-gameplay`
30
+ Use when building or reviewing 2D canvas gameplay, render/simulation separation, scaling, SVG assets, and lightweight collision patterns.
31
+
32
+ ## Rule
33
+
34
+ If the task does not match a skill boundary, do not force it.
35
+
36
+ Use the smallest relevant guidance.
@@ -0,0 +1,48 @@
1
+ ---
2
+ name: prefab-authoring
3
+ description: Use when creating reusable gameplay objects or scene presets so prefabs stay declarative, configurable, and ready for future tooling such as previews and scanned catalogs.
4
+ ---
5
+
6
+ # Prefab Authoring
7
+
8
+ Use this skill when adding reusable scene objects, pickups, obstacles, props, spawnable entities, or authored content presets.
9
+
10
+ ## Read First
11
+
12
+ 1. `docs/airjam/prefab-authoring.md`
13
+ 2. `docs/airjam/generated/project-structure.md`
14
+ 3. `docs/airjam/generated/state-and-rendering.md` if the prefab introduces hot runtime behavior
15
+
16
+ ## Contract Rule
17
+
18
+ A prefab should be a reusable content unit, not a hidden pile of gameplay logic.
19
+
20
+ Keep the prefab definition declarative and stable enough that future tooling can:
21
+
22
+ 1. scan it
23
+ 2. render a preview
24
+ 3. expose safe config
25
+ 4. instantiate it consistently
26
+
27
+ ## Structure Rules
28
+
29
+ 1. place prefab code under `src/game/prefabs/`
30
+ 2. keep metadata, schema, and runtime component clearly separated
31
+ 3. put pure behavior in domain/system modules when it outgrows the prefab itself
32
+ 4. avoid coupling prefab definitions directly to scene-global mutable state
33
+ 5. keep scene-population, spawn, and pooling layers outside `src/game/prefabs/`
34
+
35
+ ## Config Rules
36
+
37
+ 1. expose explicit defaults
38
+ 2. keep config serializable where practical
39
+ 3. use stable ids, labels, categories, and tags
40
+ 4. avoid hidden magic props or implicit scene dependencies
41
+
42
+ ## Anti-Patterns
43
+
44
+ 1. one-off scene objects masquerading as reusable prefabs
45
+ 2. prefab files that bury behavior, metadata, and config in one component
46
+ 3. prefab placement rules that depend on trial-and-error offsets
47
+ 4. prefab contracts that are too ad hoc for future scanning or preview generation
48
+ 5. plural runtime mappers like `Ships` or `Collectibles` living in `src/game/prefabs/` when they are actually population layers over state
@@ -0,0 +1,51 @@
1
+ ---
2
+ name: r3f-3d-scene
3
+ description: Use when building or reviewing a 3D Air Jam game with React Three Fiber so scene structure, lighting, shadows, grounding, particles, and physics stay deliberate instead of becoming ad hoc Three.js chaos.
4
+ ---
5
+
6
+ # R3F 3D Scene
7
+
8
+ Use this skill for 3D host gameplay surfaces built with React Three Fiber and Three.js.
9
+
10
+ ## Read First
11
+
12
+ 1. `docs/airjam/r3f-3d-scene.md`
13
+ 2. `docs/airjam/generated/state-and-rendering.md`
14
+ 3. `docs/airjam/generated/project-structure.md`
15
+
16
+ ## Core Rule
17
+
18
+ Treat R3F as a rendering layer.
19
+
20
+ Keep:
21
+
22
+ 1. gameplay rules in domain/system modules
23
+ 2. runtime orchestration in engine/adapters
24
+ 3. scene composition and visual presentation in the 3D layer
25
+
26
+ ## Scene Quality Rules
27
+
28
+ 1. establish a deliberate lighting recipe early
29
+ 2. define world origin, ground level, and object placement conventions clearly
30
+ 3. keep shadows intentionally tuned to the actual play area
31
+ 4. use particles and post effects as accents, not camouflage for weak art direction
32
+
33
+ ## Physics Rule
34
+
35
+ Use Rapier when the game really benefits from rigid-body style simulation, collision response, or stacked interactions.
36
+
37
+ If gameplay only needs simple movement, overlap checks, or authored responses, prefer a lighter custom movement/collision model.
38
+
39
+ ## Asset Rule
40
+
41
+ 1. keep model scale and grounding consistent
42
+ 2. prefer curated materials and textures over random defaults
43
+ 3. use custom shaders only when they materially improve the look or mechanic
44
+
45
+ ## Anti-Patterns
46
+
47
+ 1. React state driving per-frame scene simulation
48
+ 2. giant untuned shadow maps with clipped or blurry shadows
49
+ 3. floating models fixed by random per-scene offsets
50
+ 4. adding a full physics engine where simple authored logic would be clearer
51
+ 5. piling on particles, bloom, or shaders before the base scene reads well
@@ -0,0 +1,60 @@
1
+
2
+
3
+ # Controller UI
4
+
5
+ Controller UI should feel like a game controller first and a webpage second.
6
+
7
+ The main failure mode is borrowing desktop web-app patterns for active gameplay surfaces.
8
+
9
+ ## Gameplay Controller Rules
10
+
11
+ For active gameplay:
12
+
13
+ 1. use an absolute `inset-0` root
14
+ 2. avoid scroll
15
+ 3. disable accidental text selection
16
+ 4. use large touch targets
17
+ 5. keep controls visually obvious and single-purpose
18
+ 6. minimize text and dense hierarchy
19
+
20
+ ## Lobby Rules
21
+
22
+ Lobby screens can be slightly more flexible, but should still prefer:
23
+
24
+ 1. simple layout
25
+ 2. large controls
26
+ 3. minimal friction
27
+ 4. scroll only when it actually helps the flow
28
+
29
+ ## Interaction Rules
30
+
31
+ Avoid:
32
+
33
+ 1. tiny toggles
34
+ 2. multi-purpose buttons with unclear affordance
35
+ 3. deeply nested control groups
36
+ 4. layouts that assume precise pointer interaction
37
+
38
+ ## Visual Rules
39
+
40
+ Prefer:
41
+
42
+ 1. sparse game-like hierarchy
43
+ 2. fluid layout over hard-coded widths and heights
44
+ 3. obvious action grouping
45
+ 4. strong contrast and immediate readability
46
+
47
+ Avoid:
48
+
49
+ 1. card-heavy dashboard styling for active gameplay
50
+ 2. emoji-as-icon UI
51
+ 3. cluttered web-app chrome
52
+
53
+ ## Icon Rule
54
+
55
+ For template and starter work, a practical split is:
56
+
57
+ 1. a general UI and system icon pack for shell actions
58
+ 2. a gameplay-oriented icon set for abilities, pickups, and status effects
59
+
60
+ Keep icon usage behind local wrappers where practical so the project can curate or replace icons later.
@@ -0,0 +1,98 @@
1
+
2
+
3
+ # For Agents
4
+
5
+ This page is the fastest entrypoint for LLM agents and automation tools.
6
+
7
+ ## What Air Jam Is
8
+
9
+ Air Jam is an open AI-native framework for multiplayer games controlled by
10
+ phones.
11
+ Hosts run in your game, inputs are routed through the Air Jam server, and both
12
+ humans and agents work against typed controller, runtime, state, and release
13
+ surfaces instead of guessing through UI only.
14
+
15
+ Air Jam is the harness around your existing coding agent, not a separate hosted
16
+ editor. Local project instructions, CLI commands, MCP tools, runtime observations,
17
+ and hosted release services form one development path.
18
+
19
+ ## Connect to a Project
20
+
21
+ Run these commands from a generated game project with dependencies installed:
22
+
23
+ ```bash
24
+ pnpm exec airjam --help
25
+ pnpm exec airjam mcp doctor --dir . --json
26
+ pnpm exec airjam mcp config --profile portable --dir .
27
+ ```
28
+
29
+ New projects include `.mcp.json`. If a project has no declaration, use
30
+ `pnpm exec airjam mcp init --dir .`; it does not overwrite an existing declaration
31
+ unless you explicitly pass `--force`.
32
+
33
+ Some clients use their own registration formats instead of reading `.mcp.json`:
34
+
35
+ ```bash
36
+ pnpm exec airjam mcp config --profile codex --dir .
37
+ pnpm exec airjam mcp config --profile claude-desktop --dir .
38
+ ```
39
+
40
+ These commands render configuration; they do not install it into the client.
41
+ Use the rendered command, arguments, and absolute project directory when adding
42
+ the server. `mcp doctor` distinguishes project declarations from detected client
43
+ registrations. Confirm that the connected client discovers Air Jam's tools before
44
+ treating the connection as working.
45
+
46
+ ## Operate and Evaluate
47
+
48
+ For gameplay assertions, use `airjam.open_game_session`,
49
+ `airjam.read_game_session`, `airjam.invoke_game_session_action`, and
50
+ `airjam.close_game_session`. Read each session's published actions and state;
51
+ do not guess game-specific action IDs. `airjam.capture_game_session_visuals`
52
+ adds host and phone-controller screenshots to the same session.
53
+
54
+ MCP is optional. A terminal agent can use the same services:
55
+
56
+ ```bash
57
+ pnpm exec airjam session open --dir .
58
+ pnpm exec airjam session read <session-id> --dir .
59
+ pnpm exec airjam session invoke <session-id> <action-id> --payload '{}'
60
+ pnpm exec airjam session capture <session-id> --dir .
61
+ pnpm exec airjam session close <session-id> --dir .
62
+ ```
63
+
64
+ A session starts or reuses the canonical development process. If you start it
65
+ yourself, use `pnpm run dev`, not raw Vite. Use semantic state for repeatable
66
+ gameplay checks and rendered screenshots or browser interaction for visual polish.
67
+ During editing, run the relevant focused checks. Before sharing a completed game,
68
+ run `pnpm exec airjam evaluate --dir .` or the `airjam.evaluate` tool for the complete
69
+ typecheck, lint, test, and build result.
70
+
71
+ The [Quick Start publishing guide](/docs/getting-started/quick-start#terminal-or-agent-publishing)
72
+ covers CLI authentication, hosted release submission, inspection, and explicit
73
+ publication. Local development and evaluation do not require hosted publishing.
74
+
75
+ ## Read These First
76
+
77
+ 1. [Introduction](/docs/getting-started/introduction)
78
+ 2. [Quick Start](/docs/getting-started/quick-start)
79
+ 3. [Architecture](/docs/how-it-works/architecture)
80
+ 4. [Host System](/docs/how-it-works/host-system)
81
+ 5. [Project Structure](/docs/for-agents/project-structure)
82
+ 6. [Controller UI](/docs/for-agents/controller-ui)
83
+ 7. [State and Rendering](/docs/for-agents/state-and-rendering)
84
+ 8. [SDK Hooks](/docs/sdk/hooks)
85
+ 9. [Debugging and Logs](/docs/getting-started/debugging)
86
+ 10. [Unified Dev Logs](/docs/getting-started/dev-logs)
87
+
88
+ ## SDK Focus Areas
89
+
90
+ - [Input System](/docs/sdk/input-system)
91
+ - [Networked State](/docs/sdk/networked-state)
92
+
93
+ ## Machine Discovery
94
+
95
+ - [AI Pack Manifest](/ai-pack/manifest.json)
96
+ - [LLMs Index](/llms.txt)
97
+ - [Sitemap](/sitemap.xml)
98
+ - [Robots](/robots.txt)