okx-how-to-play

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Onchain OS — How to Play (Entry Router)

Onchain OS — 使用指南(入口路由器)

The first-time / "I don't know what to do" entry point. Routes the user from a blank prompt into a concrete DApp workflow in ≤ 3 turns.
这是首次使用/「我不知道该做什么」的入口点。可在≤3轮交互内将用户从空白提示引导至具体的DApp工作流。

Instruction Priority

指令优先级

Tagged blocks indicate rule severity (higher wins on conflict):
  1. <NEVER>
    — Absolute prohibition.
  2. <MUST>
    — Mandatory step. Skipping breaks the flow.
  3. <SHOULD>
    — Best practice.
带标签的区块表示规则的严格程度(优先级越高,冲突时越优先):
  1. <NEVER>
    — 绝对禁止。
  2. <MUST>
    — 强制步骤。跳过会中断流程。
  3. <SHOULD>
    — 最佳实践。

Pre-flight Checks

预检查

<MUST> > Read `../okx-agentic-wallet/_shared/preflight.md`. If that file does not exist, read `_shared/preflight.md` instead. </MUST>
<MUST> > 阅读 `../okx-agentic-wallet/_shared/preflight.md`。若该文件不存在,则改为阅读 `_shared/preflight.md`。 </MUST>

Trigger Criteria

触发条件

<MUST> Only trigger this skill when the user message is **open-ended / guidance-seeking**. Positive examples:
  • "how do I use this / what can I do / what is this / getting started"
  • "I just installed it, now what?"
  • "tutorial / onboarding / first time / where do I start"
Negative examples (use the matching skill instead, not this one):
  • "check my balance" →
    okx-agentic-wallet
    /
    okx-wallet-portfolio
  • "swap 0.1 ETH for USDC" →
    okx-dex-swap
  • "what's the price of BTC" →
    okx-dex-market
  • "login" alone →
    okx-agentic-wallet
    (but
    login
    as a reply to the welcome banner is handled inside this skill — see Login Method Choice)
  • "search for PEPE token" →
    okx-dex-token
</MUST>
<MUST> 仅当用户消息为**开放式/寻求指导类**内容时,触发此技能。正面示例:
  • "how do I use this / what can I do / what is this / getting started"
  • "I just installed it, now what?"
  • "tutorial / onboarding / first time / where do I start"
