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.
npx skills add fatfingererr/macro-skills --skill compute-precious-miner-gross-margingit clone --depth 1 https://github.com/fatfingererr/macro-skillsWrote 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/compute-precious-miner-gross-margin)<a href="https://agentmods.dev/skills/fatfingererr/macro-skills/compute-precious-miner-gross-margin"><img src="https://agentmods.dev/badge/skills/fatfingererr/macro-skills/compute-precious-miner-gross-margin/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/compute-precious-miner-gross-margin"><img src="https://agentmods.dev/badge/skills/fatfingererr/macro-skills/compute-precious-miner-gross-margin.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.00071 | $0.03201 |
| Opus 5 | $0.00036 | $0.01600 |
| Sonnet 5 | $0.00014 | $0.00640 |
| Haiku 4.5 | $0.00007 | $0.00320 |
Grade A, and why
compute-precious-miner-gross-margin 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 11d 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 — 302 lines — stays where its author put it; the contents beside it link to each section on GitHub.
<essential_principles>
礦業毛利率代理(Margin Proxy)使用簡化公式:
gross_margin_proxy = (metal_price - unit_cost) / metal_price
其中:
- metal_price:金屬現貨價或期貨近月價
- unit_cost:AISC (All-In Sustaining Cost)、現金成本(C1)或全成本
此指標不等同會計報表的毛利率,但能快速捕捉價格-成本關係的邊際變化。
| 口徑 | 包含項目 | 適用場景 |
|---|---|---|
| Cash Cost (C1) | 現場採掘 + 加工 + 場內行政 | 現金流壓力測試 |
| AISC | C1 + 維持資本開支 + 勘探 + 行政 | 行業標準(WGC 定義) |
| All-In Cost (AIC) | AISC + 成長資本開支 | 完整經濟成本 |
建議優先使用 AISC,因其可比性最佳且資料可得性高。
| 方法 | 公式 | 直覺 |
|---|---|---|
| equal_weight | Σ margin_i / N | 簡單平均,每家公司等權 |
| production_weighted | Σ (margin_i × prod_i) / Σ prod_i | 產量加權,反映「產業毛利」 |
| marketcap_weighted | Σ (margin_i × mcap_i) / Σ mcap_i | 市值加權,反映「股權曝險」 |
建議使用 production_weighted 以更準確反映產業整體毛利結構。
- 金屬價格:日頻或月均價
- 礦業成本:季度(多數公司僅在季報揭露 AISC)
- 對齊方式:
- 將成本 forward-fill 至季度內各期
- 或使用同季均價(更乾淨)
本 Skill 建議使用 季度頻率 作為基準,避免過度平滑。
本 skill 使用公開數據:
- 金價:LBMA Gold Price / COMEX 近月期貨
- 銀價:LBMA Silver Price / COMEX 近月期貨
- AISC:公司 IR 投資人簡報 / 季報 MD&A / 新聞稿
- 產量:同上,單位 oz / GEO / AgEq oz
腳本位於 scripts/ 目錄,可直接執行。
</essential_principles>
- 數據整合:抓取金屬價格序列與礦業成本/產量數據
- 計算毛利率代理:單一公司層級 + 籃子聚合
- 歷史分位數:判斷當前水位在歷史區間的位置
- 驅動拆解:區分價格驅動 vs 成本驅動
- 訊號生成:極端高/低檔區間標記
輸出:毛利率時序、歷史分位、驅動拆解、交易/研究連結。
<quick_start>
最快的方式:執行預設情境分析
cd skills/compute-precious-miner-gross-margin
pip install pandas numpy requests yfinance beautifulsoup4 lxml # 首次使用
python scripts/margin_calculator.py --quick --metal gold
輸出範例:
{
"skill": "compute_precious_miner_margin_proxy",
"metal": "gold",
"frequency": "quarterly",
"cost_metric": "AISC",
"basket": {
"miners": ["NEM", "GOLD", "AEM"],
"aggregation": "production_weighted"
},
"latest": {
"date": "2025-Q4",
"metal_price_usd_oz": 2650.0,
"unit_cost_proxy_usd_oz": 1320.0,
"gross_margin_proxy": 0.502,
"history_percentile": 0.78,
"regime_label": "high_margin"
}
}
完整情境分析:
python scripts/margin_calculator.py \
--metal silver \
--miners CDE,HL,AG \
--start-date 2015-01-01 \
--frequency quarterly \
--cost-metric AISC \
--aggregation production_weighted \
--output result.json
</quick_start>
- 快速計算 - 使用預設參數計算主要礦業籃子的毛利率代理
- 完整分析 - 自訂參數進行情境分析(可選擇金屬、礦業、成本口徑)
- 數據研究 - 了解如何獲取 AISC / 成本數據(爬蟲設計)
- 訊號生成 - 將毛利率轉為交易/研究訊號
- 方法論學習 - 了解計算邏輯與數據來源
請選擇或直接提供分析參數。
路由後,閱讀對應文件並執行。
<directory_structure>
compute-precious-miner-gross-margin/
├── SKILL.md # 本文件(路由器)
├── skill.yaml # 前端展示元數據
├── manifest.json # 技能元數據
├── workflows/
│ ├── analyze.md # 完整情境分析工作流
│ ├── data-research.md # 數據源研究與爬蟲設計
│ └── signal-generation.md # 訊號生成工作流
├── references/
│ ├── data-sources.md # 數據來源與獲取方式
│ ├── methodology.md # 方法論與計算邏輯
│ └── input-schema.md # 完整輸入參數定義
├── templates/
│ ├── output-json.md # JSON 輸出模板
│ └── output-markdown.md # Markdown 報告模板
├── scripts/
│ └── margin_calculator.py # 主計算腳本
└── examples/
└── sample-output.json # 範例輸出
</directory_structure>
What ships with it
12 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.
- examples/sample-output.json 1.9 KB
- manifest.json 2.8 KB
- references/data-sources.md 7.3 KB
- references/input-schema.md 7.0 KB
- references/methodology.md 8.4 KB
- scripts/margin_calculator.py 19 KB runs code
- skill.yaml 7.4 KB
- templates/output-json.md 7.1 KB
- templates/output-markdown.md 5.8 KB
- workflows/analyze.md 5.5 KB
- workflows/data-research.md 7.3 KB
- workflows/signal-generation.md 9.9 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.
- 11d ago First seen · 302 lines · 71 tokens per session scan A 0c2aa196756c
compute-precious-miner-gross-margin is a skill published in the GitHub repository fatfingererr/macro-skills (3 stars, last pushed 7mo ago), licensed MIT. It adds 71 tokens to every session and 3,201 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-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.