Stock logo

Stock

Community
MagicCube
stock

Query stock quotes for US stocks, Hong Kong stocks, and A-shares. Use when the user asks about a stock price, market quote, or stock performance — including phrases like "查一下 BABA", "BABA 现在多少", "阿里巴巴股价", "茅台今天", "港股 9988", "美股行情", or any mention of a specific stock ticker or company name wanting price/change data. Also trigger for market overview requests like "大盘怎么样", "美股今天", "港股行情".

Overview

PublisherMagicCube
Repositoryagentara
Skill namestock
Stars
516
Forks
58
Bundled files
1
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 1 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by MagicCube on GitHub. Read the source before you install it.

Installation

Install the Stock AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/MagicCube/agentara/tree/main/user-home/.claude/skills/stock
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/MagicCube/agentara.git /tmp/agentara
mkdir -p .claude/skills
cp -r /tmp/agentara/user-home/.claude/skills/stock .claude/skills/stock
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Stock in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Stock on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Stock is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Stock Quote Skill

Fetch latest stock price, change, and anomaly detection for US stocks, HK stocks, and A-shares. Uses stooq.com as data source — reliable, no auth, bypasses system proxy automatically. Data is T+1 for all markets (previous trading day close). This is expected and normal.


Step 1 — Identify Stock & Market

Parse the user's query:

  • A-share: 6-digit code (000001, 600519, 300750) or Chinese company name → market = cn
  • HK stock: 4–5 digit code (9988, 00700, 9999) or XXXX.HK format → market = hk
  • US stock: Latin ticker (BABA, AAPL, TSLA, NVDA) or BABA.US format → market = us

For well-known companies, infer the market:

  • 阿里巴巴 → BABA (US) + 09988 (HK) — user usually means one, ask if unclear
  • 腾讯 → 00700 (HK)
  • 茅台/贵州茅台 → 600519 (A-share)
  • 宁德时代 → 300750 (A-share)

For HK symbols, pass as-is (no zero-padding): 9988, 700. stooq handles it.


Step 2 — Fetch Data

Use the unified fetch_stock.py script. Market codes: hk, cn, us.

bash
# HK stock
python3 /Users/henry/.agentara/.claude/skills/stock/fetch_stock.py hk 9988

# A-share
python3 /Users/henry/.agentara/.claude/skills/stock/fetch_stock.py cn 600519

# US stock
python3 /Users/henry/.agentara/.claude/skills/stock/fetch_stock.py us BABA

Output is a JSON array of rows: {date, open, close, high, low, vol, pct, chg}. If the output starts with {"error":, report the error to the user and stop.

Network notes: stooq.com is called with trust_env=False (bypasses Clash/system proxy). No external Python deps beyond requests (stdlib-equivalent, always available).

Stooq symbol format:

  • HK: 9988.hk (no leading zeros)
  • CN: 600519.cn
  • US: baba.us (lowercase)

Step 3 — Analyze & Detect Anomalies

From the JSON output (up to 21 rows):

  1. Latest row = most recent trading day data
  2. Latest price = close of last row
  3. Latest change% = pct of last row
  4. Avg volatility = mean of |pct| of rows 2–21 (excluding last row)
  5. Avg volume = mean of vol of rows 2–6 (5-day avg, excluding last)
  6. Latest volume = vol of last row

Anomaly flags (report any that apply):

  • |pct| > 5% → 🚨 大幅波动
  • |pct| > 2% AND |pct| > 2 × avg_volatility → ⚠️ 异常波动(超出近期均值2倍)
  • latest_vol > 2 × avg_volume → 📊 成交量异常放大(X倍)
  • latest_vol < 0.4 × avg_volume → 🔇 成交量异常萎缩

If US stock pct is always near 0 except the last row, it's because the diff is computed on fetched data — use the last row's pct directly.


Step 4 — Format Output

Keep it brief and mobile-friendly. Use list format, no tables.

Color + emoji rules (Chinese convention: 红涨绿跌):

  • pct > 0 → emoji 📈, wrap numbers in <font color='red'>...</font>
  • pct < 0 → emoji 📉, wrap numbers in <font color='green'>...</font>
  • pct == 0 → emoji ➡️, no color wrapper

Template (adapt to context):

**{公司名} · {市场} {代码}**

- 最新价:<font color='red/green'>**{price} {货币}**</font>
- 涨跌:{emoji} <font color='red/green'>**{chg:+.2f} / {pct:+.2f}%**</font>
- 最新交易日:{date}

{anomaly_section_if_any}

Anomaly section (only if flags exist):

⚠️ 异常提示
- [flag 1]
- [flag 2]
近5日均幅 **{avg_vol:.2f}%**,今日 <font color='red/green'>**{pct:.2f}%**</font>

If no anomaly: omit the anomaly section entirely. Keep the whole response under 10 lines.


Step 5 — Currency

  • A-share: ¥ (人民币)
  • HK: HK$ (港元)
  • US: $ (美元)

Notes

  • US data lags by 1 trading day (Sina source) — this is expected, tell the user if they ask
  • If AKShare is not installed: pip3 install akshare -q
  • If the symbol is wrong or not found, tell the user and suggest the correct format
  • For A-share names, you can infer the 6-digit code from common knowledge; if uncertain, say so
  • Do NOT show raw JSON or DataFrame output to the user — always parse and format it

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Stock AI skill do?

Query stock quotes for US stocks, Hong Kong stocks, and A-shares. Use when the user asks about a stock price, market quote, or stock performance — including phrases like "查一下 BABA", "BABA 现在多少", "阿里巴巴股价", "茅台今天", "港股 9988", "美股行情", or any mention of a specific stock ticker or company name wanting price/change data. Also trigger for market overview requests like "大盘怎么样", "美股今天", "港股行情".

Why use Stock on TypingMind?

Because you install it once and use it with any model. Stock is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Stock in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/MagicCube/agentara/tree/main/user-home/.claude/skills/stock. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Stock?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Stock?

As many as you like. As long as a model supports skills, you can use Stock with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Stock AI skill free?

It is published on GitHub by MagicCube. Check the repository for licensing terms. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