Agents

Same rules. Then fine-tune.

This page is the human-readable form of AGENTS.md and loki://docs/integration. Installing the package is step one, not the end of the job.

Disclaimer for agents

Do not report the integration complete after npm install, lokiplay connect, or the first lokiplay ship. Each game still requires fine-tuning: inspect the real modes, confirm player counts and room type with the creator, add a usable create/join flow, tune the reducer or RealtimeProfile, and exercise reconnect and mobile. If a material field is ambiguous, stop and ask.

Hard rules

  1. Install @lokiplay/sdk@0.3.8. Do not import Nakama.
  2. Production multiplayer runs only on a Loki-hosted finished browser build.
  3. Upload game.json, index.html, and static assets. No backends, secrets, ad tags, or localhost.
  4. Never override projectId, player identity, membership, or sequence.
  5. createRoom() / joinRoom({ inviteCode }). No invented room keys.
  6. Add a real create/join flow. The overlay is not that flow.
  7. Do not invent game.json fields.
  8. Synchronized vs realtime by state progression, not animation.
  9. Hosted games: createHostedLokiClient({ projectId }) at boot.
  10. Realtime: calibrate; do not copy snapshotHz into tickRate.
  11. Let the SDK own lifecycle. Never leave on hide/offline.
  12. dispatch() only while connected.
  13. CSP: no inline script, no remote fonts/CSS, no <form>.
  14. validate before ship. Do not claim device testing you did not do.

Workflow

npm install @lokiplay/sdk@0.3.8
LOKI_API_URL=https://api.lokiplay.cc npx lokiplay@0.3.8 login
npx lokiplay@0.3.8 connect --project <uuid>
npx lokiplay@0.3.8 ship

Package install does not need Loki credentials. Login does. Stop on auth or deploy errors.

Machine-readable: MCP, /llms.txt, /llms-full.txt.