open-index/open-npm huggingface dataset:
npm package: @loonylabs/create-game
Description: Scaffold a complete game project in one command.
Latest version: 0.1.3

# @loonylabs/create-game

Scaffold a complete game project in one command.

## Usage

```bash
npx @loonylabs/create-game <game-name> <target-dir>
```

**Example:**

```bash
npx @loonylabs/create-game my-game ./my-game
cd my-game
pnpm install
pnpm dev
```

Then open `http://localhost:3200` in your browser.

## What gets created

```
my-game/
├── apps/
│   ├── client/        — Three.js + Svelte frontend
│   ├── server/
│   │   └── src/
│   │       ├── index.ts        — experience registration (~30 lines)
│   │       └── db/
│   │           ├── client.ts   — DB setup (generic)
│   │           └── schema.ts   — your game schema (fill in here)
│   ├── experiences/   — Diablo, Shooter, Runner, Oil as reference implementations
│   └── game-data/     — your game content (enemies, rooms, items, areas)
└── .claude/
    └── skills/        — AI workflow skills + primitive behavior docs
```

No framework internals in `apps/server/src/` — all server logic lives in compiled `@loonylabs/*` packages.

## What you write

1. **`apps/experiences/my-game/manifest.ts`** — pure data, no logic
2. **`apps/client/src/experiences/my-game/handler.ts`** — browser rendering
3. Register in `apps/server/src/index.ts`:

```typescript
import { createExperienceFromManifest, createManifestExperience } from '@loonylabs/gamedev-server';
import { myManifest } from '../../experiences/my-game/manifest.js';

// No persistence:
experienceManager.register(createExperienceFromManifest(myManifest));

// With player + world persistence:
experienceManager.register(createManifestExperience(myManifest, db));
```

## AI-native workflow

Once your project is set up, open it in Claude Code and run:

```
/aigdtk-new-game
```

This starts an AI conversation that designs your game, generates stories, and implements them — using the loonylabs framework as the foundation. Primitive behavior docs are co-located in `.claude/skills/aigdtk-shared/primitives/` for targeted context loading.

## Part of the loonylabs gamedev toolkit

| Package | Role |
|---|---|
| `@loonylabs/gamedev-core` | ECS, physics, dungeon gen |
| `@loonylabs/gamedev-client` | Three.js renderer, cameras, input |
| `@loonylabs/gamedev-server` | Tick loop, session management, DB, manifest persistence |
| `@loonylabs/gamedev-protocol` | Zod network schemas |
| `@loonylabs/create-game` | ← you are here |
npm package: @loonylabs/gamedev-client
Description: Client-side rendering and input layer for the loonylabs gamedev framework.
Latest version: 0.1.2

# @loonylabs/gamedev-client

Client-side rendering and input layer for the loonylabs gamedev framework.

## What's in here

Three.js-based renderer utilities, camera controllers, input handling and interpolation. No game-specific logic — purely generic infrastructure.

- **Cameras** — Follow, FirstPerson, ThirdPerson, Orbit controllers
- **Input** — WASD controller, click-to-move controller
- **Renderer** — scene setup, chunk streamer, interpolation, VFX, particles
- **Assets** — asset builder, animator, shape factory, materials
- **EventBus** — typed client-side event system
- **Shaders** — procedural shader material base

## Install

```bash
pnpm add @loonylabs/gamedev-client
```

## Usage

```ts
import { createScene, WASDController, FollowCameraController } from '@loonylabs/gamedev-client'

const scene = createScene(canvas)
const camera = new FollowCameraController(scene.camera)
const input = new WASDController()
```

## Part of the loonylabs gamedev toolkit

| Package | Role |
|---|---|
| `@loonylabs/gamedev-core` | ECS, physics, dungeon gen |
| `@loonylabs/gamedev-client` | ← you are here |
| `@loonylabs/gamedev-server` | Tick loop, session management, DB |
| `@loonylabs/gamedev-protocol` | Zod network schemas |
| `@loonylabs/create-game` | Project scaffold CLI |

**Get started:** `npx @loonylabs/create-game my-game ./my-game`
npm package: @loonylabs/gamedev-core
Description: Game-agnostic core engine for the loonylabs gamedev framework.
Latest version: 0.1.2

# @loonylabs/gamedev-core

Game-agnostic core engine for the loonylabs gamedev framework.

