move-stdlib

Common Sui Move standard library patterns — strings, Coin/Balance, Option, addresses, UID, TxContext, vectors, and struct unpacking.

15 stars

Best use case

move-stdlib is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Common Sui Move standard library patterns — strings, Coin/Balance, Option, addresses, UID, TxContext, vectors, and struct unpacking.

Teams using move-stdlib should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/stdlib/SKILL.md --create-dirs "https://raw.githubusercontent.com/MystenLabs/sui-dev-skills/main/move/stdlib/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/stdlib/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How move-stdlib Compares

Feature / Agentmove-stdlibStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Common Sui Move standard library patterns — strings, Coin/Balance, Option, addresses, UID, TxContext, vectors, and struct unpacking.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

## 1. Common Standard Library Patterns

```move
// Strings — use method syntax, don't import utf8
let s: String = b"hello".to_string();
let ascii: ascii::String = b"hello".to_ascii_string();

// Coin and Balance
use sui::coin::{Self, Coin};
use sui::balance::{Self, Balance};

let balance: Balance<SUI> = coin.into_balance();
let coin: Coin<SUI> = balance.into_coin(ctx);  // ✅ method syntax
let amount: u64 = coin.value();

// Split a payment
let exact = payment.split(amount, ctx);        // ✅
let exact = payment.balance_mut().split(amount); // ✅ avoids ctx

// Consuming values without `drop` — the @0x0 burn pattern
//
// Move's linear type system requires every non-`drop` value to be
// explicitly consumed. The `_` prefix only suppresses warnings for values
// that *do* have `drop` — it won't help for Balance<T>, Coin<T>, or your
// own structs that lack `drop`.
//
// To permanently destroy any `key + store` object, transfer it to @0x0
// (an address no one controls, equivalent to Solidity's address(0)):
transfer::public_transfer(my_obj, @0x0);       // ✅ permanent burn
//
// Balance<T> has neither `drop` nor `key`, so it cannot be transferred
// directly, and `balance::destroy_zero` only works on empty balances.
// Wrap it in a Coin first:
//
//   let _locked = supply.increase_supply(MINIMUM_LIQUIDITY); // ❌ compile error
//
let locked = supply.increase_supply(MINIMUM_LIQUIDITY).into_coin(ctx);
transfer::public_transfer(locked, @0x0);       // ✅ burns the minimum liquidity
//
// Hot potatoes (structs with no abilities at all) cannot use this pattern —
// they must be destructured and each field consumed individually.

// Option
let opt: Option<u64> = option::some(42);
let val = opt.destroy_or!(default_value);      // ✅ macro form
let val = opt.borrow();

// Address and IDs
let id: ID = object::id(&my_obj);
let addr: address = id.to_address();

// UID deletion
id.delete();                                   // ✅
// object::delete(id);                         // ❌ verbose

// TxContext sender
ctx.sender()                                   // ✅
// tx_context::sender(ctx)                     // ❌ verbose

// Vector literals and index syntax
let mut v = vector[1, 2, 3];                   // ✅ literal
let first = v[0];                              // ✅ index syntax
assert!(v.length() == 3);                      // ✅ method syntax
// let mut v = vector::empty();               // ❌ verbose
// vector::push_back(&mut v, 1);              // ❌ verbose

// Struct unpack — use .. to ignore fields you don't need
let MyStruct { id, .. } = value;               // ✅
// let MyStruct { id, field_a: _, field_b: _ } = value; // ❌ verbose
```

Related Skills

move-syntax

15
from MystenLabs/sui-dev-skills

Move language syntax — module layout, imports, mutability, visibility, method syntax, enums, macros, and comments.

move-setup

15
from MystenLabs/sui-dev-skills

Move package setup (Move.toml, edition, dependencies), building, testing, and common pitfalls from other Move dialects.

move-patterns

15
from MystenLabs/sui-dev-skills

Move design patterns — events, error handling, one-time witness (OTW), capability pattern, and pure functions/composability.

move-objects

15
from MystenLabs/sui-dev-skills

Sui object model — struct declarations, abilities (key/store/copy/drop), object ownership, naming conventions, and dynamic fields.

move

15
from MystenLabs/sui-dev-skills

Move smart contract development on Sui. Use when writing, reviewing, or debugging Move code, Move.toml configuration, or Sui object model patterns.

sui-ts-sdk

15
from MystenLabs/sui-dev-skills

Sui TypeScript SDK — PTB construction, client setup, transaction execution, and on-chain queries. Use when writing code that interacts with the Sui blockchain via @mysten/sui. These patterns apply in both backend scripts and frontend apps. For frontend-specific setup (dApp Kit, wallet adapters, React hooks), use the sui-frontend skill first or alongside this one.

sui-frontend

15
from MystenLabs/sui-dev-skills

Sui frontend dApp development with @mysten/dapp-kit-react (React) and @mysten/dapp-kit-core (Vue, vanilla JS, other frameworks). Use when building browser apps that connect to Sui wallets, query on-chain data, or execute transactions. Use alongside the sui-ts-sdk skill for PTB construction patterns.

sui-dev

15
from MystenLabs/sui-dev-skills

Full-stack Sui blockchain development — Move smart contracts, TypeScript SDK, and frontend dApp Kit. Routes to the appropriate sub-skill based on what the user is building.

performing-lateral-movement-with-wmiexec

16
from plurigrid/asi

Perform lateral movement across Windows networks using WMI-based remote execution techniques including Impacket wmiexec.py, CrackMapExec, and native WMI commands for stealthy post-exploitation during red team engagements.

performing-lateral-movement-detection

16
from plurigrid/asi

Detects lateral movement techniques including Pass-the-Hash, PsExec, WMI execution, RDP pivoting, and SMB-based spreading using SIEM correlation of Windows event logs, network flow data, and endpoint telemetry mapped to MITRE ATT&CK Lateral Movement (TA0008) techniques.

move-smith-fuzzer

16
from plurigrid/asi

Move Smith Fuzzer Skill

hunting-for-lateral-movement-via-wmi

16
from plurigrid/asi

Detect WMI-based lateral movement by analyzing Windows Event ID 4688 process creation and Sysmon Event ID 1 for WmiPrvSE.exe child process patterns, remote process execution, and WMI event subscription persistence.