Scheduling supervisor shift-staggering tool for the double peak - hourly cup forecast in, staggered-shift draft with red-flagged coverage gaps out
Please build me a single-file HTML shift-staggering tool
for a coffee shop. It opens straight in the browser, no
network, no dependencies, data stored locally only.
Build it as the scheduling supervisor's drafting board:
slice the day into staggered short shifts that trace the
double-peaked coffee curve, instead of giving everyone
the same rectangular block.
Put this background in the tool's intro text: coffee
traffic is double-peaked - a sharp morning-commute spike,
a smaller afternoon bump, and a long trough between.
Rectangular blocks spend wages on the trough; this tool
exists to make "short shifts on the peaks, long shifts
holding the floor" visible.
Data it takes in:
1. Hourly cup forecast: estimated cups per open hour,
editable cell by cell, with paste-in import of
two-column "hour, cups" text
2. Staff roster: name, hourly rate, type (full-time/
part-time), availability window (e.g. 6:00-13:00),
skill - one of three: certified barista / register
and packing / trainee shadow (certified means able
to run espresso drinks independently)
3. Constraints: minimum shift length 【】 hours, maximum
【】 hours, minimum gap between one person's shifts
【】 hours, part-time weekly cap 【】 hours, cups per
staff-hour 【】, pre-open prep block 【】 minutes
Core behavior:
- Shift drafting: a half-hour grid starting 【】 minutes
before open (prep produces no cups but must be
staffed); click start and end to create a shift; one
person may hold several shifts per day (a morning-
spike short shift + an afternoon short shift)
- Demand line: required staff per hour = that hour's
cups ÷ cups per staff-hour, rounded up, shown beside
actual scheduled staff; gap hours flagged red
- Certification flag, reported separately from headcount:
any open hour where zero certified baristas are on
the floor turns the whole row red - headcount can
look fine while nobody can independently make a
drink; this is the gap schedules miss most
- Red flags only: no auto-scheduling, no "one-click
fix" - whose hours get cut, who stacks two shifts,
whether the morning block shifts earlier or later are
human trade-offs; the tool's job is making invisible
gaps visible
- Constraint violations flagged red too: below minimum
length, over maximum, gap too small, part-timer over
the weekly cap
Output:
- Today's shift table: one row per person - shift
segments, total hours, wage subtotal
- Coverage table: per hour - forecast cups / required
staff / scheduled staff / certified baristas, with a
red-cell count in the footer
- Cost block: projected labor cost for the day; with an
entered revenue forecast, the labor percentage
- One-click plain-text shift table for pasting into the
staff group chat (red cells excluded - what gets sent
is the decision, not the debate)
Data and UI:
- localStorage persistence, survives refresh; a
"copy as tomorrow's template" action
- Single file, print-friendly, readable on a phone
Why it is written this way
Positioning it as a drafting board rather than an auto-scheduler matters because staggered shifts rearrange people's income: every automated step that looks like a time-saver ends with the supervisor explaining to a black box why someone's hours vanished. A human clicks shifts into place and the tool flags red - every trade-off is an explicit decision that can be traced to a person, which is the only version of this schedule the crew will accept.
The certification flag being separate from the headcount flag is the coffee-specific trap: three people on the morning floor with exactly one who can pull shots independently reads as fully staffed on a headcount report while the bar still can't open. Skills are three fixed levels - certified, register/packing, trainee - rather than free-form tags, precisely so this constraint is enforceable; a fuzzy tag is no constraint at all.
The double-peak curve is an input, not a built-in assumption: an office-district shop and a mall shop differ wildly in morning-spike share, so the tool never assumes a shape - it converts whatever curve the shop enters into a demand line. The pre-open prep block gets its own treatment (no cups, mandatory staffing) because it's the classic staggered-scheduling blind spot: by cups alone, staffing starts at seven, but machine warm-up, dial-in, and milk prep need someone at 6:30. Leave that block out and the tool stays red through the first open hour every single day.
"Copy as tomorrow's template" rather than a weekly one reflects how often coffee-shop part-timers' availability changes day to day: daily reuse matches the real rhythm, and it forces the scheduler to walk the demand line every morning instead of letting the tool become furniture nobody looks at.
Variables
| Variable | Notes |
|---|---|
| Shift length bounds | Minimum and maximum hours per shift - kills both the one-hour fragment and the twelve-hour marathon |
| Minimum gap between shifts | Hours between one person's two shifts; keeps a morning spike + afternoon pair from becoming a double |
| Part-time weekly cap | Maximum weekly hours for part-timers per your policies |
| Cups per staff-hour | Cups one barista steadily produces per hour, from your own peak observation; drives the demand conversion |
| Pre-open prep block | Minutes before open that someone must be present for start-up and prep; staffed mandatorily, produces no cups |