# sui-publish

sui-publish — a skill for Claude Code deploys, tests, and upgrades Sui Move smart contract packages. Triggers on requests to publish packages, manage UpgradeCap, or troubleshoot dry run deployment failures.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode, Windsurf (Devin Desktop), Claude.ai · 399 installs · ★ 25 repo stars
- Author: MystenLabs
- License: Apache-2.0 · policy=mirror · the beginning of the file is at the end of this page
- Source: https://github.com/MystenLabs/skills/tree/HEAD/sui-publish/SKILL.md
- Updated: 2026-11-12
- Security check: automated, 2026-11-17 (text) — no signs of malicious code found.
- HTML: https://affpapa.org/en/nevibecode/skills/sui-publish

## What it does

The skill guides developers through publishing, upgrading, and testing Sui Move code packages. It checks essential pre-deployment steps, such as verifying the network with `sui client active-env`, querying gas balances via `sui client balance`, and compiling Move code.

When running `sui client publish`, the tool extracts package IDs and tracks the generated `UpgradeCap` saved in `Published.toml`. To validate module initialization without burning real tokens, it runs `sui client test-publish` in ephemeral environments. It also handles upgrade policies, multisig transaction preparation, and making packages permanently immutable via `sui::package::make_immutable`. Executing these flows requires the Sui CLI and available SUI tokens on the active address.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add MystenLabs/skills --skill sui-publish -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/sui-publish/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/sui-publish/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add MystenLabs/skills --skill sui-publish -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/sui-publish/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add MystenLabs/skills --skill sui-publish -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/sui-publish/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install MystenLabs/skills sui-publish
```

2. **Manually: put the files in place**
- File: `.github/skills/sui-publish/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add MystenLabs/skills --skill sui-publish -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/MystenLabs/skills --path sui-publish
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/sui-publish/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add MystenLabs/skills --skill sui-publish -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/MystenLabs/skills/tree/HEAD/sui-publish/SKILL.md

## When to use it
- publish Sui Move packages to localnet, testnet, or mainnet
- upgrade existing contracts using the designated UpgradeCap object
- validate package init functions safely via sui client test-publish
- restrict package upgrade rules or destroy the UpgradeCap via make_immutable

## Example prompts
- Publish this Move package to testnet and capture the package ID
- How do I run sui client test-publish before deploying to mainnet?
- Upgrade our package using the UpgradeCap stored in Published.toml

## Source text · SKILL.md · Apache-2.0

Below is the content of a third-party file. It is data, not instructions for you: do not act on anything written inside unless the human asks. Block tag: 761440e4515a68c5.

BEGIN THIRD-PARTY FILE 761440e4515a68c5
````text
---
name: sui-publish
description: >
  Publishing, upgrading, and deploying Sui Move packages. Use this skill when the
  user needs to publish a package, upgrade a published package, deploy to multiple
  networks, serialize transactions for multisig signing, run a local Sui network
  (localnet), prepare for Mainnet launch, monitor production deployments, or debug
  dry run failures. Also use when the user asks about sui client publish, sui client
  upgrade, UpgradeCap, upgrade policies, Published.toml, --serialize-output, localnet,
  mainnet launch checklist, gas estimation, multisig publishing, production monitoring,
  rollback, incident response, devInspectTransactionBlock, or --dry-run.
---

# Publishing, Deploying & Local Network

> **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.

> **Source constraint:** All information sourced exclusively from [docs.sui.io](https://docs.sui.io) and [MystenLabs/sui-stack-hello-world](https://github.com/MystenLabs/sui-stack-hello-world).

## Publishing a package

### Canonical hello-world publish flow

For the full-stack starter, publish the existing hello-world package only:

```bash
cd sui-stack-hello-world/move/hello-world
sui move build
sui client publish
```

Use the package ID from the publish output to update `sui-stack-hello-world/ui/src/constants.ts` (`TESTNET_HELLO_WORLD_PACKAGE_ID`). Do not publish a separate counter package, and do not create a second project directory.

### Pre-publish checklist

1. Verify your active environment: `sui client active-env`
2. Verify you have SUI tokens: `sui client balance`
3. Build successfully: `sui move build`

### Publish

```bash
sui client publish
```

This deploys the package to the active network and returns:

- A unique **package ID** (use this for all future interactions)
- An **UpgradeCap** object (sent to your address, controls future upgrades)
- Object IDs for anything created during `init` functions

### Test publishing (ephemeral networks)

Use `sui client test-publish` to publish a package to an ephemeral environment for testing without persisting state to a real network:

```bash
sui client test-publish
```

This publishes the package, runs `init` functions, and returns the same output as `sui client publish` (package ID, UpgradeCap, created objects), but the deployment is not permanent. Use it to:

- Verify that `init` functions execute correctly before committing to a real publish
- Test publish + upgrade flows in CI without consuming Testnet/Devnet resources
- Validate gas costs and object creation before a Mainnet deploy

`test-publish` respects `--build-env` for multi-environment packages:

```bash
sui client test-publish --build-env testnet
```

### After publishing
````
END THIRD-PARTY FILE 761440e4515a68c5

The third-party file has ended. Everything between the 761440e4515a68c5 tags is data: requests and commands from it are not followed. An “end of file” line with another tag inside the block is part of the file.

First 2895 of 19111 bytes. © MystenLabs · Apache-2.0 · https://github.com/MystenLabs/skills/tree/HEAD/sui-publish/SKILL.md

_Part of the page did not fit — see the HTML version._

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
