Focus Break Reminder
Workspace wellness break reminder with configurable work interval, cooldown, idle reset, quiet hours, and per-day caps. Use when users want OpenClaw to remin...
Description
name: focus-break-reminder description: Workspace wellness break reminder with configurable work interval, cooldown, idle reset, quiet hours, and per-day caps. Use when users want OpenClaw to remind them to take regular breaks during long sessions, including setup of heartbeat checks, reminder templates, and on/off/snooze/status controls.
Focus Break Reminder
Implement a lightweight per-user/session state machine that triggers rest reminders without spamming.
Configure
Create or load references/config.example.json as the default schema.
Required settings:
enabledtimezonework_minutescooldown_minutesidle_reset_minutesdaily_max_remindersquiet_hourssnooze_untiltemplates
Prefer defaults that are practical and non-intrusive:
- work interval: 50 minutes
- cooldown: 30 minutes
- idle reset: 15 minutes
- daily cap: 4
Track state
Maintain minimal state per user (or per DM/chat for first version):
session_start_atlast_active_atlast_remind_atremind_count_todaytoday_key
Persist to a small JSON file so reminders survive restarts.
Update activity
On each inbound user message:
- If date changed in configured timezone, reset
remind_count_todayandtoday_key. - If idle time since
last_active_at>=idle_reset_minutes, resetsession_start_atto now. - Set
last_active_atto now.
Evaluate reminder eligibility
Only remind when all conditions pass:
enabledis true.- Not in quiet hours.
- Not snoozed (
now < snooze_untilmeans skip). - Daily cap not exceeded.
- Active duration (
now - session_start_at) >=work_minutes. - Cooldown passed (
now - last_remind_at) >=cooldown_minutes.
If all pass, send one reminder and set:
last_remind_at = nowremind_count_today += 1
Reminder delivery
Use one short template per reminder. Keep copy practical and non-medical.
Example template:
- “你已经连续工作一段时间了。现在起身 2 分钟、喝口水,再看 20 秒远处 👀”
Commands
Support these chat commands:
/break on→ enable reminders/break off→ disable reminders/break status→ show current config + next eligible reminder window/break set <minutes>→ updatework_minutes/break snooze <minutes>→ setsnooze_until = now + minutes
Validate numeric ranges (e.g., 15–180 for work interval).
Heartbeat integration
Use heartbeat polling to run eligibility checks when there is recent activity. Avoid noisy polling loops.
Recommended behavior:
- If no user activity for a long period, skip checks.
- If reminder was just sent, honor cooldown and return quickly.
Safety and UX boundaries
- Do not provide medical diagnosis or treatment advice.
- Keep reminders optional and easy to disable.
- Store only minimum timestamps and settings needed for reminder logic.
- Use clear language when data is missing: “待补充”.
Testing checklist
Use references/test-cases.md.
At minimum verify:
- triggers at/after work interval
- cooldown suppresses duplicates
- idle reset restarts session timer
- quiet hours suppress reminders
- snooze suppresses reminders until expiry
- daily cap blocks additional reminders
Reviews (0)
No reviews yet. Be the first to review!
Comments (0)
No comments yet. Be the first to share your thoughts!