
Description
Check a Move package for compilation errors
SKILL.md
Move Language
Move on Aptos is a safe, resource-oriented programming language for smart contracts on the Aptos blockchain. It uses a linear type system to enforce ownership and prevent double-spending at compile time.
Move Language Basics
- Modules are the unit of code organization, published at an address.
- Structs define data types; abilities (
key,store,copy,drop) control what operations are permitted. - Entry functions (
entry fun) are transaction entry points callable from outside Move. - View functions (
#[view]) are read-only queries that do not modify state. - Global storage stores resources (structs with
key) at addresses. - Move 2 syntax (required):
- Read resource:
&T[addr](notborrow_global<T>(addr)) - Mutate resource:
&mut T[addr](notborrow_global_mut<T>(addr)) - Access field:
T[addr].fielddirectly (the compiler inserts the ref op) acquiresannotations are no longer needed — do not add them.
- Read resource:
- Error codes: Use named constants for abort codes (
const E_NOT_FOUND: u64 = 1;) and document them. - Comments: Use
//for regular comments.///is a doc comment and is only valid directly before amodule,struct,enum,fun, orconstdeclaration. - Edit hook: The edit hook auto-runs on
.movefiles after edits. If it reports compilation errors, fix them before proceeding with further changes.
Links
Move Packages
A Move package is a directory with a Move.toml manifest and source files. The manifest defines the package name, dependencies, and named addresses.
Named Addresses
Modules are published at named addresses (e.g., @my_package). These must resolve to hex values for compilation.
[addresses]— production addresses (may use_placeholder for deploy-time assignment)[dev-addresses]— development/test values (used when compiling in dev or test mode)
Fixing "Unresolved addresses" errors: For each Named address 'X' in package 'Y', add X = "0x..." to [dev-addresses] in that package's Move.toml. Use 0x100 and up, avoiding reserved addresses (0x0=vm_reserved, 0x1=std/aptos_std/aptos_framework, 0x3=aptos_token, 0x4=aptos_token_objects, 0x5=aptos_trading, 0x7=aptos_experimental, 0xA=aptos_fungible_asset, 0xA550C18=core_resources):
[dev-addresses]
my_package = "0x100"
other_addr = "0x101"
Checking Move Code
Use the move_package_status MCP tool to check for compilation errors and warnings.
- Call
move_package_statuswithpackage_pathset to the package directory. - The tool sets error and returns detailed error messages if the package does not compile.
Notice that like with a build system, the tool is idempotent, and does not cause recompilation if the compilation result and sources are up-to-date.
Package Manifest
Use the move_package_manifest MCP tool to discover source files and dependencies
of a Move package:
- Call
move_package_manifestwithpackage_pathset to the package directory. - The result includes
source_paths(target modules) anddep_paths(dependencies).
Querying Package Structure
Use the move_package_query MCP tool to inspect the structure of a Move package.
Parameters:
package_path(required) — path to the Move package directory.query(required) — one of the query types below.function(required forfunction_usage) — function name in the formmodule_name::function_name.
Query Types
dep_graph— returns a map from each module to the modules it depends on. Useful for understanding module layering and import structure.module_summary— returns a summary of each module's constants, structs, and functions. Useful for getting an overview without reading all source files.call_graph— returns a function-level call graph as a map from each function to the functions it calls.function_usage— returns direct and transitive calls/uses for a given function. "called" = direct calls; "used" = direct calls + closure captures. Requires thefunctionparameter.
Writing and Editing Move Code
Edit–Compile Cycle
When fixing compilation errors, follow this iterative loop:
- Call
move_package_statuswith the package path. - If the package compiles cleanly, report success and stop.
- If there are errors, read the diagnostics carefully, and discuss fixes with the user. Then go back to step 1.
Task
Run the Edit–Compile Cycle on the current Move package.
More skills from the aptos-ai repository
View all 7 skillsmove
develop applications on Aptos
Jul 19BlockchainWeb3move-inf
infer specifications for Move packages
Jul 19Data ModelingWeb3move-init
initialize Move workflow routing
Jul 19ConfigurationWeb3move-prove
verify Move specifications with Move Prover
Jul 19TestingWeb3move-replay
replay and debug Aptos transactions
Jul 19DebuggingWeb3move-test
generate unit tests for Move code
Jul 19TestingWeb3
More from Aptos Labs
View publisheranalyze-gas-optimization
optimize Aptos Move contracts for gas
aptos-agent-skills
Jul 12BlockchainPerformanceSmart Contractscreate-aptos-project
scaffold new Aptos dApp projects
aptos-agent-skills
Jul 12Next.jsTypeScriptViteWeb3deploy-contracts
deploy Move contracts to Aptos networks
aptos-agent-skills
Jul 12DeploymentEngineeringSmart Contractsgenerate-tests
generate test suites for Move contracts
aptos-agent-skills
Jul 12EngineeringQATestingmodernize-move
modernize Move V1 contracts to V2
aptos-agent-skills
Jul 12Code AnalysisEngineeringMigrationsearch-aptos-examples
search Aptos reference implementations
aptos-agent-skills
Jul 12BlockchainDocumentationSearch