0g-agent-skills
CLAUDE.md15 starsChanged 57 days agoMITView on GitHub
You are assisting a developer building on the 0G decentralized AI operating system. This repository contains 25 agent skills across 6 categories: Storage, Compute, Chain, Cross-Layer, Private Computer, and AgenticID. SDK packages were renamed. The old @0glabs/0g-ts-sdk and @0glabs/0g-serving-broker are deprecated on npm. Always use @0gfoundation/0g-storage-ts-sdk and @0gfoundation/0g-compute-ts-sdk. - SDK packages: @0gfoundation/0g-storage-ts-sdk (storage) and @0gfoundation/0g-compute-ts-sdk (compute). The @0glabs/* packages are deprecated — NEVER use them - ethers pin: use EXACTLY 6.13.1. The storage SDK declares an exact peer dependency on…
- Reads credentials
In this repository26 other files it gives its agents.
- AGENTS.mdAGENTS.md
- agent-accountsSkill
- agent-reputationSkill
- deploy-agentSkill
- interact-agentSkill
- manage-agentSkill
- deploy-contractSkill
- interact-contractSkill
- scaffold-projectSkill
- account-managementSkill
- embeddingsSkill
- fine-tuningSkill
- image-editingSkill
- provider-discoverySkill
- speech-to-textSkill
- streaming-chatSkill
- text-to-imageSkill
- video-generationSkill
- compute-plus-storageSkill
- storage-plus-chainSkill
- 0g-pc-setupSkill
- 0g-pc-switch-modelSkill
- 0g-pc-uninstallSkill
- download-fileSkill
- merkle-verificationSkill
- upload-fileSkill
The file
We split this CLAUDE.md into the rules it gives an agent
12 rules. About 0 are common, 5 are distinctive, and 7 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈5
Distinctive · estimate
This author's own choices. Worth a look.
7
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 13
Read AGENTS.md for orchestration rules, activation triggers, and workflow sequences
- Distinctive: line 16
Follow ALL ALWAYS/NEVER rules — they prevent common bugs
- Very specific: line 23
ethers pin: use EXACTLY 6.13.1. The storage SDK declares an exact peer dependency on ethers@6.13.1.
- Very specific: line 25
processResponse(): Call after EVERY compute inference.
- Very specific: line 33
ethers: ALWAYS v6 (ethers.JsonRpcProvider, ethers.parseEther).
- Very specific: line 35
File handles: ALWAYS close ZgFile with file.close() in a finally block
- Very specific: line 36
Private keys: ALWAYS from .env, NEVER hardcoded
- Very specific: line 42
TypeScript config: use moduleResolution: "bundler".
- Very specific: line 59
Provider first use: call checkProviderSignerStatus(provider) BEFORE acknowledged(provider).
- Distinctive: line 129
When a developer asks to build something on 0G:
- Distinctive: line 131
Check AGENTS.md workflow sequences to determine which skills to activate
- Distinctive: line 134
Follow the skill's Quick Workflow section
≈ “Common” is an estimate: at least 1 in 5 of the 26,980 CLAUDE.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
0G Agent Skills
You are assisting a developer building on the 0G decentralized AI operating system. This repository contains 25 agent skills across 6 categories: Storage, Compute, Chain, Cross-Layer, Private Computer, and AgenticID.
SDK packages were renamed. The old
@0glabs/0g-ts-sdkand@0glabs/0g-serving-brokerare deprecated on npm. Always use@0gfoundation/0g-storage-ts-sdkand@0gfoundation/0g-compute-ts-sdk.
How to Use
- Read
AGENTS.mdfor orchestration rules, activation triggers, and workflow sequences - Load the relevant
SKILL.mdfile based on what the developer is building - Reference
patterns/*.mdfor deep architectural context - Follow ALL ALWAYS/NEVER rules — they prevent common bugs
Critical Rules (Memorize These)
- SDK packages:
@0gfoundation/0g-storage-ts-sdk(storage) and@0gfoundation/0g-compute-ts-sdk(compute). The@0glabs/*packages are deprecated — NEVER use them - ethers pin: use EXACTLY
6.13.1. The storage SDK declares an exact peer dependency onethers@6.13.1; a range like^6.13.0resolves to 6.17.x and fails install withERESOLVE - processResponse(): Call after EVERY compute inference. Param order:
(providerAddress, chatID, usageData) - ChatID: Extract from
ZG-Res-Keyheader FIRST,data.idas fallback. These genuinely differ — the header is a bare UUID,data.idis prefixed (chatcmpl-<uuid>). Passingdata.idwhen the header exists sends the WRONG id toprocessResponse() - Two chain stacks, scoped by category: storage / compute / chain / cross-layer use ethers
v6 pinned to exactly
6.13.1;agentic-idusesviem^2.21.0 because its SDK depends on it. Never translate between them - ethers: ALWAYS v6 (
ethers.JsonRpcProvider,ethers.parseEther). NEVER v5. Applies everywhere EXCEPTagentic-id - File handles: ALWAYS close
ZgFilewithfile.close()in afinallyblock - Private keys: ALWAYS from
.env, NEVER hardcoded - Upload signature:
indexer.upload(file, rpcUrl, signer)— returns[result, error], whereresultis an OBJECT (not a tx-hash string) and is a UNION of{ txHash, rootHash, txSeq }for a single file and{ txHashes, rootHashes, txSeqs }for a fragmented one. Narrow it:'txHash' in result ? result.txHash : result.txHashes[0]. It already carries the root hash, so you need not re-derive it from the Merkle tree - TypeScript config: use
moduleResolution: "bundler". UnderNode16/NodeNextthe storage SDK'stypes/resolveethersas CJS while an ESM app resolves it as ESM, and everyWallet→Signerargument fails withTS2345(the dual-package hazard).bundlerresolves this without anyas anycasts, even withstrict: true - Download behavior:
indexer.download()can THROW in addition to returning errors — always wrap in try/catch - listService() is paginated: signature is
listService(offset = 0, limit = 50, includeUnacknowledged = false). The contract REVERTS withLimitTooLargeabove 50, so page in chunks of ≤50. A barelistService()silently returns only the first page AND hides unacknowledged providers - Service fields:
listService()entries are hybrid tuple/objects. Prefer named access (s.provider,s.serviceType,s.model,s.teeSignerAcknowledged). Positional access still works:s[0],s[1],s[6],s[10]respectively - Ledger fields:
getLedger()returns[user, availableBalance, totalBalance, additionalInfo]— soaccount[1]is availableBalance andaccount[2]is totalBalance. Preferled.availableBalance/led.totalBalance. Spend decisions MUST use availableBalance; totalBalance includes funds already locked in provider sub-accounts - Provider first use: call
checkProviderSignerStatus(provider)BEFOREacknowledged(provider).acknowledged()reverts withAccountNotExistswhen no sub-account exists yet - Sub-account minimum: fund provider sub-accounts with at least 1 0G. The SDK warns below that and providers may reject requests
- evmVersion:
"cancun"is the RECOMMENDED default — it is supported on 0G mainnet and testnet and emits the smallest bytecode (it can useMCOPY). It is NOT a hard requirement;shanghai,parisandlondonalso deploy and execute correctly on 0G Chain
Skill Map
Storage
skills/storage/upload-file/SKILL.md— Upload files to 0G Storageskills/storage/download-file/SKILL.md— Download & verify filesskills/storage/merkle-verification/SKILL.md— Data integrity verification
Compute
skills/compute/provider-discovery/SKILL.md— Find & verify providers, enumerate modelsskills/compute/account-management/SKILL.md— Deposits, transfers, refunds, auto-fundingskills/compute/streaming-chat/SKILL.md— LLM inference (GLM, Claude, GPT, Qwen, DeepSeek, 0GM)skills/compute/text-to-image/SKILL.md— Image generation (z-image-turbo)skills/compute/image-editing/SKILL.md— Edit an existing image from a promptskills/compute/video-generation/SKILL.md— Video generation (MiniMax-H3, Seedance)skills/compute/embeddings/SKILL.md— Text embeddings for search & RAGskills/compute/speech-to-text/SKILL.md— Audio transcription (Whisper Large V3)skills/compute/fine-tuning/SKILL.md— Model training + LoRA adapter deployment
Chain
skills/chain/scaffold-project/SKILL.md— Initialize new 0G projectsskills/chain/deploy-contract/SKILL.md— Deploy Solidity contractsskills/chain/interact-contract/SKILL.md— Read/write deployed contracts
AgenticID
On-chain identity and reputation for AI agents. This category uses viem, not ethers.
skills/agentic-id/deploy-agent/SKILL.md— mint an agent (ERC-8004 + ERC-7857)skills/agentic-id/manage-agent/SKILL.md— lifecycle, transfer, cloneskills/agentic-id/interact-agent/SKILL.md— call a running agentskills/agentic-id/agent-reputation/SKILL.md— serve-proofs and feedback (testnet only)skills/agentic-id/agent-accounts/SKILL.md— trust root, balances, costs
Cross-Layer
skills/cross-layer/storage-plus-chain/SKILL.md— On-chain refs to off-chain dataskills/cross-layer/compute-plus-storage/SKILL.md— AI inference + storage I/O
Private Computer
Claude Code's own backend, not the SDKs. Claude Code only; no SDK, wallet or .env involved.
skills/private-computer/0g-pc-setup/SKILL.md— Put a project on 0G Private Computerskills/private-computer/0g-pc-switch-model/SKILL.md— Change which router model it usesskills/private-computer/0g-pc-uninstall/SKILL.md— Take the project back off 0G
Pattern Documents
patterns/NETWORK_CONFIG.md— Endpoints, chain IDs, SDK versions, .env templatepatterns/STORAGE.md— Storage architecture & SDK referencepatterns/COMPUTE.md— Compute architecture & processResponse() deep-divepatterns/CHAIN.md— EVM patterns, Hardhat/Foundry configs, ethers v6patterns/SECURITY.md— Key management, TEE, data integritypatterns/TESTING.md— Testing strategies & mock patternspatterns/AGENTIC_ID.md— Agent identity, trust chain, three-ID model, viem
Quick Start
When a developer asks to build something on 0G:
- Check
AGENTS.mdworkflow sequences to determine which skills to activate - Load the primary skill's
SKILL.md - Load
patterns/NETWORK_CONFIG.mdfor environment setup - Follow the skill's Quick Workflow section
- Apply all ALWAYS/NEVER rules from
AGENTS.md
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

