nft-development

nft-development

Master NFT development with token standards, metadata, marketplaces, and on-chain art

1étoiles
0forks
Mis à jour 1/5/2026
SKILL.md
readonlyread-only
name
nft-development
description

Master NFT development with token standards, metadata, marketplaces, and on-chain art

version
"2.0.0"

NFT Development Skill

Master NFT development with token standards, metadata design, marketplace integration, and on-chain generative art.

Quick Start

# Invoke this skill for NFT development
Skill("nft-development", topic="standards", standard="ERC721A")

Topics Covered

1. Token Standards

Choose the right standard:

  • ERC-721: Standard NFTs, one token per ID
  • ERC-721A: Gas-optimized batch minting
  • ERC-1155: Multi-token, semi-fungible
  • DN404: Divisible NFT hybrid

2. Metadata Design

Structure your NFT data:

  • On-chain: Base64 JSON, SVG
  • IPFS: Content-addressed storage
  • Arweave: Permanent storage
  • Dynamic: Evolving traits

3. Marketplace Integration

List and sell NFTs:

  • OpenSea: Seaport protocol
  • Royalties: EIP-2981
  • Operator Filter: Royalty enforcement
  • Collection Verification: Metadata standards

4. On-Chain Art

Generate art in Solidity:

  • SVG Generation: Dynamic shapes
  • Seed-based: Deterministic randomness
  • Traits: Rarity distribution
  • Base64: Data URI encoding

Code Examples

ERC-721A Mint

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.24;

import "erc721a/contracts/ERC721A.sol";
import "@openzeppelin/contracts/access/Ownable.sol";

contract MyNFT is ERC721A, Ownable {
    uint256 public constant MAX_SUPPLY = 10000;
    uint256 public constant PRICE = 0.08 ether;

    error MaxSupplyReached();
    error InsufficientPayment();

    constructor() ERC721A("MyNFT", "MNFT") Ownable(msg.sender) {}

    function mint(uint256 quantity) external payable {
        if (_totalMinted() + quantity > MAX_SUPPLY) revert MaxSupplyReached();
        if (msg.value < PRICE * quantity) revert InsufficientPayment();

        _mint(msg.sender, quantity);
    }

    function _startTokenId() internal pure override returns (uint256) {
        return 1;
    }
}

On-Chain SVG

function tokenURI(uint256 tokenId) public view returns (string memory) {
    uint256 seed = seeds[tokenId];

    string memory svg = string(abi.encodePacked(
        '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 400 400">',
        '<rect width="400" height="400" fill="#', _getColor(seed), '"/>',
        '<circle cx="200" cy="200" r="80" fill="#', _getColor(seed >> 24), '"/>',
        '</svg>'
    ));

    string memory json = string(abi.encodePacked(
        '{"name":"Art #', tokenId.toString(),
        '","image":"data:image/svg+xml;base64,', Base64.encode(bytes(svg)), '"}'
    ));

    return string(abi.encodePacked(
        "data:application/json;base64,",
        Base64.encode(bytes(json))
    ));
}

EIP-2981 Royalties

import "@openzeppelin/contracts/token/common/ERC2981.sol";

contract NFTWithRoyalty is ERC721A, ERC2981 {
    constructor() {
        _setDefaultRoyalty(msg.sender, 500); // 5%
    }

    function supportsInterface(bytes4 interfaceId)
        public view override(ERC721A, ERC2981)
        returns (bool)
    {
        return super.supportsInterface(interfaceId);
    }
}

Metadata Schema

ERC-721 Standard

{
  "name": "Cool NFT #1",
  "description": "A very cool NFT",
  "image": "ipfs://QmXxx.../1.png",
  "animation_url": "ipfs://QmXxx.../1.mp4",
  "external_url": "https://example.com/1",
  "attributes": [
    { "trait_type": "Background", "value": "Blue" },
    { "trait_type": "Rarity", "value": "Legendary" },
    { "display_type": "number", "trait_type": "Power", "value": 100 }
  ]
}

Standard Comparison

Standard Best For Gas (1 mint) Gas (5 mints)
ERC-721 Simple NFTs ~100k ~500k
ERC-721A PFP collections ~100k ~120k
ERC-1155 Game items ~50k ~80k

Common Pitfalls

Pitfall Issue Solution
Metadata not showing Bad tokenURI Validate JSON, check CORS
Gas too high Standard ERC-721 Use ERC-721A for batches
Royalties not paid Marketplaces ignore Use operator filter
Reveal broken Wrong base URI Test on testnet first

Troubleshooting

"Metadata not showing on OpenSea"

  1. Verify tokenURI returns valid JSON
  2. Check IPFS gateway accessibility
  3. Refresh metadata via API:
curl "https://api.opensea.io/api/v2/chain/ethereum/contract/{addr}/nfts/{id}/refresh"

"Batch mint out of gas"

  • Use ERC-721A instead of ERC-721
  • Limit batch size to 10-20 per tx

"Royalties not enforced"

Implement operator filter:

import "operator-filter-registry/src/DefaultOperatorFilterer.sol";

function setApprovalForAll(address op, bool approved)
    public override onlyAllowedOperatorApproval(op)
{
    super.setApprovalForAll(op, approved);
}

Gas Optimization

Technique Savings
ERC721A batching ~80% for batches
Merkle whitelist ~50% vs mapping
Packed storage ~20k per slot
Custom errors ~200 per error

Cross-References

  • Bonded Agent: 07-nft-development
  • Related Skills: solidity-development, web3-frontend

Resources

Version History

Version Date Changes
2.0.0 2025-01 Production-grade with standards, on-chain
1.0.0 2024-12 Initial release

You Might Also Like

Related Skills

coding-agent

coding-agent

179Kdev-codegen

Run Codex CLI, Claude Code, OpenCode, or Pi Coding Agent via background process for programmatic control.

openclaw avataropenclaw
Obtenir
add-uint-support

add-uint-support

97Kdev-codegen

Add unsigned integer (uint) type support to PyTorch operators by updating AT_DISPATCH macros. Use when adding support for uint16, uint32, uint64 types to operators, kernels, or when user mentions enabling unsigned types, barebones unsigned types, or uint support.

pytorch avatarpytorch
Obtenir
at-dispatch-v2

at-dispatch-v2

97Kdev-codegen

Convert PyTorch AT_DISPATCH macros to AT_DISPATCH_V2 format in ATen C++ code. Use when porting AT_DISPATCH_ALL_TYPES_AND*, AT_DISPATCH_FLOATING_TYPES*, or other dispatch macros to the new v2 API. For ATen kernel files, CUDA kernels, and native operator implementations.

pytorch avatarpytorch
Obtenir
skill-writer

skill-writer

97Kdev-codegen

Guide users through creating Agent Skills for Claude Code. Use when the user wants to create, write, author, or design a new Skill, or needs help with SKILL.md files, frontmatter, or skill structure.

pytorch avatarpytorch
Obtenir

Implements JavaScript classes in C++ using JavaScriptCore. Use when creating new JS classes with C++ bindings, prototypes, or constructors.

oven-sh avataroven-sh
Obtenir

Creates JavaScript classes using Bun's Zig bindings generator (.classes.ts). Use when implementing new JS APIs in Zig with JSC integration.

oven-sh avataroven-sh
Obtenir