负面示例(应使用匹配的技能,而非本技能):
  • "check my balance" →
    okx-agentic-wallet
    /
    okx-wallet-portfolio
  • "swap 0.1 ETH for USDC" →
    okx-dex-swap
  • "what's the price of BTC" →
    okx-dex-market
  • 单独的"login" →
    okx-agentic-wallet
    (但作为对欢迎横幅的回复的"login"由本技能处理——详见 登录方式选择
  • "search for PEPE token" →
    okx-dex-token
</MUST>

Authoring Pattern — Free Zone vs Fixed Zone

编写模式 — 自由区与固定区

Most user-facing copy in this flow is split into two parts:
  • Free zone — the agent answers the user's actual question or acknowledgement first, in 1–5 sentences, contextually woven. No fixed copy. The user shouldn't feel like they hit a script.
  • Fixed zone — the canonical English template block (welcome banner, login options, API Key heads-up). Render in the user's language at runtime; keep emojis,
    {placeholders}
    ,
    1–N
    , code identifiers, and markdown structure literal. Quoted reply tokens like
    "login"
    are prose too — translate them along with the surrounding sentence.
This applies to: Welcome Banner, Login Method Choice, and API Key Login Step 1 heads-up.
<MUST> **Bridging is mandatory.** End the free zone with a transitional half-sentence (e.g. "let me drop the menu" / "here's where to start ↓") — never with a hard period followed by an unrelated fixed-zone line. Self-check before emitting: read the free-zone tail + first fixed-zone line as a single unit; if they feel like two separate posts pasted together, rewrite the free-zone tail. </MUST>
此流程中大多数面向用户的文案分为两部分:
  • 自由区 — 智能体首先以1-5句话回应用户的实际问题或确认信息,上下文自然衔接。无固定文案,用户不应感觉像是触发了脚本。
  • 固定区 — 标准英文模板区块(欢迎横幅、登录选项、API Key提示)。运行时需转换为用户使用的语言;保留表情符号、
    {placeholders}
    1–N
    、代码标识符和Markdown结构不变。像
    "login"
    这类带引号的回复词属于散文内容——需连同周围句子一起翻译。
此模式适用于:欢迎横幅登录方式选择API Key登录步骤1提示。
<MUST> **必须添加过渡衔接**。自由区结尾需用半句话过渡(例如:"我来展示菜单" / "以下是入门路径 ↓")——绝不能以句号结尾后直接接上无关的固定区内容。输出前自查:将自由区结尾和固定区第一句连起来读;如果感觉像是两个独立内容拼接而成,请重写自由区结尾。 </MUST>

Status Check

状态检查

<MUST> Run `onchainos wallet status` **before** showing any login or welcome text. Use the `loggedIn` field to branch. </MUST>
onchainos wallet status
  • loggedIn: false
    → render the logged-out Welcome Banner.
  • loggedIn: true
    → render the logged-in Welcome Banner.

<MUST> 在显示任何登录或欢迎文本**之前**,运行 `onchainos wallet status`。根据`loggedIn`字段分支处理。 </MUST>
onchainos wallet status
  • loggedIn: false
    → 渲染未登录版欢迎横幅。
  • loggedIn: true
    → 渲染已登录版欢迎横幅。

Welcome Banner

欢迎横幅

<MUST> Render the banner from `references/welcome.md` — it covers placeholders (`{evm_address}` / `{solana_address}` / `{balance}` from `wallet balance`; geoblock variant from `wallet geoblock`), the template, and pick routing (Step 4). Variant A = 5 picks (Polymarket allowed); Variant B = 4 picks (Polymarket geoblocked). Never fabricate addresses or balance. </MUST>
<MUST> 从`references/welcome.md`渲染横幅——该文件包含占位符(来自`wallet balance`的`{evm_address}` / `{solana_address}` / `{balance}`;来自`wallet geoblock`的地域限制变体)、模板和选项路由(步骤4)。变体A包含5个选项(允许Polymarket);变体B包含4个选项(Polymarket受地域限制)。绝不能伪造地址或余额。 </MUST>

Login Method Choice

登录方式选择

Reached when the user asks to log in (either by replying
login
to the logged-out banner, or by picking a workflow option from the welcome menu while logged out).
Free zone (1–5 sentences, agent's own words): answer whatever the user actually asked / acknowledged. If they came from a workflow pick, briefly explain that login unlocks that workflow. Then segue naturally into the fixed-zone choice below.
Fixed zone — render the template below in the user's language:
Welcome to Agentic Wallet — the Onchain OS wallet built for agents. Pick a login method:

1. 📧 Email (recommended — 30 seconds)
2. 🔑 API Key (already an OKX developer? Fastest path)

Reply 1 or 2 ↓
If the user replies
1
or "email" → Email Login. If the user replies
2
or "API Key" → API Key Login.
当用户要求登录时触发(无论是回复未登录横幅的
login
,还是未登录时选择欢迎菜单中的工作流选项)。
自由区(1-5句话,智能体自主表述): 回应用户实际提出的问题/确认信息。如果用户来自工作流选项选择,简要说明登录可解锁该工作流。然后自然过渡到下方的固定区选项。
固定区 — 将以下模板转换为用户使用的语言渲染
Welcome to Agentic Wallet — the Onchain OS wallet built for agents. Pick a login method:

1. 📧 Email (recommended — 30 seconds)
2. 🔑 API Key (already an OKX developer? Fastest path)

Reply 1 or 2 ↓
若用户回复
1
或"email" → 邮箱登录。 若用户回复
2
或"API Key" → API Key登录

Email Login

邮箱登录

Handled by
okx-agentic-wallet
skill's Authentication section. Steps:
  1. Ask for email →
    onchainos wallet login <email> --locale <locale>
  2. Ask for OTP code →
    onchainos wallet verify <code>
  3. On success → Post-login routing below.
okx-agentic-wallet
技能的认证部分处理。步骤:
  1. 请求邮箱 →
    onchainos wallet login <email> --locale <locale>
  2. 请求OTP验证码 →
    onchainos wallet verify <code>
  3. 成功后 → 下方的登录后路由

API Key Login

API Key登录

Two steps total: (1) one-time heads-up so the user knows what env vars to set and where to get them, (2) run
onchainos wallet login
once they confirm.
共两步:(1) 一次性提示用户需设置的环境变量及获取位置,(2) 用户确认后运行
onchainos wallet login

Step 1 — Heads-up (one-shot, fixed zone)

步骤1 — 提示(一次性,固定区)

Free zone (1–5 sentences): if the user has any other question, answer it first. Then segue naturally into the heads-up.
Fixed zone — render the template below in the user's language:
You'll need to set three API Key environment variables before logging in:

1. `OKX_API_KEY` — API Key
2. `OKX_SECRET_KEY` — Secret Key
3. `OKX_PASSPHRASE` — Passphrase

You can find these at https://web3.okx.com/onchainos/dev-portal.

**Attention ⚠️:** Do not paste credentials into the chat — follow the dev-portal instructions and set them locally.
Then stop and wait for the user to confirm they're ready (e.g. "done / ok / ready").
自由区(1-5句话): 若用户有其他问题,先进行回复。然后自然过渡到提示内容。
固定区 — 将以下模板转换为用户使用的语言渲染
You'll need to set three API Key environment variables before logging in:

1. `OKX_API_KEY` — API Key
2. `OKX_SECRET_KEY` — Secret Key
3. `OKX_PASSPHRASE` — Passphrase

You can find these at https://web3.okx.com/onchainos/dev-portal.

**Attention ⚠️:** Do not paste credentials into the chat — follow the dev-portal instructions and set them locally.
然后停止并等待用户确认已准备就绪(例如:"done / ok / ready")。

Step 2 — Login

步骤2 — 登录

Once the user confirms, run:
onchainos wallet login
On success → Post-login routing below. On login failure, surface the error and ask the user to verify their env vars (do NOT re-show the heads-up — they already saw it).
<NEVER> - Do NOT accept API Key / Secret / Passphrase inline in chat. If the user pastes credentials in chat: do NOT echo, do NOT use the values, ask them to delete the message + rotate the keys + set the env vars locally instead. - Do NOT walk the user through generating keys, opening URLs, creating `.env` files, editing `.gitignore`, or any other multi-step setup. The heads-up is one-shot — they handle their own local setup. - Do NOT ask the user to paste the browser URL or any callback back to the CLI. The dev-portal is read-only. </NEVER>
用户确认后,运行:
onchainos wallet login
成功后 → 下方的登录后路由。登录失败时,显示错误信息并要求用户验证环境变量(请勿重新显示提示内容——用户已看过)。
<NEVER> - 请勿在聊天中直接接收API Key/密钥/密码。若用户在聊天中粘贴凭证:请勿回显,请勿使用该值,要求用户删除消息 + 轮换密钥 + 在本地设置环境变量。 - 请勿引导用户完成生成密钥、打开URL、创建`.env`文件、编辑`.gitignore`或其他多步设置流程。提示仅需一次——用户自行处理本地设置。 - 请勿要求用户将浏览器URL或任何回调内容粘贴到CLI中。开发者门户为只读状态。 </NEVER>

Post-login routing

登录后路由

After login completes successfully:
  • If the user came from picking a workflow pick while logged out: automatically load the corresponding workflow file (
    ~/.onchainos/workflows/<file>.md
    ) and follow it. Do NOT re-render the welcome banner.
  • If the user came from replying
    login
    (or equivalent) to the logged-out banner: render the logged-in Welcome Banner so they see their addresses + balance.

登录成功后:
  • 若用户来自未登录时选择工作流选项:自动加载对应的工作流文件(
    ~/.onchainos/workflows/<file>.md
    )并执行。请勿重新渲染欢迎横幅。
  • 若用户来自回复未登录横幅的
    login
    (或等效表述):渲染已登录版欢迎横幅,展示用户地址 + 余额。

Free-form fallback

自由格式回退

If the user types something other than a numbered pick or
login
, answer in the free zone, then route to the matching skill / workflow:
IntentRoute to
meme sniping / pump.fun / new launches
okx-dex-trenches
follow smart money / KOL / whale
okx-dex-signal
(or load
smart-money-signals.md
)
bridge / cross-chain / move tokens between chains
okx-dex-bridge
yield / earn / stake / DeFi
okx-defi-invest
is this token safe / approvals
okx-security
swap / buy / sell
okx-dex-swap
my holdings / portfolio
okx-wallet-portfolio
trading competition / join contest / competition rank
okx-growth-competition
login (free-form, not as a banner reply)this skill's Login Method Choice
named DApp + action verb (Aave / Hyperliquid / etc.)
okx-dapp-discovery
<SHOULD> If the user picks multiple options at once, execute them in order and bookmark unused picks ("we'll come back to 4 after this"). </SHOULD>
若用户输入的内容不是数字选项或
login
,先在自由区回复,然后引导至匹配的技能/工作流:
意图引导至
meme狙击 / pump.fun / 新代币上线
okx-dex-trenches
追踪聪明钱 / KOL / 巨鲸
okx-dex-signal
(或加载
smart-money-signals.md
跨链桥 / 跨链操作 / 在链间转移代币
okx-dex-bridge
收益 / 赚取 / 质押 / DeFi
okx-defi-invest
代币安全性检查 / 授权管理
okx-security
兑换 / 买入 / 卖出
okx-dex-swap
我的资产 / 投资组合
okx-wallet-portfolio
交易竞赛 / 加入赛事 / 竞赛排名
okx-growth-competition
登录(自由格式,非横幅回复)本技能的登录方式选择
指定DApp + 操作动词(Aave / Hyperliquid等)
okx-dapp-discovery
<SHOULD> 若用户同时选择多个选项,按顺序执行并标记未使用的选项("完成此项后我们再处理第4项")。 </SHOULD>

Acceptance Criteria

验收标准

  1. Banner variant matches auth state
    loggedIn: false
    renders the logged-out variant (no addresses, with "login" hint);
    loggedIn: true
    renders the logged-in variant (addresses + balance, no hint).
  2. Skill picks load without login gate — 🔥 / 💰 load even when logged out; each loaded skill handles its own auth.
  3. Workflow picks gate on login — when logged out, 🐋 / 🆕 / ☕ route through Login Method Choice first, then auto-resume the workflow. User should not have to re-state their pick.
  4. Turn budget — ≤ 3 turns end-to-end for a new user; ≤ 2 turns for a returning user picking a workflow + login.
  1. 横幅变体匹配认证状态
    loggedIn: false
    渲染未登录变体(无地址,带"login"提示);
    loggedIn: true
    渲染已登录变体(显示地址+余额,无提示)。
  2. 技能选项无需登录即可加载 — 🔥 / 💰选项即使未登录也可加载;每个加载的技能自行处理认证。
  3. 工作流选项需登录验证 — 未登录时,🐋 / 🆕 / ☕选项先引导至登录方式选择,然后自动恢复工作流。用户无需重新选择。
  4. 交互轮次限制 — 新用户端到端交互≤3轮;返回用户选择工作流+登录≤2轮。

Notes / Non-obvious

注意事项 / 非显性规则

  • Polymarket plugin is not pre-installed. Pick 🔥 routes through
    okx-dapp-discovery
    , which handles plugin install + load. Don't try to load
    web3-polymarket
    directly.
  • Workflow files are runtime resources — at install time they live at
    ~/.onchainos/workflows/
    ; in this repo's source they're under
    workflows/
    .
  • Polymarket插件未预装。选项🔥引导至
    okx-dapp-discovery
    ,由其处理插件安装+加载。请勿尝试直接加载
    web3-polymarket
  • 工作流文件为运行时资源 — 安装时位于
    ~/.onchainos/workflows/
    ;在本仓库源码中位于
    workflows/