aptos-move-language

Analyze Move language features for safe asset programming on Aptos.

Updated Nov 25, 2025
One-click install
npx skills add https://github.com/gounthar/bazel-riscv --skill aptos-move-language
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: aptos-move-language
Source: https://github.com/gounthar/bazel-riscv/tree/main/.claude/skills/aptos/move-language
Command: npx skills add https://github.com/gounthar/bazel-riscv --skill aptos-move-language

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Provides deep guidance on the Move language features, including abilities, generics, references, and object models.

Core Features & Use Cases

  • Abilities & Generics: copy, drop, store, key; phantom types.
  • References & Storage: borrow_global, move_to, move_from.
  • Advanced: signer patterns, visibility, inline functions.
  • Use Case: Design safe, composable on-chain data structures.

Quick Start

Ask: "Show a Move struct with phantom type and a generic function."

Frequently Asked Questions about aptos-move-language

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

FAQPage Schema
How do I use abilities in Move to control struct behavior on Aptos?

Abilities—copy, drop, store, and key—are Move type annotations that govern whether structs can be copied, discarded, stored globally, or used as resource keys. Apply abilities at struct definition to enforce safety rules; key ability marks resources storable in global state, while copy and drop enable implicit operations. This design prevents accidental loss of linear assets and ensures type-safe resource management on Aptos.

What are phantom types and when do I need them in Move generics?

Phantom types are generic parameters that appear in struct declarations but not in field definitions—they exist purely for type-checking. Use phantom types to attach metadata or constraints to structs without storing actual data, enabling compile-time validation without runtime overhead. Common in Move for marking capabilities or linking abstract properties to concrete resources on Aptos.

How do I safely store and retrieve resources using borrow_global and move_to in Move?

Use move_to to store a resource in an account's global storage and borrow_global to retrieve immutable or mutable references to it. move_to requires the signer to authorize the operation; borrow_global requires the account address and resource type. These operations are linear-safe; borrowed references prevent simultaneous exclusive access, protecting asset integrity in Aptos smart contracts.

What's the difference between references and ownership in Move, and how do they affect asset safety?

References (&T and &mut T) allow temporary, non-owning access to values without moving them. Ownership transfers happen only when passing values directly. Move's strict rules prevent simultaneous mutable access and enforce that resources cannot be implicitly copied or dropped, making references essential for safe shared access patterns in Aptos contracts without losing linear guarantees.

How do signer patterns work in Move, and when should I use them for Aptos transactions?

A signer is a special Move type representing a verified transaction sender; only entry functions can receive signer parameters, which are never stored. Use signers to authorize operations like move_to, ensuring transactions come from legitimate accounts. Signer patterns gate access to sensitive functions and prove account ownership without storing credentials, core to Aptos transaction security.

What visibility rules and friend relationships should I apply to Move modules on Aptos?

Move uses public, public(friend), and private visibility. Public functions are callable externally; public(friend) functions are restricted to modules declared as friends; private functions are internal only. Use friend declarations to share implementation details between related modules while blocking external access. Visibility controls encapsulation and prevents unauthorized asset manipulation in Aptos deployments.