Langsung ke konten
Skillpedia
Pemrograman umum33k Β· #8779

move-code-quality

Fungsinya

Skill ini memberikan agent AI Anda daftar periksa untuk meninjau kode Move, bahasa yang digunakan di beberapa blockchain. Skill ini ditujukan untuk pengembang paket Move yang ingin paket mereka mengikuti praktik terbaik saat ini.

Kapan dipakai

  • βœ“Saat Anda meminta agent meninjau kode Move atau paket Move.
  • βœ“Saat Anda ingin memeriksa proyek untuk kepatuhan terhadap Move 2024 Edition.
  • βœ“Saat proyek Anda berisi file .move atau manifest Move.toml.

Link skill

https://github.com/davila7/claude-code-templates/blob/main/cli-tool/components/skills/development/move-code-quality/SKILL.md

Salin lalu tempelkan ke AI Anda (Claude, ChatGPT, atau Cursor) dan minta AI mengikuti instruksinya.

Cara pakai

Cara paling mudah: salin pesan ini dan tempelkan ke AI Anda. AI akan membaca skill dan mengikuti instruksinya.

Pesan siap tempel

Gunakan skill ini untuk membantu saya: https://github.com/davila7/claude-code-templates/blob/main/cli-tool/components/skills/development/move-code-quality/SKILL.md Baca file SKILL.md di link tersebut dan ikuti instruksinya untuk tugas saya.
Mau AI Anda menemukan skill seperti ini sendiri?Pasang MCP Skillpedia gratis: cukup satu baris, dan AI mencari di antara 15.000+ skill sebelum tiap tugas.Pasang dalam 1 menit β†’

Contoh permintaan ke AI

β€œTinjau paket Move saya dari masalah kualitas kode dan beri tahu apa yang harus diperbaiki.”

5 skill baru setiap minggu. 1 menit baca.

Cara kerjanya

Agent menemukan file proyek Move dan membaca manifest-nya. Setelah itu, agent memeriksa kode terhadap 11 kategori aturan dan melaporkan umpan balik yang spesifik dan dapat ditindaklanjuti.

Konten teknis (SKILL.md asli)

Teks asli dari pembuat, dalam bahasa Inggris, langsung dari GitHub.

Move Code Quality Checker

You are an expert Move language code reviewer with deep knowledge of the Move Book Code Quality Checklist. Your role is to analyze Move packages and provide specific, actionable feedback based on modern Move 2024 Edition best practices.

When to Use This Skill

Activate this skill when:

  • User asks to "check Move code quality", "review Move code", or "analyze Move package"
  • User mentions Move 2024 Edition compliance
  • Working in a directory containing .move files or Move.toml
  • User asks to review code against the Move checklist

Analysis Workflow

Phase 1: Discovery

  1. Detect Move project structure

    • Look for Move.toml in current directory
    • Find all .move files using glob patterns
    • Identify test modules (files/modules with _tests suffix)
  2. Read Move.toml

    • Check edition specification
    • Review dependencies (should be implicit for Sui 1.45+)
    • Examine named addresses for proper prefixing
  3. Understand scope

    • Ask user if they want full package scan or specific file/category analysis
    • Determine if this is new code review or existing code audit

Phase 2: Systematic Analysis

Analyze code across these 11 categories with 50+ specific rules:

1. Code Organization

Use Move Formatter

  • Check if code appears formatted consistently
  • Recommend formatter tools: CLI (npm), CI/CD integration, VSCode/Cursor plugin

2. Package Manifest (Move.toml)

Use Right Edition

  • βœ… MUST have: edition = "2024.beta" or edition = "2024"
  • ❌ CRITICAL if missing: All checklist features require Move 2024 Edition

Implicit Framework Dependency

  • βœ… For Sui 1.45+: No explicit Sui, Bridge, MoveStdlib, SuiSystem in [dependencies]
  • ❌ OUTDATED: Explicit framework dependencies listed

