N NoBullshit.wiki 中文

Livestock farm purchasing & ordering: phase-based daily-feed ordering calculator, single file - inventory split by age phase (intake per head differs severalfold between phases, and one farm-wide average is the biggest error source in ordering), and age advances daily: the group in the nursery phase last week is in grower phase this week, so any static table is wrong; the tool anchors on each group's placement date and rolls out, day by day, which phase each group is in, how many head remain, and what they eat, then aggregates to per-feed-variety order quantities on the supplier's delivery rhythm; three cap checks: the order must be eaten before best-by, must fit bin capacity, and the run-out date must not land before the delivery date - any trip fires red text, and if no order works it says so

Works with:Claude / GPT-4 classCategories:Livestock FarmLevel:Advanced Updated

You are a coding agent. Build a single-file HTML "phase-based
feed ordering calculator" for a livestock farm's purchasing to
compute suggested order quantities and latest order dates per
feed variety. Runs locally, no network, no external dependencies.

Positioning (design to this; do not build an inventory system):
farm feed consumption cannot be computed as "head count x
average intake" - intake per head differs severalfold between
age phases, and blending a creep-phase group with a finisher
group produces a number that matches neither; worse, age moves
daily, so the group in nursery last week sits in grower this
week, and a static table is wrong by the second week. This
tool has exactly one engine: each group's placement date,
advanced day by day through the phase table.

Entry, four blocks:
1. Group list: placement date, head placed, head alive today
2. Phase table (this farm's measurements; all blank, pre-fill
   nothing):
   - Phase structure: how many phases, start/end age of each
     (creep / nursery / grower / finisher cut as this farm
     actually runs it)
   - Intake per head per phase (kg or lb per head per day) -
     from this farm's own scale records
   - Feed variety per phase (two phases on one variety share
     the name)
   - Transition days between feeds (0 allowed)
3. Inventory: variety / on hand / delivery-in date / best-by
   days printed on the bag
4. Parameters (blank, I set): supplier rhythm (interval or
   times per week) and lead time, safety days, storage
   capacity (per variety or total), daily mortality/cull
   decrement (percent or head per day, 0 allowed)

Logic (every formula on the page, no black box):
- From "today," roll each group daily: age +1 -> look up the
  phase table for variety and intake -> decrement head by the
  mortality rate -> that day's consumption
- Aggregate consumption by variety, subtract available
  inventory day by day (earliest delivery-in consumed first),
  yielding each variety's daily gap
- Suggested order = gap total to the next sensible delivery +
  safety-day consumption
- Latest order date = first gap day - lead time

Three cap checks (any trip fires red; silently trimming the
order to pass is forbidden):
1. Best-by cap: on hand + suggested order > consumption
   projected before best-by - red, showing the excess; feed
   carried past best-by is a certain loss
2. Capacity cap: peak arriving inventory exceeds capacity -
   red, showing the shortfall and suggesting split deliveries
   (change the rhythm), not ordering less
3. Run-out check: first gap day precedes the arrival of an
   order placed on the latest order date - red, saying
   plainly "order now" or "this supplier's rhythm cannot
   cover it - a backup channel is needed," one of the two

Output:
- Order suggestion table: variety / on hand / suggested
  quantity / latest order date / cap status, each row with a
  formula digest (covered through which date, peak daily
  consumption)
- Red list: which cap, and the smallest fix (order days
  earlier / split deliveries / adjust the variety handoff)
- One-click copy of a plain-text order sheet, ready to paste
  to the supplier

Implementation:
- Single-file HTML, inline CSS and JS, opens by double-click,
  no network requests, nothing persists, refresh clears
- Ship one preset example (two groups at different ages, a
  three-phase intake table, one variety tripping the best-by
  cap) so red text shows on first open
- "Today" comes from the system date and prints at the top of
  the page so the anchor is visible

You must not:
- Pre-fill any intake, mortality, or best-by numbers - they
  vary enormously between farms; this farm's measurements are
  the only source
- Place orders automatically or connect to any API - the tool
  computes, the person orders
- Silently relax any cap; if no quantity works, say so in red
- Compute rations or cost-per-gain - variety choice belongs to
  nutrition and the vet; this tool answers "how much, by when"

Why it is written this way

Rolling age forward day by day is the crux, and what separates this from every generic inventory tool. The standard ordering formula - average daily use x lead time + safety stock - assumes flat consumption, true in a warehouse, false in a barn: intake climbs with age roughly in steps, a group eats severalfold more at finisher than at placement, and the highest stock-out risk sits exactly at peak intake. Worse, phases move: "current phase intake x 30 days" multiplies the wrong phase by week two. Anchoring on placement date and advancing daily makes the biological clock the planning clock: date drives age, age drives phase, phase drives variety and volume. That is not an implementation detail; it is the tool's entire reason to exist.

The three caps point in different directions, and dropping any one breaks something. Best-by caps over-ordering: feed carried past its date is a certain loss, mold toxins in humid season doubly so. Capacity caps space - and its suggested fix is splitting deliveries, not ordering less, because under-ordering converts a storage problem into a stock-out. The run-out check catches ordering late: it answers one thing - whether ordering now still arrives in time - and when it cannot, it says "this supplier's rhythm cannot cover it," sending purchasing to open a backup channel rather than offering a soft "order soon." Silent trimming is banned because a tool that quietly shrinks the order until the checks go green has made a compromise nobody knows about - the barn receives a "safe" number while the stock-out risk stands untouched.

Every intake, mortality, and best-by figure left blank is this tool's honesty line. Those numbers differ farm to farm - genetics, health status, management - and another farm's intake table pasted in here is a wrong base rate; mortality shapes the head-count curve directly. What the tool supplies is the daily roll-out algorithm and blank fields for this farm's own measurements. Pre-filling "typical industry values" feels helpful but substitutes a guess the user will never audit, wrong in silence.

The one-click plain-text order sheet is the last mile: the analysis table is for me; the sheet pasted to the supplier carries variety, quantity, delivery date, and nothing else. The chain stays "tool computes, person orders": it never touches ration formulation (nutrition and the vet's province), never places orders, never connects to anything - a single-file tool's credibility comes precisely from connecting to nothing.

Variables

Variable Notes
Phase intake table Measured on this farm (daily feed drawn divided by head on hand; two weeks of records suffice) - another farm's table or a breed manual pasted in corrupts the base rate of the whole projection
Mortality decrement Approximate daily head reduction - monthly losses from the historical log spread across days is fine; head-level precision is unnecessary, it is a correction term, not the main term
Safety days Buffer for late trucks and unplanned extra feeding - larger for distant suppliers and bad roads; it adds straight into the order, so oversizing it bakes overstocking into every order

feed orderingage phasessingle-file tool