calendar-event-manager

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Calendar 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
    sound alarm
    entries (custom sound per tier)
  • Reminders (3 minimum) as a separate notification channel
Never create one without the other.
每个事件必须同时创建:
  • 带有多个
    sound alarm
    条目(每个层级使用自定义声音)的日历事件
  • 作为独立通知渠道的提醒事项(至少3个)
绝不同时只创建其中一个。

2. Use
sound alarm
, NOT
display alarm

2. 使用
sound alarm
,而非
display alarm

applescript
-- 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
sound name
property. Use DIFFERENT sounds for different tiers so the user knows which alert level it is by sound alone.
applescript
-- 正确:带自定义声音的可听警报
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 name
属性。为不同层级使用不同的声音,让用户仅通过声音就能知道警报级别。

3. 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:
SoundDurationUse For
Funk2.16sAt event time (loudest)
Glass1.65s1 hour before
Pop1.63sMorning-of / 3 hrs before
Sosumi1.54sDay-before
Ping1.50s30 min before
Submarine1.49sAlternative
Blow1.40sGentle early reminder
BANNED sounds: Hero, Basso, Bottle, Purr, Frog, Morse, Tink (all < 1.4s)
短时长声音容易被错过或忽略。绝对不要使用时长不足1.4秒的声音。
仅允许使用以下声音:
声音名称时长使用场景
Funk2.16s事件开始时(音量最大)
Glass1.65s提前1小时提醒
Pop1.63s当天早上/提前3小时提醒
Sosumi1.54s提前1天提醒
Ping1.50s提前30分钟提醒
Submarine1.49s备选声音
Blow1.40s温和的提前提醒
禁止使用的声音: Hero、Basso、Bottle、Purr、Frog、Morse、Tink(时长均<1.4秒)

4. Multiple Early Reminders Are Mandatory

4. 必须设置多个提前提醒

Minimum alarm tiers for any event:
TierTriggerCalendar SoundReminder
1 day before-1440 minBlow"TOMORROW: ..."
Morning-of 9 AMAbsoluteSosumi"TODAY: ..."
3 hours before-180 minPop(via Calendar)
1 hour before-60 minGlass(via Calendar)
30 min before-30 minPing(via Calendar)
At event time0 minFunkDue-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 user
1. 提取事件详情(标题、日期、时间、地点、备注、回复状态)
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 user
1. 向用户询问:事件名称、日期/时间、时长、地点
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 reminders

1. 创建一个3分钟后开始的测试日历事件,带有声音提醒(提前1分钟、提前2分钟层级)
2. 创建一个2分钟后到期的测试提醒事项
3. 等待用户确认收到通知
4. 删除测试事件和提醒事项

AppleScript Date Construction (CRITICAL)

AppleScript日期构造(关键)

NEVER use
date "STRING"
in AppleScript.
String-based date parsing is locale-dependent and silently produces wrong results:
Anti-patternWhat happensExample
date "April 1, 2026 at 6:00:00 PM"
On 24h systems, "PM" is ignored → 06:004 failures in amonic session
date "2026-04-01 18:00:00"
ISO parsed as individual numbers → year 121691 failure
set month
before
set day to 1
Day 31 + April (30 days) → rolls to May 11 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"
基于字符串的日期解析依赖于区域设置,会悄无声息地产生错误结果:
反模式后果示例
date "April 1, 2026 at 6:00:00 PM"
在24小时制系统中,"PM"会被忽略 → 06:00amonic会话中出现4次失败
date "2026-04-01 18:00:00"
ISO格式被解析为单独数字 → 年份变为12169出现1次失败
set day to 1
之前
set month
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 0

Calendar 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 tell
Use the first
writable:true
calendar. Never assume "Home" or "Calendar" exists.
applescript
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
使用第一个
writable:true
的日历。不要假设“Home”或“Calendar”日历存在。

Full 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 tell
applescript
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 tell

Verification (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 tell
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 tell

Paired 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 tell

applescript
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 tell

Post-Change Checklist

修改后检查清单

After modifying this skill:
  1. Sound reference table matches sound-reference.md
  2. All 6 alarm tiers documented with correct sounds
  3. BANNED sounds list is complete
  4. Hook file (
    hooks/calendar-reminder-sync.ts
    ) aligned with skill rules
  5. AppleScript examples use
    sound alarm
    not
    display alarm

修改本技能后,请检查:
  1. 声音参考表与sound-reference.md一致
  2. 所有6个提醒层级均已记录并使用正确声音
  3. 禁止使用的声音列表完整
  4. Hook文件(
    hooks/calendar-reminder-sync.ts
    )与技能规则一致
  5. AppleScript示例使用
    sound alarm
    而非
    display alarm

References

参考资料

Post-Execution Reflection

执行后反思

After this skill completes, check before closing:
  1. Did the command succeed? — If not, fix the instruction or error table that caused the failure.
  2. Did parameters or output change? — If the underlying tool's interface drifted, update Usage examples and Parameters table to match.
  3. 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.
本技能完成后,关闭前请检查:
  1. 命令是否成功? — 如果失败,请修复导致失败的指令或错误表。
  2. 参数或输出是否有变化? — 如果底层工具的接口发生变化,请更新使用示例和参数表以匹配。
  3. 是否需要临时解决方案? — 如果必须临时变通(使用不同标志、额外步骤),请更新此SKILL.md,以便下次调用时无需重复相同的变通方法。
仅针对真实可复现的问题进行更新,不要基于推测修改。