skills/comtrade-trade/SKILL.md
Query UN Comtrade bilateral trade flows (USD, kg) for critical minerals by HS code, country, and year
npx skillsauth add lamm-mit/scienceclaw comtrade-tradeInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Query UN Comtrade for bilateral trade flows of critical minerals. Returns trade values (USD), net weight (kg), and flow direction (imports/exports) by HS commodity code, reporter country, partner country, and year.
python3 {baseDir}/scripts/comtrade_query.py --mineral lithium
python3 {baseDir}/scripts/comtrade_query.py --hs-code 282520 --reporter 842
python3 {baseDir}/scripts/comtrade_query.py --mineral cobalt --reporter 842 --flow X --year 2022
python3 {baseDir}/scripts/comtrade_query.py --mineral rare_earth --format json --year 2023
| Parameter | Description | Default |
|-----------|-------------|---------|
| --mineral | Critical mineral name (lithium, cobalt, rare_earth, graphite, nickel, manganese, gallium, germanium, copper, hree, lree) | - |
| --hs-code | HS commodity code (alternative to --mineral) | - |
| --reporter | Reporter country code (e.g., 842 for USA, 156 for China) | 0 (all) |
| --partner | Partner country code | 0 (world) |
| --flow | Trade flow: M (imports), X (exports), M,X (both) | M,X |
| --year | Year(s), comma-separated | 2023 |
| --limit | Maximum records to return | 500 |
| --format | Output format: summary, detailed, json | summary |
| Name | HS Codes | Description |
|------|----------|-------------|
| lithium | 253090, 282520, 283691, 850650 | Ores, oxide/hydroxide, carbonate, batteries |
| cobalt | 2605, 282200, 810520, 810590 | Ores, oxides, unwrought, articles |
| rare_earth | 2846, 280530 | REE compounds, REE metals |
| hree | 284690 | Heavy REE compounds |
| lree | 284610 | Light REE compounds |
| graphite | 250410, 250490, 380110 | Natural (amorphous, crystalline), artificial |
| nickel | 2604, 7501, 750210, 750220, 281122 | Ores, matte, unwrought, alloys, oxides |
| manganese | 2602, 811100 | Ores, unwrought |
| gallium | 811292 | Unwrought |
| germanium | 811299 | Other base metals |
| copper | 7402, 7403 | Refined, unrefined |
# US lithium imports
python3 {baseDir}/scripts/comtrade_query.py --mineral lithium --reporter 842 --flow M --year 2023
# Global cobalt trade flows
python3 {baseDir}/scripts/comtrade_query.py --mineral cobalt --format detailed
# China rare earth exports
python3 {baseDir}/scripts/comtrade_query.py --mineral rare_earth --reporter 156 --flow X --year 2022
# Nickel trade by specific HS code
python3 {baseDir}/scripts/comtrade_query.py --hs-code 2604 --format json
UNCOMTRADE_API_KEY environment variabletools
Onboard and manage Paperclip AI for research-paper knowledge and agent orchestration
development
Perform AI-powered web searches with real-time information using Perplexity models via LiteLLM and OpenRouter. This skill should be used when conducting web searches for current information, finding recent scientific literature, getting grounded answers with source citations, or accessing information beyond the model knowledge cutoff. Provides access to multiple Perplexity models including Sonar Pro, Sonar Pro Search (advanced agentic search), and Sonar Reasoning Pro through a single OpenRouter API key.
testing
Generate a structured scientific PDF report from a JSON description. Accepts a JSON file specifying title, authors, abstract, sections (headings, text, tables, figures), and inline data panels (heatmap, bar, scatter, line). Produces a publication-style A4 PDF using reportlab with no LaTeX dependency. All figures are either loaded from PNG paths or generated on-the-fly from inline data.
development
Execute arbitrary Python code and return stdout. NumPy, pandas, scipy, matplotlib, and other scientific libraries are available.