Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

farm-economics

Real crop breakeven, profitability, and rotation math for a Claude Code skill — no invented numbers, no vague AI hand-waving.

A Claude Code skill for farm operators, ag economics students, and anyone who wants a real decision-support tool instead of a chatbot guessing at input costs.

Why this exists

Ask most AI tools "should I plant corn this year" and you get vibes. This skill either pulls a real number from the USDA NASS QuickStats API or refuses to answer — it will never fabricate a commodity price or yield.

What it does

1. Real USDA commodity data

python3 scripts/nass_lookup.py --commodity CORN --state IA --year 2025 --data-item "PRICE RECEIVED"

Pulls actual historical/current price and yield data from USDA's own public database. Requires a free API key (instant signup, no cost). Without a key, the tool tells you how to get one and exits — it does not make up a price.

2. Breakeven & profitability

python3 scripts/breakeven.py --seed 65 --fertilizer 140 --chemical 55 \
  --fuel-labor 45 --land-rent 220 --expected-yield 195 --price 4.35

Real output from that exact command:

=== Cost breakdown (per acre) ===
  Seed           $   65.00
  Fertilizer     $  140.00
  Chemical       $   55.00
  Fuel/Labor     $   45.00
  Land rent      $  220.00
  TOTAL          $  525.00

=== Breakeven ===
  Breakeven yield (at $4.35/unit): 120.7 units/acre
  Breakeven price (at 195.0 units/acre): $2.69/unit

=== At your expected yield and price ===
  Revenue/acre:  $   848.25
  Cost/acre:     $   525.00
  Profit/acre:   $   323.25
  ROI:                61.6%

Every cost category is optional — omit what doesn't apply. The tool never assumes a missing cost is zero; it flags what wasn't counted so you know the number is a floor, not a guarantee.

3. Crop rotation cross-check

python3 scripts/rotation_check.py --history "SOYBEANS,CORN,SOYBEANS" --proposed CORN

Flags same-family repeats (pest/disease carryover risk) and surfaces nitrogen-credit ranges when the prior crop was a legume — a real, quantifiable offset to your fertilizer line item, grounded in commonly-cited land-grant extension guidance (with the honest caveat that exact credit varies by region/soil — verify locally).

Install

git clone https://github.com/mikeblythe/farm-economics ~/.claude/skills/farm-economics

Claude Code picks it up automatically next session. Or just ask: "what's my breakeven on 500 acres of corn at $4.35 with these input costs..."

Honesty rules this skill follows

  • Never fabricates a commodity price or yield — real NASS data or nothing
  • Never silently treats a missing cost as $0
  • Presents rotation/nitrogen guidance as commonly-cited ranges, not certainty — a cross-check, not a replacement for your local extension agent or soil test

License

MIT

About

Real USDA NASS data + breakeven/profitability math for a Claude Code skill. No invented numbers.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages