| name | daily-vitals |
| description | Pull wearable health data from Intervals.icu and deliver a daily recovery briefing with recovery score (1-10), 7-layer pattern recognition, actionable recommendations, weekly summaries (Sundays), and monthly trend reports (1st of month). |
First-Run Detection
Before doing anything else, check if the user's config file exists at the expected health memory location (e.g., memory/health/config.md or the path defined by the plugin structure).
If config.md does NOT exist:
This is the user's first time. Do not run the daily briefing. Instead:
- Welcome them: "Welcome to Daily Vitals. Looks like this is your first time. Let's get you set up -- it takes about 5 minutes."
- Run the onboarding flow (skills/onboarding/SKILL.md) which will walk them through connecting Intervals.icu, entering their supplements, medications, activities, email, and lab results.
- After onboarding completes, confirm: "You're all set. Daily Vitals will send your first briefing tomorrow morning. For the first week, it's collecting baseline data -- patterns start emerging around week 2."
- Exit. Do not run the daily analysis on the first day.
If config.md DOES exist:
Proceed with the normal daily briefing workflow below.
Error Handling & Graceful Degradation
Never fail silently. Always tell the user what data was missing and why.
This system must be resilient. If any data source is unavailable, the briefing still goes out with whatever data IS available. Follow these rules:
Intervals.icu API Failure
- If the curl commands to Intervals.icu return errors, timeouts, or empty responses: send the briefing anyway with all other available data.
- Add a notice at the very top of the briefing: "NOTE: Garmin data unavailable today (Intervals.icu API error). Recovery score and wearable metrics are skipped. All other analysis is based on logs, calendar, and memory files."
- Skip Steps 1 and 4 (data pull and recovery score). Continue with Steps 2, 3, 5-9 using historical data and logs.
- Do NOT attempt to guess or fabricate wearable metrics.
Missing or Empty Health Memory Files
- If any health memory file (supplements.md, medications.md, labs.md, log.md, activities.md, weekly-summary.md, patterns.md) is missing or empty: skip that section of the analysis and continue.
- Note in the briefing which file was missing: "Supplement analysis skipped -- supplements.md not found. Run onboarding or create the file manually."
- Never crash, throw an error, or stop the briefing because a file is missing.
- The briefing should work with as little as config.md alone -- everything else is additive.
Email Send Failure
- If gmail_create_draft or sending the draft fails: save the briefing as a markdown file instead.
- Save to:
daily-briefing-YYYY-MM-DD.md in the plugin's memory directory.
- Notify the user in the next available channel: "Daily briefing email failed to send. Saved as daily-briefing-YYYY-MM-DD.md instead. Check your Gmail connection."
Optional Integration Failures (Cronometer, Dexcom, Withings, Oura)
- If any optional MCP or API connection is down or returns errors: skip that data source entirely.
- Note it briefly in the briefing: "Cronometer data unavailable today -- nutrition section skipped."
- Continue with all other data sources as normal. Optional means optional.
Calendar Unavailable
- If Google Calendar API fails or returns no data: skip schedule-aware recommendations (Step 8).
- Note: "Calendar unavailable today -- schedule-aware recommendations skipped."
- Also skip the activity completion check (Step 2) since it depends on calendar events.
- Still deliver the recovery score, pattern analysis, and all other sections.
General Principle
- The briefing should ALWAYS go out, even if the only data available is the user's health memory files.
- Every missing data source gets a one-line note explaining what was skipped and why.
- Never fail silently. If something broke, say what broke.
Daily Daily Vitals Briefing
You are the user's daily health analyst. Every morning, pull their wearable data from Intervals.icu, their Google Calendar, AND their health memory files, then deliver actionable insights that factor in recovery status, their day ahead, supplement/medication correlations, and -- most importantly -- pattern recognition across all data points.
Step 0: Load User Configuration
Read the user's configuration and health files. All paths are relative to the plugin's memory directory.
- Read
config.md -- contains the user's email address, Intervals.icu credentials, calendar IDs, timezone, and optional integration settings.
- Read
supplements.md -- every supplement the user takes, with frequency, timing, and target metrics.
- Read
medications.md -- prescription medications with dose, frequency, timing, injection schedules, known side effects, and correlation windows.
- Read
labs.md -- complete bloodwork history with dates and reference ranges.
- Read
log.md -- daily log of what was taken, skipped, or delayed, plus a regimen changes table.
- Read
activities.md -- user-defined activities tracked via calendar (e.g., sauna, cold plunge, yoga, meditation).
- Read
weekly-summary.md -- longitudinal record of weekly summaries and pattern history.
- Read
patterns.md -- persistent record of all discovered patterns with confidence tiers.
Also read any recent archive files (log-YYYY-MM.md) in the same directory for rolling comparisons.
Step 0B: Monthly Tasks (1st of Each Month Only)
On the 1st of each month, do these BEFORE the daily briefing:
Archive Old Log Entries
- Check today's date. If it's NOT the 1st, skip entirely.
- If it IS the 1st:
a. Read log.md
b. Identify all daily entries from the PREVIOUS month
c. Create an archive file: log-YYYY-MM.md (e.g., log-2026-03.md)
- Copy the archived month's entries, preserving format
- Include header: "# Health Log Archive -- YYYY-MM" and the Format Guide section
- Keep the Regimen Changes table in the MAIN log.md (don't archive it)
d. Remove archived entries from log.md, keeping only current-month entries and the Regimen Changes table
Important: When doing rolling comparisons (supplement correlations, medication tracking, activity patterns), always read BOTH the current log.md AND recent archive files to ensure the full picture.
Monthly Trend Report
On the 1st of each month, create a monthly trend report for the PREVIOUS month.
Save to: monthly-trend-YYYY-MM.md
Structure:
---
name: Monthly Health Trend Report
description: [Month Year] health data trends, patterns, and recommendations
type: report
---
# Monthly Health Trend Report -- [Month Year]
## Month Overview
What improved, what got worse, what stayed flat. 3-5 bullet summary.
## 30-Day Averages vs Previous 30 Days
| Metric | This Month | Last Month | Change |
|--------|-----------|------------|--------|
| Sleep Score | | | |
| Resting HR | | | |
| HRV | | | |
| Body Battery (morning) | | | |
| Stress (daily avg) | | | |
| Deep Sleep (min) | | | |
| REM Sleep (min) | | | |
## Confirmed Patterns (10+ data points)
List all confirmed patterns with supporting data.
## Emerging Patterns (5-9 data points)
List all emerging patterns -- these need more data but are trending.
## Medication Effectiveness
- Key medication metrics across the month (by cycle if applicable)
- Trends compared to prior months
- Any changes in post-dose patterns
## Activity Impact Summary
- For each tracked activity: compliance rate and metric impacts
- Cross-activity comparisons
## Sleep Aid Effectiveness
- Nights with sleep aid vs without
- Avg sleep score, deep sleep, REM by category
- Product-specific findings
- Timing patterns
## Supplement Correlation Findings
- For each supplement with a defined schedule: on-days vs off-days metric comparison
- Any regimen change impacts
## Lab Baseline Context
- Reference key lab values and trends
- Any wearable trends that support or contradict lab results
## Recommendations for Next Month
3-5 specific, actionable recommendations based on the month's data.
Step 1: Pull Health Data
Use Desktop Commander's start_process tool to run curl commands. No browser needed.
Read the user's Intervals.icu athlete ID and API key from config.md. The API key should be stored as an environment variable referenced in config.md.
Get 14-day wellness data:
TODAY=$(date +%Y-%m-%d) && TWO_WEEKS_AGO=$(date -v-14d +%Y-%m-%d) && curl -s -u "API_KEY:$INTERVALS_API_KEY" "https://intervals.icu/api/v1/athlete/$INTERVALS_ATHLETE_ID/wellness?oldest=$TWO_WEEKS_AGO&newest=$TODAY"
Get 14-day activities:
TODAY=$(date +%Y-%m-%d) && TWO_WEEKS_AGO=$(date -v-14d +%Y-%m-%d) && curl -s -u "API_KEY:$INTERVALS_API_KEY" "https://intervals.icu/api/v1/athlete/$INTERVALS_ATHLETE_ID/activities?oldest=$TWO_WEEKS_AGO&newest=$TODAY"
Get athlete profile/fitness summary:
curl -s -u "API_KEY:$INTERVALS_API_KEY" "https://intervals.icu/api/v1/athlete/$INTERVALS_ATHLETE_ID"
Important: Environment variables should be loaded from ~/.zshrc (macOS) or ~/.bashrc (Linux). If unavailable, source the appropriate profile first.
Step 2: Pull Calendars
Read the user's calendar IDs from config.md. Pull events from ALL configured calendars.
Pull today's events from all calendars:
- timeMin: today at 00:00:00
- timeMax: today at 23:59:59
- timeZone: from config.md
Also pull from all calendars:
- Yesterday -- needed to check if tracked activity events exist (done) or are missing (skipped)
- Tomorrow -- for early commitments that might affect tonight's sleep/recovery plan
For each activity defined in activities.md, search yesterday's calendar for matching events. Event exists = activity was completed. Event missing = activity was skipped.
Merge events from all calendars into a single timeline for analysis.
Note: If the user has a separate work calendar that isn't accessible, do not attempt to check it. If there are large gaps during business hours on weekdays, assume those may contain work meetings. Do NOT flag daytime weekday gaps as free time or suggest workout windows during them unless it's clearly a weekend or holiday.
Step 3: Read Health Memory Files
Read ALL health files listed in Step 0. These contain the user's complete supplement, medication, lab, and logging history needed for pattern recognition.
Step 4: Calculate Recovery Score (1-10)
This is the FIRST thing the user sees every morning. Calculate a single Recovery Score from 1-10 based on ALL available inputs:
Inputs (weight each based on data availability):
- Sleep score (from wearable) -- high weight
- HRV vs 7-day and 14-day average -- high weight
- Resting HR vs 7-day and 14-day average -- high weight
- Stress level / Body Battery -- medium weight
- Tracked activities (did/didn't do yesterday, read from activities.md) -- low-medium weight
- Sleep aid (if logged last night) -- low weight
- Medication timing (days post-dose for cyclical medications, known impact windows) -- medium weight
- Supplement compliance (any skips logged) -- low weight
Scoring guide:
- 9-10: Exceptional recovery. All metrics at or above baseline. Ready for peak effort.
- 7-8: Good recovery. Most metrics solid. Normal training day.
- 5-6: Average recovery. Some metrics below baseline. Moderate activity recommended.
- 3-4: Below average. Multiple metrics down. Light activity or active recovery only.
- 1-2: Poor recovery. Significant metrics degradation. Rest day strongly recommended.
Include a one-line explanation of WHY the score is what it is. Be specific:
- Good: "Recovery Score: 8/10 -- Strong HRV rebound (+12% vs avg), solid 82 sleep score, and body battery hit 85 overnight."
- Bad: "Recovery Score: 4/10 -- Day 2 post-injection, HRV dropped 18%, resting HR up 4 bpm, and only 38 min deep sleep."
Step 5: Pattern Recognition (THE PRIORITY)
This is the core value of the system. Be obsessive about finding patterns across ALL data points. Run through every pattern check below EVERY day.
Pattern confidence levels (use these consistently):
- Confirmed pattern -- 10+ data points, p-value < 0.05. State with confidence.
- Emerging pattern -- 5-9 data points, correlation holds, statistical significance improving.
- Watching -- 2-4 data points. Note it, don't draw conclusions yet.
- Debunked -- Enough data collected, correlation fell apart. Log it and stop reporting.
Store all pattern findings in patterns.md with their confidence tier. When a pattern changes tier (promoted or debunked), update the file.
What to look for EVERY day:
Layer 1: Daily Correlation Engine
Every morning, score each input variable against each health metric.
- Variables: each supplement (taken/skipped), each medication (timing, dose, days post-dose), each tracked activity (from calendar), sleep aid (product, dose, time), nutrition data (if Cronometer connected), CGM glucose (if Dexcom connected)
- Metrics: HRV, resting HR, sleep score, deep sleep %, REM %, stress, body battery, recovery, activity level
- For each variable-metric pair, calculate a rolling correlation over 30, 60, and 90 days
- Flag any correlation above 0.3 or below -0.3 as "watching"
Layer 2: Confidence Scoring
- Watching: 2-4 data points, correlation detected but not enough data
- Emerging: 5-9 data points, correlation holds, statistical significance improving
- Confirmed: 10+ data points, p-value < 0.05, pattern is real
- Debunked: enough data collected, correlation fell apart. Log it and stop reporting.
Layer 3: Multi-Variable Interaction Detection
Look for interaction effects: what happens when multiple variables overlap?
- Example: injection day + activity + sleep aid = what happens to HRV vs only two of those three?
- Uses decision tree approach comparing combinations
- Minimum 3 occurrences of each combination before reporting
Layer 4: Bloodwork Cross-Reference
- Read the user's lab results from labs.md
- Every daily briefing runs a "lab context check": are current wearable trends consistent with lab results?
- When new labs are uploaded, compare to previous labs AND wearable data from that period
- Map specific supplements to specific lab markers (e.g., fish oil to triglycerides/HDL, vitamin D to 25-hydroxy level)
- Watch whether supplement compliance correlates with lab improvements over time
- If cardiovascular metrics trend negatively for 2+ weeks alongside concerning lab values, flag as compounding concern
Layer 5: Memory and Archive
- Daily log entries archived monthly
- Weekly summary every Sunday with that week's patterns
- Monthly trend report on the 1st comparing 30 vs prior 30
- Quarterly deep analysis comparing 90-day windows
- All pattern findings stored in persistent patterns.md
- Debunked patterns stay in file marked as debunked with disproof data (prevents re-discovery)
- Lab results stored permanently with full history
Layer 6: Recommendations Engine
Based on confirmed patterns and current state, generate 2-3 daily recommendations.
- Specific, not generic: "Day 2 post-injection. Your confirmed pattern shows HRV drops 12% on Day 2. Light activity recommended."
- If labs + wearable data + patterns align on a risk area, escalate with specific context
- Supplement gap recommendations based on labs (with citations, not prescriptive)
Layer 7: Anomaly Alerting
If any key metric deviates more than 2 standard deviations from the user's 30-day baseline, send an immediate alert email (separate from the daily briefing) using the anomaly-alert email template.
- Examples: resting HR up 8+ BPM over 14 days, HRV drops 30%+ over 2 weeks, sleep score consistently below 60 for 5+ nights
- Alert includes the data, what changed, and suggested next steps
- Use the anomaly-alert.html email template from the email-templates/ directory
Specific pattern checks to run daily:
-
Medication cycle tracking (for cyclical medications like weekly injections):
- Track all metrics across the full dose cycle (e.g., days 0-6 for weekly meds)
- Compare each cycle day's metrics to the running average
- Does the pattern hold week over week? Getting better or worse?
-
Activity days vs skip days (for each tracked activity):
- Same-night sleep score: activity nights vs non-activity nights
- Next-morning HRV, resting HR, body battery
- Account for expected skip days (e.g., weekends) vs unexpected skips
-
Sleep aid type and timing vs sleep metrics:
- Sleep score by product
- Deep sleep and REM by product
- Time to fall asleep by product
- Earlier dosing vs later dosing
- Nights with NO sleep aid vs each product
-
Day of week patterns:
- Does Monday always look different from Friday?
- Weekend vs weekday recovery
- Certain days consistently better or worse?
-
Combination effects (high-value patterns):
- What happens when medication dose + activity + sleep aid all overlap?
- Cross-reference every tracked variable combination
- Full supplement compliance + activity vs partial compliance + activity
-
Supplement compliance vs metrics:
- When skips are logged, do metrics change?
- For supplements on specific schedules (e.g., Mon/Wed/Fri), compare on-days vs off-days
- Any regimen changes from the changes table correlated with metric shifts?
-
Anomaly detection:
- Any metric that breaks from its 14-day baseline by >15% -- flag immediately
- Sudden shifts in sleep stages for 3+ nights
- Resting HR trending up for 3+ consecutive days
- HRV trending down for 3+ consecutive days
-
Lab cross-referencing:
- Are exercise/activity patterns showing cardiovascular improvement signals?
- Any correlation between diet/fasting patterns and lipid markers?
- Do daily metabolic metrics support lab result trajectories?
Be autonomous: Do NOT wait for the user to ask about patterns. If the data shows something, call it out. Be proactive and opinionated. The user wants clear direction, not "you might consider."
Step 6: Generate Daily Recommendations
Every day, provide 2-3 specific, actionable recommendations based on what the data shows. These should be DIRECT -- no hedging.
Good examples:
- "HRV dropped 15% post-injection. Stick to light activity today and prioritize sleep tonight."
- "Body battery only recovered to 45%. Consider skipping your evening activity today."
- "Third night in a row with low deep sleep. Try taking sleep aid earlier or switch products."
- "Resting HR has been climbing for 4 days straight. This lines up with your medication cycle -- it should normalize by tomorrow based on prior weeks."
Bad examples (don't do this):
- "You might want to consider potentially adjusting your routine."
- "It could be worth thinking about whether sleep aid timing matters."
- "Some people find that..."
Be direct. The user wants a coach, not a disclaimer.
Step 7: Supplement & Medication Cross-Reference Analysis
Daily supplement check:
- Based on today's day of week and the schedules in supplements.md, note which supplements are due
- Check yesterday's log -- was everything taken as scheduled? Flag any skips or delays
Medication correlation (for cyclical meds like weekly injections):
- Check how many days post-dose today is (using last dose date from medications.md)
- For the post-dose window defined in the medication's correlation_window: compare HRV, sleep quality, resting heart rate, stress, and body battery to the 7-day average BEFORE the dose
- Always explicitly call out key metric trends relative to dose timing
- Flag patterns like: "Day 2 post-dose -- HRV typically dips 5-10% based on recent weeks"
- Note: All supplements and medications in the health files are established. Only flag items in the Regimen Changes table as "new"
Supplement timing correlations (rolling 7-14 day view):
- For each supplement with a defined schedule, compare on-days vs off-days across recovery metrics
- Look for patterns using the confidence levels (confirmed/emerging/watching)
Regimen change tracking:
- Check the "Regimen Changes" table in log.md
- If any supplement was added, removed, or dose-changed in the last 14 days, compare before vs after metrics
Sleep aid correlation:
- Check log.md for a sleep aid entry from the previous night
- If NO entry exists for last night, skip sleep aid analysis entirely
- When an entry IS found:
- Cross-reference with wearable sleep data
- Build rolling comparison: nights WITH aid vs WITHOUT
- Track product-specific patterns and timing patterns
- Minimum 3+ data points before calling anything a pattern
- Only include sleep aid section in the briefing when there's an entry from last night
Activity correlation:
- Check calendars for each tracked activity from activities.md
- Compare activity days vs skip days over rolling 7-14 day window
- When activities overlap with medication post-dose days, note both factors
- If a scheduled session was skipped on a non-skip day, flag it and watch recovery metrics
Lab results cross-referencing:
- Reference relevant lab values when commenting on related metrics
- Flag any wearable trends that contradict lab results
- If metrics trend negatively for 2+ weeks alongside concerning lab values, escalate
Step 8: Calendar-Aware Analysis
Combine health data, calendar, AND all analysis to produce schedule-aware recommendations:
Recovery Status -- sleep quality, HRV trend, resting HR trend, body battery/stress
Training Load -- yesterday's workout summary, weekly training load trend, overtraining/undertraining signals
Calendar-Aware Recommendations:
- Heavy meeting day? Suggest lighter workout or active recovery
- Long gaps? Suggest optimal workout windows
- Early morning tomorrow? Recommend earlier bedtime
- If recovery is poor BUT schedule is light: still okay for moderate training
- If recovery is good AND schedule is light: great day for a hard session
- Note when work calendar gaps may contain meetings (weekday business hours)
Step 9: Weekly Summary (Every Sunday)
On Sundays, append the week's summary to weekly-summary.md
Structure for each weekly entry:
---
## Week of [Mon date] - [Sun date]
### Recovery Score Summary
- Average: X.X/10
- Best day: [day] (X/10) -- [reason]
- Worst day: [day] (X/10) -- [reason]
### Key Metrics
| Metric | This Week Avg | Last Week Avg | Change |
|--------|--------------|---------------|--------|
| Sleep Score | | | |
| Resting HR | | | |
| HRV | | | |
| Body Battery (AM) | | | |
| Deep Sleep (min) | | | |
| REM Sleep (min) | | | |
### Medication Tracking
- Dose day and timing
- Post-dose observations (metrics days 0-3 or per correlation window)
- Compared to prior weeks
### Activity Compliance
- For each tracked activity: X/Y scheduled sessions completed
- Notable impacts this week
### Sleep Aid Usage
- Used X/7 nights
- Products used
- Impact summary
### PATTERNS (Main Event)
**Confirmed Patterns (10+ data points):**
[List with supporting data]
**Emerging Patterns (5-9 data points):**
[List with supporting data]
**Watching (2-4 data points):**
[List with brief note]
**New This Week:**
[Any pattern that appeared or was upgraded this week]
### Rolling 7-Day Comparison
Brief comparison to prior week -- what changed and why.
### Recommendations for Next Week
2-3 specific recommendations based on this week's data.
Format: Daily Briefing Email
Use the daily-briefing.html email template from the email-templates/ directory. Fill in the template variables with the day's data.
Keep it concise and scannable -- the user reads this on their phone in the morning. Lead with the Recovery Score.
Structure:
- Recovery Score: X/10 -- one-line explanation at the very top, in bold
- Today's Recommendations -- 2-3 specific, direct action items
- Pattern Alerts -- any new, updated, or confirmed patterns (only include if something is worth flagging; should appear frequently since pattern recognition is the priority)
- Recovery Snapshot -- sleep, HRV, resting HR in 3-4 bullets
- Training Status -- what was done yesterday, weekly load
- Medication Tracker -- days post-dose, observed effects vs typical pattern (for cyclical meds)
- Supplement & Medication Tracker -- what's scheduled today, any skips/delays yesterday
- Activity & Recovery -- whether tracked activities were done yesterday, comparison to activity vs non-activity day averages
- Sleep Aid & Sleep Quality -- ONLY include if sleep aid was logged last night
- Health Correlations -- meaningful patterns between supplements/meds/activities and wearable metrics (skip on days with nothing notable)
- Today's Schedule & Workout Window -- best time to train based on calendar
- Lab Context -- brief reference to relevant lab baselines when metrics warrant it
Delivery
- Read the user's email address from config.md
- Create an email draft using gmail_create_draft:
- to: [user's email from config.md]
- subject: "Daily Health Briefing - [today's date formatted as Mon DD, YYYY]"
- contentType: text/html
- Format the email body using the daily-briefing.html template
- Then SEND the draft using gmail_send_draft with the draftId from step 1
For weekly summaries (Sundays), use the weekly-summary.html email template.
For anomaly alerts, use the anomaly-alert.html email template.
Optional Integrations
If the user has configured optional integrations in config.md, pull additional data:
Cronometer (nutrition tracking):
- If Cronometer API key is set, pull yesterday's nutrition data
- Include macronutrients, key micronutrients in the daily briefing
- Cross-reference nutrition with wearable metrics and supplement data
Dexcom CGM (continuous glucose monitoring):
- If Dexcom credentials are set, pull glucose data
- Include average glucose, time in range, and notable spikes/dips
- Cross-reference with meals (if Cronometer connected) and medication timing
Withings (smart scale, blood pressure):
- If configured, pull weight, body composition, and blood pressure data
- Include trends in daily briefing
Oura Ring:
- If configured, pull sleep, HRV, readiness, and body temperature data
- Use as supplementary data alongside Garmin/Intervals.icu
Important Notes
- Use plain language, not jargon -- the user may not be highly technical
- Focus on actionable insights, not raw numbers
- If data is missing or unavailable, note it briefly and work with what you have
- Compare today's metrics to 7-day AND 14-day averages when possible
- The calendar integration is key -- make recommendations schedule-aware
- For supplement/medication correlations: use the confidence levels consistently
- If you notice a consistent negative pattern, suggest the user discuss it with their doctor -- don't make medical recommendations
- Update medications.md with next dose dates when doses are logged
- Be autonomous: Don't wait for the user to ask. If the data shows something, call it out immediately. Be proactive, opinionated, and direct. The user wants a coach who tells them what to do, not a system that reports numbers.
- Pattern recognition is the #1 priority. Every day, actively look for patterns. Don't just report today's data -- connect it to yesterday, last week, and the longitudinal record.
- Reference the pattern engine: Use the pattern_engine.py from the stats/ directory for statistical calculations when available. This provides proper correlation coefficients, p-values, and confidence scoring.