Gas station scheduling supervisor - 24-hour weekly roster tool - the roster follows the pumps and the tanker: rush-hour coverage, the overnight safety minimum, and a free-floating attendant for every fuel-delivery window are hard-wired at once, and when they cannot all be met the tool prints them in red rather than quietly loosening a constraint to produce a schedule that looks workable
You are a coding agent. Build a single-file HTML "gas station weekly
roster tool" for the scheduling supervisor of a 24-hour station:
produce a week that covers the rushes and the delivery windows, and
print every hard-constraint violation in red. Runs locally, no
network, no dependencies.
Positioning (design to this; do not build a generic roster tool):
the defining fact of a fuel station is that the roster follows the
pumps and the tanker. The commute rushes are the two busiest spans
of the day, overnight traffic is thin but cannot drop below the
safety minimum, and every tanker arrival needs one extra attendant
with delivery-supervision credentials who is not occupied at a pump.
A convenience store's flat hourly-coverage template does not fit:
the question is not "how many bodies per hour" but "rushes covered,
nights safe, deliveries watched" - all three at once.
Four input blocks:
1. Staff: name, credential tags (certified fueler / delivery
supervision / register / shop - tags editable), target weekly
hours
2. Availability: each person's weekly availability - a hard
boundary; nobody may be scheduled into an unavailable slot
3. Rules (every number user-configured): overnight minimum head
count [ ], weekly hours cap [ ], consecutive-day cap, minimum
rest between shifts
4. Demand: three segment types - rush / normal / night - each with
start-end hours and a minimum headcount, weekdays and weekends
set separately; plus delivery windows: expected tanker day and
hours for the week, each requiring one delivery-supervision
credential on shift and free of pump duty
Hard constraints (violations must print in red; silently relaxing
any of them to produce a "workable-looking" schedule is forbidden):
1. On-duty count per segment >= that segment's demand; rushes
additionally need at least one person with the register tag
2. Night segments staffed >= the overnight minimum, with at least
one certified fueler on shift
3. Every delivery window has at least one person holding the
delivery-supervision tag on shift, not counted toward pump
positions
4. Weekly hours, consecutive days and rest gaps per person - any
breach turns the whole row red
5. When a rush and a delivery window overlap, the headcounts add;
they do not substitute for each other
Output:
- Weekly grid: 7 days x segments, people view and day view, cells
clickable to reassign; any manual edit re-runs every check live
- Segment projection: "on duty / required" side by side per segment,
shortfalls visible at a glance
- Red list: each entry names the constraint broken, who and which
segment, and a minimal-fix suggestion (e.g. "Saturday delivery
window has no supervisor: slide A's mid shift two hours later and
it all goes green")
- One-click copy of the roster as plain text (by day and by person)
straight into the staff group chat
Implementation:
- Single-file HTML, inline CSS and JS, opens by double-click, zero
network requests
- Nothing persists; refresh wipes
- Preloaded demo station (~10 people, 2 new hires) showing a rush
shortfall, a compliant night, and a delivery window on first open
You may not:
- Build "labor-cost optimization" or any cleverness - get the five
hard constraints green and solid first
- Silently relax any configured number; if it cannot be met, say so
in red and leave the decision to me
- Add accounts, cloud sync, or external libraries
Why it is written this way
The dividing line from an hourly-coverage convenience-store tool is that this roster follows two external clocks: the pumps and the tanker. A store has one long evening peak; a station has two sharp commute spikes with a long flat valley between - and then the delivery windows, whose timing the station does not choose. Making "rush / normal / night" segments plus independent delivery windows input objects, instead of letting the supervisor flatten everything into hourly headcounts, is what keeps the roster from failing at the exact moment the tanker pulls in.
"Overlap counts additively" earns its own constraint because it is the most invisible gap in paper scheduling. Tankers often arrive just before the morning rush; the supervisor sees enough bodies and stops looking - enough for pumping, that is, while the one person holding supervision credentials is in the middle island directing traffic. If the two demands do not add, the schedule is always green on paper and fails at the moment the grounding clamp comes out.
"No silent relaxation" is a discipline inherited across this site's roster tools: the dangerous failure of a roster tool is not an unsolvable week but a quietly solved one. Credential constraints are where it bites hardest - slotting someone without supervision credentials into the delivery-watch position produces no error message and quietly reassigns responsibility for the highest-risk hour of the week. The tool's honesty is worth more than its cleverness; what to do about a red line stays with the supervisor.
Variables
| Variable | Description |
|---|---|
| Overnight minimum head count [ ] | Set by company security policy and the station's location; a safety floor, not a staffing target - squeeze the day shifts before you touch the night |
| Weekly hours cap [ ] | Local rules and company policy; set full-time and part-time separately |
| Consecutive days and rest gap | Prevents morning-shift-into-night-shift chains; once set, treat as hard |
| Delivery windows | Entered per tanker from this week's delivery plan; when the plan changes, change the windows - do not reuse last week's |