ShiftFlow PRO — AI Retail Workforce Scheduler Case Study | Abhay Kumar
Internal Tool · In Production

ShiftFlow PRO

An AI-generated scheduling tool built for a real retail store — turning hours of manual spreadsheet wrangling into a compliant, budget-aware two-week roster in minutes.

My role
Requirements → build
Status
v2.5.0 · Live
Stack
Client-side JS + LLM APIs
AI providers
Gemini · Claude
The problem

A schedule is a constraint-satisfaction problem, done by hand

Every two weeks, the store manager rebuilt the roster from scratch in a spreadsheet — reconciling contractual hour guarantees, shifting statutory-holiday hours, labor budgets, and role coverage all at once, entirely from memory and habit.

  • Guaranteed weekly hours differ by employment type — Regular staff need exactly 40, RPT need 32–40, PT is flexible 0–40.
  • Statutory holidays shift store hours and require auto-populated STAT shift codes.
  • Coverage rules keep conflicting employees apart and guarantee critical roles (opening manager, morning auditor) are always staffed.
  • A wrong guarantee can trigger a union grievance — the cost of a mistake is real, not cosmetic.
Discovery

Who the schedule actually serves

SM

Store Manager · Primary

Needs a compliant draft fast, a quick replacement during call-ins, and confidence that guarantees and budgets are met without doing the math themselves.

Pain: grievances from under-scheduling, budget overruns, split-shift math
SE

Store Employee · Indirect

Needs consistent scheduling patterns, fast approval on time-off, and confidence their availability window is actually respected.

Pain: inconsistent shifts, slow time-off turnaround
Backlog

User stories that shaped the build

US-01 As a store manager, I want guaranteed weekly hours enforced automatically so I never risk a union grievance from under-scheduling. Must
US-02 As a store manager, I want an AI-generated draft schedule from my constraints so I don't build the roster by hand every two weeks. Must
US-03 As a store manager, I want statutory holidays to auto-populate STAT shifts and adjusted hours so holiday scheduling isn't a manual exception. Must
US-04 As a store manager, I want a one-click coverage finder when someone calls in sick so I can fill the shift without scanning the roster by hand. Should
US-05 As a store manager, I want conflicting breaks flagged automatically so two people in the same role aren't both out at once. Should
US-06 As a store employee, I want my availability and time-off requests respected in the schedule so I'm never booked when I can't work. Must
US-07 As a store manager, I want to upload past schedules so the AI learns our store's real operational patterns over time. Could
Requirements

Spec'd as testable acceptance criteria

RequirementPriority
Enforce REG (40h) / RPT (32–40h) / PT (0–40h) guaranteed-hour bands on every generated draftMust
Force structured JSON output (schedule + reasoning) from all three LLM providersMust
Auto-populate STAT shift codes and Sunday-style hours on designated holidaysMust
Run break generation client-side, deterministically — never delegated to the LLMMust
Coverage finder excludes candidates already scheduled, unavailable, or over 40h for the weekShould
All API keys and roster data stay in client-side storage — no backend, no server-held PIIShould
Parse historical spreadsheets client-side to extract store-specific shift trendsCould
My role

From the manager's actual workflow to a shipped tool

I sat with the scheduling process directly, translated every contractual and operational rule into an explicit constraint set, and specified how an LLM could generate a compliant draft a manager could trust. I then built the application end to end — the rules engine, the AI integration layer across three providers, and the editing surface managers actually use every two weeks.

What I built

A rules engine wrapped around three AI providers

Multi-provider AI generator

Direct client-to-API calls to Gemini, Claude, and GPT models. Every response is forced into a structured JSON schema — a shift-code grid plus a plain-language rationale for every decision.

Guaranteed-hours rules engine

Enforces REG/RPT/PT hour bands, statutory-holiday shift codes, and role coverage before a draft ever reaches the manager.

Break planner & conflict checker

Break generation runs client-side rather than through the LLM — deterministic, and immune to model drift. Flags overlapping breaks for employees sharing a role.

Call-in coverage finder

One click scans the roster for a valid replacement, respecting availability, hour caps, and time-off — then logs the absence automatically.

Under the hood

The schedule is generated, not typed

Compiled store constraints — availability, holidays, budgets, roles — go to the model as a single context. It returns a shift-code grid plus its reasoning, which the manager reviews inline before publishing.

// forced structured output{
  "schedule": [{ "empId": "E014", "days": ["M","M","O","C","OFF","OFF","P"] }],
  "reasoning": "Kept two Morning Auditors apart on Sat per coverage rule; E014 held at 40h (REG)…"
}
Outcome

A manager reviews a draft instead of building one

The manual reconciliation — hour guarantees, statutory shifts, break conflicts, budget ceilings — now happens before the manager ever opens the board. They spend their time adjusting a draft and handling call-ins, not building the schedule from a blank grid.

~19
Employees scheduled per roster
Biweekly
Roster cadence automated
0
Grievances from guarantee misses since launch
Roadmap

What ships next

v2.6.0

Multi-location switching + a shared employee pool to borrow staff across nearby branches.

v2.7.0

SMS/email schedule publishing plus an employee portal for manager-approved shift trades.

v3.0.0

POS-driven traffic forecasting and direct payroll export (ADP, Ceridian).

More case studies

See the rest of the work, or get in touch.