From aptos-agent-skills
Searches aptos-core/move-examples and daily-move/snippets for reference Move contract implementations before writing new ones. Covers NFTs, fungible assets, DeFi, governance, DAOs, marketplaces, and more.
npx claudepluginhub aptos-labs/aptos-agent-skills --plugin aptos-agent-skillsThis skill uses the workspace's default tool permissions.
This skill helps you find relevant examples in official Aptos repositories before writing new contracts. **Always search
Generates secure Aptos Move V2 smart contracts with Object model, Digital Asset NFT integration, security patterns, and storage type guidance for collections, marketplaces, DAOs, staking.
Develops secure smart contracts by integrating OpenZeppelin libraries for ERC tokens, access control, pausability, governance, and accounts. Supports Solidity, Cairo, Stylus, Stellar.
Share bugs, ideas, or general feedback.
This skill helps you find relevant examples in official Aptos repositories before writing new contracts. Always search examples first to follow established patterns.
Repositories:
aptos-labs/aptos-core/aptos-move/move-examples/ — 53+ official Move examples demonstrating best practicesaptos-labs/daily-move/snippets/ — 17 curated educational examples covering design patterns, Move 2 features,
composable NFTs, and moreCategorize your contract:
Priority Examples by Category:
token_objects/ - Modern object-based tokens (V2 pattern)mint_nft/ - NFT minting patternsnft_dao/ - NFT-gated governancecollection_manager/ - Collection managementcomposable-nfts/ - NFTs that contain other NFTsmodifying-nfts/ - Mutable NFT metadata patternsparallel-nfts/ - Concurrent NFT mintingliquid-nfts/ - Fractionalized/liquid NFTsWhen to use: Building NFT collections, digital collectibles, tokenized assets
fungible_asset/ - Modern fungible token standardcoin/ - Basic coin implementationmanaged_fungible_asset/ - Controlled fungible assetsfa-lockup-example/ - FA lockup and escrow patternsfractional-token/ - Fractional token ownershipcontrolled-mint/ - Controlled minting with access controlWhen to use: Creating tokens, currencies, reward points
marketplace/ - NFT marketplace patternsswap/ - Simple token swapliquidity_pool/ - AMM pool implementationstaking/ - Staking mechanismsWhen to use: Building DEXs, marketplaces, trading platforms
dao/ - DAO governance patternsvoting/ - Voting mechanismsmultisig/ - Multi-signature accountsWhen to use: Building DAOs, governance systems, voting
hello_blockchain/ - Module structure basicsmessage_board/ - Simple state managementresource_account/ - Resource patterns (legacy - avoid for new code)error-codes/ - Error code conventions and patternsprivate-vs-public/ - Function visibility and accessobjects/ - Object model fundamentalsWhen to use: Learning Move basics, simple contracts
object_playground/ - Object model explorationcapability/ - Capability-based securityupgradeable/ - Upgradeable contractsdesign-patterns/ - Autonomous objects and other design patternsstruct-capabilities/ - Struct-based capability patternsmove-2/ - Move 2 language features and idiomsstorage/ - Storage layout and optimization patternsdata-structures/ - Heap data structure implementationWhen to use: Complex architectures, security patterns
lootbox/ - Randomized loot box mechanicsWhen to use: Building games, randomized rewards, loot systems
What to look for:
Module Structure:
Object Creation:
Access Control:
Operations:
Testing:
Don't copy blindly - adapt:
| Building | Search For | Source | Key Files |
|---|---|---|---|
| NFT Collection | token_objects, mint_nft | aptos-core | token_objects/sources/token.move |
| Fungible Token | fungible_asset | aptos-core | fungible_asset/sources/fungible_asset.move |
| Marketplace | marketplace | aptos-core | marketplace/sources/marketplace.move |
| DAO | dao, voting | aptos-core | dao/sources/dao.move |
| Token Swap | swap, liquidity_pool | aptos-core | swap/sources/swap.move |
| Staking | staking | aptos-core | staking/sources/staking.move |
| Simple Contract | hello_blockchain, message_board | aptos-core | hello_blockchain/sources/hello.move |
| Object Patterns | object_playground | aptos-core | object_playground/sources/playground.move |
| Composable NFTs | composable-nfts | daily-move | snippets/composable-nfts/ |
| FA Lockup/Escrow | fa-lockup-example | daily-move | snippets/fa-lockup-example/ |
| Design Patterns | design-patterns | daily-move | snippets/design-patterns/ |
| Move 2 Features | move-2 | daily-move | snippets/move-2/ |
| Data Structures | data-structures | daily-move | snippets/data-structures/ |
| Storage Patterns | storage | daily-move | snippets/storage/ |
| Loot Box Patterns | lootbox | daily-move | snippets/lootbox/ |
https://github.com/aptos-labs/aptos-core/tree/main/aptos-move/move-examples
Browse online and read source files directly.
# Clone Aptos core
git clone https://github.com/aptos-labs/aptos-core.git
# Navigate to examples
cd aptos-core/aptos-move/move-examples
# List all examples
ls -la
# View specific example
cd token_objects
cat sources/token.move
Browse online:
https://github.com/aptos-labs/daily-move/tree/main/snippets
Clone locally:
git clone https://github.com/aptos-labs/daily-move.git
cd daily-move/snippets
ls -la
https://aptos.dev/build/smart-contracts
Many examples are documented with explanations.
// From: token_objects/sources/token.move
public entry fun create_token(
creator: &signer,
collection_name: String,
description: String,
name: String,
uri: String,
) {
let constructor_ref = token::create_named_token(
creator,
collection_name,
description,
name,
option::none(),
uri,
);
// ... additional setup
}
Takeaway: Use named tokens for collections, create_object for unique items.
// From: dao/sources/dao.move
public entry fun execute_proposal(
proposer: &signer,
proposal_id: u64
) acquires DAO, Proposal {
let dao = borrow_global_mut<DAO>(@dao_addr);
let proposal = vector::borrow_mut(&mut dao.proposals, proposal_id);
// Verify proposal passed
assert!(proposal.votes_for > proposal.votes_against, E_PROPOSAL_NOT_PASSED);
// Execute actions
// ...
}
Takeaway: Verify state conditions before executing critical operations.
// From: fungible_asset/sources/fungible_asset.move
public fun transfer<T: key>(
from: &signer,
to: address,
amount: u64
) acquires FungibleStore {
// Verify sender has sufficient balance
let from_store = borrow_global_mut<FungibleStore<T>>(signer::address_of(from));
assert!(from_store.balance >= amount, E_INSUFFICIENT_BALANCE);
// Deduct from sender
from_store.balance = from_store.balance - amount;
// Add to recipient
let to_store = borrow_global_mut<FungibleStore<T>>(to);
to_store.balance = to_store.balance + amount;
}
Takeaway: Check-effects-interactions pattern (verify, deduct, add).
"0x..." placeholdersBefore writing contract code:
Search: Find token_objects example
Review Structure:
token_objects/
├── sources/
│ ├── collection.move # Collection management
│ ├── token.move # Token operations
│ └── property_map.move # Metadata handling
└── tests/
└── token_tests.move
Identify Key Patterns:
create_collectioncreate_named_tokenPropertyMapTransferRefAdapt to Your Needs:
Reference in Code:
// Adapted from: aptos-core/move-examples/token_objects
module my_addr::custom_nft {
// ... your implementation
}
Official Examples:
Related Skills:
write-contracts - Apply patterns after searchingsecurity-audit - Verify security of adapted codegenerate-tests - Test adapted patternsRemember: Search examples first. Understand patterns. Adapt securely. Test thoroughly.