Give your AI coding assistant superpowers for building on 0G.
This repo turns Claude Code, Cursor, and GitHub Copilot into expert 0G developers. Just say "upload a file to 0G Storage" or "build a chatbot on 0G Compute" and get correct, working TypeScript code — every time.
14 skills. 6 architecture references. 3 IDE setups. Zero build step.
git clone https://github.com/0gfoundation/0g-agent-skills .0g-skills| IDE | How |
|---|---|
| Claude Code | cp .0g-skills/CLAUDE.md ./CLAUDE.md — auto-detected on next session |
| Cursor | Create .cursorrules — see setup guide |
| Copilot | Create .github/copilot-instructions.md — see setup guide |
# Everything
npm install @0glabs/0g-ts-sdk @0glabs/0g-serving-broker ethers dotenv
# Or just what you need
npm install @0glabs/0g-ts-sdk ethers dotenv # Storage only
npm install @0glabs/0g-serving-broker ethers dotenv # Compute only# .env — NEVER commit this file
PRIVATE_KEY=your_private_key_here
RPC_URL=https://evmrpc-testnet.0g.ai
STORAGE_INDEXER=https://indexer-storage-testnet-turbo.0g.ai
PROVIDER_ADDRESS=your_compute_provider_addressAsk your AI assistant anything. Try these:
"Upload a file to 0G Storage"
"Build a streaming chatbot with 0G Compute"
"Deploy a Solidity contract to 0G Chain"
"Generate an image with AI and store it on 0G"
"Create an NFT with metadata stored on 0G Storage"
| Skill | What it does | Say this to activate |
|---|---|---|
| Upload File | Upload files via ZgFile API + Merkle tree chunking. Returns a root hash for retrieval. | "upload a file to 0G" |
| Download File | Download and verify files by root hash with Merkle proof validation. | "download a file from 0G" |
| Merkle Verification | Compute root hashes and cryptographically verify file integrity. | "verify file integrity" |
| Skill | What it does | Say this to activate |
|---|---|---|
| Streaming Chat | Conversational AI with DeepSeek V3.1, Qwen, Gemma, GPT-OSS. Streaming + non-streaming. | "build a chatbot with 0G" |
| Text to Image | Generate images from text prompts using Flux Turbo. Multiple resolutions, batch support. | "generate an image with 0G" |
| Speech to Text | Transcribe audio with Whisper Large V3. Outputs JSON, plain text, or SRT subtitles. | "transcribe audio with 0G" |
| Provider Discovery | List providers, check TEE verification, acknowledge before first use. | "find a compute provider" |
| Account Management | Deposit, transfer, refund, and withdraw across the dual-account system. | "deposit funds for compute" |
| Fine-Tuning | Train custom models on distributed GPUs. Upload data, monitor, download results. Testnet only. | "fine-tune a model on 0G" |
| Skill | What it does | Say this to activate |
|---|---|---|
| Deploy Contract | Deploy Solidity contracts via Hardhat, Foundry, or ethers v6. Requires evmVersion: "cancun". |
"deploy a contract to 0G" |
| Interact Contract | Read state, send transactions, listen to events, estimate gas — all ethers v6. | "call a contract on 0G Chain" |
| Scaffold Project | Generate a new project with correct SDKs, TypeScript config, and boilerplate. | "create a new 0G project" |
| Skill | What it does | Say this to activate |
|---|---|---|
| Storage + Chain | On-chain smart contract references to off-chain storage. NFT metadata, registries, verifiable docs. | "store NFT metadata on 0G" |
| Compute + Storage | AI inference pipelines with persistent storage. Generate-then-store, load-then-process. | "generate an image and store it on 0G" |
Runnable example projects — clone, install, and run against testnet:
| Example | What it builds | Layers |
|---|---|---|
file-vault |
Upload, download, and verify files | Storage |
ai-chatbot |
Discover providers, fund account, chat | Compute |
nft-with-metadata |
Deploy contract, upload metadata, register on-chain | Storage + Chain |
ai-image-gallery |
Generate images with AI, store on 0G | Compute + Storage |
cd examples/file-vault
npm install
cp .env.example .env
# Add your funded private key, then:
npx tsx src/upload.ts README.mdWhen you ask your AI assistant to build something on 0G, it follows an automated workflow:
You say: "Build a chatbot on 0G Compute"
|
AGENTS.md matches triggers
|
+---------------+----------------+
| | |
Provider Account Streaming
Discovery Management Chat
(auto) (auto) (primary)
| | |
+---------------+----------------+
|
Working TypeScript code
with correct SDK patterns
8 built-in workflows handle common tasks automatically:
| Workflow | What gets activated |
|---|---|
| New Project | scaffold-project |
| Upload Data | upload-file → auto: merkle-verification |
| Download Data | download-file → auto: merkle-verification |
| AI Inference | auto: provider-discovery → account-management → streaming-chat / text-to-image / speech-to-text |
| Fine-Tune | auto: provider-discovery → account-management → fine-tuning |
| Deploy Contract | deploy-contract |
| Cross-Layer App | storage-plus-chain / compute-plus-storage |
| Manage Funds | account-management |
Deep-dive documents for when you need to understand how things work:
| Document | What's inside |
|---|---|
| NETWORK_CONFIG.md | RPC endpoints, chain IDs, SDK versions, .env template, initialization patterns |
| STORAGE.md | Two-layer architecture (Log + KV), ZgFile lifecycle, upload/download internals, indexer API |
| COMPUTE.md | Broker lifecycle, processResponse() deep-dive, ChatID extraction rules, streaming patterns |
| CHAIN.md | Hardhat/Foundry configs, evmVersion: "cancun", ethers v5 → v6 migration table |
| SECURITY.md | Key management, .env best practices, TEE verification, contract access control |
| TESTING.md | Vitest mocks for all SDKs, Hardhat/Foundry contract tests, testnet integration testing |
| Network | RPC Endpoint | Chain ID | Explorer |
|---|---|---|---|
| Testnet (Galileo) | https://evmrpc-testnet.0g.ai |
16602 | https://chainscan-galileo.0g.ai |
| Mainnet (Aristotle) | https://evmrpc.0g.ai |
16661 | https://chainscan.0g.ai |
Faucet (testnet): https://faucet.0g.ai
| Package | Version | Layer |
|---|---|---|
@0glabs/0g-ts-sdk |
^0.3.3 | Storage |
@0glabs/0g-serving-broker |
^0.6.5 | Compute |
ethers |
^6.13.0 | Chain (v6 only — never v5) |
agent-skills-0g/
├── CLAUDE.md # Auto-loader for Claude Code
├── AGENTS.md # Orchestration: triggers, workflows, rules
│
├── skills/
│ ├── storage/ # 3 skills
│ │ ├── upload-file/SKILL.md
│ │ ├── download-file/SKILL.md
│ │ └── merkle-verification/SKILL.md
│ ├── compute/ # 6 skills
│ │ ├── streaming-chat/SKILL.md
│ │ ├── text-to-image/SKILL.md
│ │ ├── speech-to-text/SKILL.md
│ │ ├── provider-discovery/SKILL.md
│ │ ├── account-management/SKILL.md
│ │ └── fine-tuning/SKILL.md
│ ├── chain/ # 3 skills
│ │ ├── deploy-contract/SKILL.md
│ │ ├── interact-contract/SKILL.md
│ │ └── scaffold-project/SKILL.md
│ └── cross-layer/ # 2 skills
│ ├── storage-plus-chain/SKILL.md
│ └── compute-plus-storage/SKILL.md
│
├── examples/ # 4 runnable example projects
│ ├── file-vault/ # Storage: upload, download, verify
│ ├── ai-chatbot/ # Compute: discover, fund, chat
│ ├── nft-with-metadata/ # Cross-layer: contract + storage
│ └── ai-image-gallery/ # Cross-layer: AI + storage
│
├── patterns/ # 6 architecture references
│ ├── NETWORK_CONFIG.md
│ ├── STORAGE.md
│ ├── COMPUTE.md
│ ├── CHAIN.md
│ ├── SECURITY.md
│ └── TESTING.md
│
├── ci/ # CI scripts
│ ├── extract-code-blocks.ts
│ ├── validate-sdk-versions.ts
│ └── lint-critical-rules.ts
│
├── setups/ # IDE-specific guides
│ ├── claude-code/README.md
│ ├── cursor/README.md
│ └── copilot/README.md
│
├── INSTALL.md # Detailed installation guide
└── CONTRIBUTING.md # How to add new skills
Want to add a skill or improve an existing one? See CONTRIBUTING.md.
Every skill follows a consistent template: Metadata, Purpose, Prerequisites, Quick Workflow, Core Rules, Code Examples, Anti-Patterns, Common Errors, Related Skills, and References.
MIT — see LICENSE