# Supply Chain Analysis

> Compute supply chain risk metrics for critical minerals — HHI concentration, net import reliance, top-3 share, and trend analysis

- Skill: `lamm-mit/supply-chain-analysis` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds@latest add lamm-mit/supply-chain-analysis`
- Raw SKILL.md: https://api.skillmd.com/api/skills/lamm-mit/supply-chain-analysis/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: lamm-mit (https://skillmd.com/u/lamm-mit)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/lamm-mit/supply-chain-analysis

---


# Supply Chain Risk Analysis

Compute supply chain risk metrics for critical minerals including the Herfindahl-Hirschman Index (HHI) for production concentration, net import reliance (NIR), top-3 country share, and multi-year trend analysis. Combines data from BGS World Mineral Statistics and USGS Mineral Commodity Summaries.

## Usage

### Full risk assessment:
```bash
python3 {baseDir}/scripts/supply_chain_metrics.py --commodity "Lithium"
```

### Specific metrics:
```bash
python3 {baseDir}/scripts/supply_chain_metrics.py --commodity "Cobalt" --metrics hhi,nir,top3share
```

### Historical trend:
```bash
python3 {baseDir}/scripts/supply_chain_metrics.py --commodity "Rare earths" --metrics trend --year-from 2015
```

### JSON output:
```bash
python3 {baseDir}/scripts/supply_chain_metrics.py --commodity "Graphite" --format json
```

## Parameters

| Parameter | Description | Default |
|-----------|-------------|---------|
| `--commodity` | Commodity name (BGS naming) | Required |
| `--year` | Target year for analysis | latest available |
| `--year-from` | Start year for trend analysis | - |
| `--metrics` | Comma-separated metrics: hhi, nir, top3share, trend, all | all |
| `--format` | Output format: summary, json | summary |

## Metrics Explained

| Metric | Description | Risk Thresholds |
|--------|-------------|-----------------|
| **HHI** | Herfindahl-Hirschman Index (0-10000) | <1500 low, 1500-2500 moderate, >2500 high |
| **NIR** | US Net Import Reliance (%) | <25% low, 25-75% moderate, >75% high |
| **Top-3 Share** | Combined share of top 3 producers | <50% low, 50-75% moderate, >75% high |
| **Trend** | Year-over-year production change | Increasing/stable/declining |

## Examples

```bash
# Comprehensive lithium supply chain risk assessment
python3 {baseDir}/scripts/supply_chain_metrics.py --commodity "Lithium" --format json

# Cobalt concentration analysis
python3 {baseDir}/scripts/supply_chain_metrics.py --commodity "Cobalt" --metrics hhi,top3share

# Rare earth NIR trend
python3 {baseDir}/scripts/supply_chain_metrics.py --commodity "Rare earths" --metrics nir,trend --year-from 2018
```

## Notes

- HHI from BGS country-level production data (free API, no auth)
- NIR from USGS Mineral Commodity Summaries (requires local data files)
- Trend analysis requires multiple years of data
- Some commodities may not have all metrics available
- For raw production data, use `bgs-production` skill

