calendar-event-manager
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseCalendar Event Manager
日历事件管理器
Create macOS Calendar events with tiered sound alarms and paired Reminders so events are never missed across Mac and iOS.
Self-Evolving Skill: This skill improves through use. If instructions are wrong, parameters drifted, or a workaround was needed — fix this file immediately, don't defer. Only update for real, reproducible issues.
创建带有分层声音提醒和配对提醒事项的macOS日历事件,确保在Mac和iOS设备上不会错过任何事件。
自演进技能:本技能会通过使用不断改进。如果指令有误、参数偏移或需要临时解决方案,请立即修改此文件,不要拖延。仅针对真实可复现的问题进行更新。
CRITICAL RULES (Hard-Learned Truths 2026-02-12)
关键规则(2026年2月12日总结的经验教训)
These rules are NON-NEGOTIABLE. Violating any of them defeats the purpose of this skill.
这些规则不容协商。违反任何一条都会违背本技能的初衷。
1. Calendar + Reminders ALWAYS Together
1. 日历与提醒事项必须始终配对
Every event MUST create BOTH:
- Calendar event with multiple entries (custom sound per tier)
sound alarm - Reminders (3 minimum) as a separate notification channel
Never create one without the other.
每个事件必须同时创建:
- 带有多个条目(每个层级使用自定义声音)的日历事件
sound alarm - 作为独立通知渠道的提醒事项(至少3个)
绝不同时只创建其中一个。
2. Use sound alarm
, NOT display alarm
sound alarmdisplay alarm2. 使用sound alarm
,而非display alarm
sound alarmdisplay alarmapplescript
-- CORRECT: audible alert with custom sound
make new sound alarm at end of sound alarms with properties {trigger interval:-60, sound name:"Glass"}
-- WRONG: silent visual banner only
make new display alarm at end of display alarms with properties {trigger interval:-60}Each alarm supports its own property. Use DIFFERENT sounds for different tiers so the user knows which alert level it is by sound alone.
sound nameapplescript
-- 正确:带自定义声音的可听警报
make new sound alarm at end of sound alarms with properties {trigger interval:-60, sound name:"Glass"}
-- 错误:仅静默视觉横幅
make new display alarm at end of display alarms with properties {trigger interval:-60}每个警报都支持独立的属性。为不同层级使用不同的声音,让用户仅通过声音就能知道警报级别。
sound name3. ONLY Long Sounds (>= 1.4 seconds)
3. 仅使用长时长声音(≥1.4秒)
Short sounds get missed and ignored. NEVER use sounds under 1.4 seconds.
APPROVED sounds only:
| Sound | Duration | Use For |
|---|---|---|
| Funk | 2.16s | At event time (loudest) |
| Glass | 1.65s | 1 hour before |
| Pop | 1.63s | Morning-of / 3 hrs before |
| Sosumi | 1.54s | Day-before |
| Ping | 1.50s | 30 min before |
| Submarine | 1.49s | Alternative |
| Blow | 1.40s | Gentle early reminder |
BANNED sounds: Hero, Basso, Bottle, Purr, Frog, Morse, Tink (all < 1.4s)
短时长声音容易被错过或忽略。绝对不要使用时长不足1.4秒的声音。
仅允许使用以下声音:
| 声音名称 | 时长 | 使用场景 |
|---|---|---|
| Funk | 2.16s | 事件开始时(音量最大) |
| Glass | 1.65s | 提前1小时提醒 |
| Pop | 1.63s | 当天早上/提前3小时提醒 |
| Sosumi | 1.54s | 提前1天提醒 |
| Ping | 1.50s | 提前30分钟提醒 |
| Submarine | 1.49s | 备选声音 |
| Blow | 1.40s | 温和的提前提醒 |
禁止使用的声音: Hero、Basso、Bottle、Purr、Frog、Morse、Tink(时长均<1.4秒)
4. Multiple Early Reminders Are Mandatory
4. 必须设置多个提前提醒
Minimum alarm tiers for any event:
| Tier | Trigger | Calendar Sound | Reminder |
|---|---|---|---|
| 1 day before | -1440 min | Blow | "TOMORROW: ..." |
| Morning-of 9 AM | Absolute | Sosumi | "TODAY: ..." |
| 3 hours before | -180 min | Pop | (via Calendar) |
| 1 hour before | -60 min | Glass | (via Calendar) |
| 30 min before | -30 min | Ping | (via Calendar) |
| At event time | 0 min | Funk | Due-time reminder |
任何事件的最低提醒层级:
| 层级 | 触发条件 | 日历声音 | 提醒事项 |
|---|---|---|---|
| 提前1天 | -1440分钟 | Blow | "明天:..." |
| 当天早上9点 | 绝对时间 | Sosumi | "今天:..." |
| 提前3小时 | -180分钟 | Pop | (通过日历发送) |
| 提前1小时 | -60分钟 | Glass | (通过日历发送) |
| 提前30分钟 | -30分钟 | Ping | (通过日历发送) |
| 事件开始时 | 0分钟 | Funk | 到期时间提醒 |
5. macOS Notification Settings Prerequisite
5. macOS通知设置前提条件
Calendar notifications must be enabled in System Settings:
- System Settings > Notifications > Calendar > Allow Notifications = ON
- Alert style = Banners or Alerts
- Play sound = ON
Open with:
open "x-apple.systempreferences:com.apple.Notifications-Settings.extension"必须在系统设置中启用日历通知:
- 系统设置 > 通知 > 日历 > 允许通知 = 开启
- 提醒样式 = 横幅或提醒
- 播放声音 = 开启
打开设置的命令:
open "x-apple.systempreferences:com.apple.Notifications-Settings.extension"TodoWrite Task Templates
TodoWrite任务模板
Template A: Create Event from Invitation
模板A:从邀请创建事件
1. Extract event details (title, date, time, location, notes, RSVP)
2. Create Calendar event with 6-tier sound alarms (Blow, Sosumi, Pop, Glass, Ping, Funk)
3. Create 3 Reminders (TOMORROW, TODAY morning, due-time)
4. Verify event and reminders created
5. Report full schedule to user1. 提取事件详情(标题、日期、时间、地点、备注、回复状态)
2. 创建带有6层声音提醒(Blow、Sosumi、Pop、Glass、Ping、Funk)的日历事件
3. 创建3个提醒事项(明天、当天早上、到期时间)
4. 验证事件和提醒事项已创建
5. 向用户报告完整日程Template B: Create Event from User Description
模板B:从用户描述创建事件
1. Ask user for: event name, date/time, duration, location
2. Create Calendar event with 6-tier sound alarms
3. Create 3 Reminders
4. Verify event and reminders created
5. Report full schedule to user1. 向用户询问:事件名称、日期/时间、时长、地点
2. 创建带有6层声音提醒的日历事件
3. 创建3个提醒事项
4. 验证事件和提醒事项已创建
5. 向用户报告完整日程Template C: Test Notification Setup
模板C:测试通知设置
1. Create test Calendar event 3 min in future with sound alarms (1 min, 2 min tiers)
2. Create test Reminder 2 min in future
3. Wait for user confirmation of notifications
4. Clean up test event and reminders1. 创建一个3分钟后开始的测试日历事件,带有声音提醒(提前1分钟、提前2分钟层级)
2. 创建一个2分钟后到期的测试提醒事项
3. 等待用户确认收到通知
4. 删除测试事件和提醒事项AppleScript Date Construction (CRITICAL)
AppleScript日期构造(关键)
NEVER use in AppleScript. String-based date parsing is locale-dependent and silently produces wrong results:
date "STRING"| Anti-pattern | What happens | Example |
|---|---|---|
| On 24h systems, "PM" is ignored → 06:00 | 4 failures in amonic session |
| ISO parsed as individual numbers → year 12169 | 1 failure |
| Day 31 + April (30 days) → rolls to May 1 | 1 failure |
ALWAYS use programmatic date construction:
applescript
-- Build date safely: day-first-then-month prevents rollover
set d to current date
set day of d to 1 -- safe floor FIRST (prevents month rollover)
set month of d to April
set year of d to 2026
set day of d to 1 -- now set actual target day
set hours of d to 18 -- 24h format, no AM/PM ambiguity
set minutes of d to 0
set seconds of d to 0绝对不要在AppleScript中使用。 基于字符串的日期解析依赖于区域设置,会悄无声息地产生错误结果:
date "STRING"| 反模式 | 后果 | 示例 |
|---|---|---|
| 在24小时制系统中,"PM"会被忽略 → 06:00 | amonic会话中出现4次失败 |
| ISO格式被解析为单独数字 → 年份变为12169 | 出现1次失败 |
在 | 31天 + 4月(30天)→ 自动滚动到5月1日 | 出现1次失败 |
必须使用程序化日期构造:
applescript
-- 安全构造日期:先设置日期再设置月份,避免滚动问题
set d to current date
set day of d to 1 -- 先安全设置基准日期(防止月份滚动)
set month of d to April
set year of d to 2026
set day of d to 1 -- 现在设置目标日期
set hours of d to 18 -- 24小时制,无AM/PM歧义
set minutes of d to 0
set seconds of d to 0Calendar Discovery (run first)
日历发现(先运行)
applescript
tell application "Calendar"
set output to ""
repeat with c in calendars
set output to output & name of c & " (writable:" & writable of c & ")" & linefeed
end repeat
output
end tellUse the first calendar. Never assume "Home" or "Calendar" exists.
writable:trueapplescript
tell application "Calendar"
set output to ""
repeat with c in calendars
set output to output & name of c & " (可写入:" & writable of c & ")" & linefeed
end repeat
output
end tell使用第一个的日历。不要假设“Home”或“Calendar”日历存在。
writable:trueFull Event Creation (Copy-Paste Ready)
完整事件创建(可直接复制粘贴)
applescript
tell application "Calendar"
-- Build start date programmatically
set startDate to current date
set day of startDate to 1
set month of startDate to MONTH_CONSTANT
set year of startDate to YEAR_INT
set day of startDate to DAY_INT
set hours of startDate to HOUR_24
set minutes of startDate to 0
set seconds of startDate to 0
-- Build end date (1 hour later)
set endDate to startDate + 1 * hours
tell calendar "WRITABLE_CALENDAR_NAME"
set newEvent to make new event with properties {summary:"EVENT_NAME", start date:startDate, end date:endDate, location:"LOCATION", description:"NOTES"}
tell newEvent
make new sound alarm at end of sound alarms with properties {trigger interval:-1440, sound name:"Blow"}
make new sound alarm at end of sound alarms with properties {trigger interval:-180, sound name:"Pop"}
make new sound alarm at end of sound alarms with properties {trigger interval:-60, sound name:"Glass"}
make new sound alarm at end of sound alarms with properties {trigger interval:-30, sound name:"Ping"}
make new sound alarm at end of sound alarms with properties {trigger interval:0, sound name:"Funk"}
end tell
end tell
reload calendars
end tellapplescript
tell application "Calendar"
-- 程序化构造开始日期
set startDate to current date
set day of startDate to 1
set month of startDate to MONTH_CONSTANT
set year of startDate to YEAR_INT
set day of startDate to DAY_INT
set hours of startDate to HOUR_24
set minutes of startDate to 0
set seconds of startDate to 0
-- 构造结束日期(1小时后)
set endDate to startDate + 1 * hours
tell calendar "WRITABLE_CALENDAR_NAME"
set newEvent to make new event with properties {summary:"EVENT_NAME", start date:startDate, end date:endDate, location:"LOCATION", description:"NOTES"}
tell newEvent
make new sound alarm at end of sound alarms with properties {trigger interval:-1440, sound name:"Blow"}
make new sound alarm at end of sound alarms with properties {trigger interval:-180, sound name:"Pop"}
make new sound alarm at end of sound alarms with properties {trigger interval:-60, sound name:"Glass"}
make new sound alarm at end of sound alarms with properties {trigger interval:-30, sound name:"Ping"}
make new sound alarm at end of sound alarms with properties {trigger interval:0, sound name:"Funk"}
end tell
end tell
reload calendars
end tellVerification (always run after creation)
验证(创建后必须运行)
applescript
tell application "Calendar"
tell calendar "WRITABLE_CALENDAR_NAME"
set matches to (every event whose summary is "EVENT_NAME" and start date > (current date))
repeat with e in matches
log (summary of e) & " | " & (start date of e) & " → " & (end date of e)
end repeat
end tell
end tellapplescript
tell application "Calendar"
tell calendar "WRITABLE_CALENDAR_NAME"
set matches to (every event whose summary is "EVENT_NAME" and start date > (current date))
repeat with e in matches
log (summary of e) & " | " & (start date of e) & " → " & (end date of e)
end repeat
end tell
end tellPaired Reminders Creation
配对提醒事项创建
applescript
tell application "Reminders"
set defaultList to default list
-- Build date programmatically (same pattern as Calendar)
set eventDate to current date
set day of eventDate to 1
set month of eventDate to MONTH_CONSTANT
set year of eventDate to YEAR_INT
set day of eventDate to DAY_INT
set hours of eventDate to HOUR_24
set minutes of eventDate to 0
set seconds of eventDate to 0
-- Due-time reminder
make new reminder in defaultList with properties {name:"EVENT_NAME", due date:eventDate, body:"LOCATION\nNOTES"}
-- Day-before
make new reminder in defaultList with properties {name:"TOMORROW: EVENT_NAME", due date:(eventDate - 1 * days), body:"Event tomorrow! LOCATION"}
-- Morning-of at 9 AM
set morningDate to eventDate
set hours of morningDate to 9
set minutes of morningDate to 0
make new reminder in defaultList with properties {name:"TODAY: EVENT_NAME", due date:morningDate, body:"Today! LOCATION"}
end tellapplescript
tell application "Reminders"
set defaultList to default list
-- 程序化构造日期(与日历使用相同模式)
set eventDate to current date
set day of eventDate to 1
set month of eventDate to MONTH_CONSTANT
set year of eventDate to YEAR_INT
set day of eventDate to DAY_INT
set hours of eventDate to HOUR_24
set minutes of eventDate to 0
set seconds of eventDate to 0
-- 到期时间提醒
make new reminder in defaultList with properties {name:"EVENT_NAME", due date:eventDate, body:"LOCATION\nNOTES"}
-- 提前1天提醒
make new reminder in defaultList with properties {name:"TOMORROW: EVENT_NAME", due date:(eventDate - 1 * days), body:"Event tomorrow! LOCATION"}
-- 当天早上9点提醒
set morningDate to eventDate
set hours of morningDate to 9
set minutes of morningDate to 0
make new reminder in defaultList with properties {name:"TODAY: EVENT_NAME", due date:morningDate, body:"Today! LOCATION"}
end tellPost-Change Checklist
修改后检查清单
After modifying this skill:
- Sound reference table matches sound-reference.md
- All 6 alarm tiers documented with correct sounds
- BANNED sounds list is complete
- Hook file () aligned with skill rules
hooks/calendar-reminder-sync.ts - AppleScript examples use not
sound alarmdisplay alarm
修改本技能后,请检查:
- 声音参考表与sound-reference.md一致
- 所有6个提醒层级均已记录并使用正确声音
- 禁止使用的声音列表完整
- Hook文件()与技能规则一致
hooks/calendar-reminder-sync.ts - AppleScript示例使用而非
sound alarmdisplay alarm
References
参考资料
- Sound Reference - Full sound duration data and approved/rejected lists
- Apple Calendar Scripting Guide
- 声音参考 - 完整的声音时长数据及允许/禁止使用列表
- Apple日历脚本指南
Post-Execution Reflection
执行后反思
After this skill completes, check before closing:
- Did the command succeed? — If not, fix the instruction or error table that caused the failure.
- Did parameters or output change? — If the underlying tool's interface drifted, update Usage examples and Parameters table to match.
- Was a workaround needed? — If you had to improvise (different flags, extra steps), update this SKILL.md so the next invocation doesn't need the same workaround.
Only update if the issue is real and reproducible — not speculative.
本技能完成后,关闭前请检查:
- 命令是否成功? — 如果失败,请修复导致失败的指令或错误表。
- 参数或输出是否有变化? — 如果底层工具的接口发生变化,请更新使用示例和参数表以匹配。
- 是否需要临时解决方案? — 如果必须临时变通(使用不同标志、额外步骤),请更新此SKILL.md,以便下次调用时无需重复相同的变通方法。
仅针对真实可复现的问题进行更新,不要基于推测修改。