Skip to main content
skill CX Codex

naming-conventions — Claude Code skill for Move naming

The naming-conventions Claude Code skill sets naming rules for Move contracts on Sui. The agent uses it while creating or reviewing types, functions, and constants.

Apache-2.0 621 installs ★ 25 updated 2026-11-12

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add MystenLabs/skills --skill naming-conventions -a claude-code
Open on GitHub

What naming-conventions does

The skill defines names for elements in Move contracts on Sui. Error constants use an E prefix with PascalCase; regular constants use ALL_CAPS, and capability structs end in Cap. Event names describe completed actions. Getter functions take the field name without get_; mutable getters add _mut. Hot potato types omit Potato, while dynamic field keys use positional structs with a Key suffix. For new error constants using #[error], the type is vector<u8> and the compiler assigns numeric codes. The skill can also query the Sui documentation MCP server for current details when that server is available.

What it helps with

  • name an error constant in Move
  • apply the required suffix to a capability struct
  • rename an event to past tense
  • remove get_ from a getter name
  • add the Key suffix to a dynamic field key type

Example prompts for the agent

  • Check the names of types and constants in this Move contract for Sui.
  • Suggest names for the new events and getters in this Move module.
  • Check whether these dynamic field keys follow Sui naming rules.

How to install naming-conventions

1Skills CLI (Vercel)

npx skills add MystenLabs/skills --skill naming-conventions -a claude-code

2Manually: put the files in place

~/.claude/skills/naming-conventions/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/naming-conventions/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about naming-conventions

How do I install naming-conventions in Claude Code?

Run npx skills add MystenLabs/skills --skill naming-conventions -a claude-code. The skill file is located at ~/.claude/skills/naming-conventions/SKILL.md.

What does naming-conventions do?

It gives naming rules for Move contract elements on Sui, including constants, structs, events, getters, and dynamic field keys.

How should Move error constants be named?

Use an E prefix followed by PascalCase. New constants with #[error] use vector<u8>; the compiler assigns their numeric codes.

Source text

SKILL.md · Apache-2.0
---
name: naming-conventions
description: Use when writing or reviewing Move smart contracts on Sui. Applies to naming structs, error constants, regular constants, events, getter functions, capability types, hot potato types, and dynamic field keys. Use whenever creating new types, functions, or constants in Move code.
---

# naming-conventions

> **MCP tool:** When available in your environment, also query the Sui documentation MCP server (`https://sui.mcp.kapa.ai`) for up-to-date answers. Use it for verification and for details not covered by these reference files.

## Overview

Move on Sui has specific naming conventions that differ from what AI agents typically generate from training data. This skill covers every naming pattern from the official code quality checklist.

All patterns sourced from https://move-book.com/guides/code-quality-checklist

## Error Constants: EPascalCase with `#[error]`

Error constants MUST use PascalCase with an `E` prefix. Do NOT use SCREAMING_SNAKE_CASE.

Use the `#[error]` attribute to attach human-readable messages to error constants. When an abort occurs, the message is included in the error output, making debugging much easier for users and support.

```move
// WRONG
const NOT_AUTHORIZED: u64 = 0;
const INSUFFICIENT_BALANCE: u64 = 1;

// CORRECT — with #[error] for readable abort messages
#[error]
const ENotAuthorized: vector<u8> = b"Caller is not authorized to perform this action";
#[error]
const EInsufficientBalance: vector<u8> = b"Insufficient balance for this operation";

// Also valid — u64 without #[error] (less informative on abort)
const ENotAuthorized: u64 = 0;
const EInsufficientBalance: u64 = 1;
```

When using `#[error]`, the constant type is `vector<u8>` (a byte string message) instead of `u64`. The compiler assigns numeric codes automatically. Prefer `#[error]` for all new code — it produces clearer error output in explorers, wallets, and logs.

## Regular Constants: ALL_CAPS

Non-error constants use uppercase snake_case. This is the opposite of error constants.

```move
// WRONG
const MyConstant: vector<u8> = b"hello";
const feeNumerator: u64 = 3;

// CORRECT
const MY_CONSTANT: vector<u8> = b"hello";
const FEE_NUMERATOR: u64 = 3;
```

## Capability Structs: `Cap` Suffix

Any struct that represents a capability (authorization to perform actions) MUST be suffixed with `Cap`.

