Nag:AI 编程智能体的持续提醒系统 - Openclaw Skills

作者:互联网

2026-04-17

AI教程

什么是 Nag?

Nag 是 Openclaw Skills 生态系统中一个复杂的提醒持久层。与容易被忽略或遗忘的标准一次性警报不同,Nag 专为需要明确人工确认的任务而设计。它维持一个持久状态来跟踪任务是否已完成,并利用循环心跳机制在任务未确认时重复提示用户。

通过利用自然语言处理进行确认匹配和可配置的个性化语气,Nag 让您的 AI 代理在管理日常日程方面变得更加主动。它弥补了简单调度与高问责工作流之间的差距,确保关键的日常习惯或行政任务在忙碌的工作中不会被遗漏。

下载入口:https://github.com/openclaw/skills/tree/main/skills/meimakes/nag

安装与下载

1. ClawHub CLI

从源直接安装技能的最快方式。

npx clawhub@latest install nag

2. 手动安装

将技能文件夹复制到以下位置之一

全局模式 ~/.openclaw/skills/ 工作区 /skills/

优先级:工作区 > 本地 > 内置

3. 提示词安装

将此提示词复制到 OpenClaw 即可自动安装。

请帮我使用 Clawhub 安装 nag。如果尚未安装 Clawhub,请先安装(npm i -g clawhub)。

Nag 应用场景

  • 管理每日重复习惯,如服用补充剂、运动或练习技能。
  • 跟踪那些由于缺乏持续跟进经常被忽略或遗忘的高优先级任务。
  • 建立强制确认的问责工作流,在此类流程中,简单的通知是不够的。
  • 在 Openclaw Skills 框架内为常规运营任务自动化每日重置计划。
Nag 工作原理
  1. 代理在每个心跳周期中监控 nag-config.json 中的配置和 memory/nag-state.json 中的当前状态。
  2. 在新一天的首次运行时,系统会自动将所有提醒重置为未确认状态。
  3. 在指定时间通过标准 cron 任务触发初始提醒。
  4. 如果用户在定义的 nagAfter 窗口前未确认完成,代理将开始发送跟进消息。
  5. 代理使用自然语言子字符串匹配,将用户回复与确认模式列表进行匹配。
  6. 如果用户继续忽略提示,代理将根据配置的语气和催促次数提高消息的紧迫性和强度。

Nag 配置指南

要将 Nag 集成到您的 Openclaw Skills 工作空间,请遵循以下安装步骤:

  1. memory/nag-state.json 初始化您的状态文件以跟踪每日进度:
{
  "date": "2026-02-15",
  "reminders": {}
}
  1. 在工作空间根目录的 nag-config.json 中定义您的提醒计划,指定标识符、cron 计划和确认短语。
  2. cronFirst 计划配置 cron 任务以启动提醒序列。
  3. 在您的 HEARTBEAT.md 中添加一个 Nag Check 块,确保代理在每个心跳周期评估提醒状态。

Nag 数据架构与分类体系

Nag 使用结构化数据模型来确保 Openclaw Skills 环境的一致性。系统依赖两个主要文件:

组件 文件路径 关键元数据
配置 nag-config.json id, cronFirst, nagAfter, confirmPatterns, tone
状态跟踪 memory/nag-state.json date, confirmed, confirmedAt, nagCount

配置允许自定义消息传递和升级逻辑,而状态文件确保代理准确知道任务何时完成以及催促了用户多少次。

name: nag
description: Persistent reminder system that keeps bugging you until you confirm completion. Use when setting up recurring reminders, nag schedules, or any task that needs follow-up until acknowledged. Handles daily resets, configurable nag windows, escalating urgency, and natural-language confirmation matching. Do NOT use for one-shot reminders (use cron instead) or time-sensitive alerts that need immediate action (use cron with wakeMode now).

Nag — Persistent Reminders

Nag manages reminders that don't give up. Each reminder has a first-fire time, a nag window, and resets daily.

