Skip to content

Monorepo layout

npm scope stand-in: @ludrel/* (replace when the name is chosen). Phase in brackets = when the folder appears.

/
├── CLAUDE.md conventions, commands, phase status
├── package.json root scripts (turbo), packageManager pin [1]
├── pnpm-workspace.yaml [1]
├── turbo.json · biome.json · tsconfig.base.json · .nvmrc [1]
├── compose.yaml one-command local platform [3]
├── .env.example
│
├── packages/ framework + shared libraries (published to npm)
│ ├── schema/ Zod schemas → JSON Schema; validators; migrations [1]
│ ├── core/ loop, scenes, ECS, events, assets, save, rng [1]
│ ├── render-2d/ PixiJS adapter: sprites, animation, tilemaps,
│ │ parallax, particles; stub renderer [1]
│ ├── camera/ follow, dead-zone, bounds, shake (2D); rigs (3D) [1]
│ ├── physics-arcade/ AABB, tiles, one-way, slopes, layers, raycasts [1]
│ ├── input/ keyboard, mouse, gamepad, action maps, remapping [1]
│ ├── audio/ Web Audio SFX/music, buses, crossfades [1]
│ ├── world/ tilemap runtime, Tiled import, chunks, pathfinding [1→5]
│ ├── devtools/ debug overlay, inspector, hot-reload client [1]
│ ├── ui/ HUD + menu kit [1→5]
│ ├── framework/ convenience meta-package re-exporting the above [1]
│ ├── testing/ headless runner, input scripts, assertions [1]
│ ├── play-bridge/ typed postMessage protocol game ⇄ platform [3]
│ ├── gameplay/ FSM, behaviour trees, steering, dialogue,
│ │ inventory, quests, localization [5]
│ ├── render-3d/ Three.js adapter [5]
│ ├── physics-rapier/ Rapier 2D/3D adapter [5]
│ ├── net/ transports + client netcode [6]
│ ├── ai/ provider-agnostic AI adapter [2]
│ ├── agent-tools/ tool implementations shared by MCP + editor AI [2]
│ ├── sdk/ typed platform API client (from OpenAPI) [3]
│ └── config/ shared tsconfig / biome / vitest presets [1]
│
├── games/ sample games (also used as e2e fixtures)
│ └── sample-platformer/ Phase 1 side-scroller [1]
├── templates/ `create-game` templates (platformer, top-down,
│ arcade, 3d) — data-first, minimal code [2→5]
│
├── apps/
│ ├── mcp/ MCP server (stdio + Streamable HTTP) [2]
│ ├── web/ platform web app (React Router) [3]
│ ├── api/ Hono API (may run in-process with web at first) [3]
│ ├── worker/ jobs: build, validate, screenshot, headless runs [3]
│ ├── play/ play-origin host shell + headers [3]
│ ├── docs/ docs site (Starlight/VitePress) [2]
│ └── game-server/ multiplayer rooms [6]
│
├── tools/
│ ├── create-game/ `npm create @ludrel/game` CLI [2]
│ ├── docs-gen/ TypeDoc → markdown, llms.txt, llms-full.txt [1→2]
│ └── evals/ AI success-test scenarios (Phase 2 gate) [2]
│
├── recipes/ short, compiled, tested examples (feed llms.txt) [1→2]
├── infra/
│ ├── docker/ Dockerfiles [3]
│ └── cdk/ AWS CDK app [7]
└── docs/
├── adr/ · schemas/ · architecture.md · hosting.md · roadmap.md · risks.md
└── getting-started.md [1]

Dependency rules (enforced by lint + dependency-cruiser from Phase 1)

Section titled “Dependency rules (enforced by lint + dependency-cruiser from Phase 1)”
  1. core and schema depend on nothing in the repo except each other (core → schema).
  2. Only render-2d, render-3d, physics-rapier and audio may import third-party engines.
  3. games/* and templates/* import only @ludrel/* public entry points — never PixiJS/Three/Rapier directly.
  4. apps/* may depend on packages; packages never depend on apps.
  5. Every package: ESM, "sideEffects": false, explicit exports map, TSDoc on all exports, size-limit entry.