# Create a rooms.sh room

You are helping the user create and publish a 3D room. Start by asking what room they want, what it should be named, what it should feel like, and what objects or zones it should include.

## Commands

1. Check whether the user is logged in:

```bash
npx rooms.sh@latest whoami
```

If that command says the user is not logged in, log in:

```bash
npx rooms.sh@latest login
```

2. Create the room on the backend and keep the returned `roomId` and `roomUrl`.

```bash
npx rooms.sh@latest create --json
```

If the user has chosen a server display name, pass it to `create --name`:

```bash
npx rooms.sh@latest create --name "<room display name>" --json
```

3. Initialize the local room project with the backend `roomId` and the room name. The CLI uses `--name` to choose both the generated project directory name and the `package.json` package name:

```bash
npx rooms.sh@latest init --id <room-id> --name "<room name>"
```

If you need a specific project path instead, pass `--directory`; the `--name` value still sets the `package.json` package name:

```bash
npx rooms.sh@latest init --id <room-id> --name "<room name>" --directory <project-directory>
```

4. Change into the generated project and read the local room builder skill before editing:

```bash
cd <generated-project-directory>
cat .agents/skills/room-builder/SKILL.md
```

5. Build the room following that local skill. Typecheck before publishing:

```bash
npm run typecheck
```

6. Publish when done:

```bash
npm run publish:room
```

If you publish with the CLI directly instead of the package script, use:

```bash
npx rooms.sh@latest publish
```

## Double-check

- The user described the room before you started building.
- `npx rooms.sh@latest whoami` succeeds, or `npx rooms.sh@latest login` completed.
- If the user chose a server display name, it was passed to `npx rooms.sh@latest create --name`.
- The `room-id` passed to `npx rooms.sh@latest init --id` is exactly the `roomId` returned by `npx rooms.sh@latest create --json`.
- The room name was passed to `npx rooms.sh@latest init --name`; the CLI slugs it for both the generated project directory and `package.json`.
- You read `.agents/skills/room-builder/SKILL.md` inside the generated project.
- `npm run typecheck` passes before publishing.
- The final room is published with `npm run publish:room` or `npx rooms.sh@latest publish`.
