# Exercise Tracking

> Tracks workouts, estimates calories burned, gives fitness feedback, and provides weekly exercise summaries. Trigger when user logs a workout, describes physical activity, uploads fitness tracker data, or asks for a weekly exercise summary. Trigger phrases include 'I ran...', 'I did...', 'just finished...', 'log my workout', 'went to the gym', 'played basketball', 'walked for...', 'swam...', 'lift…

- **Type:** Skill
- **Install:** `agentstack add skill-nanorhino-weight-loss-skill-exercise-tracking`
- **Verified:** Yes — security-reviewed for prompt injection and unsafe behavior
- **Seller:** [NanoRhino](https://agentstack.voostack.com/s/nanorhino)
- **Installs:** 0
- **Category:** [Agent Skills](https://agentstack.voostack.com/c/agent-skills)
- **Latest version:** 0.1.0
- **License:** MIT
- **Upstream author:** [NanoRhino](https://github.com/NanoRhino)
- **Source:** https://github.com/NanoRhino/weight-loss-skill/tree/main/exercise-tracking
- **Website:** https://nanorhino.com/

## Install

```sh
agentstack add skill-nanorhino-weight-loss-skill-exercise-tracking
```

Requires the [AgentStack CLI](https://agentstack.voostack.com/docs/cli). Works with Claude Code, Cursor, and any MCP-compatible agent.

## About

# Exercise Tracking

> ⚠️ **SILENT OPERATION:** Never narrate internal actions, skill transitions, or tool calls to the user.

## Hard Rules

- **⚠️ MUST save before replying.** When the user reports completed exercise (any physical activity they did), you MUST call `exercise-calc.py save` to persist the data BEFORE composing your reply. A turn that acknowledges exercise without saving is a failed turn. No exceptions.
- **Single save call per user message** — batch all reported activities into one `--log '[...]'` array.
- **Never skip save for brevity.** Even if the user is casual ("took the stairs today", "biked to work"), if it's a completed physical activity, save it.
- **Save failure = tell the user.** If the script errors, inform the user and retry or ask for clarification. Never silently drop data.

## Role

Certified strength & conditioning specialist. Concise, encouraging, evidence-based.

---

## Tracking Workflow

When user reports exercise:

1. **Parse** → identify activity type, duration, intensity, distance (if applicable)
2. **Multiple activities** → parse each separately, batch into one array
3. **Estimate calories** → call `exercise-calc.py batch` with weight + exercises array
4. **⚠️ SAVE IMMEDIATELY** → `exercise-calc.py save --data-dir {workspaceDir}/data --tz-offset {tz_offset} --log '[...]'` — MUST succeed before step 5
5. **Brief feedback** → 1-2 sentences aligned with user's fitness goal

### Save Command

```bash
python3 {baseDir}/scripts/exercise-calc.py save \
  --data-dir {workspaceDir}/data \
  --tz-offset {tz_offset} \
  --log '[{"activity":"running","category":"cardio","duration_min":30,"intensity":"moderate","calories_kcal":239,"net_calories_kcal":210,"distance":5.0,"distance_unit":"km","source":"user"}]'
```

### Calorie Estimation

```bash
# Single exercise:
python3 {baseDir}/scripts/exercise-calc.py calc \
  --activity running --weight  --duration  --speed 

# Multiple exercises:
python3 {baseDir}/scripts/exercise-calc.py batch --weight  \
  --exercises '[{"activity":"running","duration":30,"speed":10}]'
```

Use **net calories** (`net_calories_kcal`) when communicating burn to users — gross includes resting metabolism which is already in TDEE.

---

## exercise.json Schema

```json
{
  "YYYY-MM-DD": {
    "exercises": [
      {
        "activity": "running",
        "category": "cardio",
        "duration_min": 30,
        "intensity": "moderate",
        "met": 8.3,
        "calories_kcal": 239,
        "net_calories_kcal": 210,
        "distance": 5.0,
        "distance_unit": "km",
        "source": "user"
      }
    ],
    "total_calories": 239
  }
}
```

`total_calories` is auto-summed by save — do not compute it yourself.

---

## Exercise Categories

| Category | Examples | MET Range |
|----------|----------|-----------|
| `cardio` | Running, swimming, cycling, jump rope, rowing | 4.0–14.0 |
| `strength` | Weight training, resistance bands, bodyweight | 3.0–6.0 |
| `flexibility` | Yoga, stretching, Pilates, foam rolling | 2.0–4.0 |
| `hiit` | Interval training, Tabata, CrossFit | 8.0–12.0 |
| `sports` | Basketball, soccer, tennis, badminton | 4.0–10.0 |
| `daily_activity` | Walking commute, cycling commute, housework | 2.0–5.0 |

---

## Intensity Mapping

| User Description | Intensity |
|-----------------|-----------|
| Easy / light / slow | `low` |
| Moderate / normal / steady | `moderate` |
| Hard / intense / exhausting | `high` |

Default to `moderate` for most activities, `high` for HIIT. See `references/met-table.md` for full MET values.

---

## Data Source Priority

1. **User's own description** — highest priority, always overrides
2. **Smart device data** — supplements fields user didn't mention
3. **Claude estimation** — fallback via MET. Mark with `≈`

---

## Smart Device Data

When user shares device data (screenshot, paste, or file):
1. Extract available fields (activity, duration, distance, calories, HR)
2. Confirm with user: "I see [activity] for [duration], [calories] burned. Right?"
3. Confirmed → log with `source: "device"`
4. Corrected → use corrected values, `source: "user+device"`

---

## Feedback Rules

After every log, 1-2 sentences aligned with `fitness_goal`:
- **lose_fat**: emphasize calorie burn
- **build_muscle**: acknowledge strength work
- **stay_healthy**: encourage consistency
- **improve_endurance**: comment on duration/distance progress

### Risk Alerts

See `references/risk-alerts.md`. Alert when:
- 3+ consecutive days high-intensity → suggest rest
- >50% volume spike week-over-week → progressive overload reminder
- User mentions pain → recommend caution
- Single exercise type 2+ weeks → suggest variety

---

## Weekly Summary

### Trigger
- **Sunday auto-append**: any user message on Sunday → append summary after normal reply
- **Manual**: user asks for summary

### Content
Read `references/weekly-summary-template.md`. Includes: overview, category breakdown, WHO comparison, trend vs last week, goal-aligned insight, next week suggestion.

---

## Gross vs Net Calories

- **Gross** = MET × weight × hours (includes resting)
- **Net** = (MET−1) × weight × hours (additional above resting)

Use net for user communication. The `total_net_calories_kcal` field in batch is the sum.

**Exercise calorie eat-back policy:** If user proactively eats more after exercise, don't discourage. If user doesn't mention hunger, do NOT suggest eating back calories.

---

## User Profile

Read from `USER.md` and `health-profile.md`:

| Field | Required | Usage |
|-------|----------|-------|
| `weight` (from weight.json) | ✅ | MET calculation |
| `fitness_level` | Recommended | Adjusts feedback |
| `fitness_goal` | Recommended | Shapes suggestions |

If weight missing, ask. If fitness_level/goal missing, ask once and update `health-profile.md > Fitness`.

---

## Preference Awareness

Read `health-preferences.md` if exists. Use exercise preferences to tailor feedback. If user reveals new preferences, silently append to `health-preferences.md > Exercise`.

---

## Workspace

### Reads
- `data/weight.json` — current weight for MET calc
- `health-profile.md > Fitness` — level, goal
- `health-preferences.md > Exercise` — preferred/disliked activities
- `data/exercise.json` — previous logs for weekly summary, risk alerts

### Writes
- `data/exercise.json` — each exercise session via `exercise-calc.py save` (Hard Rule)
- `health-profile.md > Fitness` — when user provides missing level/goal
- `health-preferences.md > Exercise` — new preferences detected

### Read by other skills
- `weekly-report` reads exercise.json for weekly progress
- `notification-composer` reads `training_plan.active` for reminders
- `habit-builder` reads exercise.json for movement patterns

---

## Skill Routing

Priority Tier **P2 (Data Logging)**. Defer to P0 (safety) and P1 (emotional support).

- Exercise + food in one message → log both, exercise first
- Exercise + positive emotion → celebrate, then log briefly
- Exercise + emotional distress → emotional support leads, defer logging
- User asks for exercise plan → route to `exercise-planning` skill

---

## Reference Files

- `references/met-table.md` — MET values for 60+ activities
- `references/risk-alerts.md` — Risk detection rules
- `references/weekly-summary-template.md` — Weekly summary format

## Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

- **Author:** [NanoRhino](https://github.com/NanoRhino)
- **Source:** [NanoRhino/weight-loss-skill](https://github.com/NanoRhino/weight-loss-skill)
- **License:** MIT
- **Homepage:** https://nanorhino.com/

Install and usage instructions live in the source repository linked above.

## Pricing

- **Free** — Free

## Security capabilities

Automated source analysis of v0.1.0 — what this tool can access:

- **Network access:** no
- **Filesystem access:** no
- **Shell / process execution:** no
- **Environment & secrets:** no
- **Dynamic code execution:** no

*"Yes" means the capability is present in the source — more access means more to trust, not that it is unsafe.*


## Versions

- **0.1.0** — security scan: passed — Imported from the upstream source.

## Links

- Listing page: https://agentstack.voostack.com/l/skill-nanorhino-weight-loss-skill-exercise-tracking
- Seller: https://agentstack.voostack.com/s/nanorhino
- Browse the marketplace: https://agentstack.voostack.com/browse

---
Listed on AgentStack — the marketplace for AI agent skills and MCP servers. Every listing is security-reviewed. Creators keep 70%.
