agentleFS
MystenLabsMystenLabs/skills/sui-move/SKILL.md

sui-move

Skill20 starsChanged 15 days agoApache-2.0View on GitHub

Sui Move smart contract development. Use when writing, reviewing, or debugging Move code on Sui. Covers Move abilities (key, store, copy, drop), TxContext, init functions, One-Time Witness, package publishing and upgrades, resource safety, events, and coins. Also use when the user asks about struct abilities, UID, how to destroy objects, or how to create a fungible token.

The file

We split this skill into the rules it gives an agent

3 rules. About 0 are common, 0 are distinctive, and 3 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Always use object::new(ctx) to create UIDs.

    line 87
  2. Very specific:

    Use public_transfer (not transfer) when the object has store and the call originates outside the defining module.

    line 88
  3. Very specific:

    Forgetting to delete the UID: When destroying an object, you must call object::delete(id) on the UID field.

    line 96

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Sui Move

MCP tool: When available in your environment, also query the Sui documentation MCP server (https://sui.mcp.kapa.ai) for up-to-date answers. Use it for verification and for details not covered by these reference files.

Source constraint: All information in this skill is sourced exclusively from docs.sui.io and move-book.com. When extending or updating this skill, only pull from these sources. Do not use third-party blogs, tutorials, or unofficial documentation.

Move is Sui's smart contract language, designed around resource safety and an object-centric data model. This skill covers the core Move language: the type system, abilities, resource safety, events, and coins.

This skill routes to focused reference files. Load only the ones relevant to the current task.


Reference files (this skill)

move — Move Language Fundamentals

Path: move.md Load when: writing Move code, working with abilities, TxContext, time/Clock, init functions, One-Time Witness, internal::Permit<T>, type_name deprecations, packages, modules, structs, resource safety, access control patterns, admin rotation, deny lists, security review, or advanced design patterns (ability dosing, phantom events, shared-object concurrency, receiver syntax, error attributes, transfer::receive, field privacy, macros). Covers: the four abilities and common combinations, TxContext methods, Clock object, init functions, OTW pattern, internal::Permit<T> type-level authorization, type_name deprecations, packages and upgrades, modules, structs, resource safety and object destruction, a worked Greeting example, admin rotation (two-step transfer), regulated coins and deny lists, security review checklist, advanced design patterns (ability dosing, phantom-type events, event denormalization, shared-object & vs &mut, receiver-syntax ordering, #[error] constants, transfer::receive privacy, field privacy, macro gotchas).

events-coins — Events and Coins

Path: events-coins.md Load when: emitting events, subscribing to events offchain, creating fungible tokens, or working with coin operations (mint, burn, split, join). Covers: event emission, event struct requirements, coin::create_currency, TreasuryCap, CoinMetadata, standard coin operations.


Related skills (load from separate skill directories)

TopicSkillLoad when
Object model, ownership, dynamic fields, collections, Display, transfer patternsobject-model/Designing data models, choosing ownership types, using dynamic fields or collections, setting up Object Display
Programmable transaction blocks, commands, owned-object version conflictsptbs/Building PTBs, composing transactions, sponsored transactions, troubleshooting transaction errors
Frontend dApp development, dApp Kit, wallet connectionfrontend-apps/Building React/Vue frontends, wallet integration, querying onchain state from the browser
Project setup, Move.toml, dependencies, publishingsui-move-project/Creating a Move project, configuring Move.toml, resolving build errors, publishing packages
Move 2024 syntax, method syntax, macrosmodern-move-syntax/Using Move 2024 edition features like method syntax, vector literals, option/loop macros
Composable function designcomposable-move-functions/Designing functions for PTB composability, parameter ordering, return patterns
Unit testing conventionsmove-unit-testing/Writing Move unit tests, test patterns, expected_failure, cleanup
Naming conventionsnaming-conventions/Naming errors, constants, capabilities, events, getters, dynamic field keys

Routing guide

TaskLoad
Writing a Move struct with abilitiesmove
Using TxContext or the Clock objectmove
Writing an init function or OTWmove
Using type_name functionsmove
Proving module authority with internal::Permit<T>move
Publishing or upgrading a packagemove
Destroying an object without dropmove
Emitting or subscribing to eventsevents-coins
Creating a fungible tokenmove + events-coins
Designing an object data modelobject-model/ skill
Choosing shared vs owned objectsobject-model/ skill
Using dynamic fields or collectionsobject-model/ skill
Setting up Object Displayobject-model/ skill
Building a PTBptbs/ skill
Implementing sponsored transactionsptbs/ skill
Building a frontendfrontend-apps/ skill
Setting up Move.tomlsui-move-project/ skill
Writing a complete smart contractmove + events-coins + object-model/ + naming-conventions/ + modern-move-syntax/
Code reviewmove + events-coins + composable-move-functions/ + naming-conventions/ + modern-move-syntax/
Security review / access control auditmove + object-model/ (patterns) + events-coins
Advanced design patterns / performance tuningmove

Rules

  • Always use object::new(ctx) to create UIDs. There is no other way.
  • Use public_transfer (not transfer) when the object has store and the call originates outside the defining module.
  • Event structs must have copy and drop abilities.
  • No as casts on numeric types. Use from/into or try_from/try_into.
  • To destroy an object without drop, unpack the struct and call object::delete(id) on the UID.

Common mistakes

  • Confusing transfer with public_transfer. The non-public variant only works within the defining module. Calling it from another module is a compile error.
  • Forgetting to delete the UID. When destroying an object, you must call object::delete(id) on the UID field.
  • Assuming ctx.epoch_timestamp_ms() is precise. It returns the epoch start time. Use the Clock object (0x6) for real-time timestamps.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.