Getting it into your agent
It runs from inside its repository, so the clone comes first — what it calls does not travel with the file alone.
git clone --depth 1 https://github.com/fatfingererr/macro-skillsnpx agentmods add skills/fatfingererr/macro-skills/detect-shanghai-silver-stock-drainWrote 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.
[](https://agentmods.dev/skills/fatfingererr/macro-skills/detect-shanghai-silver-stock-drain)<a href="https://agentmods.dev/skills/fatfingererr/macro-skills/detect-shanghai-silver-stock-drain"><img src="https://agentmods.dev/badge/skills/fatfingererr/macro-skills/detect-shanghai-silver-stock-drain/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/fatfingererr/macro-skills/detect-shanghai-silver-stock-drain"><img src="https://agentmods.dev/badge/skills/fatfingererr/macro-skills/detect-shanghai-silver-stock-drain.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00053 | $0.03077 |
| Opus 5 | $0.00026 | $0.01538 |
| Sonnet 5 | $0.00011 | $0.00615 |
| Haiku 4.5 | $0.00005 | $0.00308 |
Grade A, and why
detect-shanghai-silver-stock-drain 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 12d ago.
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.
How it starts
The opening of the file, as written. The whole thing — 281 lines — stays where its author put it; the contents beside it link to each section on GitHub.
<essential_principles>
庫存分析的三維框架:
- 方向(Direction):庫存是上升還是下降
- 速度(Speed):每週流出量
drain_rate(t) = -Δ1(t) - 加速度(Acceleration):流出速度的變化
Δ2(t) = drain_rate(t) - drain_rate(t-1)
當 drain_rate > 0 且 Δ2 > 0 時,表示「庫存正在流出,且流出速度在加快」——這是晚期供給訊號的核心特徵。
使用歷史視窗(建議 3~5 年)計算 Z 分數:
z_drain(t) = (drain_rate(t) - mean) / stdz_accel(t) = (Δ2(t) - mean) / std
門檻判定:
| 指標 | 門檻 | 意義 |
|---|---|---|
| z_drain | ≤ -1.5 | 流出速度顯著大於常態 |
| z_accel | ≥ +1.0 | 流出正在加速 |
| level_percentile | ≤ 0.20 | 庫存處於歷史低檔 |
把推文敘事轉為可執行規則:
| 條件 | 描述 | 單獨成立 | 組合效果 |
|---|---|---|---|
| A. Level | 庫存水位 < 20% 歷史分位 | WATCH | - |
| B. Speed | z_drain ≤ -1.5 | WATCH | B+C → MEDIUM |
| C. Acceleration | z_accel ≥ +1.0 | WATCH | A+B+C → HIGH |
訊號分級:
HIGH_LATE_STAGE_SUPPLY_SIGNAL:A+B+C 同時成立MEDIUM_SUPPLY_TIGHTENING:(B+C) 或 (A+B) 成立WATCH:任一條件成立NO_SIGNAL:無異常
主要數據來源:
- CEIC Data:上海期貨交易所白銀倉單數據
- URL:
https://www.ceicdata.com/zh-hans/china/shanghai-futures-exchange-commodity-futures-stock/cn-warehouse-stock-shanghai-future-exchange-silver - 數據範圍:2012-07-02 至今(約 3,300+ 觀測值)
- 更新頻率:每日
- 歷史最高:3,091 噸 (2021-01-12)
- URL:
重要提醒:
- 這是「交易所可交割/倉單」口徑,不等於全中國社會庫存
- 單週跳動可能反映倉儲規則變動或搬倉,需平滑處理
- 使用 Selenium 模擬人類瀏覽器抓取 SVG 圖表,遵循反偵測策略
</essential_principles>
- 數據採集:抓取 SGE/SHFE 週報庫存數據
- 三維量化:計算方向、速度、加速度
- 標準化判斷:使用 Z 分數判定異常
- 訊號生成:輸出晚期供給訊號分級
- 市場交叉驗證(選配):COMEX、ETF、現貨溢價
輸出:庫存水位、耗盡速度、加速度、Z 分數、訊號分級、敘事解讀。
<quick_start>
最快的方式:檢查上海白銀庫存耗盡狀態
cd skills/detect-shanghai-silver-stock-drain
# 首次使用:安裝依賴
pip install pandas numpy selenium webdriver-manager matplotlib
# 1. 抓取最新數據(5 年歷史,約 200+ 週)
python scripts/fetch_shfe_stock.py --force-update
# 2. 執行快速檢查
python scripts/drain_detector.py --quick
輸出範例:
{
"as_of": "2026-01-16",
"signal": "MEDIUM_SUPPLY_TIGHTENING",
"latest_combined_stock_tonnes": 1133.3,
"level_percentile": 0.12,
"z_drain_rate": -2.1,
"z_acceleration": 1.4
}
完整分析 + 視覺化報告:
# 1. 執行完整分析
python scripts/drain_detector.py \
--start 2020-01-01 \
--end 2026-01-16 \
--output result.json
# 2. 生成視覺化報告
python scripts/visualize_drain.py \
--result result.json \
--output ../../../output/
</quick_start>
- 快速檢查 - 查看目前上海白銀庫存耗盡狀態與訊號
- 完整分析 - 執行完整的歷史庫存分析與趨勢計算
- 數據更新 - 抓取最新的 SGE/SHFE 庫存數據
- 交叉驗證 - 使用 COMEX、ETF 等指標交叉驗證
- 方法論學習 - 了解三維度量化與訊號判定邏輯
請選擇或直接提供分析參數。
路由後,閱讀對應文件並執行。
<directory_structure>
detect-shanghai-silver-stock-drain/
├── SKILL.md # 本文件(路由器)
├── skill.yaml # 前端展示元數據
├── manifest.json # 技能元數據
├── workflows/
│ ├── analyze.md # 完整庫存分析工作流
│ ├── fetch-data.md # 數據抓取工作流
│ └── cross-validate.md # 交叉驗證工作流
├── references/
│ ├── data-sources.md # SGE/SHFE 資料來源說明
│ ├── methodology.md # 三維度量化方法論
│ └── input-schema.md # 完整輸入參數定義
├── templates/
│ ├── output-json.md # JSON 輸出模板
│ └── output-markdown.md # Markdown 報告模板
└── scripts/
├── drain_detector.py # 主偵測腳本
├── fetch_sge_stock.py # SGE 庫存抓取(PDF)
├── fetch_shfe_stock.py # SHFE 庫存抓取
└── visualize_drain.py # 視覺化報告生成
</directory_structure>
What ships with it
18 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.
- manifest.json 3.0 KB
- references/data-sources.md 7.0 KB
- references/input-schema.md 5.0 KB
- references/methodology.md 5.7 KB
- scripts/drain_detector.py 14 KB runs code
- scripts/explore_ceic.py 8.8 KB runs code
- scripts/explore_shfe.py 6.4 KB runs code
- scripts/fetch_ceic_silver.py 13 KB runs code
- scripts/fetch_ceic_svg.py 16 KB runs code
- scripts/fetch_sge_stock.py 2.8 KB runs code
- scripts/fetch_shfe_stock.py 15 KB runs code
- scripts/visualize_drain.py 9.9 KB runs code
- skill.yaml 13 KB
- templates/output-json.md 5.6 KB
- templates/output-markdown.md 5.4 KB
- workflows/analyze.md 5.2 KB
- workflows/cross-validate.md 4.2 KB
- workflows/fetch-data.md 3.4 KB
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.
- 12d ago First seen · 281 lines · 53 tokens per session scan A 08a9a8c4daa9
detect-shanghai-silver-stock-drain is a skill published in the GitHub repository fatfingererr/macro-skills (3 stars, last pushed 7mo ago), licensed MIT. It adds 53 tokens to every session and 3,077 once invoked, about $0.0003 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-31.
Other skills, from other repositories
sector-rotation
An analysis framework for comparing industries in the Chinese A-share stock market, using business conditions, price momentum, valuation, and money flows. It produces rankings and higher- or lower-allocation suggestions.
strategy-pivot-designer
Detect backtest iteration stagnation and generate structurally different strategy pivot proposals when parameter tuning reaches a local optimum.
twitter-reader
Read Twitter/X for financial research using opencli (read-only). Use this skill whenever the user wants to read their Twitter feed, search for financial tweets, view bookmarks, look up user profiles, or gather market sentiment from Twitter/X. Triggers include: "check my feed", "search Twitter for", "show my…
chenhao-limit-up
A framework for judging Chinese A-share stocks that have reached the daily price-rise limit, using market mood, sector leadership, and trading momentum.
furusato
A Japanese hometown-tax donation manager for furusato nozei, a system where donations to municipalities can qualify for an income-tax or local-tax deduction. It reads donation receipts, stores donation records, and calculates deduction limits.
reading-receipt
An image-reading workflow for extracting structured information from receipts, invoices, and hometown-tax donation certificates. It can first extract text from PDFs and otherwise read their images.