## What's in here

Pure TypeScript functions — no browser APIs, no renderer, no network. Everything is testable in isolation.

- **ECS** — entity/component world, system types
- **Dungeon generation** — ASCII-based room parser, procedural generator, pathfinding
- **Physics** — character controller, gravity, jump, voxel collision
- **Voxel** — chunk management, marching cubes, biome blending, terraform
- **Combat** — melee, raycast, loot roller
- **World** — area manager, terrain, overworld noise
- **Assets** — animation schema, rig templates, validator

## Install

```bash
pnpm add @loonylabs/gamedev-core
```

## Usage

```ts
import { createWorld, parseAsciiGrid, mulberry32 } from '@loonylabs/gamedev-core'

const prng = mulberry32(12345)
const world = createWorld()
```

## Part of the loonylabs gamedev toolkit

| Package | Role |
|---|---|
| `@loonylabs/gamedev-core` | ← you are here |
| `@loonylabs/gamedev-client` | Three.js renderer, cameras, input |
| `@loonylabs/gamedev-server` | Tick loop, session management, DB |
| `@loonylabs/gamedev-protocol` | Zod network schemas |
| `@loonylabs/create-game` | Project scaffold CLI |

**Get started:** `npx @loonylabs/create-game my-game ./my-game`
npm package: @loonylabs/gamedev-server
Description: Server-side game loop and session management for the loonylabs gamedev framework.
Latest version: 0.1.3

# @loonylabs/gamedev-server

Server-side game loop and session management for the loonylabs gamedev framework.

## What's in here

Node.js game server infrastructure built on Socket.io. Handles the tick loop, player sessions, game state, and database persistence. Game-agnostic — no hardcoded game logic.

- **Bootstrap** — server setup, Socket.io wiring, connection handling
- **Game loop** — fixed-rate tick loop (20Hz), experience-aware loop
- **Game state** — `GameSession` class, player/entity state management
- **Experience manager** — register and switch between game experiences at runtime
- **Manifest factory** — auto-generates full server behavior from a `GameManifest`
- **Manifest persistence** — player + world state save/load via SQLite
- **DB layer** — generic `createDb()` factory (SQLite + Drizzle ORM)

## Install

```bash
pnpm add @loonylabs/gamedev-server
```

## Usage

### Manifest-based (recommended)

```ts
import {
  createGameServer,
  ExperienceManager,
  SocketIOBroadcaster,
  createExperienceFromManifest,
  createManifestExperience,
  manifestPlayerState,
  manifestWorldState,
} from '@loonylabs/gamedev-server';
import { createDb } from '@loonylabs/gamedev-server';

// Create DB (include framework schema tables)
const db = createDb('./data/game.db', { manifestPlayerState, manifestWorldState }, CREATE_SQL);

// Register experiences — manifest only, no custom server code
const experienceManager = new ExperienceManager(db);

// Without persistence:
experienceManager.register(createExperienceFromManifest(manifest));

// With player + world persistence (SQLite):
experienceManager.register(createManifestExperience(manifest, db));
```

### Key exports

| Export | Description |
|--------|-------------|
| `createGameServer` | Start Socket.io server |
| `ExperienceManager` | Register + manage game experiences |
| `SocketIOBroadcaster` | Broadcast messages to players |
| `createExperienceFromManifest` | Build experience from `GameManifest` (no persistence) |
| `createManifestExperience` | Build experience with SQLite player + world persistence |
| `buildPlayerState` | Build initial player state from manifest (for protocol adapters) |
| `manifestPlayerState` | Drizzle schema table for player persistence |
| `manifestWorldState` | Drizzle schema table for world persistence |
| `createDb` | Generic SQLite + Drizzle ORM factory |
| `createPersistenceHooks` | Auto-save/load hooks for custom experiences |

## Part of the loonylabs gamedev toolkit

| Package | Role |
|---|---|
| `@loonylabs/gamedev-core` | ECS, physics, dungeon gen |
| `@loonylabs/gamedev-client` | Three.js renderer, cameras, input |
| `@loonylabs/gamedev-server` | ← you are here |
| `@loonylabs/gamedev-protocol` | Zod network schemas |
| `@loonylabs/create-game` | Project scaffold CLI |

**Get started:** `npx @loonylabs/create-game my-game ./my-game`