/shioaji
Use for Shioaji, SJ, SinoPac (永豐金), Taiwan market trading/API tasks, or broad order/trading requests where Shioaji may apply. Covers Python sync/async bindings, `shioaji` CLI, HTTP API, SSE streaming, dashboard embedding, and JS/TS, Go, C/C++, C#, Rust, Java/Kotlin HTTP clients.
$ npx -y skills add Sinotrade/Shioaji --skill shioaji --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
- Fires itselfAuto-invocation. Claude auto-loads it when your prompt matches the work.Auto-invocation is when the right skill fires by itself at the right moment, driven by a FLOW.md router and a hook, instead of you invoking it by name. It is the difference between a skill being installed and a skill actually getting used.Read the full definition →
- You can call itInvoke it directly when you want it.
- Slash command
/shioaji
Context preview
The summary Claude sees to decide when to auto-load this skill.
Use for Shioaji, SJ, SinoPac (永豐金), Taiwan market trading/API tasks, or broad order/trading requests where Shioaji may apply. Covers Python sync/async bindings, `shioaji` CLI, HTTP API, SSE streaming, dashboard embedding, and JS/TS, Go, C/C++, C#, Rust, Java/Kotlin HTTP clients.
SKILL.md
shioaji.SKILL.mdname: shioaji
description: |
Use for Shioaji, SJ, SinoPac (永豐金), Taiwan market trading/API tasks, or
broad order/trading requests where Shioaji may apply. Covers Python sync/async
bindings, `shioaji` CLI, HTTP API, SSE streaming, dashboard embedding, and
JS/TS, Go, C/C++, C#, Rust, Java/Kotlin HTTP clients. Covers TWSE/TPEX/TAIFEX
orders, quotes, market data, accounts, watchlists, reserve orders, setup,
migration, and troubleshooting. Trigger keywords include shioaji, sj, sinopac,
永豐金, 台股, 下單, 交易, 即時行情, shioaji server, and SSE streaming.
For first-time users, start with account/API onboarding gates before local
installation or code. Not for US/HK markets or generic indicators unless
paired with Shioaji data.
Shioaji Trading API
Shioaji is SinoPac's **cross-language, cross-platform** trading API for Taiwan financial markets (TWSE/TPEX/TAIFEX). It includes Python bindings, a CLI, and an HTTP API server that lets **any programming language** trade Taiwan markets.
Shioaji 是永豐金證券的**跨語言、跨平台**交易 API,提供 Python 綁定、CLI 與 HTTP API 伺服器,讓**任何程式語言**都能透過 HTTP API 交易台灣市場。
Three access layers / 三種存取層:
- **Python** — native PyO3 binding (`import shioaji`) for best performance, sync and async
- **CLI** — `shioaji` command-line tool for server management, trading, and data queries
- **HTTP API + SSE** — REST endpoints + real-time streaming at `localhost:8080`, accessible from JS/TS, Go, C/C++, C#, Rust, Java/Kotlin, or any HTTP client
> **Reasoning about connections, timeouts, processes, or state? Read [CONCEPTS.md](references/CONCEPTS.md) first.** It is the shared mental model these three layers assume — which timeout applies on which path, why Python needs no server but CLI/HTTP share one daemon, the per-person connection cap, streaming vs request-reply. Answer those questions from CONCEPTS.md instead of guessing. > **推理連線、逾時、行程或狀態時,先讀 [CONCEPTS.md](references/CONCEPTS.md)。** 這是三個存取層共用的心智模型 — 哪個 timeout 在哪條路徑生效、為何 Python 不需 server 而 CLI/HTTP 共用一個 daemon、每人連線上限、串流 vs 請求-回覆。這類問題從 CONCEPTS.md 找答案,不要猜。
How to Use References / 如何使用參考文件
Answer users directly from the bundled references. Do not route users to external documentation pages as a substitute for answering. This skill uses Shioaji 1.5 as the baseline; use [MIGRATION.md](references/MIGRATION.md) only for legacy/deprecated idioms. Response handling always belongs in the matching functional reference. When an exact command flag, request field, or response schema must be confirmed, use installed CLI `--help` or the running server's `/openapi.json`.
**First-time-user response / 首次使用者回應:**
- Use this path only when the user says or clearly implies they have not used Shioaji before, are using it for the first time, do not know how to start, or may not have completed SinoPac API onboarding. Do not treat every broad "I want to use Shioaji" request as first-time by default.
- For confirmed/likely first-time users, load [PREPARE.md](references/PREPARE.md). Treat the first response as an eligibility/onboarding conversation, because they may not even have a SinoPac account or API access yet.
- In a confirmed/likely first-time context, if the user says "walk me through", "step by step", "一步一步帶我", "慢慢來", or similar, continue the onboarding sequence from the first unconfirmed external gate. Do not reinterpret that as permission to inspect the workspace or create a local starter project.
- Before the user answers the first onboarding question, do not run commands, inspect files, mention Python versions, mention existing projects, or discuss local environments. The first step is not "check the folder"; it is "check whether the user can open/use SinoPac API at all."
- The first substantive response must check the basic gates before any technical setup: SinoPac securities/futures account, desired market access (stock / futures-options / both), API key/secret, direct API agreement signing, simulation login/order test, CA for production, and production-readiness check.
- Onboarding order matters: after account opening, confirm/create API Key and Secret Key at `https://www.sinotrade.com.tw/newweb/PythonAPIKey/`; signing pages do not issue API keys. After signing, do not jump straight to CA; confirm API credentials and run the required simulation login/order tests first. CA download is from the API management page, not the signing pages.
- When presenting onboarding steps as a table/list, write the explicit correct URL for each web step. Never use the generic SinoPac home page as the account-opening URL. Open account uses `https://www.sinotrade.com.tw/openact?strProd=0254&strWeb=0684&s=013299&utm_source=shioaji`; API Key and CA use `https://www.sinotrade.com.tw/newweb/PythonAPIKey/`; stock signing uses `https://www.sinotrade.com.tw/newweb/signCenter/S_openAPI/`; futures/options signing uses `https://www.sinotrade.com.tw/newweb/signCenter/F_openApi/`. Never write "same page"/"同上頁面" for API Key or CA when the previous row is a signing page.
- Never describe the stock/futures signing pages as places to apply for API Key / Secret Key. Those pages are only for agreement signing; key creation happens only on the API management page.
- Never ask the user to paste API Key, Secret Key, CA password, or certificate contents into chat, even "temporarily" or "for this conversation". Ask them to save/edit secrets locally instead.
- Do **not** move into installation, project setup, `.env`, `.venv`, `uv sync`, code examples, local file inspection, or order examples until the user confirms the relevant onboarding gates are done or explicitly asks for that technical step.
- For a confirmed/likely first-time user, use this first-response shape and stop there until they answer: "可以,我們一步一步來。Shioaji 不是只安裝套件就能用,前面要先確認永豐帳戶與 API 開通狀態。第一步先確認:你目前已經有永豐證券或期貨帳戶嗎?你想開通的是證券、期貨/選擇權,還是兩者都要?"
- For signing, give the direct product page, not the generic signing center: stock <https://www.sinotrade.com.tw/newweb/signCenter/S_openAPI/>; futures/options <https://www.sinot
Read more
name: shioaji description: | Use for Shioaji, SJ, SinoPac (永豐金), Taiwan market trading/API tasks, or broad order/trading requests where Shioaji may apply. Covers Python sync/async bindings, `shioaji` CLI, HTTP API, SSE streaming, dashboard embedding, and JS/TS, Go, C/C++, C#, Rust, Java/Kotlin HTTP clients. Covers TWSE/TPEX/TAIFEX orders, quotes, market data, accounts, watchlists, reserve orders, setup, migration, and troubleshooting. Trigger keywords include shioaji, sj, sinopac, 永豐金, 台股, 下單, 交易, 即時行情, shioaji server, and SSE streaming. For first-time users, start with account/API onboarding gates before local installation or code. Not for US/HK markets or generic indicators unless paired with Shioaji data.
Shioaji Trading API
Shioaji is SinoPac's **cross-language, cross-platform** trading API for Taiwan financial markets (TWSE/TPEX/TAIFEX). It includes Python bindings, a CLI, and an HTTP API server that lets **any programming language** trade Taiwan markets.
Shioaji 是永豐金證券的**跨語言、跨平台**交易 API,提供 Python 綁定、CLI 與 HTTP API 伺服器,讓**任何程式語言**都能透過 HTTP API 交易台灣市場。
Three access layers / 三種存取層:
- **Python** — native PyO3 binding (`import shioaji`) for best performance, sync and async
- **CLI** — `shioaji` command-line tool for server management, trading, and data queries
- **HTTP API + SSE** — REST endpoints + real-time streaming at `localhost:8080`, accessible from JS/TS, Go, C/C++, C#, Rust, Java/Kotlin, or any HTTP client
> **Reasoning about connections, timeouts, processes, or state? Read [CONCEPTS.md](references/CONCEPTS.md) first.** It is the shared mental model these three layers assume — which timeout applies on which path, why Python needs no server but CLI/HTTP share one daemon, the per-person connection cap, streaming vs request-reply. Answer those questions from CONCEPTS.md instead of guessing. > **推理連線、逾時、行程或狀態時,先讀 [CONCEPTS.md](references/CONCEPTS.md)。** 這是三個存取層共用的心智模型 — 哪個 timeout 在哪條路徑生效、為何 Python 不需 server 而 CLI/HTTP 共用一個 daemon、每人連線上限、串流 vs 請求-回覆。這類問題從 CONCEPTS.md 找答案,不要猜。
How to Use References / 如何使用參考文件
Answer users directly from the bundled references. Do not route users to external documentation pages as a substitute for answering. This skill uses Shioaji 1.5 as the baseline; use [MIGRATION.md](references/MIGRATION.md) only for legacy/deprecated idioms. Response handling always belongs in the matching functional reference. When an exact command flag, request field, or response schema must be confirmed, use installed CLI `--help` or the running server's `/openapi.json`.
**First-time-user response / 首次使用者回應:**
- Use this path only when the user says or clearly implies they have not used Shioaji before, are using it for the first time, do not know how to start, or may not have completed SinoPac API onboarding. Do not treat every broad "I want to use Shioaji" request as first-time by default.
- For confirmed/likely first-time users, load [PREPARE.md](references/PREPARE.md). Treat the first response as an eligibility/onboarding conversation, because they may not even have a SinoPac account or API access yet.
- In a confirmed/likely first-time context, if the user says "walk me through", "step by step", "一步一步帶我", "慢慢來", or similar, continue the onboarding sequence from the first unconfirmed external gate. Do not reinterpret that as permission to inspect the workspace or create a local starter project.
- Before the user answers the first onboarding question, do not run commands, inspect files, mention Python versions, mention existing projects, or discuss local environments. The first step is not "check the folder"; it is "check whether the user can open/use SinoPac API at all."
- The first substantive response must check the basic gates before any technical setup: SinoPac securities/futures account, desired market access (stock / futures-options / both), API key/secret, direct API agreement signing, simulation login/order test, CA for production, and production-readiness check.
- Onboarding order matters: after account opening, confirm/create API Key and Secret Key at `https://www.sinotrade.com.tw/newweb/PythonAPIKey/`; signing pages do not issue API keys. After signing, do not jump straight to CA; confirm API credentials and run the required simulation login/order tests first. CA download is from the API management page, not the signing pages.
- When presenting onboarding steps as a table/list, write the explicit correct URL for each web step. Never use the generic SinoPac home page as the account-opening URL. Open account uses `https://www.sinotrade.com.tw/openact?strProd=0254&strWeb=0684&s=013299&utm_source=shioaji`; API Key and CA use `https://www.sinotrade.com.tw/newweb/PythonAPIKey/`; stock signing uses `https://www.sinotrade.com.tw/newweb/signCenter/S_openAPI/`; futures/options signing uses `https://www.sinotrade.com.tw/newweb/signCenter/F_openApi/`. Never write "same page"/"同上頁面" for API Key or CA when the previous row is a signing page.
- Never describe the stock/futures signing pages as places to apply for API Key / Secret Key. Those pages are only for agreement signing; key creation happens only on the API management page.
- Never ask the user to paste API Key, Secret Key, CA password, or certificate contents into chat, even "temporarily" or "for this conversation". Ask them to save/edit secrets locally instead.
- Do **not** move into installation, project setup, `.env`, `.venv`, `uv sync`, code examples, local file inspection, or order examples until the user confirms the relevant onboarding gates are done or explicitly asks for that technical step.
- For a confirmed/likely first-time user, use this first-response shape and stop there until they answer: "可以,我們一步一步來。Shioaji 不是只安裝套件就能用,前面要先確認永豐帳戶與 API 開通狀態。第一步先確認:你目前已經有永豐證券或期貨帳戶嗎?你想開通的是證券、期貨/選擇權,還是兩者都要?"
- For signing, give the direct product page, not the generic signing center: stock <https://www.sinotrade.com.tw/newweb/signCenter/S_openAPI/>; futures/options <https://www.sinot
Shioaji is a trading API provided by Sinopac that offers a comprehensive and user-friendly platform for accessing the Taiwan financial markets.
Repo: Sinotrade/Shioaji

