Token导航 LogoToken导航TokenDH.com
研究检索需要联网clawhub未标认证来源可访问clear审计提醒

modernize-move现代化举措

Agent Skill

modernize-move 用于查找、检索和筛选相关信息,适合在 OpenClaw 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

6,071

周安装

248

GitHub Stars

公开资料未说明

下载量

1,964
OpenClaw

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

MIT-0

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:modernize-move(现代化举措)
来源仓库:https://github.com/iskysun96/modernize-move
安装命令:
openclaw skills install modernize-move
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 OpenClaw 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

ClawHubOpenClaw
openclaw skills install modernize-move

简介

用于检测和更新过时的 Move V1 语法和 API 到现代版本。

  • 适合升级遗留智能合约或迁移到新语法的区块链开发场景。
  • 通过 clawhub 安装,需确认合约路径和转换规则。
  • 建议结合原始 README 核验兼容性和回滚机制。
  • 使用前请评估是否会触发文件修改,避免数据丢失。modernize-move 属于研究检索类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

name
modernize-move
description
>-
license
MIT
metadata
author
aptos-labs
version
1.0
category
move
tags
["modernization", "migration", "v2", "refactoring", "syntax"]
priority
high
allowed-tools
Read Glob Grep Write Edit Bash AskUserQuestion

Skill: modernize-move

Detect and modernize outdated Move V1 syntax, patterns, and APIs to Move V2+. Preserves correctness through tiered transformations with test verification after each tier.

Essential Principles

Five non-negotiable rules for every modernization:

  1. Test safety net is mandatory WHY: Modernization must preserve behavior. No tests = no safety net. If no tests

exist, invoke generate-tests skill first to create comprehensive tests before making any changes.

  1. Analyze before modifying WHY: The user must see exactly what will change and confirm the scope. Never

surprise-edit code. Present the full analysis report and wait for confirmation.

  1. Tiered execution order WHY: Syntax changes (Tier 1) are zero-risk. API migrations (Tier 3) change semantics.

Always apply safest changes first so riskier changes build on a clean, verified foundation.

  1. Verify after each tier WHY: If tests break, you know exactly which tier caused it. Revert that tier and

investigate before proceeding. Never apply the next tier on a broken baseline.

  1. Preserve error code values WHY: Tests use #[expected_failure(abort_code = N)]. Changing numeric values breaks

tests silently. When creating named constants, the numeric value MUST match the original literal.

When to Use This Skill

  • Upgrading Move V1 contracts to V2 syntax
  • Migrating public(friend) to package fun
  • Converting vector::borrow to index notation
  • Converting while loops with counters to for range loops
  • Replacing manual vector iteration with stdlib inline functions (vector::for_each_ref, vector::map, vector::fold,

etc.) and lambdas

  • Replacing magic abort numbers with named constants
  • Migrating legacy coin/TokenV1 to modern fungible_asset/Digital Assets
  • Converting EventHandle to #[event] pattern
  • Upgrading custom signed integer workarounds to native i8-i256 types

When NOT to Use This Skill

  • Writing new contracts from scratch — use write-contracts
  • Fixing bugs or adding features — modernization is structural, not functional
  • Optimizing gas usage — use analyze-gas-optimization
  • Auditing security — use security-audit (run AFTER modernization)

Workflow

Phase 1: Analyze Contract

Entry: User provides a Move contract or project to modernize.

Actions:

  1. Read all contract source files (.move files in sources/)
  2. Scan for V1 patterns using detection rules from detection-rules.md:

- Grep for Tier 1 patterns (syntax) — highest confidence, most common - Grep for Tier 2 patterns (visibility, errors, events) - Grep for Tier 3 patterns (API migrations) — flag for manual review

  1. Cross-reference coupled patterns (T3-09+T3-10)
  2. Categorize each finding: line number, rule ID, pattern name, proposed change, tier, confidence
  3. Build the Analysis Report

Exit: Analysis Report ready for presentation.

Phase 2: Present Analysis (GATE 1)

Entry: Analysis Report complete.

Actions:

  1. Present the full Analysis Report to the user in this format:
## Modernization Analysis Report

### Summary
- Tier 1 (Syntax): X findings
- Tier 2 (Visibility & Errors): X findings
- Tier 3 (API Migrations): X findings

### Findings

| # | File:Line | Rule | Pattern | Proposed Change | Tier | Confidence |
|---|-----------|------|---------|-----------------|------|------------|
| 1 | src/mod.move:15 | T1-01 | vector::borrow | → index notation | 1 | High |
| ... | ... | ... | ... | ... | ... | ... |

### Tier 3 Warnings (if any)
- T3-03: coin → fungible_asset migration is a major rewrite (X locations)
  1. Ask the user to choose scope:

- syntax-only (Tier 1 only) — zero risk, just cleaner syntax - standard (Tier 1 + Tier 2) — recommended default, syntax + visibility + error constants - full (all tiers) — includes API migrations, higher risk

  1. Highlight any Tier 3 items that require major rewrites
  2. If scope includes Tier 3, ask the user about deployment context:

- Compatible — Upgrading an already-deployed contract. Breaking changes are excluded even if the scope includes them. Rules marked ⚠ Breaking are skipped. - Fresh deploy — New deployment or willing to redeploy. All changes in the selected scope are applied including breaking changes.

