analyze-gas-fertilizer-contract-shock

analyze-gas-fertilizer-contract-shock is a skill for Claude Code, Codex from fatfingererr/macro-skills. It costs 78 tokens per session (3,185 once invoked), scanned A, original, MIT.

A data-analysis skill that tests whether a rise in natural-gas prices is followed by fertiliser price spikes and possible supply disruption. It uses daily price data and lead-lag analysis, where one series is checked for moving before another.

In plain words
What is it for?
Use it to identify price shocks, compare their timing, measure whether gas prices lead fertiliser prices, and produce marked turning points for charts.
Why use it?
It separates evidence for that cause-and-effect story from simple coincidence and offers alternative explanations when the data does not support it.

Skill for Claude CodeCodex

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

Needs its repository: it reads a path above its own folder, which exists only inside the repository. The line is --gas-file ../data/cache/natural-gas.csv \.

Good fit Use it to identify price shocks, compare their timing, measure whether gas prices lead fertiliser prices, and produce marked turning points for charts.

Compare 6 skills from other repositories ↓
Install

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.

Clone the repo
git clone --depth 1 https://github.com/fatfingererr/macro-skills
agentmods
npx agentmods add skills/fatfingererr/macro-skills/analyze-gas-fertilizer-contract-shock

Made for: Claude Code, Codex.

Its marketplace also offers this one on its own, as the plugin analyze-gas-fertilizer-contract-shock/plugin install analyze-gas-fertilizer-contract-shock after adding the marketplace above.

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 analyze-gas-fertilizer-contract-shock

