N NoBullshit.wiki 中文

Fresh supermarket cashier - a single-file PLU lookup and drill tool, with your own code sheet pasted in

Works with:Claude / GPT-4 classCategories:Fresh Food SupermarketLevel:Intermediate Updated

Build me a single-file HTML PLU lookup and self-drill tool for
supermarket cashiers and scale-desk staff. Double-click to run, no
network.

Background first: every store's PLU scheme differs (some 4-digit
category codes, some 5-digit house codes), so the tool ships with
**no built-in code sheet** - empty start, the user pastes their
own store's sheet.

Code sheet management:
- Paste import: two columns (item name, code), straight from a
  spreadsheet; also editable row by row in the page
- The sheet persists in localStorage (it gets used every shift -
  persistence required), plus plain-text export/import for moving
  machines or sharing with colleagues
- Code-length validation as an adjustable parameter (default 4-5
  digits): pasted rows exceeding it get highlighted - almost
  certainly a product barcode pasted where a PLU belongs; don't
  swallow them silently

Lookup mode (mid-shift):
- Type a fragment of the item name or a few digits of the code;
  instant fuzzy match
- Results in large type: name + code, legible at arm's length
  from the screen
- Enter clears and re-arms for the next query - this is a
  high-frequency flow, minimize keystrokes

Drill mode (10 minutes after shift):
- Two question types: name -> code, and code -> name
- Missed questions re-enter the round's queue until answered
  right twice in a row
- End-of-round summary, two tables: accuracy, and the **10
  slowest codes by per-question response time** - slow is
  unmemorized even when correct, so time matters as much as
  right/wrong
- A "mark as tricky" toggle while drilling; later rounds can
  drill marked items only - new hires usually stall on the same
  dozen high-frequency items

Hard requirements:
- Single file, no build step, no external CDN, fonts or libraries
- An empty sheet shows an import guide with a two-column paste
  example, never a blank page
- Drill scores are NOT persisted and there is no leaderboard -
  deliberate: stored scores invite score-farming, and farming
  trains question-recall, not code-recall. Sheet persists, scores
  don't; do not "balance" this asymmetry for me
- No accounts, no cloud sync

Why it is written this way

New cashiers are slow specifically at loose produce: five seconds flipping the sheet, three loose items in a basket, and the line is backing up. The tool's core judgment is that drilling beats looking up - lookup mode is the crutch that covers a shift; drill mode is the cure that turns frequent codes into reflexes. So the drill isn't a garnish: re-queuing misses and ranking by response time are both engineered toward "drilled until fluent."

Shipping without a built-in code sheet is deliberately counter-instinctive. A coding agent will cheerfully pre-load a "common produce PLU table" - but store schemes differ, and a memorized wrong code costs far more than a slow lookup (a mistyped code is an instant price complaint). Empty start plus an import guide binds the tool to the store's own sheet as the single source of truth from minute one.

"The 10 slowest codes" is more useful than accuracy: a code you answer correctly after eight seconds of thinking is exactly the one that will stall your lane at peak. Counting only right/wrong hides those. Ranking by per-question time treats "slow" as its own kind of wrong - which is what gives the drill its aim.

The persistence asymmetry (sheet stored, scores not) comes from real tool-design scar tissue: the moment scores land on disk, practice drifts from "fix the weak codes" to "farm a pretty number" - and farming trains the quiz, not the codes. Saying "don't balance this asymmetry" out loud in the prompt is what stops the agent's helpful "improvement."

Variables

Variable Notes
Code-length validation Default 4-5 digits; set to the store's scheme
Round length Default 10 minutes; switchable to fixed question counts
Tricky-mark ceiling Suggested cap when drilling marked items only, to keep focus

PLU codestrainingspeed