@bitget-ai/bitget-agent-skill 3.4.1 → 4.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -5,6 +5,67 @@ All notable changes to `bitget-agent-skill` are documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [4.0.1] - 2026-11-18
9
+
10
+ Corrections from the first days of 4.0.0 in real clients and from the server's
11
+ call logs. Publish after the authorization server with open admission is live:
12
+ the skill no longer tells a client that is not on a list that it is unsupported.
13
+
14
+ ### Fixed
15
+
16
+ - **Account rule.** 4.0.0 said that authorizing another agent for a connected account replaces the previous authorization. The server refuses it instead ("already connected to another agent") and the first client keeps working. `SKILL.md`, `authorization.md`, and `troubleshooting.md` now describe what happens and what the user can do.
17
+ - **Codex: the authorization link did not complete** in remote and headless environments, because the login command had exited by the time the user opened the link. The Codex notes now say to keep `codex mcp login` running, and how to finish the callback when the browser is on another machine.
18
+ - **Codex: the `localhost` callback setting is gone.** It was a workaround for a firewall rule that has been lifted. `codex mcp add` followed by `codex mcp login` is enough; existing `callback_url` settings keep working.
19
+ - **New session after registering.** Claude Code and Codex load a newly registered server at the start of the next session. `first-time-setup.md` said the tools appear right away, and also told Claude Code users to restart; it now says which clients need a new session and what to do before it.
20
+ - **Installer.** An unknown `--target` name stops the run instead of being skipped. An installed copy that differs from the new one is saved to `~/.bitget-agent-skill/backup/` before it is replaced. Old skill folders are reported for every client, not only the ones being installed to.
21
+ - **Publishing.** The publish step validates the skill again instead of skipping the check, the decrypted npm credentials are removed when publishing fails, and the validator compares the version in `VERSION`, `package.json`, `SKILL.md`, and the newest `CHANGELOG.md` entry.
22
+ - **README logo** removed: the image was not in the package and showed as broken on npm.
23
+
24
+ ### Changed
25
+
26
+ - **Any MCP client with OAuth can connect.** The "supported clients" table is now a table of client ids to use where a client lets you set one. A client that is not listed is no longer told it is unsupported.
27
+ - **Writes carry a `note`:** one sentence on why, kept with the record of the call.
28
+
29
+ ### Added
30
+
31
+ - **`outcomeUnknown`.** When the exchange gives no readable answer to a write, the server returns `outcomeUnknown: true` with a `clientOid`. The skill says not to submit again and to look the order up first.
32
+ - **Parameter guidance, from the server call logs.** `SKILL.md` names the two parameters agents got wrong most (`category`, not `productType`; `qty`, not `size`), says which unit `qty` is in, and has the confirmation card show the unit. `troubleshooting.md` gains rows for the errors those mistakes produce (40019 / 400172, 40808, 45110), for 40016 (bind phone or Google first), for `Unknown action` with `suggestions`, and for results marked `retryable`.
33
+ - **Evaluation scenarios** for the spot market-buy unit, a precision error, an unknown outcome, suggestions after an unknown action, an account connected to another client, a headless Codex setup, and a client that is not in the table.
34
+
35
+ ## [4.0.0] - 2026-11-16
36
+
37
+ The local API-key edition is discontinued, and the package is restructured to
38
+ follow the Agent Skills specification (https://agentskills.io/specification).
39
+ It now ships one skill, `bitget-agentic`, for the Bitget cloud MCP
40
+ (`https://agent.bitget.com/mcp`).
41
+
42
+ ### Removed (BREAKING)
43
+ - **UTA skill** (`skills/uta/SKILL.md`, installed as `bitget-agent-skill`) — the skill that drove the `bgc` CLI with `BITGET_API_KEY` environment variables.
44
+ - **`references/`** at the package root — `commands.md`, `discover-guide.md`, `trading-safety.md`, `error-codes.md`, `auth-setup.md`, `demo-trading.md`. All documented the `bgc` path.
45
+ - **`scripts/gen-references.js`**, the `gen-references` script, and the `@bitget-ai/bitget-agent-sdk` dev dependency it needed.
46
+ - **`e2e/`** — the suite exercised only the UTA skill against `bgc`.
47
+ - **`bitget-agentic-connect` as a separate skill.** Its content is now `references/first-time-setup.md` inside `bitget-agentic`. A one-time guide no longer stays loaded in every chat, and the two skills no longer compete for the same requests.
48
+ - **The `--skill` installer flag.** It is still accepted and ignored so that commands in older guides keep working; `--skill uta` prints a notice and exits.
49
+
50
+ ### Changed
51
+ - **Skill layout.** `skills/agentic/` is now `skills/bitget-agentic/`, so the folder matches the skill `name` as the specification requires. `SKILL.md` went from about 6,100 tokens to about 1,700; detail the agent needs only sometimes moved into four reference files that load on demand: `first-time-setup.md`, `authorization.md`, `legacy-migration.md`, `troubleshooting.md`.
52
+ - **Frontmatter is portable.** Only `name`, `description`, `license`, `compatibility`, and `metadata` are used. `metadata` is a flat map of strings; the nested `requires` and `packages` blocks are gone (`requires.bins` listed `node` and `npx`, which are needed to install the skill, not to use it).
53
+ - **Description.** Rewritten in the third person as "what it does, when to use it, when not to", 897 characters against a limit of 1,024 (it was 1,148). It now also covers general Bitget trading, account, and market-data requests, since the cloud MCP is the only supported path. The operational rules it used to carry are in the body.
54
+ - **Content.** Each rule is stated once, with its reason. Sections refer to each other by title, not by number. The skill is in English throughout and uses one term for each thing ("cloud MCP", "Agentic account", "legacy MCP config", "discontinued local tools"). Tools are introduced by their qualified names (`bitget-mcp-server:guide`).
55
+ - **Supported clients** are a table of client, `client_id`, and how it is set. The redirect URIs and server-side flags from the old JSON block were removed; the agent cannot act on them.
56
+ - **Discontinued local tools.** `bgc`, the SDK with API-key environment variables, and the old UTA skill must not be installed, recommended, or run.
57
+ - **"Account list full"** in first-time setup now matches the rest of the skill: delete unused accounts and create a new one; do not pick an account created by the old SDK or npm tools.
58
+ - **Installer.** It copies the whole skill folder, references included, and replaces the folder on each run. New `cursor` target (`~/.cursor/skills`). The `codex` target now installs to `~/.agents/skills`, where current Codex reads user skills, and refreshes an existing copy in `~/.codex/skills`. It reports the obsolete `bitget-agent-skill` and `bitget-agentic-connect` folders without deleting them.
59
+ - **README and `llms.txt`** rewritten for the cloud MCP and the single-skill layout, with an "Upgrading from 3.x" section.
60
+ - Records the switch of the skill to English (2.2.6, 2026-11-10), which had no changelog entry. The skill's own version now follows the package version.
61
+
62
+ ### Added
63
+ - **`scripts/validate-skills.mjs`** (`npm run validate`) — checks `skills/` against the specification: name format and folder match, description length, portable frontmatter fields, flat string metadata, body size, links that resolve, and every reference file linked from `SKILL.md`. The build and `npm publish` run it.
64
+ - **`evals/`** — trigger and behavior scenarios for the skill. There is no bundled runner yet.
65
+
66
+ ### Fixed
67
+ - The installer exits non-zero when any target fails to install.
68
+
8
69
  ## [3.4.1] - 2026-10-30
9
70
 
10
71
  ### Fixed
package/README.md CHANGED
@@ -1,11 +1,7 @@
1
- <p align="center">
2
- <img src="assets/logo.png" alt="Bitget Agent Skill — AI reasoning guide for Claude Code, Codex and terminal crypto trading" width="120" />
3
- </p>
4
-
5
1
  <h1 align="center">bitget-agent-skill — Official Bitget AI Trading Skill</h1>
6
2
 
7
3
  <p align="center">
8
- <strong>Give Claude Code, Codex, and OpenClaw the judgment to understand your trading instructions — when to call Bitget, how to build the right command, and what to do when something goes wrong.</strong>
4
+ <strong>Teach your AI agent to connect the Bitget cloud MCP, authorize a Bitget Agentic account in the browser, and trade or query from natural language — with no API keys on your machine.</strong>
9
5
  </p>
10
6
 
11
7
  <p align="center">
@@ -17,225 +13,216 @@
17
13
 
18
14
  <p align="center">
19
15
  <a href="#quick-start">Quick Start</a> ·
20
- <a href="#what-changes-after-installing">What Changes</a> ·
21
- <a href="#why-a-skill-vs-just-installing-bgc">Why a Skill</a> ·
16
+ <a href="#how-it-works">How It Works</a> ·
22
17
  <a href="#installation">Installation</a> ·
18
+ <a href="#connect-the-cloud-mcp">Connect</a> ·
23
19
  <a href="#security">Security</a> ·
20
+ <a href="#upgrading-from-3x">Upgrading from 3.x</a> ·
24
21
  <a href="#troubleshooting">Troubleshooting</a> ·
25
22
  <a href="#faq">FAQ</a>
26
23
  </p>
27
24
 
28
25
  ---
29
26
 
30
- > **Bitget Agent Hub** is Bitget's official open-source AI Agent ecosystem. This repository is `bitget-agent-skill` — the **skill surface** that teaches terminal AI agents when and how to correctly invoke Bitget tools. Ecosystem packages: [agent-skill](https://github.com/Bitget-AI/agent-skill) (this repo), [agent-cli](https://github.com/Bitget-AI/agent-cli), [agent-mcp](https://github.com/Bitget-AI/agent-mcp), [agent-sdk](https://github.com/Bitget-AI/agent-sdk), [bitget-signal](https://github.com/Bitget-AI/bitget-signal), [agent_hub](https://github.com/Bitget-AI/agent_hub).
27
+ `@bitget-ai/bitget-agent-skill` ships the skill files for the **Bitget cloud MCP** at `https://agent.bitget.com/mcp`. The skill tells your AI agent how to connect that MCP, how to start browser authorization for a Bitget Agentic account, which tools to call, and how to handle writes and failures safely. The files are plain Markdown: no runtime, no API keys, no network access.
31
28
 
32
- `@bitget-ai/bitget-agent-skill` is Bitget's official AI trading skill file, giving Claude Code, Codex, and OpenClaw the judgment to use Bitget tools correctly — knowing when to invoke Bitget, how to break your intent into the right multi-step operations, how to handle confirmation before write actions, and what to do when something goes wrong. Pure markdown, runtime-free.
33
-
34
- **Is this for you?** You're already using Claude Code, Codex, or OpenClaw and want it to actually understand your trading instructions — not just have the tool but lack the reasoning to use it — install this.
29
+ > **4.0.0 removed the local API-key edition.** The `bgc`-based skill, its `references/` docs, and the `BITGET_API_KEY` setup are no longer supported. See [Upgrading from 3.x](#upgrading-from-3x).
35
30
 
36
31
  ---
37
32
 
38
33
  ## Quick Start
39
34
 
40
- Paste the block below into your AI agent — it will handle the entire setup (requires Node.js 20+):
35
+ Paste this into your AI agent (requires Node.js 20+):
41
36
 
42
37
  ```prompt
43
- Please help me install the Bitget trading skill (requires Node.js 20+): 1. Run npx @bitget-ai/bitget-agent-skill --target all to deploy the skill files to my AI tool; 2. Run npm install -g @bitget-ai/bitget-agent-cli to install the bgc CLI globally. Tell me the result when done.
38
+ Please set up Bitget for me: 1. Run npx @bitget-ai/bitget-agent-skill@latest --target all and read the installed SKILL.md; 2. Follow it to connect the MCP https://agent.bitget.com/mcp and open the authorization page. Tell me when it is done.
44
39
  ```
45
40
 
46
- > Both must be installed together: the skill file is the AI's instruction manual, `bgc` is the execution tool — the skill teaches the AI when to call it and how to build commands, `bgc` actually makes the API requests. Without either one, the full flow is incomplete.
41
+ A browser window opens for you to log in to Bitget and approve. You never copy an API key.
47
42
 
48
- **Verify it worked.** Ask your AI: *"What trading modules does Bitget support?"* If it returns the correct module list (market, trade, account, etc.), the skill is loaded and active.
43
+ **Verify it worked.** Ask your AI: *"Show my Bitget Agentic account assets."* If it returns your balances, you are connected.
49
44
 
50
45
  ---
51
46
 
52
- ## What Changes After Installing
47
+ ## How It Works
53
48
 
54
49
  ```mermaid
55
50
  graph LR
56
- A[You<br/>Natural Language] --> B[Claude Code / Codex<br/>with bitget-agent-skill]
57
- B -->|Generates v3 Command| C[bgc CLI<br/>bitget-agent-cli]
58
- C -->|HMAC-SHA256 Signed| D[Bitget REST API]
51
+ A[You<br/>natural language] --> B[AI agent<br/>with this skill]
52
+ B -->|guide / do_query / do_request_open_api| C[Bitget cloud MCP<br/>agent.bitget.com/mcp]
53
+ C --> D[Bitget]
59
54
  style B fill:#28a745,stroke:#333,stroke-width:2px,color:#fff
60
55
  ```
61
56
 
62
- Without the skill, `bgc` executes one command at a time. With the skill loaded, the AI can chain your intent into a sequence of operations across modules — check positions, evaluate conditions, place the order, handle the result — all in one go.
63
-
64
- - **Trigger recognition in English and Chinese**: whether you say "buy BTC at market" or「帮我买 BTC」, the AI recognizes it as a Bitget trading instruction and calls the right tool automatically — no need to specify command syntax
65
- - **v3 grammar and full reference**: the skill file includes the `bgc` v3 grammar (`bgc <tool> --action <name>`) and an auto-generated catalog of every operation — the AI knows which intent verb maps to which operation and how to fill in the parameters
66
- - **Multi-step workflow**: "check my positions, and if I have no BTC open a 10x long" — the AI queries first, reasons, then places the order, showing `[CAUTION]` before every write operation and waiting for your confirmation
67
- - **Paper trading and error handling**: tell the AI "use demo account" to switch to Bitget's sandbox automatically; when API errors occur, the AI knows whether to retry or surface the issue to you — instead of getting stuck
57
+ - **Three tools.** The MCP exposes `guide` (find what is available), `do_query` (market and reference data), and `do_request_open_api` (trading and account actions).
58
+ - **Market data needs no login.** Trading, account, and Reality / rToken actions need you to authorize once in the browser.
59
+ - **Login is an OAuth token held by your AI client's MCP connection.** It is not an API key, and it is not written into the skill files.
60
+ - **Writes are previewed first.** The skill has the AI preview a write with `dry_run`, show you a confirmation card, and only execute after you agree. High-risk actions such as cancel-all, close-all, set leverage, and repay also require an explicit `confirm` on the server. When the exchange gives no answer to a write, the AI is told not to retry and to check whether the order exists.
61
+ - **Out of scope by design.** Withdrawals, transfers between main account and sub-account, and main-account security settings are not available through the MCP.
68
62
 
69
63
  ---
70
64
 
71
- ## Why a Skill (vs. just installing `bgc`)
72
-
73
- The CLI alone gives the AI 14 intent verbs over the Unified Trading Account (89 operations) but no semantics — the assistant doesn't know **when** to reach for Bitget, **which** verb to use, or **how** to drive it safely.
65
+ ## What Ships in the Package
74
66
 
75
- The skill adds:
76
-
77
- - A **trigger description** so Claude Code / Codex / OpenClaw automatically invokes the skill on any Bitget-relevant request — including casual phrasings (*"buy 0.1 BTC at market"*) and Chinese (*"查看我的持仓"*).
78
- - The **v3 grammar** (`bgc <tool> --action <name> --<param> <value>`) and a **discover-first** workflow, plus a complete catalog of every verb, action, and parameter.
79
- - **Operational guidance** for write-safety (`--dry-run` / `--confirm`), close-direction rules, demo trading, error categories, and auth setup.
80
-
81
- Result: you say *"buy 0.1 BTC at market on Bitget"* and it actually works — the assistant composes `bgc order --action place --category SPOT --symbol BTCUSDT --side buy --orderType market --qty 0.1`, previews it with `--dry-run`, confirms with you, then runs it.
82
-
83
- ---
84
-
85
- ## What Ships in the Skill
67
+ One skill, `bitget-agentic`, following the [Agent Skills](https://agentskills.io) format. The agent loads `SKILL.md` when a request matches and opens a reference file only when it needs one.
86
68
 
87
69
  | File | Purpose |
88
70
  |---|---|
89
- | `SKILL.md` | Top-level skill definition with trigger phrases (English + Chinese) so the AI knows when to invoke, plus the v3 grammar, the 14-verb map, and the write-safety workflow. |
90
- | `references/commands.md` | Auto-generated static catalog — every domain, verb, action, and parameter (with enums + descriptions), from the SDK's own `discover` surface. |
91
- | `references/discover-guide.md` | How to navigate the live surface with `bgc discover` (the four rungs, search, `raw`). |
92
- | `references/trading-safety.md` | Close-direction rules (one-way/hedge), TP/SL, `qty` units, cancel-all, and withdrawal safety. |
93
- | `references/auth-setup.md` | How to create a Bitget API key and configure environment variables. |
94
- | `references/demo-trading.md` | How to use `--paper-trading` for safe rehearsal. |
95
- | `references/error-codes.md` | The v3 error payload, category-driven recovery, and the curated Bitget code table. |
71
+ | `SKILL.md` | The three tools, where to start, the `guide` → execute workflow, write safety, and account rules. |
72
+ | `references/first-time-setup.md` | Install the skill, register the MCP in each client, and check that the tools are available. |
73
+ | `references/authorization.md` | Opening authorization in each client, client ids, Codex notes, network and proxy. |
74
+ | `references/legacy-migration.md` | Detecting an old local Bitget MCP setup and what to tell the user. |
75
+ | `references/troubleshooting.md` | A failure table, and how to remove an old account. |
96
76
 
97
77
  ---
98
78
 
99
79
  ## Installation
100
80
 
101
- ### Step 1: Install the CLI
102
-
103
- ```bash
104
- npm install -g @bitget-ai/bitget-agent-cli
105
- ```
106
-
107
- > Why `-g`? `bgc` is a persistent CLI your AI calls dozens of times per session — it must be on `$PATH`. This skill, by contrast, is a one-shot deploy: `npx` copies markdown into your AI tool's skill directory and exits. `npx` always pulls the latest version, so subsequent runs auto-upgrade you.
108
-
109
- ### Step 2: Deploy the Skill File
110
-
111
81
  ```bash
112
82
  # Default — Claude Code only
113
- npx @bitget-ai/bitget-agent-skill
83
+ npx @bitget-ai/bitget-agent-skill@latest
114
84
 
115
85
  # All supported AI tools
116
- npx @bitget-ai/bitget-agent-skill --target all
86
+ npx @bitget-ai/bitget-agent-skill@latest --target all
87
+
88
+ # Specific tools
89
+ npx @bitget-ai/bitget-agent-skill@latest --target codex,cursor
117
90
 
118
91
  # Choose interactively
119
- npx @bitget-ai/bitget-agent-skill --interactive
92
+ npx @bitget-ai/bitget-agent-skill@latest --interactive
120
93
  ```
121
94
 
122
- `--target all` deploys to Claude Code, Codex, and OpenClaw simultaneously.
95
+ `--target` accepts `claude`, `codex`, `cursor`, `openclaw`, a comma-separated list, or `all`.
123
96
 
124
97
  | Target | Skill location |
125
98
  |---|---|
126
- | Claude Code | `~/.claude/skills/bitget-agent-skill/` |
127
- | Codex | `~/.codex/skills/bitget-agent-skill/` |
128
- | OpenClaw | `~/.openclaw/skills/bitget-agent-skill/` |
99
+ | Claude Code | `~/.claude/skills/bitget-agentic/` |
100
+ | Codex | `~/.agents/skills/bitget-agentic/` |
101
+ | Cursor | `~/.cursor/skills/bitget-agentic/` |
102
+ | OpenClaw | `~/.openclaw/skills/bitget-agentic/` |
103
+
104
+ The installer replaces the whole `bitget-agentic` folder on each run. When the installed copy differs from the new one, the old copy is saved to `~/.bitget-agent-skill/backup/` first, and the path is printed. If an earlier version left a copy in `~/.codex/skills/`, it refreshes that copy too. An unknown `--target` name stops the installer before anything is written. `--skill` from older guides is still accepted and ignored.
105
+
106
+ For an AI client without a skills directory, ask the agent to run the installer and read the `SKILL.md` path it prints.
107
+
108
+ ---
109
+
110
+ ## Connect the Cloud MCP
129
111
 
130
- ### Step 3: Set Up Credentials
112
+ There is one address: `https://agent.bitget.com/mcp`. Your AI agent normally does this step for you by following the skill.
113
+
114
+ **Claude Code**
131
115
 
132
116
  ```bash
133
- export BITGET_API_KEY="your-api-key"
134
- export BITGET_SECRET_KEY="your-secret-key"
135
- export BITGET_PASSPHRASE="your-passphrase"
117
+ claude mcp add -s user bitget-mcp-server --transport http https://agent.bitget.com/mcp
118
+ ```
119
+
120
+ **Cursor** — merge into `~/.cursor/mcp.json`:
121
+
122
+ ```json
123
+ {
124
+ "mcpServers": {
125
+ "bitget-mcp-server": {
126
+ "url": "https://agent.bitget.com/mcp",
127
+ "auth": { "CLIENT_ID": "cursor" }
128
+ }
129
+ }
130
+ }
136
131
  ```
137
132
 
138
- [Create an API key](https://www.bitget.com/api-doc/common/intro) if you don't have one. For demo trading, use a [Demo API Key](https://www.bitget.com/account/demo) instead:
133
+ **Codex** (0.147 or later)
139
134
 
140
135
  ```bash
141
- export BITGET_DEMO_API_KEY="your-demo-key"
142
- export BITGET_DEMO_SECRET_KEY="your-demo-secret"
143
- export BITGET_DEMO_PASSPHRASE="your-demo-passphrase"
136
+ codex mcp add bitget-mcp-server --url https://agent.bitget.com/mcp --oauth-client-id codex
137
+ codex mcp login bitget-mcp-server
144
138
  ```
145
139
 
146
- ### Step 4: Restart and Verify
147
-
148
- Close and reopen your AI tool, then ask: *"What Bitget trading capabilities do you have?"*
140
+ Any client that supports MCP with OAuth can connect. `references/authorization.md` inside the skill lists the client ids to use where a client lets you set one. In Codex, keep `codex mcp login` running until you have finished in the browser, and start a new session afterwards.
149
141
 
150
142
  ---
151
143
 
152
- ## Related Tools
144
+ ## Security
153
145
 
154
- | Tool | Relationship |
155
- |---|---|
156
- | [`@bitget-ai/bitget-agent-cli`](https://github.com/Bitget-AI/agent-cli) | Must be installed together: `bgc` is the execution tool, the skill file is the AI's instruction manual — neither works without the other |
157
- | [`@bitget-ai/bitget-agent-mcp`](https://github.com/Bitget-AI/agent-mcp) | Alternative for desktop AI (Claude Desktop, Cursor) — no `bgc` required |
158
- | [`@bitget-ai/bitget-signal`](https://github.com/Bitget-AI/bitget-signal) | Market analysis skills — no API key needed. This skill handles trading execution; `bitget-signal` handles market analysis. Complementary, can be installed side by side |
146
+ - **No API keys on your machine.** You approve access in the browser; the skill never asks you to create, paste, or store a key.
147
+ - **The skill files are inert.** Plain Markdown with no runtime process and no network access.
148
+ - **Scoped to an Agentic sub-account.** Withdrawals and main ↔ sub-account transfers are not exposed to the agent.
149
+ - **You can revoke at any time.** On the Bitget website go to "Sub-account management" → "Disconnect Agent". Clear open orders first. This ends every login on that account.
159
150
 
160
151
  ---
161
152
 
162
- ## Security
153
+ ## Upgrading from 3.x
154
+
155
+ Versions up to 3.4.1 also shipped a local edition that drove the `bgc` CLI with `BITGET_API_KEY` environment variables. That edition is discontinued and was removed in 4.0.0.
163
156
 
164
- The skill files themselves:
165
- - No API key required — pure Markdown
166
- - No network access — no runtime process
167
- - No credential storage — keys are passed via environment variables to `bgc`
157
+ 1. Install the current skill: `npx @bitget-ai/bitget-agent-skill@latest --target all`.
158
+ 2. Remove the old skill directories. The installer prints their paths if it finds them: `bitget-agent-skill/` (the local API-key skill) and `bitget-agentic-connect/` (the first-time guide, now part of `bitget-agentic`) under `~/.claude/skills/`, `~/.codex/skills/`, and `~/.openclaw/skills/`.
159
+ 3. Remove `BITGET_API_KEY`, `BITGET_SECRET_KEY`, and `BITGET_PASSPHRASE` from your shell profile, and remove any local Bitget MCP entry from your AI client's MCP config, including the old `@bitget-ai/bitget-agent-mcp` stdio server.
160
+ 4. Connect the cloud MCP as above and authorize.
168
161
 
169
- All actual API calls go through `bgc`, which provides:
170
- - Credentials live only in environment variables (no `.env` file parsing)
171
- - `--read-only` strips all write tools
172
- - `--paper-trading` switches to the demo environment
173
- - Local HMAC-SHA256 request signing
162
+ When you authorize for the first time, create a **new** Agentic account. Accounts created by the old SDK or npm tools cannot be selected on the new authorization page.
174
163
 
175
164
  ---
176
165
 
177
166
  ## Troubleshooting
178
167
 
179
- ### "Skill not recognized by AI"
180
-
181
- **Cause:** Skill file not deployed or AI tool not restarted.
168
+ ### The AI does not seem to know the skill
182
169
 
183
- **Fix:**
184
- 1. Re-deploy: `npx @bitget-ai/bitget-agent-skill --target all`
185
- 2. Restart your AI tool completely
186
- 3. Verify: ask *"What Bitget trading modules are available?"*
170
+ Re-run the installer, then restart your AI tool. Check that `SKILL.md` exists in the location shown in [Installation](#installation).
187
171
 
188
- ### "AI has bgc but doesn't understand trading commands"
172
+ ### The AI cannot see `guide`, `do_query`, or `do_request_open_api`
189
173
 
190
- **Cause:** The skill file is missing — `bgc` is installed but the AI has no instruction manual.
191
-
192
- **Fix:** Deploy the skill and verify the files landed in the correct location:
193
-
194
- | AI Tool | Expected Location |
195
- |---|---|
196
- | Claude Code | `~/.claude/skills/bitget-agent-skill/SKILL.md` |
197
- | Codex | `~/.codex/skills/bitget-agent-skill/SKILL.md` |
198
- | OpenClaw | `~/.openclaw/skills/bitget-agent-skill/SKILL.md` |
174
+ The MCP is not registered in this client, or an old local Bitget MCP is still in the config and shadows the new one. Register the address as in [Connect the Cloud MCP](#connect-the-cloud-mcp) and remove the old entry.
199
175
 
200
- ### "bgc: command not found"
176
+ ### Authorization finishes but the AI still says it is not logged in
201
177
 
202
- **Cause:** `bitget-agent-cli` not installed or not on `$PATH`.
178
+ Ask the AI to run a read-only account call such as `getAccountAssets`. In Cursor, check that `auth.CLIENT_ID` is exactly `cursor`. If the authorization page cannot reach bitget.com, turn on your proxy and try again.
203
179
 
204
- **Fix:** `npm install -g @bitget-ai/bitget-agent-cli` then restart your terminal.
180
+ `references/troubleshooting.md` in the skill contains the full failure table the AI follows.
205
181
 
206
182
  ---
207
183
 
208
184
  ## Updates
209
185
 
210
186
  ```bash
211
- # Update all Bitget AI packages
212
- npx @bitget-ai/bitget-agent-installer upgrade-all --target all
213
-
214
- # Or update just this skill
215
- npx @bitget-ai/bitget-agent-skill@latest
187
+ npx @bitget-ai/bitget-agent-skill@latest --target all
216
188
  ```
217
189
 
218
190
  ---
219
191
 
220
192
  ## FAQ
221
193
 
222
- **Will the AI automatically place orders after the skill is installed?**
223
- No. For write operations like placing orders or transferring funds, the AI displays a `[CAUTION]` annotation and waits for your confirmation before executing.
194
+ **Will the AI place orders on its own after I install this?**
195
+ The skill instructs the AI to preview every write, show you a confirmation card, and wait for your clear "yes" before executing.
196
+
197
+ **Do I need an API key?**
198
+ No. Access is granted through browser authorization and can be revoked on the Bitget website.
224
199
 
225
- **How do I trade without real money?**
226
- Tell your AI "use demo account" or "use paper trading" — it will switch to Bitget's Demo Trading environment automatically. Requires a [Demo API Key](https://www.bitget.com/account/demo).
200
+ **Does the skill file need network access?**
201
+ No. It is Markdown. All requests are made by your AI client to the cloud MCP.
227
202
 
228
- **What's the difference between this and the MCP server?**
229
- Terminal AI (Claude Code, Codex) → install `bitget-agent-skill` + `bgc`. Desktop AI (Claude Desktop, Cursor) → install `bitget-agent-mcp`. Both enable natural language Bitget trading — they adapt to different AI environments.
203
+ **Can I connect two AI clients to the same Agentic account?**
204
+ Not two different clients. An account is connected to one client at a time, and a second client is refused until you disconnect the first on the Bitget website. Give each client its own Agentic account.
230
205
 
231
- **Does the skill file require an API key or network access?**
232
- No. Pure Markdown files with no runtime process. All API calls happen at execution time through `bgc`.
206
+ **Can I still use `bgc` and the local API-key skill?**
207
+ No. That edition is no longer supported. See [Upgrading from 3.x](#upgrading-from-3x).
233
208
 
234
209
  **Is it free?**
235
210
  MIT-licensed and free to use.
236
211
 
237
212
  ---
238
213
 
214
+ ## Developing the Skill
215
+
216
+ ```bash
217
+ npm run validate
218
+ ```
219
+
220
+ checks `skills/` against the Agent Skills specification: the name matches its folder, the description is within 1,024 characters, the frontmatter uses only portable fields, the body stays under the size limits, every reference file is linked from `SKILL.md`, and the version is the same in `VERSION`, `package.json`, `SKILL.md`, and the newest `CHANGELOG.md` entry. The build and the publish step run the same check.
221
+
222
+ `evals/` holds the scenarios the skill is expected to handle. Run them before and after changing the skill.
223
+
224
+ ---
225
+
239
226
  ## Contributing
240
227
 
241
228
  - **Bug reports & feature requests:** [GitHub Issues](https://github.com/Bitget-AI/agent-skill/issues)
@@ -250,6 +237,5 @@ MIT-licensed and free to use.
250
237
 
251
238
  ---
252
239
 
253
- <sub>Part of the **[Bitget Agent Hub](https://github.com/Bitget-AI/agent_hub)** ecosystem — the official open-source AI Agent ecosystem from Bitget.<br/>
254
- Trading Stack · Skill Surface. ⚠️ Trading cryptocurrency carries risk; you are responsible for any orders your AI agent places. Use demo account to practice safely before trading with real funds.<br/>
255
- Foundation: [agent-sdk](https://github.com/Bitget-AI/agent-sdk) · Execution: [agent-cli](https://github.com/Bitget-AI/agent-cli) · Desktop: [agent-mcp](https://github.com/Bitget-AI/agent-mcp) · Market signals: [bitget-signal](https://github.com/Bitget-AI/bitget-signal)</sub>
240
+ <sub>Part of the **[Bitget Agent Hub](https://github.com/Bitget-AI/agent_hub)** ecosystem.<br/>
241
+ ⚠️ Trading cryptocurrency carries risk; you are responsible for any orders your AI agent places.</sub>
package/VERSION CHANGED
@@ -1 +1 @@
1
- 3.4.1
1
+ 4.0.1
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@bitget-ai/bitget-agent-skill",
3
- "version": "3.4.1",
3
+ "version": "4.0.1",
4
4
  "packageManager": "pnpm@8.14.1",
5
- "description": "Official Bitget AI skill — teaches Claude Code, Codex, and OpenClaw when and how to drive the Bitget Unified Trading Account (UTA / v3) API through the `bgc` CLI from natural language. Run `npx @bitget-ai/bitget-agent-skill` to deploy into your AI tool's skill directory.",
5
+ "description": "Official Bitget AI skill — teaches Claude Code, Codex, Cursor, OpenClaw and other AI agents to connect the Bitget cloud MCP (https://agent.bitget.com/mcp), authorize a Bitget Agentic account with browser OAuth, and trade or query from natural language. No local API keys. Run `npx @bitget-ai/bitget-agent-skill` to deploy into your AI tool's skill directory.",
6
6
  "type": "module",
7
7
  "license": "MIT",
8
8
  "bin": {
@@ -10,7 +10,6 @@
10
10
  },
11
11
  "files": [
12
12
  "skills",
13
- "references",
14
13
  "scripts",
15
14
  "CHANGELOG.md",
16
15
  "README.md",
@@ -18,11 +17,9 @@
18
17
  "VERSION"
19
18
  ],
20
19
  "scripts": {
21
- "gen-references": "node scripts/gen-references.js",
22
20
  "install-skill": "node scripts/install.js",
23
- "e2e:real": "node e2e/run.mjs",
24
- "e2e:agent": "node e2e/agent/run.mjs",
25
- "prepublishOnly": "node scripts/gen-references.js"
21
+ "validate": "node scripts/validate-skills.mjs",
22
+ "prepublishOnly": "node scripts/validate-skills.mjs"
26
23
  },
27
24
  "engines": {
28
25
  "node": ">=20.0.0"
@@ -37,13 +34,12 @@
37
34
  "trading",
38
35
  "crypto",
39
36
  "ai-agent",
40
- "natural-language"
37
+ "natural-language",
38
+ "mcp",
39
+ "oauth"
41
40
  ],
42
41
  "publishConfig": {
43
42
  "access": "public",
44
43
  "registry": "https://registry.npmjs.org/"
45
- },
46
- "devDependencies": {
47
- "@bitget-ai/bitget-agent-sdk": "^3.0.0"
48
44
  }
49
45
  }