runbookify
← All plans
Manufacturing & Production / Quality Control & Inspection

Incoming Inspection with AQL Sampling: Stop Eyeballing Received Lots

Import received lots, let the tool pull the right sample size from your AQL table, record measured and visual results per characteristic, auto-suggest accept/reject/quarantine — then your quality lead approves the disposition before stock status is updated.

IntermediateA weekendBuilds onNext.jsSupabaseResend
What you'll build

An internal web tool where receiving QC picks a received lot, the tool computes the sample size from the lot quantity and your AQL, the inspector records results per characteristic, the tool auto-suggests accept/reject/quarantine, your quality lead approves the disposition, and you export an inspection record plus a stock-status update.

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 receiving export you already pull: a CSV/Sheet of received lots (item, supplier, lot, qty)
  • Your sampling table and AQL levels, and the inspection characteristics you check per item
  • Claude Code or any AI coding agent

The problem this kills

A truck backs up to the dock, a lot of parts comes off, and somebody in receiving QC has to decide: is this good enough to put into stock? Too often the answer is "grab a couple, look them over, looks fine." That's not inspection — that's a guess. Pull two parts from a lot of 5,000 and you've checked four-hundredths of a percent of it. When a defect slips through and shows up on the line a week later, there's no defensible record of what was checked, how many, or by whom.

The fix is AQL sampling — a published table (ANSI/ASQ Z1.4, or your customer's spec) that tells you, for a given lot size and quality level, exactly how many pieces to pull and how many defects you're allowed to find before you reject the lot. It's the standard the auditors expect. But the table lives in a binder or a PDF, the inspector reads off the wrong row under time pressure, results get scribbled on a traveler, and the accept/reject call comes down to who's having a good day. Nothing links the result back to the supplier and lot, so you can't build a scorecard or prove anything in an audit.

You don't need a six-figure quality module to fix this. You can build the inspection tool yourself, this weekend.

What you'll build

An internal web tool your receiving QC team logs into. You import the lots that came in today — item, supplier, lot number, quantity — from the receiving export you already pull (or you type one in). The inspector picks a lot, and the tool reads your sampling table: it takes the lot quantity, finds the right row for your inspection level and AQL, and tells the inspector exactly how many pieces to sample and the accept/reject numbers (the most defects allowed before the lot fails).

The inspector records results against the characteristics you actually check for that item — dimensions with a measured value and a spec, visual pass/fail, function tests — and marks each sampled piece. As defects are tallied, the tool compares the count to the accept number and auto-suggests a disposition: accept, reject, or quarantine. Then comes the gate: the inspector can't change stock status. The quality lead reviews the record and approves the disposition — accept into stock, reject back to the supplier, or quarantine pending review. Only then does the tool export the inspection record and the stock-status update. Every result is tied to the supplier and lot, so supplier scorecards build themselves.

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 incoming inspection process — which sampling standard and AQL levels you use, the characteristics you check per item and how you spec them, your real lot sizes, who's allowed to disposition a lot, and your messy cases (no sampling plan on file, partial receipts, supplier deviations) — and 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 quality system and a generic template you have to fight.

From there it walks the agent through the data model (suppliers, items and their characteristics, the sampling table, received lots, inspections and results), the lot importer, the duplicate guard on receipt/lot ID, the sample-size-and-acceptance calculator, the results-entry screen, the auto-suggested disposition, the quality-lead approval gate, and the final export of the inspection record plus stock-status file. Every step ends with a ready-to-copy prompt. There's a full "No API yet?" path: import a receiving CSV, export a clean inspection + stock-status CSV, and you never have to touch your ERP's API to ship.

The governance it includes (this is the point)

In quality, the controls are the product — that's what survives an audit. The plan builds them in: a login so only your QC team can use it; row-level security so each plant or organization only ever sees its own lots; a complete audit trail of who sampled, recorded, suggested, and approved, and when; a hard human-approval gate so a lot's stock status cannot change until the quality lead signs off on the disposition; and a duplicate guard (on receipt/lot ID) so the same lot can't be inspected and dispositioned twice. The inspector drafts and records — a person with authority commits the disposition. That's the defensible inspection story your auditor and your customers want.

Who it's for

Incoming and receiving inspectors, quality technicians, and the quality leads who own lot disposition. If you can explain to a new hire how you pick a sample size and what makes a lot worth rejecting, 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 inspection actually runs, and you'll watch your first lot pull its own sample size and suggest a disposition.

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.