sui-move-syntax

Standardize Sui Move module syntax and conventions for clean compilation.

4|Updated Feb 13, 2026
One-click install
npx skills add https://github.com/widnyana/eyay-toolkits --skill sui-move-syntax
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: sui-move-syntax
Source: https://github.com/widnyana/eyay-toolkits/tree/main/plugins/sui-dev-tools/skills/sui-move-syntax
Command: npx skills add https://github.com/widnyana/eyay-toolkits --skill sui-move-syntax

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill prevents common Sui Move syntax and style mistakes that cause compilation failures or incorrect behavior by enforcing idiomatic module structure, visibility/mutability rules, method syntax preferences, and safe commenting conventions.

Core Features & Use Cases

  • Idiomatic module layout: Standardizes section ordering (imports → constants → structs/enums → init → public functions → public(package) → private → test-only) and promotes readable === Section Title === separators.
  • Correct use and visibility patterns: Guides proper import syntax (no redundant braces) and modern visibility choices, including avoiding deprecated public(friend)/friend and using public(package) where appropriate.
  • Safe mutability and entry design: Enforces mut for reassigned or mutably borrowed variables/parameters and clarifies composable public fun versus transaction-only entry fun to avoid incorrect return expectations.
  • Readable APIs via method syntax: Encourages method-style calls for types where the first argument matches, improving clarity in day-to-day Move code.
  • Macro-friendly iteration patterns: Promotes vector/option macros to replace verbose manual loops and branching logic.

Quick Start

Use the sui-move-syntax skill to rewrite a Move module so it follows modern Sui conventions for module declarations, imports, mut usage, visibility, and method/macro style.

Frequently Asked Questions about sui-move-syntax

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I structure a Sui Move module to avoid compilation errors?

To avoid Sui Move compilation errors, structure modules by ordering imports, constants, structs, init, public functions, public(package), private, and test-only sections sequentially. Using idiomatic section ordering ensures modules compile cleanly and read predictably.

What is the correct way to use mutability and visibility in Sui Move?

Correct Sui Move mutability requires using `mut` for reassigned or mutably borrowed variables. For visibility, avoid deprecated `public(friend)` patterns and use `public(package)` to ensure safe mutability and modern module access control.

When should I use entry fun versus public fun in Sui Move?

Use `public fun` in Sui Move for composable functions that return values, and `entry fun` for transaction-only calls. Clarifying entry versus public design prevents incorrect return expectations and ensures safe transaction execution.

How do I simplify Sui Move code using macros and method syntax?

Simplify Sui Move code by using vector and option macros to replace verbose manual loops and branching logic. Additionally, applying method syntax for calls where the first argument matches the type improves API readability.

What are common Sui Move syntax mistakes with use imports and comments?

Common Sui Move syntax mistakes include using redundant braces in `use` imports and neglecting safe commenting conventions. Remove redundant import braces and apply readable section separators to resolve these style mistakes.