Cursor for Sui

Give Cursor standing Sui and Move conventions, so it stops guessing from other chains.

Last updated Aug 21, 2026

Tags

cursorsetupai

What this does

Cursor is good at Sui the moment it knows Sui's rules, and bad at it by default — left alone, it reaches for Solidity habits, invents framework APIs, and writes SDK calls against a JSON-RPC client that has been deprecated. This page installs a standing rule file that corrects all three, permanently, for every conversation in the repo.

It does not install Cursor, and it does not touch your application or contract code.

When Cursor is the right tool

Reach for Cursor when you want an IDE loop: edit a Move module or a TypeScript client, ask a question against the open repo, apply the patch in the editor and keep going. It is the best of the three for local Move.toml packages and for refactors that touch a lot of files at once.

Use Claude Code instead when the work is terminal-first — chasing a failing sui move test, reading logs, exploring a package you have never seen. Use Codex when the task is already well specified and you mostly want it written.

How to install it

Press Copy markdown at the top of this page and paste it into Cursor Agent with your repo open.

What you copy is not this page. It is an instruction set written for the agent: it inventories your repo first, reports what it found, and then creates the rule file. You do not need to add a prompt in front of it — pasting is enough.

If you would rather point an agent at a URL than paste, the same payload is served as plain markdown at /start-building/ai-setup/cursor/agent.md.

Prefer doing it by hand? The whole change is one new file, .cursor/rules/sui-move.mdc, marked alwaysApply: true. The copied payload contains the exact body to put in it.

What lands on disk

One file: .cursor/rules/sui-move.mdc. Cursor picks up .mdc rule files on its own, so nothing else needs editing.

Commit it and your teammates and CI agents inherit the same rules, and changes to them show up in review. If you would rather keep it personal, tell the agent so and it writes ~/.cursor/rules/sui-move.mdc instead, which follows you across every Sui repo and stays out of the project.

Either way, an existing AGENTS.md or CLAUDE.md is left alone. That matters more than it sounds: a common setup symlinks AGENTS.md to CLAUDE.md, and an agent told to "create AGENTS.md" will happily write through the link and destroy the other file.

What the rules actually enforce

Your repo outranks the rules. The edition and dependency rev come from your Move.toml, read at the time of asking — never from a value baked into a rule that was true when someone wrote it. Move sources are found by locating Move.toml, not by assuming a sources/ directory. Commands use whichever package manager your lockfile implies.

Ownership is treated as security. Object ownership, the key / store / copy / drop abilities, and transfers are handled as security-critical rather than mechanical. Visibility has to match intent, so public never gets widened just to make something compile. Admin, mint, and publisher capabilities must be gated, and shared-object mutations come with a note about congestion and authorization.

Deprecated clients are flagged, not silently rewritten. New code defaults to SuiGrpcClient from @mysten/sui/grpc, with SuiGraphQLClient for indexed or historical queries and @mysten/dapp-kit-react for new UI. Where old SuiClient code already exists, the agent is told to point it out and propose a migration — not to start rewriting working call sites in the middle of an unrelated task.

How to tell it worked

Ask Cursor to review your Move package for ownership and capability bugs, without listing what to look for.

If the rules loaded, the answer talks about abilities, entry versus public visibility, and capability gating unprompted, and it quotes the real edition from your Move.toml instead of a generic one. If it gives you a vague code-style review, the rule file is not being read.

Skills, if you want more depth

Rules are always on and should stay short. Skills load on demand and can be long, which makes them the right home for deep procedures — a Move security review pass, a zkLogin debugging walkthrough, a Walrus upload checklist.

Official Sui skills install with skills add mystenlabs/skills, run through whichever package runner your project uses. Start with --list rather than a name you remember: the catalogue moves, and the upstream README currently lags the repo. Task-specific ones live under Start building → Browse AI prompts, saved as .cursor/skills/<name>/SKILL.md. Check what you already have installed first — duplicate skills covering the same ground make the agent pick arbitrarily.

One safety note

Never put private keys, mnemonics, or production secrets in a rule file or a skill sample. Rule files are always in context, they get committed, and they end up in screenshots.