README.md
[![agentmods](https://agentmods.dev/badge/skills/fatfingererr/macro-skills/analyze-gas-fertilizer-contract-shock/github.svg)](https://agentmods.dev/skills/fatfingererr/macro-skills/analyze-gas-fertilizer-contract-shock)
Your own site
<a href="https://agentmods.dev/skills/fatfingererr/macro-skills/analyze-gas-fertilizer-contract-shock"><img src="https://agentmods.dev/badge/skills/fatfingererr/macro-skills/analyze-gas-fertilizer-contract-shock/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.

agentmods 80×15 button for analyze-gas-fertilizer-contract-shock

Your own site · 80×15
<a href="https://agentmods.dev/skills/fatfingererr/macro-skills/analyze-gas-fertilizer-contract-shock"><img src="https://agentmods.dev/badge/skills/fatfingererr/macro-skills/analyze-gas-fertilizer-contract-shock.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 78 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,185 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.
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.00078 $0.03185
Opus 5 $0.00039 $0.01592
Sonnet 5 $0.00016 $0.00637
Haiku 4.5 $0.00008 $0.00318

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

Security

Grade A, and why

analyze-gas-fertilizer-contract-shock 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.

The scan reads SKILL.md. This mod also ships 3 executable files (scripts/fetch_te_data.py, scripts/gas_fertilizer_analyzer.py, scripts/visualize_shock_regimes.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/analyze-gas-fertilizer-contract-shock/SKILL.md · 328 lines

How it starts

The opening of the file, as written. The whole thing — 328 lines — stays where its author put it; the contents beside it link to each section on GitHub.

<essential_principles>

本技能專注於「用數據檢驗敘事」:

  • 輸入:社群/新聞宣稱「天然氣暴漲導致化肥供應/價格異常」
  • 輸出:時間序列上的因果假說檢驗結果

不做價格預測,只回答:「這個敘事在數據上是否有支撐?」

敘事成立需要三段條件同時滿足:

階段 條件 檢驗方式
A 段 天然氣出現 shock regime z-score 或斜率突破閾值
B 段 化肥在 A 段後出現 spike 同法檢驗,且起點晚於天然氣
C 段 領先落後關係支持因果 cross-correlation 顯示 gas 領先 fert

若 A→B→C 成立,敘事有量化支撐;否則提供替代解釋。

使用 rolling z-score + 斜率雙重確認:

# z-score 偵測
z_t = (r_t - rolling_mean(r, window)) / rolling_std(r, window)
shock = z_t >= threshold_z  # 預設 3.0

# 斜率偵測(補充)
slope_t = (price_t / price_{t-k} - 1) / k
shock |= slope_t >= threshold_slope  # 預設 1.5%/day

連續 shock 日合併為 regime,輸出起點/終點/峰值。

Cross-correlation 結果解讀:

lag 值 意義 敘事支撐度
lag > 0 天然氣領先化肥 高(符合預期)
lag ≈ 0 同時變動 中(共同驅動)
lag < 0 化肥領先天然氣 低(敘事較弱)

合理領先期:1-8 週(7-56 天)

主要:TradingEconomics(透過全自動 Chrome CDP 爬取) 備援:FRED Henry Hub + World Bank Pink Sheet

全自動 Chrome CDP 爬取: 腳本自動完成以下步驟,無需手動操作:

  1. 自動啟動 Chrome 調試模式
  2. 開啟 TradingEconomics 頁面並等待圖表載入
  3. 透過 WebSocket 連接執行 JavaScript 提取 Highcharts 數據
  4. 自動導航到多個商品頁面(如天然氣→化肥)
  5. 完成後自動關閉 Chrome

完全繞過 Cloudflare,無需手動驗證。

</essential_principles>

輸出三層分析:

  1. Shock Regimes: 天然氣與化肥的拋物線/暴衝區間
  2. Lead-Lag Test: 領先落後相關分析
  3. Narrative Assessment: 敘事可信度判斷

<quick_start>

全自動模式:一鍵完成數據抓取、分析與視覺化

腳本會自動啟動 Chrome、抓取數據、關閉 Chrome,無需手動操作。

Step 1:安裝依賴

pip install requests websocket-client pandas numpy matplotlib scipy

Step 2:全自動抓取數據(自動啟動/關閉 Chrome)

cd scripts
python fetch_te_data.py --symbol natural-gas --symbol urea

Step 3:執行因果假說分析

python gas_fertilizer_analyzer.py \
  --gas-file ../data/cache/natural-gas.csv \
  --fert-file ../data/cache/urea.csv \
  --output ../data/analysis_result.json

Step 4:生成視覺化圖表(Bloomberg 風格)

python visualize_shock_regimes.py
# 自動輸出到: output/gas_fert_shock_YYYY-MM-DD.png

輸出範例

{
  "signal": "narrative_supported",
  "confidence": "medium",
  "gas_shock_regimes": [
    {"start": "2026-01-20", "peak": "2026-01-22", "regime_return_pct": 29.1}
  ],
  "fert_spike_regimes": [
    {"start": "2025-10-27", "peak": "2025-10-27", "regime_return_pct": 0.0}
  ],
  "lead_lag_test": {
    "best_lag_days_gas_leads_fert": 21,
    "best_corr": 0.131
  },
  "interpretation": "天然氣領先化肥約 21 天,敘事有量化支撐"
}

注意:首次執行時,Chrome 會自動啟動並在背景抓取數據(約 60 秒),完成後自動關閉。

</quick_start>

  1. 快速檢查 - 查看最近是否有天然氣 shock 及化肥跟隨
  2. 完整分析 - 執行三段式因果檢驗並生成報告
  3. 合約對沖假說 - 輸入合約價格,計算價差壓力指標
  4. 方法論學習 - 了解 shock 偵測與領先落後分析原理

請選擇或直接提供分析參數。

路由後,閱讀對應文件並執行。

<directory_structure>

analyze-gas-fertilizer-contract-shock/
├── SKILL.md                           # 本文件(路由器)
├── skill.yaml                         # 前端展示元數據
├── manifest.json                      # 技能元資料
├── workflows/
│   ├── analyze.md                     # 完整三段式分析工作流
│   ├── quick-check.md                 # 快速檢查工作流
│   └── hedge-hypothesis.md            # 合約對沖假說分析
├── references/
│   ├── data-sources.md                # Chrome CDP 爬蟲說明
│   ├── methodology.md                 # Shock 偵測與領先落後方法論
│   ├── input-schema.md                # 輸入參數定義
│   └── historical-episodes.md         # 歷史案例對照
├── templates/
│   ├── output-json.md                 # JSON 輸出模板
│   └── output-markdown.md             # Markdown 報告模板
├── scripts/
│   ├── fetch_te_data.py               # TradingEconomics CDP 爬蟲
│   ├── gas_fertilizer_analyzer.py     # 主分析腳本
│   └── visualize_shock_regimes.py     # Shock regime 視覺化
├── data/                              # 數據快取目錄
│   └── cache/                         # 快取檔案
└── examples/
    └── sample_output.json             # 範例輸出

</directory_structure>

Read the full file on GitHub · 328 lines

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. 12d ago First seen · 328 lines · 78 tokens per session scan A 14d5f1f47674

Subscribe to this mod's changes

analyze-gas-fertilizer-contract-shock 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 3,185 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.

Related

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.

HKUDS/Vibe-Trading · 39 tokens

strategy-pivot-designer

Detect backtest iteration stagnation and generate structurally different strategy pivot proposals when parameter tuning reaches a local optimum.

tradermonty/claude-trading-skills · 28 tokens

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…

himself65/finance-skills · 161 tokens

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.

questflowai/investorskills · 44 tokens

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.

kazukinagata/shinkoku · 102 tokens

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.

kazukinagata/shinkoku · 64 tokens