Convenience store scheduling supervisor - 24-hour weekly schedule tool - every hour needs a body, not every shift - hourly coverage, a two-person night safety window, and handover overlap as hard constraints, and no constraint gets silently relaxed to print a plausible-looking week
You are a coding agent. Build a single-file HTML
"24-hour convenience store weekly schedule tool"
for a scheduling supervisor: produce a week of
hourly, gap-free coverage and put every hard-
constraint violation on screen in red. Runs
locally, no network, no dependencies.
Scope (build to this; do not build a generic
scheduler): the premise that makes this store
different is that it never closes - not an early
shift and a late shift but 168 hours that each
need a body, a night window that wants two people
for safety, and a face-to-face handover with
overlap at every change of crew. Shift-block
templates built for restaurants do not fit here.
Not a general-purpose scheduler.
Four inputs:
- Staff list: name, skill tags (register, fresh
food, stocking - tags editable), target weekly
hours
- Availability: each person's weekly available
hours - part-time availability is a hard
boundary; nobody gets scheduled outside it
- Rule settings (every value is mine to set):
night two-person window [ ] (toggle plus start
and end hour; at least 2 on the floor each hour
inside it), weekly hours cap [ ] (separate
values for full-time and part-time allowed),
consecutive-day cap, minimum rest between
shifts, handover overlap [ ] minutes
- Hourly demand: minimum bodies per hour,
settable per day
Hard constraints (violations must be listed in
red; silently relaxing any of them to print a
plausible-looking week is forbidden):
1. Hourly coverage: on-floor count meets that
hour's demand (floor of 1); empty hours
render red
2. Inside the night two-person window: at least
2 on the floor every hour
3. Every night hour includes at least one person
tagged register-qualified, able to run the
till alone
4. Handover overlap: adjacent shifts overlap by
at least the configured minutes - cash,
keys, and the fresh-food date and temperature
log hand over face to face, with no
unattended gap
5. Labor law limits and house rules: weekly
hours, consecutive days, rest between shifts
- any breach turns that staff member's whole
row red
Outputs:
- Week grid: 7 days x 24 hours, cells clickable
to adjust assignments; every manual edit
re-runs all checks instantly
- Hourly headcount projection: on-floor versus
needed side by side, so the short hours are
visible at a glance
- Red-item list: each line names the constraint
broken, who and which hour is involved, and a
minimal fix (example: "Tue 02:00 short 1
person: slide one person's Tuesday shift two
hours earlier and the week goes all green")
- One-click plain-text export of the week, by
day and by person, ready to paste into the
staff group chat
Implementation requirements:
- Single HTML file, inline CSS and JS, opens by
double-click, no network requests
- Nothing persists; refresh clears
- Preload one sample store (about 8 staff
including 2 student part-timers) so coverage,
red items, and the handover overlap are
visible the moment the page opens
You will not:
- Build "automatic labor-cost optimization" or
any extra cleverness - get the five hard
constraints all green first
- Silently relax any constraint value; if the
week cannot be staffed, say so in red - the
tradeoff call is mine
- Add accounts, cloud sync, or external
libraries
Why it is written this way
An hourly grid instead of shift blocks is the dividing line between this tool and every restaurant scheduler it might be mistaken for. Restaurants have natural peak boundaries, so a shift is a sensible unit; a 24-hour store has no such boundary - coverage is a property of each individual hour, and an early/late template hides a one-hour gap at 5 a.m. inside the seam between two blocks. Starting from 168 cells, with empty hours rendering red, leaves the seam nowhere to hide.
The red-item list with minimal fixes, and the explicit ban on silently relaxing a constraint to print a plausible-looking week, is the single most important sentence in the prompt. The dangerous failure mode of schedule tools is not failing to produce a table - it is producing one by quietly shaving the overlap minutes or letting a single-body night pass as double-staffed. That table fails at 2 a.m. with nobody holding the tradeoff that produced it. If the week cannot be staffed, the tool owes the supervisor that fact in red, plus the smallest change that would fix it; whether to make that change stays with the supervisor. Honesty is worth more than cleverness in a scheduler.
The night two-person window and the handover overlap are first-class constraints because they are what convenience stores actually have and other schedulers do not: two bodies overnight is a safety minimum, not redundancy - the first minute of an incident runs on the second person being there - and overlap minutes make cash, keys, and the fresh-food log change hands face to face instead of riding an unattended gap. Windows, caps, and minutes are all left to the user to set, because security policies and handover checklists vary widely; the prompt welds the structure, not the numbers.
The preloaded sample store and the nothing-persists rule are two sides of usability. The tool's value has to be visible within ten seconds of opening - what a red item looks like, how overlap renders - and a blank page cannot show that; a worked example with student part-timers in it explains the whole tool, then gets edited into the real store. And roster data is staff personal information: refresh-clears is what makes it safe to run on any computer in the store.
Variables
| Variable | Description |
|---|---|
| Night two-person window | The safety window's toggle and hours - set by the store's location and company security policy; once switched on, treat it as a hard constraint, not an aspiration |
| Weekly hours cap | From local labor law limits and company policy, not the store next door's number; where full-timers and part-timers differ, set separate values |
| Handover overlap minutes | Longer as the handover checklist grows (cash count, keys, fresh-food dates and temperature log); once set, do not shave it - zero overlap is a canceled handover |
| Consecutive-day cap and rest between shifts | What stops clopening - a close followed by next morning's open; set the gap from commute reality and local rules, then enforce it as written |