一键导入
sui-move-setup
Move package setup (Move.toml, edition, dependencies), building, testing, and common pitfalls from other Move dialects.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Move package setup (Move.toml, edition, dependencies), building, testing, and common pitfalls from other Move dialects.
用 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-setup |
| description | Move package setup (Move.toml, edition, dependencies), building, testing, and common pitfalls from other Move dialects. |
Always use the Move 2024 edition (edition = "2024" in Move.toml). The name in [package] defines the package's address name and must match what the Move code uses (e.g., module my_package::m requires name = "my_package"):
[package]
name = "my_package"
edition = "2024"
Implicit framework dependencies (Sui 1.45+) — do not list Sui, MoveStdlib, Bridge, or SuiSystem in [dependencies]. They are implicit:
# ✅ Sui 1.45+
[dependencies]
# no framework entries needed
# ❌ Outdated
[dependencies]
Sui = { git = "...", subdir = "crates/sui-framework/packages/sui-framework", rev = "..." }
No [addresses] section (Sui CLI 1.63+) — named addresses are derived from the [package] name and [dependencies] keys. Do not add an [addresses] or [dev-addresses] section.
Run sui move build after any significant change to verify the code compiles before proceeding.
Always verify code compiles and tests pass using the Sui CLI:
# Build
sui move build
# Run all tests
sui move test
# Run a specific test by name
sui move test swap_exact_input
Naming — do not prefix test functions with test_. The #[test] attribute already signals intent:
// ✅
#[test] fun create_pool() { }
#[test] fun swap_returns_correct_amount() { }
// ❌
#[test] fun test_create_pool() { }
Merge attributes — combine #[test] and #[expected_failure] on one line:
// ✅
#[test, expected_failure(abort_code = EInsufficientLiquidity)]
fun swap_with_zero_input() { ... }
// ❌
#[test]
#[expected_failure(abort_code = EInsufficientLiquidity)]
fun swap_with_zero_input() { ... }
Don't clean up in expected_failure tests — let them abort naturally, don't add scenario.end() or other teardown:
// ✅
#[test, expected_failure(abort_code = EInsufficientLiquidity)]
fun swap_with_zero_input() {
let mut ctx = tx_context::dummy();
let pool = create_pool(&mut ctx);
pool.swap(coin::zero(&mut ctx)); // aborts here — done
}
// ❌ — don't clean up after expected failure
#[test, expected_failure(abort_code = EInsufficientLiquidity)]
fun swap_with_zero_input() {
let mut scenario = test_scenario::begin(@0xA);
// ... test body ...
scenario.end(); // unnecessary, misleading
}
Use tx_context::dummy() for simple tests — only reach for test_scenario when multi-transaction or multi-sender behaviour is genuinely needed:
// ✅ Simple test — no scenario needed
#[test]
fun create_pool() {
let mut ctx = tx_context::dummy();
let pool = new_pool(&mut ctx);
assert_eq!(pool.fee_bps(), 30);
sui::test_utils::destroy(pool);
}
// ✅ Multi-sender test — scenario is appropriate
#[test]
fun only_admin_can_set_fee() {
let mut scenario = test_scenario::begin(@admin);
// ...
scenario.end();
}
Assertions — prefer assert_eq! over assert! for value comparisons (shows both sides on failure), and never pass abort codes to assert!:
// ✅
assert_eq!(pool.fee_bps(), 30);
assert!(pool.is_active());
// ❌
assert!(pool.fee_bps() == 30); // doesn't show the actual value on failure
assert!(pool.is_active(), 0); // abort code conflicts with app error codes
Destroying objects in tests — use sui::test_utils::destroy, never write custom destroy_for_testing functions:
// ✅
use sui::test_utils::destroy;
destroy(pool);
// ❌
pool.destroy_for_testing();
| Pattern | Source | Do NOT use on Sui |
|---|---|---|
acquires, move_to, move_from, borrow_global | Aptos / Core Move | Sui has no global storage |
signer type | Aptos / Core Move | Use &mut TxContext and ctx.sender() |
Script functions | Aptos | Use entry functions instead |
public(friend) | Legacy Move | Use public(package) |
Struct without public keyword | Legacy Move | All structs must be public |
let x = ... for mutable vars | Legacy Move | Use let mut x = ... |
use inside function bodies for module-level imports | Style issue | Put use at the top of the module |
&signer | Rust / Aptos | Does not exist on Sui |
| Task | Load |
|---|---|
| Writing module code, functions, enums | sui-move-syntax |
| Defining structs or choosing abilities | sui-move-object |
| Emitting events, error handling, caps | sui-move-patterns |
| Working with Coin, Balance, vectors, etc. | sui-move-stdlib |
| Full contract from scratch | all sub-skills |