AgentSkillsCN

macclock

在 macOS 上控制 MacClock 定时器、番茄钟以及各类日程安排。设置倒计时定时器,管理番茄钟会话,并创建定时任务。当用户输入“timer”“计时器”“pomodoro”“番茄钟”“倒数”“countdown”“schedule”“排程”时,即可触发该功能。

SKILL.md
--- frontmatter
name: macclock
description: Control MacClock timers, Pomodoro, and schedules on macOS. Set countdown timers, manage Pomodoro sessions, and create scheduled tasks. Triggers on "timer", "計時器", "pomodoro", "番茄鐘", "倒數", "countdown", "schedule", "排程".
compatibility: Requires macOS and MacClock app installed
metadata:
  author: henry11996
  version: "1.1"
  platform: macOS

MacClock Control

Control MacClock app via URL Scheme.

Commands

Set Timer

bash
open "macclock://timer?sec=<seconds>&label=<name>"

Parameters:

ParameterRequiredDescription
secYesDuration in seconds
labelNoTimer name (default: Quick Timer)
colorNoTimer color (see colors below, default: blue)
commandNoShell command to run on completion (URL encoded)
repeatNotrue to auto-restart timer (loop mode)

Available Colors:

NameHexChinese
blue3B82F6藍色
redEF4444紅色
green22C55E綠色
purple8B5CF6紫色
orangeF97316橙色
pinkEC4899粉色
cyan06B6D4青色
yellowEAB308黃色

Cancel Timer

bash
open "macclock://timer?action=cancel"              # Cancel last timer
open "macclock://timer?action=cancel&label=<name>" # Cancel by name
open "macclock://timer?action=cancel&all=true"     # Cancel all timers

Pomodoro Control

bash
open "macclock://pomodoro?action=start"   # Start
open "macclock://pomodoro?action=pause"   # Pause
open "macclock://pomodoro?action=reset"   # Reset

Schedule Control

bash
# Add a schedule
open "macclock://schedule?action=add&time=<HH:MM>&do=<action>&repeat=<rule>&name=<label>"

# List all schedules
open "macclock://schedule?action=list"

# Toggle schedule on/off
open "macclock://schedule?action=toggle&label=<name>"

# Remove a schedule
open "macclock://schedule?action=remove&label=<name>"

Schedule Parameters:

ParameterRequiredDescription
timeYesTime in HH:MM format (24-hour)
doYesAction: pomodoro, timer, command, notify
nameNoSchedule label
repeatNodaily, weekday, weekend, or hours interval (e.g., 2)

For do=timer:

ParameterDescription
secDuration in seconds (default: 300)
labelTimer label

For do=notify:

ParameterDescription
titleNotification title
msgNotification message

For do=command:

ParameterDescription
cmdShell command to execute (URL encoded)

Check Status & List

bash
# Get overall status (timer count, pomodoro state, schedule count)
open "macclock://status"

# List all timers with details
open "macclock://timer?action=list"

# List all schedules with details
open "macclock://schedule?action=list"

Note: Results are copied to clipboard. Use pbpaste to view:

bash
open "macclock://timer?action=list" && sleep 0.5 && pbpaste

Common Durations

  • 1 minute = 60 seconds
  • 5 minutes = 300 seconds
  • 10 minutes = 600 seconds
  • 15 minutes = 900 seconds
  • 25 minutes = 1500 seconds (Pomodoro)
  • 30 minutes = 1800 seconds
  • 1 hour = 3600 seconds

Examples

RequestCommand
Set 5 minute timeropen "macclock://timer?sec=300&label=5分鐘"
Set 25 min focus timeropen "macclock://timer?sec=1500&label=Focus"
Red timer for urgent taskopen "macclock://timer?sec=300&label=緊急&color=red"
Green timer for breakopen "macclock://timer?sec=600&label=休息&color=green"
Timer with custom hex coloropen "macclock://timer?sec=300&color=FF6B6B"
Speak when timer endsopen "macclock://timer?sec=60&command=say%20時間到"
Open Safari when doneopen "macclock://timer?sec=60&command=open%20-a%20Safari"
Loop timer (say ok every 5s)open "macclock://timer?sec=5&label=Loop&command=say%20ok&repeat=true"
Start pomodoroopen "macclock://pomodoro?action=start"
Pause pomodoroopen "macclock://pomodoro?action=pause"
Cancel timeropen "macclock://timer?action=cancel"
Cancel all timersopen "macclock://timer?action=cancel&all=true"
List all timersopen "macclock://timer?action=list"
Check statusopen "macclock://status"
Daily pomodoro at 9:00open "macclock://schedule?action=add&time=09:00&do=pomodoro&repeat=daily&name=Morning"
Weekday reminder at 18:00open "macclock://schedule?action=add&time=18:00&do=notify&title=Reminder&msg=Time%20to%20go&repeat=weekday"
Every 2 hours breakopen "macclock://schedule?action=add&time=10:00&do=timer&sec=300&label=Break&repeat=2"
Run command at noonopen "macclock://schedule?action=add&time=12:00&do=command&cmd=say%20Lunch%20time"
List schedulesopen "macclock://schedule?action=list"
Toggle scheduleopen "macclock://schedule?action=toggle&label=Morning"
Remove scheduleopen "macclock://schedule?action=remove&label=Morning"

Notes

  • MacClock must be running
  • Duration in seconds
  • Chinese labels are supported
  • Starting a timer will auto-show the countdown widget if hidden
  • For command parameter: spaces must be encoded as %20
  • Use repeat=true for infinite looping timers (cancel with action=cancel)
  • Color accepts English names, Chinese names, or hex values (e.g., red, 紅色, EF4444)
  • Maximum 20 schedules allowed
  • Schedules are checked every minute
  • Adding a schedule will auto-show the schedule widget if hidden

Reference

See references/AI-Integration.md for detailed API documentation including App Intents, Python integration, and tool definitions.