Exit: User has confirmed scope (and deployment context if Tier 3 is included). Do NOT proceed until confirmed.

Phase 3: Establish Test Safety Net

Entry: User confirmed scope.

Actions:

  1. Search for existing tests:

- #[test_only] modules within source files - *_tests.move files - tests/ directory

  1. If no tests found: stop and invoke generate-tests skill to create comprehensive tests first, then return here
  2. Run aptos move test to establish a passing baseline
  3. Record baseline: number of tests, all passing status

Exit: All tests pass. Baseline recorded. If tests fail pre-modernization, stop and address test failures first — do not modernize on a broken test suite.

Phase 4: Apply Transformations (with Feedback Loops)

Entry: Test baseline established.

Actions — apply in tier order:

Tier 1 (if scope includes it — always):

  1. Apply all Tier 1 syntax changes per transformation-guide.md
  2. Run aptos move test
  3. If tests fail → revert all Tier 1 changes, investigate which specific change caused failure, fix and retry

Tier 2 (if scope is standard or full): 4. Apply all Tier 2 changes per transformation guide 5. Run aptos move test 6. If tests fail → revert all Tier 2 changes, investigate and fix

Tier 3 (if scope is full only): 7. Apply Tier 3 changes ONE AT A TIME (not all at once)

  • If deployment context is compatible: skip any rule marked ⚠ Breaking. Add to the skipped list with reason

"breaking change, excluded in compatible mode."

  • If deployment context is fresh deploy: apply all rules in scope normally.
  1. Run aptos move test after EACH individual Tier 3 change
  2. If tests fail → revert that specific change, note it as skipped, proceed to next Tier 3 item

Exit: All approved changes applied, all tests passing.

Phase 5: Final Verification

Entry: All transformations applied.

Actions:

  1. Run aptos move test --coverage
  2. Verify test coverage is >= baseline (should be same or better)
  3. Generate Modernization Summary Report:
## Modernization Summary

### Changes Applied
- Tier 1: X changes (syntax)
- Tier 2: X changes (visibility & errors)
- Tier 3: X changes (API migrations)

### Changes Skipped
- [List any skipped items with reasons]

### Test Results
- Tests: X passing (baseline: Y)
- Coverage: X% (baseline: Y%)

### Files Modified
- [List of modified files]

Exit: Report presented to user.

Modernization Scope Quick Reference

ScopeTiersRiskWhen to Use
syntax-onlyTier 1ZeroJust clean up syntax, no semantic changes
standardTier 1+2LowDefault. Syntax + visibility + error constants
fullTier 1+2+3Medium-HighFull migration including API changes

Tier Quick Reference

TierWhat ChangesRiskExamples
1 — SyntaxCode reads differently, compiles identicallyZerovector::borrow(&v, i)v[i], x = x + 1x += 1, while (i < n) { ... i += 1 }for (i in 0..n) { ... }
2 — Visibility & ErrorsSame semantics, cleaner declarationsLowpublic(friend)package fun, magic numbers → E_* constants
3 — API MigrationsDifferent APIs, same intended behavior. Most are breaking changes.Medium-Highcoinfungible_asset, SmartTableBigOrderedMap, EventHandle#[event], manual loops → stdlib v.for_each_ref()/v.map()/v.fold() with lambdas

See detection-rules.md for the complete rule catalog (22 rules across 3 tiers).

Rationalizations to Reject

RationalizationWhy It's Wrong
"Tests pass so the modernization is correct"Tests verify behavior, not code quality. Review changes manually too.
"This contract is simple, skip the analysis"Simple contracts can have subtle patterns. Always analyze first.
"Let's do all tiers at once to save time"If tests break, you can't isolate which change caused it. Always tier.
"The receiver-style call looks right"Must verify the target function declares self. False positives are common.
"Error constants can have new names and values"Existing tests depend on exact numeric values. Preserve them.
"No tests exist, but the changes are safe"Without tests there is no safety net. Generate tests first.
"Tier 3 changes are optional, skip the test run"Every change needs verification. Tier 3 is highest risk — test MORE, not less.

Success Criteria

  • [ ] Analysis Report presented before any modifications
  • [ ] User confirmed modernization scope
  • [ ] Test baseline established before changes
  • [ ] Tests pass after each tier of changes
  • [ ] All error code numeric values preserved
  • [ ] No Tier 3 changes applied without full scope confirmation
  • [ ] Breaking changes excluded when user selected compatible mode
  • [ ] Modernization Summary Report generated
  • [ ] Test coverage maintained at or above baseline

Reference Index

FileContent
detection-rules.mdComplete V1 pattern detection catalog (22 rules across 3 tiers)
transformation-guide.mdBefore/after code, safety checks, edge cases per rule
MOVE_V2_SYNTAX.mdFull V2 syntax reference
OBJECTS.mdModern object model patterns
ADVANCED_TYPES.mdEnums, signed integers, phantom types

Related skills: generate-tests, write-contracts, security-audit

适合场景

01

OpenClaw 用户查找和安装 Skill 时

02

用户想查找某类 Agent Skill 时

03

需要根据任务场景推荐可安装能力包时

04

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

能力 5

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

OpenClaw

88.79%
按下载量换算1,744

安全审计

VirusTotal

通过

ClawScan

可疑

Static analysis

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills