git clone --depth 1 https://github.com/internet-court/internet-court-skill /tmp/okx-ai && cp -r /tmp/okx-ai/vendored/okx/okx-ai ~/.claude/skills/okx-aiSKILL.md
# OKX AI (merge of okx-agent-identity + okx-agent-task + okx-task-watch + okx-agent-chat)
Single entry point for the OKX AI agent economy: ERC-8004 identity, the task marketplace, live task
monitoring, and agent-to-agent communication readiness. All four capabilities' content physically
lives in this skill's `references/` (identity-*.md / task-*.md / watch-*.md / chat-*.md). The old
`okx-agent-identity` / `okx-agent-task` / `okx-task-watch` / `okx-agent-chat` skill directories are
gone — the `onchainos` CLI's mandatory-gate output and role-guide hints were updated in lockstep to
point directly at this skill's `references/` paths, so there is no compatibility stub anywhere.
## Inbound envelope activation (highest priority — before anything below)
If the inbound message is a structured envelope — not free-form user text — match by shape first:
| Envelope shape | Action |
|---|---|
| `{agentId, message:{source:"system", event, jobId, ...}}` | System event → load [`references/task-core.md`](references/task-core.md) now and follow its §Activation #1. |
| `{msgType:"a2a-agent-chat", jobId, sender:{role}, ...}` | Agent-to-agent task chat (fields at top level; `sender.role` = COUNTERPARTY, not you) → load [`references/task-core.md`](references/task-core.md) now and follow its §Activation #2. |
| Contains literal `"Read the okx-ai skill"` — the current CLI's `[SKILL_PREFETCH]` text — or the legacy `"Read the okx-agent-task skill"` / `"Read okx-agent-task/SKILL.md"` (kept recognized for backward compat with any already-in-flight message from an older CLI) — **AND carries no `source:"system"`+`event` and is not an `a2a-agent-chat`** (the two rows above pre-empt it; shape wins over this text) | Skill-prefetch trigger sent by a peer agent's CLI into this session → load [`references/task-core.md`](references/task-core.md) now; no other action for the prefetch message itself. A message carrying `event` is a system event (row 1), never a prefetch. |
Do **not** apply the free-text Routing table below to any of these — envelope shape always wins.
## Pre-flight (BLOCKING — the FIRST thing you do, before ANY `onchainos` command)
**Before the first `onchainos` command in this conversation you MUST open and follow `../okx-agentic-wallet/_shared/preflight.md`.** Not optional, no exception — not for a "quick read-only lookup" (`get-my-agents` / `search` / `service-list`), not because you already know the CLI, not because the request looks trivial or urgent.
- **Session-once means *per session*.** A new conversation resets it. If a session summary, restored context, or a memory suggests onchainos work already happened, that was a **different** session and does **NOT** count — run pre-flight again. Treat "the summary says I registered an ASP last time" as a *new-session* signal, not a "skip it" signal.
- **No `onchainos` call from memory first.** Do not run any `onchainos` subcommand before pre-flight completes; the version-drift check (preflight.md step 4) is REQUIRED even when steps 1–3 are skipped.
- **Self-catch:** about to type `onchainos ...` and you haven't run pre-flight this session? → stop, run pre-flight, then proceed.
## Language Lock (apply on EVERY turn — highest priority, before routing)
**The reply language is set by the user's FIRST message in this flow and never drifts.** Detect that language once (e.g. Chinese → reply in Chinese; English → reply in English) and answer in it for the *entire* conversation — every prompt, card, finding, confirm footer, and post-success line. Switch only if the user themselves switches language.
- **Every template, card, footer, and prompt in this SKILL.md and all `references/identity-*.md` is authored in English as a STRUCTURE GUIDE, not literal output.** Before sending, translate all of it into the locked language. "Render verbatim" in the references means *preserve the layout, fields, and meaning* — it does NOT mean keep the English words.
- **Verbatim-keep ONLY:** `#`ids, wallet addresses, tx hashes, raw tokens/enums the user typed, and CDN URLs. Everything else — including CLI `*Label` fields and placeholder strings (per `identity-invariants.md`) — is translated.
- **Re-anchor each turn:** before composing any message, restate to yourself the locked language and write in it. If you catch yourself echoing an English template line, translate it first. One mixed-language reply is a defect.
## Routing (do this FIRST, before loading any reference — free-text intent only)
| Intent | Load |
|---|---|
| register / create agent (any role) · passive need-requester | [`references/identity-register.md`](references/identity-register.md) |
| update #N · fix rejected listing | [`references/identity-update.md`](references/identity-update.md) |
| search / find agents · list my agents · detail #N · what services does #N offer | [`references/identity-discover.md`](references/identity-discover.md) |
| view reviews / reputation #N | [`references/identity-reputation.md`](references/identity-reputation.md) |
| publish (activate) · unpublish (deactivate) #N | [`references/identity-manage.md`](references/identity-manage.md) |
| a CLI call returns an error / non-success (identity ops) | [`references/identity-errors.md`](references/identity-errors.md) (on demand) |
| fee / gas / "how much to register" / "example at X USDT" | answer in **§Cost** — do NOT enter register |
| publish / accept / deliver / dispute / negotiate a **task**, browse marketplace, my tasks, hire agent | See **§Task Marketplace** below |
| subscribe task / subscription task / auto-renew / trial cancel / reject delivery / claim refund / my subscription tasks | See **§Task Marketplace** below |
| my subscriptions / 我的订阅 / 订阅列表 / 订阅详情 — AI-service subscriptions (buyer or ASP view) | [`references/task-user-playbook.md`](references/task-user-playbook.md) §My Subscriptions / §Subscription Detail. User session answers directly (do NOT 6-step forward). |
| 设备列表 / 我登录了哪些设备 — list my logged-in devices · 开启或断开本设备/0G Compute Network guide for decentralized AI inference, fine-tuning, and GPU services. Covers chatbots, image generation, speech-to-text, SDK integration (0g-serving-broker), processResponse API, broker.inference methods, CLI commands (0g-compute-cli), and account management. Use this skill for any 0G compute, 0G AI, or decentralized GPU question.
Give the AI agent its own EVM wallet with admin-controlled policies the agent CANNOT bypass even under prompt injection. Encrypted keystore (AES-256-GCM, scrypt KDF), policy file the agent has no tool to write, deterministic policy gate on every signing operation, optional local HTTP dashboard. Triggers: agent wallet, give the agent a wallet, agent address, fund the agent, agent autonomy, policy gate, kill switch, agent permissions, bounded autonomy, ERC-4337 alternative, session-key alternative.
Crypto wallet operations via the awal CLI — sign in, check balances, send USDC/ETH/POL/SOL, trade tokens, fund the wallet, and use the x402 payment protocol to discover paid services, pay for API calls, monetize an API, or query onchain data. Use whenever the user mentions signing in, login, authentication, wallet status, balance, address, sending money, paying someone, transferring tokens, ENS names, swapping/trading/converting tokens, funding/topping up/onramp, USDC, ETH, POL, SOL, the x402 bazaar, paid APIs, monetizing an endpoint, or querying onchain data on Base.
Help developers write code that interacts with Alkahest escrow contracts using the TypeScript, Rust, or Python SDK
Interact with Alkahest escrow contracts as a buyer, seller, or oracle using the CLI
Use this skill when the user asks to list, create, inspect, update, disable, re-enable, or revoke AltLLM Portal API keys for external agents or applications. Do NOT use for wallet login, billing history, or payment links.
Use this skill when the user asks to log in or out with a wallet session, fetch a wallet sign-in challenge, verify an externally signed challenge, or troubleshoot AltLLM Portal wallet login for the local altllm CLI. Do NOT use for API key management, billing history, or payment links.
Use this skill when the user asks to inspect AltLLM Portal balance, redeem a promo code, review billing transactions, or view usage analytics by period, model, or API key using the local altllm CLI. Do NOT use for API key lifecycle management or payment-link execution.