Shift Scheduler
Overview
This skill manages staff scheduling queries and shift-related requests.
It reads schedule data from the configured source and routes requests
to the appropriate manager for approval.
Depends on: Staff list + schedule data from Step 02 / Step 05 config.
Configured in: skills_config.shift-scheduler
Data Source Options
| Source | Config Value | Setup |
|---|
| Google Sheets | INLINECODE1 | Share link in config |
| Excel/CSV file |
"file" | Path to schedule file |
| WeCom Calendar |
"wecom_calendar" | WeCom API integration |
| Manual input |
"manual" | Manager pastes schedule text |
Reference: schedule-formats.md
Query Types & Responses
"我今天几点上班?"
- 1. Identify the asker (match to staff list by WeCom ID or name)
- Look up today's shift in schedule data
- Return: shift start/end time + location (if multi-floor/location)
CODEBLOCK0
"今天谁在当班?" (Manager query)
CODEBLOCK1
"我想换班" (Swap request)
- 1. Confirm: who wants to swap, which shift, with whom (or open request)
- Check if target staff is available (not already scheduled)
- Submit to manager for approval (L1)
- Notify both parties of outcome
"我想请假" (Time-off request)
- 1. Confirm dates and reason (optional)
- Submit to manager (L2 — always needs approval)
- Check if replacement coverage is available; flag if not
- Track request status; notify when approved/denied
Proactive Shift Reminders
Send 12 hours before shift starts (configurable via
remind_before_hours):
⏰ 上班提醒
张三,明天 [date] 你的班是:
10:00 – 19:00([location])
记得准时到岗~
Swap Request Flow
CODEBLOCK3
On-Call Routing Integration
The shift schedule drives escalation routing in complaint-handler and inventory-query.
When an escalation fires:
- 1. Check current time against shift schedule
- Route to whoever is listed as on-duty manager for this time slot
- If no on-duty manager found: fall back to
off_hours_contact in INLINECODE9
This ensures L2/L3 alerts always go to the right person, not just a fixed manager ID.
Schedule Update
When manager pastes or uploads a new schedule:
- 1. Parse it using INLINECODE10
- Validate: no double-booking, all shifts covered, no gaps > 2 hours during open hours
- Confirm with manager before activating
- Archive previous schedule
Script: scripts/parse_schedule.py — parses Excel/text schedule into structured JSON.
Reference: schedule-formats.md
排班调度器
概述
该技能负责处理员工排班查询和与班次相关的请求。
它从配置的源读取排班数据,并将请求路由至相应经理进行审批。
依赖项: 员工名单 + 步骤02/步骤05配置中的排班数据。
配置位置: skills_config.shift-scheduler
数据源选项
| 数据源 | 配置值 | 设置方式 |
|---|
| Google Sheets | google_sheets | 在配置中分享链接 |
| Excel/CSV文件 |
file | 排班文件路径 |
| 企业微信日历 | wecom_calendar | 企业微信API集成 |
| 手动输入 | manual | 经理粘贴排班文本 |
参考: schedule-formats.md
查询类型与响应
我今天几点上班?
- 1. 识别提问者(通过企业微信ID或姓名匹配员工名单)
- 在排班数据中查找今日班次
- 返回:班次开始/结束时间 + 地点(若为多楼层/多地点)
张三,你今天的班是:
📍 收银台 10:00 – 19:00(含1小时午休)
搭班同事:李四、王五
今天谁在当班?(经理查询)
今日在班人员([日期]):
早班 (09:00-17:00):张三、李四
晚班 (14:00-22:00):王五、赵六
值班店长:王经理
我想换班(换班请求)
- 1. 确认:谁想换班、换哪个班次、与谁换(或公开请求)
- 检查目标员工是否可用(未被排班)
- 提交给经理审批(L1级)
- 通知双方结果
我想请假(请假请求)
- 1. 确认日期和原因(可选)
- 提交给经理审批(L2级——始终需要审批)
- 检查是否有替班人员;若无则标记提醒
- 跟踪请求状态;审批/拒绝时通知
主动班次提醒
在班次开始前12小时发送(可通过remind
beforehours配置):
⏰ 上班提醒
张三,明天 [日期] 你的班是:
10:00 – 19:00([地点])
记得准时到岗~
换班请求流程
员工申请换班
↓
检查被换员工排班(有无冲突)
↓
发送 L1 确认给店长
↓
店长确认 → 更新排班表 → 通知双方
店长拒绝 → 通知申请人 + 给出原因
↓
记录换班历史(避免频繁换班模式)
值班路由集成
排班表驱动投诉处理和库存查询中的升级路由。
当升级触发时:
- 1. 将当前时间与排班表进行比对
- 路由至该时段值班经理
- 若未找到值班经理:回退至permissionsconfig中的offhours_contact
这确保L2/L3级警报始终发送给正确的人员,而非固定的经理ID。
排班更新
当经理粘贴或上传新排班表时:
- 1. 使用scripts/parse_schedule.py进行解析
- 验证:无重复排班、所有班次已覆盖、营业时间内无超过2小时的空档
- 激活前与经理确认
- 归档上一份排班表
脚本: scripts/parse_schedule.py — 将Excel/文本排班表解析为结构化JSON。
参考: schedule-formats.md