Ultrahuman analytics
This skill implements multi-day analytics, predictions, correlations, reports, and engagement on top of Ultrahuman data. Always use the ultrahuman_mcp tool ultrahuman_get_daily_metrics once per date, then aggregate and interpret in your response. Never invent data; only use what the API returns.
Prerequisites
- - ultrahumanmcp must be available. Use email from ULTRAHUMANEMAIL or user message.
- Dates in YYYY-MM-DD. For "last 7 days" compute the 7 dates ending yesterday (or today if user says "including today").
- All workflows are read-only and descriptive (no medical advice).
1. Analytics and evaluations
1.1 Weekly report
Trigger: "weekly report", "last 7 days summary", "how was my week", "week in review".
Steps:
- 1. Call ultrahumangetdailymetrics for each of the last 7 days (same email). Use
response_format: "json" if you need to parse programmatically, or "markdown" and extract numbers from the summary. - For each day extract: sleep score, recovery score, HRV (avg), night RHR, steps. If present: metabolicscore, timeintarget, average_glucose.
- Compute: averages for sleep, recovery, HRV, steps; best night (highest recovery or sleep score, state which date); worst night (lowest); day-over-day deltas (e.g. "Recovery improved 3 days in a row, then dropped").
- Reply with: one short paragraph summary, then a small table (date | sleep | recovery | HRV | steps), then 1–2 bullet insights (e.g. "Best night: Wed (recovery 8). Recovery trend: improving into mid-week.").
1.2 Sleep consistency score
Trigger: "sleep consistency", "how consistent is my sleep", "sleep variability".
Steps:
- 1. Fetch last 7–14 days via ultrahumangetdailymetrics (one call per date).
- From each day's sleep object get: total sleep (from quickmetrics), sleep efficiency, and if available bedtime (from details). Compute standard deviation or range for total sleep and efficiency.
- Derive a simple "consistency" statement: e.g. "You're highly consistent (sleep within 30 min and efficiency within 5% most nights)" or "Sleep duration varied by ~1h this week – consider more consistent bedtimes."
- No formal score required; descriptive summary is enough.
1.3 Recovery trend
Trigger: "recovery trend", "recovery over the week", "how is my recovery trending", "recovery last 14 days".
Steps:
- 1. Fetch 7 or 14 days (one call per date).
- Extract per day: recovery score or recoveryindex, HRV avg, nightrhr avg.
- Build a table: date | recovery | HRV | night RHR. Add a one-line trend: "Improving", "Declining", "Stable", or "Recovery dipped mid-week then recovered."
- If recovery dropped for 3+ days in a row, add a short note: "Consider lighter days or more sleep" (descriptive only).
1.4 Metabolic week
Trigger: "metabolic week", "glucose this week", "time in target last 7 days", "metabolic summary".
Steps:
- 1. Fetch last 7 days.
- From each day get: metabolicscore, timeintarget, averageglucose, glucose_variability (if present). If a day has no CGM data, note "No CGM data for [date]."
- Compute weekly averages for the metrics that exist. Optionally compare to the previous 7 days if user asked for "vs last week" (then fetch 14 days and split).
- Reply: "Metabolic week: average time in target X%, avg glucose Y mg/dL, variability Z%. [One-line comparison if previous week requested.]"
1.5 VO2 and movement trend
Trigger: "VO2 trend", "movement this week", "activity trend", "steps and VO2".
Steps:
- 1. Fetch last 7 days.
- Extract: steps (avg), movementindex, vo2max per day where available.
- Weekly average for steps and movementindex; if vo2max is present, note trend (up/stable/down) or latest value.
- One sentence: "Activity trend: [up/stable/down]. Weekly avg steps: X. Movement index avg: Y."
1.6 Deep / REM balance
Trigger: "deep sleep", "REM sleep", "sleep stages", "deep vs REM".
Steps:
- 1. Fetch last 7 days (or N user specified).
- From each day's sleep details.sleepstages get: deepsleep %, lightsleep %, remsleep %, awake %.
- Compute average % deep and average % REM over the period. Note if one is consistently low (e.g. "REM averaged 12% – some research associates higher REM with memory and mood; consider sleep consistency."). Descriptive only, no diagnosis.
2. Predictions and readiness
2.1 Tomorrow readiness
Trigger: "tomorrow readiness", "will I be ready tomorrow", "am I set for tomorrow".
Steps:
- 1. Fetch last night's (or the most recent night's) data with ultrahumangetdaily_metrics.
- Read: sleep score, recovery score, HRV.
- Heuristic (descriptive only): "When recovery is above 7 and sleep above 6, your numbers typically support a solid next day. Your last night: recovery X, sleep Y – [so your numbers suggest good readiness / suggest paying attention to rest today]."
- Do not promise outcomes; only describe what the numbers often indicate.
2.2 Training load check
Trigger: "I trained hard yesterday", "training load", "did I recover from my workout", "heavy training yesterday".
Steps:
- 1. Fetch yesterday and optionally today (or 2–3 days including the training day).
- Compare recovery, sleep, HRV on the night after the training day to the user's recent baseline (e.g. 7-day average). If no baseline yet, use the same night's values only.
- Reply: "After your training day, last night's recovery was [X]. [Compared to your recent average, that's typical / below your average – your body may need more recovery before the next hard session.]" Descriptive only.
2.3 Low-recovery alert
Trigger: "low recovery", "recovery alert", "am I overreaching", "recovery slipping".
Steps:
- 1. Fetch last 7 days.
- Compute 7-day average recovery (or recovery_index). Count how many of the last 3 nights were below that average.
- If 2 or 3 of the last 3 nights are below average: "Last 3 nights your recovery was below your 7-day average – consider lighter days or more sleep."
- If not, briefly summarize: "Your last 3 nights are in line with or above your weekly average."
2.4 Glucose spike risk (pattern)
Trigger: "glucose and sleep", "does sleep affect my glucose", "glucose spike risk".
Steps:
- 1. Fetch last 7–14 days.
- For each day: total sleep (from sleep details) or sleep score, and glucosevariability or averageglucose (if CGM data exists).
- Split days into "shorter sleep" (e.g. <6h or sleep score <5) vs "longer sleep". Compute average glucose variability (or average glucose) for each group.
- One sentence pattern: "On days when you slept under 6h, your glucose variability averaged X% vs Y% on longer-sleep days." No causation; present as observed pattern only.
3. Correlations and insights
3.1 Sleep–glucose link
Trigger: "sleep and glucose", "sleep glucose link", "how does sleep affect my glucose".
Steps:
- 1. Fetch 7–14 days.
- For each day: total sleep or sleep score; timeintarget and/or averageglucose.
- Group days by e.g. "7+ hours sleep" vs "under 7 hours". Average timeintarget (and optionally averageglucose) per group.
- Reply: "When you slept 7+ hours, time in target averaged X%. When you slept less, it averaged Y%." No causation; pattern only.
3.2 Sleep–recovery link
Trigger: "sleep recovery link", "does sleep affect recovery", "sleep efficiency and recovery".
Steps:
- 1. Fetch 7–14 days.
- From each day: sleep efficiency (from sleep details quickmetrics), recovery score or recoveryindex.
- Group by efficiency (e.g. ≥85% vs <85%). Average recovery per group.
- Reply: "Your recovery tends to be higher when sleep efficiency is above 85% (avg recovery X vs Y when efficiency is lower)."
3.3 Rest day effect
Trigger: "rest day", "days I didn't train", "recovery after rest".
Steps:
- 1. Fetch last 7–10 days.
- Use steps (or movement_index) as a proxy for activity: "high steps" vs "low steps" days. Define thresholds simply (e.g. above/below median steps).
- Compare average recovery and sleep score (and HRV if you like) on "low steps" days vs "high steps" days.
- Reply: "On lower-activity days your recovery averaged X vs Y on higher-activity days." Descriptive only.
3.4 Weekday vs weekend
Trigger: "weekday vs weekend", "weekend sleep", "do I sleep better on weekends".
Steps:
- 1. Fetch last 14 days (to get at least two weekends).
- Label each date as weekday (Mon–Thu) or weekend (Fri–Sun), or Mon–Fri vs Sat–Sun depending on user wording.
- Average sleep score and recovery score for weekday vs weekend.
- Reply: "Weekday average sleep score X, recovery Y. Weekend sleep X2, recovery Y2. [You sleep ~Z% better on weekends / similar across the week.]"
4. Reports and exports
4.1 PDF-ready summary
Trigger: "PDF summary", "export last 7 days", "report I can copy", "summary for doc".
Steps:
- 1. Fetch last 7 days (or N requested).
- Build a structured Markdown or plain-text block: title "Ultrahuman summary – [date range]"; then table with columns Date | Sleep | Recovery | HRV | Steps | [Glucose/Metabolic if present]; then one line "Trend: …".
- Tell the user they can copy the block into a doc or export to PDF. No images; text/table only.
4.2 Coach view
Trigger: "coach view", "share with coach", "coach summary", "trainer report".
Steps:
- 1. Fetch last 7–14 days.
- Include only: recovery trend (up/down/stable), sleep consistency (one line), any red flags (e.g. "3 nights in a row below average recovery"). Optional: best night, worst night, one MVP metric.
- Keep it short (3–5 bullets). Framed as "Summary for your coach" or "Highlights to share."
4.3 Monthly one-pager
Trigger: "monthly summary", "last month", "4 weeks", "month over month".
Steps:
- 1. Fetch last 28 days (or 4 full weeks). Group by week (e.g. Week 1: days 1–7, Week 2: 8–14, …).
- For each week compute: average sleep score, recovery, steps; optionally metabolic if available.
- Output: table "Week | Sleep avg | Recovery avg | Steps avg | [Metabolic]"; then one sentence "Month over month: [improving / stable / declining]."
- If user asked for "vs previous month", fetch 56 days and compare two 28-day blocks.
5. Fun and engagement
5.1 Best night of the week
Trigger: "best night", "best sleep this week", "top night".
Steps:
- 1. Fetch last 7 days.
- Pick the night with highest recovery score (or sleep score if recovery missing). State the date and day name.
- Reply: "Your best night this week was [Tuesday] ([date]): recovery [X], [7h20 sleep], HRV [Y]." Include 1–2 other metrics from that night.
5.2 Streak counter
Trigger: "streak", "how many nights", "recovery streak", "sleep streak".
Steps:
- 1. Fetch last 7–14 days (enough to count backwards).
- From most recent night going backwards, count consecutive nights where recovery score ≥ 7 (or sleep score ≥ 7, if user said "sleep streak").
- Reply: "You've had [N] nights in a row with recovery ≥ 7." Or "Your current streak is [N] nights of sleep score ≥ 7." If streak is 0, say "No streak right now – last night was below 7."
5.3 Personal record
Trigger: "personal record", "best HRV", "best sleep score", "PR this month".
Steps:
- 1. Fetch the requested range (e.g. last 30 days or "this month").
- Find max HRV and the date; max sleep score and the date. If user asked for one metric only, do that one.
- Reply: "Your highest HRV this [period] was [58] on [date]. Your best sleep score was [9] on [date]."
5.4 Weekly MVP metric
Trigger: "weekly MVP", "highlight this week", "best metric this week", "standout".
Steps:
- 1. Fetch last 7 days.
- Compute averages for: sleep score, sleep efficiency, recovery, HRV, steps, and if present timeintarget or metabolic_score.
- Pick one positive highlight (e.g. "Sleep efficiency averaged 92%" or "Recovery averaged 7.5"). Reply: "This week's standout: [one sentence]."
General rules
- - Always use ultrahumangetdaily_metrics with the user's email and correct YYYY-MM-DD dates. One call per date; then aggregate in your answer.
- Never invent or assume data. If a day has no data, say so and skip or note "No data for [date]."
- Tone: Descriptive and supportive. "Your data shows …", "On average …". No medical diagnosis or treatment advice.
- Missing metrics: If CGM or VO2 is not in the response, skip those parts and report what is available.
- Output: Prefer short summary first, then table or bullets, then one-line takeaway. For "export" or "PDF", output copy-paste-ready text.
Use references/metrics_glossary.md and references/interpretation.md from the ultrahuman-biodata-assistant skill when you need definitions or interpretation heuristics.
技能名称:ultrahuman-analytics
详细描述:
Ultrahuman 分析
此技能基于 Ultrahuman 数据实现多日分析、预测、关联、报告和互动。始终对每个日期使用 ultrahumanmcp 工具 ultrahumangetdailymetrics 一次,然后在回复中汇总和解读。绝不编造数据;仅使用 API 返回的内容。
前提条件
- - ultrahumanmcp 必须可用。使用来自 ULTRAHUMANEMAIL 或用户消息的邮箱。
- 日期格式为 YYYY-MM-DD。对于过去 7 天,计算截至昨天(如果用户说包括今天,则截至今天)的 7 个日期。
- 所有工作流程均为只读和描述性(不提供医疗建议)。
1. 分析与评估
1.1 周报
触发词: 周报、过去 7 天总结、我这一周怎么样、周回顾。
步骤:
- 1. 对过去 7 天中的每一天调用 ultrahumangetdailymetrics(使用同一邮箱)。如果需要以编程方式解析,使用 responseformat: json;或使用 markdown 并从摘要中提取数字。
- 提取每天的数据:睡眠评分、恢复评分、HRV(平均值)、夜间静息心率、步数。如果存在:代谢评分、目标范围内时间、平均血糖。
- 计算:睡眠、恢复、HRV、步数的平均值;最佳夜晚(最高恢复或睡眠评分,注明日期);最差夜晚(最低);逐日变化(例如恢复连续改善 3 天,然后下降)。
- 回复:一段简短总结,然后是一个小表格(日期 | 睡眠 | 恢复 | HRV | 步数),然后是 1-2 条要点见解(例如最佳夜晚:周三(恢复 8)。恢复趋势:到周中持续改善。)。
1.2 睡眠一致性评分
触发词: 睡眠一致性、我的睡眠有多一致、睡眠变异性。
步骤:
- 1. 通过 ultrahumangetdailymetrics 获取过去 7-14 天的数据(每天一次调用)。
- 从每天的睡眠对象中获取:总睡眠时间(来自 quickmetrics)、睡眠效率,以及如果可用的话,就寝时间(来自 details)。计算总睡眠时间和效率的标准差或范围。
- 得出一个简单的一致性陈述:例如你非常一致(大多数夜晚睡眠时间在 30 分钟内,效率在 5% 以内)或本周睡眠时长变化约 1 小时——考虑更一致的就寝时间。
- 不需要正式评分;描述性总结就足够了。
1.3 恢复趋势
触发词: 恢复趋势、本周恢复情况、我的恢复趋势如何、过去 14 天的恢复。
步骤:
- 1. 获取 7 或 14 天的数据(每天一次调用)。
- 提取每天的数据:恢复评分或 recoveryindex、HRV 平均值、nightrhr 平均值。
- 构建一个表格:日期 | 恢复 | HRV | 夜间静息心率。添加一行趋势说明:改善、下降、稳定或恢复在周中下降然后回升。
- 如果恢复连续下降 3 天或以上,添加一条简短说明:考虑轻松日或更多睡眠(仅描述性)。
1.4 代谢周报
触发词: 代谢周报、本周血糖、过去 7 天的目标范围内时间、代谢总结。
步骤:
- 1. 获取过去 7 天的数据。
- 从每天获取:代谢评分、目标范围内时间、平均血糖、血糖变异性(如果存在)。如果某天没有 CGM 数据,注明[日期] 无 CGM 数据。
- 计算存在指标的平均值。如果用户要求与上周对比,则可选地与前 7 天进行比较(然后获取 14 天数据并拆分)。
- 回复:代谢周报:平均目标范围内时间 X%,平均血糖 Y mg/dL,变异性 Z%。[如果要求与上周对比,添加一行比较。]
1.5 VO2 与活动趋势
触发词: VO2 趋势、本周活动、活动趋势、步数和 VO2。
步骤:
- 1. 获取过去 7 天的数据。
- 提取:步数(平均值)、活动指数、每日可用的最大摄氧量。
- 步数和活动指数的周平均值;如果存在最大摄氧量,注明趋势(上升/稳定/下降)或最新值。
- 一句话:活动趋势:[上升/稳定/下降]。周平均步数:X。活动指数平均值:Y。
1.6 深度/快速眼动睡眠平衡
触发词: 深度睡眠、快速眼动睡眠、睡眠阶段、深度与快速眼动睡眠对比。
步骤:
- 1. 获取过去 7 天(或用户指定的 N 天)的数据。
- 从每天的睡眠 details.sleep_stages 中获取:深度睡眠百分比、浅睡眠百分比、快速眼动睡眠百分比、清醒百分比。
- 计算该期间的平均深度睡眠百分比和平均快速眼动睡眠百分比。注意其中一个是否持续偏低(例如快速眼动睡眠平均为 12%——一些研究认为较高的快速眼动睡眠与记忆和情绪有关;考虑睡眠一致性。)。仅描述性,不提供诊断。
2. 预测与准备状态
2.1 明日准备状态
触发词: 明日准备状态、我明天准备好了吗、我为明天准备好了吗。
步骤:
- 1. 使用 ultrahumangetdaily_metrics 获取昨晚(或最近一晚)的数据。
- 读取:睡眠评分、恢复评分、HRV。
- 启发式(仅描述性):当恢复高于 7 且睡眠高于 6 时,你的数据通常支持一个良好的第二天。你昨晚:恢复 X,睡眠 Y——[因此你的数据表明准备状态良好/建议今天注意休息]。
- 不承诺结果;仅描述数据通常表明什么。
2.2 训练负荷检查
触发词: 我昨天训练很辛苦、训练负荷、我从锻炼中恢复了吗、昨天高强度训练。
步骤:
- 1. 获取昨天和可选地今天(或包括训练日在内的 2-3 天)的数据。
- 将训练日之后晚上的恢复、睡眠、HRV 与用户近期的基线(例如 7 天平均值)进行比较。如果还没有基线,仅使用同一晚的值。
- 回复:在你的训练日之后,昨晚的恢复是 [X]。[与你近期的平均值相比,这是典型的/低于你的平均值——你的身体可能需要更多恢复才能进行下一次高强度训练。] 仅描述性。
2.3 低恢复警报
触发词: 低恢复、恢复警报、我是否过度训练、恢复下滑。
步骤:
- 1. 获取过去 7 天的数据。
- 计算 7 天平均恢复(或 recovery_index)。统计最近 3 晚中有多少晚低于该平均值。
- 如果最近 3 晚中有 2 或 3 晚低于平均值:最近 3 晚你的恢复低于你的 7 天平均值——考虑轻松日或更多睡眠。
- 如果不是,简要总结:你最近 3 晚与你的周平均值持平或更高。
2.4 血糖峰值风险(模式)
触发词: 血糖与睡眠、睡眠是否影响我的血糖、血糖峰值风险。
步骤:
- 1. 获取过去 7-14 天的数据。
- 对于每天:总睡眠时间(来自睡眠详情)或睡眠评分,以及血糖变异性或平均血糖(如果存在 CGM 数据)。
- 将天数分为较短睡眠(例如 <6 小时或睡眠评分 <5)和较长睡眠。计算每组的平均血糖变异性(或平均血糖)。
- 一句话模式:在你睡眠不足 6 小时的日子里,你的血糖变异性平均为 X%,而在睡眠较长的日子里为 Y%。 不说明因果关系;仅作为观察到的模式呈现。
3. 关联与见解
3.1 睡眠-血糖关联
触发词: 睡眠与血糖、睡眠血糖关联、睡眠如何影响我的血糖。
步骤:
- 1. 获取 7-14 天的数据。
- 对于每天:总睡眠时间或睡眠评分;目标范围内时间和/或平均血糖。
- 将天数分组,例如7 小时以上睡眠与