N NoBullshit.wiki 中文

Scheduling supervisor at a neighborhood fresh-food store - the schedule red-line checker - weekly hours, consecutive days, and shift-gap minimums, flagged in red with the smallest fix that creates no new violation

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

You are a coding agent building a single-file tool for a neighborhood
fresh-food store. Build an HTML single file that opens straight in a
browser: a Schedule Red-Line Checker, used by the scheduling
supervisor before each week's schedule goes out. All computation
local; no external requests.

Data entry:
- Paste or type a week's schedule: name / date / shift start and
  end (support two shifts in one day, e.g., 6:00-10:00 +
  16:00-20:00)
- Tag part-time vs full-time (the red lines can differ between
  employment types)

Settings (three red lines, all user-defined; the tool ships zero
"statutory" numbers):
- Weekly hours cap (default 44, settable per employment type)
- Consecutive days worked cap (default 6)
- Minimum gap between shifts in hours (default 10) - clock-out to
  next clock-in

Checks and output:
- Violation matrix: person x rule, red where a line is crossed,
  stating by how much ("46.5h this week, over by 2.5h" /
  "7th consecutive day")
- Each violation carries a "smallest fix": swap which day with
  which colleague, or convert which day to a rest day - fixes
  only, no commentary on whether the schedule is otherwise wise
- Fixes must pass a chain check: a proposed swap may not create a
  new violation (if the swap pushes the colleague over a line,
  move to the next candidate)
- Summary block: store-wide weekly hours, and each person's total
  with distance to their red line
- When clean, print one line "all three lines clear" plus the two
  people closest to a line (early warning)

Hard constraints:
- The three lines carry no built-in statutory values and the tool
  outputs no legal interpretation - thresholds are set and verified
  by the user per local rules and employment type (full-time /
  part-time / contractor). The tool only checks against the lines
  you give it
- No "optimal schedule generator" - a different problem; bolting
  it on dilutes the checking itself
- No network, no upload; schedules carry employee names, so
  closing the page clears everything, with a CSV export as the
  escape hatch

Why it is written this way

Schedule violations are almost always structural: seven consecutive days is not any single day scheduled wrongly - it only exists as a pattern across seven; a 10 p.m. close followed by a 6 a.m. open looks fine on both days apart. Inside a five-by-seven grid the eye cannot see cross-row patterns; a rules engine sweeps them in three seconds. The tool's whole point is turning "self-check before posting" from a matter of conscience into a fixed mechanical step.

Leaving all three lines blank - no statutory numbers - is deliberate. Jurisdictions and employment types carry different limits; hard-code one and the tool either terrifies or lulls, and worse, users start treating "the tool's default" as the law. The right division of labor: the employer verifies local thresholds and sets the lines; the tool mechanically compares. That boundary is also the firewall keeping this tool from becoming a compliance imprimatur.

The shift-gap line is the one that bites neighborhood stores hardest: closing at ten, opening at six - eight hours apart, each shift individually defensible, month after month. This is the line that catches invisible fatigue scheduling - every shift compliant, the human ground down. The default of ten hours is simply the level where such patterns surface; the store can tighten it.

The chain check on fixes was learned the hard way: the trap with "swap with a colleague" suggestions is that the swap lands the colleague over a line - a well-meant fix manufacturing a second violation. Every fix must be re-run against all three lines so it cures one red flag without spawning another; only then can a supervisor paste the fix straight into the schedule.

Variables

This prompt has no blanks to fill in; the three red lines (weekly hour cap, consecutive-day cap, shift-gap minimum) are set by the user in the tool's settings per local rules.

schedulinglabor hourscompliance