一键导入
sui-move-stdlib
Common Sui Move standard library patterns — strings, Coin/Balance, Option, addresses, UID, TxContext, vectors, and struct unpacking.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Common Sui Move standard library patterns — strings, Coin/Balance, Option, addresses, UID, TxContext, vectors, and struct unpacking.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
This skill should be used when the user says "run the sprint", "autonomous sprint", "run all stories", "execute sprint plan", "complete all epics", or asks to autonomously execute all stories in the current sprint. Drives Claude Code through create-story, dev-story, quality gates, and code-review in a continuous loop without human intervention until all stories are done or blocked.
This skill should be used when the user asks to "upgrade a Solana program through Squads", "set up squads multisig deployment", "create a Squads upgrade proposal", "configure squads-program-action", "deploy via Squads multisig", "set up Squads CI/CD pipeline", "squads GitHub Actions workflow", or mentions Solana program upgrades involving Squads v4 multisig governance.
This skill should be used when the user asks to "create a diagram", "make an architecture diagram", "design a system diagram", "draw an architecture", "create a technical diagram", "make a deployment diagram", "visualize infrastructure", "create a data flow diagram", "draw system components", "make a network diagram", "diagram a cloud architecture", "draw an AWS diagram", "create a Kubernetes diagram", or mentions architecture, system design, infrastructure diagrams, component relationships, or data flow. Do NOT trigger for cover images, step-by-step process flows, or infographics.
This skill should be used when the user asks to "write something satirical about work", "roast a corporate event", "write a vignette about a bad meeting", "satirise startup culture", "write a LinkedIn post parody", "make fun of OKRs", "write a scene about a reorg", "satirise remote work rituals", "mock team-building activities", "write a satirical all-hands recap", or wants any comedic or ironic depiction of organisational life, management behaviour, or workplace absurdity across offices, startups, remote teams, or any setting where hierarchy produces comedy.
Write technical documentation, blog articles, code reviews, and product writeups in a storytelling style that's direct, humble, and problem-first. Use this skill whenever the user wants to publish articles, write technical reviews, document processes, or explain systems in a way that's concrete and human. This includes API docs, how-to guides, product comparisons, incident postmortems, feature writeups, and code reviews. The skill applies whether you're writing for public blogs, internal teams, or personal knowledge vaults. Provide both public-facing (slightly more scaffolding) and internal (tighter) versions when requested.
This skill should be used when the user asks to "create a cover image", "generate a blog cover", "make an OG image", "design a social preview", "create a thumbnail for a post", "add a cover to my article", "make a featured image", "create a header image for a post", "generate an open graph image", or mentions cover images, OG images, social preview images, or blog post thumbnails. Do NOT trigger for diagrams, architecture diagrams, or process flows.
| name | sui-move-stdlib |
| description | Common Sui Move standard library patterns — strings, Coin/Balance, Option, addresses, UID, TxContext, vectors, and struct unpacking. |
// 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
| Task | Load |
|---|---|
| Abilities required by stdlib types | sui-move-object |
| Method syntax for stdlib method calls | sui-move-syntax |
| Error handling with assert! and error constants | sui-move-patterns |
| Package config, building, testing | sui-move-setup |