mystenlabs/sui-dev-skills/syntax
Claude Code and agent skill by mystenlabs/sui-dev-skills
- community
Checking that the SKILL.md file is still in the repository.
Move language syntax — module layout, imports, mutability, visibility, method syntax, enums, macros, and comments.
Install
npx vskill@latest install mystenlabs/sui-dev-skills/syntaxSKILL.md
1. Module Layout
Use the new single-line module declaration without braces:
Standard section order within a module:
useimports- Constants (
const) - Structs / Enums
fun init(if needed)- Public functions
public(package)functions- Private functions
- Test module (
#[test_only])
Use === Section Title === comments to delimit sections for readability.
use import rules
Don't use a lone {Self} — just import the module directly:
When importing both the module and members, group them with Self:
2. Mutability — mut is Required
All variables that are reassigned or mutably borrowed must be declared let mut:
Function parameters that are mutably borrowed must also be mut:
3. Visibility
| Keyword | Scope | |
|---|---|---|
public | Callable from any module | |
public(package) | Callable only within the same package | |
| (none) | Private — callable only within the same module |
public(friend) and friend declarations are deprecated. Use public(package) instead.
Never use `public entry` — use one or the other. public functions are composable in PTBs and return values; entry functions are transaction endpoints only and cannot return values:
Function parameter ordering
Always order parameters: mutable objects → immutable objects → capabilities → primitive types → &Clock → &mut TxContext:
Getter naming
Name getters after the field. Do not use a get_ prefix:
4. Method Syntax
Functions whose first argument matches a type are automatically callable as methods:
Use method syntax wherever it improves readability. Declare use fun aliases for functions defined outside the owning module:
5. Enums
Use enums for types with multiple variants. Enums cannot have the key ability (they cannot be top-level objects), but they can be stored inside objects:
Pattern match with match:
6. Macros
Use macro functions for higher-order patterns instead of manual loops.
Vector macros
All of these replace verbose manual while loops. Use them whenever you iterate over a vector.
Option macros
These replace verbose if (opt.is_some()) / destroy_some() patterns:
7. Comments
Use /// for doc comments. JavaDoc-style /** */ is not supported in Move:
Use regular // comments to explain non-obvious logic, potential edge cases, and TODOs:
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingmove/syntax/SKILL.md
Popularity
- Repository stars
- 20
- Repository forks
- 9
- 7-day trend score
- 0
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/mystenlabs/sui-dev-skills/syntax)