---
description: Always use this when you are a Cursor Cloud agent
globs:
alwaysApply: false
---

# Cursor Cloud agent setup notes

These notes apply only when running inside a Cursor Cloud agent VM. For architecture, commands, testing, lint, and formatting, follow `AGENTS.md`.

The cloud VM boots from a snapshot with dependencies already installed; the startup update script only runs `yarn` (install).

- **Node is fixed in the VM snapshot, not in this repo.** `/exec-daemon/node` (Node 22.14) is injected ahead of nvm in `PATH`, and `nvm use` does not override it. That breaks anything running a `.ts` file directly through `node` (`yarn task check`, `yarn nx run-many -t check`). The snapshot's `~/.bashrc` already prepends the nvm-managed Node (`.nvmrc` / `22.22.3`), so normally you do nothing. Because that fix lives in the VM image rather than in git, it is not reproducible from this repo alone — if `node --version` reports below 22.18, the snapshot was rebuilt without it and you should restore it:
  ```bash
  # from the repo root, so nvm resolves .nvmrc
  nvm install                                                                           # no-op if already installed
  export PATH="${NVM_DIR:-$HOME/.nvm}/versions/node/v$(tr -d '[:space:]' < .nvmrc)/bin:$PATH"
  corepack enable                                                                       # yarn 4.18.0 on that Node
  ```
- **Compile before running or typechecking.** The update script does not build. `yarn storybook:ui` runs `code/core/dist/bin/dispatcher.js`, so run `yarn task --task=compile --start-from=compile` (or `yarn nx run-many -t compile`) after a fresh boot or after changing package source. NX caches make reruns fast.
- **Running the app:** `cd code && yarn storybook:ui` serves the internal Storybook UI on port `6006`. Verify with `curl --fail --silent --show-error localhost:6006/index.json`.
