Agent skill

Shioaji

by nicepkg in nicepkg/ai-workflow

Shioaji Taiwan financial trading API guide. An agent skill from nicepkg/ai-workflow.

MITAuto-check passedBusiness, Finance & HR

Install Shioaji

skills CLI
$ npx skills add nicepkg/ai-workflow --skill shioaji -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install nicepkg/ai-workflow shioaji --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/nicepkg/ai-workflow.git skills-src && mkdir -p .claude/skills && cp -r skills-src/workflows/stock-trader-workflow/.claude/skills/shioaji .claude/skills/shioaji && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
shioaji
GitHub stars
285
Token cost
~1.5k tokens
SKILL.md length
254 words
Files
10
Skills in repo
75
Repo updated
First seen
Licence
MIT

At a glance

Shioaji Taiwan financial trading API guide. An agent skill from nicepkg/ai-workflow.

  • Trading stocks/futures/options on Taiwan markets
  • SKILL.md covers Navigation 功能導覽, Quick Start 快速入門, Common Constants 常用常數 and Account Objects 帳戶物件, plus 4 more sections
  • Calls uv, pip and docker
  • Subscribing to real-time market data

What it does

Shioaji is an agent skill from nicepkg/ai-workflow. Shioaji Taiwan financial trading API guide. Use when trading stocks/futures/options on Taiwan markets, subscribing to real-time market data, querying account info, or building automated trading systems. Shioaji 台灣金融交易 API 指南。適用於:股票/期貨/選擇權交易、即時行情訂閱、帳務查詢、自動交易系統開發。

Its SKILL.md is about 1.5k tokens, which your agent loads only when the skill is triggered. The skill folder holds 9 other files (for example `ACCOUNTING.md`, `ADVANCED.md` and `CONTRACTS.md`).

It sits in Business, Finance & HR, covering Stock and market analysis and Trading and backtesting. The repository describes itself as: 🚀 170+ pre-built skills for Claude Code, Cursor, Codex & 14+ AI tools. Stop re-teaching your AI the same things. One command → instant domain expertise. Marketing, SEO, Trading… The licence is MIT.

When your agent uses it

  • Trading stocks/futures/options on Taiwan markets
  • Subscribing to real-time market data
  • Querying account info
  • Building automated trading systems

Example prompts

  • “/shioaji”

Requirements

  • Python 3
  • Docker
  • A credential in YOUR_API_KEY
  • A credential in YOUR_SECRET_KEY

What it can do on your machine

Read from SKILL.md and the folder at commit d167b41. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Shell commands in SKILL.md call:

    • uv
    • pip
    • docker

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Links to these hosts (documentation or services it may open):

    • sinotrade.github.io

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Shioaji loads about 1.5k tokens when it runs. Until then it costs about 68 tokens; SKILL.md has 254 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~68
When it runs · the whole SKILL.md, loaded when a task matches
~1.5k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from nicepkg/ai-workflow at commit d167b41, republished under its MIT licence (© nicepkg). 254 words, ~1,514 tokens.

