---
description: RTIE platform coding rules — use when working in a project that builds on RTIE.
globs: ["**/*.ts", "**/*.tsx"]
alwaysApply: false
---

# RTIE Platform — Coding Rules

You are working in a project built on **RTIE** (Real Time Intelligence Engine).

## Key constraints

- Use `@rtie/sdk` for all realtime, presence, chat, and auction operations — never call Supabase, SpacetimeDB, or Cloudflare APIs directly
- Deploy via `bunx wrangler deploy` — not Railway, Vercel, or AWS
- Run DB migrations via `bun db:migrate` — not Supabase CLI
- Every module table must have `context_id` referencing the Context Graph
- Modules communicate via emitted events, not direct cross-module SQL joins

## SDK quickstart

```typescript
import { createClient } from "@rtie/sdk";
const rtie = createClient({ apiKey: process.env.RTIE_API_KEY! });
```

## MCP tools

Connect to `https://mcp.rtie.ai/mcp` with `Authorization: Bearer ${RTIE_API_KEY}`.

Core tools: `list_rooms`, `create_room`, `activate_room`, `get_presence`, `send_chat_message`, `create_auction`, `start_auction`, `auction_place_bid`, `ingest_signal`, `get_rules`, `set_rules`

## Module manifest

Every module must export a `manifest: ModuleManifest` from `@rtie/module-sdk` with: `id`, `name`, `version`, `routes`, `events`, `mcp_tools` (typed `McpToolDefinition[]`), and `contexts`.

## Full docs

https://docs.rtie.ai/ai-tools
