composable-move-functions

Design Sui Move function APIs for Programmable Transaction Blocks.

10|5|Updated Mar 13, 2026
One-click install
npx skills add https://github.com/MystenLabs/skills --skill composable-move-functions
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: composable-move-functions
Source: https://github.com/MystenLabs/skills/tree/main/composable-move-functions
Command: npx skills add https://github.com/MystenLabs/skills --skill composable-move-functions

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill prevents non-composable Sui Move function patterns by guiding how to structure public and entry points, return values, and parameters so functions can be safely chained in Programmable Transaction Blocks (PTBs) without breaking caller composition.

Core Features & Use Cases

  • Visibility & Entrypoints: Enforces using public for composable functions and entry only for transaction endpoints, avoiding invalid public entry combinations.
  • Return vs Transfer Design: Requires public functions to return objects to the caller instead of transferring internally to ctx.sender(), with separate entry wrappers for convenience.
  • Function Signature Ordering: Standardizes parameter order as objects first, capabilities second, primitives third, and places Clock near the end before ctx, with TxContext last.

Use Case: When building a modular AMM or NFT minting API, use this guidance to ensure functions like add_liquidity, swap, or mint_profile return the relevant objects/coins to the caller so they can be chained in a single PTB while keeping transaction-specific transfers isolated to entry wrappers.

Quick Start

Use the composable-move-functions skill to review an existing Sui Move module and rewrite its function signatures so public APIs return values for PTB composability, entry endpoints transfer to the sender, and parameter order follows the required object-capability-primitive-clock-txcontext pattern.

Frequently Asked Questions about composable-move-functions

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I design Move smart contract functions that compose correctly inside Programmable Transaction Blocks?

Design composable Move smart contract functions for PTBs by using `public` visibility and returning objects to the caller instead of transferring internally to `ctx.sender()`, ensuring safe chaining across modules within a single PTB.

What is the correct parameter order for Sui Move function signatures?

The correct parameter order for Sui Move function signatures is objects first, capabilities second, primitives third, `Clock` near the end, and `TxContext` last. Standardizing signatures this way ensures predictable usage across modules and PTBs.

Why should I avoid using public entry functions in Sui Move?

Avoid `public entry` functions in Sui Move because they mix composable APIs with transaction endpoints. Use `public` for functions that need to chain in PTBs and `entry` only for transaction endpoints to prevent invalid combinations and broken caller composition.

How do I structure a modular AMM or NFT minting API in Sui Move?

Structure modular AMM or NFT minting APIs in Sui Move by making public functions like `swap` or `mint_profile` return relevant objects and coins to the caller. Keep transaction-specific transfers isolated to separate `entry` wrapper functions.

How do I refactor an existing Sui Move module to be PTB-composable?

Refactor an existing Sui Move module to be PTB-composable by rewriting function signatures so public APIs return values for chaining, entry endpoints transfer to the sender, and parameter order follows the object-capability-primitive-clock-txcontext pattern.