一键导入
sui-move-object
Sui object model — struct declarations, abilities (key/store/copy/drop), object ownership, naming conventions, and dynamic fields.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Sui object model — struct declarations, abilities (key/store/copy/drop), object ownership, naming conventions, and dynamic fields.
用 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-object |
| description | Sui object model — struct declarations, abilities (key/store/copy/drop), object ownership, naming conventions, and dynamic fields. |
All structs must be declared public. Ability declarations go after the fields:
// ✅
public struct Pool has key {
id: UID,
balance_x: Balance<SUI>,
balance_y: Balance<USDC>,
}
public struct PoolCap has key, store {
id: UID,
pool_id: ID,
}
// ❌ Legacy — no public keyword
struct Pool has key {
id: UID,
}
Object rule: Any struct with the key ability must have id: UID as its first field. Use object::new(ctx) to create UIDs — never reuse or fabricate them.
Capabilities must be suffixed with Cap:
// ✅
public struct AdminCap has key, store { id: UID }
// ❌ Unclear it's a capability
public struct Admin has key, store { id: UID }
No Potato suffix — a struct's lack of abilities already communicates it's a hot potato:
// ✅
public struct Promise {}
// ❌
public struct PromisePotato {}
Events named in past tense — they describe something that already happened:
// ✅
public struct LiquidityAdded has copy, drop { ... }
public struct FeesCollected has copy, drop { ... }
// ❌
public struct AddLiquidity has copy, drop { ... }
public struct CollectFees has copy, drop { ... }
Dynamic field keys — use positional structs (no named fields):
// ✅
public struct BalanceKey() has copy, drop, store;
// ⚠️ Acceptable but not canonical
public struct BalanceKey has copy, drop, store {}
Error constants use EPascalCase. All other constants use ALL_CAPS:
// ✅
const ENotAuthorized: u64 = 0;
const MAX_FEE_BPS: u64 = 10_000;
// ❌
const NOT_AUTHORIZED: u64 = 0; // error should be EPascalCase
const MaxFeeBps: u64 = 10_000; // non-error should be ALL_CAPS
| Ability | Meaning in Sui |
|---|---|
key | Struct is an on-chain object; requires id: UID as first field |
store | Can be embedded inside other objects; enables public_transfer, public_share_object, public_freeze_object |
copy | Value can be duplicated (not valid on objects with key) |
drop | Value can be silently discarded |
Object ownership model:
// Transfer to an address (owned object)
transfer::transfer(obj, recipient); // key only — module-restricted
transfer::public_transfer(obj, recipient); // key + store — usable anywhere
// Share (accessible by anyone, goes through consensus)
transfer::share_object(obj); // key only — module-restricted
transfer::public_share_object(obj); // key + store
// Freeze (immutable forever)
transfer::freeze_object(obj); // key only — module-restricted
transfer::public_freeze_object(obj); // key + store
Only call transfer, share_object, and freeze_object (the non-public_ variants) inside the module that defines that object's type.
Never construct an object struct literal outside of its defining module.
Use dynamic fields for extensible storage or when the key set is not known at compile time:
use sui::dynamic_field as df;
use sui::dynamic_object_field as dof;
// Add a dynamic field (value stored inline with parent)
df::add(&mut parent.id, key, value);
// Add a dynamic object field (value is an independent object)
dof::add(&mut parent.id, key, child_obj);
// Access
let val: &MyType = df::borrow(&parent.id, key);
let val: &mut MyType = df::borrow_mut(&mut parent.id, key);
// Remove
let val: MyType = df::remove(&mut parent.id, key);
| Task | Load |
|---|---|
| Capability pattern, OTW, events | sui-move-patterns |
| Coin / Balance types and their abilities | sui-move-stdlib |
| Function parameter ordering with objects | sui-move-syntax |
| Package config, building, testing | sui-move-setup |