7.2 KiB
| name | description |
|---|---|
| schedule-job | Scheduled Task Management - Create, manage, and view scheduled tasks for users (supports cron recurring tasks and one-time tasks) |
Schedule Job - Scheduled Task Management
Manage scheduled tasks for users, supporting cron recurring tasks and one-time scheduled tasks. The system automatically executes AI conversations when tasks are due.
Quick Start
When a user requests to create a scheduled task:
- Confirm the task type (recurring cron / one-time once)
- Determine the time (cron expression or specific time) and timezone
- Confirm notification method: Check the currently enabled skills in the context and recommend a suitable notification method to the user (e.g., email, Telegram, etc.) for confirmation. If no notification skills are available, proactively ask the user: "How would you like to be notified when the scheduled task completes?"
- Compose the message content to send to the AI (refer to Message Writing Guidelines)
- Call schedule_manager.py to create the task
Instructions
Tool Path
All operations are executed via shell commands:
python {skill_dir}/scripts/schedule_manager.py <command> [options]
Available Commands
List Tasks
python {skill_dir}/scripts/schedule_manager.py list
python {skill_dir}/scripts/schedule_manager.py list --format brief
Add Cron Recurring Task
python {skill_dir}/scripts/schedule_manager.py add \
--name "Task Name" \
--type cron \
--schedule "0 9 * * *" \
--timezone "Asia/Tokyo" \
--message "Please search and summarize today's important tech news, listing the Top 5 in a concise format. After completion, select an appropriate notification method based on the currently enabled skills to push the results to the user."
Add One-Time Task
python {skill_dir}/scripts/schedule_manager.py add \
--name "Meeting Reminder" \
--type once \
--scheduled-at "2026-04-01T10:00:00+09:00" \
--message "A scheduled reminder for the user has arrived. The schedule content is: 'Meeting at 10:00'. Please compose an appropriate reminder message based on the schedule content, then select an appropriate notification method based on the currently enabled skills to send the reminder to the user."
Edit Task
python {skill_dir}/scripts/schedule_manager.py edit <task_id> \
--schedule "0 10 * * 1-5" \
--message "New message content"
Delete Task
python {skill_dir}/scripts/schedule_manager.py delete <task_id>
Pause/Resume Task
python {skill_dir}/scripts/schedule_manager.py toggle <task_id>
View Execution Logs
python {skill_dir}/scripts/schedule_manager.py logs --limit 10
python {skill_dir}/scripts/schedule_manager.py logs --task-id <task_id>
Timezone Mapping
Automatically recommend timezone based on user language:
- Chinese (zh) → Asia/Shanghai (UTC+8)
- Japanese (ja/jp) → Asia/Tokyo (UTC+9)
- English (en) → UTC
Cron Expression Reference
Standard 5-field format: minute hour day-of-month month day-of-week
Common examples:
| Expression | Meaning |
|---|---|
0 9 * * * |
Every day at 9:00 |
0 9 * * 1-5 |
Monday to Friday at 9:00 |
30 8 * * 1 |
Every Monday at 8:30 |
0 */2 * * * |
Every 2 hours |
0 9,18 * * * |
Every day at 9:00 and 18:00 |
Note: Cron expression times are based on the timezone specified by --timezone.
One-Time Task Time Format
Supports ISO 8601 format (timezone offset recommended):
2026-04-01T10:00:00+09:00(Japan Time)2026-04-01T01:00:00Z(UTC)2026-04-01T08:00:00+08:00(China Time)
Message Writing Guidelines
The message is an execution instruction sent to the AI agent when the scheduled task triggers. The agent has no conversation context at execution time, so the message must include:
- Task Content: What specifically needs to be done
- Notification Instruction: Based on the notification method confirmed by the user, explicitly specify the notification channel in the message (e.g., "notify the user via email"). If the user has not specified, write "select an appropriate notification method based on the currently enabled skills to push the results to the user"
- Language: The message language must match the language the user is currently using in the conversation (e.g., if the user speaks Japanese, write the message in Japanese)
Schedule Reminder Scenario (One-Time Task)
❌ Wrong: "Reminder: You have a meeting to attend now, don't forget!"
✅ Correct: "A scheduled reminder for the user has arrived. The schedule content is: 'Product review meeting at 3:00 PM'. Please compose an appropriate reminder message based on the schedule content, then select an appropriate notification method based on the currently enabled skills to send the reminder to the user."
Recurring Task Scenario (Cron Task)
❌ Wrong: "Execute: Get latest news"
✅ Correct: "Please search and summarize today's important tech news, listing the Top 5 in a concise format. After completion, select an appropriate notification method based on the currently enabled skills to push the results to the user."
Examples
User: "Set up a daily news summary task at 9 AM"
python {skill_dir}/scripts/schedule_manager.py add \
--name "Daily News Summary" \
--type cron \
--schedule "0 9 * * *" \
--timezone "Asia/Tokyo" \
--message "Please search and summarize today's important tech news, listing the Top 5 in a concise format. After completion, select an appropriate notification method based on the currently enabled skills to push the results to the user."
User: "Remind me about the meeting tomorrow at 3 PM"
python {skill_dir}/scripts/schedule_manager.py add \
--name "Meeting Reminder" \
--type once \
--scheduled-at "2026-03-31T15:00:00+09:00" \
--message "A scheduled reminder for the user has arrived. The schedule content is: 'Meeting tomorrow at 3:00 PM'. Please compose an appropriate reminder message based on the schedule content, then select an appropriate notification method based on the currently enabled skills to send the reminder to the user."
User: "Change the daily news task to 10 AM"
# First check the task list to get the task_id
python {skill_dir}/scripts/schedule_manager.py list
# Then edit
python {skill_dir}/scripts/schedule_manager.py edit <task_id> --schedule "0 10 * * *"
Guidelines
- Before creating a task, use
listto check existing tasks and avoid duplicates - Automatically set the appropriate timezone based on user language
- Must confirm notification method before creating a task: Check the currently enabled skills, recommend available notification channels to the user and confirm. If no notification skills are available, proactively ask the user how they would like to receive results
- Message content is a complete execution instruction for the AI agent and must include both task content and notification instructions (refer to the Message Writing Guidelines above)
- The message language must match the language the user is currently using in the conversation
- One-time task times cannot be in the past
- When editing a task, only modify the fields the user requested — do not change other fields