runbookify
← All plans
Manufacturing & Production / Raw Material & WIP Inventory

FIFO/FEFO Pick Advisor: Use Old & Expiring Stock Before It Becomes Scrap

Enter an item and a quantity; the tool lists exactly which lots and locations to pull — oldest received first (FIFO) or first-to-expire first (FEFO) — warns on expired and near-expiry stock, captures the picker's confirmation or override, and exports a clean pick log plus a stock-relief file.

BeginnerAn afternoonBuilds onNext.jsSupabaseResend
What you'll build

An internal web tool where a picker enters an item and quantity, sees the exact lots and locations to pull in FIFO or FEFO order, gets warned about expired and near-expiry lots, confirms the lot actually picked (or records an override with a reason), and exports a pick log plus a stock-relief CSV for your system of record.

Gated download

Enter your email — the plan downloads instantly and a copy lands in your inbox.

By submitting your email you'll also receive the weekly runbookify newsletter. You can unsubscribe at any time.

Before you start

  • A Supabase account (free)
  • A Vercel account (free)
  • A lot-level stock snapshot you can export as CSV (item, lot, location, quantity, received date, expiry date)
  • Your rule for each item: pick oldest-received (FIFO) or first-to-expire (FEFO)
  • Claude Code or any AI coding agent

The problem this kills

In a lot-controlled plant, two pallets of the "same" material are not the same. One was received in March and expires next month; one came in last week. If your picker grabs the fresher pallet because it's closer to the aisle, that March lot keeps sliding to the back — until the day it's expired, blocked, and written off as scrap. Multiply that across hundreds of items and a busy shop floor, and stale-stock write-offs become a line on your P&L that nobody can quite explain.

The fix is simple to say and hard to do by hand: always pull the oldest received lot first (FIFO — first in, first out) for materials that age, or the first-to-expire lot first (FEFO — first expired, first out) for materials with a real shelf life. Doing that correctly means knowing, at the moment of the pick, every lot of that item, where each one sits, how much is left, when it came in, and when it expires — and picking the right one every single time. A spreadsheet can't tell the picker that at the rack. So the rule gets followed when it's convenient and skipped when it's not.

You don't need a six-figure warehouse-management upgrade to fix this. You can build the pick advisor yourself, this afternoon.

What you'll build

An internal web tool your stockroom logs into. You import a lot-level stock snapshot — the export you already pull, with item, lot, location, quantity, received date, and expiry date. A picker types in the item and the quantity needed, and the tool instantly lists the lots to pull, in the right order: oldest-received first if that item is FIFO, soonest-to-expire first if it's FEFO. It tells the picker exactly which lot, which location, and how much to take from each — and it loudly flags anything expired or near-expiry so it gets used or quarantined, never ignored.

Then comes the part that makes it trustworthy on a real floor: the picker confirms the lot they actually pulled. If they had to deviate — the advised lot was damaged, blocked, or physically somewhere else — they record an override with a reason instead. Only after that confirmation does the tool log the pick and relieve the stock. One click exports a pick log and a stock-relief CSV in the exact columns your ERP or inventory system expects.

What's inside the Implementation Plan

The downloadable plan is a single markdown file you paste into an AI coding agent. It opens by interviewing you about your own plant — what you call an item, a lot, and a location; which items are FIFO versus FEFO; how your stock snapshot is shaped and named; what "near-expiry" means for you; your override rules; and your messiest edge cases (split picks, quarantined lots, no expiry date on some items). Then it reads a short spec back for your thumbs-up before it builds anything. That's the difference between a tool shaped to your material master and a generic template you have to fight.

From there it walks the agent through the data model (lots, pick requests, pick lines, overrides), the snapshot importer, the FIFO/FEFO ordering engine, the expiry warnings, the picker confirm/override gate, and the two exports. Every step ends with a ready-to-copy prompt. There's a full "No API yet?" path: import your lot-stock CSV, export a clean pick-log and stock-relief CSV — you never have to touch your ERP's API to ship.

The governance it includes (this is the point)

On a shop floor the controls are the product. The plan builds them in: a login so only your team uses it; row-level security so each site or organization only ever sees its own stock; a complete audit trail of who requested, advised, confirmed, overrode, and exported — and when; a hard human-in-the-loop gate so no stock is relieved until the picker confirms what they physically pulled; and a duplicate guard (the same pick request against the same lot can't be logged twice) so one pick never relieves stock twice. Every override is captured with its reason, so when a lot does get skipped you know exactly why. That's the traceability story your quality and inventory-control people want.

Who it's for

Material handlers, stockroom staff, and production planners in lot-controlled plants — food, beverage, pharma, chemicals, cosmetics, electronics, anywhere material ages or expires. If you can explain to a new hire why you pull the older pallet first, you can build this — no developer required.

You've got this — open the plan, paste the first prompt, answer a few questions about how your plant actually picks, and you'll watch your first pick advisory line itself up in the right order.

Gated download

Enter your email — the plan downloads instantly and a copy lands in your inbox.

By submitting your email you'll also receive the weekly runbookify newsletter. You can unsubscribe at any time.