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 cost-density-net-rr-calculatorgit 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/cost-density-net-rr-calculator)<a href="https://agentmods.dev/skills/fatfingererr/macro-skills/cost-density-net-rr-calculator"><img src="https://agentmods.dev/badge/skills/fatfingererr/macro-skills/cost-density-net-rr-calculator/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/cost-density-net-rr-calculator"><img src="https://agentmods.dev/badge/skills/fatfingererr/macro-skills/cost-density-net-rr-calculator.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.00078 | $0.01401 |
| Opus 5 | $0.00039 | $0.00700 |
| Sonnet 5 | $0.00016 | $0.00280 |
| Haiku 4.5 | $0.00008 | $0.00140 |
Grade A, and why
cost-density-net-rr-calculator 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.
What it actually says
<essential_principles> 成本密度模型核心原則
1. 核心公式
所有計算基於以下關係:
Cost Density = (c/V + s) # 成本密度(pips 等效)
x = Cost Density / P # 負載係數
RR_net = (RR_g - x) / (1 + x) # 淨風險報酬比
WR_min = (1 + x) / (1 + RR_g) # 最低勝率
P_critical = CostDensity × (RR_g + 2) / RR_g # 效率減半點
2. 參數定義
| 參數 | 定義 | 單位 |
|---|---|---|
| RR_g | 毛風險報酬比(目標/停損) | 無單位 |
| P | 停損大小 | pips/points |
| c | 來回佣金(每手) | 帳戶貨幣 |
| s | 來回點差 | pips/points |
| V | 每 pip 價值(每手) | 帳戶貨幣/pip |
| R | 固定風險(可選,會抵消) | 帳戶貨幣 |
3. 關鍵洞察
- 雙曲線衰減: P → 0 時,x → ∞,RR_net → -1
- R 無關性: RR_net 不依賴固定風險 R
- 剪刀效應: 短時間框架同時增加成本負擔與降低訊號品質
4. 單位一致性規則
- P 和 s 必須使用相同基準(都是 pips 或都是 points)
- c 必須是 round-turn(來回)佣金
- V 必須是每 pip 每手的價值 </essential_principles>
- Compute - 計算單一參數組合的成本密度與效率指標
- Sweep - 掃描停損範圍,生成 RR_net/WR_min 曲線表
- Analyze - 解讀結果,提供策略建議
等待回應後再繼續。
讀取工作流程後,請完全遵循其步驟。
<reference_index>
參考文件 (references/)
| 文件 | 內容 |
|---|---|
| formulas.md | 完整公式推導與數學證明 |
| theory.md | 市場微結構理論背景與文獻 |
| </reference_index> |
<workflows_index>
| Workflow | Purpose |
|---|---|
| compute.md | 單次計算成本密度與效率指標 |
| sweep.md | 網格掃描與閾值搜尋 |
| analyze.md | 結果解讀與策略建議 |
| </workflows_index> |
<templates_index>
| Template | Purpose |
|---|---|
| output-schema.yaml | 輸出 JSON schema |
| input-schema.yaml | 輸入參數 schema |
| </templates_index> |
<scripts_index>
| Script | Purpose |
|---|---|
| cost_density.py | Python 計算實作 |
| cost_density.ts | TypeScript 計算實作 |
| </scripts_index> |
<quick_start> 快速計算(XAU/USD 範例):
輸入:
{
"RR_g": 3.0,
"c": 7.0,
"s": 1.5,
"V": 10.0,
"P": 20
}
計算:
cost_density = 7.0/10.0 + 1.5 # = 2.2 pips
x = 2.2 / 20 # = 0.11
RR_net = (3.0 - 0.11) / (1 + 0.11) # = 2.60
WR_min = (1 + 0.11) / (1 + 3.0) # = 27.7%
P_critical = 2.2 * (3.0 + 2) / 3.0 # = 3.67 pips
輸出:
{
"cost_density": 2.2,
"x": 0.11,
"RR_net": 2.60,
"WR_min": 0.277,
"P_critical": 3.67,
"Loss_RR": 0.133
}
</quick_start>
<success_criteria> Skill 成功執行時:
- 輸入參數通過驗證(單位一致性)
- 正確計算 cost_density、x、RR_net、WR_min
- 識別是否處於高摩擦區(P < P_critical)
- 輸出符合 outputs_schema
- 提供 zh-TW 解釋說明 </success_criteria>
What ships with it
14 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/eurusd_low_cost.json 1.1 KB
- examples/high_frequency_warning.json 1.9 KB
- examples/xauusd_default.json 1.2 KB
- manifest.json 389 B
- references/formulas.md 4.9 KB
- references/theory.md 4.9 KB
- scripts/cost_density.py 7.2 KB runs code
- scripts/cost_density.ts 6.6 KB runs code
- skill.yaml 5.8 KB
- templates/input-schema.yaml 2.4 KB
- templates/output-schema.yaml 2.5 KB
- workflows/analyze.md 4.5 KB
- workflows/compute.md 2.0 KB
- workflows/sweep.md 3.0 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 · 140 lines · 78 tokens per session scan A f0e868159c72
cost-density-net-rr-calculator is a skill published in the GitHub repository fatfingererr/macro-skills (3 stars, last pushed 7mo ago), licensed MIT. It adds 78 tokens to every session and 1,401 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.