Token导航 LogoToken导航TokenDH.com
开发敏感数据github未标认证来源可访问clear审计提醒

aptosaptos 命令行

Agent Skill

aptos 用于处理 GitHub 仓库、Issue、Pull Request 和代码协作信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要围绕仓库状态、代码变更或协作事项进行整理时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

927

周安装

39

GitHub Stars

74

下载量

324
CodexClaudeCursorGemini CLI

安装说明

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

GitHub

来源数

3

许可证

MIT

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

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

请帮我安装这个 Agent Skill:aptos(aptos 命令行)
来源仓库:https://github.com/raintree-technology/claude-starter
仓库路径:skills/aptos
安装命令:
npx skills add https://github.com/raintree-technology/claude-starter --skill aptos
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/raintree-technology/claude-starter --skill aptos

简介

用于处理 Aptos 区块链和 Move 语言相关的开发任务,提供智能合约编写支持。

  • 适用于理解 Move 类型系统、资源模型和代币标准等核心概念。
  • 通过命令行激活,结合官方文档和示例代码进行合约设计和测试。
  • 使用前需确认开发环境和网络配置,避免误部署到主网或泄露敏感信息。
  • aptos 属于开发类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

Aptos Blockchain & Move Language Expert

Aptos is a Layer 1 blockchain with the Move programming language, designed for safe and scalable smart contracts.

When to Use

  • Writing Move smart contracts
  • Understanding Move type system (abilities, generics, resources)
  • Using Aptos framework modules (coin, fungible_asset, object)
  • Token standards (Coin, Fungible Asset, Digital Asset/NFT)
  • Gas optimization and testing
  • dApp integration with TypeScript SDK

Move Language Fundamentals

Abilities - Move's Core Feature

Every type has abilities that control what you can do with it:

AbilityMeaningExample
copyCan be duplicatedPrimitives, configs
dropCan be discardedTemporary data
storeCan be stored in structsMost data types
keyCan be top-level resourceAccount resources
// Resource that can be stored globally
struct Balance has key, store {
    coins: u64
}

// Value type that behaves like a primitive
struct Point has copy, drop, store {
    x: u64,
    y: u64
}

// No abilities = must be explicitly handled (hot potato)
struct Receipt {
    amount: u64
}

Generics and Phantom Types

// Type parameter with ability constraint
struct Box<T: store> has key {
    value: T
}

// Phantom type - zero runtime cost, type safety only
struct Coin<phantom CoinType> has store {
    value: u64
}

// Different types can't be mixed
let btc: Coin<BTC> = Coin { value: 100 };
let eth: Coin<ETH> = Coin { value: 50 };
// btc + eth → compile error!

Global Storage Operations

// Store resource at signer's address
public fun initialize(account: &signer) {
    move_to(account, MyResource { value: 0 });
}

// Read resource (requires acquires annotation)
public fun get_value(addr: address): u64 acquires MyResource {
    borrow_global<MyResource>(addr).value
}

// Modify resource
public fun set_value(addr: address, val: u64) acquires MyResource {
    borrow_global_mut<MyResource>(addr).value = val;
}

// Check existence
public fun exists_at(addr: address): bool {
    exists<MyResource>(addr)
}

// Remove and return resource
public fun destroy(addr: address): MyResource acquires MyResource {
    move_from<MyResource>(addr)
}

Signer - Authentication

use std::signer;

// Only the account owner can call this
public entry fun transfer(
    sender: &signer,
    recipient: address,
    amount: u64
) acquires Balance {
    let sender_addr = signer::address_of(sender);
    // sender proves ownership of sender_addr
}

Visibility Modifiers

module example {
    // Private (default) - only within module
    fun internal() { }

    // Public - callable from anywhere
    public fun library_fn() { }

    // Friend - only from declared friend modules
    public(friend) fun restricted() { }

    // Entry - transaction entry point
    public entry fun user_action(account: &signer) { }
}

Aptos Framework (0x1)

Core Modules

ModulePurpose
accountAccount creation, auth key rotation
coinOriginal fungible token standard
fungible_assetNew flexible token standard
objectObject model for composable assets
aptos_coinNative APT token
timestampBlock timestamp
eventEvent emission

Coin Standard (0x1::coin)

use aptos_framework::coin;

// Register to receive a coin type
public entry fun register<CoinType>(account: &signer) {
    coin::register<CoinType>(account);
}

// Transfer coins
public entry fun transfer<CoinType>(
    from: &signer,
    to: address,
    amount: u64
) {
    coin::transfer<CoinType>(from, to, amount);
}

// Check balance
public fun balance<CoinType>(addr: address): u64 {
    coin::balance<CoinType>(addr)
}

Fungible Asset Standard (0x1::fungible_asset)

Modern, flexible token standard:

use aptos_framework::fungible_asset::{Self, FungibleAsset, Metadata};
use aptos_framework::primary_fungible_store;

// Create fungible asset metadata
public fun create_fa(creator: &signer): Object<Metadata> {
    let constructor_ref = object::create_named_object(creator, b"MY_FA");

    primary_fungible_store::create_primary_store_enabled_fungible_asset(
        &constructor_ref,
        option::none(), // max supply
        utf8(b"My Token"),
        utf8(b"MTK"),
        8, // decimals
        utf8(b"https://example.com/icon.png"),
        utf8(b"https://example.com"),
    );

    object::object_from_constructor_ref(&constructor_ref)
}