When to Use

  • Recurring daily habits (supplements, workouts, practice)
  • Tasks that get ignored/forgotten without follow-up
  • Anything where "remind me once" isn't enough

When NOT to Use

  • One-shot reminders ("remind me in 20 minutes") — use a cron job with schedule.kind: "at"
  • Time-critical alerts that can't wait for a heartbeat cycle
  • Reminders that don't need confirmation (informational only)

Setup

1. State File

Create memory/nag-state.json in the workspace:

{
  "date": "2026-02-15",
  "reminders": {}
}

The date field triggers automatic daily resets — when today's date differs from the stored date, all reminders reset to unconfirmed.

2. Reminder Config

Create nag-config.json in the workspace root:

{
  "reminders": [
    {
      "id": "morning-supplements",
      "label": "morning supplements",
      "cronFirst": "0 8 * * *",
      "nagAfter": "09:00",
      "confirmPatterns": ["taken", "done", "took them", "did it", "yes"],
      "tone": "friendly but persistent, escalate to ALL CAPS drama after 3 nags",
      "messages": {
        "first": "Time for morning supplements!"
      }
    }
  ]
}

Fields:

Field Required Description
id yes Unique identifier, used as key in state file
label yes Human-readable name for display
cronFirst yes Cron expression for initial reminder (create a cron job for this)
nagAfter yes Time (HH:MM, 24h) after which heartbeat nags begin
confirmPatterns yes Array of phrases that mark the reminder as done (case-insensitive, substring match)
tone no Personality guidance for generating nag messages. If absent, use a neutral friendly tone. The model has creative liberty to vary the wording each nag.
messages.first no Text sent by the cron job for the initial reminder. If absent, generate from label + tone.
messages.nag no Suggested nag text. If absent, generate contextually from label + tone + nagCount.
messages.escalate no Suggested text after 3+ ignored nags. If absent, generate with increased urgency from tone.
days no Array of weekday names to restrict when this reminder fires (e.g. ["monday", "wednesday", "friday"]). Omit for every day.

For more examples, see references/config-examples.md.

Message generation: When messages.nag or messages.escalate are absent, generate them on the fly using the label and tone fields. Vary the wording each time — don't repeat the same nag verbatim. Use nagCount to calibrate urgency: low count = gentle, 3+ = escalated.

3. Wire Up Cron + Heartbeat

For each reminder, create a cron job that fires messages.first at the cronFirst schedule.

In HEARTBEAT.md, add a nag check block:

## Nag Check
Read nag-config.json and memory/nag-state.json.
For each reminder in nag-config.json:
- If date in state differs from today, reset all reminders (set confirmed: false, nagCount: 0).
- Skip if today's weekday isn't in the reminder's `days` array (if specified).
- If current time is after `nagAfter` and confirmed is false: send a nag message to the user.
  - Generate the message from the reminder's label and tone (or use messages.nag if provided).
  - If nagCount >= 3, escalate urgency (use messages.escalate if provided, otherwise generate with more intensity).
  - Increment nagCount in state.
- Do NOT nag before the nagAfter time.

4. Confirmation Handling

When the user sends a message matching any confirmPatterns for a reminder, update memory/nag-state.json:

{
  "date": "2026-02-15",
  "reminders": {
    "morning-supplements": {
      "confirmed": true,
      "confirmedAt": "09:06",
      "nagCount": 1
    }
  }
}

Match confirmation by checking if any pattern appears as a substring (case-insensitive) in the user's message. When ambiguous (multiple reminders could match), match the one currently in its nag window.

Adding a New Reminder

  1. Add entry to nag-config.json
  2. Create a cron job for the cronFirst schedule
  3. The heartbeat nag block handles everything else automatically

Removing a Reminder

  1. Remove entry from nag-config.json
  2. Remove or disable the corresponding cron job
  3. Optionally clean up its key from memory/nag-state.json