modernize-move

Modernize Move V1 syntax, patterns, and APIs to Move V2+.

19|8|Updated Jan 23, 2026
One-click install
npx skills add https://github.com/aptos-labs/aptos-agent-skills --skill modernize-move
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: modernize-move
Source: https://github.com/aptos-labs/aptos-agent-skills/tree/main/skills/move/modernize-move
Command: npx skills add https://github.com/aptos-labs/aptos-agent-skills --skill modernize-move

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill automatically detects and modernizes outdated Move V1 syntax, patterns, and APIs to the latest Move V2+ standards, ensuring your smart contracts are up-to-date and follow best practices.

Core Features & Use Cases

  • Syntax Modernization: Converts legacy syntax like vector::borrow to index notation (v[i]) and while loops with counters to for range loops.
  • API Migration: Guides migration from older APIs like coin to fungible_asset and EventHandle to #[event] patterns.
  • Use Case: You have a legacy Move V1 NFT contract that uses public(friend) visibility and magic numbers for abort codes. This Skill will refactor it to use friend fun and named error constants, making it cleaner and more maintainable.

Quick Start

Use the modernize-move skill to refactor the attached contract 'legacy_nft.move' to use Move V2 syntax and best practices.

Frequently Asked Questions about modernize-move

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

FAQPage Schema
How do I upgrade Move V1 smart contracts to V2 syntax?

Yes, you can migrate legacy Move `coin` APIs to the `fungible_asset` standard during a V2 upgrade. This API migration replaces outdated modules with modern asset standards, ensuring your smart contracts remain compatible with current Move V2+ functionality.

How do I convert Move V1 EventHandle to V2 event patterns?

Converting Move V1 `EventHandle` to V2 event patterns involves refactoring legacy event definitions to use `#[event]` attributes. This modernization simplifies event handling in your smart contracts and aligns them with Move V2+ syntax standards.

What is the best way to refactor Move V1 vector operations?

The best way to refactor Move V1 vector operations is by converting legacy `vector::borrow` calls to index notation like `v[i]`. This syntax modernization improves code readability and updates your smart contracts to Move V2+ standards.

Can I update public friend visibility to Move V2 friend fun syntax?

Yes, you can update `public(friend)` visibility modifiers to `friend fun` syntax when modernizing Move V1 code. This refactoring transforms legacy visibility patterns into cleaner, more maintainable Move V2+ smart contract code.

Does Move V2 migration support converting while loops to for range loops?

Yes, Move V2 migration supports converting legacy `while` loops with manual counters into `for` range loops. This syntax upgrade modernizes outdated iteration patterns, making your smart contracts cleaner and compliant with V2+ best practices.