Home Tutorials Categories Skills About
ZH EN JA KO
Skills-Plugins

Building a Scheduled Reminder Skill for OpenClaw

· 14 min read

Introduction

Scheduled reminders are one of the most practical features of a personal AI assistant. Imagine casually saying "Remind me about the meeting tomorrow at 9 AM" in a chat window and actually getting a notification when the time comes — that's exactly what we'll build in this tutorial.

This tutorial walks you through developing a full-featured reminder Skill with natural language time parsing, recurring reminders, and persistent storage.

Feature Planning

Our reminder Skill needs the following capabilities:

Feature Description Priority
Set Reminders Create one-time reminders using natural language Required
Recurring Reminders Daily, weekly, and monthly repeating reminders Required
View Reminders List all pending reminders Required
Delete Reminders Cancel a specific reminder Required
Persistence Reminders survive restarts Required
Multi-Channel Push Deliver notifications in the channel where the reminder was set Recommended

MCP Tool Configuration

The reminder feature requires file read/write and scheduling capabilities. Configure the MCP tools in ~/.config/openclaw/openclaw.json5:

{
  mcp: {
    servers: {
      "filesystem": {
        command: "npx",
        args: ["-y", "@modelcontextprotocol/server-filesystem",
               "--allow-read", "--allow-write",
               "~/.openclaw/data/reminders/"],
      },
      "scheduler": {
        command: "npx",
        args: ["-y", "@openclaw-mcp/scheduler"],
      }
    }
  }
}

Create the reminder data directory:

mkdir -p ~/.openclaw/data/reminders/

Writing the SKILL.md

Create reminder.SKILL.md in the ~/.openclaw/skills/ directory:

---
name: reminder
version: 1.0.0
description: 定时提醒技能,支持自然语言设置提醒、周期任务和持久化存储
triggers:
  - 提醒
  - remind
  - 闹钟
  - alarm
  - 定时
  - 待办
  - 记得
  - 别忘了
  - 到时候
mcp_tools:
  - filesystem
  - scheduler
---

# 定时提醒技能

## Description

这是一个定时提醒技能,让用户可以通过自然语言设置、管理提醒事项。
提醒到期时,自动在用户所在的频道发送通知。

## Core Behavior

### 设置提醒

当用户想设置提醒时:

1. **解析时间**:从用户消息中提取时间信息,支持以下格式:
   - 绝对时间:"明天早上9点"、"3月15日下午3点"、"2026-03-20 14:00"
   - 相对时间:"5分钟后"、"1小时后"、"3天后"
   - 自然语言:"今天晚上"、"这周五"、"下周一上午"

2. **提取内容**:识别提醒内容,即用户想被提醒做什么。

3. **确认信息**:向用户确认提醒的时间和内容。

4. **保存提醒**:使用 filesystem 工具将提醒保存到
   `~/.openclaw/data/reminders/reminders.json`。

5. **注册调度**:使用 scheduler 工具注册定时任务。

### 查看提醒

当用户要查看提醒列表时,读取 reminders.json 并按时间排序展示。

### 删除提醒

当用户要取消提醒时,根据编号或内容匹配找到提醒并删除。

### 触发提醒

当提醒时间到达时,scheduler 会回调 OpenClaw,在对应频道发送提醒消息。

## Data Schema

提醒数据使用 JSON 格式存储:

