cursorrules

A set of coding rules for a cloud project, including package-management, Git, TypeScript, error-handling, and AI-library preferences. It also specifies commands and practices the project expects developers to follow.

In plain words
What is it for?
Use it when installing packages, running scripts, working with GitHub, writing TypeScript, handling errors, or adding AI-related features.
Why use it?
It keeps contributions consistent with the project's tools and reduces avoidable errors from using unsupported commands, types, or patterns.

Cursor rule for Cursor

▶ Build an AI Agent with Eliza OS - X/Twitter Bot Tutorial 2025 Square of Dai · about elizaOS/eliza · on YouTube →
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add rules/elizaos/eliza/cursorrules
Clone the repo
git clone --depth 1 https://github.com/elizaOS/eliza

Made for: Cursor.

Per session 632 This file is loaded in full into every session.
When invoked 632 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00632 $0.00632
Opus 5 $0.00316 $0.00316
Sonnet 5 $0.00126 $0.00126
Haiku 4.5 $0.00063 $0.00063

Measured 2d ago against content hash d27d20747ab7, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

cursorrules scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

packages/cloud/shared/.cursorrules · 66 lines

How it starts

The opening of the file, as written. The whole thing — 66 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Cursor Rules for cloud

Package Management

  • Always use bun for package management operations (install, add, remove, run scripts)
  • Never use npm, yarn, or pnpm commands
  • Use bun install instead of npm install
  • Use bun add instead of npm install <package>
  • Use bun remove instead of npm uninstall
  • Use bun run instead of npm run

Git Operations

  • For git operations and links use GitHub CLI (gh)
  • Never make comments on PR

TypeScript

  • Never use any or unknown types, always look for the actual types
  • Always use explicit type definitions, search for existing shared types before creating new ones

AI/ML Libraries

  • Prefer to use Vercel AI SDK wherever possible for AI-related functionality
  • Use AI SDK elements for AI-related UI elements whenever possible (e.g., message components, reasoning displays, artifacts, etc.)

Documentation

  • Use Context7 MCP for library documentation whenever needed

Do not use try { } catch { } blocks unless they are absolutely necessary or handling user supplied data. Avoid defensive programming and implement clean code with fail-fast patterns.

IMPORTANT: After you have finished a task, go through again and review for slop, unnecessary comments, fallbacks and overly complex state management

It is very important that you ALWAYS review your work after you've completed it to make sure that it is as clean, tight, compact as possible, with strong types and fail fast where it makes sense

If you are expecting something, you can use an expect/throw pattern. Always aim to catch errors and throw instead of hiding errors and falling back.

Database Migrations

CRITICAL: Never use db:push - it bypasses migration tracking and breaks production deployments.

Schema Changes Workflow

  1. Modify TypeScript schema in db/schemas/
  2. Generate migration: bun run db:generate
  3. Review generated SQL in db/migrations/
  4. Test locally: bun run db:migrate
  5. Commit both schema and migration files

Read the full file on GitHub · 66 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 66 lines · 632 tokens per session scan A d27d20747ab7

Subscribe to this mod's changes

cursorrules is a cursor rule published in the GitHub repository elizaOS/eliza (19,210 stars, last pushed 3d ago), licensed MIT. It adds 632 tokens to every session, about $0.0032 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.