---
name: oura-ring-report
description: Weekly or daily Oura Ring report from AI + Vitals. Fetch the user's Oura summaries with their agent token, write a short analysis, and email it to them. Use when the user's scheduled report task runs or when they ask for their Oura report.
---

# Oura Ring report (AI + Vitals)

The user connected their Oura Ring at https://aiplusvitals.com and gave you a **read-only agent token** (`w2o_` followed by 48 hex characters). With it you can read summaries of *their own* Oura data and ask the service to email them the report you write. You never see Oura credentials.

Treat the token like a password: keep it in the scheduled task's own configuration or prompt only, never print it in full, never send it anywhere except `https://aiplusvitals.com` (or the older address `https://oura.way2ai.sg`, which serves the same API).

## 1. Set up the schedule (first time only)

Create a recurring task with the tool your environment provides. Default: **every Monday 09:00 in the user's time zone**; daily if the user asked for it (use `"kind": "daily"` then). Each run follows steps 2 to 4. Then run once immediately.

- **Claude Code**: use its scheduled tasks / routines (for example the `/schedule` command). If the task runs in a cloud environment with restricted network access, make sure `aiplusvitals.com` is allowed.
- **Codex CLI or any shell agent**: add a cron (Linux) or launchd (macOS) job that runs your agent non-interactively with these instructions, for example `codex exec "Follow https://aiplusvitals.com/skill.md: fetch, analyse and send my Oura report. Token: ..."`. Store the token in a file readable only by the user (`chmod 600`) rather than in the crontab line if you can.
- **ChatGPT**: its scheduled tasks cannot call authenticated APIs. Tell the user and stop.

## 2. Fetch the data

```bash
curl -sS https://aiplusvitals.com/api/agent/weekly -H "Authorization: Bearer $TOKEN"
```

Response:

- `today`: today's date (Singapore).
- `first_name`: the user's first name, or null.
- `language`: `{code, name}`, the report language the user set on the dashboard (for example `{"code":"zh-Hant","name":"繁體中文"}`). **Write every string you send in this language**, whatever language the user's message or your task prompt is in. The email template uses the same language, so mixing languages makes the email look broken.
- `week`: the last 7 complete days (`from` to `to`) against the 28 days before. `sleepScore`, `readiness`, `activityScore`, `hrv` (ms), `restingHr` (bpm), `sleepHours`, `deepPct`, `steps`, `bedtime` and `wake` (hours from midnight: -0.5 = 23:30, 8.75 = 08:45) are each `{week, base}`. Also `bedtimeSpread` (hours, standard deviation), `workouts`, `lateNaps`, `feverDays`, `nights`, `improved` (metrics clearly better than baseline), `daily` (the 14 days in the email charts) and `tips` (simple rule-based hints, for reference only).
- `days`: the last 35 days, one row per day (`sleep_score`, `readiness_score`, `activity_score`, `steps`, `total_sleep_hours`, `hrv`, `resting_hr`, `temp_deviation`); `null` where the ring recorded nothing.

## 3. Write the analysis

The email already shows score cards, 14-day trend charts and a metric table, so your text must be **short**: only what matters. Write in `language.name` from step 2. Every string at most 120 characters, one sentence, with a number in it.

- `headline`: one sentence, the single most important thing about the period.
- `concerns` (0 to 3): health signals worth attention: short sleep, late or irregular bedtime, HRV well below baseline, temperature above +0.5 °C, days with no data, almost no activity. Name the day and value.
- `improvements` (0 to 3): what got clearly better than the 4 weeks before (the API's `week.improved` lists candidates).
- `actions` (1 to 3): concrete next steps (a time, a step count, sessions per week), built on the user's current routine.

No filler, no repetition of the numbers already in the table unless they make the point. Never diagnose or name a disease or condition; if something looks unusual, suggest seeing a doctor. For a daily report, focus on the latest day against the recent trend.

## 4. Send it

```bash
curl -sS https://aiplusvitals.com/api/agent/weekly -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"kind":"weekly","headline":"...","concerns":["..."],"improvements":["..."],"actions":["..."]}'
```

`kind` is `weekly` (default) or `daily`.

**Always also show the report in your reply**, whether or not the email went out.

| Response | Meaning | What to do |
|---|---|---|
| `200 {"ok":true,"emailed":true}` | Emailed | Done |
| `400 bad_analysis` | Wrong JSON shape | Fix it as `expected` says and send again once |
| `401 unauthorized` | Token wrong or revoked | Ask the user to create a new one at https://aiplusvitals.com/dashboard#agent and paste the new message |
| `409 oura_not_connected` | Oura access expired | Ask the user to reconnect Oura at https://aiplusvitals.com/dashboard |
| `429 rate_limited` | One email per 20 hours | Show the report in chat only |
| `502 email_unavailable` / `oura_unavailable` | Email or Oura failed | Show the report in chat (or try again later for Oura) |

Do not retry more than twice. Never invent data the API did not return.