```json
{
  "reminders": [
    {
      "id": "rem_20260328_001",
      "content": "参加下午的产品会议",
      "triggerTime": "2026-03-28T14:00:00+08:00",
      "repeat": null,
      "channelType": "telegram",
      "channelId": "12345678",
      "userId": "user_001",
      "createdAt": "2026-03-28T09:00:00+08:00",
      "status": "pending"
    }
  ]
}

Field Reference

Field Type Description
id string Unique identifier, format rem_YYYYMMDD_NNN
content string Reminder content
triggerTime string Trigger time in ISO 8601 format
repeat object/null Repeat rules (see below)
channelType string Source channel type
channelId string Source channel/user ID
userId string User who set the reminder
createdAt string Creation time
status string Status: pending/triggered/cancelled

Repeat Rules

{
  "repeat": {
    "type": "daily",
    "interval": 1,
    "endDate": "2026-12-31T23:59:59+08:00"
  }
}

Available type values:

  • daily: Repeat every day
  • weekly: Repeat every week (specific day of week can be specified)
  • monthly: Repeat every month (specific date can be specified)
  • cron: Custom cron expression

Output Format

Reminder Set Successfully

✅ 提醒已设置!

📋 内容:{提醒内容}
⏰ 时间:{YYYY年MM月DD日 HH:mm}
🔁 重复:{重复规则,无则显示"一次性"}
🆔 编号:{ID}

到时候我会在这里通知你。

View Reminder List

📝 你的提醒列表:

1. ⏰ {时间1} - {内容1} [编号: {ID1}]
2. ⏰ {时间2} - {内容2} [编号: {ID2}]
3. 🔁 {时间3} - {内容3}(每天重复)[编号: {ID3}]

共 {N} 个待触发提醒。
输入"取消提醒 {编号}"可删除指定提醒。

Reminder Triggered Notification

🔔 提醒时间到!

📋 {提醒内容}
⏰ 当前时间:{HH:mm}

---
这是你在 {设置时间} 设置的提醒。

Reminder Deleted Successfully

❌ 已取消提醒:{提醒内容}

Error Handling

  • 如果无法解析时间,请用户用更明确的方式表述
  • 如果时间已经过去,提醒用户设置的时间已过期
  • 如果 reminders.json 不存在,自动创建空文件
  • 如果 scheduler 不可用,告知用户提醒功能暂时不可用

Example Interactions

用户:明天早上8点提醒我买咖啡 助手:✅ 提醒已设置! 📋 内容:买咖啡 ⏰ 时间:2026年03月29日 08:00 🔁 重复:一次性 🆔 编号:rem_20260328_001

用户:每周五下午5点提醒我写周报 助手:✅ 提醒已设置! 📋 内容:写周报 ⏰ 时间:每周五 17:00(下次:2026年03月28日) 🔁 重复:每周五 🆔 编号:rem_20260328_002

用户:看看我有哪些提醒 助手:📝 你的提醒列表: 1. ⏰ 03/29 08:00 - 买咖啡 [编号: rem_20260328_001] 2. 🔁 每周五 17:00 - 写周报 [编号: rem_20260328_002] 共 2 个待触发提醒。

用户:取消买咖啡的提醒 助手:❌ 已取消提醒:买咖啡


## Persistence Mechanism

### Storage Strategy

Reminder data is saved in `~/.openclaw/data/reminders/reminders.json`. The file is written immediately after every operation (create, delete, or modify).

### Recovery After Restart

When OpenClaw restarts, the reminder skill needs to:

1. Read all reminders with a `pending` status from reminders.json
2. Re-register them with the scheduler
3. Clean up expired but untriggered reminders (mark them as `missed` and notify the user during the next interaction)

## Timezone Handling

Time parsing and storage must account for timezones:

```markdown
## Timezone Rules

- 默认使用用户所在频道配置的时区
- 如果未配置时区,默认使用 Asia/Shanghai (UTC+8)
- 所有存储时间使用 ISO 8601 带时区格式
- 显示时间使用用户本地时区

Testing Checklist

After development, test using the following checklist:

# 1. Restart to load the skill
openclaw restart

# 2. Confirm the skill is loaded
openclaw skill list

Then test each scenario in chat:

  • [ ] Set a reminder for 1 minute from now and verify it triggers on time
  • [ ] Set a reminder with an absolute time
  • [ ] Set a recurring reminder
  • [ ] View the reminder list
  • [ ] Delete a reminder
  • [ ] Restart OpenClaw and check that reminders are recovered

Summary

The scheduled reminder Skill is a comprehensive project that involves natural language time parsing, data persistence, scheduled task dispatching, and multi-channel notification delivery. Once you've mastered the development approach for this Skill, you'll be equipped to build even more complex automation workflow skills.

OpenClaw is a free, open-source personal AI assistant that supports WhatsApp, Telegram, Discord, and many more platforms