# Fitness Agent

> Operate the local Fitness Agent CLI for Strava and Obsidian workflows. Use when Codex needs to authenticate with Strava, list or fetch Strava activities, export workout data as Obsidian-compatible Markdown, configure a local Obsidian vault path, or write/sync workout notes into a vault from the local fitness-agent project.

- Skill: `zxt6991-source/fitness-agent` (Agent Skill, multi-file: 12 files)
- Install (CLI): `npx skillmds@latest add zxt6991-source/fitness-agent`
- Raw SKILL.md: https://api.skillmd.com/api/skills/zxt6991-source/fitness-agent/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: AI & ML
- Author: zxt6991-source (https://skillmd.com/u/zxt6991-source)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/zxt6991-source/fitness-agent

---


# Fitness Agent

Use the bundled wrapper script to run the local CLI:

```bash
scripts/run_fitness_agent.sh --help
```

The skill is self-contained. The wrapper resolves the skill root relative to its own location, so it works after cloning the repository or after copying the skill directory into a local skills folder.

## Workflow

1. Authenticate first if no Strava token is configured.
2. Configure the Obsidian vault path before attempting vault writes or syncs.
3. List activities to identify target activity ids when the user does not provide one.
4. Export Markdown when the user wants reviewable output.
5. Use `sync latest` when the user wants the full Obsidian analysis surface, because it writes activity notes plus dashboard and weekly/monthly reports.
6. Write or sync into the vault only after confirming the destination path is configured.

Prefer the CLI defaults unless the user asks otherwise. Do not add `--overwrite` unless the user explicitly wants to replace an existing file or note.

## Commands

Authenticate with Strava:

```bash
scripts/run_fitness_agent.sh auth login \
  --client-id YOUR_CLIENT_ID \
  --client-secret YOUR_CLIENT_SECRET
```

Configure the default Obsidian vault:

```bash
scripts/run_fitness_agent.sh config set-vault \
  --vault-path "/path/to/YourVault" \
  --default-folder "Fitness/Strava"
```

List recent activities:

```bash
scripts/run_fitness_agent.sh activities list --limit 5
```

Export one activity as Obsidian Markdown:

```bash
scripts/run_fitness_agent.sh activities export --activity-id 123456789
```

Write one activity into the configured vault:

```bash
scripts/run_fitness_agent.sh vault write --activity-id 123456789
```

Sync the latest activities into the configured vault:

```bash
scripts/run_fitness_agent.sh sync latest --limit 3
```

This sync now writes:

- activity notes under `Activities/YYYY/MM/`
- `Dashboard/Fitness Dashboard.base`
- `Dashboard/Fitness Dashboard.md`
- weekly reports under `Reports/Weekly/`
- monthly reports under `Reports/Monthly/`

## Guardrails

- Surface the exact note path after successful vault writes or syncs.
- Stop and report the CLI error if Strava auth, token refresh, network access, or vault path validation fails.
- Treat `~/.fitness-agent/config.json` as the default local config unless the user provides `--config-path`.
- Use `activities export` before vault writes when the user wants to inspect or revise the generated Markdown first.
- Mention that the OAuth callback defaults to `http://localhost:33371/callback` when the user asks how auth works.
- Explain that single-activity exports include streams when available, while `sync latest` also backfills affected week/month context to keep reports complete.

## Trigger Examples

- `$fitness-agent 帮我登录 Strava 并配置我的 Obsidian vault`
- `$fitness-agent 列出最近 10 条 Strava 活动`
- `$fitness-agent 把活动 123456789 导出成 Obsidian Markdown`
- `$fitness-agent 把最近 3 条 Strava 活动同步到我的 vault`

## Resources

- `fitness_agent.py`: Self-contained CLI entrypoint packaged with the skill.
- `src/fitness_agent/`: Python implementation for Strava auth, activity fetch, Markdown rendering, and vault writes.
- `scripts/run_fitness_agent.sh`: Stable wrapper that dispatches to the packaged CLI.

