# HEARTBEAT.md

Check the following and notify only once per event (track in `memory/heartbeat-state.json`):

1. **USA-Iran conflict**: Fetch news (RSS or search). If USA attacks/strikes Iran militarily, notify immediately. Only notify once when it first happens.

2. **Rheinmetall stock (RHM)**: Check current price. If above €1950, notify. Only notify once when threshold is crossed.

3. **Evening wind-down guidance (19:00-22:00 Vienna)**:
   
   **First nudge at 19:00**: On the first heartbeat at/after 19:00 Vienna, always check in — ask what they're doing if not in active conversation, or nudge toward winding down if already chatting about work/tinkering.
   
   **If NOT in active conversation**: Send a brief WhatsApp asking what they're doing (working? winding down? about to start something new?). Log responses in `memory/wind-down-log.json`.
   
   **Concrete wind-down suggestions**: Don't just say "maybe wind down" — use real data:
   - `bin/jellyfin resume` → suggest continuing what they're watching
   - `bin/jellyfin recent` → suggest something newly added
   - `bin/audiobooks current` → suggest picking up their audiobook
   - Make it specific: "You're 44% through Die zweite Legion" or "New movie added: The Rip (2026)"
   
   **Work-end reminders**: When they indicate they're wrapping up or transitioning to wind-down, check `memory/tasks.json` for `recurring` items with `when: "evening"` and remind them (e.g., nose shower) before they get too deep into relaxation mode.

   **📝 AUTO-LOG EVERYTHING 19:00→SLEEP** — Log to `memory/wind-down-log.json` as events happen:
   - What they're doing (working, watching TV, chatting, browsing, etc.)
   - Activity changes (switched from X to Y)
   - Work tasks and when they finish
   - Nose shower / evening routine
   - Food/drinks mentioned
   - Energy/mood if mentioned
   - In bed / winding down
   - Trying to sleep
   - Sleep issues (couldn't sleep, woke up, etc.)
   - Anything that might reveal patterns
   
   Log continuously from 19:00 Vienna until sleep. This data is critical for analyzing habits and optimizing the wind-down process. Don't wait to be asked.

4. **Proactive calendar reminders**: Check CalDAV for upcoming events (see TOOLS.md for credentials). Only remind for events that require leaving home:
   - In-person / location-based: 1-2 hours before (account for travel)
   - Appointments (doctor, haircut, etc.): 1 hour before
   - Skip: Video calls, online meetings, at-home events (calendar app handles those)
   Track sent reminders in `memory/calendar-reminders-sent.json` to avoid duplicates.

5. **Steam Machine / Steam Frame**: Check for **official Valve news only** about pricing or release date. Notify once when official price or specific release date is announced. Baseline: "early 2026" window, no price yet.

6. **OpenClaw + Claude Code updates**: Check once daily (daytime) for:
   - OpenClaw releases (especially for Opus 4.6 support via PR #9863)
   - Claude Code new versions
   Track in `memory/heartbeat-state.json` watchlist. Notify when new versions ship.

7. **Task nudging**: During daytime hours (10:00-18:00 Vienna), occasionally check `memory/tasks.json` for:
   - `now` priority tasks — nudge daily
   - `soon` priority tasks — nudge every 2-3 days (weekdays only)
   - `someday` tasks — only mention during weekly reviews or when contextually relevant
   On weekends: only nudge `now` priority items.
   Surface 1-2 items max, conversationally. NOT in evening — that's wind-down time.
   **Auto-capture:** When user mentions tasks naturally in chat ("I should...", "I need to...", "Don't forget..."), add to tasks.json and confirm with a short acknowledgment.
   **Done = delete.** Remove completed tasks immediately. History lives in daily memory logs.

If nothing new to report, reply HEARTBEAT_OK.