// Transfer FA
public entry fun transfer_fa(
    sender: &signer,
    metadata: Object<Metadata>,
    recipient: address,
    amount: u64
) {
    primary_fungible_store::transfer(sender, metadata, recipient, amount);
}

Object Model (0x1::object)

Composable, transferable objects:

use aptos_framework::object::{Self, Object, ConstructorRef};

struct MyObject has key {
    value: u64
}

// Create object
public fun create(creator: &signer): Object<MyObject> {
    let constructor_ref = object::create_object(signer::address_of(creator));
    let object_signer = object::generate_signer(&constructor_ref);

    move_to(&object_signer, MyObject { value: 42 });

    object::object_from_constructor_ref(&constructor_ref)
}

// Transfer object
public entry fun transfer_object(
    owner: &signer,
    obj: Object<MyObject>,
    recipient: address
) {
    object::transfer(owner, obj, recipient);
}

Token Standards

Digital Asset (NFT) Standard

use aptos_token_objects::collection;
use aptos_token_objects::token;

// Create collection
public entry fun create_collection(creator: &signer) {
    collection::create_unlimited_collection(
        creator,
        utf8(b"My Collection Description"),
        utf8(b"My Collection"),
        option::none(), // royalty
        utf8(b"https://example.com/collection"),
    );
}

// Mint token
public entry fun mint_token(creator: &signer, to: address) {
    let token_constructor_ref = token::create(
        creator,
        utf8(b"My Collection"),
        utf8(b"Token description"),
        utf8(b"Token #1"),
        option::none(), // royalty
        utf8(b"https://example.com/token/1"),
    );

    let transfer_ref = object::generate_transfer_ref(&token_constructor_ref);
    let linear_transfer_ref = object::generate_linear_transfer_ref(&transfer_ref);
    object::transfer_with_ref(linear_transfer_ref, to);
}

Common Patterns

Capability Pattern

struct AdminCap has key, store {}

public fun init_module(deployer: &signer) {
    move_to(deployer, AdminCap {});
}

public entry fun admin_only(admin: &signer) acquires AdminCap {
    assert!(exists<AdminCap>(signer::address_of(admin)), E_NOT_ADMIN);
    // Admin-only logic
}

Resource Account

use aptos_framework::resource_account;

// Create resource account for deterministic addresses
public fun create_resource_account(creator: &signer): signer {
    let (resource_signer, _cap) = resource_account::create_resource_account(
        creator,
        b"seed"
    );
    resource_signer
}

Events

use aptos_framework::event;

#[event]
struct TransferEvent has drop, store {
    from: address,
    to: address,
    amount: u64,
}

public fun emit_transfer(from: address, to: address, amount: u64) {
    event::emit(TransferEvent { from, to, amount });
}

Testing

#[test]
fun test_basic() {
    let x = 1 + 1;
    assert!(x == 2, 0);
}

#[test(account = @0x123)]
fun test_with_signer(account: &signer) {
    let addr = signer::address_of(account);
    assert!(addr == @0x123, 0);
}

#[test]
#[expected_failure(abort_code = E_NOT_FOUND)]
fun test_expected_failure() {
    abort E_NOT_FOUND
}

CLI Commands

# Initialize project
aptos init

# Compile
aptos move compile

# Test
aptos move test

# Publish
aptos move publish --profile mainnet

# Run function
aptos move run --function-id 'addr::module::function'

Gas Optimization

  • Use inline for small frequently-called functions
  • Prefer Table over vector for large collections
  • Minimize storage operations (most expensive)
  • Use SmartTable for parallel execution
  • Batch operations when possible

TypeScript SDK

import { Aptos, AptosConfig, Network } from "@aptos-labs/ts-sdk";

const config = new AptosConfig({ network: Network.MAINNET });
const aptos = new Aptos(config);

// Query account balance
const balance = await aptos.getAccountAPTAmount({
    accountAddress: "0x1"
});

// Submit transaction
const txn = await aptos.transaction.build.simple({
    sender: account.accountAddress,
    data: {
        function: "0x1::coin::transfer",
        typeArguments: ["0x1::aptos_coin::AptosCoin"],
        functionArguments: [recipientAddress, amount],
    },
});

const result = await aptos.signAndSubmitTransaction({
    signer: account,
    transaction: txn,
});

Resources

适合场景

01

用户想查找某类 Agent Skill 时

02

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

03

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

04

需要参考平台分布和安装热度时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

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

能力 4

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

能力 5

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

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

平台分布

Claude Code

27.56%
按下载量换算89

Antigravity

23.23%
按下载量换算75

trae

16.5%
按下载量换算53

OpenCode

11.21%
按下载量换算36

Cursor

7.93%
按下载量换算26

Gemini CLI

3.64%
按下载量换算12

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

可疑

权限和风险

敏感数据

该 Skill 可能接触密钥、Token、环境变量或敏感配置,应进入高风险复核队列,默认不自动发布。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。

来源信息

继续浏览同类 Skills