预约日程管理器 📅 是做什么的?
为服务型企业提供的自动化预约管理系统。
功能
- 预约接收 — 解析来自私信、KakaoTalk、电话(文本转换)的预订请求
- 日历登记 — 自动同步 Google 日历 / Naver 日历
- 冲突检测 — 防止重复预订
- 提醒 — 在 1 天前和 2 小时前自动通知客户
- 缺席管理 — 追踪缺席并标记重复违规者
- 候补名单 — 满额时自动加入候补名单,取消时自动通知
目标场景
- 美容院
- 诊所
- 工作室
- 照相亭
快速开始
1. 初始化配置
node <skill-dir>/scripts/init-config.js
这将创建 config/appointment-scheduler.json,包含:
- 营业时间
- 服务时长默认值
- 日历连接设置
- 提醒时间偏好
- 缺席策略
2. 处理传入请求
来自文本消息:
node <skill-dir>/scripts/parse-booking.js --text "明天下午3点可以预约剪发吗? - 金哲秀 010-1234-5678"
来自对话上下文:
"客户请求预约: [消息内容]"
该技能将:
- 解析日期/时间、服务类型、客户姓名、联系方式
- 检查日历冲突
- 如果可用 → 预订并确认
- 如果冲突 → 建议其他时间或加入候补名单
3. 手动预订
node <skill-dir>/scripts/book.js \
--date "2026-02-20" \
--time "15:00" \
--duration 60 \
--service "剪发" \
--customer "金哲秀" \
--phone "010-1234-5678"
4. 查看日程
# 今日预约
node <skill-dir>/scripts/check-schedule.js --date today
# 指定日期
node <skill-dir>/scripts/check-schedule.js --date 2026-02-20
# 本周
node <skill-dir>/scripts/check-schedule.js --week
5. 发送提醒
手动触发:
node <skill-dir>/scripts/send-reminders.js
通过 Cron 自动触发:
# 每天上午9:00 - 发送1天前提醒
0 9 * * * node /path/to/skills/appointment-scheduler/scripts/send-reminders.js --type day-before
# 每小时 - 发送2小时前提醒
0 * * * * node /path/to/skills/appointment-scheduler/scripts/send-reminders.js --type hour-before
6. 处理缺席
# 标记客户为缺席
node <skill-dir>/scripts/mark-noshow.js --booking-id abc123
# 查看缺席统计
node <skill-dir>/scripts/noshow-report.js
# 标记重复违规者(3次及以上缺席)
node <skill-dir>/scripts/noshow-report.js --flag-repeat
7. 候补名单管理
# 加入候补名单
node <skill-dir>/scripts/waitlist.js add \
--date "2026-02-20" \
--time "15:00" \
--customer "李英熙" \
--phone "010-9999-8888"
# 查看候补名单
node <skill-dir>/scripts/waitlist.js list --date 2026-02-20
# 取消时通知候补名单
node <skill-dir>/scripts/waitlist.js notify --booking-id abc123
数据存储
位置:workspace/data/appointments/
data/appointments/
bookings/
2026-02-20.json # 每日预订记录
waitlist/
2026-02-20.json # 每日候补名单
noshow/
history.json # 缺席记录
flagged-customers.json # 重复违规者
reminders/
sent.json # 提醒发送日志
日历集成
Google 日历
- 启用 Google Calendar API
- 下载 OAuth 凭据 → 保存至
~/.secrets/google-calendar-credentials.json - 首次运行将提示浏览器授权
- 刷新令牌保存至
~/.secrets/google-calendar-token.json
同步脚本:
node <skill-dir>/scripts/sync-google-calendar.js
Naver 日历
使用 Naver Calendar API(如可用)或浏览器自动化回退。
配置:将 Naver 账号添加到 config/appointment-scheduler.json
预订请求解析
解析器支持处理自然语言,例如:
- "明天下午3点剪发预约"
- "2月20日15:00烫发可以吗"
- "下周一上午剪发+染色"
- "3点照相亭预约 - 金哲秀 010-1234-5678"
提取字段:
- 日期(相对或绝对)
- 时间
- 服务类型
- 客户姓名
- 联系方式(电话/邮箱/用户名)
- 特殊备注
冲突检测
确认前:
- 检查日期/时间段内现有预订
- 计算服务时长重叠
- 如有冲突 → 建议最近可用时段
- 如已满 → 提供候补选项
缓冲时间:可在 config 中配置(默认:两次预约之间间隔 10 分钟)
提醒系统
默认时间:
- 1 天前 上午 9:00 — "明天下午3点有预约"
- 2 小时前 — "2小时后有预约"
发送渠道(根据客户联系方式自动检测):
- 电话 → 短信(通过消息工具)
- Instagram → 私信
- KakaoTalk → 消息
自定义:编辑 config/appointment-scheduler.json 中的时间设置
缺席管理
追踪:
- 如果客户在 15 分钟宽限期后未出现,标记为缺席
- 记录在
noshow/history.json中 - 按客户统计次数
自动标记策略(默认):
- 3 次及以上缺席 → 标记客户
- 被标记客户需支付押金才能进行未来预订
查询:
# 查看客户历史
node <skill-dir>/scripts/noshow-report.js --customer "金哲秀"
# 月度统计
node <skill-dir>/scripts/noshow-report.js --month 2026-02
候补名单自动通知
预订取消时:
- 查找同一日期/时间的候补条目
- 自动发送通知:"预约名额已空出!如果您需要,可以进行预约"
- 先到先得 → 通过回复确认
- 如 30 分钟内确认,则自动预订
语音集成
支持电话 → 文本 → 预订流程:
- 接收通话转录(通过语音转文本工具)
- 解析预订请求
- 确认可用性
- 发送短信确认
钩子集成
pre-hook:预订前 → 检查营业时间、服务可用性 post-hook:预订后 → 发送确认、更新日历、记录事件 conflict-hook:冲突时 → 触发替代建议或候补流程
事件总线集成
位置:events/appointment-YYYY-MM-DD.json
{
"timestamp": "2026-02-18T15:30:00Z",
"event": "booking_created",
"booking_id": "abc123",
"customer": "金哲秀",
"date": "2026-02-20",
"time": "15:00",
"service": "剪发"
}
Cron 设置
推荐的 crontab 任务:
# 每天上午9点发送1天前提醒
0 9 * * * node /path/to/skills/appointment-scheduler/scripts/send-reminders.js --type day-before
# 每小时发送2小时前提醒
0 * * * * node /path/to/skills/appointment-scheduler/scripts/send-reminders.js --type hour-before
# 每30分钟同步日历
*/30 * * * * node /path/to/skills/appointment-scheduler/scripts/sync-google-calendar.js
# 每天晚8点发送缺席报告
0 20 * * * node /path/to/skills/appointment-scheduler/scripts/noshow-report.js --daily
配置模板
位置:config/appointment-scheduler.json
{
"business_name": "MUFI 照相亭",
"business_hours": {
"monday": { "open": "10:00", "close": "20:00" },
"tuesday": { "open": "10:00", "close": "20:00" },
"wednesday": { "open": "10:00", "close": "20:00" },
"thursday": { "open": "10:00", "close": "20:00" },
"friday": { "open": "10:00", "close": "22:00" },
"saturday": { "open": "10:00", "close": "22:00" },
"sunday": { "open": "12:00", "close": "18:00" }
},
"services": {
"拍照": { "duration": 30, "buffer": 10 },
"剪发": { "duration": 60, "buffer": 10 },
"烫发": { "duration": 120, "buffer": 15 },
"染色": { "duration": 90, "buffer": 15 }
},
"reminders": {
"day_before": { "enabled": true, "time": "09:00" },
"hour_before": { "enabled": true, "hours": 2 }
},
"noshow_policy": {
"grace_period_min": 15,
"flag_threshold": 3,
"require_deposit_when_flagged": true
},
"calendar": {
"google": {
"enabled": true,
"calendar_id": "primary"
},
"naver": {
"enabled": false
}
}
}
故障排除
| 问题 | 解决方案 |
|---|---|
| 预订解析失败 | 检查 parse-booking.js 输出,添加自定义模式 |
| 日历同步错误 | 验证 OAuth 凭据,检查令牌过期 |
| 提醒未发送 | 检查 Cron 任务状态,验证消息工具配置 |
| 发生重复预订 | 确保冲突检测已启用,检查缓冲时间 |
| 候补名单通知失败 | 检查客户联系信息,验证消息渠道 |
高级用法
自定义服务类型
编辑 config/appointment-scheduler.json:
"services": {
"新服务": { "duration": 45, "buffer": 10 }
}
屏蔽时段
# 将时间段标记为不可用
node <skill-dir>/scripts/block-time.js \
--date "2026-02-20" \
--start "12:00" \
--end "13:00" \
--reason "午餐时间"
批量导入
# 从 CSV 导入
node <skill-dir>/scripts/import-bookings.js --file bookings.csv
导出报告
# 月度预订报告
node <skill-dir>/scripts/export-report.js --month 2026-02 --format json
# 缺席分析
node <skill-dir>/scripts/noshow-report.js --month 2026-02 --export csv
经验总结
- 自然语言解析准确率:韩语日期时间表达约 85%
- 提醒送达率:通过 Instagram 私信 95% 以上,通过短信 80% 以上
- 实施 1 天前提醒后,缺席率降低了 40%
- 候补自动通知将预订填补率提高了 25%
🐧 由 Mupeng 构建 — Mupengism 生态系统技能