Prefix Named Addresses

  • βœ… GOOD: my_protocol_math = "0x0" (project-specific prefix)
  • ❌ BAD: math = "0x0" (generic, conflict-prone)

3. Imports, Modules & Constants

Using Module Label (Modern Syntax)

  • βœ… GOOD: module my_package::my_module; followed by declarations
  • ❌ BAD: module my_package::my_module { ... } (legacy curly braces)

No Single Self in Use Statements

  • βœ… GOOD: use my_package::my_module;
  • ❌ BAD: use my_package::my_module::{Self}; (redundant braces)
  • βœ… GOOD when importing members: use my_package::my_module::{Self, Member};

Group Use Statements with Self

  • βœ… GOOD: use my_package::my_module::{Self, OtherMember};
  • ❌ BAD: Separate imports for module and its members

Error Constants in EPascalCase

  • βœ… GOOD: const ENotAuthorized: u64 = 0;
  • ❌ BAD: const NOT_AUTHORIZED: u64 = 0; (all-caps reserved for regular constants)

Regular Constants in ALL_CAPS

  • βœ… GOOD: const MY_CONSTANT: vector<u8> = b"value";
  • ❌ BAD: const MyConstant: vector<u8> = b"value"; (PascalCase suggests error)

4. Structs

Capabilities Suffixed with Cap

  • βœ… GOOD: public struct AdminCap has key, store { id: UID }
  • ❌ BAD: public struct Admin has key, store { id: UID } (unclear it's a capability)

No Potato in Names

  • βœ… GOOD: public struct Promise {}
  • ❌ BAD: public struct PromisePotato {} (redundant, abilities show it's hot potato)

Events Named in Past Tense

  • βœ… GOOD: public struct UserRegistered has copy, drop { user: address }
  • ❌ BAD: public struct RegisterUser has copy, drop { user: address } (ambiguous)

Positional Structs for Dynamic Field Keys

  • βœ… CANONICAL: public struct DynamicFieldKey() has copy, drop, store;
  • ⚠️ ACCEPTABLE: public struct DynamicField has copy, drop, store {}

5. Functions

No Public Entry - Use Public or Entry

  • βœ… GOOD: public fun do_something(): T { ... } (composable, returns value)
  • βœ… GOOD: entry fun mint_and_transfer(...) { ... } (transaction endpoint only)
  • ❌ BAD: public entry fun do_something() { ... } (redundant combination)
  • Reason: Public functions are more permissive and enable PTB composition

Composable Functions for PTBs

  • βœ… GOOD: public fun mint(ctx: &mut TxContext): NFT { ... }
  • ❌ BAD: public fun mint_and_transfer(ctx: &mut TxContext) { transfer::transfer(...) } (not composable)
  • Benefit: Returning values enables Programmable Transaction Block chaining

Objects Go First (Except Clock)

  • βœ… GOOD parameter order:
    1. Objects (mutable, then immutable)
    2. Capabilities
    3. Primitive types (u8, u64, bool, etc.)
    4. Clock reference
    5. TxContext (always last)

Example: ```mov

Pertanyaan umum

Berapa banyak kategori aturan yang diperiksa?

Skill memeriksa 11 kategori dengan lebih dari 50 aturan spesifik.

Apakah perlu file Move?

Ya. Skill bekerja jika proyek memiliki file .move atau manifest Move.toml.

Apakah memeriksa format?

Ya. Satu kategori mencakup penggunaan formatter Move untuk kode yang konsisten.

Detail

Deskripsi asli dari pembuat

Analyzes Move language packages against the official Move Book Code Quality Checklist. Use this skill when reviewing Move code, checking Move 2024 Edition compliance, or analyzing Move packages for best practices. Activates automatically when working with .move files or Move.toml manifests.

repo: davila7/claude-code-templates

Popularitas

Bintang GitHub
33k
Peringkat
#8779
Lisensi
MIT
Diperbarui
2/11/2026

Apakah skill ini berguna?

0

Masuk untuk memberi suara.

Komentar

  • …

Skill lain dari repositori ini

Skill serupa