From faostat-skills
Use ONLY when the user explicitly asks to compare two or more specific named entities (countries, commodities, or regions) side by side. Keywords — compare, comparison, versus, vs, benchmark, countries, crops, production, yield, area harvested, trade, growth rate. Do NOT use for a global commodity briefing → `faostat-commodity`. Do NOT use for a country food security profile → `faostat-country-profile`. Do NOT use for trend ranking (fastest growing/declining) → `faostat-trends`. Do NOT use for import dependency or supply chain risk → `faostat-trade`.
How this skill is triggered — by the user, by Claude, or both
Slash command
/faostat-skills:compareThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Produce a structured side-by-side comparison of countries, commodities, or both across agricultural metrics using FAOSTAT data.
Produce a structured side-by-side comparison of countries, commodities, or both across agricultural metrics using FAOSTAT data.
Verify that the following FAOSTAT MCP tools are available before proceeding:
faostat_search_codesfaostat_get_datafaostat_get_rankingsIf any tool is missing, inform the user: "This skill requires the FAOSTAT MCP server to be connected. Please ensure it is running and try again."
Determine from the user's message (or ask if unclear):
Map the metric to the correct FAOSTAT element FILTER codes:
Element codes below are verified hints. Resolve at runtime via
faostat_search_codesbefore use.
'2510''2413''2312''2610'; Export quantity (TCL): '2910''2612'; Export value (TCL, USD 1000): '2912'For each entity (country or commodity), call faostat_search_codes:
Countries:
faostat_search_codes(domain_code='<domain>', dimension_id='area', query='<country_name>')
Commodities:
faostat_search_codes(domain_code='<domain>', dimension_id='item', query='<commodity_name>')
CRITICAL: If ANY search returns requires_confirmation: true, present the options to the user and wait for confirmation before proceeding. Resolve each entity independently — do not skip confirmation for any of them.
Store all confirmed codes.
For each entity combination, call faostat_get_data with:
domain_code='<domain>'area='<area_code>' (or comma-separated codes if comparing multiple countries for one item)item='<item_code>' (or comma-separated codes if comparing multiple items)element='<element_filter_code>' — resolve first: faostat_search_codes(domain_code='<domain>', dimension_id='element', query='<metric name>') → use the returned FILTER code; reference hints in Step 1 to validateyear='2014,2015,2016,2017,2018,2019,2020,2021,2022,2023' — use an explicit comma-separated year list. Colon ranges like '2014:2023' have returned empty in practice; avoid them.response_format='compact' (saves tokens for multi-entity queries)limit=200 (increase limit for multi-year, multi-entity queries)show_unit=TrueIf comparing many entities, batch the calls to avoid excessively large responses. Prefer 2-4 entities per call.
China composite rule (user preference, Apr 2026). If any entity is "China" without qualification, use composite China (area code 351) — the roll-up of mainland + HK SAR + Macao SAR + Taiwan. Do NOT substitute China, mainland (41) unless the user asks for 41 explicitly. Note the choice in the methodology section and flag that FAOSTAT's own publications default to 41, so "China" values here are marginally larger than the FAO data-portal default.
From the retrieved data, compute:
(end_value / start_value) ^ (1 / years) - 1Structure the output as follows:
Title: Comparative Analysis: [Entity A] vs. [Entity B] [vs. Entity C...] — [Metric]
Comparison Table — Tabular summary with entities as columns and years (or summary stats) as rows. Include units.
Growth Rates — CAGR and total period change for each entity, clearly indicating which grew faster.
Key Differences — Narrative highlighting:
Context & Insights — Brief interpretation:
End with:
Source: FAOSTAT (FAO), accessed [current date].
Element and item code resolution. Never use a hardcoded numeric element or item code as the primary value in a faostat_get_data call. Always resolve at runtime: faostat_search_codes(domain_code='<dom>', dimension_id='element', query='<metric name>') for elements; faostat_search_codes(domain_code='<dom>', dimension_id='item', query='<item name>') for items. Numeric codes shown in reference tables and code examples are verified hints — use them to validate the search result, not as the authoritative source. Domain letter-codes (QCL, TCL, GT, EM, FBS, FS…) are stable and may be used directly.
faostat_get_rankings sometimes returns HTTP 500. If you need rankings for context (e.g., "show how Brazil ranks globally before comparing to Argentina"), fall back to faostat_get_data across reporting countries and sort client-side.year='2014:2023' produces no rows, retry with year='2014,2015,...,2023'.Use a clean tabular layout for numerical comparisons. Follow the table with a concise narrative analysis. Keep growth rate calculations transparent by showing the formula values used.
| If you need… | Use |
|---|---|
| Global commodity briefing | /faostat-commodity |
| Country food security profile | /faostat-country-profile |
| Trend ranking across commodities | /faostat-trends |
| Import dependency / supply chain risk | /faostat-trade |
Provides CDSS development patterns for drug interaction checking, dose validation, clinical scoring (NEWS2, qSOFA), and alert classification integrated into EMR workflows.
npx claudepluginhub berba-q/faostat-skills