stock-rt-subscribe

stock-rt-subscribe is a skill for Claude Code, Codex from Yourdaylight/stock_datasource. It costs 81 tokens per session (744 once invoked), scanned A, original, MIT.

Instructions and scripts for receiving live prices and minute-level market data for Chinese mainland stocks, Hong Kong stocks, and ETFs through a persistent WebSocket connection.

In plain words
What is it for?
Use it to subscribe to selected symbols, run one-time connection checks, trigger price-change alerts, save updates as JSONL, or connect the stream to an AI agent.
Why use it?
It avoids repeatedly requesting prices manually and can stream updates to clients while optionally reporting percentage-change alerts.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Use it to subscribe to selected symbols, run one-time connection checks, trigger price-change alerts, save updates as JSONL, or connect the stream to an AI agent.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/yourdaylight/stock_datasource/stock-rt-subscribe
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add Yourdaylight/stock_datasource --skill stock-rt-subscribe
Clone the repo
git clone --depth 1 https://github.com/Yourdaylight/stock_datasource

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for stock-rt-subscribe

README.md
[![agentmods](https://agentmods.dev/badge/skills/yourdaylight/stock_datasource/stock-rt-subscribe.svg)](https://agentmods.dev/skills/yourdaylight/stock_datasource/stock-rt-subscribe)
Your own site
<a href="https://agentmods.dev/skills/yourdaylight/stock_datasource/stock-rt-subscribe"><img src="https://agentmods.dev/badge/skills/yourdaylight/stock_datasource/stock-rt-subscribe.svg" alt="Measured on agentmods" height="20"></a>
Per session 81 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 744 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
How audits are shown
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00081 $0.00744
Opus 5 $0.00041 $0.00372
Sonnet 5 $0.00016 $0.00149
Haiku 4.5 $0.00008 $0.00074

Measured 8d ago against content hash a5e52be0d510, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-07, from the pricing page.

Security

Grade A, and why

stock-rt-subscribe scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 8d ago.

The scan reads SKILL.md. This mod also ships 4 executable files (scripts/ai_agent_integration.py, scripts/alert_engine.py, scripts/strategy_engine.py, …), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/stock-rt-subscribe/SKILL.md · 87 lines

What it actually says

实时股票数据订阅(WebSocket)

通过 WebSocket 长连接 实时接收 A 股、港股、ETF 行情数据,每 3~5 秒更新一次。

架构

Receiver Node (HTTP API) → scripts/subscribe_client.py → ws://localhost:8765 → 客户端

环境准备

pip install requests websockets
export STOCK_RT_NODE_URL="http://your-node:9100"
export STOCK_RT_TOKEN="your-token"   # 可选,有鉴权时设置

快速开始

一次性查询(验证连通性)

python3 scripts/subscribe_client.py --symbols 00700.HK 600519.SH --once

启动 WebSocket 推送服务

# 基础订阅
python3 scripts/subscribe_client.py --symbols 00700.HK 09988.HK 600519.SH

# 指定节点和端口
python3 scripts/subscribe_client.py --node-url http://your-node:9100 --ws-port 8765 --symbols 00700.HK

# 涨跌幅告警(±2% 触发)
python3 scripts/subscribe_client.py --symbols 00700.HK --alert-pct 2.0

# 输出到文件
python3 scripts/subscribe_client.py --symbols 00700.HK --output ticks.jsonl

编程方式启动

from scripts.subscribe_client import StockWSServer

server = StockWSServer(
    node_url="http://your-node:9100",
    symbols=["00700.HK", "09988.HK"],
    poll_interval=3.0,
)
server.add_callback(lambda sym, tick: print(f"{tick.name}: {tick.close}"))
server.run(port=8765)

AI Agent 集成

from scripts.ai_agent_integration import StockDataAgent

agent = StockDataAgent()
agent.install()  # 检查依赖、验证节点连通性

# 完整工作流(订阅 + 告警监控 60 秒)
import asyncio
asyncio.run(agent.complete_workflow(['00700.HK', '600519.SH'], duration=60))

告警策略

告警规则配置见 references/strategy_config.json,内置策略:

  • limit_up_down:涨停/跌停监控
  • big_move:大幅波动(≥ ±5%)
  • vol_spike:成交量异动(≥ 近5日均量3倍)
  • price_breakout:价格突破近20日高点

参考文档

Files

What ships with it

6 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 8d ago First seen · 87 lines · 81 tokens per session scan A a5e52be0d510

Subscribe to this mod's changes

stock-rt-subscribe is a skill published in the GitHub repository Yourdaylight/stock_datasource (184 stars, last pushed 3d ago), licensed MIT. It adds 81 tokens to every session and 744 once invoked, about $0.0004 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories