PRD · shifts.gsaas · v1.0generic-saas Factory · blueprint #BP-041
1 · PROBLEM
Retail shift scheduling for 14 stores
Store managers build a weekly rota for 6–14 hourly staff. Today this happens in a $2,400/yr SaaS plus a spreadsheet per store for overtime, because the tool doesn't know the store's labour rules. 72% of swaps are agreed by phone and typed in afterwards. The goal is a rota that respects availability and labour rules at publish time, and lets staff swap from their phones without a manager retyping anything.
2 · WHO
Store managerBuilds and publishes the week. Approves swaps. 14 people.
Shift leadCovers gaps on the day. Can approve same-day swaps. ~30.
StaffSets availability, sees their week, requests swaps. ~140.
HROwns labour rules and the overtime report. 2 people.
3 · DATA MODEL
Store { id, name, region, opening_hours[], labour_rules → graph:Store }
Person { id, role, home_store, contract_hours → graph:Person via Identity }
Week { store, starts_on, status: draft | published | locked, version }
Shift { week, person?, start, end, role_required, break_min }
Availability { person, weekday, from, to, recurring }
SwapRequest { shift, from_person, to_person, state, approved_by → fn:approvals.route }
LabourRule { store, max_hours_week, min_rest_hours, max_consecutive_days } · never-touch for agent
4 · CORE FLOWS
- Publish a week. Manager duplicates last week → adjusts → platform checks every shift against Availability and LabourRule → conflicts block publish with a reason → publish notifies staff via fn:notify.send.
- Request a swap. Staff taps a shift → picks a colleague who is available and qualified → request routed via fn:approvals.route (shift lead same-day, manager otherwise) → both parties notified → journal entry.
- Overtime report. HR gets a scheduled report per store per month from the Journal — no spreadsheet.
5 · SCREENS · 9, each with acceptance criteria
Week gridShift editorConflict panelMy week (mobile)Swap flow (mobile)AvailabilityApprovals inboxLabour rules (HR)Overtime report
AC · Week grid · Publishing a week with any LabourRule violation is impossible; the violating shift is highlighted with the rule name. Publishing a valid week takes one click and notifies every person with a shift within 60 seconds.
6 · PLATFORM WIRING
Identity — roles: manager, shift lead, staff, HR
Knowledge Graph — Store, Person, reporting lines
Functions — approvals.route, notify.send, calendar.workingDays
Audit — every publish, swap, rule change
Inference — draft staff messages, summarise swap patterns
Observability — SLO: publish < 2s p95
7 · AGENT BRIEF
WATCHSwap requests by hour and channel · time from draft to publish · shifts edited after publish · exports and screenshots
MAY PROPOSEDefaults, shortcuts, views, notification timing, new reports
NEVER TOUCHLabourRule · contract_hours · anything that changes who gets paid for what
8 · Migration plan · 9 · Open questions — pages 2–4page 1 of 4