Download SKILL.mdSave it as .claude/skills/shioaji/SKILL.md (or your agent's skills folder). This skill also uses 9 other files; get the full folder from GitHub.
name
shioaji
description
Shioaji Taiwan financial trading API guide. Use when trading stocks/futures/options on Taiwan markets, subscribing to real-time market data, querying account info, or building automated trading systems. Shioaji 台灣金融交易 API 指南。適用於:股票/期貨/選擇權交易、即時行情訂閱、帳務查詢、自動交易系統開發。

Shioaji Trading API

Shioaji is SinoPac's Python API for trading Taiwan financial markets (stocks, futures, options). Shioaji 是永豐金證券提供的 Python 交易 API,支援台灣股票、期貨、選擇權市場。

Official Docs 官方文檔: https://sinotrade.github.io/ LLM Reference: https://sinotrade.github.io/llms-full.txt


Navigation 功能導覽

Topic 主題File 檔案Description 說明
Preparation 準備PREPARE.mdAccount setup, API keys, testing 開戶/金鑰申請/測試
Contracts 合約CONTRACTS.mdStocks, Futures, Options contracts 股票/期貨/選擇權合約
Orders 下單ORDERS.mdPlace, modify, cancel, combo orders 下單/改單/刪單/組合單
Reserve 預收RESERVE.mdReserve orders for disposition stocks 處置股預收券款
Streaming 行情STREAMING.mdReal-time tick & bidask data 即時 Tick/BidAsk 資料
Market Data 市場資料MARKET_DATA.mdHistorical, snapshot, credit, scanners 歷史資料/快照/資券/掃描器
Accounting 帳務ACCOUNTING.mdBalance, margin, P&L, trading limits 餘額/保證金/損益/額度
Advanced 進階ADVANCED.mdQuote binding, non-blocking, stop orders 報價綁定/非阻塞/觸價
Troubleshooting 問題排解TROUBLESHOOTING.mdCommon issues and solutions 常見問題與解決

Quick Start 快速入門

Installation 安裝
bash
# pip
pip install shioaji

# uv (recommended 推薦)
uv add shioaji

# with speed optimization 速度優化版
uv add shioaji --extra speed

# Docker
docker run -it sinotrade/shioaji:latest
Login & Activate CA 登入與憑證啟用
python
import shioaji as sj

api = sj.Shioaji()

# Login with API Key 使用 API Key 登入
accounts = api.login(
    api_key="YOUR_API_KEY",
    secret_key="YOUR_SECRET_KEY"
)

# Activate CA certificate 啟用憑證 (required for placing orders 下單必須)
api.activate_ca(
    ca_path="/path/to/Sinopac.pfx",
    ca_passwd="YOUR_CA_PASSWORD",
)
Simulation Mode 模擬模式

Test API without real money. 使用模擬環境測試 API。

python
import shioaji as sj

api = sj.Shioaji(simulation=True)
api.login(api_key="YOUR_KEY", secret_key="YOUR_SECRET")

Available in simulation 模擬模式可用功能:

  • Quote: subscribe, unsubscribe, ticks, kbars, snapshots
  • Order: place_order, update_order, cancel_order, update_status, list_trades
  • Account: list_positions, list_profit_loss
  • Data: short_stock_sources, credit_enquires, scanners
Simple Order Example 簡單下單範例
python
# Get contract 取得合約
contract = api.Contracts.Stocks["2330"]  # TSMC 台積電

# Create order 建立訂單
order = api.Order(
    price=580,
    quantity=1,
    action=sj.constant.Action.Buy,
    price_type=sj.constant.StockPriceType.LMT,
    order_type=sj.constant.OrderType.ROD,
    account=api.stock_account,
)

# Place order 下單
trade = api.place_order(contract, order)

Common Constants 常用常數

Action 買賣方向
python
sj.constant.Action.Buy   # 買進
sj.constant.Action.Sell  # 賣出
Stock Price Type 股票價格類型
python
sj.constant.StockPriceType.LMT  # Limit 限價
sj.constant.StockPriceType.MKT  # Market 市價
sj.constant.StockPriceType.MKP  # Range Market 範圍市價
Futures Price Type 期貨價格類型
python
sj.constant.FuturesPriceType.LMT  # Limit 限價
sj.constant.FuturesPriceType.MKT  # Market 市價
sj.constant.FuturesPriceType.MKP  # Range Market 範圍市價
Order Type 委託條件
python
sj.constant.OrderType.ROD  # Rest of Day 當日有效
sj.constant.OrderType.IOC  # Immediate or Cancel 立即成交否則取消
sj.constant.OrderType.FOK  # Fill or Kill 全部成交否則取消
Stock Order Lot 股票交易單位
python
sj.constant.StockOrderLot.Common      # Regular 整股 (1000 shares)
sj.constant.StockOrderLot.Odd         # After-hours odd lot 盤後零股
sj.constant.StockOrderLot.IntradayOdd # Intraday odd lot 盤中零股
sj.constant.StockOrderLot.Fixing      # Fixing 定盤
Order Condition 信用交易條件
python
sj.constant.StockOrderCond.Cash          # Cash 現股
sj.constant.StockOrderCond.MarginTrading # Margin 融資
sj.constant.StockOrderCond.ShortSelling  # Short 融券
Quote Type 報價類型
python
sj.constant.QuoteType.Tick    # Tick data 逐筆成交
sj.constant.QuoteType.BidAsk  # Bid/Ask data 五檔報價

Account Objects 帳戶物件

python
# Stock account 股票帳戶
api.stock_account

# Futures account 期貨帳戶
api.futopt_account

# List all accounts 列出所有帳戶
api.list_accounts()

Rate Limits 流量限制

Category 類別Limit 限制
Daily Traffic 每日流量500MB - 10GB (based on trading volume 依交易量)
Quote Query 行情查詢50 requests / 5 sec
Accounting Query 帳務查詢25 requests / 5 sec
Connections 連線數5 per person ID
Daily Logins 每日登入1000 times

Common Patterns 常用模式

Subscribe Market Data 訂閱行情
python
# Subscribe tick data 訂閱逐筆成交
api.quote.subscribe(
    api.Contracts.Stocks["2330"],
    quote_type=sj.constant.QuoteType.Tick
)

# Subscribe bidask 訂閱五檔
api.quote.subscribe(
    api.Contracts.Stocks["2330"],
    quote_type=sj.constant.QuoteType.BidAsk
)

# Set callback 設定回調
@api.quote.on_quote
def quote_callback(topic, quote):
    print(f"Topic: {topic}, Quote: {quote}")
Query Positions 查詢持倉
python
# Stock positions 股票持倉
positions = api.list_positions(api.stock_account)

# Futures positions 期貨持倉
positions = api.list_positions(api.futopt_account)
Cancel Order 刪單
python
api.cancel_order(trade)
Update Order 改單
python
# Change price 改價
api.update_order(trade=trade, price=590)

# Reduce quantity 減量 (can only reduce 只能減少)
api.update_order(trade=trade, qty=1)

Error Handling 錯誤處理

python
try:
    trade = api.place_order(contract, order)
except Exception as e:
    print(f"Order failed: {e}")

# Check order status 檢查訂單狀態
api.update_status(api.stock_account)
for trade in api.list_trades():
    print(trade.status)

Logout 登出

python
api.logout()

© nicepkg, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 9 other files in workflows/stock-trader-workflow/.claude/skills/shioaji of nicepkg/ai-workflow.

  • SKILL.md
  • ACCOUNTING.md
  • ADVANCED.md
  • CONTRACTS.md
  • MARKET_DATA.md
  • ORDERS.md
  • PREPARE.md
  • RESERVE.md
  • STREAMING.md
  • TROUBLESHOOTING.md

Open the folder on GitHubat commit d167b41

Compare with similar skills

Shioaji next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Shioaji compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Shioaji this skillnicepkg/ai-workflow285—~1.5kAutomated safety check: PassMIT
Tushare Datazillionare/zillionare3212 repos~2.3kAutomated safety check: PassNone
Tradingview MCPatilaahmettaner/tradingview-mcp5k—~1.3kAutomated safety check: PassMIT
Digital Oraclekomako-workshop/digital-oracle878—~5.9kAutomated safety check: PassMIT
Worth Buy Stocksstarriv/worth-buy-stocks175—~4.5kAutomated safety check: NotesNone
Regimejackson-video-resources/markov-hedge-fund-method484—~1.6kAutomated safety check: PassCustom licence

Similar skills

  • Tushare Data

    zillionare/zillionare

    面向中文自然语言的 Tushare 数据研究技能。用于把“看看这只股票最近怎么样”“帮我查财报趋势”“最近哪个板块最强”“北向资金在买什么”“给我导出一份行情数据”这类请求,转成可执行的数据获取、清洗、对比、筛选、导出与简要分析流程。适用于 A 股、指数、ETF/基金、财务、估值、资金流、公告新闻、板块概念与宏观数据等研究场景。

    321 GitHub starsUsed in 2 repos~2.3k tokens
    Business, Finance & HRAuto-check passed
  • Tradingview MCP

    atilaahmettaner/tradingview-mcp

    AI Trading Intelligence — live prices, 30+ technical indicators, backtesting (6 strategies), walk-forward overfitting detection, trade logs, equity curves, licensed news sentiment (Marketaux), and…

    5k GitHub stars~1.3k tokensUpdated today
    Business, Finance & HRAuto-check passed
  • Digital Oracle

    komako-workshop/digital-oracle

    Answer prediction questions using market trading data, not opinions.

    878 GitHub stars~5.9k tokensUpdated 2 mo ago
    Business, Finance & HRAuto-check passed
  • Worth Buy Stocks

    starriv/worth-buy-stocks

    Evaluate US stocks under an Alpaca trend and relative-strength framework, and prioritize defined-risk net-credit income spreads: Bull Put/Bear Call first, Iron Condor second.

    175 GitHub stars~4.5k tokensUpdated 8 days ago
    Business, Finance & HRAuto-check: notes
  • Regime

    jackson-video-resources/markov-hedge-fund-method

    Detect the market regime (Bull / Bear / Sideways) for ANY asset and turn it into a tradeable signal or a risk filter.

    484 GitHub stars~1.6k tokensUpdated 4 mo ago
    Business, Finance & HRAuto-check passed
  • Agentic Trading Desk

    Oft3r/agentic-trading-desk

    Personal trading desk for short-term technical analysis on stocks/ETFs via Robinhood MCP.

    306 GitHub stars~5.1k tokensUpdated 1 mo ago
    Business, Finance & HRAuto-check passed

More from nicepkg/ai-workflow

All 75 skills in this repo
  • Capture Triage

    nicepkg/ai-workflow

    Processes Drafts Pro captures from the Inbox folder. An agent skill from nicepkg/ai-workflow.

    285 GitHub stars~3k tokensUpdated 8 mo ago
    Auto-check passed
  • Legacy To AI Ready

    nicepkg/ai-workflow

    Transform legacy codebases into AI-ready projects with Claude Code configurations.

    285 GitHub stars~2.2k tokensUpdated 8 mo ago
    Auto-check: notes
  • Newsletter Coach

    nicepkg/ai-workflow

    Writing coach that extracts educational content from your daily experiences and turns it into publish-ready newsletter drafts.

    285 GitHub stars~3.7k tokensUpdated 8 mo ago
    Auto-check passed
  • Webfluence

    nicepkg/ai-workflow

    Content web architecture framework. An agent skill from nicepkg/ai-workflow.

    285 GitHub stars~1.4k tokensUpdated 8 mo ago
    Auto-check passed
  • Workflow Creator

    nicepkg/ai-workflow

    Create complete Claude Code workflow directories with curated skills.

    285 GitHub stars~2.6k tokensUpdated 8 mo ago
    Auto-check passed
  • Media Processing

    nicepkg/ai-workflow

    Video/audio/image processing with FFmpeg and ImageMagick. An agent skill from nicepkg/ai-workflow.

    285 GitHub stars~2.4k tokensUpdated 8 mo ago
    Auto-check: notes

Questions about Shioaji

What does Shioaji do?

Shioaji Taiwan financial trading API guide. An agent skill from nicepkg/ai-workflow. Shioaji is an agent skill from nicepkg/ai-workflow. Shioaji Taiwan financial trading API guide.

When should I use Shioaji?

Shioaji fits situations like: trading stocks/futures/options on Taiwan markets; subscribing to real-time market data; querying account info; building automated trading systems.

How do I install Shioaji in Claude Code?

Run `npx skills add nicepkg/ai-workflow --skill shioaji -a claude-code`. Or copy the skill folder (workflows/stock-trader-workflow/.claude/skills/shioaji in nicepkg/ai-workflow) into .claude/skills/shioaji in your project. Claude Code loads it when a task matches its description.

How do I install Shioaji in Codex?

Run `npx skills add nicepkg/ai-workflow --skill shioaji -a codex`. Or copy the skill folder (workflows/stock-trader-workflow/.claude/skills/shioaji in nicepkg/ai-workflow) into .agents/skills/shioaji in your project. Codex loads it when a task matches its description.

Can I use Shioaji in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add nicepkg/ai-workflow --skill shioaji -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/shioaji, .gemini/skills/shioaji, .github/skills/shioaji and .opencode/skills/shioaji in your project.

What does Shioaji need to run?

Going by SKILL.md and its folder, Shioaji needs the command-line tools its instructions call (uv, pip and docker). Our summary lists: Python 3; Docker; A credential in YOUR_API_KEY; A credential in YOUR_SECRET_KEY.

Does Shioaji access the network?

SKILL.md names 1 domain. As links in the text: sinotrade.github.io. This is read from the text; nothing was executed.

Is Shioaji safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Shioaji use?

Shioaji is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Shioaji use?

About 1.5k tokens (SKILL.md is roughly 6.1k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Shioaji?

Skills that share tags, products or a category with Shioaji: Tushare Data (zillionare/zillionare, 321 stars), Tradingview MCP (atilaahmettaner/tradingview-mcp, 5k stars), Digital Oracle (komako-workshop/digital-oracle, 878 stars) and Worth Buy Stocks (starriv/worth-buy-stocks, 175 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Shioaji?

nicepkg (a GitHub organization) maintains it in nicepkg/ai-workflow, which has 285 GitHub stars. The repository holds 75 skills in this directory. The repository was last updated on January 20, 2026.

Source: nicepkg/ai-workflow on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.