```move
// WRONG
public struct Admin has key, store { id: UID }
public struct MintAuthority has key, store { id: UID }

// CORRECT
public struct AdminCap has key, store { id: UID }
public struct MintCap has key, store { id: UID }
```

## Events: Past Tense

Event struct names MUST use past tense to indicate something that already happened.

```move
// WRONG
public struct RegisterUser has copy, drop { user: address }
public struct CreatePool has copy, drop { pool_id: ID }
public struct LevelUp has copy, drop { new_level: u64 }

// CORRECT
public struct UserRegistered has copy, drop { user: address }
public struct PoolCreated has copy, drop { pool_id: ID }
public struct LeveledUp has copy, drop { new_level: u64 }
```

## Getter Functions: Field Name, Not `get_`

Getter functions should be named after the field they return, without a `get_` prefix. Mutable getters add `_mut` suffix.

```move
// WRONG
public fun get_name(u: &User): String { u.name }
public fun get_balance(u: &User): u64 { u.balance }

// CORRECT
public fun name(u: &User): String { u.name }
public fun balance(u: &User): u64 { u.balance }
public fun details_mut(u: &mut User): &mut Details { &mut u.details }
```

## Hot Potato Structs: No `Potato` in Name

Hot potato types (structs with no abilities) should NOT include "Potato" in the name. The absence of abilities already signals the pattern.

```move
// WRONG
public struct FlashLoanPotato {}
public struct PromisePotato {}

// CORRECT
public struct FlashLoanReceipt {}
public struct Promise {}
```

## Dynamic Field Keys: Positional Struct with `Key` Suffix

Dynamic field key types should use positional struct syntax (empty parentheses) with a `Key` suffix.

```move
// WRONG
public struct DynamicField has copy, drop, store {}
public struct ItemSlot has copy, drop, store { name: String }

// CORRECT
public struct DynamicFieldKey() has copy, drop, store;
public struct ItemKey(String) has copy, drop, store;
```

## Quick Reference

| Element | Convention | Example |
|---------|-----------|---------|
| Error constants | `E` + PascalCase | `ENotAuthorized` |
| Regular constants | ALL_CAPS | `FEE_NUMERATOR` |
| Capabilities | Suffix with `Cap` | `AdminCap` |
| Events | Past tense | `PoolCreated` |
| Getters | Field name, no `get_` | `balance()` |
| Mutable getters | Field name + `_mut` | `balance_mut()` |
| Hot potatoes | Descriptive, no `Potato` | `FlashLoanReceipt` |
| Dynamic field keys | Positional + `Key` suffix | `ItemKey()` |

© MystenLabs · Apache-2.0 · MystenLabs/skills

Similar skills

SKILL.md skills catalog →

From the same set30

The whole set →
sui-move sui-move — a skill for Claude Code, Codex and Cursor that guides writing, reviewing and debugging Move smart contracts on Sui. CX Codex +1 633installs sui-move-project sui-move-project is a Claude Code skill for setting up Sui Move projects and fixing Move.toml, dependency, and build issues. It activates for project creation and legacy-format migrations. CX Codex +1 620installs sui-object-model The sui-object-model Claude Code skill covers Sui objects and helps answer questions about ownership, transfers, and data storage in Sui Move. It activates for choices between ownership types or storage patterns. CX Codex +1 617installs composable-move-functions composable-move-functions — a skill for Claude Code enforces conventions for Sui Move function signatures. It activates when designing public APIs, ordering parameters, and handling object returns for PTB composition. CX Codex +1 616installs move-unit-testing The move-unit-testing Claude Code skill guides unit testing for Move smart contracts on Sui. It activates when asked to write tests or add them to a Move module. CX Codex +1 615installs sui-build The sui-build Claude Code skill guides Move package builds with sui move build. The agent uses it for Move coding and questions about the build command. CX Codex +1 613installs modern-move-syntax modern-move-syntax — a skill for Claude Code that enforces Move 2024 edition syntax for Sui smart contracts. It replaces legacy module calls with method dot notation, loop macros, and clean literals. CX Codex +1 613installs accessing-data accessing-data — a skill for Claude Code that guides data fetching on Sui across gRPC, GraphQL RPC, Archival Store, Walrus, and sui-indexer-alt. Triggers on queries about balances, objects, and JSON-RPC migrations. CX Codex +1 491installs

Project sponsors

Companies that keep this analytics open